From d3d35436e7c999477f431e0ae29835e5bf559f0a Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 6 Dec 2024 14:20:05 +0530 Subject: [PATCH 001/160] chore: source version map to include v2 but safely --- src/controllers/util/index.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/controllers/util/index.ts b/src/controllers/util/index.ts index ab2a0f5dc3a..b011540fb75 100644 --- a/src/controllers/util/index.ts +++ b/src/controllers/util/index.ts @@ -15,6 +15,7 @@ import { getValueFromMessage } from '../../v0/util'; import genericFieldMap from '../../v0/util/data/GenericFieldMapping.json'; import { EventType, MappedToDestinationKey } from '../../constants'; import { versionConversionFactory } from './versionConversion'; +import defaultFeaturesConfig from '../../features'; export class ControllerUtility { private static sourceVersionMap: Map = new Map(); @@ -29,15 +30,29 @@ export class ControllerUtility { [EventType.TRACK]: [`properties.${RETL_TIMESTAMP}`, ...genericFieldMap.timestamp], }; + private static getSourceDirPath(version: string): string { + if (version === 'v2') { + return path.resolve(__dirname, `../../sources`); + } + return path.resolve(__dirname, `../../${version}/sources`); + } + private static getSourceVersionsMap(): Map { if (this.sourceVersionMap?.size > 0) { return this.sourceVersionMap; } + const versions = ['v0', 'v1']; + if (defaultFeaturesConfig.upgradedToSourceTransformV2) { + // this makes it easy to revert to v0,v1 spec if something doesn't work out using ENV variables + versions.push('v2'); + } + versions.forEach((version) => { - const files = fs.readdirSync(path.resolve(__dirname, `../../${version}/sources`), { + const files = fs.readdirSync(this.getSourceDirPath(version), { withFileTypes: true, }); + const sources = files.filter((file) => file.isDirectory()).map((folder) => folder.name); sources.forEach((source) => { this.sourceVersionMap.set(source, version); From b674611f95ce18656168e0bad0eb0f7111c0fcea Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Sat, 7 Dec 2024 21:15:54 +0530 Subject: [PATCH 002/160] chore: source handler based on version --- src/services/misc.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/misc.ts b/src/services/misc.ts index 334b54ba17b..3efbe617bfa 100644 --- a/src/services/misc.ts +++ b/src/services/misc.ts @@ -14,6 +14,9 @@ export class MiscService { } public static getSourceHandler(source: string, version: string) { + if (version === 'v2') { + return require(`../sources/${source}/transform`); + } return require(`../${version}/sources/${source}/transform`); } From d01f411722229a0a893f782f78c0b864d0ea1989 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 9 Dec 2024 14:17:32 +0530 Subject: [PATCH 003/160] chore: adjust and shopify changes with expanded test cases --- src/sources/adjust/transform.js | 18 + src/sources/shopify/transform.js | 19 + src/v0/sources/adjust/transform.js | 2 +- test/apitests/service.api.test.ts | 44 +- test/integrations/component.test.ts | 8 + test/integrations/sources/adjust/data.ts | 65 +- test/integrations/sources/shopify/data.ts | 1156 +++++++++++---------- 7 files changed, 700 insertions(+), 612 deletions(-) create mode 100644 src/sources/adjust/transform.js create mode 100644 src/sources/shopify/transform.js diff --git a/src/sources/adjust/transform.js b/src/sources/adjust/transform.js new file mode 100644 index 00000000000..42ed933a970 --- /dev/null +++ b/src/sources/adjust/transform.js @@ -0,0 +1,18 @@ +const { processEvent: processV0Event } = require('../../v0/sources/adjust/transform'); +const { CommonUtils } = require('../../util/common'); + +const convertV2ToV0 = (sourceEvent) => { + const v0Event = JSON.parse(sourceEvent.request.body); + if (sourceEvent.request.query_parameters) { + v0Event.query_parameters = sourceEvent.request.query_parameters; + } + return v0Event; +}; + +const process = (requests) => { + const requestsArray = CommonUtils.toArray(requests); + const v0Events = requestsArray.map(convertV2ToV0); + return v0Events.map(processV0Event); +}; + +module.exports = { process }; diff --git a/src/sources/shopify/transform.js b/src/sources/shopify/transform.js new file mode 100644 index 00000000000..1d0d70ca907 --- /dev/null +++ b/src/sources/shopify/transform.js @@ -0,0 +1,19 @@ +const { process: processV1 } = require('../../v1/sources/shopify/transform'); + +const convertV2ToV1 = (inputRequest) => { + const { body: bodyString, query_parameters: qParams } = inputRequest.request; + const requestBody = JSON.parse(bodyString); + + if (qParams) { + requestBody.query_parameters = qParams; + } + + return { + event: requestBody, + source: inputRequest.source, + }; +}; + +const process = async (inputEvent) => processV1(convertV2ToV1(inputEvent)); + +module.exports = { process }; diff --git a/src/v0/sources/adjust/transform.js b/src/v0/sources/adjust/transform.js index f68e87d4764..8769cc310f3 100644 --- a/src/v0/sources/adjust/transform.js +++ b/src/v0/sources/adjust/transform.js @@ -59,4 +59,4 @@ const process = (events) => { return eventsArray.map(processEvent); }; -module.exports = { process }; +module.exports = { process, processEvent }; diff --git a/test/apitests/service.api.test.ts b/test/apitests/service.api.test.ts index 2ad1f323ace..523476017ef 100644 --- a/test/apitests/service.api.test.ts +++ b/test/apitests/service.api.test.ts @@ -543,27 +543,29 @@ describe('Destination api tests', () => { }); describe('Source api tests', () => { - test('(shopify) successful source transform', async () => { - const data = getDataFromPath('./data_scenarios/source/v0/successful.json'); - const response = await request(server) - .post('/v0/sources/shopify') - .set('Accept', 'application/json') - .send(data.input); - const parsedResp = JSON.parse(response.text); - delete parsedResp[0].output.batch[0].anonymousId; - expect(response.status).toEqual(200); - expect(parsedResp).toEqual(data.output); - }); - - test('(shopify) failure source transform (shopify)', async () => { - const data = getDataFromPath('./data_scenarios/source/v0/failure.json'); - const response = await request(server) - .post('/v0/sources/shopify') - .set('Accept', 'application/json') - .send(data.input); - expect(response.status).toEqual(200); - expect(JSON.parse(response.text)).toEqual(data.output); - }); + // Note: v0 is deprecated and v2 to v0 conversion strategy is not implemented. This leads to errors in the below test case + + // test('(shopify) successful source transform', async () => { + // const data = getDataFromPath('./data_scenarios/source/v0/successful.json'); + // const response = await request(server) + // .post('/v0/sources/shopify') + // .set('Accept', 'application/json') + // .send(data.input); + // const parsedResp = JSON.parse(response.text); + // delete parsedResp[0].output.batch[0].anonymousId; + // expect(response.status).toEqual(200); + // expect(parsedResp).toEqual(data.output); + // }); + + // test('(shopify) failure source transform (shopify)', async () => { + // const data = getDataFromPath('./data_scenarios/source/v0/failure.json'); + // const response = await request(server) + // .post('/v0/sources/shopify') + // .set('Accept', 'application/json') + // .send(data.input); + // expect(response.status).toEqual(200); + // expect(JSON.parse(response.text)).toEqual(data.output); + // }); test('(shopify) success source transform (monday)', async () => { const data = getDataFromPath('./data_scenarios/source/v0/response_to_caller.json'); diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index baad6813dfb..9f1bfd238fb 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -24,6 +24,7 @@ import { appendFileSync } from 'fs'; import { assertRouterOutput, responses } from '../testHelper'; import { generateTestReport, initaliseReport } from '../test_reporter/reporter'; import _ from 'lodash'; +import defaultFeaturesConfig from '../../src/features'; // To run single destination test cases // npm run test:ts -- component --destination=adobe_analytics @@ -228,6 +229,7 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { return false; }); } + describe(`${testData[0].name} ${testData[0].module}`, () => { test.each(testData)('$feature -> $description (index: $#)', async (tcData) => { tcData?.mockFns?.(mockAdapter); @@ -237,6 +239,12 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { await destinationTestHandler(tcData); break; case tags.MODULES.SOURCE: + defaultFeaturesConfig.upgradedToSourceTransformV2 = false; + await sourceTestHandler(tcData); + + // run the same tests for sources only with upgradedToSourceTransformV2 flag as true + tcData?.mockFns?.(mockAdapter); + defaultFeaturesConfig.upgradedToSourceTransformV2 = true; await sourceTestHandler(tcData); break; default: diff --git a/test/integrations/sources/adjust/data.ts b/test/integrations/sources/adjust/data.ts index 107bb444c43..bfd61d4ed32 100644 --- a/test/integrations/sources/adjust/data.ts +++ b/test/integrations/sources/adjust/data.ts @@ -10,23 +10,26 @@ export const data = [ name: 'adjust', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - id: 'adjust', - query_parameters: { - gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], - adid: ['18546f6171f67e29d1cb983322ad1329'], - tracker_token: ['abc'], - custom: ['custom'], - tracker_name: ['dummy'], - created_at: ['1404214665'], - event_name: ['Click'], + event: { + id: 'adjust', + query_parameters: { + gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], + adid: ['18546f6171f67e29d1cb983322ad1329'], + tracker_token: ['abc'], + custom: ['custom'], + tracker_name: ['dummy'], + created_at: ['1404214665'], + event_name: ['Click'], + }, + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', }, - updated_at: '2023-02-10T12:16:07.251Z', - created_at: '2023-02-10T12:05:04.402Z', + source: {}, }, ], method: 'POST', @@ -85,15 +88,18 @@ export const data = [ name: 'adjust', description: 'Simple track call with no query parameters', module: 'source', - version: 'v0', + version: 'v1', skipGo: 'FIXME', input: { request: { body: [ { - id: 'adjust', - updated_at: '2023-02-10T12:16:07.251Z', - created_at: '2023-02-10T12:05:04.402Z', + event: { + id: 'adjust', + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', + }, + source: {}, }, ], method: 'POST', @@ -129,24 +135,27 @@ export const data = [ name: 'adjust', description: 'Simple track call with wrong created at', module: 'source', - version: 'v0', + version: 'v1', skipGo: 'FIXME', input: { request: { body: [ { - id: 'adjust', - query_parameters: { - gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], - adid: ['18546f6171f67e29d1cb983322ad1329'], - tracker_token: ['abc'], - custom: ['custom'], - tracker_name: ['dummy'], - created_at: ['test'], - event_name: ['Click'], + event: { + id: 'adjust', + query_parameters: { + gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], + adid: ['18546f6171f67e29d1cb983322ad1329'], + tracker_token: ['abc'], + custom: ['custom'], + tracker_name: ['dummy'], + created_at: ['test'], + event_name: ['Click'], + }, + updated_at: '2023-02-10T12:16:07.251Z', + created_at: 'test', }, - updated_at: '2023-02-10T12:16:07.251Z', - created_at: 'test', + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/shopify/data.ts b/test/integrations/sources/shopify/data.ts index d4498e089c9..fdf20094921 100644 --- a/test/integrations/sources/shopify/data.ts +++ b/test/integrations/sources/shopify/data.ts @@ -11,18 +11,21 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Track Call -> carts_create ', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - id: 'shopify_test3', - query_parameters: { topic: ['carts_create'] }, - token: 'shopify_test3', - line_items: [], - note: null, - updated_at: '2023-02-10T12:16:07.251Z', - created_at: '2023-02-10T12:05:04.402Z', + event: { + id: 'shopify_test3', + query_parameters: { topic: ['carts_create'] }, + token: 'shopify_test3', + line_items: [], + note: null, + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', + }, + source: {}, }, ], method: 'POST', @@ -41,10 +44,14 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'No Query Parameters', module: 'source', - version: 'v0', + version: 'v1', skipGo: 'not possible', input: { - request: { body: [{}], method: 'POST', headers: { 'Content-Type': 'application/json' } }, + request: { + body: [{ event: {}, source: {} }], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, pathSuffix: '', }, output: { @@ -70,11 +77,16 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Invalid topic', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ - { query_parameters: { signature: ['rudderstack'], writeKey: ['sample-write-key'] } }, + { + event: { + query_parameters: { signature: ['rudderstack'], writeKey: ['sample-write-key'] }, + }, + source: {}, + }, ], method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -104,17 +116,20 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Topic Not found', module: 'source', - version: 'v0', + version: 'v1', skipGo: 'not possible', input: { request: { body: [ { - query_parameters: { - topic: [], - signature: ['rudderstack'], - writeKey: ['sample-write-key'], + event: { + query_parameters: { + topic: [], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, }, + source: {}, }, ], method: 'POST', @@ -145,16 +160,19 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Unsupported Event Type', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['random_event'], - signature: ['rudderstack'], - writeKey: ['sample-write-key'], + event: { + query_parameters: { + topic: ['random_event'], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, }, + source: {}, }, ], method: 'POST', @@ -173,37 +191,68 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Identify Call for customers create event', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['customers_create'], - signature: ['rudderstack'], - writeKey: ['sample-write-key'], - }, - id: 5747017285820, - email: 'anuraj@rudderstack.com', - accepts_marketing: false, - created_at: '2021-12-29T15:15:19+05:30', - updated_at: '2021-12-29T15:15:20+05:30', - first_name: 'Anuraj', - last_name: 'Guha', - orders_count: 0, - state: 'disabled', - total_spent: '0.00', - last_order_id: null, - note: '', - verified_email: true, - multipass_identifier: null, - tax_exempt: false, - phone: '+919876543210', - tags: '', - last_order_name: null, - currency: 'INR', - addresses: [ - { + event: { + query_parameters: { + topic: ['customers_create'], + signature: ['rudderstack'], + writeKey: ['sample-write-key'], + }, + id: 5747017285820, + email: 'anuraj@rudderstack.com', + accepts_marketing: false, + created_at: '2021-12-29T15:15:19+05:30', + updated_at: '2021-12-29T15:15:20+05:30', + first_name: 'Anuraj', + last_name: 'Guha', + orders_count: 0, + state: 'disabled', + total_spent: '0.00', + last_order_id: null, + note: '', + verified_email: true, + multipass_identifier: null, + tax_exempt: false, + phone: '+919876543210', + tags: '', + last_order_name: null, + currency: 'INR', + addresses: [ + { + id: 6947581821116, + customer_id: 5747017285820, + first_name: 'Anuraj', + last_name: 'Guha', + company: 'Rudderstack', + address1: 'Home', + address2: 'Apartment', + city: 'Kolkata', + province: 'West Bengal', + country: 'India', + zip: '708091', + phone: '+919876543210', + name: 'Anuraj Guha', + province_code: 'WB', + country_code: 'IN', + country_name: 'India', + default: true, + }, + ], + accepts_marketing_updated_at: '2021-12-29T15:15:20+05:30', + marketing_opt_in_level: null, + tax_exemptions: [], + sms_marketing_consent: { + state: 'not_subscribed', + opt_in_level: 'single_opt_in', + consent_updated_at: null, + consent_collected_from: 'SHOPIFY', + }, + admin_graphql_api_id: 'gid://shopify/Customer/5747017285820', + default_address: { id: 6947581821116, customer_id: 5747017285820, first_name: 'Anuraj', @@ -222,36 +271,8 @@ const serverSideEventsScenarios = [ country_name: 'India', default: true, }, - ], - accepts_marketing_updated_at: '2021-12-29T15:15:20+05:30', - marketing_opt_in_level: null, - tax_exemptions: [], - sms_marketing_consent: { - state: 'not_subscribed', - opt_in_level: 'single_opt_in', - consent_updated_at: null, - consent_collected_from: 'SHOPIFY', - }, - admin_graphql_api_id: 'gid://shopify/Customer/5747017285820', - default_address: { - id: 6947581821116, - customer_id: 5747017285820, - first_name: 'Anuraj', - last_name: 'Guha', - company: 'Rudderstack', - address1: 'Home', - address2: 'Apartment', - city: 'Kolkata', - province: 'West Bengal', - country: 'India', - zip: '708091', - phone: '+919876543210', - name: 'Anuraj Guha', - province_code: 'WB', - country_code: 'IN', - country_name: 'India', - default: true, }, + source: {}, }, ], method: 'POST', @@ -352,40 +373,44 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Unsupported checkout event', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['checkout_delete'], - writeKey: ['sample-write-key'], - signature: ['rudderstack'], + event: { + query_parameters: { + topic: ['checkout_delete'], + writeKey: ['sample-write-key'], + signature: ['rudderstack'], + }, + admin_graphql_api_id: 'gid://shopify/Fulfillment/4124667937024', + created_at: '2022-01-05T18:13:02+05:30', + destination: null, + id: 4124667937024, + line_items: [], + customer: { email: 'test_person@email.com', first_name: 'Test', last_name: 'Person' }, + billing_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + shipping_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + location_id: 66855371008, + name: '#1002.1', + order_id: 4617255092480, + origin_address: null, + receipt: {}, + service: 'manual', + shipment_status: null, + status: 'success', + tracking_company: 'Amazon Logistics UK', + tracking_number: 'Sample001test', + tracking_numbers: ['Sample001test'], + tracking_url: + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + tracking_urls: [ + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + ], + updated_at: '2022-01-05T18:16:48+05:30', }, - admin_graphql_api_id: 'gid://shopify/Fulfillment/4124667937024', - created_at: '2022-01-05T18:13:02+05:30', - destination: null, - id: 4124667937024, - line_items: [], - customer: { email: 'test_person@email.com', first_name: 'Test', last_name: 'Person' }, - billing_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, - shipping_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, - location_id: 66855371008, - name: '#1002.1', - order_id: 4617255092480, - origin_address: null, - receipt: {}, - service: 'manual', - shipment_status: null, - status: 'success', - tracking_company: 'Amazon Logistics UK', - tracking_number: 'Sample001test', - tracking_numbers: ['Sample001test'], - tracking_url: 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', - tracking_urls: [ - 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', - ], - updated_at: '2022-01-05T18:16:48+05:30', + source: {}, }, ], method: 'POST', @@ -404,97 +429,101 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Track Call -> Fullfillments updated event', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['fulfillments_update'], - writeKey: ['sample-write-key'], - signature: ['rudderstack'], - }, - shipping_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, - billing_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, - admin_graphql_api_id: 'gid://shopify/Fulfillment/4124667937024', - created_at: '2022-01-05T18:13:02+05:30', - destination: null, - email: 'test_person@email.com', - id: 4124667937024, - line_items: [ - { - admin_graphql_api_id: 'gid://shopify/LineItem/11896203149568', - discount_allocations: [], - duties: [], - fulfillable_quantity: 0, - fulfillment_service: 'manual', - fulfillment_status: 'fulfilled', - gift_card: false, - grams: 0, - id: 11896203149568, - name: 'p1', - origin_location: { - address1: '74 CC/7, Anupama Housing Estate - II', - address2: '', - city: 'Kolkatta', - country_code: 'IN', - id: 3373642219776, - name: '74 CC/7, Anupama Housing Estate - II', - province_code: 'WB', - zip: '700052', - }, - price: '5000.00', - price_set: { - presentment_money: { amount: '5000.00', currency_code: 'INR' }, - shop_money: { amount: '5000.00', currency_code: 'INR' }, - }, - product_exists: true, - product_id: 7510929801472, - properties: [], - quantity: 1, - requires_shipping: true, - sku: '15', - tax_lines: [ - { - channel_liable: false, - price: '900.00', - price_set: { - presentment_money: { amount: '900.00', currency_code: 'INR' }, - shop_money: { amount: '900.00', currency_code: 'INR' }, + event: { + query_parameters: { + topic: ['fulfillments_update'], + writeKey: ['sample-write-key'], + signature: ['rudderstack'], + }, + shipping_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + billing_address: { address1: '11 Rani Sankari Lane Patuapara Bhowanipore' }, + admin_graphql_api_id: 'gid://shopify/Fulfillment/4124667937024', + created_at: '2022-01-05T18:13:02+05:30', + destination: null, + email: 'test_person@email.com', + id: 4124667937024, + line_items: [ + { + admin_graphql_api_id: 'gid://shopify/LineItem/11896203149568', + discount_allocations: [], + duties: [], + fulfillable_quantity: 0, + fulfillment_service: 'manual', + fulfillment_status: 'fulfilled', + gift_card: false, + grams: 0, + id: 11896203149568, + name: 'p1', + origin_location: { + address1: '74 CC/7, Anupama Housing Estate - II', + address2: '', + city: 'Kolkatta', + country_code: 'IN', + id: 3373642219776, + name: '74 CC/7, Anupama Housing Estate - II', + province_code: 'WB', + zip: '700052', + }, + price: '5000.00', + price_set: { + presentment_money: { amount: '5000.00', currency_code: 'INR' }, + shop_money: { amount: '5000.00', currency_code: 'INR' }, + }, + product_exists: true, + product_id: 7510929801472, + properties: [], + quantity: 1, + requires_shipping: true, + sku: '15', + tax_lines: [ + { + channel_liable: false, + price: '900.00', + price_set: { + presentment_money: { amount: '900.00', currency_code: 'INR' }, + shop_money: { amount: '900.00', currency_code: 'INR' }, + }, + rate: 0.18, + title: 'IGST', }, - rate: 0.18, - title: 'IGST', + ], + taxable: true, + title: 'p1', + total_discount: '0.00', + total_discount_set: { + presentment_money: { amount: '0.00', currency_code: 'INR' }, + shop_money: { amount: '0.00', currency_code: 'INR' }, }, - ], - taxable: true, - title: 'p1', - total_discount: '0.00', - total_discount_set: { - presentment_money: { amount: '0.00', currency_code: 'INR' }, - shop_money: { amount: '0.00', currency_code: 'INR' }, + variant_id: 42211160228096, + variant_inventory_management: 'shopify', + variant_title: '', + vendor: 'rudderstack-store', }, - variant_id: 42211160228096, - variant_inventory_management: 'shopify', - variant_title: '', - vendor: 'rudderstack-store', - }, - ], - location_id: 66855371008, - name: '#1002.1', - order_id: 4617255092480, - origin_address: null, - receipt: {}, - service: 'manual', - shipment_status: null, - status: 'success', - tracking_company: 'Amazon Logistics UK', - tracking_number: 'Sample001test', - tracking_numbers: ['Sample001test'], - tracking_url: 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', - tracking_urls: [ - 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', - ], - updated_at: '2022-01-05T18:16:48+05:30', + ], + location_id: 66855371008, + name: '#1002.1', + order_id: 4617255092480, + origin_address: null, + receipt: {}, + service: 'manual', + shipment_status: null, + status: 'success', + tracking_company: 'Amazon Logistics UK', + tracking_number: 'Sample001test', + tracking_numbers: ['Sample001test'], + tracking_url: + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + tracking_urls: [ + 'https://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201910530', + ], + updated_at: '2022-01-05T18:16:48+05:30', + }, + source: {}, }, ], method: 'POST', @@ -616,407 +645,410 @@ const serverSideEventsScenarios = [ name: 'shopify', description: 'Track Call -> Order Partially Fulfilled event', module: 'source', - version: 'v0', + version: 'v1', input: { request: { body: [ { - query_parameters: { - topic: ['orders_partially_fulfilled'], - writeKey: ['sample-write-key'], - signature: ['rudderstack'], - }, - id: 820982911946154508, - admin_graphql_api_id: 'gid://shopify/Order/820982911946154508', - app_id: null, - browser_ip: null, - buyer_accepts_marketing: true, - cancel_reason: 'customer', - cancelled_at: '2021-12-31T19:00:00-05:00', - cart_token: null, - checkout_id: null, - checkout_token: null, - client_details: null, - closed_at: null, - confirmation_number: null, - confirmed: false, - contact_email: 'jon@example.com', - created_at: '2021-12-31T19:00:00-05:00', - currency: 'USD', - current_subtotal_price: '398.00', - current_subtotal_price_set: { - shop_money: { - amount: '398.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '398.00', - currency_code: 'USD', - }, - }, - current_total_additional_fees_set: null, - current_total_discounts: '0.00', - current_total_discounts_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', - }, - }, - current_total_duties_set: null, - current_total_price: '398.00', - current_total_price_set: { - shop_money: { - amount: '398.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '398.00', - currency_code: 'USD', - }, - }, - current_total_tax: '0.00', - current_total_tax_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', - }, - }, - customer_locale: 'en', - device_id: null, - discount_codes: [], - email: 'jon@example.com', - estimated_taxes: false, - financial_status: 'voided', - fulfillment_status: 'pending', - landing_site: null, - landing_site_ref: null, - location_id: null, - merchant_of_record_app_id: null, - name: '#9999', - note: null, - note_attributes: [], - number: 234, - order_number: 1234, - order_status_url: - 'https://jsmith.myshopify.com/548380009/orders/123456abcd/authenticate?key=abcdefg', - original_total_additional_fees_set: null, - original_total_duties_set: null, - payment_gateway_names: ['visa', 'bogus'], - phone: null, - po_number: null, - presentment_currency: 'USD', - processed_at: '2021-12-31T19:00:00-05:00', - reference: null, - referring_site: null, - source_identifier: null, - source_name: 'web', - source_url: null, - subtotal_price: '388.00', - subtotal_price_set: { - shop_money: { - amount: '388.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '388.00', - currency_code: 'USD', + event: { + query_parameters: { + topic: ['orders_partially_fulfilled'], + writeKey: ['sample-write-key'], + signature: ['rudderstack'], }, - }, - tags: 'tag1, tag2', - tax_exempt: false, - tax_lines: [], - taxes_included: false, - test: true, - token: '123456abcd', - total_discounts: '20.00', - total_discounts_set: { - shop_money: { - amount: '20.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '20.00', - currency_code: 'USD', + id: 820982911946154508, + admin_graphql_api_id: 'gid://shopify/Order/820982911946154508', + app_id: null, + browser_ip: null, + buyer_accepts_marketing: true, + cancel_reason: 'customer', + cancelled_at: '2021-12-31T19:00:00-05:00', + cart_token: null, + checkout_id: null, + checkout_token: null, + client_details: null, + closed_at: null, + confirmation_number: null, + confirmed: false, + contact_email: 'jon@example.com', + created_at: '2021-12-31T19:00:00-05:00', + currency: 'USD', + current_subtotal_price: '398.00', + current_subtotal_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, }, - }, - total_line_items_price: '398.00', - total_line_items_price_set: { - shop_money: { - amount: '398.00', - currency_code: 'USD', + current_total_additional_fees_set: null, + current_total_discounts: '0.00', + current_total_discounts_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '398.00', - currency_code: 'USD', + current_total_duties_set: null, + current_total_price: '398.00', + current_total_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, }, - }, - total_outstanding: '398.00', - total_price: '388.00', - total_price_set: { - shop_money: { - amount: '388.00', - currency_code: 'USD', + current_total_tax: '0.00', + current_total_tax_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '388.00', - currency_code: 'USD', + customer_locale: 'en', + device_id: null, + discount_codes: [], + email: 'jon@example.com', + estimated_taxes: false, + financial_status: 'voided', + fulfillment_status: 'pending', + landing_site: null, + landing_site_ref: null, + location_id: null, + merchant_of_record_app_id: null, + name: '#9999', + note: null, + note_attributes: [], + number: 234, + order_number: 1234, + order_status_url: + 'https://jsmith.myshopify.com/548380009/orders/123456abcd/authenticate?key=abcdefg', + original_total_additional_fees_set: null, + original_total_duties_set: null, + payment_gateway_names: ['visa', 'bogus'], + phone: null, + po_number: null, + presentment_currency: 'USD', + processed_at: '2021-12-31T19:00:00-05:00', + reference: null, + referring_site: null, + source_identifier: null, + source_name: 'web', + source_url: null, + subtotal_price: '388.00', + subtotal_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, }, - }, - total_shipping_price_set: { - shop_money: { - amount: '10.00', - currency_code: 'USD', + tags: 'tag1, tag2', + tax_exempt: false, + tax_lines: [], + taxes_included: false, + test: true, + token: '123456abcd', + total_discounts: '20.00', + total_discounts_set: { + shop_money: { + amount: '20.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '20.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '10.00', - currency_code: 'USD', + total_line_items_price: '398.00', + total_line_items_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, }, - }, - total_tax: '0.00', - total_tax_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', + total_outstanding: '398.00', + total_price: '388.00', + total_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', + total_shipping_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, }, - }, - total_tip_received: '0.00', - total_weight: 0, - updated_at: '2021-12-31T19:00:00-05:00', - user_id: null, - billing_address: { - first_name: 'Steve', - address1: '123 Shipping Street', - phone: '555-555-SHIP', - city: 'Shippington', - zip: '40003', - province: 'Kentucky', - country: 'United States', - last_name: 'Shipper', - address2: null, - company: 'Shipping Company', - latitude: null, - longitude: null, - name: 'Steve Shipper', - country_code: 'US', - province_code: 'KY', - }, - customer: { - id: 115310627314723954, - email: 'john@example.com', - created_at: null, - updated_at: null, - first_name: 'John', - last_name: 'Smith', - state: 'disabled', - note: null, - verified_email: true, - multipass_identifier: null, - tax_exempt: false, - phone: null, - email_marketing_consent: { - state: 'not_subscribed', - opt_in_level: null, - consent_updated_at: null, + total_tax: '0.00', + total_tax_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, - sms_marketing_consent: null, - tags: '', - currency: 'USD', - tax_exemptions: [], - admin_graphql_api_id: 'gid://shopify/Customer/115310627314723954', - default_address: { - id: 715243470612851245, - customer_id: 115310627314723954, - first_name: null, - last_name: null, - company: null, - address1: '123 Elm St.', + total_tip_received: '0.00', + total_weight: 0, + updated_at: '2021-12-31T19:00:00-05:00', + user_id: null, + billing_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', address2: null, - city: 'Ottawa', - province: 'Ontario', - country: 'Canada', - zip: 'K2H7A8', - phone: '123-123-1234', - name: '', - province_code: 'ON', - country_code: 'CA', - country_name: 'Canada', - default: true, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', }, - }, - discount_applications: [], - fulfillments: [], - line_items: [ - { - id: 866550311766439020, - admin_graphql_api_id: 'gid://shopify/LineItem/866550311766439020', - attributed_staffs: [ - { - id: 'gid://shopify/StaffMember/902541635', - quantity: 1, - }, - ], - current_quantity: 1, - fulfillable_quantity: 1, - fulfillment_service: 'manual', - fulfillment_status: null, - gift_card: false, - grams: 567, - name: 'IPod Nano - 8GB', - price: '199.00', - price_set: { - shop_money: { - amount: '199.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '199.00', - currency_code: 'USD', - }, + customer: { + id: 115310627314723954, + email: 'john@example.com', + created_at: null, + updated_at: null, + first_name: 'John', + last_name: 'Smith', + state: 'disabled', + note: null, + verified_email: true, + multipass_identifier: null, + tax_exempt: false, + phone: null, + email_marketing_consent: { + state: 'not_subscribed', + opt_in_level: null, + consent_updated_at: null, }, - product_exists: true, - product_id: 632910392, - properties: [], - quantity: 1, - requires_shipping: true, - sku: 'IPOD2008PINK', - taxable: true, - title: 'IPod Nano - 8GB', - total_discount: '0.00', - total_discount_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', - }, + sms_marketing_consent: null, + tags: '', + currency: 'USD', + tax_exemptions: [], + admin_graphql_api_id: 'gid://shopify/Customer/115310627314723954', + default_address: { + id: 715243470612851245, + customer_id: 115310627314723954, + first_name: null, + last_name: null, + company: null, + address1: '123 Elm St.', + address2: null, + city: 'Ottawa', + province: 'Ontario', + country: 'Canada', + zip: 'K2H7A8', + phone: '123-123-1234', + name: '', + province_code: 'ON', + country_code: 'CA', + country_name: 'Canada', + default: true, }, - variant_id: 808950810, - variant_inventory_management: 'shopify', - variant_title: null, - vendor: null, - tax_lines: [], - duties: [], - discount_allocations: [], }, - { - id: 141249953214522974, - admin_graphql_api_id: 'gid://shopify/LineItem/141249953214522974', - attributed_staffs: [], - current_quantity: 1, - fulfillable_quantity: 1, - fulfillment_service: 'manual', - fulfillment_status: null, - gift_card: false, - grams: 567, - name: 'IPod Nano - 8GB', - price: '199.00', - price_set: { - shop_money: { - amount: '199.00', - currency_code: 'USD', + discount_applications: [], + fulfillments: [], + line_items: [ + { + id: 866550311766439020, + admin_graphql_api_id: 'gid://shopify/LineItem/866550311766439020', + attributed_staffs: [ + { + id: 'gid://shopify/StaffMember/902541635', + quantity: 1, + }, + ], + current_quantity: 1, + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '199.00', - currency_code: 'USD', + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], }, - product_exists: true, - product_id: 632910392, - properties: [], - quantity: 1, - requires_shipping: true, - sku: 'IPOD2008PINK', - taxable: true, - title: 'IPod Nano - 8GB', - total_discount: '0.00', - total_discount_set: { - shop_money: { - amount: '0.00', - currency_code: 'USD', + { + id: 141249953214522974, + admin_graphql_api_id: 'gid://shopify/LineItem/141249953214522974', + attributed_staffs: [], + current_quantity: 1, + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '0.00', - currency_code: 'USD', + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], }, - variant_id: 808950810, - variant_inventory_management: 'shopify', - variant_title: null, - vendor: null, - tax_lines: [], - duties: [], - discount_allocations: [], + ], + payment_terms: null, + refunds: [], + shipping_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', + address2: null, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', }, - ], - payment_terms: null, - refunds: [], - shipping_address: { - first_name: 'Steve', - address1: '123 Shipping Street', - phone: '555-555-SHIP', - city: 'Shippington', - zip: '40003', - province: 'Kentucky', - country: 'United States', - last_name: 'Shipper', - address2: null, - company: 'Shipping Company', - latitude: null, - longitude: null, - name: 'Steve Shipper', - country_code: 'US', - province_code: 'KY', - }, - shipping_lines: [ - { - id: 271878346596884015, - carrier_identifier: null, - code: null, - discounted_price: '10.00', - discounted_price_set: { - shop_money: { - amount: '10.00', - currency_code: 'USD', - }, - presentment_money: { - amount: '10.00', - currency_code: 'USD', - }, - }, - is_removed: false, - phone: null, - price: '10.00', - price_set: { - shop_money: { - amount: '10.00', - currency_code: 'USD', + shipping_lines: [ + { + id: 271878346596884015, + carrier_identifier: null, + code: null, + discounted_price: '10.00', + discounted_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, }, - presentment_money: { - amount: '10.00', - currency_code: 'USD', + is_removed: false, + phone: null, + price: '10.00', + price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, }, + requested_fulfillment_service_id: null, + source: 'shopify', + title: 'Generic Shipping', + tax_lines: [], + discount_allocations: [], }, - requested_fulfillment_service_id: null, - source: 'shopify', - title: 'Generic Shipping', - tax_lines: [], - discount_allocations: [], - }, - ], + ], + }, + source: {}, }, ], method: 'POST', From a8e7a40d94a59b8e4ecc3bbcb6b677f938aedfbd Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Thu, 12 Dec 2024 13:08:40 +0530 Subject: [PATCH 004/160] chore: test cases cover v2 spec respecting code coverage --- test/apitests/service.api.test.ts | 24 ---------- test/integrations/component.test.ts | 71 +++++++++++++++++++---------- test/integrations/testTypes.ts | 8 ++++ 3 files changed, 56 insertions(+), 47 deletions(-) diff --git a/test/apitests/service.api.test.ts b/test/apitests/service.api.test.ts index 523476017ef..d69d568355d 100644 --- a/test/apitests/service.api.test.ts +++ b/test/apitests/service.api.test.ts @@ -543,30 +543,6 @@ describe('Destination api tests', () => { }); describe('Source api tests', () => { - // Note: v0 is deprecated and v2 to v0 conversion strategy is not implemented. This leads to errors in the below test case - - // test('(shopify) successful source transform', async () => { - // const data = getDataFromPath('./data_scenarios/source/v0/successful.json'); - // const response = await request(server) - // .post('/v0/sources/shopify') - // .set('Accept', 'application/json') - // .send(data.input); - // const parsedResp = JSON.parse(response.text); - // delete parsedResp[0].output.batch[0].anonymousId; - // expect(response.status).toEqual(200); - // expect(parsedResp).toEqual(data.output); - // }); - - // test('(shopify) failure source transform (shopify)', async () => { - // const data = getDataFromPath('./data_scenarios/source/v0/failure.json'); - // const response = await request(server) - // .post('/v0/sources/shopify') - // .set('Accept', 'application/json') - // .send(data.input); - // expect(response.status).toEqual(200); - // expect(JSON.parse(response.text)).toEqual(data.output); - // }); - test('(shopify) success source transform (monday)', async () => { const data = getDataFromPath('./data_scenarios/source/v0/response_to_caller.json'); const response = await request(server) diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 9f1bfd238fb..b077c316948 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -7,7 +7,7 @@ import axios from 'axios'; import bodyParser from 'koa-bodyparser'; import { Command } from 'commander'; import { createHttpTerminator } from 'http-terminator'; -import { MockHttpCallsData, TestCaseData } from './testTypes'; +import { ExtendedTestCaseData, MockHttpCallsData, TestCaseData } from './testTypes'; import { applicationRoutes } from '../../src/routes/index'; import MockAxiosAdapter from 'axios-mock-adapter'; import { @@ -25,6 +25,8 @@ import { assertRouterOutput, responses } from '../testHelper'; import { generateTestReport, initaliseReport } from '../test_reporter/reporter'; import _ from 'lodash'; import defaultFeaturesConfig from '../../src/features'; +import { ControllerUtility } from '../../src/controllers/util'; +import { FetchHandler } from '../../src/helpers/fetchHandlers'; // To run single destination test cases // npm run test:ts -- component --destination=adobe_analytics @@ -230,29 +232,52 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { }); } - describe(`${testData[0].name} ${testData[0].module}`, () => { - test.each(testData)('$feature -> $description (index: $#)', async (tcData) => { - tcData?.mockFns?.(mockAdapter); + const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => { + if (tcData.module === tags.MODULES.SOURCE) { + return [ + { + tcData, + sourceTransformV2Flag: false, + descriptionSuffix: ' (sourceTransformV2Flag: false)', + }, + { + tcData, + sourceTransformV2Flag: true, + descriptionSuffix: ' (sourceTransformV2Flag: true)', + }, + ]; + } + return [{ tcData }]; + }); - switch (tcData.module) { - case tags.MODULES.DESTINATION: - await destinationTestHandler(tcData); - break; - case tags.MODULES.SOURCE: - defaultFeaturesConfig.upgradedToSourceTransformV2 = false; - await sourceTestHandler(tcData); + describe(`${testData[0].name} ${testData[0].module}`, () => { + test.each(extendedTestData)( + '$feature -> $description$descriptionSuffix (index: $#)', + async ({ tcData, sourceTransformV2Flag }) => { + tcData?.mockFns?.(mockAdapter); - // run the same tests for sources only with upgradedToSourceTransformV2 flag as true - tcData?.mockFns?.(mockAdapter); - defaultFeaturesConfig.upgradedToSourceTransformV2 = true; - await sourceTestHandler(tcData); - break; - default: - console.log('Invalid module'); - // Intentionally fail the test case - expect(true).toEqual(false); - break; - } - }); + switch (tcData.module) { + case tags.MODULES.DESTINATION: + await destinationTestHandler(tcData); + break; + case tags.MODULES.SOURCE: + tcData?.mockFns?.(mockAdapter); + testSetupSourceTransformV2(sourceTransformV2Flag); + await sourceTestHandler(tcData); + break; + default: + console.log('Invalid module'); + // Intentionally fail the test case + expect(true).toEqual(false); + break; + } + }, + ); }); }); + +const testSetupSourceTransformV2 = (flag) => { + defaultFeaturesConfig.upgradedToSourceTransformV2 = flag; + ControllerUtility['sourceVersionMap'] = new Map(); + FetchHandler['sourceHandlerMap'] = new Map(); +}; diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index 3c5cf606009..dbd02e22170 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -57,6 +57,14 @@ export interface TestCaseData { mockFns?: (mockAdapter: MockAdapter) => {}; } +export interface ExtendedTestCaseData { + // use this to add any new properties for dynamic test cases + // this will keep the base TestCaseData structure generic and intact + tcData: TestCaseData; + sourceTransformV2Flag?: boolean; + descriptionSuffix?: string; +} + export type MockFns = (mockAdapter: MockAdapter) => void; export interface SrcTestCaseData { From 7d4fbaad99c2b8a3e68672736085bfab318e0fc5 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 13 Dec 2024 09:36:27 +0000 Subject: [PATCH 005/160] chore(release): 1.87.0 --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e742ea1f553..ee9dead590d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ 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.87.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.86.0...v1.87.0) (2024-12-13) + + +### Features + +* onboard topsort destination ([#3913](https://github.com/rudderlabs/rudder-transformer/issues/3913)) ([227419f](https://github.com/rudderlabs/rudder-transformer/commit/227419f1ff618f96aafa849862828e2315e4ac55)) + + +### Bug Fixes + +* handling partial error in a batch for reddit destination ([#3935](https://github.com/rudderlabs/rudder-transformer/issues/3935)) ([d40db6c](https://github.com/rudderlabs/rudder-transformer/commit/d40db6c1e7f71c5ab5fc3a3659d1fc51b6d527fa)) + ## [1.86.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.85.1...v1.86.0) (2024-12-09) diff --git a/package-lock.json b/package-lock.json index 5f9e7229f6d..2aea3c8ffd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.86.0", + "version": "1.87.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.86.0", + "version": "1.87.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index b9064fac2c5..aa0a700681b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.86.0", + "version": "1.87.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 43abf9ca193a9d16a9eddc28cc6117beadd76b41 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Thu, 26 Dec 2024 09:47:48 +0530 Subject: [PATCH 006/160] fix: user order (#3944) * fix: anonymousId overwriting userId at MoEngage destination (#3914) fix/moengage-anonymousid-over-userid Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> * chore: fix test cases --------- Co-authored-by: Landi <98327875+jmlandi@users.noreply.github.com> --- src/v0/destinations/moengage/transform.js | 2 +- .../destinations/moengage/processor/data.ts | 24 +++++++++---------- .../destinations/moengage/router/data.ts | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/v0/destinations/moengage/transform.js b/src/v0/destinations/moengage/transform.js index 8a16d9c7a71..2df921cb60f 100644 --- a/src/v0/destinations/moengage/transform.js +++ b/src/v0/destinations/moengage/transform.js @@ -49,7 +49,7 @@ function responseBuilderSimple(message, category, destination) { // using base64 and prepends it with the string 'Basic '. Authorization: `Basic ${btoa(`${apiId}:${apiKey}`)}`, }; - response.userId = message.anonymousId || message.userId; + response.userId = message.userId || message.anonymousId; if (payload) { switch (category.type) { case 'identify': diff --git a/test/integrations/destinations/moengage/processor/data.ts b/test/integrations/destinations/moengage/processor/data.ts index df6e1226b6d..50309c03724 100644 --- a/test/integrations/destinations/moengage/processor/data.ts +++ b/test/integrations/destinations/moengage/processor/data.ts @@ -292,7 +292,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -418,7 +418,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', 'Content-Type': 'application/json', @@ -686,7 +686,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', 'Content-Type': 'application/json', @@ -719,7 +719,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', 'Content-Type': 'application/json', @@ -851,7 +851,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', 'Content-Type': 'application/json', @@ -983,7 +983,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', 'Content-Type': 'application/json', @@ -1875,7 +1875,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -2008,7 +2008,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', 'Content-Type': 'application/json', @@ -2041,7 +2041,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', headers: { 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', 'Content-Type': 'application/json', @@ -2318,7 +2318,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -2599,7 +2599,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, statusCode: 200, }, @@ -2875,7 +2875,7 @@ export const data = [ method: 'POST', params: {}, type: 'REST', - userId: 'anon-dummyId-1', + userId: 'userId16', version: '1', }, statusCode: 200, diff --git a/test/integrations/destinations/moengage/router/data.ts b/test/integrations/destinations/moengage/router/data.ts index b24453fd348..a31f407b2c8 100644 --- a/test/integrations/destinations/moengage/router/data.ts +++ b/test/integrations/destinations/moengage/router/data.ts @@ -324,7 +324,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, metadata: [{ jobId: 1, userId: 'u1' }], batched: false, @@ -393,7 +393,7 @@ export const data = [ FORM: {}, }, files: {}, - userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + userId: 'rudder123', }, metadata: [{ jobId: 2, userId: 'u1' }], batched: false, From 01de6eadcce3861a3e4b9c61fa7309d51040903b Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Thu, 26 Dec 2024 10:12:10 +0530 Subject: [PATCH 007/160] chore: clean deprecated files (#3904) chore: claen depricated files --- src/controllers/bulkUpload.ts | 166 ---- src/controllers/obs.delivery.js | 130 --- src/legacy/delivery.js | 27 - src/legacy/router.js | 1272 --------------------------- src/routes/bulkUpload.ts | 17 - src/routes/index.ts | 2 - test/__tests__/legacyRouter.test.ts | 113 --- 7 files changed, 1727 deletions(-) delete mode 100644 src/controllers/bulkUpload.ts delete mode 100644 src/controllers/obs.delivery.js delete mode 100644 src/legacy/delivery.js delete mode 100644 src/legacy/router.js delete mode 100644 src/routes/bulkUpload.ts delete mode 100644 test/__tests__/legacyRouter.test.ts diff --git a/src/controllers/bulkUpload.ts b/src/controllers/bulkUpload.ts deleted file mode 100644 index cb0bcfed3c0..00000000000 --- a/src/controllers/bulkUpload.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* eslint-disable global-require, import/no-dynamic-require, @typescript-eslint/no-unused-vars */ -import { client as errNotificationClient } from '../util/errorNotifier'; -import { - getDestFileUploadHandler, - getJobStatusHandler, - getPollStatusHandler, -} from '../util/fetchDestinationHandlers'; -import { CatchErr, ContextBodySimple } from '../util/types'; -import logger from '../logger'; -// TODO: To be refactored and redisgned - -const ERROR_MESSAGE_PROCESSOR_STRING = 'Error occurred while processing payload.'; - -const getCommonMetadata = (ctx) => - // TODO: Parse information such as - // cluster, namespace, etc information - // from the request - ({ - namespace: 'Unknown', - cluster: 'Unknown', - }); - -const getReqMetadata = (ctx) => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType, importId: reqBody?.importId }; - } catch (error) { - // Do nothing - } - return {}; -}; - -export const fileUpload = async (ctx) => { - logger.debug('Native(Bulk-Upload): Request to transformer:: /fileUpload route', ctx.request.body); - const getReqMetadataFileUpload = () => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getDestFileUploadHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processFileData) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processFileData(ctx.request.body); - } catch (error: CatchErr) { - response = { - statusCode: error?.response?.status || error?.status || 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - metadata: error.response ? error.response.metadata : null, - }; - errNotificationClient.notify(error, 'File Upload', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Response from transformer:: /fileUpload route', ctx.body); - return ctx.body; -}; - -export const pollStatus = async (ctx) => { - logger.debug('Native(Bulk-Upload): Request to transformer:: /pollStatus route', ctx.request.body); - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getPollStatusHandler('v0', destType.toLowerCase()); - let response; - if (!destFileUploadHandler || !destFileUploadHandler.processPolling) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - try { - response = await destFileUploadHandler.processPolling(ctx.request.body); - } catch (error: CatchErr) { - response = { - statusCode: error.response?.status || 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - }; - errNotificationClient.notify(error, 'Poll Status', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Request from transformer:: /pollStatus route', ctx.body); - return ctx.body; -}; - -export const getWarnJobStatus = async (ctx) => { - logger.debug( - 'Native(Bulk-Upload): Request to transformer:: /getWarningJobs route', - ctx.request.body, - ); - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processJobStatus(ctx.request.body, 'warn'); - } catch (error: CatchErr) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - }; - errNotificationClient.notify(error, 'Job Status', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Request from transformer:: /getWarningJobs route', ctx.body); - return ctx.body; -}; - -export const getFailedJobStatus = async (ctx) => { - logger.debug( - 'Native(Bulk-Upload): Request to transformer:: /getFailedJobs route', - ctx.request.body, - ); - - const { destType }: ContextBodySimple = ctx.request.body; - const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processJobStatus(ctx.request.body, 'fail'); - } catch (error: CatchErr) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || ERROR_MESSAGE_PROCESSOR_STRING, - }; - errNotificationClient.notify(error, 'Job Status', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(ctx), - }); - } - ctx.body = response; - logger.debug('Native(Bulk-Upload): Request from transformer:: /getFailedJobs route', ctx.body); - return ctx.body; -}; diff --git a/src/controllers/obs.delivery.js b/src/controllers/obs.delivery.js deleted file mode 100644 index 8e99650af64..00000000000 --- a/src/controllers/obs.delivery.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * -------------------------------------- - * -------------------------------------- - * ---------TO BE DEPRECATED------------- - * -------------------------------------- - * -------------------------------------- - */ - -const match = require('match-json'); -const jsonDiff = require('json-diff'); -const networkHandlerFactory = require('../adapters/networkHandlerFactory'); -const { getPayloadData } = require('../adapters/network'); -const { generateErrorObject } = require('../v0/util'); -const logger = require('../logger'); -const tags = require('../v0/util/tags'); -const stats = require('../util/stats'); - -const DestProxyController = { - /** - * Handler for testing the destination proxy - * @param {*} destination Destination name - * @param {*} ctx - * @returns - */ - async handleProxyTestRequest(destination, ctx) { - const { - deliveryPayload: routerDeliveryPayload, - destinationRequestPayload: routerDestReqPayload, - } = ctx.request.body; - let response; - try { - const destNetworkHandler = networkHandlerFactory.getNetworkHandler(destination); - - const proxyDestReqPayload = destNetworkHandler.prepareProxy(routerDeliveryPayload); - response = { - destinationRequestPayload: proxyDestReqPayload, - }; - - // Special handling required as Go and JavaScript encodes - // URL parameters differently - const { payloadFormat } = getPayloadData(routerDeliveryPayload.body); - if (payloadFormat === 'FORM') { - // This is to make sure we encode `~` in the data coming from the router. - // The data coming from the router is already a query parameter string - const routerDataVal = new URLSearchParams(routerDestReqPayload.data); - routerDestReqPayload.data = routerDataVal; - - const proxyDataVal = new URLSearchParams(); - proxyDestReqPayload.data.forEach((value, key) => { - const encodeAsterisk = (x) => x.replace(/\*/g, '%2A'); - // Router encodes `*` as well - proxyDataVal.append(encodeAsterisk(key), encodeAsterisk(value)); - }); - proxyDestReqPayload.data = proxyDataVal; - } - - // Compare the destination request payloads from router and proxy - if (!match(routerDestReqPayload, proxyDestReqPayload)) { - stats.counter('proxy_test_payload_mismatch', 1, { - destination, - }); - - logger.error(`[TransformerProxyTest] Destination request payload mismatch!`); - logger.error( - `[TransformerProxyTest] Delivery payload (router): ${JSON.stringify( - routerDeliveryPayload, - )}`, - ); - logger.error( - `[TransformerProxyTest] Destination request payload (router): ${JSON.stringify( - routerDestReqPayload, - )}`, - ); - logger.error( - `[TransformerProxyTest] Destination request payload (proxy): ${JSON.stringify( - proxyDestReqPayload, - )} `, - ); - - // Compute output difference - const outputDiff = jsonDiff.diffString(routerDestReqPayload, proxyDestReqPayload); - logger.error( - `[TransformerProxyTest] Destination request payload difference: ${outputDiff}`, - ); - response = { - outputDiff, - ...response, - }; - } else { - stats.counter('proxy_test_payload_match', 1, { - destination, - }); - } - } catch (err) { - stats.counter('proxy_test_error', 1, { - destination, - }); - - response = generateErrorObject( - err, - { - [tags.TAG_NAMES.DEST_TYPE]: destination.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.DATA_DELIVERY, - }, - false, - ); - response.message = `[TransformerProxyTest] Error occurred while testing proxy for destination ("${destination}"): "${err.message}"`; - logger.error(response.message); - logger.error(err); - logger.error( - `[TransformerProxyTest] Delivery payload (router): ${JSON.stringify( - routerDeliveryPayload, - )}`, - ); - logger.error( - `[TransformerProxyTest] Destination request payload (router): ${JSON.stringify( - routerDestReqPayload, - )}`, - ); - } - - // Always return success as router doesn't care - ctx.status = 200; - ctx.body = { output: response }; - return ctx.body; - }, -}; - -module.exports = { DestProxyController }; diff --git a/src/legacy/delivery.js b/src/legacy/delivery.js deleted file mode 100644 index 8f7b0928154..00000000000 --- a/src/legacy/delivery.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * -------------------------------------- - * -------------------------------------- - * ---------TO BE DEPRICIATED------------ - * -------------------------------------- - * -------------------------------------- - */ - -const path = require('path'); -const KoaRouter = require('@koa/router'); -const { DestProxyController } = require('../controllers/obs.delivery'); -const { getIntegrations } = require('../routes/utils'); -const { SUPPORTED_VERSIONS, API_VERSION } = require('../routes/utils/constants'); - -const router = new KoaRouter(); - -SUPPORTED_VERSIONS.forEach((version) => { - const destinations = getIntegrations(path.resolve(__dirname, `../${version}/destinations`)); - destinations.forEach((destination) => { - router.post(`/${version}/destinations/${destination}/proxyTest`, async (ctx) => { - ctx.set('apiVersion', API_VERSION); - await DestProxyController.handleProxyTestRequest(destination, ctx); - }); - }); -}); - -module.exports = router.routes(); diff --git a/src/legacy/router.js b/src/legacy/router.js deleted file mode 100644 index 60f786e2252..00000000000 --- a/src/legacy/router.js +++ /dev/null @@ -1,1272 +0,0 @@ -// ============================================================================= -// DEPRECATION NOTICE: THIS FILE IS GETTING DEPRECATED AND WILL BE REMOVED IN FUTURE RELEASE -// ============================================================================= -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable global-require */ -const Router = require('@koa/router'); -const lodash = require('lodash'); -const fs = require('fs'); -const path = require('path'); -const { PlatformError, getErrorRespEvents } = require('@rudderstack/integrations-lib'); -const logger = require('../logger'); -const stats = require('../util/stats'); -const { SUPPORTED_VERSIONS, API_VERSION } = require('../routes/utils/constants'); -const { client: errNotificationClient } = require('../util/errorNotifier'); -const tags = require('../v0/util/tags'); - -const { - isNonFuncObject, - getMetadata, - generateErrorObject, - checkAndCorrectUserId, -} = require('../v0/util'); -const { processDynamicConfig } = require('../util/dynamicConfig'); -const { DestHandlerMap } = require('../constants/destinationCanonicalNames'); -const { userTransformHandler } = require('../routerUtils'); -const networkHandlerFactory = require('../adapters/networkHandlerFactory'); -const destProxyRoutes = require('./delivery'); -const eventValidator = require('../util/eventValidation'); -const { getIntegrations } = require('../routes/utils'); -const { setupUserTransformHandler, validateCode } = require('../util/customTransformer'); -const { - RespStatusError, - RetryRequestError, - sendViolationMetrics, - constructValidationErrors, -} = require('../util/utils'); -const { extractLibraries } = require('../util/customTransformer'); -const { getCompatibleStatusCode } = require('../adapters/utils/networkUtils'); - -const transformerMode = process.env.TRANSFORMER_MODE; - -const startDestTransformer = transformerMode === 'destination' || !transformerMode; -const startSourceTransformer = transformerMode === 'source' || !transformerMode; -const transformerProxy = process.env.TRANSFORMER_PROXY || true; -const proxyTestModeEnabled = - process.env.TRANSFORMER_PROXY_TEST_ENABLED?.toLowerCase() === 'true' || false; -const transformerTestModeEnabled = process.env.TRANSFORMER_TEST_MODE - ? process.env.TRANSFORMER_TEST_MODE.toLowerCase() === 'true' - : false; - -const router = new Router(); - -const PAYLOAD_PROC_ERR_MSG = 'Error occurred while processing payload'; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const getDestHandler = (version, dest) => { - if (Object.prototype.hasOwnProperty.call(DestHandlerMap, dest)) { - return require(`../${version}/destinations/${DestHandlerMap[dest]}/transform`); - } - return require(`../${version}/destinations/${dest}/transform`); -}; - -const getDestFileUploadHandler = (version, dest) => - require(`../${version}/destinations/${dest}/fileUpload`); - -const getPollStatusHandler = (version, dest) => require(`../${version}/destinations/${dest}/poll`); - -const getJobStatusHandler = (version, dest) => - require(`../${version}/destinations/${dest}/fetchJobStatus`); - -const getDeletionUserHandler = (version, dest) => - require(`../${version}/destinations/${dest}/deleteUsers`); - -const getSourceHandler = (version, source) => require(`../${version}/sources/${source}/transform`); - -let areFunctionsEnabled = -1; -const functionsEnabled = () => { - if (areFunctionsEnabled === -1) { - areFunctionsEnabled = process.env.ENABLE_FUNCTIONS === 'false' ? 0 : 1; - } - return areFunctionsEnabled === 1; -}; - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getCommonMetadata(ctx) { - // TODO: Parse information such as - // cluster, namespace, etc information - // from the request - return { - namespace: 'Unknown', - cluster: 'Unknown', - }; -} - -/** - * Enriches the transformed event with more information - * - userId stringification - * - * @param {Object} transformedEvent - single transformed event - * @returns transformedEvent after enrichment - */ -const enrichTransformedEvent = (transformedEvent) => ({ - ...transformedEvent, - userId: checkAndCorrectUserId(transformedEvent.statusCode, transformedEvent?.userId), -}); - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -function handleV0Destination(destHandler, inputArr) { - return destHandler(...inputArr); -} -/** - * @deprecated this function is deprecated and will be removed in future release - */ -async function handleDest(ctx, version, destination) { - const getReqMetadata = (event) => { - try { - return { - destType: destination, - destinationId: event?.destination?.ID, - destName: event?.destination?.Name, - metadata: event?.metadata, - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const events = ctx.request.body; - if (!Array.isArray(events) || events.length === 0) { - throw new PlatformError('Event is missing or in inappropriate format'); - } - const reqParams = ctx.request.query; - logger.debug(`[DT] Input events: ${JSON.stringify(events)}`); - - const metaTags = - events && events.length > 0 && events[0].metadata ? getMetadata(events[0].metadata) : {}; - stats.histogram('dest_transform_input_events', events.length, { - destination, - version, - ...metaTags, - }); - const executeStartTime = new Date(); - let destHandler = null; - const respList = await Promise.all( - events.map(async (event) => { - try { - let parsedEvent = event; - parsedEvent.request = { query: reqParams }; - parsedEvent = processDynamicConfig(parsedEvent); - let respEvents; - if (destHandler === null) { - destHandler = getDestHandler(version, destination); - } - respEvents = await handleV0Destination(destHandler.process, [parsedEvent]); - - if (respEvents) { - if (!Array.isArray(respEvents)) { - respEvents = [respEvents]; - } - return respEvents.map((ev) => ({ - output: enrichTransformedEvent(ev), - metadata: destHandler?.processMetadata - ? destHandler.processMetadata({ - metadata: event.metadata, - inputEvent: parsedEvent, - outputEvent: ev, - }) - : event.metadata, - statusCode: 200, - })); - } - return undefined; - } catch (error) { - logger.error(error); - - const implementation = tags.IMPLEMENTATIONS.NATIVE; - const errCtx = 'Processor Transformation'; - - const errObj = generateErrorObject(error, { - [tags.TAG_NAMES.DEST_TYPE]: destination.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: implementation, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.PROCESSOR, - [tags.TAG_NAMES.DESTINATION_ID]: event.metadata?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: event.metadata?.workspaceId, - }); - - const resp = { - metadata: event.metadata, - destination: event.destination, - statusCode: errObj.status, - error: errObj.message, - statTags: errObj.statTags, - }; - - errNotificationClient.notify(error, errCtx, { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(event), - }); - return resp; - } - }), - ); - stats.timing('cdk_events_latency', executeStartTime, { - destination, - ...metaTags, - }); - logger.debug(`[DT] Output events: ${JSON.stringify(respList)}`); - stats.histogram('dest_transform_output_events', respList.length, { - destination, - version, - ...metaTags, - }); - ctx.body = respList.flat(); - return ctx.body; -} - -async function handleValidation(ctx) { - const requestStartTime = new Date(); - const events = ctx.request.body; - const requestSize = Number(ctx.request.get('content-length')); - const reqParams = ctx.request.query; - const respList = []; - const metaTags = events[0].metadata ? getMetadata(events[0].metadata) : {}; - let ctxStatusCode = 200; - // eslint-disable-next-line no-restricted-syntax - for (const event of events) { - const eventStartTime = new Date(); - try { - const parsedEvent = event; - parsedEvent.request = { query: reqParams }; - // eslint-disable-next-line no-await-in-loop - const hv = await eventValidator.handleValidation(parsedEvent); - sendViolationMetrics(hv.validationErrors, hv.dropEvent, metaTags); - if (hv.dropEvent) { - respList.push({ - output: event.message, - metadata: event.metadata, - statusCode: 400, - validationErrors: hv.validationErrors, - error: JSON.stringify(constructValidationErrors(hv.validationErrors)), - }); - stats.counter('hv_violation_type', 1, { - violationType: hv.violationType, - ...metaTags, - }); - } else { - respList.push({ - output: event.message, - metadata: event.metadata, - statusCode: 200, - validationErrors: hv.validationErrors, - error: JSON.stringify(constructValidationErrors(hv.validationErrors)), - }); - stats.counter('hv_propagated_events', 1, { - ...metaTags, - }); - } - } catch (error) { - const errMessage = `Error occurred while validating : ${error}`; - logger.error(errMessage); - let status = 200; - if (error instanceof RetryRequestError) { - ctxStatusCode = error.statusCode; - } - if (error instanceof RespStatusError) { - status = error.statusCode; - } - respList.push({ - output: event.message, - metadata: event.metadata, - statusCode: status, - validationErrors: [], - error: errMessage, - }); - stats.counter('hv_errors', 1, { - ...metaTags, - }); - } finally { - stats.timing('hv_event_latency', eventStartTime, { - ...metaTags, - }); - } - } - ctx.body = respList; - ctx.status = ctxStatusCode; - ctx.set('apiVersion', API_VERSION); - - stats.counter('hv_events_count', events.length, { - ...metaTags, - }); - stats.histogram('hv_request_size', requestSize, { - ...metaTags, - }); - stats.timing('hv_request_latency', requestStartTime, { - ...metaTags, - }); -} - -async function isValidRouterDest(event, destType) { - try { - const routerDestHandler = getDestHandler('v0', destType); - return routerDestHandler?.processRouterDest !== undefined; - } catch (error) { - return false; - } -} -/** - * @deprecated this function is deprecated and will be removed in future release - */ -async function routerHandleDest(ctx) { - const getReqMetadata = () => { - try { - return { - destType: ctx.request?.body?.destType, - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const respEvents = []; - let destType; - let defTags; - try { - const { input } = ctx.request.body; - destType = ctx.request.body.destType; - defTags = { - [tags.TAG_NAMES.DEST_TYPE]: destType.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.ROUTER, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - }; - - const routerDestHandler = getDestHandler('v0', destType); - const isValidRTDest = await isValidRouterDest(input[0], destType); - if (!isValidRTDest) { - ctx.status = 404; - ctx.body = `${destType} doesn't support router transform`; - return null; - } - const allDestEvents = lodash.groupBy(input, (event) => event.destination.ID); - await Promise.all( - Object.values(allDestEvents).map(async (destInputArray) => { - const newDestInputArray = processDynamicConfig(destInputArray, 'router'); - const listOutput = await handleV0Destination(routerDestHandler.processRouterDest, [ - newDestInputArray, - { ...getCommonMetadata(ctx), ...getReqMetadata() }, - ]); - const hasProcMetadataForRouter = routerDestHandler.processMetadataForRouter; - // enriching transformed event - listOutput.forEach((listOut) => { - const { batchedRequest } = listOut; - if (Array.isArray(batchedRequest)) { - // eslint-disable-next-line no-param-reassign - listOut.batchedRequest = batchedRequest.map((batReq) => enrichTransformedEvent(batReq)); - } else if (batchedRequest && typeof batchedRequest === 'object') { - // eslint-disable-next-line no-param-reassign - listOut.batchedRequest = enrichTransformedEvent(batchedRequest); - } - - if (hasProcMetadataForRouter) { - // eslint-disable-next-line no-param-reassign - listOut.metadata = routerDestHandler.processMetadataForRouter(listOut); - } - }); - respEvents.push(...listOutput); - }), - ); - - // Add default stat tags - respEvents - .filter( - (resp) => - 'error' in resp && lodash.isObject(resp.statTags) && !lodash.isEmpty(resp.statTags), - ) - .forEach((resp) => { - // eslint-disable-next-line no-param-reassign - resp.statTags = { - ...resp.statTags, - ...defTags, - [tags.TAG_NAMES.DESTINATION_ID]: resp.metadata[0]?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: resp.metadata[0]?.workspaceId, - }; - }); - } catch (error) { - logger.error(error); - - const errObj = generateErrorObject(error, defTags); - - const resp = { - statusCode: errObj.status, - error: errObj.message, - statTags: errObj.statTags, - }; - - // Add support to perform refreshToken action for OAuth destinations - if (error?.authErrorCategory) { - resp.authErrorCategory = error.authErrorCategory; - } - - errNotificationClient.notify(error, 'Router Transformation', { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - - respEvents.push(resp); - } - ctx.body = { output: respEvents }; - return ctx.body; -} - -if (startDestTransformer) { - SUPPORTED_VERSIONS.forEach((version) => { - const destinations = getIntegrations(path.resolve(__dirname, `../${version}/destinations`)); - destinations.forEach((destination) => { - // eg. v0/destinations/ga - router.post(`/${version}/destinations/${destination}`, async (ctx) => { - const startTime = new Date(); - await handleDest(ctx, version, destination); - ctx.set('apiVersion', API_VERSION); - // Assuming that events are from one single source - - const metaTags = - ctx.request.body && ctx.request.body.length > 0 && ctx.request.body[0].metadata - ? getMetadata(ctx.request.body[0].metadata) - : {}; - - stats.timing('dest_transform_request_latency', startTime, { - destination, - version, - ...metaTags, - }); - stats.increment('dest_transform_requests', { - destination, - version, - ...metaTags, - }); - }); - // eg. v0/ga. will be deprecated in favor of v0/destinations/ga format - router.post(`/${version}/${destination}`, async (ctx) => { - const startTime = new Date(); - await handleDest(ctx, version, destination); - ctx.set('apiVersion', API_VERSION); - // Assuming that events are from one single source - - const metaTags = - ctx.request.body && ctx.request.body.length > 0 && ctx.request.body[0].metadata - ? getMetadata(ctx.request.body[0].metadata) - : {}; - - stats.timing('dest_transform_request_latency', startTime, { - destination, - ...metaTags, - }); - stats.increment('dest_transform_requests', { - destination, - version, - ...metaTags, - }); - }); - router.post('/routerTransform', async (ctx) => { - ctx.set('apiVersion', API_VERSION); - await routerHandleDest(ctx); - }); - }); - }); - - if (functionsEnabled()) { - router.post('/extractLibs', async (ctx) => { - try { - const { - code, - versionId, - validateImports = false, - additionalLibraries = [], - language = 'javascript', - testMode = false, - } = ctx.request.body; - - if (!code) { - throw new Error('Invalid request. Code is missing'); - } - - const obj = await extractLibraries( - code, - versionId, - validateImports, - additionalLibraries, - language, - testMode || versionId === 'testVersionId', - ); - ctx.body = obj; - } catch (err) { - ctx.status = 400; - ctx.body = { error: err.error || err.message }; - } - }); - - // eslint-disable-next-line sonarjs/cognitive-complexity - router.post('/customTransform', async (ctx) => { - const startTime = new Date(); - const events = ctx.request.body; - const { processSessions } = ctx.query; - logger.debug(`[CT] Input events: ${JSON.stringify(events)}`); - stats.histogram('user_transform_input_events', events.length, { - processSessions, - }); - let groupedEvents; - if (processSessions) { - groupedEvents = lodash.groupBy(events, (event) => { - // to have the backward-compatibility and being extra careful. We need to remove this (message.anonymousId) in next release. - const rudderId = event.metadata.rudderId || event.message.anonymousId; - return `${event.destination.ID}_${event.metadata.sourceId}_${rudderId}`; - }); - } else { - groupedEvents = lodash.groupBy( - events, - (event) => `${event.metadata.destinationId}_${event.metadata.sourceId}`, - ); - } - stats.counter('user_transform_function_group_size', Object.entries(groupedEvents).length, {}); - - let ctxStatusCode = 200; - const transformedEvents = []; - let librariesVersionIDs = []; - if (events[0].libraries) { - librariesVersionIDs = events[0].libraries.map((library) => library.VersionID); - } - await Promise.all( - Object.entries(groupedEvents).map(async ([dest, destEvents]) => { - logger.debug(`dest: ${dest}`); - const transformationVersionId = - destEvents[0] && - destEvents[0].destination && - destEvents[0].destination.Transformations && - destEvents[0].destination.Transformations[0] && - destEvents[0].destination.Transformations[0].VersionID; - const messageIds = destEvents.map((ev) => ev.metadata && ev.metadata.messageId); - const commonMetadata = { - sourceId: destEvents[0].metadata && destEvents[0].metadata.sourceId, - destinationId: destEvents[0].metadata && destEvents[0].metadata.destinationId, - destinationType: destEvents[0].metadata && destEvents[0].metadata.destinationType, - messageIds, - }; - - const metaTags = - destEvents.length > 0 && destEvents[0].metadata - ? getMetadata(destEvents[0].metadata) - : {}; - if (transformationVersionId) { - let destTransformedEvents; - try { - destTransformedEvents = await userTransformHandler()( - destEvents, - transformationVersionId, - librariesVersionIDs, - ); - transformedEvents.push( - ...destTransformedEvents.map((ev) => { - if (ev.error) { - return { - statusCode: 400, - error: ev.error, - metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, - }; - } - if (!isNonFuncObject(ev.transformedEvent)) { - return { - statusCode: 400, - error: `returned event in events from user transformation is not an object. transformationVersionId:${transformationVersionId} and returned event: ${JSON.stringify( - ev.transformedEvent, - )}`, - metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, - }; - } - return { - output: ev.transformedEvent, - metadata: lodash.isEmpty(ev.metadata) ? commonMetadata : ev.metadata, - statusCode: 200, - }; - }), - ); - } catch (error) { - logger.error(error); - let status = 400; - const errorString = error.toString(); - if (error instanceof RetryRequestError) { - ctxStatusCode = error.statusCode; - } - if (error instanceof RespStatusError) { - status = error.statusCode; - } - destTransformedEvents = destEvents.map((e) => ({ - statusCode: status, - metadata: e.metadata, - error: errorString, - })); - transformedEvents.push(...destTransformedEvents); - stats.counter('user_transform_errors', destEvents.length, { - transformationVersionId, - processSessions, - ...metaTags, - }); - } - } else { - const errorMessage = 'Transformation VersionID not found'; - logger.error(`[CT] ${errorMessage}`); - transformedEvents.push({ - statusCode: 400, - error: errorMessage, - metadata: commonMetadata, - }); - stats.counter('user_transform_errors', destEvents.length, { - transformationVersionId, - processSessions, - ...metaTags, - }); - } - }), - ); - logger.debug(`[CT] Output events: ${JSON.stringify(transformedEvents)}`); - ctx.body = transformedEvents; - ctx.status = ctxStatusCode; - ctx.set('apiVersion', API_VERSION); - - stats.timingSummary('user_transform_request_latency_summary', startTime, {}); - stats.increment('user_transform_requests', {}); - stats.histogram('user_transform_output_events', transformedEvents.length, {}); - }); - } -} - -if (transformerTestModeEnabled) { - router.post('/transformation/test', async (ctx) => { - try { - const { events, trRevCode, libraryVersionIDs = [] } = ctx.request.body; - if (!trRevCode || !trRevCode.code || !trRevCode.codeVersion) { - throw new Error('Invalid Request. Missing parameters in transformation code block'); - } - if (!events || events.length === 0) { - throw new Error('Invalid request. Missing events'); - } - - logger.debug(`[CT] Test Input Events: ${JSON.stringify(events)}`); - trRevCode.versionId = 'testVersionId'; - const res = await userTransformHandler()( - events, - trRevCode.versionId, - libraryVersionIDs, - trRevCode, - true, - ); - logger.debug(`[CT] Test Output Events: ${JSON.stringify(res.transformedEvents)}`); - ctx.body = res; - } catch (error) { - ctx.status = error.statusCode || 400; - ctx.body = { error: error.message }; - } - }); - - router.post('/transformationLibrary/test', async (ctx) => { - try { - const { code, language = 'javascript' } = ctx.request.body; - - if (!code) { - throw new Error('Invalid request. Missing code'); - } - - const res = await validateCode(code, language); - ctx.body = res; - } catch (error) { - ctx.body = { error: error.message }; - ctx.status = 400; - } - }); - /* *params - * code: transfromation code - * language - * name - */ - router.post('/transformation/sethandle', async (ctx) => { - try { - const { trRevCode, libraryVersionIDs = [] } = ctx.request.body; - const { code, versionId, language, testName } = trRevCode || {}; - if (!code || !language || !testName || (language === 'pythonfaas' && !versionId)) { - throw new Error('Invalid Request. Missing parameters in transformation code block'); - } - - logger.debug(`[CT] Setting up a transformation ${testName}`); - if (!trRevCode.versionId) { - trRevCode.versionId = 'testVersionId'; - } - if (!trRevCode.workspaceId) { - trRevCode.workspaceId = 'workspaceId'; - } - const res = await setupUserTransformHandler(libraryVersionIDs, trRevCode); - logger.debug(`[CT] Finished setting up transformation: ${testName}`); - ctx.body = res; - } catch (error) { - ctx.status = 400; - ctx.body = { error: error.message }; - } - }); -} - -async function handleSource(ctx, version, source) { - const getReqMetadata = () => { - try { - return { srcType: source }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const sourceHandler = getSourceHandler(version, source); - const events = ctx.request.body; - logger.debug(`[ST] Input source events: ${JSON.stringify(events)}`); - stats.counter('source_transform_input_events', events.length, { - source, - version, - }); - const respList = []; - await Promise.all( - events.map(async (event) => { - try { - const respEvents = await sourceHandler.process(event); - - // We send response back to the source - // through outputToSource. This is not sent to gateway - if (Object.prototype.hasOwnProperty.call(respEvents, 'outputToSource')) { - respList.push(respEvents); - return; - } - - if (Array.isArray(respEvents)) { - respList.push({ output: { batch: respEvents } }); - } else { - respList.push({ output: { batch: [respEvents] } }); - } - } catch (error) { - logger.error(error); - - // TODO: Update the data contact for source transformation - // and then send the following additional information - // const errObj = generateErrorObject(error, { - // [tags.TAG_NAMES.SRC_TYPE]: source.toUpperCase(), - // [tags.TAG_NAMES.MODULE]: tags.MODULES.SOURCE, - // [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - // [tags.TAG_NAMES.FEATURE]: tags.FEATURES.PROCESSOR - // [tags.TAG_NAMES.SOURCE_ID]: TBD - // }); - - // const resp = { - // statusCode: errObj.status, - // error: errObj.message, - // statTags: errObj.statTags - // }; - - const resp = { - statusCode: 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - }; - - respList.push(resp); - - stats.counter('source_transform_errors', events.length, { - source, - version, - }); - errNotificationClient.notify(error, 'Source Transformation', { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - }), - ); - logger.debug(`[ST] Output source events: ${JSON.stringify(respList)}`); - stats.increment('source_transform_output_events', respList.length, { - source, - version, - }); - ctx.body = respList; - ctx.set('apiVersion', API_VERSION); -} - -if (startSourceTransformer) { - SUPPORTED_VERSIONS.forEach((version) => { - const sources = getIntegrations(path.resolve(__dirname, `../${version}/sources`)); - sources.forEach((source) => { - // eg. v0/sources/customerio - router.post(`/${version}/sources/${source}`, async (ctx) => { - const startTime = new Date(); - await handleSource(ctx, version, source); - - stats.timing('source_transform_request_latency', startTime, { - source, - version, - }); - stats.increment('source_transform_requests', { source, version }); - }); - }); - }); -} -/** - * @deprecated this function is deprecated and will be removed in future release - */ -async function handleProxyRequest(destination, ctx) { - const getReqMetadata = () => { - try { - return { destType: destination }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { metadata, ...destinationRequest } = ctx.request.body; - const destNetworkHandler = networkHandlerFactory.getNetworkHandler(destination); - let response; - try { - stats.counter('tf_proxy_dest_req_count', 1, { - destination, - }); - const startTime = new Date(); - const rawProxyResponse = await destNetworkHandler.proxy(destinationRequest); - - stats.timing('transformer_proxy_time', startTime, { - destination, - }); - stats.counter('tf_proxy_dest_resp_count', 1, { - destination, - success: rawProxyResponse.success, - }); - - const processedProxyResponse = destNetworkHandler.processAxiosResponse(rawProxyResponse); - stats.counter('tf_proxy_proc_ax_response_count', 1, { - destination, - }); - response = destNetworkHandler.responseHandler( - { ...processedProxyResponse, rudderJobMetadata: metadata }, - destination, - ); - stats.counter('tf_proxy_resp_handler_count', 1, { - destination, - }); - } catch (err) { - logger.error('Error occurred while completing proxy request:'); - logger.error(err); - - const errObj = generateErrorObject( - err, - { - [tags.TAG_NAMES.DEST_TYPE]: destination.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.DATA_DELIVERY, - [tags.TAG_NAMES.DESTINATION_ID]: metadata?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: metadata?.workspaceId, - }, - false, - ); - - response = { - status: errObj.status, - ...(errObj.authErrorCategory && { - authErrorCategory: errObj.authErrorCategory, - }), - destinationResponse: errObj.destinationResponse, - message: errObj.message, - statTags: errObj.statTags, - }; - - stats.counter('tf_proxy_err_count', 1, { - destination, - }); - - errNotificationClient.notify(err, 'Data Delivery', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - ctx.body = { output: response }; - // Sending `204` status(obtained from destination) is not working as expected - // Since this is success scenario, we'll be forcefully sending `200` status-code to server - ctx.status = getCompatibleStatusCode(response.status); - return ctx.body; -} - -if (transformerProxy) { - SUPPORTED_VERSIONS.forEach((version) => { - const destinations = getIntegrations(path.resolve(__dirname, `../${version}/destinations`)); - destinations.forEach((destination) => { - router.post(`/${version}/destinations/${destination}/proxy`, async (ctx) => { - const startTime = new Date(); - ctx.set('apiVersion', API_VERSION); - await handleProxyRequest(destination, ctx); - - stats.timing('transformer_total_proxy_latency', startTime, { - destination, - version, - }); - }); - }); - }); -} - -if (proxyTestModeEnabled) { - router.use(destProxyRoutes); -} - -router.get('/version', (ctx) => { - ctx.body = process.env.npm_package_version || 'Version Info not found'; -}); - -router.get('/transformerBuildVersion', (ctx) => { - ctx.body = process.env.transformer_build_version || 'Version Info not found'; -}); - -router.get('/health', (ctx) => { - const { git_commit_sha: gitCommitSha, transformer_build_version: imageVersion } = process.env; - ctx.body = { - service: 'UP', - ...(imageVersion && { version: imageVersion }), - ...(gitCommitSha && { gitCommitSha }), - }; -}); - -router.get('/features', (ctx) => { - const obj = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'features.json'), 'utf8')); - ctx.body = JSON.stringify(obj); -}); -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const batchHandler = (ctx) => { - const getReqMetadata = (destEvents) => { - try { - const reqBody = ctx.request.body; - const firstEvent = destEvents[0]; - return { - destType: reqBody?.destType, - destinationId: firstEvent?.destination?.ID, - destName: firstEvent?.destination?.Name, - metadata: firstEvent?.metadata, - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { destType, input } = ctx.request.body; - const destHandler = getDestHandler('v0', destType); - if (!destHandler || !destHandler.batch) { - ctx.status = 404; - ctx.body = `${destType} doesn't support batching`; - return null; - } - const allDestEvents = lodash.groupBy(input, (event) => event.destination.ID); - - const response = { batchedRequests: [], errors: [] }; - Object.entries(allDestEvents).forEach(([, destEvents]) => { - try { - // eslint-disable-next-line no-param-reassign - destEvents = processDynamicConfig(destEvents, 'batch'); - const destBatchedRequests = destHandler.batch(destEvents); - response.batchedRequests.push(...destBatchedRequests); - } catch (error) { - const errorObj = generateErrorObject(error, { - [tags.TAG_NAMES.DEST_TYPE]: destType.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.BATCH, - [tags.TAG_NAMES.DESTINATION_ID]: destEvents[0].metadata?.destinationId, - [tags.TAG_NAMES.WORKSPACE_ID]: destEvents[0].metadata?.workspaceId, - }); - const errResp = getErrorRespEvents( - destEvents.map((d) => d.metadata), - 500, // not using errorObj.status - errorObj.message, - errorObj.statTags, - ); - response.errors.push({ - ...errResp, - destination: destEvents[0].destination, - }); - errNotificationClient.notify(error, 'Batch Transformation', { - ...errResp, - ...getCommonMetadata(ctx), - ...getReqMetadata(destEvents), - }); - } - }); - if (response.errors.length > 0) { - ctx.status = 500; - ctx.body = response.errors; - return null; - } - ctx.body = response.batchedRequests; - return ctx.body; -}; -router.post('/batch', (ctx) => { - ctx.set('apiVersion', API_VERSION); - batchHandler(ctx); -}); - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const fileUpload = async (ctx) => { - const getReqMetadata = () => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const { destType } = ctx.request.body; - const destFileUploadHandler = getDestFileUploadHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processFileData) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processFileData(ctx.request.body); - } catch (error) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - metadata: error.response ? error.response.metadata : null, - }; - errNotificationClient.notify(error, 'File Upload', { - ...response, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - ctx.body = response; - return ctx.body; -}; - -const jobAndPollStatusReqMetadata = (ctx) => { - try { - const reqBody = ctx.request.body; - return { destType: reqBody?.destType, importId: reqBody?.importId }; - } catch (error) { - // Do nothing - } - return {}; -}; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const pollStatus = async (ctx) => { - const { destType } = ctx.request.body; - const destFileUploadHandler = getPollStatusHandler('v0', destType.toLowerCase()); - let response; - if (!destFileUploadHandler || !destFileUploadHandler.processPolling) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - try { - response = await destFileUploadHandler.processPolling(ctx.request.body); - } catch (error) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - }; - errNotificationClient.notify(error, 'Poll Status', { - ...response, - ...getCommonMetadata(ctx), - ...jobAndPollStatusReqMetadata(ctx), - }); - } - ctx.body = response; - return ctx.body; -}; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const getJobStatus = async (ctx, type) => { - const { destType } = ctx.request.body; - const destFileUploadHandler = getJobStatusHandler('v0', destType.toLowerCase()); - - if (!destFileUploadHandler || !destFileUploadHandler.processJobStatus) { - ctx.status = 404; - ctx.body = `${destType} doesn't support bulk upload`; - return null; - } - let response; - try { - response = await destFileUploadHandler.processJobStatus(ctx.request.body, type); - } catch (error) { - response = { - statusCode: error.response ? error.response.status : 400, - error: error.message || PAYLOAD_PROC_ERR_MSG, - }; - errNotificationClient.notify(error, 'Job Status', { - ...response, - ...getCommonMetadata(ctx), - ...jobAndPollStatusReqMetadata(ctx), - }); - } - ctx.body = response; - return ctx.body; -}; - -/** - * @deprecated this function is deprecated and will be removed in future release - */ -const handleDeletionOfUsers = async (ctx) => { - const getReqMetadata = () => { - try { - const reqBody = ctx.request.body; - return { - destType: reqBody[0]?.destType, - jobs: reqBody.map((req) => req.jobId), - }; - } catch (error) { - // Do nothing - } - return {}; - }; - - const getRudderDestInfo = () => { - try { - const rudderDestInfoHeader = ctx.get('x-rudder-dest-info'); - const destInfoHeader = JSON.parse(rudderDestInfoHeader); - if (!Array.isArray(destInfoHeader)) { - return destInfoHeader; - } - } catch (error) { - logger.error(`Error while getting rudderDestInfo header value: ${error}`); - } - return {}; - }; - - const { body } = ctx.request; - const respList = []; - const rudderDestInfo = getRudderDestInfo(); - let response; - await Promise.all( - body.map(async (reqBody) => { - const { destType } = reqBody; - const destUserDeletionHandler = getDeletionUserHandler('v0', destType.toLowerCase()); - if (!destUserDeletionHandler || !destUserDeletionHandler.processDeleteUsers) { - ctx.status = 404; - ctx.body = "Doesn't support deletion of users"; - return null; - } - - try { - response = await destUserDeletionHandler.processDeleteUsers({ - ...reqBody, - rudderDestInfo, - }); - if (response) { - respList.push(response); - } - } catch (error) { - const errObj = generateErrorObject( - error, - { - [tags.TAG_NAMES.DEST_TYPE]: destType.toUpperCase(), - [tags.TAG_NAMES.MODULE]: tags.MODULES.DESTINATION, - [tags.TAG_NAMES.IMPLEMENTATION]: tags.IMPLEMENTATIONS.NATIVE, - [tags.TAG_NAMES.FEATURE]: tags.FEATURES.USER_DELETION, - }, - false, - ); - - // adding the status to the request - ctx.status = errObj.status; - const resp = { - statusCode: errObj.status, - error: errObj.message, - ...(errObj.authErrorCategory && { - authErrorCategory: errObj.authErrorCategory, - }), - }; - - respList.push(resp); - logger.error(`Error Response List: ${JSON.stringify(respList, null, 2)}`); - - errNotificationClient.notify(error, 'User Deletion', { - ...resp, - ...getCommonMetadata(ctx), - ...getReqMetadata(), - }); - } - return undefined; - }), - ); - ctx.body = respList; - return ctx.body; - // const { destType } = ctx.request.body; -}; - -router.post('/fileUpload', async (ctx) => { - await fileUpload(ctx); -}); - -router.post('/pollStatus', async (ctx) => { - await pollStatus(ctx); -}); - -router.post('/getFailedJobs', async (ctx) => { - await getJobStatus(ctx, 'fail'); -}); - -router.post('/getWarningJobs', async (ctx) => { - await getJobStatus(ctx, 'warn'); -}); -// eg. v0/validate. will validate events as per respective tracking plans -router.post(`/v0/validate`, async (ctx) => { - await handleValidation(ctx); -}); - -// Api to handle deletion of users for data regulation -// { -// "destType": "dest name", -// "userAttributes": [ -// { -// "userId": "user_1" -// }, -// { -// "userId": "user_2" -// } -// ], -// "config": { -// "apiKey": "", -// "apiSecret": "" -// } -// } -router.post(`/deleteUsers`, async (ctx) => { - await handleDeletionOfUsers(ctx); -}); - -module.exports = { - router, - handleDest, - routerHandleDest, - batchHandler, - handleProxyRequest, - handleDeletionOfUsers, - fileUpload, - pollStatus, - getJobStatus, - handleV0Destination, - getDestHandler, -}; diff --git a/src/routes/bulkUpload.ts b/src/routes/bulkUpload.ts deleted file mode 100644 index efbd81c34e0..00000000000 --- a/src/routes/bulkUpload.ts +++ /dev/null @@ -1,17 +0,0 @@ -import Router from '@koa/router'; -import { - fileUpload, - pollStatus, - getFailedJobStatus, - getWarnJobStatus, -} from '../controllers/bulkUpload'; - -const router = new Router(); - -router.post('/fileUpload', fileUpload); -router.post('/pollStatus', pollStatus); -router.post('/getFailedJobs', getFailedJobStatus); -router.post('/getWarningJobs', getWarnJobStatus); -const bulkUploadRoutes = router.routes(); - -export default bulkUploadRoutes; diff --git a/src/routes/index.ts b/src/routes/index.ts index d77584bea34..890d5752f63 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -5,7 +5,6 @@ import dotenv from 'dotenv'; import { koaSwagger } from 'koa2-swagger-ui'; import path from 'path'; import userTransformRoutes from './userTransform'; -import bulkUploadRoutes from './bulkUpload'; import proxyRoutes from './delivery'; import destinationRoutes from './destination'; import miscRoutes from './misc'; @@ -21,7 +20,6 @@ dotenv.config(); const enableSwagger = process.env.ENABLE_SWAGGER === 'true'; export function applicationRoutes(app: Koa) { - app.use(bulkUploadRoutes); app.use(proxyRoutes); app.use(destinationRoutes); app.use(miscRoutes); diff --git a/test/__tests__/legacyRouter.test.ts b/test/__tests__/legacyRouter.test.ts deleted file mode 100644 index 926f6e76d4e..00000000000 --- a/test/__tests__/legacyRouter.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { DestinationController } from '../../src/controllers/destination'; -const destArg = process.argv.filter((x) => x.startsWith('--destName='))[0]; // send arguments on which destination -const typeArg = process.argv.filter((x) => x.startsWith('--type='))[0]; // send argument on which function - -// To invoke CDK live compare: -// router: CDK_LIVE_TEST=1 npx jest versionedRouter --destName=algolia --type=router -// processor: CDK_LIVE_TEST=1 npx jest versionedRouter --destName=algolia --type=processor - -let destination; -if (typeArg) { - destination = destArg ? destArg.split('=')[1] : 'heap'; // default - const type = typeArg.split('=')[1]; - let reqBody; - let respBody; - if (type !== 'all') { - try { - reqBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_${type}_${destination}_input.json`), - ) - .toString(), - ); - respBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_${type}_${destination}_output.json`), - ) - .toString(), - ); - } catch (error) { - throw new Error('destination/type not valid' + error); - } - } - if (type === 'router') { - it(`Testing: routerHandleDest`, async () => { - const output = await DestinationController.destinationTransformAtRouter(reqBody); - expect(output).toEqual(respBody); - }); - } else if (type === 'processor') { - it(`Testing: handleDest`, async () => { - const output = await DestinationController.destinationTransformAtProcessor(reqBody); - expect(output).toEqual(respBody); - }); - } else if (type === 'batch') { - it(`Testing: batchHandler`, async () => { - const output = await DestinationController.batchProcess(reqBody); - expect(output).toEqual(respBody); - }); - } else if (type === 'all') { - it(`Testing: routerHandleDest`, async () => { - const reqBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_router_${destination}_input.json`), - ) - .toString(), - ); - const respBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_router_${destination}_output.json`), - ) - .toString(), - ); - const output = await DestinationController.destinationTransformAtRouter(reqBody); - expect(output).toEqual(respBody); - }); - it(`Testing: handleDest`, async () => { - const reqBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_processor_${destination}_input.json`), - ) - .toString(), - ); - const respBody = JSON.parse( - fs - .readFileSync( - path.resolve(__dirname, `./data/versioned_processor_${destination}_output.json`), - ) - .toString(), - ); - destination = destination || 'heap'; // default - const output = await DestinationController.destinationTransformAtProcessor(reqBody); - expect(output).toEqual(respBody); - }); - it(`Testing: batchHandler`, async () => { - const reqBody = JSON.parse( - fs - .readFileSync(path.resolve(__dirname, `./data/versioned_batch_braze_input.json`)) - .toString(), - ); - const respBody = JSON.parse( - fs - .readFileSync(path.resolve(__dirname, `./data/versioned_batch_braze_output.json`)) - .toString(), - ); - }); - } else { - it(`Type is not all/router/batch/processor`, () => { - expect('Type is not all/router/batch/processor').toEqual( - 'Type is not all/router/batch/processor', - ); - }); - } -} else { - it(`No type and destination mentioned for testing versionedRouter`, () => { - expect('no command line argument provided').toEqual('no command line argument provided'); - }); -} From 419381d039cb71971632da1e08c0c93df28c9e97 Mon Sep 17 00:00:00 2001 From: Sankeerth Date: Thu, 26 Dec 2024 11:43:33 +0530 Subject: [PATCH 008/160] chore: separation prs for ut and dt dedicated deployment updates (#3936) * chore: dedicated deployments separation for ut and dt * chore: update commit msg for dt * chore: update ut dedicated deployment branch and commit msg * chore: update branch for dedicated ut deployment --------- Co-authored-by: Sai Sankeerth --- .../workflows/prepare-for-prod-dt-deploy.yml | 14 +++---- .../workflows/prepare-for-prod-ut-deploy.yml | 38 +++++++++++++++++++ 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/.github/workflows/prepare-for-prod-dt-deploy.yml b/.github/workflows/prepare-for-prod-dt-deploy.yml index 0a61a359bfa..56fda56b708 100644 --- a/.github/workflows/prepare-for-prod-dt-deploy.yml +++ b/.github/workflows/prepare-for-prod-dt-deploy.yml @@ -159,7 +159,7 @@ jobs: cd customer-objects - declare -a enabled_ut_customers=() + declare -a enabled_dt_customers=() declare -a sub_directories=('enterprise-us' 'enterprise-eu') # identify the customers enabled in sub-directories @@ -167,21 +167,21 @@ jobs: for f in "./$directory"/*; do [[ -f $f ]] || continue - enabled="$(yq e '.spec.user_transformer.enabled' $f)" + enabled="$(yq e '.spec.transformer.enabled' $f)" if [ $enabled == "true" ]; then - enabled_ut_customers+=( $f ) + enabled_dt_customers+=( $f ) fi done done # bump up the customers version and repository information - for customer in "${enabled_ut_customers[@]}"; do - yq eval -i ".spec.user_transformer.image.version=\"$TAG_NAME\"" $customer - yq eval -i ".spec.user_transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer + for customer in "${enabled_dt_customers[@]}"; do + yq eval -i ".spec.transformer.image.version=\"$TAG_NAME\"" $customer + yq eval -i ".spec.transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer git add $customer done - git commit -m "chore: upgrade dedicated transformers to $TAG_NAME" + git commit -m "chore: upgrade dedicated dt transformers to $TAG_NAME" git push -u origin dedicated-transformer-$TAG_NAME gh pr create --fill diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index 3053979b3e0..612dddc8332 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -29,6 +29,7 @@ jobs: if: ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true) outputs: tag_name_ut: ${{ steps.gen_tag_names.outputs.tag_name_ut }} + tag_name: ${{ steps.gen_tag_names.outputs.tag_name }} steps: - name: Checkout uses: actions/checkout@v4.2.1 @@ -71,6 +72,7 @@ jobs: needs: [generate-tag-names, build-user-transformer-image] env: UT_TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name_ut }} + TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name }} TF_IMAGE_REPOSITORY: rudderstack/rudder-transformer steps: - name: Checkout @@ -134,3 +136,39 @@ jobs: git push -u origin hosted-user-transformer-$UT_TAG_NAME gh pr create --fill + + - name: Update helm charts and raise pull request for enterprise customers on dedicated transformers + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: | + cd rudder-devops + git checkout -b dedicated-user-transformer-$TAG_NAME + + cd customer-objects + + declare -a enabled_ut_customers=() + declare -a sub_directories=('enterprise-us' 'enterprise-eu') + + # identify the customers enabled in sub-directories + for directory in "${sub_directories[@]}"; do + for f in "./$directory"/*; do + [[ -f $f ]] || continue + + enabled="$(yq e '.spec.user_transformer.enabled' $f)" + if [ $enabled == "true" ]; then + enabled_ut_customers+=( $f ) + fi + done + done + + # bump up the customers version and repository information + for customer in "${enabled_ut_customers[@]}"; do + yq eval -i ".spec.user_transformer.image.version=\"$TAG_NAME\"" $customer + yq eval -i ".spec.user_transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer + git add $customer + done + + git commit -m "chore: upgrade dedicated user transformers to $TAG_NAME" + git push -u origin dedicated-user-transformer-$TAG_NAME + + gh pr create --fill \ No newline at end of file From 1d8532e743aad1e27efbe2975551ed174cf6ae6c Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Fri, 27 Dec 2024 17:24:11 +0530 Subject: [PATCH 009/160] fix(airship): resolved minor bugsnag error (#3942) --- src/v0/destinations/airship/transform.js | 2 +- .../destinations/airship/processor/data.ts | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/src/v0/destinations/airship/transform.js b/src/v0/destinations/airship/transform.js index fcf18daa7ed..18b7a87547f 100644 --- a/src/v0/destinations/airship/transform.js +++ b/src/v0/destinations/airship/transform.js @@ -149,7 +149,7 @@ const trackResponseBuilder = async (message, { Config }) => { } payload.name = name.replace(/\s+/g, '_'); - if (payload.value) { + if (payload.value && typeof payload.value === 'string') { payload.value.replace(/\s+/g, '_'); } const { appKey, dataCenter, apiKey } = Config; diff --git a/test/integrations/destinations/airship/processor/data.ts b/test/integrations/destinations/airship/processor/data.ts index 3c6d827ce6c..973a6be0ecc 100644 --- a/test/integrations/destinations/airship/processor/data.ts +++ b/test/integrations/destinations/airship/processor/data.ts @@ -1934,6 +1934,77 @@ export const data = [ }, }, }, + { + name: 'airship', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + event: 'Product Clicked', + userId: 'testuserId1', + properties: { value: 55 }, + integrations: { All: true }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummyApiKey', + appKey: 'ffdf', + appSecret: 'fhf', + dataCenter: false, + }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://go.urbanairship.com/api/custom-events', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/vnd.urbanairship+json; version=3', + 'X-UA-Appkey': 'ffdf', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + occured: '2019-10-14T09:03:17.562Z', + user: { named_user_id: 'testuserId1' }, + body: { name: 'product_clicked', value: 55 }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, { name: 'airship', description: 'Test 17', From 7e51661ac3860f0c92411990013b3463eb9a192a Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Mon, 30 Dec 2024 12:19:25 +0530 Subject: [PATCH 010/160] chore: allure integration and migration utility for component tests (#3949) --- .gitignore | 6 +- jest.config.typescript.js | 2 +- package-lock.json | 59 +- package.json | 3 + test/integrations/component.test.ts | 17 +- .../active_campaign/processor/data.ts | 877 +++++++++++------- .../active_campaign/router/data.ts | 483 ++++++++-- .../destinations/af/processor/validation.ts | 5 + .../bloomreach/processor/identify.ts | 2 + .../destinations/bloomreach/processor/page.ts | 2 + .../bloomreach/processor/track.ts | 3 + .../bloomreach/processor/validation.ts | 4 + .../cordial/processor/identify.ts | 3 + .../destinations/cordial/processor/track.ts | 2 + .../cordial/processor/validation.ts | 2 + .../processor/configLevelFeaturesTestData.ts | 7 + .../facebook_pixel/processor/ecommTestData.ts | 12 + .../processor/identifyTestData.ts | 2 + .../processor/pageScreenTestData.ts | 8 + .../facebook_pixel/processor/trackTestData.ts | 2 + .../ga4/processor/ecomTestData.ts | 30 + .../ga4/processor/groupTestData.ts | 3 + .../ga4/processor/pageTestData.ts | 4 + .../ga4/processor/trackTestData.ts | 39 + .../ga4/processor/validationTestData.ts | 17 + .../http/processor/configuration.ts | 4 + .../intercom/processor/validationTestData.ts | 10 + .../destinations/intercom/router/data.ts | 3 + .../destinations/intercom_v2/router/data.ts | 6 + .../iterable/processor/aliasTestData.ts | 2 + .../iterable/processor/identifyTestData.ts | 7 + .../iterable/processor/pageScreenTestData.ts | 7 + .../iterable/processor/trackTestData.ts | 10 + .../iterable/processor/validationTestData.ts | 5 + .../klaviyo/processor/ecomTestData.ts | 3 + .../klaviyo/processor/groupTestData.ts | 2 + .../klaviyo/processor/groupTestDataV2.ts | 3 + .../klaviyo/processor/identifyTestData.ts | 7 + .../klaviyo/processor/identifyTestDataV2.ts | 4 + .../klaviyo/processor/screenTestData.ts | 1 + .../klaviyo/processor/screenTestDataV2.ts | 1 + .../klaviyo/processor/trackTestData.ts | 4 + .../klaviyo/processor/trackTestDataV2.ts | 3 + .../klaviyo/processor/validationTestData.ts | 1 + .../klaviyo/processor/validationTestDataV2.ts | 1 + .../destinations/klaviyo/router/data.ts | 1 + .../destinations/klaviyo/router/dataV2.ts | 6 + .../destinations/koddi/processor/clicks.ts | 1 + .../koddi/processor/conversions.ts | 2 + .../koddi/processor/impressions.ts | 1 + .../processor/configLevelFeaturesTestData.ts | 2 + .../linkedin_ads/processor/trackTestData.ts | 7 + .../processor/validationTestData.ts | 5 + .../linkedin_audience/processor/business.ts | 4 + .../linkedin_audience/processor/validation.ts | 3 + .../movable_ink/processor/identify.ts | 1 + .../movable_ink/processor/track.ts | 3 + .../movable_ink/processor/validation.ts | 6 + .../refiner/processor/groupTestData.ts | 1 + .../refiner/processor/identifyTestData.ts | 1 + .../refiner/processor/pageTestData.ts | 1 + .../refiner/processor/trackTestData.ts | 1 + .../refiner/processor/validationTestData.ts | 4 + .../topsort/processor/trackClicksTestData.ts | 4 + .../processor/trackImpressionsTestData.ts | 3 + .../processor/trackPurchasesTestData.ts | 3 + .../destinations/topsort/router/data.ts | 3 + .../tune/processor/trackTestData.ts | 3 + .../destinations/tune/router/data.ts | 2 + .../wunderkind/processor/validation.ts | 1 + test/integrations/testTypes.ts | 3 + test/scripts/migrateTest.ts | 155 ++++ test/scripts/migrationUtils.ts | 465 ++++++++++ test/test_reporter/allureReporter.ts | 134 +++ 74 files changed, 2107 insertions(+), 397 deletions(-) create mode 100644 test/scripts/migrateTest.ts create mode 100644 test/scripts/migrationUtils.ts create mode 100644 test/test_reporter/allureReporter.ts diff --git a/.gitignore b/.gitignore index 84421f49d9b..e52af90cc6c 100644 --- a/.gitignore +++ b/.gitignore @@ -139,4 +139,8 @@ dist # component test report test_reports/ -temp/ \ No newline at end of file +temp/ + +# Allure +allure-results/ +allure-report/ \ No newline at end of file diff --git a/jest.config.typescript.js b/jest.config.typescript.js index 7350f1e19d1..35997cb70c3 100644 --- a/jest.config.typescript.js +++ b/jest.config.typescript.js @@ -128,7 +128,7 @@ module.exports = { // snapshotSerializers: [], // The test environment that will be used for testing - testEnvironment: 'node', + testEnvironment: 'allure-jest/node', // Options that will be passed to the testEnvironment // testEnvironmentOptions: {}, diff --git a/package-lock.json b/package-lock.json index 2aea3c8ffd0..98e5c650c50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,6 +90,7 @@ "@types/supertest": "^6.0.2", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.59.2", + "allure-jest": "^3.0.7", "axios-mock-adapter": "^1.22.0", "benchmark-suite": "^0.1.8", "commander": "^10.0.1", @@ -109,6 +110,8 @@ "http-terminator": "^3.2.0", "husky": "^9.1.6", "jest": "^29.5.0", + "jest-diff": "^29.7.0", + "jest-environment-node": "^29.7.0", "jest-sonar": "^0.2.16", "jest-when": "^3.5.2", "lint-staged": "^13.2.2", @@ -8201,6 +8204,56 @@ } } }, + "node_modules/allure-jest": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/allure-jest/-/allure-jest-3.0.7.tgz", + "integrity": "sha512-vOFLkjreMI0br1PoSNP8AyPY3ieTLdHcBz1c5kXSyWNIxx23EPJ/TxKgg1cYyQrkpm3z3TMCj3XS3iYhVwz0/g==", + "dev": true, + "dependencies": { + "allure-js-commons": "3.0.7" + }, + "peerDependencies": { + "jest": ">=24.8.0", + "jest-circus": ">=24.8.0", + "jest-cli": ">=24.8.0", + "jest-environment-jsdom": ">=24.8.0", + "jest-environment-node": ">=24.8.0" + }, + "peerDependenciesMeta": { + "jest": { + "optional": true + }, + "jest-circus": { + "optional": true + }, + "jest-cli": { + "optional": true + }, + "jest-environment-jsdom": { + "optional": true + }, + "jest-environment-node": { + "optional": true + } + } + }, + "node_modules/allure-js-commons": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.0.7.tgz", + "integrity": "sha512-keHlPAtmzdtEK8FT5W0mOMYh9ZrdlhbrDyaaAKMNHipF/EsFak18XdbLiAKhnHbHiicE+n3BrmBU4rfQEoFHzA==", + "dev": true, + "dependencies": { + "md5": "^2.3.0" + }, + "peerDependencies": { + "allure-playwright": "3.0.7" + }, + "peerDependenciesMeta": { + "allure-playwright": { + "optional": true + } + } + }, "node_modules/amazon-dsp-formatter": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/amazon-dsp-formatter/-/amazon-dsp-formatter-1.0.2.tgz", @@ -15028,8 +15081,9 @@ }, "node_modules/jest-diff": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, - "license": "MIT", "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -15196,8 +15250,9 @@ }, "node_modules/jest-environment-node": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, - "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", diff --git a/package.json b/package.json index aa0a700681b..9066715b49d 100644 --- a/package.json +++ b/package.json @@ -135,6 +135,7 @@ "@types/supertest": "^6.0.2", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.59.2", + "allure-jest": "^3.0.7", "axios-mock-adapter": "^1.22.0", "benchmark-suite": "^0.1.8", "commander": "^10.0.1", @@ -154,6 +155,8 @@ "http-terminator": "^3.2.0", "husky": "^9.1.6", "jest": "^29.5.0", + "jest-diff": "^29.7.0", + "jest-environment-node": "^29.7.0", "jest-sonar": "^0.2.16", "jest-when": "^3.5.2", "lint-staged": "^13.2.2", diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index baad6813dfb..3175104cfa6 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -24,6 +24,7 @@ import { appendFileSync } from 'fs'; import { assertRouterOutput, responses } from '../testHelper'; import { generateTestReport, initaliseReport } from '../test_reporter/reporter'; import _ from 'lodash'; +import { enhancedTestUtils } from '../test_reporter/allureReporter'; // To run single destination test cases // npm run test:ts -- component --destination=adobe_analytics @@ -55,7 +56,12 @@ if (opts.generate === 'true') { let server: Server; -const INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE = ['klaviyo', 'campaign_manager', 'criteo_audience']; +const INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE = [ + 'active_campaign', + 'klaviyo', + 'campaign_manager', + 'criteo_audience', +]; beforeAll(async () => { initaliseReport(); @@ -153,13 +159,8 @@ const testRoute = async (route, tcData: TestCaseData) => { if (INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE.includes(tcData.name?.toLocaleLowerCase())) { expect(validateTestWithZOD(tcData, response)).toEqual(true); - const bodyMatched = _.isEqual(response.body, outputResp.body); - const statusMatched = response.status === outputResp.status; - if (bodyMatched && statusMatched) { - generateTestReport(tcData, response.body, 'passed'); - } else { - generateTestReport(tcData, response.body, 'failed'); - } + enhancedTestUtils.beforeTestRun(tcData); + enhancedTestUtils.afterTestRun(tcData, response.body); } if (outputResp?.body) { diff --git a/test/integrations/destinations/active_campaign/processor/data.ts b/test/integrations/destinations/active_campaign/processor/data.ts index cef8c2a3a80..56bb3892b92 100644 --- a/test/integrations/destinations/active_campaign/processor/data.ts +++ b/test/integrations/destinations/active_campaign/processor/data.ts @@ -1,25 +1,63 @@ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-10T06:45:10.187Z + */ + +import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; import MockAdapter from 'axios-mock-adapter'; import { isMatch } from 'lodash'; -export const data = [ +const baseMetadata: Metadata = { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-10T06:45:09.572Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; + +export const data: ProcessorTestData[] = [ { + id: 'processor-1733813110185', name: 'active_campaign', - description: 'Test 0', + description: 'Test 0: Indetify scenario which tests the happy path of creating a contact', + scenario: + 'The contact is created successfully with all the fields info , a test tag is also added and the contact is subscribe to to list 2 and unsubscribed from list 3 and an invalid operation is performed on list 3', + successCriteria: 'Processor test should pass successfully, and the contact should be created', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', messageId: '84e26acc-56a5-4835-8233-591137fca468', @@ -42,9 +80,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -54,12 +101,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiKey', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -85,10 +156,22 @@ export const data = [ firstName: 'James', lastName: 'Doe', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -99,6 +182,7 @@ export const data = [ files: {}, userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -106,23 +190,21 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 0', + description: + 'Test 1: Identify scenario which tests the happy path of creating a contact with multiple tags', + scenario: + 'Identify scenario which tests the happy path of creating a contact with all fields info and multiple tags and the contact is subscribed to list 2 and unsubscribed from list 3 and an invalid operation is performed on list 3', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', messageId: '84e26acc-56a5-4835-8233-591137fca468', @@ -145,9 +227,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -157,12 +248,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiKey', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -188,10 +303,22 @@ export const data = [ firstName: 'James', lastName: 'Doe', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -202,6 +329,7 @@ export const data = [ files: {}, userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -209,40 +337,49 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 1', + description: 'Test 2: Page scenario which tests the happy path of tracking a page view', + scenario: 'Scenario which tests the happy path of tracking a page view', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { - page: { referring_domain: 'https://www.rudderlabs.com' }, + page: { + referring_domain: 'https://www.rudderlabs.com', + }, app: { build: '1.0.0', name: 'RudderLabs JavaScript SDK', namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'jamesDoe@gmail.com', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, request_ip: '1.1.1.1', type: 'page', @@ -259,100 +396,36 @@ export const data = [ title: 'Test Page', url: 'https://www.rudderlabs.com', }, - integrations: { All: true }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - }, - ], - method: 'POST', - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, - }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { - 'Api-Token': 'dummyApiKey', - 'Content-Type': 'application/json', + integrations: { + All: true, }, - version: '1', - endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', - userId: '', + sentAt: '2019-10-14T11:15:53.296Z', }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'active_campaign', - description: 'Test 2', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { + metadata: baseMetadata, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiKey', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, - }, - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, - }, - request_ip: '1.1.1.1', - type: 'page', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', - originalTimestamp: '2019-10-14T11:15:18.299Z', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - name: 'ApplicationLoaded', - path: '/test', - referrer: 'Rudder', - search: 'abc', - title: 'Test Page', - url: 'https://www.rudderlabs.com', - }, - integrations: { All: true }, - sentAt: '2019-10-14T11:15:53.296Z', + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], - method: 'POST', }, }, output: { @@ -365,7 +438,11 @@ export const data = [ XML: {}, FORM: {}, JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, + JSON: { + siteTrackingDomain: { + name: 'rudderlabs.com', + }, + }, }, type: 'REST', files: {}, @@ -379,6 +456,7 @@ export const data = [ endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -386,23 +464,21 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 3', + description: + 'Test 3: Screen event scenario which tests the happy path of tracking a screen view', + scenario: + 'Screen event scenario which tests the happy path of tracking a screen viewn the email field is passed in the visit field for the destination and the properties name is passed in the eventdata field the event is ScreenViewed', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -412,125 +488,71 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'jamesDoe@gmail.com', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, request_ip: '1.1.1.1', - type: 'page', + type: 'screen', messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', originalTimestamp: '2019-10-14T11:15:18.299Z', anonymousId: '00000000000000000000000000', userId: '12345', properties: { - name: 'ApplicationLoaded', path: '/test', referrer: 'Rudder', - referring_domain: 'https://www.rudderlabs.com', search: 'abc', title: 'Test Page', - url: 'https://www.rudderlabs.com', - }, - integrations: { All: true }, - sentAt: '2019-10-14T11:15:53.296Z', - }, - }, - ], - method: 'POST', - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - body: { - XML: {}, - FORM: {}, - JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, + url: 'www.rudderlabs.com', + name: 'Rudder_Event_Screen_Test', }, - type: 'REST', - files: {}, - method: 'POST', - params: {}, - headers: { - 'Api-Token': 'dummyApiKey', - 'Content-Type': 'application/json', + event: 'ScreenViewed', + integrations: { + All: true, }, - version: '1', - endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', - userId: '', + sentAt: '2019-10-14T11:15:53.296Z', }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'active_campaign', - description: 'Test 4', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { + metadata: baseMetadata, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiKey', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, - }, - message: { - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', - locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, - }, - request_ip: '1.1.1.1', - type: 'screen', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', - originalTimestamp: '2019-10-14T11:15:18.299Z', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - path: '/test', - referrer: 'Rudder', - search: 'abc', - title: 'Test Page', - url: 'www.rudderlabs.com', - name: 'Rudder_Event_Screen_Test', - }, - event: 'ScreenViewed', - integrations: { All: true }, - sentAt: '2019-10-14T11:15:53.296Z', + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], - method: 'POST', }, }, output: { @@ -563,6 +585,7 @@ export const data = [ endpoint: 'https://trackcmp.net/event', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -570,23 +593,20 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 5', + description: 'Test 4: Track event scenario which tests the happy path of tracking an event', + scenario: + 'Track event scenraio where the event name is Tracking Action and the properties name is Rudder_Event_Track_Test', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', context: { @@ -596,26 +616,60 @@ export const data = [ model: 'Redmi 6', name: 'xiaomi', }, - network: { carrier: 'Banglalink' }, - os: { name: 'android', version: '8.1.0' }, + network: { + carrier: 'Banglalink', + }, + os: { + name: 'android', + version: '8.1.0', + }, traits: { email: 'jamesDoe@gmail.com', - address: { city: 'Dhaka', country: 'Bangladesh' }, + address: { + city: 'Dhaka', + country: 'Bangladesh', + }, anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', }, }, event: 'Tracking Action', - integrations: { All: true }, + integrations: { + All: true, + }, message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8', - properties: { name: 'Rudder_Event_Track_Test' }, + properties: { + name: 'Rudder_Event_Track_Test', + }, userId: 'test_user_id', timestamp: '2019-09-01T15:46:51.693Z', originalTimestamp: '2019-09-01T15:46:51.693Z', type: 'track', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiKey', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -648,6 +702,7 @@ export const data = [ endpoint: 'https://trackcmp.net/event', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -655,23 +710,20 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 6', + description: + 'Test 5: Identify scenario which tests the happy path of creating/updating a contact with all fields info', + scenario: 'Scneario is exactly same as Test 0', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -681,13 +733,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -707,9 +767,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -719,12 +788,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiKey', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -742,10 +835,22 @@ export const data = [ email: 'jamesDoe@gmail.com', phone: '92374162212', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -762,32 +867,29 @@ export const data = [ endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', userId: '', }, + metadata: baseMetadata, statusCode: 200, }, ], }, }, }, - { + id: 'processor-1733813110186', name: 'active_campaign', description: - 'Test 7: node error(ECONNABORTED) where there is no response coming from dest. server', + 'Test 6: node error(ECONNABORTED) where there is no response coming from dest. server', + scenario: + 'Scenario which tests the failure case where there is no response from the destination server', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.dumber.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -797,13 +899,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -823,9 +933,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -835,12 +954,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiKey', + apiUrl: 'https://active.campaigns.dumber.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -848,17 +991,20 @@ export const data = [ status: 200, body: [ { + metadata: baseMetadata, + statusCode: 500, error: '{"message":"Failed to create new contact (undefined,\\"[ECONNABORTED] :: Connection aborted\\")","destinationResponse":"[ECONNABORTED] :: Connection aborted"}', statTags: { destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', errorCategory: 'network', errorType: 'retryable', feature: 'processor', implementation: 'native', module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 500, }, ], }, @@ -890,23 +1036,20 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 8: erreneous response from active_campaign server(5xx)', + description: 'Test 7: erreneous response from active_campaign server(5xx)', + scenario: + 'Scenario which tests the failure case where the destination server returns a 5xx error', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.dumber2.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -916,13 +1059,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -942,9 +1093,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -954,12 +1114,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiKey', + apiUrl: 'https://active.campaigns.dumber2.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -967,17 +1151,20 @@ export const data = [ status: 200, body: [ { + metadata: baseMetadata, + statusCode: 504, error: '{"message":"Failed to create new contact (undefined,\\"\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n \\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\naccurx.api-us1.com | 504: Gateway time-out\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n\\\\\\\\n
\\\\\\\\n
\\\\\\\\n
\\\\\\\\n

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

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

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

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

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

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

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

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

What happened?

\\\\\\\\n

The web server reported a gateway time-out error.

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

What can I do?

\\\\\\\\n

Please try again in a few minutes.

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

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

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

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

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

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

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

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

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

What happened?

\\\\n

The web server reported a gateway time-out error.

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

What can I do?

\\\\n

Please try again in a few minutes.

\\\\n
\\\\n
\\\\n
\\\\n\\\\n \\\\n\\\\n\\\\n
\\\\n
\\\\n\\\\n\\\\n\\")"}', statTags: { destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', errorCategory: 'network', errorType: 'retryable', feature: 'processor', implementation: 'native', module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 504, }, ], }, @@ -1016,23 +1203,19 @@ export const data = [ }, }, { + id: 'processor-1733813110186', name: 'active_campaign', - description: 'Test 9: erreneous response from active_campaign server(4xx)', + description: 'Test 8: erreneous response from active_campaign server(4xx)', + scenario: 'Scenrio which tests the processor when the active_campaign server returns 4xx error', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - apiKey: 'dummyApiKey', - apiUrl: 'https://active.campaigns.dumber2.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, message: { channel: 'web', context: { @@ -1042,13 +1225,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -1068,9 +1259,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -1080,12 +1280,36 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiKey', + apiUrl: 'https://active.campaigns.dumber2.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -1093,17 +1317,20 @@ export const data = [ status: 200, body: [ { + metadata: baseMetadata, + statusCode: 422, error: '{"message":"Failed to create new contact (undefined,{\\"errors\\":[{\\"title\\":\\"Contact Email Address is not valid.\\",\\"detail\\":\\"\\",\\"code\\":\\"email_invalid\\",\\"error\\":\\"must_be_valid_email_address\\",\\"source\\":{\\"pointer\\":\\"/data/attributes/email\\"}}]})","destinationResponse":{"errors":[{"title":"Contact Email Address is not valid.","detail":"","code":"email_invalid","error":"must_be_valid_email_address","source":{"pointer":"/data/attributes/email"}}]}}', statTags: { destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', errorCategory: 'network', errorType: 'aborted', feature: 'processor', implementation: 'native', module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 422, }, ], }, diff --git a/test/integrations/destinations/active_campaign/router/data.ts b/test/integrations/destinations/active_campaign/router/data.ts index a73140c161c..148e330b189 100644 --- a/test/integrations/destinations/active_campaign/router/data.ts +++ b/test/integrations/destinations/active_campaign/router/data.ts @@ -1,7 +1,18 @@ -export const data = [ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-06T12:28:59.200Z + */ + +import { RouterTestData } from '../../../testTypes'; +import {} from '../../../../../src/types'; + +export const data: RouterTestData[] = [ { + id: 'router-1733488139199', name: 'active_campaign', - description: 'Test 0', + description: 'Test 0: Successful identify event', + scenario: 'Scenario which tests for a successful identify event', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -10,15 +21,6 @@ export const data = [ body: { input: [ { - destination: { - Config: { - apiKey: 'dummyApiToken', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, - metadata: { jobId: 2, userId: 'u1' }, message: { channel: 'web', context: { @@ -28,13 +30,21 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, messageId: '84e26acc-56a5-4835-8233-591137fca468', session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', @@ -56,9 +66,18 @@ export const data = [ Random: 'random', }, lists: [ - { id: 2, status: 'subscribe' }, - { id: 3, status: 'unsubscribe' }, - { id: 3, status: 'unsubscribexyz' }, + { + id: 2, + status: 'subscribe', + }, + { + id: 3, + status: 'unsubscribe', + }, + { + id: 3, + status: 'unsubscribexyz', + }, ], address: { city: 'kolkata', @@ -68,9 +87,66 @@ export const data = [ street: '', }, }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T09:03:22.563Z', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiToken', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], destType: 'active_campaign', @@ -96,10 +172,22 @@ export const data = [ lastName: 'Doe', phone: '92374162212', fieldValues: [ - { field: '0', value: 'Trastkiv' }, - { field: '1', value: 'Russia' }, - { field: '3', value: '||Potato||Onion||' }, - { field: '4', value: 'random' }, + { + field: '0', + value: 'Trastkiv', + }, + { + field: '1', + value: 'Russia', + }, + { + field: '3', + value: '||Potato||Onion||', + }, + { + field: '4', + value: 'random', + }, ], }, }, @@ -108,21 +196,72 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { 'Api-Token': 'dummyApiToken', 'Content-Type': 'application/json' }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, version: '1', endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, ], }, @@ -130,8 +269,11 @@ export const data = [ }, }, { + id: 'router-1733488139199', name: 'active_campaign', - description: 'Test 1', + description: 'Test 1: Test case for a successful page event', + scenario: 'Scenario which tests for a successful page event', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -140,15 +282,6 @@ export const data = [ body: { input: [ { - destination: { - Config: { - apiKey: 'dummyApiToken', - apiUrl: 'https://active.campaigns.rudder.com', - actid: '476550467', - eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', - }, - }, - metadata: { jobId: 2, userId: 'u1' }, message: { channel: 'web', context: { @@ -158,13 +291,24 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'jamesDoe@gmail.com', anonymousId: '12345' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'jamesDoe@gmail.com', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, request_ip: '1.1.1.1', type: 'page', @@ -181,9 +325,66 @@ export const data = [ title: 'Test Page', url: 'https://www.rudderlabs.com', }, - integrations: { All: true }, + integrations: { + All: true, + }, sentAt: '2019-10-14T11:15:53.296Z', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: 'dummyApiToken', + apiUrl: 'https://active.campaigns.rudder.com', + actid: '476550467', + eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], destType: 'active_campaign', @@ -202,27 +403,82 @@ export const data = [ XML: {}, FORM: {}, JSON_ARRAY: {}, - JSON: { siteTrackingDomain: { name: 'rudderlabs.com' } }, + JSON: { + siteTrackingDomain: { + name: 'rudderlabs.com', + }, + }, }, type: 'REST', files: {}, method: 'POST', params: {}, - headers: { 'Api-Token': 'dummyApiToken', 'Content-Type': 'application/json' }, + headers: { + 'Api-Token': 'dummyApiToken', + 'Content-Type': 'application/json', + }, version: '1', endpoint: 'https://active.campaigns.rudder.com/api/3/siteTrackingDomains', }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, ], }, @@ -230,8 +486,11 @@ export const data = [ }, }, { + id: 'router-1733488139199', name: 'active_campaign', - description: 'Test 2', + description: 'Test 2: Page event with invalid URL', + scenario: 'Scenario which tests for a page event with invalid URL', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -246,7 +505,10 @@ export const data = [ sentAt: '2023-01-10T22:31:10.954Z', channel: 'web', context: { - os: { name: '', version: '' }, + os: { + name: '', + version: '', + }, app: { name: 'RudderLabs JavaScript SDK', build: '1.0.0', @@ -273,7 +535,10 @@ export const data = [ innerHeight: 782, }, traits: {}, - library: { name: 'RudderLabs JavaScript SDK', version: '2.20.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '2.20.0', + }, campaign: {}, sessionId: 1673389635049, userAgent: @@ -297,18 +562,66 @@ export const data = [ receivedAt: '2023-01-10T22:31:11.612Z', request_ip: '0.0.0.20', anonymousId: '878e8f5f-9b6c-4aef-b5d3-1b970a13f17a', - integrations: { All: true }, + integrations: { + All: true, + }, originalTimestamp: '2023-01-10T22:31:10.943Z', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 5, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: { jobId: 5, userId: 'u1' }, }, ], destType: 'active_campaign', @@ -322,25 +635,75 @@ export const data = [ body: { output: [ { - error: 'Invalid URL: url', - statTags: { - destType: 'ACTIVE_CAMPAIGN', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'router', - implementation: 'native', - module: 'destination', - }, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 5, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 400, - metadata: [{ jobId: 5, userId: 'u1' }], - batched: false, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: 'dummyApiToken', apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + batched: false, + error: 'Invalid URL: url', + statTags: { + destType: 'ACTIVE_CAMPAIGN', + destinationId: 'default-destination', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspace', }, }, ], diff --git a/test/integrations/destinations/af/processor/validation.ts b/test/integrations/destinations/af/processor/validation.ts index 8042570c7d2..b36cd7d15da 100644 --- a/test/integrations/destinations/af/processor/validation.ts +++ b/test/integrations/destinations/af/processor/validation.ts @@ -1786,6 +1786,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1843,6 +1844,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1900,6 +1902,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1956,6 +1959,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2016,6 +2020,7 @@ export const newConfigValidationTests: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach/processor/identify.ts b/test/integrations/destinations/bloomreach/processor/identify.ts index 2a79cb57e38..cf9486081b7 100644 --- a/test/integrations/destinations/bloomreach/processor/identify.ts +++ b/test/integrations/destinations/bloomreach/processor/identify.ts @@ -30,6 +30,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -107,6 +108,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach/processor/page.ts b/test/integrations/destinations/bloomreach/processor/page.ts index 3081feeb26a..ae454ba3ef3 100644 --- a/test/integrations/destinations/bloomreach/processor/page.ts +++ b/test/integrations/destinations/bloomreach/processor/page.ts @@ -40,6 +40,7 @@ export const page: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -97,6 +98,7 @@ export const page: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach/processor/track.ts b/test/integrations/destinations/bloomreach/processor/track.ts index a369f508b23..bca516a3b4c 100644 --- a/test/integrations/destinations/bloomreach/processor/track.ts +++ b/test/integrations/destinations/bloomreach/processor/track.ts @@ -30,6 +30,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -87,6 +88,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -142,6 +144,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/bloomreach/processor/validation.ts b/test/integrations/destinations/bloomreach/processor/validation.ts index 1a6199abb06..dcd36908377 100644 --- a/test/integrations/destinations/bloomreach/processor/validation.ts +++ b/test/integrations/destinations/bloomreach/processor/validation.ts @@ -34,6 +34,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -78,6 +79,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -118,6 +120,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -162,6 +165,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/cordial/processor/identify.ts b/test/integrations/destinations/cordial/processor/identify.ts index 074852b1993..ef7636a7162 100644 --- a/test/integrations/destinations/cordial/processor/identify.ts +++ b/test/integrations/destinations/cordial/processor/identify.ts @@ -39,6 +39,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -102,6 +103,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -166,6 +168,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/cordial/processor/track.ts b/test/integrations/destinations/cordial/processor/track.ts index 3e7a560a52d..3ead5a959cb 100644 --- a/test/integrations/destinations/cordial/processor/track.ts +++ b/test/integrations/destinations/cordial/processor/track.ts @@ -40,6 +40,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -96,6 +97,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/cordial/processor/validation.ts b/test/integrations/destinations/cordial/processor/validation.ts index 61f2e1cbed9..ea7dff6dac9 100644 --- a/test/integrations/destinations/cordial/processor/validation.ts +++ b/test/integrations/destinations/cordial/processor/validation.ts @@ -27,6 +27,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -71,6 +72,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts index 5a7beb41740..a8baee05863 100644 --- a/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/configLevelFeaturesTestData.ts @@ -116,6 +116,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -203,6 +204,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -294,6 +296,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -397,6 +400,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -500,6 +504,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -611,6 +616,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -702,6 +708,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts index 8e7f50ec2d2..3daf22d5c2d 100644 --- a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts @@ -124,6 +124,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -207,6 +208,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -314,6 +316,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -398,6 +401,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -482,6 +486,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -561,6 +566,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -669,6 +675,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -754,6 +761,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -800,6 +808,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -879,6 +888,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -988,6 +998,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -1097,6 +1108,7 @@ export const ecommTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts index d315b03cead..7d872efae02 100644 --- a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts @@ -120,6 +120,7 @@ export const identifyTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { advancedMapping: false }), }, ], + method: 'POST', }, }, output: { @@ -160,6 +161,7 @@ export const identifyTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts b/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts index dee772522ab..443c9e25be6 100644 --- a/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/pageScreenTestData.ts @@ -148,6 +148,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -228,6 +229,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -288,6 +290,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -371,6 +374,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -455,6 +459,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -532,6 +537,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -590,6 +596,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { standardPageCall: true }), }, ], + method: 'POST', }, }, output: { @@ -673,6 +680,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts b/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts index 9fd65945c4d..a3f2ff0ed41 100644 --- a/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/trackTestData.ts @@ -86,6 +86,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -159,6 +160,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/ecomTestData.ts b/test/integrations/destinations/ga4/processor/ecomTestData.ts index 238e44222b9..3a6f1972700 100644 --- a/test/integrations/destinations/ga4/processor/ecomTestData.ts +++ b/test/integrations/destinations/ga4/processor/ecomTestData.ts @@ -292,6 +292,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -362,6 +363,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -434,6 +436,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -504,6 +507,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -574,6 +578,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -647,6 +652,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -721,6 +727,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -794,6 +801,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -869,6 +877,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -943,6 +952,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1017,6 +1027,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1093,6 +1104,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1170,6 +1182,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1244,6 +1257,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1315,6 +1329,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1385,6 +1400,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1456,6 +1472,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1525,6 +1542,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1591,6 +1609,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1657,6 +1676,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1723,6 +1743,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1800,6 +1821,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1873,6 +1895,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1943,6 +1966,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2014,6 +2038,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2087,6 +2112,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2164,6 +2190,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2247,6 +2274,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2321,6 +2349,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2410,6 +2439,7 @@ export const ecommTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/groupTestData.ts b/test/integrations/destinations/ga4/processor/groupTestData.ts index 68daad3a8ec..9e97ac33cd7 100644 --- a/test/integrations/destinations/ga4/processor/groupTestData.ts +++ b/test/integrations/destinations/ga4/processor/groupTestData.ts @@ -113,6 +113,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -184,6 +185,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -265,6 +267,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/pageTestData.ts b/test/integrations/destinations/ga4/processor/pageTestData.ts index 672f7e8f634..3f5d357e6e2 100644 --- a/test/integrations/destinations/ga4/processor/pageTestData.ts +++ b/test/integrations/destinations/ga4/processor/pageTestData.ts @@ -122,6 +122,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -191,6 +192,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -263,6 +265,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -448,6 +451,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/trackTestData.ts b/test/integrations/destinations/ga4/processor/trackTestData.ts index ce991ff8453..d99cc24bdf0 100644 --- a/test/integrations/destinations/ga4/processor/trackTestData.ts +++ b/test/integrations/destinations/ga4/processor/trackTestData.ts @@ -158,6 +158,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -225,6 +226,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -294,6 +296,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -365,6 +368,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -432,6 +436,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -502,6 +507,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -569,6 +575,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -637,6 +644,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -703,6 +711,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -773,6 +782,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -844,6 +854,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -914,6 +925,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -981,6 +993,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1049,6 +1062,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1115,6 +1129,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1185,6 +1200,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1253,6 +1269,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1318,6 +1335,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1383,6 +1401,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1451,6 +1470,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1523,6 +1543,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1598,6 +1619,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1673,6 +1695,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1749,6 +1772,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1815,6 +1839,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1879,6 +1904,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -1944,6 +1970,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2010,6 +2037,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2076,6 +2104,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2142,6 +2171,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2215,6 +2245,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2292,6 +2323,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2379,6 +2411,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2458,6 +2491,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2542,6 +2576,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2667,6 +2702,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2752,6 +2788,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2829,6 +2866,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -2909,6 +2947,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/ga4/processor/validationTestData.ts b/test/integrations/destinations/ga4/processor/validationTestData.ts index 0030ee178ec..a7587cbac35 100644 --- a/test/integrations/destinations/ga4/processor/validationTestData.ts +++ b/test/integrations/destinations/ga4/processor/validationTestData.ts @@ -136,6 +136,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -194,6 +195,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -250,6 +252,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -301,6 +304,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -352,6 +356,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -402,6 +407,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -452,6 +458,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -497,6 +504,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -542,6 +550,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -594,6 +603,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -647,6 +657,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -700,6 +711,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -746,6 +758,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -796,6 +809,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -851,6 +865,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -898,6 +913,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -942,6 +958,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index b493a236ee0..43d39952b9a 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -26,6 +26,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -77,6 +78,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -122,6 +124,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -175,6 +178,7 @@ export const configuration: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/intercom/processor/validationTestData.ts b/test/integrations/destinations/intercom/processor/validationTestData.ts index 45fe3c1b9ec..11a303d82b9 100644 --- a/test/integrations/destinations/intercom/processor/validationTestData.ts +++ b/test/integrations/destinations/intercom/processor/validationTestData.ts @@ -108,6 +108,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -151,6 +152,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -197,6 +199,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -245,6 +248,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -293,6 +297,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -353,6 +358,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -397,6 +403,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -447,6 +454,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -490,6 +498,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -534,6 +543,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/intercom/router/data.ts b/test/integrations/destinations/intercom/router/data.ts index cc89d3f1e2d..43af421f3a3 100644 --- a/test/integrations/destinations/intercom/router/data.ts +++ b/test/integrations/destinations/intercom/router/data.ts @@ -812,6 +812,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest1, + method: 'POST', }, }, output: { @@ -993,6 +994,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest2, + method: 'POST', }, }, output: { @@ -1212,6 +1214,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest4, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/intercom_v2/router/data.ts b/test/integrations/destinations/intercom_v2/router/data.ts index 75f5ba6ae7b..4574dde9f6f 100644 --- a/test/integrations/destinations/intercom_v2/router/data.ts +++ b/test/integrations/destinations/intercom_v2/router/data.ts @@ -424,6 +424,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest1, + method: 'POST', }, }, output: { @@ -589,6 +590,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest2, + method: 'POST', }, }, output: { @@ -682,6 +684,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest3, + method: 'POST', }, }, output: { @@ -807,6 +810,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest4, + method: 'POST', }, }, output: { @@ -881,6 +885,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest5, + method: 'POST', }, }, output: { @@ -945,6 +950,7 @@ export const data: RouterTestData[] = [ input: { request: { body: rETLRecordV2RouterRequest, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/iterable/processor/aliasTestData.ts b/test/integrations/destinations/iterable/processor/aliasTestData.ts index 1ee41348596..e6893d5510c 100644 --- a/test/integrations/destinations/iterable/processor/aliasTestData.ts +++ b/test/integrations/destinations/iterable/processor/aliasTestData.ts @@ -76,6 +76,7 @@ export const aliasTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -128,6 +129,7 @@ export const aliasTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/iterable/processor/identifyTestData.ts b/test/integrations/destinations/iterable/processor/identifyTestData.ts index 21d294e2322..4c6729fc80a 100644 --- a/test/integrations/destinations/iterable/processor/identifyTestData.ts +++ b/test/integrations/destinations/iterable/processor/identifyTestData.ts @@ -88,6 +88,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -142,6 +143,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -198,6 +200,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -256,6 +259,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -320,6 +324,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -382,6 +387,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -435,6 +441,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts index a27cf9fe3b8..bc644c7f80d 100644 --- a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts +++ b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts @@ -82,6 +82,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -142,6 +143,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -204,6 +206,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -264,6 +267,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -324,6 +328,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -386,6 +391,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -443,6 +449,7 @@ export const pageScreenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/iterable/processor/trackTestData.ts b/test/integrations/destinations/iterable/processor/trackTestData.ts index 2b7d2a9c47a..7f53cd6d407 100644 --- a/test/integrations/destinations/iterable/processor/trackTestData.ts +++ b/test/integrations/destinations/iterable/processor/trackTestData.ts @@ -160,6 +160,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -222,6 +223,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -290,6 +292,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -364,6 +367,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -423,6 +427,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -499,6 +504,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -572,6 +578,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -642,6 +649,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -693,6 +701,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -744,6 +753,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/iterable/processor/validationTestData.ts b/test/integrations/destinations/iterable/processor/validationTestData.ts index 86728a868b6..5e4b9478fd3 100644 --- a/test/integrations/destinations/iterable/processor/validationTestData.ts +++ b/test/integrations/destinations/iterable/processor/validationTestData.ts @@ -75,6 +75,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -115,6 +116,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -155,6 +157,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -196,6 +199,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -239,6 +243,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/ecomTestData.ts b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts index 34eff45232a..83055cfef1d 100644 --- a/test/integrations/destinations/klaviyo/processor/ecomTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts @@ -80,6 +80,7 @@ export const ecomTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -188,6 +189,7 @@ export const ecomTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -300,6 +302,7 @@ export const ecomTestData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/groupTestData.ts b/test/integrations/destinations/klaviyo/processor/groupTestData.ts index 0002f7ce90e..844729b8225 100644 --- a/test/integrations/destinations/klaviyo/processor/groupTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/groupTestData.ts @@ -67,6 +67,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -131,6 +132,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts index da7769b1105..871388aed26 100644 --- a/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts @@ -108,6 +108,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -168,6 +169,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -228,6 +230,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestData.ts b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts index 0dd47511330..ec663cf8e93 100644 --- a/test/integrations/destinations/klaviyo/processor/identifyTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts @@ -133,6 +133,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -212,6 +213,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -296,6 +298,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { @@ -352,6 +355,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(4), }, ], + method: 'POST', }, }, output: { @@ -406,6 +410,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(5), }, ], + method: 'POST', }, }, output: { @@ -488,6 +493,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(6), }, ], + method: 'POST', }, }, output: { @@ -565,6 +571,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(7), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts index 612bfe88f89..33c85e7d6a2 100644 --- a/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts @@ -162,6 +162,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -254,6 +255,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -357,6 +359,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(4), }, ], + method: 'POST', }, }, output: { @@ -424,6 +427,7 @@ export const identifyData: ProcessorTestData[] = [ metadata: generateMetadata(5), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/screenTestData.ts b/test/integrations/destinations/klaviyo/processor/screenTestData.ts index 0a20110236b..d14c397bdca 100644 --- a/test/integrations/destinations/klaviyo/processor/screenTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/screenTestData.ts @@ -67,6 +67,7 @@ export const screenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts index 5ccbed600c1..a50659343c5 100644 --- a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts @@ -75,6 +75,7 @@ export const screenTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/trackTestData.ts b/test/integrations/destinations/klaviyo/processor/trackTestData.ts index 3bc2b1747ad..9bc4dfae21e 100644 --- a/test/integrations/destinations/klaviyo/processor/trackTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/trackTestData.ts @@ -88,6 +88,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -170,6 +171,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -244,6 +246,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { @@ -312,6 +315,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(4), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts index ecea141d386..78a3a0d7185 100644 --- a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts @@ -101,6 +101,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(2), }, ], + method: 'POST', }, }, output: { @@ -183,6 +184,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(3), }, ], + method: 'POST', }, }, output: { @@ -265,6 +267,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/validationTestData.ts b/test/integrations/destinations/klaviyo/processor/validationTestData.ts index 801e03d5417..94d0c7818b4 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestData.ts @@ -55,6 +55,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts index 10e2d15db0d..2deb1debbbc 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts @@ -55,6 +55,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/router/data.ts b/test/integrations/destinations/klaviyo/router/data.ts index 1b3f7f39ada..02e22937e12 100644 --- a/test/integrations/destinations/klaviyo/router/data.ts +++ b/test/integrations/destinations/klaviyo/router/data.ts @@ -34,6 +34,7 @@ export const data: RouterTestData[] = [ input: { request: { body: routerRequest, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/klaviyo/router/dataV2.ts b/test/integrations/destinations/klaviyo/router/dataV2.ts index 5a0a06fad10..5201abc712c 100644 --- a/test/integrations/destinations/klaviyo/router/dataV2.ts +++ b/test/integrations/destinations/klaviyo/router/dataV2.ts @@ -89,6 +89,7 @@ export const dataV2: RouterTestData[] = [ input: { request: { body: routerRequestV2, + method: 'POST', }, }, output: { @@ -422,6 +423,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -694,6 +696,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -1113,6 +1116,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -1371,6 +1375,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { @@ -1734,6 +1739,7 @@ export const dataV2: RouterTestData[] = [ ], destType: 'klaviyo', }, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/koddi/processor/clicks.ts b/test/integrations/destinations/koddi/processor/clicks.ts index 6101e9bafef..0b27c424425 100644 --- a/test/integrations/destinations/koddi/processor/clicks.ts +++ b/test/integrations/destinations/koddi/processor/clicks.ts @@ -40,6 +40,7 @@ export const clicks: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/koddi/processor/conversions.ts b/test/integrations/destinations/koddi/processor/conversions.ts index 1647ffed7db..f4516bfb984 100644 --- a/test/integrations/destinations/koddi/processor/conversions.ts +++ b/test/integrations/destinations/koddi/processor/conversions.ts @@ -52,6 +52,7 @@ export const conversions: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -122,6 +123,7 @@ export const conversions: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/koddi/processor/impressions.ts b/test/integrations/destinations/koddi/processor/impressions.ts index 840ed9139fc..90c1d6b6ae7 100644 --- a/test/integrations/destinations/koddi/processor/impressions.ts +++ b/test/integrations/destinations/koddi/processor/impressions.ts @@ -40,6 +40,7 @@ export const impressions: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts index 29ff1f10a8c..19e34e6549e 100644 --- a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts @@ -89,6 +89,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { hashData: false }), }, ], + method: 'POST', }, }, output: { @@ -164,6 +165,7 @@ export const configLevelFeaturesTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts index 53272e73bff..f8fd0a46395 100644 --- a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts @@ -148,6 +148,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -221,6 +222,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -327,6 +329,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -414,6 +417,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -472,6 +476,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -558,6 +563,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { @@ -651,6 +657,7 @@ export const trackTestData: ProcessorTestData[] = [ destination: commonDestination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts index 653ad320565..e93da3e2059 100644 --- a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts @@ -113,6 +113,7 @@ export const validationTestData: ProcessorTestData[] = [ destination: overrideDestination(commonDestination, { hashData: false }), }, ], + method: 'POST', }, }, output: { @@ -168,6 +169,7 @@ export const validationTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -219,6 +221,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -265,6 +268,7 @@ export const validationTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { @@ -351,6 +355,7 @@ export const validationTestData: ProcessorTestData[] = [ }), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_audience/processor/business.ts b/test/integrations/destinations/linkedin_audience/processor/business.ts index 28cb6a9a97b..8878d58cedc 100644 --- a/test/integrations/destinations/linkedin_audience/processor/business.ts +++ b/test/integrations/destinations/linkedin_audience/processor/business.ts @@ -85,6 +85,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -188,6 +189,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -317,6 +319,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -468,6 +471,7 @@ export const businessTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/linkedin_audience/processor/validation.ts b/test/integrations/destinations/linkedin_audience/processor/validation.ts index 3ad37b2f4de..ae63251e249 100644 --- a/test/integrations/destinations/linkedin_audience/processor/validation.ts +++ b/test/integrations/destinations/linkedin_audience/processor/validation.ts @@ -86,6 +86,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -227,6 +228,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { @@ -337,6 +339,7 @@ export const validationTestData: ProcessorTestData[] = [ }, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/movable_ink/processor/identify.ts b/test/integrations/destinations/movable_ink/processor/identify.ts index 0fe806df4ae..60c9b39d76b 100644 --- a/test/integrations/destinations/movable_ink/processor/identify.ts +++ b/test/integrations/destinations/movable_ink/processor/identify.ts @@ -31,6 +31,7 @@ export const identify: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/movable_ink/processor/track.ts b/test/integrations/destinations/movable_ink/processor/track.ts index 890de11a0cf..e34e1799e59 100644 --- a/test/integrations/destinations/movable_ink/processor/track.ts +++ b/test/integrations/destinations/movable_ink/processor/track.ts @@ -33,6 +33,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -96,6 +97,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -159,6 +161,7 @@ export const track: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/movable_ink/processor/validation.ts b/test/integrations/destinations/movable_ink/processor/validation.ts index 6aafb5e2c07..575337a20fb 100644 --- a/test/integrations/destinations/movable_ink/processor/validation.ts +++ b/test/integrations/destinations/movable_ink/processor/validation.ts @@ -27,6 +27,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -71,6 +72,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -111,6 +113,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -154,6 +157,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -197,6 +201,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -241,6 +246,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/groupTestData.ts b/test/integrations/destinations/refiner/processor/groupTestData.ts index e3a05357f5a..7ee6ad7e687 100644 --- a/test/integrations/destinations/refiner/processor/groupTestData.ts +++ b/test/integrations/destinations/refiner/processor/groupTestData.ts @@ -62,6 +62,7 @@ export const groupTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/identifyTestData.ts b/test/integrations/destinations/refiner/processor/identifyTestData.ts index cc3704bb451..0d4b4a0d037 100644 --- a/test/integrations/destinations/refiner/processor/identifyTestData.ts +++ b/test/integrations/destinations/refiner/processor/identifyTestData.ts @@ -88,6 +88,7 @@ export const identifyTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/pageTestData.ts b/test/integrations/destinations/refiner/processor/pageTestData.ts index b6c782202eb..c53804db9f2 100644 --- a/test/integrations/destinations/refiner/processor/pageTestData.ts +++ b/test/integrations/destinations/refiner/processor/pageTestData.ts @@ -75,6 +75,7 @@ export const pageTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/trackTestData.ts b/test/integrations/destinations/refiner/processor/trackTestData.ts index e10ac6f0f58..cdea22540d8 100644 --- a/test/integrations/destinations/refiner/processor/trackTestData.ts +++ b/test/integrations/destinations/refiner/processor/trackTestData.ts @@ -85,6 +85,7 @@ export const trackTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/refiner/processor/validationTestData.ts b/test/integrations/destinations/refiner/processor/validationTestData.ts index 20a9694fdf6..5b408b5e5c8 100644 --- a/test/integrations/destinations/refiner/processor/validationTestData.ts +++ b/test/integrations/destinations/refiner/processor/validationTestData.ts @@ -83,6 +83,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -125,6 +126,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -166,6 +168,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { @@ -208,6 +211,7 @@ export const validationTestData: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/topsort/processor/trackClicksTestData.ts b/test/integrations/destinations/topsort/processor/trackClicksTestData.ts index 2cfd4589053..7e187cc0d4c 100644 --- a/test/integrations/destinations/topsort/processor/trackClicksTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackClicksTestData.ts @@ -97,6 +97,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -216,6 +217,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -356,6 +358,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -477,6 +480,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts b/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts index 2f1fc60571c..385a068d70b 100644 --- a/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts @@ -93,6 +93,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -212,6 +213,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -352,6 +354,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts b/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts index a4736fb471b..b1ab98b8f12 100644 --- a/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts @@ -93,6 +93,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -212,6 +213,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -355,6 +357,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/topsort/router/data.ts b/test/integrations/destinations/topsort/router/data.ts index 0cabdcbac8d..d226f8610c4 100644 --- a/test/integrations/destinations/topsort/router/data.ts +++ b/test/integrations/destinations/topsort/router/data.ts @@ -97,6 +97,7 @@ export const data: RouterTestData[] = [ ], destType: 'topsort', }, + method: 'POST', }, }, output: { @@ -228,6 +229,7 @@ export const data: RouterTestData[] = [ ], destType: 'topsort', }, + method: 'POST', }, }, output: { @@ -353,6 +355,7 @@ export const data: RouterTestData[] = [ ], destType: 'topsort', }, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/tune/processor/trackTestData.ts b/test/integrations/destinations/tune/processor/trackTestData.ts index d9bfab54e39..d42c4136b67 100644 --- a/test/integrations/destinations/tune/processor/trackTestData.ts +++ b/test/integrations/destinations/tune/processor/trackTestData.ts @@ -78,6 +78,7 @@ export const trackTestdata: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -140,6 +141,7 @@ export const trackTestdata: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { @@ -198,6 +200,7 @@ export const trackTestdata: ProcessorTestData[] = [ destination, }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/tune/router/data.ts b/test/integrations/destinations/tune/router/data.ts index 4aee5b89673..66d19f481df 100644 --- a/test/integrations/destinations/tune/router/data.ts +++ b/test/integrations/destinations/tune/router/data.ts @@ -78,6 +78,7 @@ export const data: RouterTestData[] = [ ], destType: 'tune', }, + method: 'POST', }, }, output: { @@ -156,6 +157,7 @@ export const data: RouterTestData[] = [ ], destType: 'tune', }, + method: 'POST', }, }, output: { diff --git a/test/integrations/destinations/wunderkind/processor/validation.ts b/test/integrations/destinations/wunderkind/processor/validation.ts index aeabdd497b0..38c94ecef1e 100644 --- a/test/integrations/destinations/wunderkind/processor/validation.ts +++ b/test/integrations/destinations/wunderkind/processor/validation.ts @@ -30,6 +30,7 @@ export const validation: ProcessorTestData[] = [ metadata: generateMetadata(1), }, ], + method: 'POST', }, }, output: { diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index b11403f50a5..971ef5969c6 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -45,6 +45,7 @@ export interface TestCaseData { skipGo?: string; scenario?: string; successCriteria?: string; + tags?: string[]; comment?: string; feature: string; module: string; @@ -92,6 +93,7 @@ export type ProcessorTestData = { version: string; input: { request: { + method: string; body: ProcessorTransformationRequest[]; }; }; @@ -116,6 +118,7 @@ export type RouterTestData = { input: { request: { body: RouterTransformationRequest; + method: string; }; }; output: { diff --git a/test/scripts/migrateTest.ts b/test/scripts/migrateTest.ts new file mode 100644 index 00000000000..6757aa4bd12 --- /dev/null +++ b/test/scripts/migrateTest.ts @@ -0,0 +1,155 @@ +import fs from 'fs'; +import path from 'path'; + +import prettier from 'prettier'; +import { Command } from 'commander'; + +// Initialize command line options +const program = new Command(); +program + .option('-d, --destination ', 'Destination name to migrate') + .option('-f, --feature ', 'Feature type (processor/router/proxy)', 'processor') + // .option('-p, --path ', 'Base path for test files', path.join(__dirname, 'destinations')) + .parse(process.argv); + +const options = program.opts(); + +// Default values and utility functions from the previous example +import { + migrateProcessorTestCase, + migrateRouterTestCase, + migrateProxyTestCase, + extractCommonValues, + generateOptimizedTestFile, +} from './migrationUtils'; +import { getTestData, getTestDataFilePaths } from '../integrations/testUtils'; + +function readTestFile(filePath: string): any { + try { + const fileContent = getTestData(filePath); + return fileContent; + } catch (error) { + console.error(`Error reading test file ${filePath}:`, error); + return null; + } +} + +async function formatWithPrettier(content: string, filepath: string): Promise { + try { + // Try to load prettier config from the project + const prettierConfig = await prettier.resolveConfig(filepath); + + // Format the content using prettier with either found config or defaults + const formattedContent = await prettier.format(content, { + ...prettierConfig, + filepath, // This helps prettier determine parser based on file extension + parser: 'typescript', // Fallback to typescript parser if not determined from filepath + }); + + return formattedContent; + } catch (error) { + console.error('Error formatting file with prettier:', error); + // Return original content if formatting fails + return content; + } +} + +async function enhancedwriteTestFile( + filePath: string, + testCases: any[], + feature: string, +): Promise { + try { + // Extract common values + const commonValues = extractCommonValues(testCases); + + // Generate optimized content + const content = generateOptimizedTestFile(testCases, commonValues, feature); + + // Format with prettier + const formattedContent = await formatWithPrettier(content, filePath); + + // Write the formatted content + fs.writeFileSync(filePath, formattedContent); + } catch (error) { + console.error(`Error writing to file ${filePath}:`, error); + throw error; + } +} + +async function migrateTestFiles(): Promise { + const { destination, feature } = options; + + if (!destination) { + console.error('Please specify a destination with -d or --destination'); + process.exit(1); + } + + console.log(`Starting migration for destination: ${destination}, feature: ${feature}`); + + const basePath = path.resolve(__dirname, '..'); + + const testFiles = getTestDataFilePaths(basePath, options); + + if (testFiles.length === 0) { + console.log('No test files found matching the criteria'); + return; + } + + let migratedCount = 0; + let errorCount = 0; + + for (const filePath of testFiles) { + console.log(`\nProcessing file: ${filePath}`); + try { + const testCases = readTestFile(filePath); + if (!testCases) continue; + + const migratedTests = testCases.map((testCase: any, index: number) => { + try { + switch (feature.toLowerCase()) { + case 'processor': + return migrateProcessorTestCase(testCase, index); + case 'router': + return migrateRouterTestCase(testCase, index); + case 'proxy': + return migrateProxyTestCase(testCase, index); + default: + throw new Error(`Unsupported feature type: ${feature}`); + } + } catch (error) { + console.error(`Error migrating test case: ${testCase.name || 'unnamed'}`, error); + return testCase; + } + }); + + // Create backup of original file + const backupPath = filePath.replace('data.ts', 'data.backup.ts'); + fs.copyFileSync(filePath, backupPath); + console.log(`Created backup at: ${backupPath}`); + + // Write migrated tests + await enhancedwriteTestFile(filePath, migratedTests, feature.toLowerCase()); + console.log(`Successfully migrated ${migratedTests.length} test cases in ${filePath}`); + migratedCount += migratedTests.length; + } catch (error) { + console.error(`Error processing file ${filePath}:`, error); + errorCount++; + } + } + + console.log('\nMigration Summary:'); + console.log(`Total files processed: ${testFiles.length}`); + console.log(`Total test cases migrated: ${migratedCount}`); + console.log(`Files with errors: ${errorCount}`); +} + +// Run migration if this script is called directly +if (require.main === module) { + migrateTestFiles().catch((error) => { + console.error('Migration failed:', error); + process.exit(1); + }); +} + +export { migrateTestFiles }; diff --git a/test/scripts/migrationUtils.ts b/test/scripts/migrationUtils.ts new file mode 100644 index 00000000000..67d158a85fa --- /dev/null +++ b/test/scripts/migrationUtils.ts @@ -0,0 +1,465 @@ +import { removeUndefinedValues } from '@rudderstack/integrations-lib'; +import { + Metadata, + Destination, + ProcessorTransformationRequest, + RouterTransformationRequest, + ProxyV1Request, + ProcessorTransformationResponse, + RouterTransformationResponse, +} from '../../src/types'; + +import { + TestCaseData, + ProcessorTestData, + RouterTestData, + ProxyV1TestData, +} from '../integrations/testTypes'; + +// Default metadata to fill in missing fields +const defaultMetadata: Metadata = { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: new Date().toISOString(), + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; + +// Default destination configuration +const defaultDestination: Destination = { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: {}, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, +}; + +// Utility function to migrate generic test cases +export function migrateTestCase(oldTestCase: any): TestCaseData { + return { + id: oldTestCase.id || `test-${Date.now()}`, + name: oldTestCase.name || 'Migrated Test Case', + description: oldTestCase.description || 'Migrated from legacy test case', + scenario: oldTestCase.scenario || 'Default scenario', + successCriteria: oldTestCase.successCriteria || 'Test should pass successfully', + feature: oldTestCase.feature || 'default-feature', + module: oldTestCase.module || 'default-module', + version: oldTestCase.version || '1.0.0', + input: { + request: { + method: oldTestCase.input?.request?.method || 'POST', + body: oldTestCase.input?.request?.body || {}, + headers: oldTestCase.input?.request?.headers || {}, + params: oldTestCase.input?.request?.params || {}, + }, + pathSuffix: oldTestCase.input?.pathSuffix, + }, + output: { + response: { + status: oldTestCase.output?.response?.status || 200, + body: oldTestCase.output?.response?.body || {}, + headers: oldTestCase.output?.response?.headers || {}, + }, + }, + }; +} + +// Utility function to migrate processor test cases +export function migrateProcessorTestCase(oldTestCase: any, index: number): ProcessorTestData { + const processorRequest: ProcessorTransformationRequest = { + message: oldTestCase.input?.request?.body[0]?.message || {}, + metadata: { ...defaultMetadata, ...oldTestCase.input?.request?.body[0]?.metadata }, + destination: { ...defaultDestination, ...oldTestCase.input?.request?.body[0]?.destination }, + }; + + const processorResponse: ProcessorTransformationResponse = { + output: oldTestCase.output?.response?.body[0]?.output, + metadata: { ...defaultMetadata, ...oldTestCase.output?.response?.body[0]?.metadata }, + statusCode: oldTestCase.output?.response?.body[0]?.statusCode || 200, + error: oldTestCase.output?.response?.body[0]?.error, + statTags: oldTestCase.output?.response?.body[0]?.statTags, + }; + + return removeUndefinedValues({ + id: oldTestCase.id || `processor-${Date.now()}`, + name: oldTestCase.name || 'Processor Test Case', + description: oldTestCase.description || 'Migrated processor test case', + scenario: oldTestCase.scenario || 'Default processor scenario', + successCriteria: oldTestCase.successCriteria || 'Processor test should pass successfully', + feature: oldTestCase.feature || 'processor', + module: oldTestCase.module || 'transformation', + version: oldTestCase.version || '1.0.0', + input: { + request: { + method: oldTestCase.input?.request?.method || 'POST', + body: [processorRequest], + }, + }, + output: { + response: { + status: 200, + body: [processorResponse], + }, + }, + mockFns: oldTestCase.mockFns ? `Add mock of index ${index}` : undefined, + }) as ProcessorTestData; +} + +// Utility function to migrate router test cases +export function migrateRouterTestCase(oldTestCase: any, index: number): RouterTestData { + const input = Array.isArray(oldTestCase.input.request.body.input) + ? oldTestCase.input.request.body.input.map((item: any) => ({ + message: item.message || {}, + metadata: { ...defaultMetadata, ...item.metadata }, + destination: { ...defaultDestination, ...item.destination }, + })) + : { + message: oldTestCase.input.request.body.input?.message || {}, + metadata: { ...defaultMetadata, ...oldTestCase.input.request.body.input?.metadata }, + destination: { + ...defaultDestination, + ...oldTestCase.input.request.body.input?.destination, + }, + }; + const routerRequest: RouterTransformationRequest = { + input: input, + destType: oldTestCase.input?.request?.body?.destType || 'default-destination-type', + }; + + const routerResponse: RouterTransformationResponse = oldTestCase.output.response.body.output.map( + (op) => { + return removeUndefinedValues({ + batchedRequest: op.batchedRequest, + metadata: op.metadata.map((m: any) => ({ ...defaultMetadata, ...m })), + statusCode: op.statusCode || 200, + destination: { ...defaultDestination, ...op.destination }, + batched: op.batched || false, + error: op.error, + statTags: op.statTags, + }); + }, + ); + + return removeUndefinedValues({ + id: oldTestCase.id || `router-${Date.now()}`, + name: oldTestCase.name || 'Router Test Case', + description: oldTestCase.description || 'Migrated router test case', + scenario: oldTestCase.scenario || 'Default router scenario', + successCriteria: oldTestCase.successCriteria || 'Router test should pass successfully', + feature: oldTestCase.feature || 'router', + module: oldTestCase.module || 'transformation', + version: oldTestCase.version || '1.0.0', + input: { + request: { + body: routerRequest, + method: oldTestCase.input?.request?.method || 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: routerResponse, + }, + }, + }, + mockFns: oldTestCase.mockFns ? `Add mock of index ${index}` : undefined, + }) as RouterTestData; +} + +// Utility function to migrate proxy test cases +export function migrateProxyTestCase(oldTestCase: any, index: number): ProxyV1TestData { + const proxyRequest: ProxyV1Request = { + version: oldTestCase.input?.request?.body?.version || '1.0.0', + type: oldTestCase.input?.request?.body?.type || 'default-type', + method: oldTestCase.input?.request?.body?.method || 'POST', + endpoint: oldTestCase.input?.request?.body?.endpoint || '/default-endpoint', + userId: oldTestCase.input?.request?.body?.userId || 'default-user', + metadata: [ + { + jobId: 1, + attemptNum: 1, + userId: 'default-user', + sourceId: 'default-source', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + secret: {}, + dontBatch: false, + }, + ], + destinationConfig: {}, + }; + + return { + id: oldTestCase.id || `proxy-${Date.now()}`, + name: oldTestCase.name || 'Proxy Test Case', + description: oldTestCase.description || 'Migrated proxy test case', + scenario: oldTestCase.scenario || 'Default proxy scenario', + successCriteria: oldTestCase.successCriteria || 'Proxy test should pass successfully', + feature: oldTestCase.feature || 'proxy', + module: oldTestCase.module || 'delivery', + version: oldTestCase.version || '1.0.0', + input: { + request: { + body: proxyRequest, + method: oldTestCase.input?.request?.method || 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: 'Success', + response: [ + { + error: '', + statusCode: 200, + metadata: proxyRequest.metadata[0], + }, + ], + }, + }, + }, + }, + }; +} + +interface CommonValues { + metadata?: Metadata; + destination?: Destination; + baseRequest?: { + headers?: Record; + params?: Record; + }; + commonConfig?: Record; +} + +function deepDiff(obj1: any, obj2: any): any { + const diff: any = {}; + + for (const key in obj1) { + if (typeof obj1[key] === 'object' && obj1[key] !== null) { + const nestedDiff = deepDiff(obj1[key], obj2[key] || {}); + if (Object.keys(nestedDiff).length > 0) { + diff[key] = nestedDiff; + } + } else if (obj1[key] !== obj2[key]) { + diff[key] = obj2[key]; + } + } + + return diff; +} + +export function extractCommonValues(testCases: any[]): CommonValues { + const commonValues: CommonValues = {}; + + // Only proceed if we have test cases + if (testCases.length === 0) return commonValues; + + // Extract metadata from first test case as base + const firstCase = testCases[0]; + let isMetadataCommon = true; + let isDestinationCommon = true; + let baseMetadata: Metadata | undefined; + let baseDestination: Destination | undefined; + + // For processor and router cases + if (firstCase.input?.request?.body) { + if (Array.isArray(firstCase.input.request.body)) { + baseMetadata = firstCase.input.request.body[0]?.metadata; + baseDestination = firstCase.input.request.body[0]?.destination; + } else { + baseMetadata = firstCase.input.request.body?.metadata; + baseDestination = firstCase.input.request.body?.destination; + } + } + + // Compare with other test cases + for (const testCase of testCases.slice(1)) { + let currentMetadata; + let currentDestination; + + if (testCase.input?.request?.body) { + if (Array.isArray(testCase.input.request.body)) { + currentMetadata = testCase.input.request.body[0]?.metadata; + currentDestination = testCase.input.request.body[0]?.destination; + } else { + currentMetadata = testCase.input.request.body?.metadata; + currentDestination = testCase.input.request.body?.destination; + } + } + + // Check if metadata is common + if (baseMetadata && currentMetadata) { + const metadataDiff = deepDiff(baseMetadata, currentMetadata); + if (Object.keys(metadataDiff).length > 0) { + isMetadataCommon = false; + } + } + + // Check if destination is common + if (baseDestination && currentDestination) { + const destinationDiff = deepDiff(baseDestination, currentDestination); + if (Object.keys(destinationDiff).length > 0) { + isDestinationCommon = false; + } + } + } + + if (isMetadataCommon && baseMetadata) { + commonValues.metadata = baseMetadata; + } + + if (isDestinationCommon && baseDestination) { + commonValues.destination = baseDestination; + } + + return commonValues; +} + +export function generateOptimizedTestFile( + testCases: any[], + commonValues: CommonValues, + feature: string, +): string { + const variables: string[] = []; + const imports: Set = new Set([]); + + // Add necessary imports based on common values + if (commonValues.metadata) imports.add('Metadata'); + if (commonValues.destination) imports.add('Destination'); + + // Generate common variables + if (commonValues.metadata) { + variables.push( + `const baseMetadata: Metadata = ${JSON.stringify(commonValues.metadata, null, 2)};`, + ); + } + + if (commonValues.destination) { + variables.push(` +const baseDestination: Destination = ${JSON.stringify(commonValues.destination, null, 2)};`); + } + + // Process test cases to use common variables + const processedTests = testCases.map((testCase) => { + const processedCase = { ...testCase }; + + if (commonValues.metadata && testCase.input?.request?.body) { + // Handle input metadata + if (Array.isArray(testCase.input.request.body)) { + processedCase.input.request.body = testCase.input.request.body.map((item: any) => ({ + ...item, + metadata: 'baseMetadata', // special marker + })); + } else { + processedCase.input.request.body.metadata = 'baseMetadata'; // special marker + processedCase.output.metadata = 'baseMetadata'; // special marker + } + // Handle output metadata + if (Array.isArray(testCase.output.response.body)) { + processedCase.output.response.body = testCase.output.response.body.map((item: any) => ({ + ...item, + metadata: 'baseMetadata', // special marker + })); + } else { + processedCase.output.response.body.metadata = 'baseMetadata'; // special marker + } + } + + if (commonValues.destination && testCase.input?.request?.body) { + // Handle input destination + if (Array.isArray(testCase.input.request.body)) { + processedCase.input.request.body = testCase.input.request.body.map((item: any) => ({ + ...item, + destination: 'baseDestination', // special marker + })); + } else { + processedCase.input.request.body.destination = 'baseDestination'; // special marker + } + // Handle output destination + if (Array.isArray(testCase.output.response.body)) { + processedCase.output.response.body = testCase.output.response.body.map((item: any) => ({ + ...item, + metadata: 'baseMetadata', // special marker + })); + } else { + processedCase.output.response.body.metadata = 'baseMetadata'; // special marker + } + } + + return processedCase; + }); + + // const functionReplacer = (key, value) => { + // if (typeof value === 'function') { + // return value.toString(); + // } + // return value; + // }; + + let type = ''; + if (feature === 'processor') { + type = 'ProcessorTestData'; + } else if (feature === 'router') { + type = 'RouterTestData'; + } + + // Generate the final file content + const content = `/** + * Auto-migrated and optimized test cases + * Generated on: ${new Date().toISOString()} + */ + + import { ${type} } from '../../../testTypes'; + import { ${Array.from(imports).join(', ')} } from '../../../../../src/types'; + + ${variables.join('\n')} + + export const data: ${type}[] = ${JSON.stringify(processedTests, null, 2)}; + `; + + // Replace our special markers with actual variable references + return content + .replaceAll('"baseMetadata"', 'baseMetadata') + .replaceAll('"baseDestination"', 'baseDestination'); +} diff --git a/test/test_reporter/allureReporter.ts b/test/test_reporter/allureReporter.ts new file mode 100644 index 00000000000..3165aaa96a7 --- /dev/null +++ b/test/test_reporter/allureReporter.ts @@ -0,0 +1,134 @@ +import * as allure from 'allure-js-commons'; +import { diff as jsonDiff } from 'jest-diff'; +import _ from 'lodash'; +import { TestCaseData } from '../integrations/testTypes'; +import { compareObjects } from '../integrations/testUtils'; + +interface TestReportData { + testCase: TestCaseData; + actualResponse: any; + status: 'passed' | 'failed'; + diff?: string; +} + +/** + * Enhanced test reporter with detailed JSON diff and Allure integration + */ +export const enhancedTestReport = { + /** + * Generate a detailed test report with JSON diff for failed cases + */ + generateDetailedReport(data: TestReportData) { + const { testCase, actualResponse, status } = data; + const expectedResponse = testCase.output.response?.body; + + // Create Allure test case details + allure.description(` + Feature: ${testCase.feature} + Description: ${testCase.description} + Success Criteria: ${testCase.successCriteria || 'N/A'} + Scenario: ${testCase.scenario || 'N/A'} + Test ID: ${testCase.id || 'N/A'} + API Version: ${testCase.version || 'N/A'} + `); + + // Add request/response as attachments + allure.attachment( + 'Request', + JSON.stringify(testCase.input.request, null, 2), + 'application/json', + ); + allure.attachment( + 'Actual Response', + JSON.stringify(actualResponse, null, 2), + 'application/json', + ); + + if (status === 'failed') { + const diffResult = jsonDiff(expectedResponse, actualResponse, { + expand: false, // Compact diff view + contextLines: 3, // Show 3 lines of context around changes + }); + + const diffKeys = compareObjects(expectedResponse, actualResponse); + + if (diffResult) { + allure.attachment( + 'Expected Response', + JSON.stringify(expectedResponse, null, 2), + 'application/json', + ); + + allure.attachment('Diff Keys', JSON.stringify(diffKeys), 'text/plain'); + } + + // Add failure details + const failureMessage = `Test failed for ${testCase.name}\nSee JSON diff for details`; + allure.step(failureMessage, () => { + throw new Error(failureMessage); + }); + } + + return status; + }, + + /** + * Validate test case response with enhanced reporting + */ + validateTestResponse(testCase: TestCaseData, response: any): boolean { + const expectedResponse = testCase.output.response?.body; + const actualResponse = response; + const status = _.isEqual(actualResponse, expectedResponse) ? 'passed' : 'failed'; + + this.generateDetailedReport({ + testCase, + actualResponse, + status, + }); + + return status === 'passed'; + }, +}; + +/** + * Enhanced test utilities with better organization + */ +export const enhancedTestUtils = { + /** + * Setup test suite with Allure reporting + */ + setupTestSuite(testData: TestCaseData) { + allure.epic(testData.name); + allure.feature(testData.module); + allure.story(testData.feature); + allure.displayName(testData.description); + if (testData.scenario) { + allure.tag(testData.scenario); + } + if (testData.tags) { + allure.tags(...testData.tags); + } + if (testData.id) { + allure.allureId(testData.id); + } + }, + + /** + * Run pre-test preparations + */ + beforeTestRun(testCase: TestCaseData) { + allure.step('Test Setup', () => { + // Setup new test + this.setupTestSuite(testCase); + }); + }, + + /** + * Run post-test cleanup and reporting + */ + afterTestRun(testCase: TestCaseData, response: any) { + allure.step('Test Verification', () => { + return enhancedTestReport.validateTestResponse(testCase, response); + }); + }, +}; From eaa68beab9a381e69896cbf600a9bda849d862cb Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:06:26 +0530 Subject: [PATCH 011/160] chore: remove redundant products tag when no products sent (#3951) --- src/v0/destinations/adobe_analytics/transform.js | 2 +- .../destinations/adobe_analytics/processor/data.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v0/destinations/adobe_analytics/transform.js b/src/v0/destinations/adobe_analytics/transform.js index 5d3d6e7d00f..e6f1f32630d 100644 --- a/src/v0/destinations/adobe_analytics/transform.js +++ b/src/v0/destinations/adobe_analytics/transform.js @@ -340,7 +340,7 @@ const processTrackEvent = (message, adobeEventName, destinationConfig, extras = return { ...extras, events: overrideEventString || adobeEventArr.join(','), - products: overrideProductString || prodString, + products: overrideProductString || (Array.isArray(prodString) && prodString.length > 0 ? prodString : undefined), }; }; diff --git a/test/integrations/destinations/adobe_analytics/processor/data.ts b/test/integrations/destinations/adobe_analytics/processor/data.ts index fa050897c95..2ace5bed4b9 100644 --- a/test/integrations/destinations/adobe_analytics/processor/data.ts +++ b/test/integrations/destinations/adobe_analytics/processor/data.ts @@ -1412,7 +1412,7 @@ export const data = [ JSON_ARRAY: {}, XML: { payload: - '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDK <Custom>TEDxGROWTH&MARKETINGoWatched Videohttps://www.estore.com/best-seller/1growth2020-01-09T10:01:53.558Zmktcloudid001event1footlockerrudderstackpoc', + '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDK <Custom>TEDxGROWTH&MARKETINGoWatched Videohttps://www.estore.com/best-seller/1growth2020-01-09T10:01:53.558Zmktcloudid001event1footlockerrudderstackpoc', }, FORM: {}, }, @@ -1582,7 +1582,7 @@ export const data = [ JSON_ARRAY: {}, XML: { payload: - '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001Kolkata9935400932RudderLabs JavaScript SDKopage viewhttps://www.estore.com/best-seller/1r15,faze90Rciaz,hummer,tharcustompropval1custompropval22020-01-09T10:01:53.558Zmktcloudid001event2footlockerrudderstackpoc', + '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001Kolkata9935400932RudderLabs JavaScript SDKopage viewhttps://www.estore.com/best-seller/1r15,faze90Rciaz,hummer,tharcustompropval1custompropval22020-01-09T10:01:53.558Zmktcloudid001event2footlockerrudderstackpoc', }, FORM: {}, }, @@ -3044,7 +3044,7 @@ export const data = [ JSON_ARRAY: {}, XML: { payload: - '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDKorandom unmapped eventhttps://www.estore.com/best-seller/12020-01-09T10:01:53.558Zmktcloudid001override eventfootlockerrudderstackpoc', + '17941080sales campaignweb127.0.0.1en-USDalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)https://www.google.com/search?q=estore+bestsellerroottval001RudderLabs JavaScript SDKorandom unmapped eventhttps://www.estore.com/best-seller/12020-01-09T10:01:53.558Zmktcloudid001override eventfootlockerrudderstackpoc', }, FORM: {}, }, From ac673fc22094d5567691ceaf13adca15442ea896 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Thu, 2 Jan 2025 08:49:18 +0530 Subject: [PATCH 012/160] fix: added missing eu url in delete flow for amplitude destination (#3952) Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> --- src/v0/destinations/am/deleteUsers.js | 7 +++- .../destinations/am/deleteUsers/data.ts | 41 +++++++++++++++++++ test/integrations/destinations/am/network.ts | 38 +++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) diff --git a/src/v0/destinations/am/deleteUsers.js b/src/v0/destinations/am/deleteUsers.js index 96c4f7b19c7..1fde1c4142e 100644 --- a/src/v0/destinations/am/deleteUsers.js +++ b/src/v0/destinations/am/deleteUsers.js @@ -16,7 +16,7 @@ const userDeletionHandler = async (userAttributes, config) => { if (!config) { throw new ConfigurationError('Config for deletion not present'); } - const { apiKey, apiSecret } = config; + const { apiKey, apiSecret, residencyServer } = config; if (!apiKey || !apiSecret) { throw new ConfigurationError('api key/secret for deletion not present'); } @@ -27,7 +27,10 @@ const userDeletionHandler = async (userAttributes, config) => { }; // Ref : https://www.docs.developers.amplitude.com/analytics/apis/user-privacy-api/#response const batchEvents = getUserIdBatches(userAttributes, DELETE_MAX_BATCH_SIZE); - const url = 'https://amplitude.com/api/2/deletions/users'; + const url = + residencyServer === 'EU' + ? 'https://analytics.eu.amplitude.com/api/2/deletions/users' + : 'https://amplitude.com/api/2/deletions/users'; const endpointPath = '/api/2/deletions/users'; await Promise.all( batchEvents.map(async (batch) => { diff --git a/test/integrations/destinations/am/deleteUsers/data.ts b/test/integrations/destinations/am/deleteUsers/data.ts index bd10a4d7e05..3431df980e5 100644 --- a/test/integrations/destinations/am/deleteUsers/data.ts +++ b/test/integrations/destinations/am/deleteUsers/data.ts @@ -393,4 +393,45 @@ export const data = [ }, }, }, + { + name: 'am', + description: 'user deletion test with EU residencyServer', + feature: 'userDeletion', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + jobId: 'dummy-job-id', + destType: 'AM', + userAttributes: [ + { + userId: 'test_user_id_1', + }, + { + userId: 'test_user_id_2', + }, + ], + config: { + apiKey: '1234', + apiSecret: 'abcd', + residencyServer: 'EU', + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 200, + status: 'successful', + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/am/network.ts b/test/integrations/destinations/am/network.ts index 5cd016069c7..19181e50662 100644 --- a/test/integrations/destinations/am/network.ts +++ b/test/integrations/destinations/am/network.ts @@ -205,6 +205,44 @@ const deleteNwData = [ }, }, }, + { + httpReq: { + method: 'post', + url: 'https://analytics.eu.amplitude.com/api/2/deletions/users', + data: { + user_ids: ['test_user_id_1', 'test_user_id_2'], + requester: 'RudderStack', + ignore_invalid_id: 'true', + }, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic MTIzNDphYmNk', + }, + }, + httpRes: { + data: [ + { + active_scrub_done_date: null, + amplitude_ids: [ + { + amplitude_id: 44547850078, + requested_on_day: '2024-12-01', + requester: 'RudderStack', + }, + { + amplitude_id: 44547886812, + requested_on_day: '2024-12-01', + requester: 'RudderStack', + }, + ], + app: '10000000', + day: '2025-01-10', + status: 'staging', + }, + ], + status: 200, + }, + }, ]; const deliveryNwData = [ From 0dedaa2983b25ab529a5bc5b34ab70ebbf94fb3e Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:47:55 +0530 Subject: [PATCH 013/160] fix: property and event name mappings in shopify v2 (#3941) * fix: property and event name mappings in shopify v2 * chore: server suffix in checkout started webhook event * chore: remove value from updation webhook events * chore: update comflicting event name with webhook suffix --------- Co-authored-by: Krishna Chaitanya --- src/v1/sources/shopify/config.js | 20 +++- .../webhookEventsMapping/identifyMapping.json | 112 ++++++++++++++++++ .../lineItemsMapping.json | 32 +++++ .../shopify/webhookEventsMapping/mapping.json | 10 ++ .../webhookEventsMapping/productMapping.json | 24 ++++ .../serverSideTransform.js | 4 +- .../serverSideUtils.test.js | 6 +- .../webhookTransformations/serverSideUtlis.js | 10 +- .../pixelTestScenarios/CheckoutStepsTests.ts | 2 +- .../CheckoutEventsTests.ts | 36 +++--- 10 files changed, 225 insertions(+), 31 deletions(-) create mode 100644 src/v1/sources/shopify/webhookEventsMapping/identifyMapping.json create mode 100644 src/v1/sources/shopify/webhookEventsMapping/lineItemsMapping.json create mode 100644 src/v1/sources/shopify/webhookEventsMapping/mapping.json create mode 100644 src/v1/sources/shopify/webhookEventsMapping/productMapping.json diff --git a/src/v1/sources/shopify/config.js b/src/v1/sources/shopify/config.js index 5d88353d60c..9cb11e471f5 100644 --- a/src/v1/sources/shopify/config.js +++ b/src/v1/sources/shopify/config.js @@ -31,10 +31,17 @@ const PIXEL_EVENT_MAPPING = { checkout_address_info_submitted: 'Checkout Address Info Submitted', checkout_contact_info_submitted: 'Checkout Contact Info Submitted', checkout_shipping_info_submitted: 'Checkout Shipping Info Submitted', - payment_info_submitted: 'Payment Info Submitted', + payment_info_submitted: 'Payment Info Entered', search_submitted: 'Search Submitted', }; +const RUDDER_ECOM_MAP = { + checkouts_create: 'Checkout Started - Webhook', + checkouts_update: 'Checkout Updated', + orders_updated: 'Order Updated', + orders_create: 'Order Created', +}; + const contextualFieldMappingJSON = JSON.parse( fs.readFileSync(path.resolve(__dirname, 'pixelEventsMappings', 'contextualFieldMapping.json')), ); @@ -63,6 +70,14 @@ const checkoutStartedCompletedEventMappingJSON = JSON.parse( ), ); +const productMappingJSON = JSON.parse( + fs.readFileSync(path.resolve(__dirname, 'webhookEventsMapping', 'productMapping.json')), +); + +const lineItemsMappingJSON = JSON.parse( + fs.readFileSync(path.resolve(__dirname, 'webhookEventsMapping', 'lineItemsMapping.json')), +); + const pixelEventToCartTokenLocationMapping = { cart_viewed: 'properties.cart_id', checkout_address_info_submitted: commonCartTokenLocation, @@ -79,6 +94,7 @@ module.exports = { INTEGERATION, PIXEL_EVENT_TOPICS, PIXEL_EVENT_MAPPING, + RUDDER_ECOM_MAP, contextualFieldMappingJSON, cartViewedEventMappingJSON, productListViewedEventMappingJSON, @@ -86,4 +102,6 @@ module.exports = { productToCartEventMappingJSON, checkoutStartedCompletedEventMappingJSON, pixelEventToCartTokenLocationMapping, + productMappingJSON, + lineItemsMappingJSON, }; diff --git a/src/v1/sources/shopify/webhookEventsMapping/identifyMapping.json b/src/v1/sources/shopify/webhookEventsMapping/identifyMapping.json new file mode 100644 index 00000000000..03672675028 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/identifyMapping.json @@ -0,0 +1,112 @@ +[ + { + "sourceKeys": "id", + "destKeys": "userId" + }, + { + "sourceKeys": "email", + "destKeys": "traits.email" + }, + + { + "sourceKeys": "first_name", + "destKeys": "traits.firstName" + }, + + { + "sourceKeys": "last_name", + "destKeys": "traits.lastName" + }, + + { + "sourceKeys": "phone", + "destKeys": "traits.phone" + }, + + { + "sourceKeys": "addresses", + "destKeys": "traits.addressList" + }, + + { + "sourceKeys": "default_address", + "destKeys": "traits.address" + }, + + { + "sourceKeys": "shipping_address", + "destKeys": "traits.shippingAddress" + }, + + { + "sourceKeys": "billing_address", + "destKeys": "traits.billingAddress" + }, + + { + "sourceKeys": "accepts_marketing", + "destKeys": "traits.acceptsMarketing" + }, + + { + "sourceKeys": "orders_count", + "destKeys": "traits.orderCount" + }, + + { + "sourceKeys": "state", + "destKeys": "traits.state" + }, + { + "sourceKeys": "total_spent", + "destKeys": "traits.totalSpent" + }, + { + "sourceKeys": "note", + "destKeys": "traits.note" + }, + { + "sourceKeys": "verified_email", + "destKeys": "traits.verifiedEmail" + }, + { + "sourceKeys": "multipass_identifier", + "destKeys": "traits.multipassIdentifier" + }, + { + "sourceKeys": "tax_exempt", + "destKeys": "traits.taxExempt" + }, + { + "sourceKeys": "tags", + "destKeys": "traits.tags" + }, + { + "sourceKeys": "last_order_name", + "destKeys": "traits.lastOrderName" + }, + { + "sourceKeys": "currency", + "destKeys": "traits.currency" + }, + { + "sourceKeys": "marketing_opt_in_level", + "destKeys": "traits.marketingOptInLevel" + }, + { + "sourceKeys": "tax_exemptions", + "destKeys": "traits.taxExemptions" + }, + { + "sourceKeys": "sms_marketing_consent", + "destKeys": "traits.smsMarketingConsent" + }, + { + "sourceKeys": "admin_graphql_api_id", + "destKeys": "traits.adminGraphqlApiId" + }, + { + "sourceKeys": "accepts_marketing_updated_at", + "destKeys": "traits.acceptsMarketingUpdatedAt" + } +] diff --git a/src/v1/sources/shopify/webhookEventsMapping/lineItemsMapping.json b/src/v1/sources/shopify/webhookEventsMapping/lineItemsMapping.json new file mode 100644 index 00000000000..3bcef331b07 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/lineItemsMapping.json @@ -0,0 +1,32 @@ +[ + { + "sourceKeys": "product_id", + "destKey": "product_id", + "metadata": { + "type": "toString" + } + }, + { + "sourceKeys": "sku", + "destKey": "sku" + }, + { + "sourceKeys": "name", + "destKey": "title" + }, + { + "sourceKeys": "price", + "destKey": "price", + "metadata": { + "type": "toNumber" + } + }, + { + "sourceKeys": "vendor", + "destKey": "brand" + }, + { + "sourceKeys": "quantity", + "destKey": "quantity" + } +] diff --git a/src/v1/sources/shopify/webhookEventsMapping/mapping.json b/src/v1/sources/shopify/webhookEventsMapping/mapping.json new file mode 100644 index 00000000000..6c268ef13c6 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/mapping.json @@ -0,0 +1,10 @@ +[ + { + "sourceKeys": "line_items", + "destKeys": "products" + }, + { + "sourceKeys": "id", + "destKeys": "properties.order_id" + } +] diff --git a/src/v1/sources/shopify/webhookEventsMapping/productMapping.json b/src/v1/sources/shopify/webhookEventsMapping/productMapping.json new file mode 100644 index 00000000000..e78ed50dfc4 --- /dev/null +++ b/src/v1/sources/shopify/webhookEventsMapping/productMapping.json @@ -0,0 +1,24 @@ +[ + { + "sourceKeys": "id", + "destKey": "order_id", + "metadata": { + "type": "toString" + } + }, + { + "sourceKeys": "total_price", + "destKey": "value" + }, + { + "sourceKeys": "total_tax", + "destKey": "tax", + "metadata": { + "type": "toNumber" + } + }, + { + "sourceKeys": "currency", + "destKey": "currency" + } +] diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 292a980a93b..d0221f6950a 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -11,11 +11,11 @@ const { MAPPING_CATEGORIES, IDENTIFY_TOPICS, ECOM_TOPICS, - RUDDER_ECOM_MAP, SUPPORTED_TRACK_EVENTS, SHOPIFY_TRACK_MAP, lineItemsMappingJSON, } = require('../../../../v0/sources/shopify/config'); +const { RUDDER_ECOM_MAP } = require('../config'); const { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, @@ -46,7 +46,7 @@ const ecomPayloadBuilder = (event, shopifyTopic) => { message.setEventType(EventType.TRACK); message.setEventName(RUDDER_ECOM_MAP[shopifyTopic]); - const properties = createPropertiesForEcomEventFromWebhook(event); + const properties = createPropertiesForEcomEventFromWebhook(event, shopifyTopic); message.properties = removeUndefinedAndNullValues(properties); // Map Customer details if present const customerDetails = get(event, 'customer'); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index 4a2839103b9..b94ec9c3ddf 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -98,11 +98,11 @@ describe('serverSideUtils.js', () => { const result = createPropertiesForEcomEventFromWebhook(message); expect(result).toEqual({ products: [ - { brand: 'Hydrogen Vendor', price: '600.00', product_id: 7234590408818, quantity: 1 }, + { brand: 'Hydrogen Vendor', price: 600.0, product_id: '7234590408818', quantity: 1 }, { brand: 'Hydrogen Vendor', - price: '600.00', - product_id: 7234590408817, + price: 600.0, + product_id: '7234590408817', quantity: 1, title: 'The Collection Snowboard: Nitrogen', }, diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index 951fa479e4f..df33d7a347a 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -1,9 +1,6 @@ const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); const { constructPayload } = require('../../../../v0/util'); -const { - lineItemsMappingJSON, - productMappingJSON, -} = require('../../../../v0/sources/shopify/config'); +const { lineItemsMappingJSON, productMappingJSON } = require('../config'); /** * Returns an array of products from the lineItems array received from the webhook event @@ -28,12 +25,15 @@ const getProductsFromLineItems = (lineItems, mapping) => { * @param {Object} message * @returns {Object} properties */ -const createPropertiesForEcomEventFromWebhook = (message) => { +const createPropertiesForEcomEventFromWebhook = (message, shopifyTopic) => { const { line_items: lineItems } = message; if (!lineItems || lineItems.length === 0) { return []; } const mappedPayload = constructPayload(message, productMappingJSON); + if (shopifyTopic === 'orders_updated' || shopifyTopic === 'checkouts_update') { + delete mappedPayload.value; + } mappedPayload.products = getProductsFromLineItems(lineItems, lineItemsMappingJSON); return mappedPayload; }; diff --git a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts index 38f682ac6da..3db2e3ab101 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts @@ -2037,7 +2037,7 @@ export const pixelCheckoutStepsScenarios = [ SHOPIFY: true, }, type: 'track', - event: 'Payment Info Submitted', + event: 'Payment Info Entered', properties: { buyerAcceptsEmailMarketing: false, buyerAcceptsSmsMarketing: false, diff --git a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts index a154ccb890c..b6fa5be322e 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts @@ -217,16 +217,16 @@ export const checkoutEventsTestScenarios = [ SHOPIFY: true, }, type: 'track', - event: 'Checkout Started', + event: 'Checkout Started - Webhook', properties: { - order_id: 35550298931313, + order_id: '35550298931313', value: '600.00', - tax: '0.00', + tax: 0, currency: 'USD', products: [ { - product_id: 7234590408817, - price: '600.00', + product_id: '7234590408817', + price: 600.0, brand: 'Hydrogen Vendor', quantity: 1, }, @@ -533,17 +533,16 @@ export const checkoutEventsTestScenarios = [ }, properties: { currency: 'USD', - order_id: 35374569160817, + order_id: '35374569160817', products: [ { brand: 'pixel-testing-rs', - price: '729.95', - product_id: 7234590638193, + price: 729.95, + product_id: '7234590638193', quantity: 1, }, ], - tax: '0.00', - value: '736.85', + tax: 0, }, timestamp: '2024-09-17T07:29:02.000Z', traits: { @@ -1207,15 +1206,14 @@ export const checkoutEventsTestScenarios = [ type: 'track', event: 'Order Updated', properties: { - order_id: 5778367414385, - value: '600.00', - tax: '0.00', + order_id: '5778367414385', + tax: 0, currency: 'USD', products: [ { - product_id: 7234590408817, + product_id: '7234590408817', title: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, brand: 'Hydrogen Vendor', quantity: 1, }, @@ -1598,15 +1596,15 @@ export const checkoutEventsTestScenarios = [ type: 'track', event: 'Order Created', properties: { - order_id: 5778367414385, + order_id: '5778367414385', value: '600.00', - tax: '0.00', + tax: 0, currency: 'USD', products: [ { - product_id: 7234590408817, + product_id: '7234590408817', title: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, brand: 'Hydrogen Vendor', quantity: 1, }, From 49eb59180581b34252b601101ce2450e639c0850 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:25:13 +0530 Subject: [PATCH 014/160] fix: use correct endpoint for custom events (#3954) * fix: use correct endpoint for custom events * fix: sonar cloud issue --- src/v0/destinations/branch/data/eventMapping.js | 1 + src/v0/destinations/branch/transform.js | 16 +++++++--------- .../destinations/branch/processor/data.ts | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/v0/destinations/branch/data/eventMapping.js b/src/v0/destinations/branch/data/eventMapping.js index 84ae1a07af4..abab6a29932 100644 --- a/src/v0/destinations/branch/data/eventMapping.js +++ b/src/v0/destinations/branch/data/eventMapping.js @@ -40,6 +40,7 @@ const CommerceEventConfig = { 'Spend Credits': 'SPEND_CREDITS', 'Promotion Viewed': 'VIEW_AD', 'Promotion Clicked': 'CLICK_AD', + Purchase: 'PURCHASE', Reserve: 'RESERVE', }, event_data: ['transaction_id', 'currency', 'revenue', 'shipping', 'tax', 'coupon', 'description'], diff --git a/src/v0/destinations/branch/transform.js b/src/v0/destinations/branch/transform.js index 2626d8aa812..8362f10723a 100644 --- a/src/v0/destinations/branch/transform.js +++ b/src/v0/destinations/branch/transform.js @@ -46,17 +46,16 @@ function getCategoryAndName(rudderEventName) { let requiredName = null; let requiredCategory = null; // eslint-disable-next-line array-callback-return, sonarjs/no-ignored-return - Object.keys(category.name).find((branchKey) => { + Object.keys(category.name).forEach((branchKey) => { if ( typeof branchKey === 'string' && typeof rudderEventName === 'string' && - branchKey.toLowerCase() === rudderEventName.toLowerCase() + (branchKey.toLowerCase() === rudderEventName.toLowerCase() || + category.name[branchKey].toLowerCase() === rudderEventName.toLowerCase()) ) { requiredName = category.name[branchKey]; requiredCategory = category; - return true; } - return false; }); if (requiredName != null && requiredCategory != null) { return { evName: requiredName, category: requiredCategory }; @@ -116,14 +115,12 @@ function mapPayload(category, rudderProperty, rudderPropertiesObj) { let valFound = false; if (category.content_items) { // eslint-disable-next-line sonarjs/no-ignored-return - Object.keys(category.content_items).find((branchMappingProperty) => { + Object.keys(category.content_items).forEach((branchMappingProperty) => { if (branchMappingProperty === rudderProperty) { const tmpKeyName = category.content_items[branchMappingProperty]; contentItems[tmpKeyName] = rudderPropertiesObj[rudderProperty]; valFound = true; - return true; } - return false; }); } @@ -217,16 +214,17 @@ function getCommonPayload(message, category, evName) { function processMessage(message, destination) { let evName; let category; + let updatedEventName = message.event; switch (message.type) { case EventType.TRACK: { if (!message.event) { throw new InstrumentationError('Event name is required'); } - ({ evName, category } = getCategoryAndName(message.event)); const eventNameFromConfig = getMappedEventNameFromConfig(message, destination); if (eventNameFromConfig) { - evName = eventNameFromConfig; + updatedEventName = eventNameFromConfig; } + ({ evName, category } = getCategoryAndName(updatedEventName)); break; } case EventType.IDENTIFY: diff --git a/test/integrations/destinations/branch/processor/data.ts b/test/integrations/destinations/branch/processor/data.ts index dc1bdd33bca..70da041d2b5 100644 --- a/test/integrations/destinations/branch/processor/data.ts +++ b/test/integrations/destinations/branch/processor/data.ts @@ -1505,7 +1505,7 @@ export const data = [ branchKey: 'test_branch_key', eventsMapping: [ { - from: 'Order Completed', + from: 'Some Random Event', to: 'PURCHASE', }, ], @@ -1561,7 +1561,7 @@ export const data = [ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, - event: 'Order Completed', + event: 'Some Random Event', integrations: { All: true, }, From b3280adc694bce6ef3cdb35e8c715c1dfa5b2f06 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Fri, 3 Jan 2025 15:47:33 +0530 Subject: [PATCH 015/160] chore: update test cases for branch (#3955) * fix: use correct endpoint for custom events * chore: update test cases with types * chore: address comment and remove redundant test cases * chore: add branch name to updated list --- .../destinations/adobe_analytics/transform.js | 4 +- test/integrations/component.test.ts | 1 + .../destinations/branch/processor/data.ts | 1203 +++-------------- .../destinations/branch/router/data.ts | 306 ++++- 4 files changed, 487 insertions(+), 1027 deletions(-) diff --git a/src/v0/destinations/adobe_analytics/transform.js b/src/v0/destinations/adobe_analytics/transform.js index e6f1f32630d..ecc2fdd4573 100644 --- a/src/v0/destinations/adobe_analytics/transform.js +++ b/src/v0/destinations/adobe_analytics/transform.js @@ -340,7 +340,9 @@ const processTrackEvent = (message, adobeEventName, destinationConfig, extras = return { ...extras, events: overrideEventString || adobeEventArr.join(','), - products: overrideProductString || (Array.isArray(prodString) && prodString.length > 0 ? prodString : undefined), + products: + overrideProductString || + (Array.isArray(prodString) && prodString.length > 0 ? prodString : undefined), }; }; diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 3175104cfa6..85c2eac2cd0 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -61,6 +61,7 @@ const INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE = [ 'klaviyo', 'campaign_manager', 'criteo_audience', + 'branch', ]; beforeAll(async () => { diff --git a/test/integrations/destinations/branch/processor/data.ts b/test/integrations/destinations/branch/processor/data.ts index 70da041d2b5..e5519b7c39a 100644 --- a/test/integrations/destinations/branch/processor/data.ts +++ b/test/integrations/destinations/branch/processor/data.ts @@ -1,7 +1,53 @@ -export const data = [ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-30T11:04:59.426Z + */ + +import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; + +const baseMetadata: Metadata = { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T11:04:58.693Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; + +export const data: ProcessorTestData[] = [ { + id: 'processor-1735556699424', name: 'branch', description: 'Test 0', + scenario: + 'Success scenario where the event will be mapped to standard event through default mappings', + successCriteria: 'Should hit the standard endpoint', feature: 'processor', module: 'destination', version: 'v0', @@ -9,21 +55,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -80,8 +111,30 @@ export const data = [ type: 'track', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -129,6 +182,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -136,8 +190,11 @@ export const data = [ }, }, { + id: 'processor-1735556699424', name: 'branch', description: 'Test 1', + scenario: 'Success scenario with identify event', + successCriteria: 'Should hit the custom endpoint with userId as event name', feature: 'processor', module: 'destination', version: 'v0', @@ -145,21 +202,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -212,8 +254,30 @@ export const data = [ type: 'identify', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -261,6 +325,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -268,8 +333,11 @@ export const data = [ }, }, { + id: 'processor-1735556699424', name: 'branch', description: 'Test 2', + scenario: 'Default processor scenario', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', @@ -277,112 +345,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: '', - version: '', - }, - screen: { - density: 2, - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'page', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - statTags: { - destType: 'BRANCH', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - error: 'Message type is not supported', - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 3', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -409,7 +371,7 @@ export const data = [ }, locale: 'en-US', os: { - name: 'watchos', + name: 'tvos', }, screen: { density: 2, @@ -437,8 +399,30 @@ export const data = [ type: 'track', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -464,7 +448,7 @@ export const data = [ }, ], user_data: { - os: 'watchos', + os: 'tvos', app_version: '1.0.0', screen_dpi: 2, developer_identity: 'sampath', @@ -485,6 +469,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -492,8 +477,11 @@ export const data = [ }, }, { + id: 'processor-1735556699424', name: 'branch', - description: 'Test 4', + description: 'Test 3', + scenario: 'Successful scenario with track event but without any products', + successCriteria: 'The transformed payload should not contain any content_items', feature: 'processor', module: 'destination', version: 'v0', @@ -501,21 +489,6 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', @@ -533,6 +506,7 @@ export const data = [ manufacturer: 'Google', model: 'AOSP on IA Emulator', name: 'generic_x86_arm', + type: 'ios', attTrackingStatus: 3, }, ip: '0.0.0.0', @@ -542,7 +516,8 @@ export const data = [ }, locale: 'en-US', os: { - name: 'ipados', + name: 'iOS', + version: '14.4.1', }, screen: { density: 2, @@ -560,9 +535,6 @@ export const data = [ }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', - properties: { - name: 'sampath', - }, receivedAt: '2020-01-17T10:23:52.688+05:30', request_ip: '[::1]:64059', sentAt: '2020-01-17T04:53:52.667Z', @@ -570,8 +542,30 @@ export const data = [ type: 'track', userId: 'sampath', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], + method: 'POST', }, }, output: { @@ -591,13 +585,9 @@ export const data = [ params: {}, body: { JSON: { - content_items: [ - { - $product_name: 'sampath', - }, - ], user_data: { - os: 'ipados', + os: 'iOS', + os_version: '14.4.1', app_version: '1.0.0', screen_dpi: 2, developer_identity: 'sampath', @@ -618,6 +608,7 @@ export const data = [ files: {}, userId: 'sampath', }, + metadata: baseMetadata, statusCode: 200, }, ], @@ -625,8 +616,11 @@ export const data = [ }, }, { + id: 'processor-1735556699425', name: 'branch', - description: 'Test 5', + description: 'Test 4', + scenario: 'Failure scenario when event name is not present', + successCriteria: 'Should return error message for missing event name', feature: 'processor', module: 'destination', version: 'v0', @@ -634,31 +628,10 @@ export const data = [ request: { body: [ { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'sampath', channel: 'web', context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, device: { adTrackingEnabled: true, advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -666,6 +639,7 @@ export const data = [ manufacturer: 'Google', model: 'AOSP on IA Emulator', name: 'generic_x86_arm', + type: 'ios', attTrackingStatus: 3, }, ip: '0.0.0.0', @@ -675,10 +649,8 @@ export const data = [ }, locale: 'en-US', os: { - name: 'tvos', - }, - screen: { - density: 2, + name: 'iOS', + version: '14.4.1', }, traits: { anonymousId: 'sampath', @@ -687,753 +659,42 @@ export const data = [ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, - event: 'product added', integrations: { All: true, }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', - properties: { - name: 'sampath', - }, - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - content_items: [ - { - $product_name: 'sampath', - }, - ], - user_data: { - os: 'tvos', - app_version: '1.0.0', - screen_dpi: 2, - developer_identity: 'sampath', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 6', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - screen: { - density: 2, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - event: 'product added', - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - user_data: { - os: 'iOS', - os_version: '14.4.1', - app_version: '1.0.0', - screen_dpi: 2, - developer_identity: 'sampath', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 7', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - screen: { - density: 2, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - event: 'product added', - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - user_data: { - app_version: '1.0.0', - screen_dpi: 2, - developer_identity: 'sampath', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 8', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - event: 'product added', - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - user_data: { - os: 'iOS', - os_version: '14.4.1', - developer_identity: 'sampath', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: false, - model: 'AOSP on IA Emulator', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - name: 'ADD_TO_CART', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', - }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 9', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 3, - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'track', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - statusCode: 400, - error: 'Event name is required', - statTags: { - destType: 'BRANCH', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - }, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 10', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'Android', - attTrackingStatus: 2, - brand: 'testBrand', - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'Android', - version: '9', - }, - screen: { - density: 2, - height: 1794, - width: 1080, - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', receivedAt: '2020-01-17T10:23:52.688+05:30', request_ip: '[::1]:64059', sentAt: '2020-01-17T04:53:52.667Z', timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'identify', - userId: 'sampath', - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/custom', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - custom_data: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - content_items: [{}], - user_data: { - os: 'Android', - os_version: '9', - app_version: '1.0.0', - model: 'AOSP on IA Emulator', - brand: 'testBrand', - screen_dpi: 2, - screen_height: 1794, - screen_width: 1080, - developer_identity: 'sampath', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - aaid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: true, - }, - name: 'sampath', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, + type: 'track', userId: 'sampath', }, - statusCode: 200, - }, - ], - }, - }, - }, - { - name: 'branch', - description: 'Test 11', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { + metadata: baseMetadata, destination: { - Config: { - branchKey: '', - useNativeSDK: false, - }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], - }, - message: { - anonymousId: 'sampath', - channel: 'web', - context: { - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.0.0', - }, - device: { - adTrackingEnabled: true, - advertisingId: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - manufacturer: 'Google', - model: 'AOSP on IA Emulator', - name: 'generic_x86_arm', - type: 'ios', - attTrackingStatus: 2, - brand: 'testBrand', - }, - ip: '0.0.0.0', - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.0.0', - }, - locale: 'en-US', - os: { - name: 'iOS', - version: '14.4.1', - }, - screen: { - density: 2, - height: 1794, - width: 1080, - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - }, - integrations: { - All: true, - }, - traits: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', - originalTimestamp: '2020-01-17T04:53:51.185Z', - receivedAt: '2020-01-17T10:23:52.688+05:30', - request_ip: '[::1]:64059', - sentAt: '2020-01-17T04:53:52.667Z', - timestamp: '2020-01-17T10:23:51.206+05:30', - type: 'identify', - userId: 'sampath', + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], + method: 'POST', }, }, output: { @@ -1441,86 +702,38 @@ export const data = [ status: 200, body: [ { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api2.branch.io/v2/event/custom', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json', - }, - params: {}, - body: { - JSON: { - custom_data: { - anonymousId: 'sampath', - email: 'sampath@gmail.com', - }, - content_items: [{}], - user_data: { - os: 'iOS', - os_version: '14.4.1', - app_version: '1.0.0', - model: 'AOSP on IA Emulator', - brand: 'testBrand', - screen_dpi: 2, - screen_height: 1794, - screen_width: 1080, - developer_identity: 'sampath', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', - idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', - limit_ad_tracking: true, - }, - name: 'sampath', - branch_key: '', - }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'sampath', + metadata: baseMetadata, + statusCode: 400, + error: 'Event name is required', + statTags: { + destType: 'BRANCH', + destinationId: 'default-destination', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspace', }, - statusCode: 200, }, ], }, }, }, { + id: 'processor-1735556699425', name: 'branch', - description: 'Map event name to branch standard event name in track call', + description: 'Test 5', + scenario: 'Default processor scenario', + successCriteria: 'Processor test should pass successfully', feature: 'processor', module: 'destination', version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - Config: { - branchKey: 'test_branch_key', - eventsMapping: [ - { - from: 'Some Random Event', - to: 'PURCHASE', - }, - ], - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, message: { anonymousId: 'anonId123', channel: 'web', @@ -1582,6 +795,33 @@ export const data = [ type: 'track', userId: 'userId123', }, + metadata: baseMetadata, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: 'test_branch_key', + eventsMapping: [ + { + from: 'Some Random Event', + to: 'PURCHASE', + }, + ], + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], }, @@ -1640,6 +880,7 @@ export const data = [ files: {}, userId: 'anonId123', }, + metadata: baseMetadata, statusCode: 200, }, ], diff --git a/test/integrations/destinations/branch/router/data.ts b/test/integrations/destinations/branch/router/data.ts index 6451c463f18..ddfebb4e1bb 100644 --- a/test/integrations/destinations/branch/router/data.ts +++ b/test/integrations/destinations/branch/router/data.ts @@ -1,7 +1,18 @@ -export const data = [ +/** + * Auto-migrated and optimized test cases + * Generated on: 2024-12-30T12:23:26.084Z + */ + +import { RouterTestData } from '../../../testTypes'; +import {} from '../../../../../src/types'; + +export const data: RouterTestData[] = [ { + id: 'router-1735561406084', name: 'branch', description: 'Test 0', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -10,19 +21,6 @@ export const data = [ body: { input: [ { - destination: { - Config: { branchKey: '', useNativeSDK: false }, - DestinationDefinition: { - DisplayName: 'Branch Metrics', - ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', - Name: 'BRANCH', - }, - Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', - Transformations: [], - }, - metadata: { jobId: 1, userId: 'u1' }, message: { anonymousId: 'sampath', channel: 'web', @@ -34,19 +32,34 @@ export const data = [ version: '1.0.0', }, ip: '0.0.0.0', - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, locale: 'en-US', - os: { name: 'iOS', version: '' }, - screen: { density: 2 }, - traits: { anonymousId: 'sampath', email: 'sampath@gmail.com' }, + os: { + name: 'iOS', + version: '', + }, + screen: { + density: 2, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, event: 'product added', - integrations: { All: true }, + integrations: { + All: true, + }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', - properties: { name: 'sampath' }, + properties: { + name: 'sampath', + }, receivedAt: '2020-01-17T10:23:52.688+05:30', request_ip: '[::1]:64059', sentAt: '2020-01-17T04:53:52.667Z', @@ -54,21 +67,61 @@ export const data = [ type: 'track', userId: 'sampath', }, - }, - { + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, destination: { - Config: { branchKey: '', useNativeSDK: false }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: { jobId: 2, userId: 'u1' }, + }, + { message: { anonymousId: 'sampath', channel: 'web', @@ -80,15 +133,28 @@ export const data = [ version: '1.0.0', }, ip: '0.0.0.0', - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, locale: 'en-US', - os: { name: 'iOS', version: '' }, - screen: { density: 2 }, + os: { + name: 'iOS', + version: '', + }, + screen: { + density: 2, + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36', }, - integrations: { All: true }, - traits: { anonymousId: 'sampath', email: 'sampath@gmail.com' }, + integrations: { + All: true, + }, + traits: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, messageId: 'ea5cfab2-3961-4d8a-8187-3d1858c90a9f', originalTimestamp: '2020-01-17T04:53:51.185Z', receivedAt: '2020-01-17T10:23:52.688+05:30', @@ -98,6 +164,59 @@ export const data = [ type: 'identify', userId: 'sampath', }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + destination: { + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', + DestinationDefinition: { + DisplayName: 'Branch Metrics', + ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', + Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], destType: 'branch', @@ -116,13 +235,20 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api2.branch.io/v2/event/standard', - headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, params: {}, body: { JSON: { branch_key: '', name: 'ADD_TO_CART', - content_items: [{ $product_name: 'sampath' }], + content_items: [ + { + $product_name: 'sampath', + }, + ], user_data: { os: 'iOS', os_version: '', @@ -140,21 +266,63 @@ export const data = [ files: {}, userId: 'sampath', }, - metadata: [{ jobId: 1, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { - Config: { branchKey: '', useNativeSDK: false }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, { batchedRequest: { @@ -162,13 +330,19 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api2.branch.io/v2/event/custom', - headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, params: {}, body: { JSON: { branch_key: '', name: 'sampath', - custom_data: { anonymousId: 'sampath', email: 'sampath@gmail.com' }, + custom_data: { + anonymousId: 'sampath', + email: 'sampath@gmail.com', + }, content_items: [{}], user_data: { os: 'iOS', @@ -187,21 +361,63 @@ export const data = [ files: {}, userId: 'sampath', }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-30T12:23:25.430Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], statusCode: 200, destination: { - Config: { branchKey: '', useNativeSDK: false }, + ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', + Name: 'branch test', DestinationDefinition: { DisplayName: 'Branch Metrics', ID: '1WTpBSTiL3iAUHUdW7rHT4sawgU', Name: 'BRANCH', + Config: {}, + }, + Config: { + branchKey: '', + useNativeSDK: false, }, Enabled: true, - ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', - Name: 'branch test', + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, ], }, From 0cc278a052aafab8a06c81442eee225e3e0d9045 Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Fri, 3 Jan 2025 16:04:23 +0530 Subject: [PATCH 016/160] chore: clean up unused env (#3958) --- src/routes/index.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/routes/index.ts b/src/routes/index.ts index 890d5752f63..9bd40b8e680 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -16,9 +16,6 @@ import { isNotEmpty } from '../v0/util'; dotenv.config(); -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const enableSwagger = process.env.ENABLE_SWAGGER === 'true'; - export function applicationRoutes(app: Koa) { app.use(proxyRoutes); app.use(destinationRoutes); From 30377b879cfdcfcd30a8f9c3b425401045ace755 Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Mon, 6 Jan 2025 11:06:43 +0530 Subject: [PATCH 017/160] chore: upgrade axios version to 1.7.9 (#3956) --- package-lock.json | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 98e5c650c50..6a7d4ce983c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", "amazon-dsp-formatter": "^1.0.2", - "axios": "^1.7.3", + "axios": "^1.7.9", "btoa": "^1.2.1", "component-each": "^0.2.6", "crypto-js": "^4.2.0", @@ -8535,8 +8535,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.7.5", - "license": "MIT", + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", diff --git a/package.json b/package.json index 9066715b49d..f7d7e447493 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", "amazon-dsp-formatter": "^1.0.2", - "axios": "^1.7.3", + "axios": "^1.7.9", "btoa": "^1.2.1", "component-each": "^0.2.6", "crypto-js": "^4.2.0", From c47488decf8e79b9a2e0277bd85a8e895ffecc56 Mon Sep 17 00:00:00 2001 From: shrouti1507 <60211312+shrouti1507@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:02:18 +0530 Subject: [PATCH 018/160] fix: adding transformer proxy for iterable (#3878) * fix: adding transformer proxy for iterable * fix: adding component test cases * fix: adding factory pattern * fix: code redesigning * fix: decoupling networkHandler and specific strategy * fix: simplifying logic * fix: convert to registry pattern * fix: converting to typescript * fix: removing unnecessary comments * fix: adding data delivery test cases for all endpoints * chore: improve iterable network handler (#3918) * chore: improve iterable network handler * chore: add comment in principal strategy class * chore: rename from PrincipalStrategy to BaseStrategy * chore: update expect-error comment --------- Co-authored-by: Sai Sankeerth * fix: review comments addressed * fix: small refactoring * fix: update for supporting disallowed events * fix: code review suggestion Co-authored-by: Sankeerth * fix: fixing test cases * fix: review comment addressed * fix: adding type definitions * fix: separating handle error functions * fix: migrating processor and router test cases * fix: review comment addressed --------- Co-authored-by: Sankeerth Co-authored-by: Sai Sankeerth --- src/v0/destinations/iterable/config.js | 23 + src/v0/destinations/iterable/util.js | 13 +- src/v0/destinations/iterable/util.test.js | 1 - .../destinations/iterable/networkHandler.ts | 33 + .../destinations/iterable/strategies/base.ts | 22 + .../iterable/strategies/generic.ts | 57 + .../iterable/strategies/track-identify.ts | 69 + src/v1/destinations/iterable/types.ts | 69 + src/v1/destinations/iterable/utils.test.ts | 184 +++ src/v1/destinations/iterable/utils.ts | 92 ++ .../iterable/dataDelivery/business.ts | 799 +++++++++ .../iterable/dataDelivery/data.ts | 3 + .../iterable/dataDelivery/network.ts | 575 +++++++ .../iterable/processor/aliasTestData.ts | 151 +- .../iterable/processor/identifyTestData.ts | 781 ++++++--- .../iterable/processor/pageScreenTestData.ts | 735 ++++++--- .../iterable/processor/trackTestData.ts | 1423 ++++++++++++----- .../iterable/processor/validationTestData.ts | 199 ++- .../destinations/iterable/router/data.ts | 515 +++++- 19 files changed, 4762 insertions(+), 982 deletions(-) create mode 100644 src/v1/destinations/iterable/networkHandler.ts create mode 100644 src/v1/destinations/iterable/strategies/base.ts create mode 100644 src/v1/destinations/iterable/strategies/generic.ts create mode 100644 src/v1/destinations/iterable/strategies/track-identify.ts create mode 100644 src/v1/destinations/iterable/types.ts create mode 100644 src/v1/destinations/iterable/utils.test.ts create mode 100644 src/v1/destinations/iterable/utils.ts create mode 100644 test/integrations/destinations/iterable/dataDelivery/business.ts create mode 100644 test/integrations/destinations/iterable/dataDelivery/data.ts create mode 100644 test/integrations/destinations/iterable/dataDelivery/network.ts diff --git a/src/v0/destinations/iterable/config.js b/src/v0/destinations/iterable/config.js index 125367875f2..e60e444c18a 100644 --- a/src/v0/destinations/iterable/config.js +++ b/src/v0/destinations/iterable/config.js @@ -76,11 +76,31 @@ const constructEndpoint = (dataCenter, category) => { return `${baseUrl}${category.endpoint}`; }; +const BULK_ENDPOINTS = ['/api/users/bulkUpdate', '/api/events/trackBulk']; + const IDENTIFY_MAX_BATCH_SIZE = 1000; const IDENTIFY_MAX_BODY_SIZE_IN_BYTES = 4000000; const TRACK_MAX_BATCH_SIZE = 8000; +const ITERABLE_RESPONSE_USER_ID_PATHS = [ + 'invalidUserIds', + 'failedUpdates.invalidUserIds', + 'failedUpdates.notFoundUserIds', + 'failedUpdates.forgottenUserIds', + 'failedUpdates.conflictUserIds', + 'failedUpdates.invalidDataUserIds', +]; + +const ITERABLE_RESPONSE_EMAIL_PATHS = [ + 'invalidEmails', + 'failedUpdates.invalidEmails', + 'failedUpdates.notFoundEmails', + 'failedUpdates.forgottenEmails', + 'failedUpdates.conflictEmails', + 'failedUpdates.invalidDataEmails', +]; + module.exports = { mappingConfig, ConfigCategory, @@ -88,4 +108,7 @@ module.exports = { TRACK_MAX_BATCH_SIZE, IDENTIFY_MAX_BATCH_SIZE, IDENTIFY_MAX_BODY_SIZE_IN_BYTES, + ITERABLE_RESPONSE_USER_ID_PATHS, + ITERABLE_RESPONSE_EMAIL_PATHS, + BULK_ENDPOINTS, }; diff --git a/src/v0/destinations/iterable/util.js b/src/v0/destinations/iterable/util.js index b918600253f..764d76f8825 100644 --- a/src/v0/destinations/iterable/util.js +++ b/src/v0/destinations/iterable/util.js @@ -483,6 +483,7 @@ const batchUpdateUserEvents = (updateUserEvents, registerDeviceOrBrowserTokenEve /** * Processes chunks of catalog events, extracts the necessary data, and prepares batched requests for further processing + * ref : https://api.iterable.com/api/docs#catalogs_bulkUpdateCatalogItems * @param {*} catalogEventsChunks * @returns */ @@ -600,12 +601,12 @@ const batchTrackEvents = (trackEvents) => { */ const prepareBatchRequests = (filteredEvents) => { const { - trackEvents, - catalogEvents, - errorRespList, - updateUserEvents, - eventResponseList, - registerDeviceOrBrowserTokenEvents, + trackEvents, // track + catalogEvents, // identify + errorRespList, // track + updateUserEvents, // identify + eventResponseList, // track + registerDeviceOrBrowserTokenEvents, // identify } = filteredEvents; const updateUserBatchedResponseList = diff --git a/src/v0/destinations/iterable/util.test.js b/src/v0/destinations/iterable/util.test.js index 098960ac775..6bbf00ba085 100644 --- a/src/v0/destinations/iterable/util.test.js +++ b/src/v0/destinations/iterable/util.test.js @@ -8,7 +8,6 @@ const { registerDeviceTokenEventPayloadBuilder, registerBrowserTokenEventPayloadBuilder, } = require('./util'); - const { ConfigCategory } = require('./config'); const getTestMessage = () => { diff --git a/src/v1/destinations/iterable/networkHandler.ts b/src/v1/destinations/iterable/networkHandler.ts new file mode 100644 index 00000000000..e3edb5daab7 --- /dev/null +++ b/src/v1/destinations/iterable/networkHandler.ts @@ -0,0 +1,33 @@ +import { prepareProxyRequest, proxyRequest } from '../../../adapters/network'; +import { processAxiosResponse } from '../../../adapters/utils/networkUtils'; +import { BULK_ENDPOINTS } from '../../../v0/destinations/iterable/config'; +import { GenericStrategy } from './strategies/generic'; +import { TrackIdentifyStrategy } from './strategies/track-identify'; +import { GenericProxyHandlerInput } from './types'; + +const strategyRegistry: { [key: string]: any } = { + [TrackIdentifyStrategy.name]: new TrackIdentifyStrategy(), + [GenericStrategy.name]: new GenericStrategy(), +}; + +const getResponseStrategy = (endpoint: string) => { + if (BULK_ENDPOINTS.some((path) => endpoint.includes(path))) { + return strategyRegistry[TrackIdentifyStrategy.name]; + } + return strategyRegistry[GenericStrategy.name]; +}; + +const responseHandler = (responseParams: GenericProxyHandlerInput) => { + const { destinationRequest } = responseParams; + const strategy = getResponseStrategy(destinationRequest.endpoint); + return strategy.handleResponse(responseParams); +}; + +function networkHandler(this: any) { + this.prepareProxy = prepareProxyRequest; + this.proxy = proxyRequest; + this.processAxiosResponse = processAxiosResponse; + this.responseHandler = responseHandler; +} + +export { networkHandler }; diff --git a/src/v1/destinations/iterable/strategies/base.ts b/src/v1/destinations/iterable/strategies/base.ts new file mode 100644 index 00000000000..dfde1e92253 --- /dev/null +++ b/src/v1/destinations/iterable/strategies/base.ts @@ -0,0 +1,22 @@ +import { isHttpStatusSuccess } from '../../../../v0/util'; +import { GenericProxyHandlerInput } from '../types'; + +// Base strategy is the base class for all strategies in Iterable destination +abstract class BaseStrategy { + handleResponse(responseParams: GenericProxyHandlerInput): void { + const { destinationResponse } = responseParams; + const { status } = destinationResponse; + + if (!isHttpStatusSuccess(status)) { + return this.handleError(responseParams); + } + + return this.handleSuccess(responseParams); + } + + abstract handleError(responseParams: GenericProxyHandlerInput): void; + + abstract handleSuccess(responseParams: any): void; +} + +export { BaseStrategy }; diff --git a/src/v1/destinations/iterable/strategies/generic.ts b/src/v1/destinations/iterable/strategies/generic.ts new file mode 100644 index 00000000000..e43eb7623b5 --- /dev/null +++ b/src/v1/destinations/iterable/strategies/generic.ts @@ -0,0 +1,57 @@ +import { BaseStrategy } from './base'; +import { + GenericProxyHandlerInput, + IterableBulkApiResponse, + IterableSuccessResponse, +} from '../types'; +import { ProxyMetdata } from '../../../../types'; +import { TransformerProxyError } from '../../../../v0/util/errorTypes'; +import { TAG_NAMES } from '../../../../v0/util/tags'; +import { getDynamicErrorType } from '../../../../adapters/utils/networkUtils'; + +class GenericStrategy extends BaseStrategy { + handleSuccess(responseParams: { + destinationResponse: IterableBulkApiResponse; + rudderJobMetadata: ProxyMetdata[]; + }): IterableSuccessResponse { + const { destinationResponse, rudderJobMetadata } = responseParams; + const { status } = destinationResponse; + + const responseWithIndividualEvents = rudderJobMetadata.map((metadata) => ({ + statusCode: status, + metadata, + error: 'success', + })); + + return { + status, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse, + response: responseWithIndividualEvents, + }; + } + + handleError(responseParams: GenericProxyHandlerInput): void { + const { destinationResponse, rudderJobMetadata } = responseParams; + const { response, status } = destinationResponse; + const responseMessage = response.params || response.msg || response.message; + const errorMessage = JSON.stringify(responseMessage) || 'unknown error format'; + + const responseWithIndividualEvents = rudderJobMetadata.map((metadata) => ({ + statusCode: status, + metadata, + error: errorMessage, + })); + + throw new TransformerProxyError( + `ITERABLE: Error transformer proxy during ITERABLE response transformation. ${errorMessage}`, + status, + { [TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status) }, + destinationResponse, + '', + responseWithIndividualEvents, + ); + } +} + +export { GenericStrategy }; diff --git a/src/v1/destinations/iterable/strategies/track-identify.ts b/src/v1/destinations/iterable/strategies/track-identify.ts new file mode 100644 index 00000000000..a8a08682514 --- /dev/null +++ b/src/v1/destinations/iterable/strategies/track-identify.ts @@ -0,0 +1,69 @@ +import { BaseStrategy } from './base'; +import { GenericProxyHandlerInput, IterableBulkProxyInput } from '../types'; +import { checkIfEventIsAbortableAndExtractErrorMessage } from '../utils'; +import { DeliveryJobState, DeliveryV1Response } from '../../../../types'; +import { TransformerProxyError } from '../../../../v0/util/errorTypes'; +import { getDynamicErrorType } from '../../../../adapters/utils/networkUtils'; +import { TAG_NAMES } from '../../../../v0/util/tags'; + +class TrackIdentifyStrategy extends BaseStrategy { + handleSuccess(responseParams: IterableBulkProxyInput): DeliveryV1Response { + const { destinationResponse, rudderJobMetadata, destinationRequest } = responseParams; + const { status } = destinationResponse; + const responseWithIndividualEvents: DeliveryJobState[] = []; + + const { events, users } = destinationRequest?.body.JSON || {}; + const finalData = events || users; + + if (finalData) { + finalData.forEach((event, idx) => { + const parsedOutput = { + statusCode: 200, + metadata: rudderJobMetadata[idx], + error: 'success', + }; + + const { isAbortable, errorMsg } = checkIfEventIsAbortableAndExtractErrorMessage( + event, + destinationResponse, + ); + if (isAbortable) { + parsedOutput.statusCode = 400; + parsedOutput.error = errorMsg; + } + responseWithIndividualEvents.push(parsedOutput); + }); + } + + return { + status, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse, + response: responseWithIndividualEvents, + }; + } + + handleError(responseParams: GenericProxyHandlerInput): void { + const { destinationResponse, rudderJobMetadata } = responseParams; + const { response, status } = destinationResponse; + const responseMessage = response.params || response.msg || response.message; + const errorMessage = JSON.stringify(responseMessage) || 'unknown error format'; + + const responseWithIndividualEvents = rudderJobMetadata.map((metadata) => ({ + statusCode: status, + metadata, + error: errorMessage, + })); + + throw new TransformerProxyError( + `ITERABLE: Error transformer proxy during ITERABLE response transformation. ${errorMessage}`, + status, + { [TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(status) }, + destinationResponse, + '', + responseWithIndividualEvents, + ); + } +} + +export { TrackIdentifyStrategy }; diff --git a/src/v1/destinations/iterable/types.ts b/src/v1/destinations/iterable/types.ts new file mode 100644 index 00000000000..f0875494ed3 --- /dev/null +++ b/src/v1/destinations/iterable/types.ts @@ -0,0 +1,69 @@ +import { ProxyMetdata, ProxyV1Request } from '../../../types'; + +type FailedUpdates = { + invalidEmails?: string[]; + invalidUserIds?: string[]; + notFoundEmails?: string[]; + notFoundUserIds?: string[]; + invalidDataEmails?: string[]; + invalidDataUserIds?: string[]; + conflictEmails?: string[]; + conflictUserIds?: string[]; + forgottenEmails?: string[]; + forgottenUserIds?: string[]; +}; + +export type GeneralApiResponse = { + msg?: string; + code?: string; + params?: Record; + successCount?: number; + failCount?: number; + invalidEmails?: string[]; + invalidUserIds?: string[]; + filteredOutFields?: string[]; + createdFields?: string[]; + disallowedEventNames?: string[]; + failedUpdates?: FailedUpdates; +}; + +export type IterableBulkApiResponse = { + status: number; + response: GeneralApiResponse; +}; + +type IterableBulkRequestBody = { + events?: any[]; + users?: any[]; +}; + +export type IterableBulkProxyInput = { + destinationResponse: IterableBulkApiResponse; + rudderJobMetadata: ProxyMetdata[]; + destType: string; + destinationRequest?: { + body: { + JSON: IterableBulkRequestBody; + }; + }; +}; + +export type GenericProxyHandlerInput = { + destinationResponse: any; + rudderJobMetadata: ProxyMetdata[]; + destType: string; + destinationRequest: ProxyV1Request; +}; + +export type Response = { + statusCode: number; + metadata: any; + error: string; +}; + +export type IterableSuccessResponse = { + status: number; + message: string; + destinationResponse: IterableBulkApiResponse; + response: Response[]; +}; diff --git a/src/v1/destinations/iterable/utils.test.ts b/src/v1/destinations/iterable/utils.test.ts new file mode 100644 index 00000000000..a556e3704f8 --- /dev/null +++ b/src/v1/destinations/iterable/utils.test.ts @@ -0,0 +1,184 @@ +import { checkIfEventIsAbortableAndExtractErrorMessage } from './utils'; +describe('checkIfEventIsAbortableAndExtractErrorMessage', () => { + // Returns non-abortable and empty error message when failCount is 0 + it('should return non-abortable and empty error message when failCount is 0', () => { + const event = { + email: 'test@example.com', + userId: 'user123', + eventName: 'testEvent', + }; + const destinationResponse = { + status: 200, + response: { + failCount: 0, + }, + }; + + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ isAbortable: false, errorMsg: '' }); + }); + + // Handles undefined or null event fields gracefully + it('should handle undefined or null event fields gracefully', () => { + const event = { + email: null, + userId: undefined, + eventName: 'testEvent', + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + invalidEmails: ['test@example.com'], + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ isAbortable: false, errorMsg: '' }); + }); + + // Handles events with all expected fields present + it('should handle events with all expected fields present and return non-abortable when no match', () => { + const event = { + email: 'test@example.com', + userId: 'user123', + eventName: 'purchase', + id: 'event123', + createdAt: '2023-10-01T00:00:00Z', + campaignId: 'campaign123', + templateId: 'template123', + createNewFields: true, + dataFields: { field1: 'value1' }, + }; + + const destinationResponse = { + status: 200, + response: { + failCount: 1, + invalidEmails: ['another@example.com'], + }, + }; + + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + + expect(result.isAbortable).toBe(false); + expect(result.errorMsg).toBe(''); + }); + + // Returns appropriate error message for abortable event + + it('should find the right value for which it should fail and passes otherwise for emails', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'value1', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + failedUpdates: { + invalidEmails: ['test'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ + isAbortable: true, + errorMsg: 'email error:"test" in "failedUpdates.invalidEmails".', + }); + }); + + it('should find the right value for which it should fail', () => { + const event = { + email: 'test@gmail.com', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'test', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + failedUpdates: { + invalidEmails: ['test'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result.isAbortable).toBe(false); + expect(result.errorMsg).toBe(''); + }); + + it('should find all the matching paths it failed for and curate error message', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'test', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + invalidEmails: ['test'], + failedUpdates: { + invalidEmails: ['test'], + conflictEmails: ['test'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result.isAbortable).toBe(true); + expect(result.errorMsg).toBe( + 'email error:"test" in "invalidEmails,failedUpdates.invalidEmails,failedUpdates.conflictEmails".', + ); + }); + + it('should find the right value for which it should fail and passes otherwise for userIds', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'value1', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + failedUpdates: { + invalidUserIds: ['user123'], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ + isAbortable: true, + errorMsg: 'userId error:"user123" in "failedUpdates.invalidUserIds".', + }); + }); + + it('should find the right value for which it should fail and passes otherwise for disallowed events', () => { + const event = { + email: 'test', + userId: 'user123', + eventName: 'purchase', + dataFields: { customField1: 'value1', customField2: 'value2' }, + }; + const destinationResponse = { + status: 200, + response: { + failCount: 1, + disallowedEventNames: ['purchase'], + failedUpdates: { + invalidUserIds: [], + }, + }, + }; + const result = checkIfEventIsAbortableAndExtractErrorMessage(event, destinationResponse); + expect(result).toEqual({ + isAbortable: true, + errorMsg: 'eventName error:"purchase" in "disallowedEventNames".', + }); + }); +}); diff --git a/src/v1/destinations/iterable/utils.ts b/src/v1/destinations/iterable/utils.ts new file mode 100644 index 00000000000..90985a8e949 --- /dev/null +++ b/src/v1/destinations/iterable/utils.ts @@ -0,0 +1,92 @@ +import { + ITERABLE_RESPONSE_EMAIL_PATHS, + ITERABLE_RESPONSE_USER_ID_PATHS, +} from '../../../v0/destinations/iterable/config'; +import { IterableBulkApiResponse } from './types'; + +const get = require('get-value'); + +/** + * Checks if a value is present in a response array based on a given path. + * @param {Object} response - The response object to search within. + * @param {string} path - The path to the response array. + * @param {any} value - The value to check for in the array. + * @returns {boolean} - True if the value is in the array, otherwise false. + */ +const isValueInResponseArray = (destinationResponse, path, value) => { + const respArr = get(destinationResponse, path); + return Array.isArray(respArr) && respArr.includes(value); +}; + +/** + * Determines if an event should be aborted based on the response from a destination + * and extracts an error message if applicable. + * ref: + * 1) https://api.iterable.com/api/docs#users_updateEmail + * 2) https://api.iterable.com/api/docs#events_track + * 3) https://api.iterable.com/api/docs#users_bulkUpdateUser + * 4) https://api.iterable.com/api/docs#events_trackBulk + * 5) https://api.iterable.com/api/docs#catalogs_bulkUpdateCatalogItems + * 6) https://api.iterable.com/api/docs#users_registerDeviceToken + * 7) https://api.iterable.com/api/docs#users_registerBrowserToken + * 8) https://api.iterable.com/api/docs#commerce_trackPurchase + * 9) https://api.iterable.com/api/docs#commerce_updateCart + * + * @param {Object} event - The event object containing various event properties. + * @param {Object} destinationResponse - The response object from the destination. + * @returns {Object} An object containing a boolean `isAbortable` indicating if the event + * should be aborted, and an `errorMsg` string with the error message if applicable. + */ + +export const checkIfEventIsAbortableAndExtractErrorMessage = ( + event: any, + destinationResponse: IterableBulkApiResponse, +): { + isAbortable: boolean; + errorMsg: string; +} => { + const { failCount } = destinationResponse.response; + + if (failCount === 0) { + return { isAbortable: false, errorMsg: '' }; + } + + const eventValues = { + email: event.email, + userId: event.userId, + eventName: event.eventName, + }; + + let errorMsg = ''; + const userIdMatchPath = ITERABLE_RESPONSE_USER_ID_PATHS.filter((userIdPath) => + isValueInResponseArray(destinationResponse.response, userIdPath, eventValues.userId), + ); + if (userIdMatchPath.length > 0) { + errorMsg += `userId error:"${eventValues.userId}" in "${userIdMatchPath}".`; + } + + const emailMatchPath = ITERABLE_RESPONSE_EMAIL_PATHS.filter((emailPath) => + isValueInResponseArray(destinationResponse.response, emailPath, eventValues.email), + ); + + if (emailMatchPath.length > 0) { + errorMsg += `email error:"${eventValues.email}" in "${emailMatchPath}".`; + } + + const eventNameMatchPath = ['disallowedEventNames'].filter((eventNamePath) => + isValueInResponseArray(destinationResponse.response, eventNamePath, eventValues.eventName), + ); + + if (eventNameMatchPath.length > 0) { + errorMsg += `eventName error:"${eventValues.eventName}" in "${eventNameMatchPath}".`; + } + + if (errorMsg) { + return { + isAbortable: true, + errorMsg, + }; + } + + return { isAbortable: false, errorMsg: '' }; +}; diff --git a/test/integrations/destinations/iterable/dataDelivery/business.ts b/test/integrations/destinations/iterable/dataDelivery/business.ts new file mode 100644 index 00000000000..0d6059806e1 --- /dev/null +++ b/test/integrations/destinations/iterable/dataDelivery/business.ts @@ -0,0 +1,799 @@ +import { ProxyV1TestData } from '../../../testTypes'; +import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; +import { + correctIdentifyData, + correctTrackData, + headerBlockWithCorrectAccessToken, + partiallyCorrectIdentifyData, + partiallyCorrectTrackData, + wrongIdentifyData, + wrongTrackData, +} from './network'; + +export const statTags = { + destType: 'ITERABLE', + errorCategory: 'network', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', +}; + +export const metadata = [generateMetadata(1), generateMetadata(2)]; + +export const singleMetadata = [ + { + jobId: 1, + attemptNum: 1, + userId: 'default-userId', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + sourceId: 'default-sourceId', + secret: { + accessToken: 'default-accessToken', + }, + dontBatch: false, + }, +]; + +export const singleTrackPayload = { + email: 'sayan@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + id: '1234', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + campaignId: 0, + templateId: 0, + createNewFields: true, +}; + +export const updateEmailData = { + currentEmail: 'sayan', + currentUserId: 'abcdeeeeeeeexxxx102', + newEmail: 'sayan@gmail.com', +}; + +export const testScenariosForV1API: ProxyV1TestData[] = [ + { + id: 'ITERABLE_v1_other_scenario_1', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test correct Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: correctTrackData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/trackBulk', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + createdFields: [], + disallowedEventNames: [], + failCount: 0, + failedUpdates: { + forgottenEmails: [], + forgottenUserIds: [], + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + }, + filteredOutFields: [], + invalidEmails: [], + invalidUserIds: [], + successCount: 2, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + { + statusCode: 200, + metadata: generateMetadata(2), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_2', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test Malformed Payload Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: wrongTrackData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/trackBulk', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"obj.events[1].createdAt":"Number value expected"}', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: + '{"msg":"[/api/events/trackBulk] Invalid JSON body","code":"BadJsonBody","params":{"obj.events[1].createdAt":"Number value expected"}}', + }, + { + statusCode: 400, + metadata: generateMetadata(2), + error: + '{"msg":"[/api/events/trackBulk] Invalid JSON body","code":"BadJsonBody","params":{"obj.events[1].createdAt":"Number value expected"}}', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_3', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test partially successful Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: partiallyCorrectTrackData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/trackBulk', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + successCount: 1, + failCount: 1, + invalidEmails: ['sayan'], + invalidUserIds: [], + disallowedEventNames: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: ['sayan'], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + + status: 200, + }, + }, + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: 'email error:"sayan" in "invalidEmails,failedUpdates.invalidEmails".', + }, + { + statusCode: 200, + metadata: generateMetadata(2), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_4', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test correct identify Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: correctIdentifyData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/bulkUpdate', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + createdFields: [], + noOpEmails: [], + noOpUserIds: [], + failCount: 0, + failedUpdates: { + conflictEmails: [], + conflictUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + }, + filteredOutFields: [], + invalidEmails: [], + invalidUserIds: [], + successCount: 2, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + { + statusCode: 200, + metadata: generateMetadata(2), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_5', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test Malformed identify Payload Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: wrongIdentifyData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/bulkUpdate', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"obj.users[1].preferUserId":"Boolean value expected"}', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: + '{"msg":"[/api/users/bulkUpdate] Invalid JSON body","code":"BadJsonBody","params":{"obj.users[1].preferUserId":"Boolean value expected"}}', + }, + { + statusCode: 400, + metadata: generateMetadata(2), + error: + '{"msg":"[/api/users/bulkUpdate] Invalid JSON body","code":"BadJsonBody","params":{"obj.users[1].preferUserId":"Boolean value expected"}}', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_6', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test partially successful identify Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: partiallyCorrectIdentifyData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/bulkUpdate', + }, + metadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + successCount: 1, + failCount: 1, + invalidEmails: ['shrouti'], + invalidUserIds: [], + noOpEmails: [], + noOpUserIds: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: ['shrouti'], + conflictEmails: [], + conflictUserIds: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + }, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + { + statusCode: 400, + metadata: generateMetadata(2), + error: 'email error:"shrouti" in "invalidEmails,failedUpdates.invalidEmails".', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_7', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test partially unsuccessful updateEmail Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: updateEmailData, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/updateEmail', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. "Invalid currentEmail sayan"', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: + '{"msg":"Invalid currentEmail sayan","code":"InvalidEmailAddressError","params":null}', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_8', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test single track correct Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: singleTrackPayload, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/track', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + msg: 'Event with id: 1234 tracked.', + code: 'Success', + params: { + id: '1234', + }, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_9', + name: 'iterable', + description: + '[Proxy API] :: Scenario to wrong sinle track event Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { ...singleTrackPayload, email: 'sayan' }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/events/track', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 400, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. "Invalid email: sayan"', + response: [ + { + statusCode: 400, + metadata: generateMetadata(1), + error: + '{"msg":"Invalid email: sayan","code":"InvalidEmailAddressError","params":null}', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_10', + name: 'iterable', + description: + '[Proxy API] :: Scenario to wrong single track event for catalogs Response Handling from Destination', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/catalogs/rudder-test/items', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 404, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. "Catalog not found: rudder-test"', + response: [ + { + statusCode: 404, + metadata: generateMetadata(1), + error: + '{"error":"NotFound","message":"Catalog not found: rudder-test","code":"error.catalogs.notFound","data":{"args":["rudder-test"]}}', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_11', + name: 'iterable', + description: + '[Proxy API] :: Scenario to test catalog track correct Payload Response Handling from Destination', + successCriteria: 'Should return 200 status code with success', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/catalogs/test-ruchira/items', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 200, + message: '[ITERABLE Response Handler] - Request Processed Successfully', + destinationResponse: { + status: 200, + response: { + code: 'Success', + msg: 'Request to bulk-upload documents into test-ruchira processed successfully', + params: null, + }, + }, + response: [ + { + statusCode: 200, + metadata: generateMetadata(1), + error: 'success', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_12', + name: 'iterable', + description: + '[Proxy API] :: Scenario to correct device token registration event Response Handling from Destination with wrong permission', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + email: 'sayan@gmail.com', + device: { + token: '1234', + platform: 'APNS', + applicationName: 'rudder', + dataFields: {}, + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/registerDeviceToken', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 401, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"ip":"103.189.130.133","endpoint":"/api/users/registerDeviceToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}', + response: [ + { + statusCode: 401, + metadata: generateMetadata(1), + error: + '{"msg":"Disabled API key or insufficient privileges","code":"BadApiKey","params":{"ip":"103.189.130.133","endpoint":"/api/users/registerDeviceToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}}', + }, + ], + }, + }, + }, + }, + }, + { + id: 'ITERABLE_v1_other_scenario_13', + name: 'iterable', + description: + '[Proxy API] :: Scenario to correct browser token registration event Response Handling from Destination with wrong permission', + successCriteria: 'Should return 400 status code with error message', + scenario: 'Business', + feature: 'dataDelivery', + module: 'destination', + version: 'v1', + input: { + request: { + body: generateProxyV1Payload( + { + JSON: { + email: 'sayan@gmail.com', + browserToken: '1234567', + userId: 'abcdeeeeeeeexxxx102', + }, + headers: headerBlockWithCorrectAccessToken, + endpoint: 'https://api.iterable.com/api/users/registerBrowserToken', + }, + singleMetadata, + ), + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: { + status: 401, + statTags, + message: + 'ITERABLE: Error transformer proxy during ITERABLE response transformation. {"ip":"103.189.130.129","endpoint":"/api/users/registerBrowserToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}', + response: [ + { + statusCode: 401, + metadata: generateMetadata(1), + error: + '{"msg":"Disabled API key or insufficient privileges","code":"BadApiKey","params":{"ip":"103.189.130.129","endpoint":"/api/users/registerBrowserToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}}', + }, + ], + }, + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/iterable/dataDelivery/data.ts b/test/integrations/destinations/iterable/dataDelivery/data.ts new file mode 100644 index 00000000000..fc969bb8e1a --- /dev/null +++ b/test/integrations/destinations/iterable/dataDelivery/data.ts @@ -0,0 +1,3 @@ +import { testScenariosForV1API } from './business'; + +export const data = [...testScenariosForV1API]; diff --git a/test/integrations/destinations/iterable/dataDelivery/network.ts b/test/integrations/destinations/iterable/dataDelivery/network.ts new file mode 100644 index 00000000000..72189581be9 --- /dev/null +++ b/test/integrations/destinations/iterable/dataDelivery/network.ts @@ -0,0 +1,575 @@ +export const headerBlockWithCorrectAccessToken = { + 'Content-Type': 'application/json', + api_key: 'DUMMY_API_KEY', +}; + +export const headerBlockWithWrongAccessToken = { + 'Content-Type': 'application/json', + api_key: 'DUMMY_WRONG_API_KEY', +}; +export const correctTrackData = { + events: [ + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + email: 'sayan@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'pradip@gmail.com', + }, + email: 'pradip@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + ], +}; + +export const wrongTrackData = { + events: [ + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + email: 'sayan', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 'abc', + }, + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'pradip@gmail.com', + }, + email: 'pradip@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + ], +}; + +export const partiallyCorrectTrackData = { + events: [ + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + email: 'sayan', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + { + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'pradip@gmail.com', + }, + email: 'pradip@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + createdAt: 1598631966468, + }, + ], +}; + +export const correctIdentifyData = { + users: [ + { + email: 'manashi@website.com', + dataFields: { + city: 'Bangalore', + name: 'manashi', + email: 'manashi@website.com', + country: 'India', + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + { + email: 'shrouti@website.com', + dataFields: { + city: 'Bangalore', + name: 'shrouti', + email: 'shrouti@website.com', + country: 'India', + }, + userId: 'abcdeeeegggggxxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + ], +}; + +export const wrongIdentifyData = { + users: [ + { + email: 'manashi@website.com', + dataFields: { + city: 'Bangalore', + name: 'manashi', + email: 'manashi@website.com', + country: 'India', + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + { + email: 'shrouti@website.com', + dataFields: { + city: 'Bangalore', + name: 'shrouti', + email: 'shrouti@website.com', + country: 'India', + }, + userId: 'abcdeeeegggggxxxx102', + preferUserId: 'abc', + mergeNestedObjects: true, + }, + ], +}; + +export const partiallyCorrectIdentifyData = { + users: [ + { + email: 'manashi@website.com', + dataFields: { + city: 'Bangalore', + name: 'manashi', + email: 'manashi@website.com', + country: 'India', + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + { + email: 'shrouti', + dataFields: { + city: 'Bangalore', + name: 'shrouti', + email: 'shrouti@website.com', + country: 'India', + }, + userId: 'abcdeeeegggggxxxx102', + preferUserId: true, + mergeNestedObjects: true, + }, + ], +}; + +// MOCK DATA +const businessMockData = [ + { + description: 'Mock response from destination depicting request with a correct track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: headerBlockWithCorrectAccessToken, + data: correctTrackData, + }, + httpRes: { + data: { + successCount: 2, + failCount: 0, + invalidEmails: [], + invalidUserIds: [], + disallowedEventNames: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting request with a partially wrong track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: headerBlockWithCorrectAccessToken, + data: partiallyCorrectTrackData, + }, + httpRes: { + data: { + successCount: 1, + failCount: 1, + invalidEmails: ['sayan'], + invalidUserIds: [], + disallowedEventNames: [], + filteredOutFields: [], + createdFields: [], + failedUpdates: { + invalidEmails: ['sayan'], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + + status: 200, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: 'Mock response from destination depicting request with a wrong data', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: headerBlockWithCorrectAccessToken, + data: wrongTrackData, + }, + httpRes: { + data: { + msg: '[/api/events/trackBulk] Invalid JSON body', + code: 'BadJsonBody', + params: { + 'obj.events[1].createdAt': 'Number value expected', + }, + }, + status: 400, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct track payload but wrong API key', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/trackBulk', + headers: { ...headerBlockWithCorrectAccessToken, api_key: 'WRONG_API_KEY' }, + data: correctTrackData, + }, + httpRes: { + data: { + msg: 'Invalid API key', + code: 'BadApiKey', + params: { + ip: '152.58.182.124', + endpoint: '/api/events/trackBulk', + }, + }, + status: 401, + }, + }, + { + description: 'Mock response from destination depicting request with a correct Identify payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/bulkUpdate', + headers: headerBlockWithCorrectAccessToken, + data: correctIdentifyData, + }, + httpRes: { + data: { + successCount: 2, + failCount: 0, + invalidEmails: [], + invalidUserIds: [], + filteredOutFields: [], + createdFields: [], + noOpEmails: [], + noOpUserIds: [], + failedUpdates: { + invalidEmails: [], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + conflictEmails: [], + conflictUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting identify request with a partially wrong track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/bulkUpdate', + headers: headerBlockWithCorrectAccessToken, + data: partiallyCorrectIdentifyData, + }, + httpRes: { + data: { + successCount: 1, + failCount: 1, + invalidEmails: ['shrouti'], + invalidUserIds: [], + filteredOutFields: [], + createdFields: [], + noOpEmails: [], + noOpUserIds: [], + failedUpdates: { + invalidEmails: ['shrouti'], + invalidUserIds: [], + notFoundEmails: [], + notFoundUserIds: [], + invalidDataEmails: [], + invalidDataUserIds: [], + conflictEmails: [], + conflictUserIds: [], + forgottenEmails: [], + forgottenUserIds: [], + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: 'Mock response from destination depicting identify request with a wrong data', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/bulkUpdate', + headers: headerBlockWithCorrectAccessToken, + data: wrongIdentifyData, + }, + httpRes: { + data: { + msg: '[/api/users/bulkUpdate] Invalid JSON body', + code: 'BadJsonBody', + params: { + 'obj.users[1].preferUserId': 'Boolean value expected', + }, + }, + status: 400, + }, + }, + { + description: 'Mock response from destination depicting update email request with a wrong data', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/updateEmail', + headers: headerBlockWithCorrectAccessToken, + data: { + currentEmail: 'sayan', + currentUserId: 'abcdeeeeeeeexxxx102', + newEmail: 'sayan@gmail.com', + }, + }, + httpRes: { + data: { + msg: 'Invalid currentEmail sayan', + code: 'InvalidEmailAddressError', + params: null, + }, + status: 400, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct single track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/track', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan@gmail.com', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + id: '1234', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + campaignId: 0, + templateId: 0, + createNewFields: true, + }, + }, + httpRes: { + data: { + msg: 'Event with id: 1234 tracked.', + code: 'Success', + params: { + id: '1234', + }, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting request with a wrong email single track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/events/track', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan', + userId: 'abcdeeeeeeeexxxx102', + eventName: 'Email Opened', + id: '1234', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + campaignId: 0, + templateId: 0, + createNewFields: true, + }, + }, + httpRes: { + data: { + msg: 'Invalid email: sayan', + code: 'InvalidEmailAddressError', + params: null, + }, + status: 400, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct catalog bulk payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/catalogs/rudder-test/items', + headers: headerBlockWithCorrectAccessToken, + data: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + }, + httpRes: { + data: { + error: 'NotFound', + message: 'Catalog not found: rudder-test', + code: 'error.catalogs.notFound', + data: { + args: ['rudder-test'], + }, + }, + status: 404, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct catalog track payload', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/catalogs/test-ruchira/items', + headers: headerBlockWithCorrectAccessToken, + data: { + documents: { + Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + }, + replaceUploadedFieldsOnly: true, + }, + }, + httpRes: { + data: { + msg: 'Request to bulk-upload documents into test-ruchira processed successfully', + code: 'Success', + params: null, + }, + status: 200, + statusText: 'OK', + }, + }, + { + description: + 'Mock response from destination depicting request with a correct register device token payload with insufficient permission', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/registerDeviceToken', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan@gmail.com', + device: { + token: '1234', + platform: 'APNS', + applicationName: 'rudder', + dataFields: {}, + }, + userId: 'abcdeeeeeeeexxxx102', + preferUserId: true, + }, + }, + httpRes: { + data: { + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.133', + endpoint: '/api/users/registerDeviceToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }, + status: 401, + }, + }, + { + description: + 'Mock response from destination depicting request with a correct registerbrowswer token payload with insufficient permission', + httpReq: { + method: 'POST', + url: 'https://api.iterable.com/api/users/registerBrowserToken', + headers: headerBlockWithCorrectAccessToken, + data: { + email: 'sayan@gmail.com', + browserToken: '1234567', + userId: 'abcdeeeeeeeexxxx102', + }, + }, + httpRes: { + data: { + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.129', + endpoint: '/api/users/registerBrowserToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }, + status: 401, + }, + }, +]; + +export const networkCallsData = [...businessMockData]; diff --git a/test/integrations/destinations/iterable/processor/aliasTestData.ts b/test/integrations/destinations/iterable/processor/aliasTestData.ts index e6893d5510c..48f92f5ac22 100644 --- a/test/integrations/destinations/iterable/processor/aliasTestData.ts +++ b/test/integrations/destinations/iterable/processor/aliasTestData.ts @@ -1,10 +1,40 @@ -import { - generateMetadata, - overrideDestination, - transformResultBuilder, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Destination, Metadata } from '../../../../../src/types'; +import { overrideDestination } from '../../../testUtils'; + +const baseMetadata: Metadata = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:12:38.713Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; const destination: Destination = { ID: '123', @@ -29,23 +59,6 @@ const destination: Destination = { Enabled: true, }; -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', -}; - -const properties = { - path: '/abc', - referrer: '', - search: '', - title: '', - url: '', - category: 'test-category', -}; - -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - export const aliasTestData: ProcessorTestData[] = [ { id: 'iterable-alias-test-1', @@ -59,24 +72,31 @@ export const aliasTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { anonymousId: 'anonId', userId: 'new@email.com', previousId: 'old@email.com', name: 'ApplicationLoaded', context: {}, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'alias', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination, }, ], - method: 'POST', }, }, output: { @@ -84,17 +104,30 @@ export const aliasTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, + method: 'POST', endpoint: 'https://api.iterable.com/api/users/updateEmail', - JSON: { - currentEmail: 'old@email.com', - newEmail: 'new@email.com', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + currentEmail: 'old@email.com', + newEmail: 'new@email.com', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -112,24 +145,31 @@ export const aliasTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { anonymousId: 'anonId', userId: 'new@email.com', previousId: 'old@email.com', name: 'ApplicationLoaded', context: {}, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'alias', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: overrideDestination(destination, { dataCenter: 'EUDC' }), }, ], - method: 'POST', }, }, output: { @@ -137,17 +177,30 @@ export const aliasTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, + method: 'POST', endpoint: 'https://api.eu.iterable.com/api/users/updateEmail', - JSON: { - currentEmail: 'old@email.com', - newEmail: 'new@email.com', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', }, - }), + params: {}, + body: { + JSON: { + currentEmail: 'old@email.com', + newEmail: 'new@email.com', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/identifyTestData.ts b/test/integrations/destinations/iterable/processor/identifyTestData.ts index 4c6729fc80a..792e16566c7 100644 --- a/test/integrations/destinations/iterable/processor/identifyTestData.ts +++ b/test/integrations/destinations/iterable/processor/identifyTestData.ts @@ -1,64 +1,40 @@ -import { - generateMetadata, - transformResultBuilder, - generateIndentifyPayload, - overrideDestination, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; -const destination: Destination = { - ID: '123', - Name: 'iterable', - DestinationDefinition: { - ID: '123', - Name: 'iterable', - DisplayName: 'Iterable', - Config: {}, - }, - WorkspaceID: '123', - Transformations: [], - Config: { - apiKey: 'testApiKey', - dataCenter: 'USDC', - preferUserId: false, - trackAllPages: true, - trackNamedPages: false, - mapToSingleEvent: false, - trackCategorisedPages: false, - }, - Enabled: true, -}; - -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', -}; - -const user1Traits = { - name: 'manashi', - country: 'India', - city: 'Bangalore', - email: 'manashi@website.com', -}; - -const user2Traits = { - am_pm: 'AM', - pPower: 'AM', - boolean: true, - userId: 'Jacqueline', - firstname: 'Jacqueline', - administrative_unit: 'Minnesota', +const baseMetadata: Metadata = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T03:57:13.523Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, }; -const userId = 'userId'; -const anonymousId = 'anonId'; -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const updateUserEndpoint = 'https://api.iterable.com/api/users/update'; -const updateUserEndpointEUDC = 'https://api.eu.iterable.com/api/users/update'; - export const identifyTestData: ProcessorTestData[] = [ { id: 'iterable-identify-test-1', @@ -72,23 +48,57 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', context: { - traits: user1Traits, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + }, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', }, - traits: user1Traits, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -96,20 +106,38 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: user1Traits.email, - userId: anonymousId, - dataFields: user1Traits, - preferUserId: false, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'manashi@website.com', + userId: 'anonId', + dataFields: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -127,23 +155,78 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateIndentifyPayload({ - userId, - anonymousId, + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { - traits: { email: 'ruchira@rudderlabs.com' }, + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, - type: 'identify', - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + rudderId: '62amo6xzksaeyupr4y0pfaucwj0upzs6g7yx', + messageId: 'hk02avz2xijdkid4i0mvncbm478g9lybdpgc', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -151,22 +234,35 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - userId, - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: false, + mergeNestedObjects: true, }, - preferUserId: false, - mergeNestedObjects: true, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -184,23 +280,78 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { ...destination, Config: { ...destination.Config, preferUserId: true } }, - message: generateIndentifyPayload({ - userId, - anonymousId, + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { - traits: { email: 'ruchira@rudderlabs.com' }, + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, - type: 'identify', - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + rudderId: '1bbuv14fd7e8ogmsx7prcmw6ob37aq1zj6mo', + messageId: '1y56axyob5fp3lg3b1y1pij50kp15pyc2ubj', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: true, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -208,22 +359,35 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - userId, - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: true, + mergeNestedObjects: true, }, - preferUserId: true, - mergeNestedObjects: true, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -242,24 +406,79 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { ...destination, Config: { ...destination.Config, preferUserId: true } }, - message: generateIndentifyPayload({ - userId, - anonymousId, + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: {}, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, - traits: { email: 'ruchira@rudderlabs.com' }, - type: 'identify', - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + traits: { + email: 'ruchira@rudderlabs.com', + }, + rudderId: 'iakido48935yw0kmw2swvjldsqoaophjzlhe', + messageId: 'hzycemnjaxr9cuqyyh003x9zlwfqnvbgzv4n', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: true, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -267,22 +486,35 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - userId, - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: true, + mergeNestedObjects: true, }, - preferUserId: true, - mergeNestedObjects: true, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -300,12 +532,12 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { ...destination, Config: { ...destination.Config, preferUserId: true } }, message: { - userId, - anonymousId, + userId: 'userId', + anonymousId: 'anonId', context: { externalId: [ { @@ -316,15 +548,46 @@ export const identifyTestData: ProcessorTestData[] = [ ], mappedToDestination: 'true', }, - traits: user2Traits, + traits: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Jacqueline', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + }, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: true, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -332,20 +595,41 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - email: 'lynnanderson@smith.net', - userId, - dataFields: { ...user2Traits, email: 'lynnanderson@smith.net' }, - preferUserId: true, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'lynnanderson@smith.net', + userId: 'userId', + dataFields: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Jacqueline', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + email: 'lynnanderson@smith.net', + }, + preferUserId: true, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -363,12 +647,12 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { userId: 'Matthew', - anonymousId, + anonymousId: 'anonId', context: { externalId: [ { @@ -379,15 +663,46 @@ export const identifyTestData: ProcessorTestData[] = [ ], mappedToDestination: 'true', }, - traits: user2Traits, + traits: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Jacqueline', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + }, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -395,19 +710,39 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpoint, - JSON: { - userId: 'Matthew', - dataFields: { ...user2Traits, userId: 'Matthew' }, - preferUserId: false, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', }, - }), + params: {}, + body: { + JSON: { + userId: 'Matthew', + dataFields: { + am_pm: 'AM', + pPower: 'AM', + boolean: true, + userId: 'Matthew', + firstname: 'Jacqueline', + administrative_unit: 'Minnesota', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -425,23 +760,57 @@ export const identifyTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { - anonymousId, + anonymousId: 'anonId', context: { - traits: user1Traits, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + }, + traits: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', }, - traits: user1Traits, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'EUDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -449,20 +818,38 @@ export const identifyTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateUserEndpointEUDC, - JSON: { - email: user1Traits.email, - userId: anonymousId, - dataFields: user1Traits, - preferUserId: false, - mergeNestedObjects: true, + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', }, - }), + params: {}, + body: { + JSON: { + email: 'manashi@website.com', + userId: 'anonId', + dataFields: { + name: 'manashi', + country: 'India', + city: 'Bangalore', + email: 'manashi@website.com', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts index bc644c7f80d..6fd35cf8fb8 100644 --- a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts +++ b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts @@ -1,55 +1,40 @@ -import { - generateMetadata, - overrideDestination, - transformResultBuilder, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; -const destination: Destination = { - ID: '123', - Name: 'iterable', - DestinationDefinition: { - ID: '123', - Name: 'iterable', - DisplayName: 'Iterable', - Config: {}, - }, - WorkspaceID: '123', - Transformations: [], - Config: { - apiKey: 'testApiKey', - dataCenter: 'USDC', - preferUserId: false, - trackAllPages: true, - trackNamedPages: false, - mapToSingleEvent: false, - trackCategorisedPages: false, - }, - Enabled: true, -}; - -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', +const baseMetadata: Metadata = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:03:53.932Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, }; -const properties = { - path: '/abc', - referrer: '', - search: '', - title: '', - url: '', - category: 'test-category', -}; - -const anonymousId = 'anonId'; -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const pageEndpoint = 'https://api.iterable.com/api/events/track'; -const pageEndpointEUDC = 'https://api.eu.iterable.com/api/events/track'; - export const pageScreenTestData: ProcessorTestData[] = [ { id: 'iterable-page-test-1', @@ -63,26 +48,57 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -90,20 +106,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - dataFields: properties, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded page', - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded page', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -121,29 +157,59 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, mapToSingleEvent: true }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties: { ...properties, campaignId: '123456', templateId: '1213458' }, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: true, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -151,22 +217,44 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - campaignId: 123456, - templateId: 1213458, - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'Loaded a Page', - dataFields: { ...properties, campaignId: '123456', templateId: '1213458' }, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + campaignId: 123456, + templateId: 1213458, + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'Loaded a Page', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -184,29 +272,57 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, trackNamedPages: true, trackAllPages: false }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: false, + trackNamedPages: true, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -214,20 +330,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded page', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded page', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -245,29 +381,57 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, trackCategorisedPages: true, trackAllPages: false }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'screen', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: false, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: true, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -275,20 +439,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - dataFields: properties, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded screen', - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded screen', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -306,29 +490,59 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, mapToSingleEvent: true }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties: { ...properties, campaignId: '123456', templateId: '1213458' }, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, type: 'screen', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: true, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -336,22 +550,44 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - campaignId: 123456, - templateId: 1213458, - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'Loaded a Screen', - dataFields: { ...properties, campaignId: '123456', templateId: '1213458' }, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + campaignId: 123456, + templateId: 1213458, + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'Loaded a Screen', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + campaignId: '123456', + templateId: '1213458', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -369,29 +605,57 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: { - ...destination, - Config: { ...destination.Config, trackNamedPages: true, trackAllPages: false }, - }, message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'screen', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: false, + trackNamedPages: true, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -399,20 +663,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpoint, - JSON: { - userId: anonymousId, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded screen', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded screen', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -430,26 +714,57 @@ export const pageScreenTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { - anonymousId, + anonymousId: 'anonId', name: 'ApplicationLoaded', context: { traits: { email: 'sayan@gmail.com', }, }, - properties, + properties: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'EUDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -457,20 +772,40 @@ export const pageScreenTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: pageEndpointEUDC, - JSON: { - userId: anonymousId, - dataFields: properties, - email: 'sayan@gmail.com', - createdAt: 1598631966468, - eventName: 'ApplicationLoaded page', - }, - }), + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + dataFields: { + path: '/abc', + referrer: '', + search: '', + title: '', + url: '', + category: 'test-category', + }, + email: 'sayan@gmail.com', + createdAt: 1598631966468, + eventName: 'ApplicationLoaded page', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/trackTestData.ts b/test/integrations/destinations/iterable/processor/trackTestData.ts index 7f53cd6d407..91271097a8a 100644 --- a/test/integrations/destinations/iterable/processor/trackTestData.ts +++ b/test/integrations/destinations/iterable/processor/trackTestData.ts @@ -1,137 +1,40 @@ -import { - generateMetadata, - generateTrackPayload, - overrideDestination, - transformResultBuilder, -} from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; -const destination: Destination = { - ID: '123', - Name: 'iterable', - DestinationDefinition: { - ID: '123', - Name: 'iterable', - DisplayName: 'Iterable', - Config: {}, - }, - WorkspaceID: '123', - Transformations: [], - Config: { - apiKey: 'testApiKey', - dataCenter: 'USDC', - preferUserId: false, - trackAllPages: true, - trackNamedPages: false, - mapToSingleEvent: false, - trackCategorisedPages: false, - }, - Enabled: true, -}; - -const headers = { - api_key: 'testApiKey', - 'Content-Type': 'application/json', -}; - -const properties = { - subject: 'resume validate', - sendtime: '2020-01-01', - sendlocation: 'akashdeep@gmail.com', -}; - -const customEventProperties = { - campaignId: '1', - templateId: '0', - user_actual_id: 12345, - category: 'test-category', - email: 'ruchira@rudderlabs.com', - user_actual_role: 'system_admin, system_user', +const baseMetadata: Metadata = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:00:49.698Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, }; -const productInfo = { - price: 797, - variant: 'Oak', - quantity: 1, - quickship: true, - full_price: 1328, - product_id: 10606, - non_interaction: 1, - sku: 'JB24691400-W05', - name: 'Vira Console Cabinet', - cart_id: 'bd9b8dbf4ef8ee01d4206b04fe2ee6ae', -}; - -const orderCompletedProductInfo = { - price: 45, - quantity: 1, - total: '1000', - name: 'Shoes', - orderId: 10000, - product_id: 1234, - campaignId: '123456', - templateId: '1213458', -}; - -const products = [ - { - product_id: '507f1f77bcf86cd799439011', - sku: '45790-32', - name: 'Monopoly: 3rd Edition', - price: '19', - position: '1', - category: 'cars', - url: 'https://www.example.com/product/path', - image_url: 'https://www.example.com/product/path.jpg', - quantity: '2', - }, - { - product_id: '507f1f77bcf86cd7994390112', - sku: '45790-322', - name: 'Monopoly: 3rd Edition2', - price: '192', - quantity: 22, - position: '12', - category: 'Cars2', - url: 'https://www.example.com/product/path2', - image_url: 'https://www.example.com/product/path.jpg2', - }, -]; - -const items = [ - { - id: '507f1f77bcf86cd799439011', - sku: '45790-32', - name: 'Monopoly: 3rd Edition', - categories: ['cars'], - price: 19, - quantity: 2, - imageUrl: 'https://www.example.com/product/path.jpg', - url: 'https://www.example.com/product/path', - }, - { - id: '507f1f77bcf86cd7994390112', - sku: '45790-322', - name: 'Monopoly: 3rd Edition2', - categories: ['Cars2'], - price: 192, - quantity: 22, - imageUrl: 'https://www.example.com/product/path.jpg2', - url: 'https://www.example.com/product/path2', - }, -]; - -const userId = 'userId'; -const anonymousId = 'anonId'; -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const endpoint = 'https://api.iterable.com/api/events/track'; -const endpointEUDC = 'https://api.eu.iterable.com/api/events/track'; -const updateCartEndpoint = 'https://api.iterable.com/api/commerce/updateCart'; -const trackPurchaseEndpoint = 'https://api.iterable.com/api/commerce/trackPurchase'; - export const trackTestData: ProcessorTestData[] = [ { id: 'iterable-track-test-1', @@ -145,22 +48,50 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', event: 'Email Opened', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -168,19 +99,36 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - userId: 'anonId', - createdAt: 1598631966468, - eventName: 'Email Opened', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + createdAt: 1598631966468, + eventName: 'Email Opened', + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -198,32 +146,109 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'product added', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'sayan@gmail.com', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, + rudderId: '227egb53wnacyz7f5hopt3jwriuwwk8n2y8i', + messageId: '40q64xrajd4kqt5174iy8889da8kjij55u85', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'product added', properties: { campaignId: '1', templateId: '0', orderId: 10000, total: 1000, - products, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], }, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -231,25 +256,59 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateCartEndpoint, - JSON: { - user: { - email: 'sayan@gmail.com', - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + user: { email: 'sayan@gmail.com', + dataFields: { + email: 'sayan@gmail.com', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + categories: ['cars'], + price: 19, + quantity: 2, + imageUrl: 'https://www.example.com/product/path.jpg', + url: 'https://www.example.com/product/path', + }, + { + id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + categories: ['Cars2'], + price: 192, + quantity: 22, + imageUrl: 'https://www.example.com/product/path.jpg2', + url: 'https://www.example.com/product/path2', + }, + ], }, - items, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -267,32 +326,109 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'order completed', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'sayan@gmail.com', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, + rudderId: 'npe99e7yc7apntgd9roobt2n8i7262rsg6vr', + messageId: '68ygodw5mj88lmjm5sm765tatvscrucqo6kx', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'order completed', properties: { orderId: 10000, total: '1000', campaignId: '123456', templateId: '1213458', - products, + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, }, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -300,37 +436,94 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: trackPurchaseEndpoint, - JSON: { - dataFields: { - orderId: 10000, - total: '1000', - campaignId: '123456', - templateId: '1213458', - products, - }, - id: '10000', - createdAt: 1598631966468, - campaignId: 123456, - templateId: 1213458, - total: 1000, - user: { - email: 'sayan@gmail.com', + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/trackPurchase', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { dataFields: { + orderId: 10000, + total: '1000', + campaignId: '123456', + templateId: '1213458', + products: [ + { + product_id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + price: '19', + position: '1', + category: 'cars', + url: 'https://www.example.com/product/path', + image_url: 'https://www.example.com/product/path.jpg', + quantity: '2', + }, + { + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + ], + }, + id: '10000', + createdAt: 1598631966468, + campaignId: 123456, + templateId: 1213458, + total: 1000, + user: { email: 'sayan@gmail.com', + dataFields: { + email: 'sayan@gmail.com', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + id: '507f1f77bcf86cd799439011', + sku: '45790-32', + name: 'Monopoly: 3rd Edition', + categories: ['cars'], + price: 19, + quantity: 2, + imageUrl: 'https://www.example.com/product/path.jpg', + url: 'https://www.example.com/product/path', + }, + { + id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + categories: ['Cars2'], + price: 192, + quantity: 22, + imageUrl: 'https://www.example.com/product/path.jpg2', + url: 'https://www.example.com/product/path2', + }, + ], }, - items, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -348,26 +541,87 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'test track event GA3', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'sayan@gmail.com', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: 'id2nbnto38rw1v5wiqyc81xe61c7t420zpjb', + messageId: '28pdlaljhp7i1woa7b0fhj47rlz3g4z2pvdw', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'test track event GA3', + properties: { + campaignId: '1', + templateId: '0', + user_actual_id: 12345, + category: 'test-category', + email: 'ruchira@rudderlabs.com', + user_actual_role: 'system_admin, system_user', + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, }, - properties: customEventProperties, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -375,22 +629,42 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - email: 'ruchira@rudderlabs.com', - dataFields: customEventProperties, - userId, - eventName: 'test track event GA3', - createdAt: 1598631966468, - campaignId: 1, - templateId: 0, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'ruchira@rudderlabs.com', + dataFields: { + campaignId: '1', + templateId: '0', + user_actual_id: 12345, + category: 'test-category', + email: 'ruchira@rudderlabs.com', + user_actual_role: 'system_admin, system_user', + }, + userId: 'userId', + eventName: 'test track event GA3', + createdAt: 1598631966468, + campaignId: 1, + templateId: 0, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -408,26 +682,91 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'product added', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'jessica@jlpdesign.net', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: 'gm8wm4385x4kfzl464h7tjtob474i17anotc', + messageId: 'jslc0490479rziix9h0ya6z6qpn2taqmryro', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'product added', + properties: { + price: 797, + variant: 'Oak', + quantity: 1, + quickship: true, + full_price: 1328, + product_id: 10606, + non_interaction: 1, + sku: 'JB24691400-W05', + name: 'Vira Console Cabinet', + cart_id: 'bd9b8dbf4ef8ee01d4206b04fe2ee6ae', + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, }, - properties: productInfo, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -435,33 +774,46 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateCartEndpoint, - JSON: { - user: { - email: 'jessica@jlpdesign.net', - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + user: { email: 'jessica@jlpdesign.net', + dataFields: { + email: 'jessica@jlpdesign.net', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + id: 10606, + sku: 'JB24691400-W05', + name: 'Vira Console Cabinet', + price: 797, + quantity: 1, + }, + ], }, - items: [ - { - id: productInfo.product_id, - sku: productInfo.sku, - name: productInfo.name, - price: productInfo.price, - quantity: productInfo.quantity, - }, - ], + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -479,32 +831,94 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'product added', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'jessica@jlpdesign.net', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', }, + rudderId: '4osg2zcrsrh2accmbijxm0zqixtxyrsun8uc', + messageId: 'x901bx7paxtr7ktja5mhd1mi8q4lr5vlrl2x', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'product added', properties: { campaignId: '1', templateId: '0', orderId: 10000, total: 1000, - ...products[1], + product_id: '507f1f77bcf86cd7994390112', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + price: '192', + quantity: 22, + position: '12', + category: 'Cars2', + url: 'https://www.example.com/product/path2', + image_url: 'https://www.example.com/product/path.jpg2', + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, }, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -512,36 +926,49 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: updateCartEndpoint, - JSON: { - user: { - email: 'jessica@jlpdesign.net', - dataFields: { + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + user: { email: 'jessica@jlpdesign.net', + dataFields: { + email: 'jessica@jlpdesign.net', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + items: [ + { + price: 192, + url: 'https://www.example.com/product/path2', + sku: '45790-322', + name: 'Monopoly: 3rd Edition2', + id: '507f1f77bcf86cd7994390112', + quantity: 22, + imageUrl: 'https://www.example.com/product/path.jpg2', + categories: ['Cars2'], + }, + ], }, - items: [ - { - price: 192, - url: products[1].url, - sku: products[1].sku, - name: products[1].name, - id: products[1].product_id, - quantity: products[1].quantity, - imageUrl: products[1].image_url, - categories: [products[1].category], - }, - ], + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -559,26 +986,89 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, - message: generateTrackPayload({ - userId, - anonymousId, - event: 'order completed', + message: { + type: 'track', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, traits: { email: 'jessica@jlpdesign.net', }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '9ovlz4kuew0wjcbwymj3vlhkngzixp9evf19', + messageId: 'ev0qyvsclinoh4z4e1uz4d8pdhrnf17q0rjd', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + event: 'order completed', + properties: { + price: 45, + quantity: 1, + total: '1000', + name: 'Shoes', + orderId: 10000, + product_id: 1234, + campaignId: '123456', + templateId: '1213458', + }, + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, }, - properties: orderCompletedProductInfo, - sentAt, - originalTimestamp, - }), - metadata: generateMetadata(1), + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, }, ], - method: 'POST', }, }, output: { @@ -586,38 +1076,60 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: trackPurchaseEndpoint, - JSON: { - dataFields: orderCompletedProductInfo, - user: { - email: 'jessica@jlpdesign.net', + method: 'POST', + endpoint: 'https://api.iterable.com/api/commerce/trackPurchase', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { dataFields: { + price: 45, + quantity: 1, + total: '1000', + name: 'Shoes', + orderId: 10000, + product_id: 1234, + campaignId: '123456', + templateId: '1213458', + }, + user: { email: 'jessica@jlpdesign.net', + dataFields: { + email: 'jessica@jlpdesign.net', + }, + userId: 'userId', + preferUserId: false, + mergeNestedObjects: true, }, - userId, - preferUserId: false, - mergeNestedObjects: true, + id: '10000', + total: 1000, + campaignId: 123456, + templateId: 1213458, + createdAt: 1598631966468, + items: [ + { + id: 1234, + name: 'Shoes', + price: 45, + quantity: 1, + }, + ], }, - id: '10000', - total: 1000, - campaignId: 123456, - templateId: 1213458, - createdAt: 1598631966468, - items: [ - { - id: orderCompletedProductInfo.product_id, - name: orderCompletedProductInfo.name, - price: orderCompletedProductInfo.price, - quantity: orderCompletedProductInfo.quantity, - }, - ], + JSON_ARRAY: {}, + XML: {}, + FORM: {}, }, - }), + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -635,21 +1147,49 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - anonymousId, + anonymousId: 'anonId', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -657,18 +1197,35 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - userId: anonymousId, - createdAt: 1598631966468, - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -686,22 +1243,50 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { - userId, - anonymousId, + userId: 'userId', + anonymousId: 'anonId', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -709,18 +1294,35 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint, - JSON: { - userId, - createdAt: 1598631966468, - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'userId', + createdAt: 1598631966468, + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, @@ -738,22 +1340,50 @@ export const trackTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination: overrideDestination(destination, { dataCenter: 'EUDC' }), message: { - anonymousId, + anonymousId: 'anonId', event: 'Email Opened', type: 'track', context: {}, - properties, - sentAt, - originalTimestamp, + properties: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'EUDC', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - metadata: generateMetadata(1), }, ], - method: 'POST', }, }, output: { @@ -761,19 +1391,36 @@ export const trackTestData: ProcessorTestData[] = [ status: 200, body: [ { - output: transformResultBuilder({ + output: { + version: '1', + type: 'REST', userId: '', - headers, - endpoint: endpointEUDC, - JSON: { - userId: 'anonId', - createdAt: 1598631966468, - eventName: 'Email Opened', - dataFields: properties, - }, - }), + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/events/track', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + userId: 'anonId', + createdAt: 1598631966468, + eventName: 'Email Opened', + dataFields: { + subject: 'resume validate', + sendtime: '2020-01-01', + sendlocation: 'akashdeep@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, statusCode: 200, - metadata: generateMetadata(1), }, ], }, diff --git a/test/integrations/destinations/iterable/processor/validationTestData.ts b/test/integrations/destinations/iterable/processor/validationTestData.ts index 5e4b9478fd3..8f0813de3f2 100644 --- a/test/integrations/destinations/iterable/processor/validationTestData.ts +++ b/test/integrations/destinations/iterable/processor/validationTestData.ts @@ -1,8 +1,41 @@ -import { generateMetadata } from './../../../testUtils'; -import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { Metadata, Destination } from '../../../../../src/types'; -const destination: Destination = { +const baseMetadata: Metadata = { + sourceId: 'default-sourceId', + workspaceId: 'default-workspaceId', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destinationId', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2025-01-06T04:14:40.785Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, +}; + +const baseDestination: Destination = { ID: '123', Name: 'iterable', DestinationDefinition: { @@ -11,8 +44,6 @@ const destination: Destination = { DisplayName: 'Iterable', Config: {}, }, - WorkspaceID: '123', - Transformations: [], Config: { apiKey: 'testApiKey', mapToSingleEvent: false, @@ -21,26 +52,11 @@ const destination: Destination = { trackNamedPages: false, }, Enabled: true, -}; - -const properties = { - url: 'https://dominos.com', - title: 'Pizza', - referrer: 'https://google.com', -}; - -const sentAt = '2020-08-28T16:26:16.473Z'; -const originalTimestamp = '2020-08-28T16:26:06.468Z'; - -const expectedStatTags = { - destType: 'ITERABLE', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'processor', - implementation: 'native', - module: 'destination', - destinationId: 'default-destinationId', - workspaceId: 'default-workspaceId', + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }; export const validationTestData: ProcessorTestData[] = [ @@ -56,9 +72,9 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { userId: 'sajal12', anonymousId: 'abcdeeeeeeeexxxx102', @@ -67,15 +83,19 @@ export const validationTestData: ProcessorTestData[] = [ email: 'abc@example.com', }, }, - properties, + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, type: 'page', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], - method: 'POST', }, }, output: { @@ -83,10 +103,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Invalid page call', - statTags: { ...expectedStatTags, errorType: 'configuration' }, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -104,19 +133,19 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'identify', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], - method: 'POST', }, }, output: { @@ -124,10 +153,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'userId or email is mandatory for this request', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -145,19 +183,19 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'group', - sentAt, - originalTimestamp, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], - method: 'POST', }, }, output: { @@ -165,10 +203,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Message type group not supported', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -186,20 +233,24 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'alias', - properties, - sentAt, - originalTimestamp, + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], - method: 'POST', }, }, output: { @@ -207,10 +258,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Missing required value from "previousId"', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, @@ -228,22 +288,26 @@ export const validationTestData: ProcessorTestData[] = [ version: 'v0', input: { request: { + method: 'POST', body: [ { - destination, message: { context: {}, type: 'alias', previousId: 'old@email.com', anonymousId: 'anonId', - properties, - sentAt, - originalTimestamp, + properties: { + url: 'https://dominos.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: generateMetadata(1), + metadata: baseMetadata, + destination: baseDestination, }, ], - method: 'POST', }, }, output: { @@ -251,10 +315,19 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { + metadata: baseMetadata, statusCode: 400, error: 'Missing required value from "userId"', - statTags: expectedStatTags, - metadata: generateMetadata(1), + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, }, ], }, diff --git a/test/integrations/destinations/iterable/router/data.ts b/test/integrations/destinations/iterable/router/data.ts index 1917c078ebd..63c6f12a5e8 100644 --- a/test/integrations/destinations/iterable/router/data.ts +++ b/test/integrations/destinations/iterable/router/data.ts @@ -1,7 +1,15 @@ -export const data = [ +import { RouterTestData } from '../../../testTypes'; +import {} from '../../../../../src/types'; +import { generateMetadata } from '../../../testUtils'; +import { getBrowserInfo } from '../../../../../src/v0/util'; + +export const data: RouterTestData[] = [ { + id: 'router-1736135082961', name: 'iterable', description: 'Test 0', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -15,7 +23,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + traits: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -29,7 +40,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'Tiffany', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'Tiffany', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -38,10 +53,26 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(1), destination: { - Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' }, + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -50,7 +81,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + traits: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -64,7 +98,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'ABC', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'ABC', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -73,15 +111,32 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(2), destination: { - Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' }, + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], destType: 'iterable', }, + method: 'POST', }, }, output: { @@ -103,8 +158,14 @@ export const data = [ body: { JSON: { documents: { - Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, - ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + Tiffany: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, + ABC: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, }, replaceUploadedFieldsOnly: true, }, @@ -114,16 +175,29 @@ export const data = [ }, files: {}, }, - metadata: [ - { jobId: 2, userId: 'u1' }, - { jobId: 2, userId: 'u1' }, - ], - batched: true, + metadata: [generateMetadata(1), generateMetadata(2)], statusCode: 200, destination: { - Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' }, + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, ], }, @@ -131,8 +205,11 @@ export const data = [ }, }, { + id: 'router-1736135082962', name: 'iterable', description: 'routerTest 1', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -145,8 +222,15 @@ export const data = [ type: 'track', event: 'Email Opened', sentAt: '2020-08-28T16:26:16.473Z', - context: { library: { name: 'analytics-node', version: '0.0.3' } }, - _metadata: { nodeVersion: '10.22.0' }, + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', + }, messageId: 'node-570110489d3e99b234b18af9a9eca9d4-6009779e-82d7-469d-aaeb-5ccf162b0453', properties: { @@ -157,8 +241,16 @@ export const data = [ anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(2), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -167,6 +259,11 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -187,16 +284,29 @@ export const data = [ email: 'manashi@website.com', country: 'India', }, - library: { name: 'analytics-node', version: '0.0.3' }, + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', }, - _metadata: { nodeVersion: '10.22.0' }, messageId: 'node-cc3ef811f686139ee527b806ee0129ef-163a3a88-266f-447e-8cce-34a8f42f8dcd', anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.462Z', }, - metadata: { jobId: 3, userId: 'u1' }, + metadata: generateMetadata(3), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -205,6 +315,11 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -217,14 +332,24 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'sayan@gmail.com' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'sayan@gmail.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, type: 'page', messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', @@ -239,12 +364,22 @@ export const data = [ url: '', category: 'test-category', }, - integrations: { All: true }, + integrations: { + All: true, + }, name: 'ApplicationLoaded', sentAt: '2019-10-14T11:15:53.296Z', }, - metadata: { jobId: 4, userId: 'u1' }, + metadata: generateMetadata(4), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '12345', dataCenter: 'USDC', @@ -254,6 +389,11 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -276,7 +416,9 @@ export const data = [ task_run_id: 'c5tar6cqgmgmcjvupdi0', version: 'release.v1.6.8', }, - device: { token: 54321 }, + device: { + token: 54321, + }, }, messageId: '2f052f7c-f694-4849-a7ed-a432f7ffa0a4', originalTimestamp: '2021-10-28T14:03:50.503Z', @@ -297,7 +439,7 @@ export const data = [ type: 'identify', userId: 'lynnanderson@smith.net', }, - metadata: { jobId: 5, userId: 'u1' }, + metadata: generateMetadata(5), destination: { ID: '1zia9wKshXt80YksLmUdJnr7IHI', Name: 'test_iterable', @@ -337,7 +479,6 @@ export const data = [ transformAt: 'processor', transformAtV1: 'processor', }, - ResponseRules: null, }, Config: { apiKey: '12345', @@ -348,11 +489,12 @@ export const data = [ trackNamedPages: true, }, Enabled: true, + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', IsProcessorEnabled: true, + IsConnectionEnabled: true, }, - libraries: [], - request: { query: {} }, }, { message: { @@ -364,14 +506,24 @@ export const data = [ namespace: 'com.rudderlabs.javascript', version: '1.0.0', }, - traits: { email: 'sayan@gmail.com' }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + traits: { + email: 'sayan@gmail.com', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', locale: 'en-US', ip: '0.0.0.0', - os: { name: '', version: '' }, - screen: { density: 2 }, + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, }, event: 'product added', type: 'track', @@ -409,12 +561,22 @@ export const data = [ }, ], }, - integrations: { All: true }, + integrations: { + All: true, + }, name: 'ApplicationLoaded', sentAt: '2019-10-14T11:15:53.296Z', }, - metadata: { jobId: 6, userId: 'u1' }, + metadata: generateMetadata(6), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -424,14 +586,26 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { message: { type: 'page', sentAt: '2020-08-28T16:26:16.473Z', - context: { library: { name: 'analytics-node', version: '0.0.3' } }, - _metadata: { nodeVersion: '10.22.0' }, + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', + }, messageId: 'node-6f62b91e789a636929ca38aed01c5f6e-103c720d-81bd-4742-98d6-d45a65aed23e', properties: { @@ -442,8 +616,16 @@ export const data = [ anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: { jobId: 7, userId: 'u1' }, + metadata: generateMetadata(7), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -453,14 +635,26 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { message: { type: 'alias', sentAt: '2020-08-28T16:26:16.473Z', - context: { library: { name: 'analytics-node', version: '0.0.3' } }, - _metadata: { nodeVersion: '10.22.0' }, + context: { + library: { + name: 'analytics-node', + version: '0.0.3', + }, + }, + _metadata: { + nodeVersion: '10.22.0', + }, messageId: 'node-6f62b91e789a636929ca38aed01c5f6e-103c720d-81bd-4742-98d6-d45a65aed23e', properties: { @@ -473,8 +667,16 @@ export const data = [ anonymousId: 'abcdeeeeeeeexxxx102', originalTimestamp: '2020-08-28T16:26:06.468Z', }, - metadata: { jobId: 8, userId: 'u1' }, + metadata: generateMetadata(8), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -484,11 +686,17 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], destType: 'iterable', }, + method: 'POST', }, }, output: { @@ -528,10 +736,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 2, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(2)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -540,7 +755,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -576,10 +797,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 3, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(3)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', mapToSingleEvent: false, @@ -588,7 +816,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -596,7 +830,10 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.iterable.com/api/events/trackBulk', - headers: { 'Content-Type': 'application/json', api_key: '12345' }, + headers: { + 'Content-Type': 'application/json', + api_key: '12345', + }, params: {}, body: { JSON: { @@ -623,10 +860,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 4, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(4)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '12345', dataCenter: 'USDC', @@ -636,7 +880,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -653,7 +903,9 @@ export const data = [ JSON: { user: { email: 'sayan@gmail.com', - dataFields: { email: 'sayan@gmail.com' }, + dataFields: { + email: 'sayan@gmail.com', + }, userId: '12345', preferUserId: true, mergeNestedObjects: true, @@ -687,10 +939,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 6, userId: 'u1' }], - batched: false, + metadata: [generateMetadata(6)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -700,7 +959,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, { batchedRequest: { @@ -734,10 +999,17 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 7, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(7)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -747,7 +1019,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, { batchedRequest: { @@ -761,17 +1039,27 @@ export const data = [ }, params: {}, body: { - JSON: { currentEmail: 'old@email.com', newEmail: 'new@email.com' }, + JSON: { + currentEmail: 'old@email.com', + newEmail: 'new@email.com', + }, JSON_ARRAY: {}, XML: {}, FORM: {}, }, files: {}, }, - metadata: [{ jobId: 8, userId: 'u1' }], - batched: false, + metadata: [generateMetadata(8)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '62d12498c37c4fd8a1a546c2d35c2f60', dataCenter: 'USDC', @@ -781,7 +1069,13 @@ export const data = [ trackNamedPages: false, }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: false, }, { batchedRequest: { @@ -789,7 +1083,10 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.iterable.com/api/users/bulkUpdate', - headers: { 'Content-Type': 'application/json', api_key: '12345' }, + headers: { + 'Content-Type': 'application/json', + api_key: '12345', + }, params: {}, body: { JSON: { @@ -817,8 +1114,7 @@ export const data = [ }, files: {}, }, - metadata: [{ jobId: 5, userId: 'u1' }], - batched: true, + metadata: [generateMetadata(5)], statusCode: 200, destination: { ID: '1zia9wKshXt80YksLmUdJnr7IHI', @@ -859,7 +1155,6 @@ export const data = [ transformAt: 'processor', transformAtV1: 'processor', }, - ResponseRules: null, }, Config: { apiKey: '12345', @@ -870,9 +1165,13 @@ export const data = [ trackNamedPages: true, }, Enabled: true, + WorkspaceID: 'default-workspace', Transformations: [], + RevisionID: 'default-revision', IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, ], }, @@ -880,8 +1179,11 @@ export const data = [ }, }, { + id: 'router-1736135082962', name: 'iterable', description: 'Simple identify call with EUDC dataCenter', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', feature: 'router', module: 'destination', version: 'v0', @@ -895,7 +1197,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, + traits: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -909,7 +1214,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'Tiffany', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'Tiffany', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -918,14 +1227,27 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(1), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', dataCenter: 'EUDC', hubID: '22066036', }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, { @@ -934,7 +1256,10 @@ export const data = [ sentAt: '2022-09-27T11:13:03.777Z', messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469', originalTimestamp: '2022-09-27T11:13:03.777Z', - traits: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + traits: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, channel: 'sources', rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e', context: { @@ -948,7 +1273,11 @@ export const data = [ }, mappedToDestination: 'true', externalId: [ - { id: 'ABC', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' }, + { + id: 'ABC', + type: 'ITERABLE-test-ruchira', + identifierType: 'itemId', + }, ], }, timestamp: '2022-09-27T11:12:59.079Z', @@ -957,19 +1286,33 @@ export const data = [ recordId: '10', request_ip: '10.1.86.248', }, - metadata: { jobId: 2, userId: 'u1' }, + metadata: generateMetadata(2), destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', dataCenter: 'EUDC', hubID: '22066036', }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, }, ], destType: 'iterable', }, + method: 'POST', }, }, output: { @@ -991,8 +1334,14 @@ export const data = [ body: { JSON: { documents: { - Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' }, - ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' }, + Tiffany: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, + ABC: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, }, replaceUploadedFieldsOnly: true, }, @@ -1002,20 +1351,30 @@ export const data = [ }, files: {}, }, - metadata: [ - { jobId: 2, userId: 'u1' }, - { jobId: 2, userId: 'u1' }, - ], - batched: true, + metadata: [generateMetadata(1), generateMetadata(2)], statusCode: 200, destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', dataCenter: 'EUDC', hubID: '22066036', }, Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, }, + batched: true, }, ], }, From 72192445a925b5efe5c3e3fbdea8e9833d06a2f5 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 6 Jan 2025 08:00:46 +0000 Subject: [PATCH 019/160] chore(release): 1.87.1 --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee9dead590d..fa45ed9b5b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ 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.87.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.0...v1.87.1) (2025-01-06) + + +### Bug Fixes + +* added missing eu url in delete flow for amplitude destination ([#3952](https://github.com/rudderlabs/rudder-transformer/issues/3952)) ([ac673fc](https://github.com/rudderlabs/rudder-transformer/commit/ac673fc22094d5567691ceaf13adca15442ea896)) +* adding transformer proxy for iterable ([#3878](https://github.com/rudderlabs/rudder-transformer/issues/3878)) ([c47488d](https://github.com/rudderlabs/rudder-transformer/commit/c47488decf8e79b9a2e0277bd85a8e895ffecc56)), closes [#3918](https://github.com/rudderlabs/rudder-transformer/issues/3918) +* **airship:** resolved minor bugsnag error ([#3942](https://github.com/rudderlabs/rudder-transformer/issues/3942)) ([1d8532e](https://github.com/rudderlabs/rudder-transformer/commit/1d8532e743aad1e27efbe2975551ed174cf6ae6c)) +* property and event name mappings in shopify v2 ([#3941](https://github.com/rudderlabs/rudder-transformer/issues/3941)) ([0dedaa2](https://github.com/rudderlabs/rudder-transformer/commit/0dedaa2983b25ab529a5bc5b34ab70ebbf94fb3e)) +* use correct endpoint for custom events ([#3954](https://github.com/rudderlabs/rudder-transformer/issues/3954)) ([49eb591](https://github.com/rudderlabs/rudder-transformer/commit/49eb59180581b34252b601101ce2450e639c0850)) +* user order ([#3944](https://github.com/rudderlabs/rudder-transformer/issues/3944)) ([43abf9c](https://github.com/rudderlabs/rudder-transformer/commit/43abf9ca193a9d16a9eddc28cc6117beadd76b41)), closes [#3914](https://github.com/rudderlabs/rudder-transformer/issues/3914) + ## [1.87.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.86.0...v1.87.0) (2024-12-13) diff --git a/package-lock.json b/package-lock.json index 6a7d4ce983c..99efc2e7fd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.87.0", + "version": "1.87.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.87.0", + "version": "1.87.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index f7d7e447493..7f713bdd5d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.87.0", + "version": "1.87.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 77d330c1710867d8fe6a532e76bd3aae39fbfe9c Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Tue, 7 Jan 2025 10:49:50 +0530 Subject: [PATCH 020/160] chore: integrate allure ci (#3959) --- .github/workflows/allure-test-reporter.yml | 109 ++++++++++++++++++++ .github/workflows/component-test-report.yml | 81 --------------- 2 files changed, 109 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/allure-test-reporter.yml delete mode 100644 .github/workflows/component-test-report.yml diff --git a/.github/workflows/allure-test-reporter.yml b/.github/workflows/allure-test-reporter.yml new file mode 100644 index 00000000000..57ff4ee4a68 --- /dev/null +++ b/.github/workflows/allure-test-reporter.yml @@ -0,0 +1,109 @@ +name: Allure Test Reporter + +on: + pull_request: + types: + - opened + - reopened + - synchronize + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +permissions: + id-token: write + contents: write # Required for gh-pages deployment + +jobs: + test_and_publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4.2.1 + + - name: Setup Node + uses: actions/setup-node@v4.0.4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Install Dependencies + run: npm ci + + - name: Run Tests and Generate Report + run: | + npm run test:ts + + - name: Load test report history + uses: actions/checkout@v4 + if: always() + continue-on-error: true + with: + ref: gh-pages + path: gh-pages + + - name: Generate Allure Report + uses: simple-elf/allure-report-action@master + if: always() + with: + gh_pages: gh-pages + allure_results: allure-results + allure_history: allure-history + keep_reports: 20 + + - name: Publish to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + id: deploy + if: always() + with: + github_token: ${{ secrets.PAT }} + publish_branch: gh-pages + publish_dir: allure-history + + - name: Get Report Number + id: report-number + if: always() + run: | + # Wait a moment for gh-pages to update + sleep 10 + + # Create a temporary directory for gh-pages checkout + mkdir temp_gh_pages + cd temp_gh_pages + + # Initialize git and fetch gh-pages + git init + git remote add origin https://github.com/rudderlabs/rudder-transformer.git + git fetch origin gh-pages + git checkout gh-pages + + # Find the latest numbered directory + LATEST_NUM=$(find . -maxdepth 1 -type d -name "[0-9]*" | sort -n | tail -1 | sed 's/\.\///') + echo "number=${LATEST_NUM}" >> $GITHUB_OUTPUT + + # Cleanup + cd .. + rm -rf temp_gh_pages + + - name: Add Test Report Link as Comment on PR + uses: actions/github-script@v7 + if: always() + with: + github-token: ${{ secrets.PAT }} + script: | + const { owner, repo } = context.repo; + const prNumber = context.payload.pull_request.number; + const reportNumber = '${{ steps.report-number.outputs.number }}'; + + const commentBody = `Allure Test reports for this run are available at: + - Allure Report: https://rudderlabs.github.io/rudder-transformer/${reportNumber}/index.html`; + + // Comment on the pull request + await github.rest.issues.createComment({ + owner, + repo, + issue_number: prNumber, + body: commentBody + }); \ No newline at end of file diff --git a/.github/workflows/component-test-report.yml b/.github/workflows/component-test-report.yml deleted file mode 100644 index 8d739c5aee6..00000000000 --- a/.github/workflows/component-test-report.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Component Test Reporter - -on: - pull_request: - types: - - opened - - reopened - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} - cancel-in-progress: true - -permissions: - id-token: write # allows the JWT to be requested from GitHub's OIDC provider - contents: read # This is required for actions/checkout - -jobs: - test_and_upload: - runs-on: ubuntu-latest - - steps: - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ secrets.AWS_DEV_ACCOUNT_ID }}:role/${{ secrets.AWS_DEV_S3_SYNC_ROLE }} - aws-region: us-east-1 - - - name: Checkout - uses: actions/checkout@v4.2.1 - with: - fetch-depth: 1 - - - name: Setup Node - uses: actions/setup-node@v4.0.4 - with: - node-version-file: '.nvmrc' - cache: 'npm' - - - name: Install Dependencies - run: npm ci - - - name: Run Tests and Generate Report - run: | - npm run test:ts -- component - - - name: Uplaod Report to S3 - run: | - aws s3 cp ./test_reports/ s3://test-integrations-dev/integrations-test-reports/rudder-transformer/${{ github.event.number }}/ --recursive - - - name: Add Test Report Link as Comment on PR - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.PAT }} - script: | - const { owner, repo } = context.repo; - // Get the pull request number - const prNumber = context.payload.pull_request.number; - const commentBody = `Test report for this run is available at: https://test-integrations-dev.s3.amazonaws.com/integrations-test-reports/rudder-transformer/${prNumber}/test-report.html`; - - // find all the comments of the PR - const issueComments = await github.paginate(github.rest.issues.listComments, { - owner, - repo, - issue_number: prNumber, - }); - - for (const comment of issueComments) { - if (comment.body === commentBody) { - console.log('Comment already exists'); - return; - } - } - - // Comment on the pull request - await github.rest.issues.createComment({ - owner, - repo, - issue_number: prNumber, - body: commentBody - }); From 3bff99f0449d514024049125882235cd2a4f9b80 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Wed, 8 Jan 2025 18:55:33 +0530 Subject: [PATCH 021/160] chore: logs to track webhook source implementation version --- src/controllers/source.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controllers/source.ts b/src/controllers/source.ts index 3d9fa4f4a45..ab5a5bbf7af 100644 --- a/src/controllers/source.ts +++ b/src/controllers/source.ts @@ -24,6 +24,11 @@ export class SourceController { version, events, ); + logger.debug('Native(Source-Transform):: Controller Input Adapter::', { + implementationVersion, + inputVersion: version, + source, + }); const resplist = await integrationService.sourceTransformRoutine( input, From 1a1fd3f5c1d274e9471ad51bae37db3f10d4661e Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Tue, 14 Jan 2025 12:57:37 +0530 Subject: [PATCH 022/160] chore: remove template string with no variables --- src/controllers/util/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/util/index.ts b/src/controllers/util/index.ts index b011540fb75..4d24f607b45 100644 --- a/src/controllers/util/index.ts +++ b/src/controllers/util/index.ts @@ -32,7 +32,7 @@ export class ControllerUtility { private static getSourceDirPath(version: string): string { if (version === 'v2') { - return path.resolve(__dirname, `../../sources`); + return path.resolve(__dirname, '../../sources'); } return path.resolve(__dirname, `../../${version}/sources`); } From 1c45db8e6ec6b9436ef08eaa9dfcc99c8953397b Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:05:10 +0530 Subject: [PATCH 023/160] fix: add email validation in HS (#3972) * fix: add email validation in HS * chore: add router test * chore: update error string Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> * chore: update tests --------- Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> --- package-lock.json | 9 ++ package.json | 1 + src/v0/destinations/hs/HSTransform-v2.js | 6 + .../destinations/hs/processor/data.ts | 82 +++++++++++++ .../destinations/hs/router/data.ts | 116 ++++++++++++++++++ 5 files changed, 214 insertions(+) diff --git a/package-lock.json b/package-lock.json index 99efc2e7fd9..c34bc606e43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -75,6 +75,7 @@ "unset-value": "^2.0.1", "uuid": "^9.0.1", "valid-url": "^1.0.9", + "validator": "^13.12.0", "zod": "^3.22.4" }, "devDependencies": { @@ -21970,6 +21971,14 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/validator": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", + "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/vary": { "version": "1.1.2", "license": "MIT", diff --git a/package.json b/package.json index 7f713bdd5d8..cf72ab26def 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,7 @@ "unset-value": "^2.0.1", "uuid": "^9.0.1", "valid-url": "^1.0.9", + "validator": "^13.12.0", "zod": "^3.22.4" }, "devDependencies": { diff --git a/src/v0/destinations/hs/HSTransform-v2.js b/src/v0/destinations/hs/HSTransform-v2.js index 3dd9f87ea4a..586934fc708 100644 --- a/src/v0/destinations/hs/HSTransform-v2.js +++ b/src/v0/destinations/hs/HSTransform-v2.js @@ -5,6 +5,7 @@ const { ConfigurationError, InstrumentationError, } = require('@rudderstack/integrations-lib'); +const validator = require('validator'); const { MappedToDestinationKey, GENERIC_TRUE_VALUES } = require('../../../constants'); const { defaultPostRequestConfig, @@ -72,6 +73,11 @@ const addHsAuthentication = (response, Config) => { const processIdentify = async ({ message, destination, metadata }, propertyMap) => { const { Config } = destination; let traits = getFieldValueFromMessage(message, 'traits'); + // since hubspot does not allow imvalid emails, we need to + // validate the email before sending it to hubspot + if (traits?.email && !validator.isEmail(traits.email)) { + throw new InstrumentationError(`Email "${traits.email}" is invalid`); + } const mappedToDestination = get(message, MappedToDestinationKey); const operation = get(message, 'context.hubspotOperation'); const externalIdObj = getDestinationExternalIDObjectForRetl(message, 'HS'); diff --git a/test/integrations/destinations/hs/processor/data.ts b/test/integrations/destinations/hs/processor/data.ts index f503ae92acc..fa3c98737c4 100644 --- a/test/integrations/destinations/hs/processor/data.ts +++ b/test/integrations/destinations/hs/processor/data.ts @@ -5425,4 +5425,86 @@ export const data = [ }, }, }, + { + name: 'hs', + description: + '[HS] (New API v3) - throw error if invalid email is provided in traits for identify call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - throw error if invalid email is provided in traits for identify call', + message: { + channel: 'web', + context: { + traits: { + email: 'incorrect-email', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + }, + type: 'identify', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2025-01-01T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: '', + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Email "incorrect-email" is invalid', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/hs/router/data.ts b/test/integrations/destinations/hs/router/data.ts index 2f0879528bf..1546193a4aa 100644 --- a/test/integrations/destinations/hs/router/data.ts +++ b/test/integrations/destinations/hs/router/data.ts @@ -3547,4 +3547,120 @@ export const data = [ }, }, }, + { + name: 'hs', + description: 'test when email is of wrong format', + feature: 'router', + module: 'destination', + id: 'emailfailsValidation', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + traits: { + email: 'incorrect-email', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + }, + type: 'identify', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2025-01-01T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: '', + integrations: { + All: true, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + metadata: { jobId: 3, userId: 'u1' }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + accessToken: 'dummy-access-token', + apiKey: '', + apiVersion: 'newApi', + authorizationType: 'newPrivateAppApi', + blacklistedEvents: [ + { + eventName: '', + }, + ], + eventFilteringOption: 'disable', + hubID: '', + lookupField: 'lookupField', + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + error: 'Email "incorrect-email" is invalid', + metadata: [ + { + jobId: 3, + userId: 'u1', + }, + ], + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + }, ]; From 0745ae885227c1c9531f48eb69c56c3fdce6497d Mon Sep 17 00:00:00 2001 From: Krishna Chaitanya Date: Thu, 16 Jan 2025 14:44:45 +0530 Subject: [PATCH 024/160] chore: update node package (#3970) --- .eslintignore | 1 + .github/workflows/allure-test-reporter.yml | 12 +- .github/workflows/build-push-docker-image.yml | 6 +- .../workflows/prepare-for-prod-ut-deploy.yml | 2 +- Dockerfile | 2 +- package-lock.json | 159 ++++++++++++------ .../v2/destinations/reddit/rtWorkflow.yaml | 2 +- 7 files changed, 119 insertions(+), 65 deletions(-) diff --git a/.eslintignore b/.eslintignore index fba46e43283..bc11e675809 100644 --- a/.eslintignore +++ b/.eslintignore @@ -26,3 +26,4 @@ scripts/skipPrepareScript.js .eslintignore .prettierignore *.json +Dockerfile* \ No newline at end of file diff --git a/.github/workflows/allure-test-reporter.yml b/.github/workflows/allure-test-reporter.yml index 57ff4ee4a68..68c5926434b 100644 --- a/.github/workflows/allure-test-reporter.yml +++ b/.github/workflows/allure-test-reporter.yml @@ -68,21 +68,21 @@ jobs: run: | # Wait a moment for gh-pages to update sleep 10 - + # Create a temporary directory for gh-pages checkout mkdir temp_gh_pages cd temp_gh_pages - + # Initialize git and fetch gh-pages git init git remote add origin https://github.com/rudderlabs/rudder-transformer.git git fetch origin gh-pages git checkout gh-pages - + # Find the latest numbered directory LATEST_NUM=$(find . -maxdepth 1 -type d -name "[0-9]*" | sort -n | tail -1 | sed 's/\.\///') echo "number=${LATEST_NUM}" >> $GITHUB_OUTPUT - + # Cleanup cd .. rm -rf temp_gh_pages @@ -96,7 +96,7 @@ jobs: const { owner, repo } = context.repo; const prNumber = context.payload.pull_request.number; const reportNumber = '${{ steps.report-number.outputs.number }}'; - + const commentBody = `Allure Test reports for this run are available at: - Allure Report: https://rudderlabs.github.io/rudder-transformer/${reportNumber}/index.html`; @@ -106,4 +106,4 @@ jobs: repo, issue_number: prNumber, body: commentBody - }); \ No newline at end of file + }); diff --git a/.github/workflows/build-push-docker-image.yml b/.github/workflows/build-push-docker-image.yml index ba62e5d8d17..e0571a24f87 100644 --- a/.github/workflows/build-push-docker-image.yml +++ b/.github/workflows/build-push-docker-image.yml @@ -96,12 +96,12 @@ jobs: with: ref: ${{ needs.get_sha.outputs.sha }} fetch-depth: 1 - + - name: Login to DockerHub uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3.7.1 @@ -149,7 +149,7 @@ jobs: with: ref: ${{ needs.get_sha.outputs.sha }} fetch-depth: 1 - + - name: Login to DockerHub uses: docker/login-action@v3.3.0 with: diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index 612dddc8332..4c108b23d64 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -171,4 +171,4 @@ jobs: git commit -m "chore: upgrade dedicated user transformers to $TAG_NAME" git push -u origin dedicated-user-transformer-$TAG_NAME - gh pr create --fill \ No newline at end of file + gh pr create --fill diff --git a/Dockerfile b/Dockerfile index 9fe3c1cdb2c..6131ebbd54c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.4 -FROM node:18.20.1-alpine3.18 AS base +FROM node:18.20.3-alpine3.18 AS base ENV HUSKY 0 RUN apk update diff --git a/package-lock.json b/package-lock.json index c34bc606e43..b3631b2e57f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6447,7 +6447,8 @@ }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -6465,7 +6466,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir": { "version": "3.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dependencies": { "semver": "^6.0.0" }, @@ -6478,7 +6480,8 @@ }, "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": { "version": "6.3.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -6539,23 +6542,28 @@ }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -6563,27 +6571,33 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" }, "node_modules/@protobufjs/path": { "version": "1.1.2", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, "node_modules/@pyroscope/nodejs": { "version": "0.2.9", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@pyroscope/nodejs/-/nodejs-0.2.9.tgz", + "integrity": "sha512-pIw4pIqcNZTZxTUuV0OUI18UZEmx9lT2GaT75ny6FKVe2L1gxAwTCf5TKk8VsnUGY66buUkyaTHcTm7fy0BP/Q==", "dependencies": { "axios": "^0.28.0", "debug": "^4.3.3", @@ -8111,7 +8125,8 @@ }, "node_modules/abbrev": { "version": "1.1.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "node_modules/accepts": { "version": "1.3.8", @@ -8334,11 +8349,14 @@ }, "node_modules/aproba": { "version": "2.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" }, "node_modules/are-we-there-yet": { "version": "2.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -8349,7 +8367,8 @@ }, "node_modules/are-we-there-yet/node_modules/readable-stream": { "version": "3.6.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -8768,7 +8787,8 @@ }, "node_modules/bindings": { "version": "1.5.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dependencies": { "file-uri-to-path": "1.0.0" } @@ -9192,7 +9212,8 @@ }, "node_modules/chownr": { "version": "2.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "engines": { "node": ">=10" } @@ -9416,7 +9437,8 @@ }, "node_modules/color-support": { "version": "1.1.3", - "license": "ISC", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "bin": { "color-support": "bin.js" } @@ -9758,7 +9780,8 @@ }, "node_modules/console-control-strings": { "version": "1.1.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, "node_modules/content-disposition": { "version": "0.5.4", @@ -11040,7 +11063,8 @@ }, "node_modules/detect-libc": { "version": "2.0.3", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", "engines": { "node": ">=8" } @@ -12370,7 +12394,8 @@ }, "node_modules/file-uri-to-path": { "version": "1.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "node_modules/filelist": { "version": "1.0.4", @@ -12485,7 +12510,8 @@ }, "node_modules/findit2": { "version": "2.2.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz", + "integrity": "sha512-lg/Moejf4qXovVutL0Lz4IsaPoNYMuxt4PA0nGqFxnJ1CTTGGlEO2wKgoDpwknhvZ8k4Q2F+eesgkLbG2Mxfog==", "engines": { "node": ">=0.8.22" } @@ -12645,7 +12671,8 @@ }, "node_modules/fs-minipass": { "version": "2.1.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dependencies": { "minipass": "^3.0.0" }, @@ -12655,7 +12682,8 @@ }, "node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "license": "ISC", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dependencies": { "yallist": "^4.0.0" }, @@ -12665,7 +12693,8 @@ }, "node_modules/fs-minipass/node_modules/yallist": { "version": "4.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/fs.realpath": { "version": "1.0.0", @@ -12715,7 +12744,9 @@ }, "node_modules/gauge": { "version": "3.0.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -13556,7 +13587,8 @@ }, "node_modules/has-unicode": { "version": "2.0.1", - "license": "ISC" + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" }, "node_modules/has-value": { "version": "2.0.2", @@ -17003,7 +17035,8 @@ }, "node_modules/lodash.sortby": { "version": "4.7.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" }, "node_modules/lodash.startcase": { "version": "4.4.0", @@ -17276,8 +17309,9 @@ } }, "node_modules/long": { - "version": "5.2.3", - "license": "Apache-2.0" + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.4.tgz", + "integrity": "sha512-qtzLbJE8hq7VabR3mISmVGtoXP8KGc2Z/AT8OuqlYD7JTR3oqrgwdjnk07wpj1twXxYmgDXgoKVWUG/fReSzHg==" }, "node_modules/longest": { "version": "2.0.1", @@ -17824,7 +17858,8 @@ }, "node_modules/minizlib": { "version": "2.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -17835,7 +17870,8 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "license": "ISC", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dependencies": { "yallist": "^4.0.0" }, @@ -17845,11 +17881,13 @@ }, "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/mkdirp": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "bin": { "mkdirp": "bin/cmd.js" }, @@ -18145,8 +18183,9 @@ "license": "ISC" }, "node_modules/nan": { - "version": "2.19.0", - "license": "MIT" + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz", + "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==" }, "node_modules/nanoid": { "version": "3.3.7", @@ -18303,7 +18342,8 @@ }, "node_modules/nopt": { "version": "5.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dependencies": { "abbrev": "1" }, @@ -18365,7 +18405,9 @@ }, "node_modules/npmlog": { "version": "5.0.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -19056,8 +19098,9 @@ }, "node_modules/pprof": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pprof/-/pprof-4.0.0.tgz", + "integrity": "sha512-Yhfk7Y0G1MYsy97oXxmSG5nvbM1sCz9EALiNhW/isAv5Xf7svzP+1RfGeBlS6mLSgRJvgSLh6Mi5DaisQuPttw==", "hasInstallScript": true, - "license": "Apache-2.0", "dependencies": { "@mapbox/node-pre-gyp": "^1.0.9", "bindings": "^1.2.1", @@ -19074,12 +19117,14 @@ } }, "node_modules/pprof-format": { - "version": "2.0.7", - "license": "MIT" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pprof-format/-/pprof-format-2.1.0.tgz", + "integrity": "sha512-0+G5bHH0RNr8E5hoZo/zJYsL92MhkZjwrHp3O2IxmY8RJL9ooKeuZ8Tm0ZNBw5sGZ9TiM71sthTjWoR2Vf5/xw==" }, "node_modules/pprof/node_modules/source-map": { "version": "0.8.0-beta.0", - "license": "BSD-3-Clause", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", "dependencies": { "whatwg-url": "^7.0.0" }, @@ -19089,18 +19134,21 @@ }, "node_modules/pprof/node_modules/tr46": { "version": "1.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/pprof/node_modules/webidl-conversions": { "version": "4.0.2", - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" }, "node_modules/pprof/node_modules/whatwg-url": { "version": "7.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", "dependencies": { "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", @@ -19483,8 +19531,9 @@ }, "node_modules/protobufjs": { "version": "7.2.6", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", + "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", "hasInstallScript": true, - "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -21309,7 +21358,8 @@ }, "node_modules/tar": { "version": "6.2.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -21324,14 +21374,16 @@ }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "license": "ISC", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "engines": { "node": ">=8" } }, "node_modules/tar/node_modules/yallist": { "version": "4.0.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/tdigest": { "version": "0.1.2", @@ -22104,7 +22156,8 @@ }, "node_modules/wide-align": { "version": "1.1.5", - "license": "ISC", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } diff --git a/src/cdk/v2/destinations/reddit/rtWorkflow.yaml b/src/cdk/v2/destinations/reddit/rtWorkflow.yaml index fd315b381ab..7d3e1653ca0 100644 --- a/src/cdk/v2/destinations/reddit/rtWorkflow.yaml +++ b/src/cdk/v2/destinations/reddit/rtWorkflow.yaml @@ -39,7 +39,7 @@ steps: const dontBatchTrueEvents = $.outputs.successfulEvents{.metadata.dontBatch}[]; const dontBatchFalseEvents = $.outputs.successfulEvents{!.metadata.dontBatch}[]; const dontBatchTrueEventsChunks = $.chunk(dontBatchTrueEvents, 1); - + let batches = [...$.batchEvents(dontBatchFalseEvents), ...$.batchEventChunks(dontBatchTrueEventsChunks)]; batches@batch.({ "batchedRequest": { From 0e0944d2372fa53b1a6db56fd382fc42c57e5068 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:13:55 +0530 Subject: [PATCH 025/160] fix: sonar issues in regex expressions (#3979) * fix: sonar issues in dynamic config * fix: sonar issues in dynamic config * fix: sonar issues in dynamic config --- src/util/dynamicConfig.js | 49 +++++++++++++----------- src/util/dynamicConfig.test.js | 2 +- src/v0/destinations/af/deleteUsers.js | 2 +- src/v0/destinations/airship/transform.js | 2 +- src/v0/destinations/clickup/util.js | 2 +- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/util/dynamicConfig.js b/src/util/dynamicConfig.js index bdfebc87e87..a189141e1cd 100644 --- a/src/util/dynamicConfig.js +++ b/src/util/dynamicConfig.js @@ -3,30 +3,35 @@ const get = require('get-value'); const unset = require('unset-value'); function getDynamicConfigValue(event, value) { - // this regex checks for pattern "only spaces {{ path || defaultvalue }} only spaces" . - // " {{message.traits.key || \"email\" }} " - // " {{ message.traits.key || 1233 }} " - const defFormat = - /^\s*{{\s*(?[A-Z_a-z]\w*(?:\.[A-Z_a-z]\w*)+)\s*\|\|\s*(?.*)\s*}}\s*$/; - const matResult = value.match(defFormat); - if (matResult) { - // Support "event.." alias for "message.." - const fieldPath = matResult.groups.path.replace(/^event\.(.*)$/, 'message.$1'); - const pathVal = get(event, fieldPath); - if (pathVal) { - value = pathVal; - unset(event, fieldPath); - } else { - value = matResult.groups.defaultVal.replace(/"/g, '').trim(); + // Check if the value contains the "{{ }}" pattern + value = value.trim(); + if (value.startsWith(`{{`) && value.endsWith(`}}`)) { + // Remove the surrounding "{{ }}" and trim spaces + const innerContent = value.slice(2, -2).trim(); + + // Split the content by "||" to separate path and default value + const parts = innerContent.split('||').map((part) => part.trim()); + + // Ensure there are exactly two parts: path and default value + if (parts.length === 2) { + const [path, defaultVal] = parts; + + // Replace "event.." with "message.." + const fieldPath = path.startsWith('event.') ? path.replace(/^event\./, 'message.') : path; + + // Retrieve the value from the event object + const pathVal = get(event, fieldPath); + + // Use the path value if available, otherwise use the default value + if (pathVal) { + unset(event, fieldPath); // Remove the used path from the event object + return pathVal; + } + return defaultVal.replace(/"/g, '').trim(); // Clean up and use default value } - return value; } - /** var format2 = //; - matResult = value.match(format2); - if (matResult) { - - return value - } */ + + // Return the value unchanged if no "{{ }}" pattern or invalid format return value; } diff --git a/src/util/dynamicConfig.test.js b/src/util/dynamicConfig.test.js index 523f31ed10c..c500fa213a4 100644 --- a/src/util/dynamicConfig.test.js +++ b/src/util/dynamicConfig.test.js @@ -6,7 +6,7 @@ const reqType = 'processor'; describe(`${funcName} Tests`, () => { const funcTestData = getFuncTestData(__dirname, `./testdata/${funcName}.json`); - test.each(funcTestData)('$description', async ({ description, input, output }) => { + test.each(funcTestData)('$description', async ({ input, output }) => { let result; if (Array.isArray(input)) { result = processDynamicConfig(...input); diff --git a/src/v0/destinations/af/deleteUsers.js b/src/v0/destinations/af/deleteUsers.js index e0da3699edd..ca956dc86fb 100644 --- a/src/v0/destinations/af/deleteUsers.js +++ b/src/v0/destinations/af/deleteUsers.js @@ -77,7 +77,7 @@ const userDeletionHandler = async (userAttributes, config) => { if (config.statusCallbackUrls) { const statusCallbackUrlsArray = config.statusCallbackUrls.split(','); const filteredStatusCallbackUrlsArray = statusCallbackUrlsArray.filter((statusCallbackUrl) => { - const URLRegex = /^(https?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w!#$&'()*+,/:;=?@[\]~-]+$/; + const URLRegex = /^(https?:\/\/)?[\w.-]+(\.[A-Za-z]{2,})+([#/?]\S*)?$/; return statusCallbackUrl.match(URLRegex); }); if (filteredStatusCallbackUrlsArray.length > 3) { diff --git a/src/v0/destinations/airship/transform.js b/src/v0/destinations/airship/transform.js index 18b7a87547f..50b5f309553 100644 --- a/src/v0/destinations/airship/transform.js +++ b/src/v0/destinations/airship/transform.js @@ -76,7 +76,7 @@ const identifyResponseBuilder = (message, { Config }) => { // attribute if (typeof traits[key] !== 'boolean') { const attribute = { action: 'set' }; - const keyMapped = RESERVED_TRAITS_MAPPING[key.toLowerCase()]; + const keyMapped = RESERVED_TRAITS_MAPPING[key] || RESERVED_TRAITS_MAPPING[key.toLowerCase()]; if (keyMapped) { attribute.key = keyMapped; } else { diff --git a/src/v0/destinations/clickup/util.js b/src/v0/destinations/clickup/util.js index 5da4192b5bb..9930954ecbf 100644 --- a/src/v0/destinations/clickup/util.js +++ b/src/v0/destinations/clickup/util.js @@ -56,7 +56,7 @@ const validateEmail = (email) => { * @param {*} url */ const validateUrl = (url) => { - const regex = /^(https?:\/\/)[\w.-]+(?:\.[\w.-]+)+[\w!#$&'()*+,/:;=?@[\]~-]+$/; + const regex = /^https?:\/\/[\w.-]+(\.[A-Za-z]{2,})+([#/?]\S*)?$/; if (!regex.test(url)) { throw new InstrumentationError('The provided url is invalid'); } From e4838da71cf331a58c6890eb43d01fc85ad12ded Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:03:39 +0530 Subject: [PATCH 026/160] chore: update proxy v0 v1 api doc in swagger (#3974) chore: update swagger proxy api doc --- swagger/api.yaml | 6 +- .../examples/delivery/v0/request/request.yaml | 33 +++++++++ .../delivery/v0/response/failure.yaml | 23 ++++++ .../delivery/v0/response/success.yaml | 20 ++++++ .../examples/delivery/v1/request/request.yaml | 49 +++++++++++++ .../delivery/v1/response/failure.yaml | 29 ++++++++ .../delivery/v1/response/success.yaml | 57 +++++++++++++++ .../components/schemas/v0DeliveryRequest.yaml | 32 +++++++++ ...yResponse.yaml => v0DeliveryResponse.yaml} | 2 +- .../components/schemas/v1DeliveryRequest.yaml | 34 +++++++++ .../schemas/v1DeliveryResponse.yaml | 42 +++++++++++ swagger/routes/delivery.yaml | 71 +++++++++++++------ 12 files changed, 375 insertions(+), 23 deletions(-) create mode 100644 swagger/components/examples/delivery/v0/request/request.yaml create mode 100644 swagger/components/examples/delivery/v0/response/failure.yaml create mode 100644 swagger/components/examples/delivery/v0/response/success.yaml create mode 100644 swagger/components/examples/delivery/v1/request/request.yaml create mode 100644 swagger/components/examples/delivery/v1/response/failure.yaml create mode 100644 swagger/components/examples/delivery/v1/response/success.yaml create mode 100644 swagger/components/schemas/v0DeliveryRequest.yaml rename swagger/components/schemas/{deliveryResponse.yaml => v0DeliveryResponse.yaml} (97%) create mode 100644 swagger/components/schemas/v1DeliveryRequest.yaml create mode 100644 swagger/components/schemas/v1DeliveryResponse.yaml diff --git a/swagger/api.yaml b/swagger/api.yaml index 8e7a67d6f8e..6b4a484a2cf 100644 --- a/swagger/api.yaml +++ b/swagger/api.yaml @@ -52,8 +52,10 @@ paths: $ref: './routes/bulkUpload.yaml#/~1getWarningJobs' #Delivery Routes - /{version}/destinations/{destination}/proxy: - $ref: './routes/delivery.yaml#/~1{version}~1destinations~1{destination}~1proxy' + /v0/destinations/{destination}/proxy: + $ref: './routes/delivery.yaml#/~1v0~1destinations~1{destination}~1proxy' + /v1/destinations/{destination}/proxy: + $ref: './routes/delivery.yaml#/~1v1~1destinations~1{destination}~1proxy' /{version}/destinations/{destination}/proxyTest: $ref: './routes/delivery.yaml#/~1{version}~1destinations~1{destination}~1proxyTest' diff --git a/swagger/components/examples/delivery/v0/request/request.yaml b/swagger/components/examples/delivery/v0/request/request.yaml new file mode 100644 index 00000000000..ee2eee44e95 --- /dev/null +++ b/swagger/components/examples/delivery/v0/request/request.yaml @@ -0,0 +1,33 @@ +value: + version: v1 + type: REST + method: POST + endpoint: "https://demoapp-api.bloomreach.com/data/v2/projects/{project}/catalogs/{catalog}/items/partial-update" + userId: "" + headers: + Authorization: "Basic token" + params: {} + body: + JSON: {} + JSON_ARRAY: + batch: + - item_id: "222" + properties: { } + XML: {} + FORM: {} + files: {} + metadata: + userId: '<<>>12345<<>>12345' + jobId: 1 + sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx' + sourceCategory: '' + destinationId: '2JIqVoWNvSOHa9ppKOqSxxx' + attemptNum: 0 + receivedAt: '2024-07-17T16:45:40.114+05:30' + createdAt: '2024-07-17T11:15:41.140Z' + firstAttemptedAt: '' + transformAt: 'router' + workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx' + secret: null + workerAssignedTime: '2024-07-17T16:45:41.264239+05:30' + dontBatch: false \ No newline at end of file diff --git a/swagger/components/examples/delivery/v0/response/failure.yaml b/swagger/components/examples/delivery/v0/response/failure.yaml new file mode 100644 index 00000000000..91e3e0c1ee1 --- /dev/null +++ b/swagger/components/examples/delivery/v0/response/failure.yaml @@ -0,0 +1,23 @@ +message: "[Generic Response Handler] Request failed for destination bloomreach_catalog with status: 401" +status: 401 +destinationResponse: + response: "Could not verify your access level for that URL.\nYou have to login with proper credentials using HTTP Basic Auth (public key as username and private key as password)" + status: 401 + headers: + server: "nginx" + date: "Fri, 1 Jan 2029 03:03:43 GMT" + content-type: "text/html; charset=utf-8" + content-length: "165" + www-authenticate: 'Basic realm="Login Required"' + vary: "Cookie" + via: "1.1 google" + alt-svc: 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000' +statTags: + errorCategory: "network" + errorType: "aborted" + destType: "BLOOMREACH_CATALOG" + module: "destination" + implementation: "native" + feature: "dataDelivery" + destinationId: "2JIqVoWNvSOHa9ppKOqSxxx" + workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx" \ No newline at end of file diff --git a/swagger/components/examples/delivery/v0/response/success.yaml b/swagger/components/examples/delivery/v0/response/success.yaml new file mode 100644 index 00000000000..26fa5a1a900 --- /dev/null +++ b/swagger/components/examples/delivery/v0/response/success.yaml @@ -0,0 +1,20 @@ +output: + status: 200 + message: "[Generic Response Handler] Request for destination: bloomreach_catalog Processed Successfully" + destinationResponse: + response: + - queued: true + success: true + status: 200 + headers: + server: "nginx" + date: "Mon, 01 Jan 2029 03:45:29 GMT" + content-type: "application/json" + x-ratelimit-limit: 5 + x-ratelimit-remaining: 4 + x-ratelimit-reset: 1736135140 + retry-after: "Mon, 06 Jan 2025 03:45:40 GMT" + strict-transport-security: "max-age=31536000; includeSubDomains" + via: "1.1 google" + alt-svc: "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + transfer-encoding: "chunked" \ No newline at end of file diff --git a/swagger/components/examples/delivery/v1/request/request.yaml b/swagger/components/examples/delivery/v1/request/request.yaml new file mode 100644 index 00000000000..bc33c56b7ad --- /dev/null +++ b/swagger/components/examples/delivery/v1/request/request.yaml @@ -0,0 +1,49 @@ +value: + version: v1 + type: REST + method: POST + endpoint: "https://demoapp-api.bloomreach.com/data/v2/projects/{project}/catalogs/{catalog}/items/partial-update" + userId: "" + headers: + Authorization: "Basic token" + params: {} + body: + JSON: {} + JSON_ARRAY: + batch: + - item_id: "222" + properties: {} + - item_id: "11234" + properties: {} + XML: {} + FORM: {} + files: {} + metadata: + - userId: '<<>>12345<<>>12345' + jobId: 1 + sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx' + sourceCategory: '' + destinationId: '2JIqVoWNvSOHa9ppKOqSxxx' + attemptNum: 0 + receivedAt: '2024-07-17T16:45:40.114+05:30' + createdAt: '2024-07-17T11:15:41.140Z' + firstAttemptedAt: '' + transformAt: 'router' + workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx' + secret: null + workerAssignedTime: '2024-07-17T16:45:41.264239+05:30' + dontBatch: false + - userId: '<<>>12345<<>>12345' + jobId: 2 + sourceId: '2ifsnRxzoONtZeIoGxgNWsr4xx' + sourceCategory: '' + destinationId: '2JIqVoWNvSOHa9ppKOqSxxx' + attemptNum: 0 + receivedAt: '2024-07-17T16:45:40.114+05:30' + createdAt: '2024-07-17T11:15:41.140Z' + firstAttemptedAt: '' + transformAt: 'router' + workspaceId: '2hSS1hZ8kuCpUZAAYsQucAFdxxx' + secret: null + workerAssignedTime: '2024-07-17T16:45:41.264239+05:30' + dontBatch: false \ No newline at end of file diff --git a/swagger/components/examples/delivery/v1/response/failure.yaml b/swagger/components/examples/delivery/v1/response/failure.yaml new file mode 100644 index 00000000000..e269f4db504 --- /dev/null +++ b/swagger/components/examples/delivery/v1/response/failure.yaml @@ -0,0 +1,29 @@ +response: + - error: "\"Could not verify your access level for that URL.\\nYou have to login with proper credentials using HTTP Basic Auth (public key as username and private key as password)\"" + statusCode: 401 + metadata: + userId: "<<>>12345<<>>12345" + jobId: 1 + sourceId: "2ifsnRxzoONtZeIoGxgNWsr4xx" + sourceCategory: "" + destinationId: "2JIqVoWNvSOHa9ppKOqSxxx" + attemptNum: 0 + receivedAt: "2024-07-17T16:45:40.114+05:30" + createdAt: "2024-07-17T11:15:41.140Z" + firstAttemptedAt: "" + transformAt: "router" + workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx" + secret: null + workerAssignedTime: "2024-07-17T16:45:41.264239+05:30" + dontBatch: false +statTags: + errorCategory: "network" + errorType: "aborted" + destType: "BLOOMREACH_CATALOG" + module: "destination" + implementation: "native" + feature: "dataDelivery" + destinationId: "2JIqVoWNvSOHa9ppKOqSxxx" + workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx" +message: "BLOOMREACH_CATALOG: Error encountered in transformer proxy V1" +status: 401 \ No newline at end of file diff --git a/swagger/components/examples/delivery/v1/response/success.yaml b/swagger/components/examples/delivery/v1/response/success.yaml new file mode 100644 index 00000000000..f30e131fe95 --- /dev/null +++ b/swagger/components/examples/delivery/v1/response/success.yaml @@ -0,0 +1,57 @@ +output: + status: 200 + message: "[BLOOMREACH_CATALOG Response V1 Handler] - Request Processed Successfully" + destinationResponse: + response: + - queued: true + success: true + - queued: true + success: true + status: 200 + headers: + server: "nginx" + date: "Mon, 06 Jan 2025 03:45:29 GMT" + content-type: "application/json" + x-ratelimit-limit: 5 + x-ratelimit-remaining: 4 + x-ratelimit-reset: 1736135140 + retry-after: "Mon, 06 Jan 2025 03:45:40 GMT" + strict-transport-security: "max-age=31536000; includeSubDomains" + via: "1.1 google" + alt-svc: "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + transfer-encoding: "chunked" +response: + - statusCode: 200 + error: "success" + metadata: + userId: "<<>>12345<<>>12345" + jobId: 1 + sourceId: "2ifsnRxzoONtZeIoGxgNWsr4xx" + sourceCategory: "" + destinationId: "2JIqVoWNvSOHa9ppKOqSxxx" + attemptNum: 0 + receivedAt: "2024-07-17T16:45:40.114+05:30" + createdAt: "2024-07-17T11:15:41.140Z" + firstAttemptedAt: "" + transformAt: "router" + workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx" + secret: null + workerAssignedTime: "2024-07-17T16:45:41.264239+05:30" + dontBatch: false + - statusCode: 200 + error: "success" + metadata: + userId: "<<>>12345<<>>12345" + jobId: 2 + sourceId: "2ifsnRxzoONtZeIoGxgNWsr4xx" + sourceCategory: "" + destinationId: "2JIqVoWNvSOHa9ppKOqSxxx" + attemptNum: 0 + receivedAt: "2024-07-17T16:45:40.114+05:30" + createdAt: "2024-07-17T11:15:41.140Z" + firstAttemptedAt: "" + transformAt: "router" + workspaceId: "2hSS1hZ8kuCpUZAAYsQucAFdxxx" + secret: null + workerAssignedTime: "2024-07-17T16:45:41.264239+05:30" + dontBatch: false \ No newline at end of file diff --git a/swagger/components/schemas/v0DeliveryRequest.yaml b/swagger/components/schemas/v0DeliveryRequest.yaml new file mode 100644 index 00000000000..8dced0661c0 --- /dev/null +++ b/swagger/components/schemas/v0DeliveryRequest.yaml @@ -0,0 +1,32 @@ +title: Proxy Request +type: object +properties: + version: + type: string + type: + type: string + method: + type: string + endpoint: + type: string + userId: + type: string + headers: + type: object + params: + type: object + body: + type: object + properties: + JSON: + type: object + JSON_ARRAY: + type: object + XML: + type: object + FORM: + type: object + files: + type: object + metadata: + $ref: './metadata.yaml' \ No newline at end of file diff --git a/swagger/components/schemas/deliveryResponse.yaml b/swagger/components/schemas/v0DeliveryResponse.yaml similarity index 97% rename from swagger/components/schemas/deliveryResponse.yaml rename to swagger/components/schemas/v0DeliveryResponse.yaml index 8f373c2aeb9..91f4816bea1 100644 --- a/swagger/components/schemas/deliveryResponse.yaml +++ b/swagger/components/schemas/v0DeliveryResponse.yaml @@ -28,4 +28,4 @@ properties: workspaceId: type: string authErrorCategory: - type: string + type: string \ No newline at end of file diff --git a/swagger/components/schemas/v1DeliveryRequest.yaml b/swagger/components/schemas/v1DeliveryRequest.yaml new file mode 100644 index 00000000000..53ec6a650ee --- /dev/null +++ b/swagger/components/schemas/v1DeliveryRequest.yaml @@ -0,0 +1,34 @@ +title: Proxy Request +type: object +properties: + version: + type: string + type: + type: string + method: + type: string + endpoint: + type: string + userId: + type: string + headers: + type: object + params: + type: object + body: + type: object + properties: + JSON: + type: object + JSON_ARRAY: + type: object + XML: + type: object + FORM: + type: object + files: + type: object + metadata: + type: array + items: + $ref: './metadata.yaml' \ No newline at end of file diff --git a/swagger/components/schemas/v1DeliveryResponse.yaml b/swagger/components/schemas/v1DeliveryResponse.yaml new file mode 100644 index 00000000000..d24cdf7a161 --- /dev/null +++ b/swagger/components/schemas/v1DeliveryResponse.yaml @@ -0,0 +1,42 @@ +title: Delivery response +type: object +properties: + status: + type: number + message: + type: string + statTags: + type: object + properties: + errorCategory: + type: string + errorType: + type: string + destType: + type: string + module: + type: string + implementation: + type: string + feature: + type: string + example: 'dataDelivery' + destinationId: + type: string + workspaceId: + type: string + destinationResponse: + type: object + authErrorCategory: + type: string + response: + type: array + items: + type: object + properties: + error: + type: string + statusCode: + type: number + metadata: + $ref: './metadata.yaml' diff --git a/swagger/routes/delivery.yaml b/swagger/routes/delivery.yaml index 7506666d460..97de9257c7d 100644 --- a/swagger/routes/delivery.yaml +++ b/swagger/routes/delivery.yaml @@ -1,14 +1,9 @@ -/{version}/destinations/{destination}/proxy: +/v0/destinations/{destination}/proxy: post: tags: - Delivery summary: Destination processor transformation parameters: - - in: path - name: version - required: true - schema: - type: string - in: path name: destination description: The destination identifier @@ -21,7 +16,10 @@ content: application/json: schema: - $ref: '../components/schemas/processorTransformationOutput.yaml' + $ref: '../components/schemas/v0DeliveryRequest.yaml' + examples: + request: + $ref: '../components/examples/delivery/v0/request/request.yaml' responses: 200: description: Success @@ -31,25 +29,58 @@ type: object properties: output: - $ref: '../components/schemas/deliveryResponse.yaml' - 400: - description: Bad Request - content: - application/json: - schema: - type: object - properties: - output: - $ref: '../components/schemas/deliveryResponse.yaml' - 500: - description: Internal Server Error + $ref: '../components/schemas/v0DeliveryResponse.yaml' + examples: + success: + value: + output: + $ref: '../components/examples/delivery/v0/response/success.yaml' + failure: + value: + output: + $ref: '../components/examples/delivery/v0/response/failure.yaml' + +/v1/destinations/{destination}/proxy: + post: + tags: + - Delivery + summary: Destination processor transformation + parameters: + - in: path + name: destination + description: The destination identifier + required: true + schema: + type: string + requestBody: + description: Request Body + required: true + content: + application/json: + schema: + $ref: '../components/schemas/v1DeliveryRequest.yaml' + examples: + request: + $ref: '../components/examples/delivery/v1/request/request.yaml' + responses: + 200: + description: Success content: application/json: schema: type: object properties: output: - $ref: '../components/schemas/deliveryResponse.yaml' + $ref: '../components/schemas/v1DeliveryResponse.yaml' + examples: + success: + value: + output: + $ref: '../components/examples/delivery/v1/response/success.yaml' + failure: + value: + output: + $ref: '../components/examples/delivery/v1/response/failure.yaml' /{version}/destinations/{destination}/proxyTest: post: From 12e8a528148454e2113c9c68b575d25695c1d55a Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:04:22 +0530 Subject: [PATCH 027/160] fix: fixing mismatch of schedule field value in clicksend destination (#3975) * fix: fixing mismatch of schedule field value in clicksend destination due to different timezone * fix: calculating everything in utc and added unit test --- src/cdk/v2/destinations/clicksend/utils.js | 10 ++++-- .../v2/destinations/clicksend/utils.test.js | 35 ++++++++++++++++--- .../destinations/clicksend/processor/track.ts | 4 +-- .../destinations/clicksend/router/data.ts | 12 +++---- 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/cdk/v2/destinations/clicksend/utils.js b/src/cdk/v2/destinations/clicksend/utils.js index d0671df45c5..797ea12025e 100644 --- a/src/cdk/v2/destinations/clicksend/utils.js +++ b/src/cdk/v2/destinations/clicksend/utils.js @@ -33,13 +33,17 @@ const deduceSchedule = (eventLevelSchedule, timestamp, destConfig) => { if (isDefinedAndNotNull(eventLevelSchedule) && !Number.isNaN(eventLevelSchedule)) { return eventLevelSchedule; } - const { defaultCampaignScheduleUnit = 'minute', defaultCampaignSchedule = 0 } = destConfig; + const { defaultCampaignScheduleUnit = 'minute', defaultCampaignSchedule = '0' } = destConfig; const date = new Date(timestamp); + let defaultCampaignScheduleInt = parseInt(defaultCampaignSchedule, 10); + if (Number.isNaN(defaultCampaignScheduleInt)) { + defaultCampaignScheduleInt = 0; + } if (defaultCampaignScheduleUnit === 'day') { - date.setDate(date.getDate() + defaultCampaignSchedule); + date.setUTCDate(date.getUTCDate() + defaultCampaignScheduleInt); } else if (defaultCampaignScheduleUnit === 'minute') { - date.setMinutes(date.getMinutes() + defaultCampaignSchedule); + date.setUTCMinutes(date.getUTCMinutes() + defaultCampaignScheduleInt); } else { throw new Error("Invalid delta unit. Use 'day' or 'minute'."); } diff --git a/src/cdk/v2/destinations/clicksend/utils.test.js b/src/cdk/v2/destinations/clicksend/utils.test.js index 4999f556788..ef4468b6fe7 100644 --- a/src/cdk/v2/destinations/clicksend/utils.test.js +++ b/src/cdk/v2/destinations/clicksend/utils.test.js @@ -46,7 +46,7 @@ describe('deduceSchedule', () => { it('should return eventLevelSchedule when it is defined, not null, and not empty', () => { const eventLevelSchedule = 1234567890; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: '5' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -57,7 +57,7 @@ describe('deduceSchedule', () => { it('should throw error when defaultCampaignScheduleUnit is invalid', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'hour', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'hour', defaultCampaignSchedule: '5' }; expect(() => { deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -68,7 +68,7 @@ describe('deduceSchedule', () => { it('should calculate future timestamp correctly when defaultCampaignScheduleUnit is minute', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: '5' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -81,7 +81,7 @@ describe('deduceSchedule', () => { it('should calculate future timestamp correctly when defaultCampaignScheduleUnit is day', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: 1 }; + const destConfig = { defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: '1' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); @@ -90,11 +90,36 @@ describe('deduceSchedule', () => { expect(result).toBe(expectedTimestamp); }); + it('should calculate timestamp when defaultCampaignSchedule in some invalid string', () => { + const eventLevelSchedule = null; + const timestamp = '2023-10-01T00:00:00Z'; + const destConfig = { defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: 'inValid' }; + + const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); + const expectedTimestamp = new Date('2023-10-01T00:00:00Z').getTime() / 1000; + + expect(result).toBe(expectedTimestamp); + }); + + it('should calculate timestamp when defaultCampaignSchedule has trailing invalid text and/or leading space', () => { + const eventLevelSchedule = null; + const timestamp = '2023-10-01T00:00:00Z'; + const destConfig = { + defaultCampaignScheduleUnit: 'minute', + defaultCampaignSchedule: ' 5Invalid.String ', + }; + + const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); + const expectedTimestamp = new Date('2023-10-01T00:05:00Z').getTime() / 1000; + + expect(result).toBe(expectedTimestamp); + }); + // returns UNIX timestamp in seconds it('should return UNIX timestamp in seconds', () => { const eventLevelSchedule = null; const timestamp = '2023-10-01T00:00:00Z'; - const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: 5 }; + const destConfig = { defaultCampaignScheduleUnit: 'minute', defaultCampaignSchedule: '5' }; const result = deduceSchedule(eventLevelSchedule, timestamp, destConfig); diff --git a/test/integrations/destinations/clicksend/processor/track.ts b/test/integrations/destinations/clicksend/processor/track.ts index e4a8c5be979..eee7c573e9a 100644 --- a/test/integrations/destinations/clicksend/processor/track.ts +++ b/test/integrations/destinations/clicksend/processor/track.ts @@ -62,7 +62,7 @@ export const track = [ body: 'abcd', from: 'abc@gmail.com', name: 'new campaign', - schedule: 1631201576, + schedule: 1611761576, }, userId: '', }), @@ -227,7 +227,7 @@ export const track = [ from: 'abc@gmail.com', from_email: 'dummy@gmail.com', custom_string: 'test string', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, diff --git a/test/integrations/destinations/clicksend/router/data.ts b/test/integrations/destinations/clicksend/router/data.ts index 54018787b03..5a9da7e7a65 100644 --- a/test/integrations/destinations/clicksend/router/data.ts +++ b/test/integrations/destinations/clicksend/router/data.ts @@ -121,7 +121,7 @@ export const data = [ from: 'abc@gmail.com', list_id: 123345, name: 'new campaign', - schedule: 1631201576, + schedule: 1611761576, }, JSON_ARRAY: {}, XML: {}, @@ -160,7 +160,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, @@ -373,7 +373,7 @@ export const data = [ from: 'abc@gmail.com', list_id: 123345, name: 'new campaign', - schedule: 1631201576, + schedule: 1611761576, }, JSON_ARRAY: {}, XML: {}, @@ -412,7 +412,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, @@ -422,7 +422,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, @@ -432,7 +432,7 @@ export const data = [ email: 'abc@gmail.com', from: 'abc@gmail.com', from_email: 'dummy@gmail.com', - schedule: 1631201576, + schedule: 1611761576, source: 'php', to: '+9182XXXX068', }, From b0e0b15ee3cb7aeab0162c91fdcf98fca1e16722 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 20 Jan 2025 08:52:34 +0530 Subject: [PATCH 028/160] fix: removing device token from if condition in mixpanel destination (#3982) * fix: removing device token from if condition in mixpanel destination * fix: reducing sonar cloud cognitive complexity * fix: addressing comment --- src/v0/destinations/mp/util.js | 40 ++++-- src/v0/destinations/mp/util.test.js | 198 ++++++++++++++++++++++++++++ 2 files changed, 226 insertions(+), 12 deletions(-) diff --git a/src/v0/destinations/mp/util.js b/src/v0/destinations/mp/util.js index b2807d6e119..a62dca0f4e7 100644 --- a/src/v0/destinations/mp/util.js +++ b/src/v0/destinations/mp/util.js @@ -17,6 +17,7 @@ const { isObject, isDefinedAndNotNullAndNotEmpty, isDefinedAndNotNull, + removeUndefinedValues, } = require('../../util'); const { ConfigCategory, @@ -32,6 +33,30 @@ const mPProfileAndroidConfigJson = mappingConfig[ConfigCategory.PROFILE_ANDROID. const mPProfileIosConfigJson = mappingConfig[ConfigCategory.PROFILE_IOS.name]; const mPSetOnceConfigJson = mappingConfig[ConfigCategory.SET_ONCE.name]; +/** + * This method populates the payload with device fields based on mp mapping + * @param message + * @param rawPayload + * @returns + */ +const populateDeviceFieldsInPayload = (message, rawPayload) => { + const device = get(message, 'context.device'); + let payload = {}; + let updatedRawPayload = { ...rawPayload }; + if (device) { + const deviceTokenArray = isDefinedAndNotNull(device.token) ? [device.token] : undefined; + if (isAppleFamily(device.type)) { + payload = constructPayload(message, mPProfileIosConfigJson); + updatedRawPayload.$ios_devices = deviceTokenArray; + } else if (device.type.toLowerCase() === 'android') { + payload = constructPayload(message, mPProfileAndroidConfigJson); + updatedRawPayload.$android_devices = deviceTokenArray; + } + updatedRawPayload = removeUndefinedValues(updatedRawPayload); + } + return { ...updatedRawPayload, ...payload }; +}; + /** * this function has been used to create * @param {*} message rudderstack identify payload @@ -75,18 +100,8 @@ const getTransformedJSON = (message, mappingJson, useNewMapping) => { } } - const device = get(message, 'context.device'); - if (device && device.token) { - let payload; - if (isAppleFamily(device.type)) { - payload = constructPayload(message, mPProfileIosConfigJson); - rawPayload.$ios_devices = [device.token]; - } else if (device.type.toLowerCase() === 'android') { - payload = constructPayload(message, mPProfileAndroidConfigJson); - rawPayload.$android_devices = [device.token]; - } - rawPayload = { ...rawPayload, ...payload }; - } + rawPayload = populateDeviceFieldsInPayload(message, rawPayload); + if (message.channel === 'web' && message.context?.userAgent) { const browser = getBrowserInfo(message.context.userAgent); rawPayload.$browser = browser.name; @@ -373,4 +388,5 @@ module.exports = { trimTraits, generatePageOrScreenCustomEventName, recordBatchSizeMetrics, + getTransformedJSON, }; diff --git a/src/v0/destinations/mp/util.test.js b/src/v0/destinations/mp/util.test.js index 3666081f593..4813b1fe1ff 100644 --- a/src/v0/destinations/mp/util.test.js +++ b/src/v0/destinations/mp/util.test.js @@ -5,9 +5,11 @@ const { buildUtmParams, trimTraits, generatePageOrScreenCustomEventName, + getTransformedJSON, } = require('./util'); const { FEATURE_GZIP_SUPPORT } = require('../../util/constant'); const { ConfigurationError } = require('@rudderstack/integrations-lib'); +const { mappingConfig, ConfigCategory } = require('./config'); const maxBatchSizeMock = 2; @@ -489,3 +491,199 @@ describe('generatePageOrScreenCustomEventName', () => { expect(result).toBe(expected); }); }); + +describe('Unit test cases for getTransformedJSON', () => { + it('should transform the message payload to appropriate payload if device.token is present', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'ios', + token: 'test_device_token', + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'iOS', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1', + $ios_app_version: '1.0', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device.token is present and device.token is null', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: null, + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'Android', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $os: 'Android', + $android_model: 'Android SDK built for x86', + $android_os_version: '8.1.0', + $android_manufacturer: 'Google', + $android_app_version: '1.0', + $android_app_version_code: '1.0', + $android_brand: 'Google', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device.token is not present for apple device', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'ios', + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'iOS', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1', + $ios_app_version: '1.0', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device.token is not present for android device', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + device: { + id: '5094f5704b9cf2b3', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + type: 'android', + token: undefined, + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'Android', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $wifi: true, + userId: 'test_user_id', + $os: 'Android', + $android_model: 'Android SDK built for x86', + $android_os_version: '8.1.0', + $android_manufacturer: 'Google', + $android_app_version: '1.0', + $android_app_version_code: '1.0', + $android_brand: 'Google', + }; + + expect(result).toEqual(expectedResult); + }); + + it('should transform the message payload to appropriate payload if device is not present', () => { + const message = { + context: { + app: { + build: '1', + name: 'LeanPlumIntegrationAndroid', + namespace: 'com.android.SampleLeanPlum', + version: '1.0', + }, + network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true }, + os: { name: 'iOS', version: '8.1.0' }, + timezone: 'Asia/Kolkata', + traits: { userId: 'test_user_id' }, + }, + }; + const result = getTransformedJSON(message, mappingConfig[ConfigCategory.IDENTIFY.name], true); + + const expectedResult = { + $carrier: 'Android', + $wifi: true, + userId: 'test_user_id', + }; + + expect(result).toEqual(expectedResult); + }); +}); From 6ec3d552b845535965bc6c7b9990161a168b9a4e Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 20 Jan 2025 08:53:11 +0530 Subject: [PATCH 029/160] feat: added drop traits in track call feature for mixpanel (#3986) * feat: added drop traits in track call feature for mixpanel * Apply suggestions from code review Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> * chore: apply suggestions from code review Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> * fix: fix commit message --------- Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --- src/v0/destinations/mp/transform.js | 5 +- .../destinations/mp/processor/data.ts | 111 ++++++++++++++++++ 2 files changed, 115 insertions(+), 1 deletion(-) diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index 02eca8ed22f..1967e110c92 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -163,9 +163,12 @@ const getEventValueForTrackEvent = (message, destination) => { } const unixTimestamp = toUnixTimestampInMS(message.timestamp || message.originalTimestamp); + + const traits = destination.Config?.dropTraitsInTrackEvent ? {} : { ...message.context.traits }; + let properties = { ...message.properties, - ...get(message, 'context.traits'), + ...traits, ...mappedProperties, token: destination.Config.token, distinct_id: message.userId || message.anonymousId, diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index d13cf64cae2..c35d2013c6a 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -6190,4 +6190,115 @@ export const data = [ }, }, }, + { + name: 'mp', + description: 'Track event test when dropTraitsInTrackEvent is true', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(sampleDestination, { + dropTraitsInTrackEvent: true, + }), + message: { + type: 'track', + event: 'FirstTrackCall12', + sentAt: '2021-09-30T07:15:23.523Z', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + path: '/Testing/App_for_testingTool/', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + referrer: 'http://127.0.0.1:7307/Testing/', + initial_referrer: 'http://127.0.0.1:7307/Testing/', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '127.0.0.1:7307', + }, + locale: 'en-US', + screen: { width: 1440, height: 900, density: 2, innerWidth: 590, innerHeight: 665 }, + traits: { + anonymousId: 'ea776ad0-3136-44fb-9216-5b1578609a2b', + userId: 'as09sufa09usaf09as0f9uasf', + id: 'as09sufa09usaf09as0f9uasf', + firstName: 'Bob', + lastName: 'Marley', + name: 'Bob Marley', + age: 43, + email: 'bob@marleymail.com', + phone: '+447748544123', + birthday: '1987-01-01T20:08:59+0000', + createdAt: '2022-01-21T14:10:12+0000', + address: '51,B.L.T road, Kolkata-700060', + description: 'I am great', + gender: 'male', + title: 'Founder', + username: 'bobm', + website: 'https://bobm.com', + randomProperty: 'randomValue', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36', + }, + rudderId: '294702c7-8732-4fb3-b39f-f3bdffe1aa88', + messageId: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + properties: { foo: 'bar', $deviceId: 'nkasdnkasd' }, + anonymousId: '1dbb5784-b8e2-4074-8644-9920145b7ae5', + integrations: { All: true }, + originalTimestamp: '2021-09-30T07:15:23.523Z', + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.mixpanel.com/import/', + headers: { + Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + 'Content-Type': 'application/json', + }, + params: { strict: 0 }, + body: { + JSON: {}, + JSON_ARRAY: { + batch: + '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', + }, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; From fc090806235f2599703098c9f3fc83c4bdf7d599 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:03:07 +0530 Subject: [PATCH 030/160] fix: refactor code and add validation for values (#3971) * fix: refactor code and add validation for values * chore: update updateConversion conditions to mutually exclusive --- .../data/TrackAddStoreConversionsConfig.json | 3 +- .../transform.js | 4 - .../utils.js | 38 +++--- src/v0/util/index.js | 11 +- src/v0/util/index.test.js | 24 ++++ .../processor/data.ts | 108 ++++++++++++++++++ 6 files changed, 163 insertions(+), 25 deletions(-) diff --git a/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json b/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json index 9c88e59ddb3..9bfd0bc179f 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json +++ b/src/v0/destinations/google_adwords_offline_conversions/data/TrackAddStoreConversionsConfig.json @@ -17,7 +17,8 @@ ], "required": true, "metadata": { - "type": "toNumber" + "type": "toNumber", + "regex": "^([1-9]\\d*(\\.\\d+)?|0\\.\\d+)$" } }, { diff --git a/src/v0/destinations/google_adwords_offline_conversions/transform.js b/src/v0/destinations/google_adwords_offline_conversions/transform.js index 2648f03e8a3..76b12587cdc 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/transform.js +++ b/src/v0/destinations/google_adwords_offline_conversions/transform.js @@ -18,7 +18,6 @@ const { getClickConversionPayloadAndEndpoint, getConsentsDataFromIntegrationObj, getCallConversionPayload, - updateConversion, } = require('./utils'); const helper = require('./helper'); @@ -49,9 +48,6 @@ const getConversions = (message, metadata, { Config }, event, conversionType) => filteredCustomerId, eventLevelConsentsData, ); - convertedPayload.payload.conversions[0] = updateConversion( - convertedPayload.payload.conversions[0], - ); payload = convertedPayload.payload; endpoint = convertedPayload.endpoint; } else if (conversionType === 'store') { diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index 2d47095eea7..eeb4d2c3a45 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -346,6 +346,24 @@ const populateUserIdentifier = ({ email, phone, properties, payload, UserIdentif } return copiedPayload; }; + +/** + * remove redundant ids + * @param {*} conversionCopy + */ +const updateConversion = (conversion) => { + const conversionCopy = cloneDeep(conversion); + if (conversionCopy.gclid) { + delete conversionCopy.wbraid; + delete conversionCopy.gbraid; + } else if (conversionCopy.wbraid && conversionCopy.gbraid) { + throw new InstrumentationError(`You can't use both wbraid and gbraid.`); + } else if (conversionCopy.wbraid || conversionCopy.gbraid) { + delete conversionCopy.userIdentifiers; + } + return conversionCopy; +}; + const getClickConversionPayloadAndEndpoint = ( message, Config, @@ -423,6 +441,7 @@ const getClickConversionPayloadAndEndpoint = ( const consentObject = finaliseConsent(consentConfigMap, eventLevelConsent, Config); // here conversions[0] is expected to be present there are some mandatory properties mapped in the mapping json. set(payload, 'conversions[0].consent', consentObject); + payload.conversions[0] = updateConversion(payload.conversions[0]); return { payload, endpoint }; }; @@ -431,25 +450,6 @@ const getConsentsDataFromIntegrationObj = (message) => { return integrationObj?.consents || {}; }; -/** - * remove redundant ids - * @param {*} conversionCopy - */ -const updateConversion = (conversion) => { - const conversionCopy = cloneDeep(conversion); - if (conversionCopy.gclid) { - delete conversionCopy.wbraid; - delete conversionCopy.gbraid; - } - if (conversionCopy.wbraid && conversionCopy.gbraid) { - throw new InstrumentationError(`You can't use both wbraid and gbraid.`); - } - if (conversionCopy.wbraid || conversionCopy.gbraid) { - delete conversionCopy.userIdentifiers; - } - return conversionCopy; -}; - module.exports = { validateDestinationConfig, generateItemListFromProducts, diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 0f9abfb0403..683cf9b746b 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -971,6 +971,7 @@ const handleMetadataForValue = (value, metadata, destKey, integrationsObj = null validateTimestamp, allowedKeyCheck, toArray, + regex, } = metadata; // if value is null and defaultValue is supplied - use that @@ -1044,7 +1045,14 @@ const handleMetadataForValue = (value, metadata, destKey, integrationsObj = null } return [formattedVal]; } - + if (regex) { + const regexPattern = new RegExp(regex); + if (!regexPattern.test(formattedVal)) { + throw new InstrumentationError( + `The value '${formattedVal}' does not match the regex pattern, ${regex}`, + ); + } + } return formattedVal; }; @@ -2489,4 +2497,5 @@ module.exports = { removeEmptyKey, isAxiosError, convertToUuid, + handleMetadataForValue, }; diff --git a/src/v0/util/index.test.js b/src/v0/util/index.test.js index cfdfefddee3..0b0b585e4cb 100644 --- a/src/v0/util/index.test.js +++ b/src/v0/util/index.test.js @@ -1049,3 +1049,27 @@ describe('convertToUuid', () => { expect(result).toBe('672ca00c-37f4-5d71-b8c3-6ae0848080ec'); }); }); + +describe('', () => { + it('should return original value when regex pattern is invalid', () => { + const value = 'test value'; + const metadata = { + regex: `\\b(?!1000\\b)\\d{4,}\\b`, + }; + try { + const result = utilities.handleMetadataForValue(value, metadata); + } catch (e) { + expect(e.message).toBe( + `The value 'test value' does not match the regex pattern, \\b(?!1000\\b)\\d{4,}\\b`, + ); + } + }); + it('should return true when the regex matches', () => { + const value = 1003; + const metadata = { + regex: `\\b(?!1000\\b)\\d{4,}\\b`, + }; + const res = utilities.handleMetadataForValue(value, metadata); + expect(res).toBe(1003); + }); +}); diff --git a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts index 3ecae2b92dd..7ce05c17e06 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts @@ -5929,4 +5929,112 @@ export const data = [ }, mockFns: timestampMock, }, + { + name: 'google_adwords_offline_conversions', + description: 'Test 29 : store conversion which has value less than 0, should throw error', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + traits: {}, + }, + event: 'Product Clicked', + type: 'track', + messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + item_id: 'item id', + merchant_id: 'merchant id', + currency: 'INR', + revenue: '0', + store_code: 'store code', + gclid: 'gclid', + conversionDateTime: '2019-10-14T11:15:18.299Z', + product_id: '123445', + quantity: 123, + }, + integrations: { + google_adwords_offline_conversion: { + consent: { + adUserdata: 'UNSPECIFIED', + adPersonalization: 'GRANTED', + }, + }, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + isCustomerAllowed: false, + customerId: '111-222-3333', + subAccount: true, + loginCustomerId: 'login-customer-id', + userDataConsent: 'GRANTED', + personalizationConsent: 'DENIED', + eventsToOfflineConversionsTypeMapping: [ + { + from: 'Product Clicked', + to: 'store', + }, + ], + eventsToConversionsNamesMapping: [ + { + from: 'Product Clicked', + to: 'Sign-up - click', + }, + ], + hashUserIdentifier: true, + defaultUserIdentifier: 'phone', + validateOnly: false, + rudderAccountId: '2EOknn1JNH7WK1MfNkgr4t3u4fGYKkRK', + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + "The value '0' does not match the regex pattern, ^([1-9]\\d*(\\.\\d+)?|0\\.\\d+)$", + metadata: { + secret: { + access_token: 'abcd1234', + developer_token: 'ijkl91011', + refresh_token: 'efgh5678', + }, + }, + statTags: { + destType: 'GOOGLE_ADWORDS_OFFLINE_CONVERSIONS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + mockFns: timestampMock, + }, ]; From 24c05961f5e69b3c3dba48afd1a3ce450318a769 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:25:43 +0530 Subject: [PATCH 031/160] refactor: use email validator instead of regex (#3985) * refactor: use email validator instead of regex * refactor: use email validator instead of regex --- src/v0/destinations/clickup/util.js | 6 +++--- src/v0/destinations/customerio/util.js | 24 ++++++--------------- src/v0/destinations/customerio/util.test.js | 3 ++- src/v0/destinations/mautic/utils.js | 14 +++--------- src/v0/destinations/sendinblue/util.js | 4 ++-- src/v0/util/index.js | 7 ------ 6 files changed, 17 insertions(+), 41 deletions(-) diff --git a/src/v0/destinations/clickup/util.js b/src/v0/destinations/clickup/util.js index 9930954ecbf..55923b29538 100644 --- a/src/v0/destinations/clickup/util.js +++ b/src/v0/destinations/clickup/util.js @@ -1,4 +1,5 @@ const { NetworkError, InstrumentationError } = require('@rudderstack/integrations-lib'); +const validator = require('validator'); const { httpGET } = require('../../../adapters/network'); const { processAxiosResponse, @@ -9,6 +10,7 @@ const { getHashFromArrayWithValueAsObject, formatTimeStamp, } = require('../../util'); + const { getCustomFieldsEndPoint } = require('./config'); const tags = require('../../util/tags'); const { JSON_MIME_TYPE } = require('../../util/constant'); @@ -44,9 +46,7 @@ const validatePhoneWithCountryCode = (phone) => { * @param {*} email */ const validateEmail = (email) => { - const regex = - /^(([^\s"(),.:;<>@[\\\]]+(\.[^\s"(),.:;<>@[\\\]]+)*)|(".+"))@((\[(?:\d{1,3}\.){3}\d{1,3}])|(([\dA-Za-z-]+\.)+[A-Za-z]{2,}))$/; - if (!regex.test(email)) { + if (!validator.isEmail(email)) { throw new InstrumentationError('The provided email is invalid'); } }; diff --git a/src/v0/destinations/customerio/util.js b/src/v0/destinations/customerio/util.js index cadad5620ce..d5696123b04 100644 --- a/src/v0/destinations/customerio/util.js +++ b/src/v0/destinations/customerio/util.js @@ -1,6 +1,7 @@ const get = require('get-value'); const set = require('set-value'); const truncate = require('truncate-utf8-bytes'); +const validator = require('validator'); const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); const { MAX_BATCH_SIZE, configFieldsToCheck } = require('./config'); const { @@ -10,7 +11,6 @@ const { getFieldValueFromMessage, defaultDeleteRequestConfig, isAppleFamily, - validateEmail, } = require('../../util'); const { EventType, SpecedTraits, TraitsMapping } = require('../../../constants'); @@ -166,26 +166,19 @@ const identifyResponseBuilder = (userId, message) => { const aliasResponseBuilder = (message, userId) => { // ref : https://customer.io/docs/api/#operation/merge - if (!userId && !message.previousId) { - throw new InstrumentationError('Both userId and previousId is mandatory for merge operation'); + if (!userId || !message.previousId) { + throw new InstrumentationError('Both userId and previousId are mandatory for merge operation'); } const endpoint = MERGE_USER_ENDPOINT; const requestConfig = defaultPostRequestConfig; - let cioProperty = 'id'; - if (validateEmail(userId)) { - cioProperty = 'email'; - } - // eslint-disable-next-line @typescript-eslint/naming-convention - let prev_cioProperty = 'id'; - if (validateEmail(message.previousId)) { - prev_cioProperty = 'email'; - } + const cioProperty = validator.isEmail(userId) ? 'email' : 'id'; + const prevCioProperty = validator.isEmail(message.previousId) ? 'email' : 'id'; const rawPayload = { primary: { [cioProperty]: userId, }, secondary: { - [prev_cioProperty]: message.previousId, + [prevCioProperty]: message.previousId, }, }; @@ -208,11 +201,8 @@ const groupResponseBuilder = (message) => { cio_relationships: [], }; const id = payload?.userId || payload?.email; - let cioProperty = 'id'; - if (validateEmail(id)) { - cioProperty = 'email'; - } if (id) { + const cioProperty = validator.isEmail(id) ? 'email' : 'id'; rawPayload.cio_relationships.push({ identifiers: { [cioProperty]: id } }); } const requestConfig = defaultPostRequestConfig; diff --git a/src/v0/destinations/customerio/util.test.js b/src/v0/destinations/customerio/util.test.js index 2c308cd262d..ee36bd3f1be 100644 --- a/src/v0/destinations/customerio/util.test.js +++ b/src/v0/destinations/customerio/util.test.js @@ -8,6 +8,7 @@ const { const getTestMessage = () => { let message = { anonymousId: 'anonId', + previousId: 'user0', traits: { email: 'abc@test.com', name: 'rudder', @@ -133,7 +134,7 @@ describe('Unit test cases for customerio aliasResponseBuilder', () => { it('Device token name does not match with event name as well as allowed list', async () => { let expectedOutput = { endpoint: 'https://track.customer.io/api/v1/merge_customers', - rawPayload: { primary: { id: 'user1' }, secondary: { id: undefined } }, + rawPayload: { primary: { id: 'user1' }, secondary: { id: 'user0' } }, requestConfig: { requestFormat: 'JSON', requestMethod: 'POST' }, }; expect(aliasResponseBuilder(getTestMessage(), 'user1')).toEqual(expectedOutput); diff --git a/src/v0/destinations/mautic/utils.js b/src/v0/destinations/mautic/utils.js index fc9654d2e3a..061c91f3578 100644 --- a/src/v0/destinations/mautic/utils.js +++ b/src/v0/destinations/mautic/utils.js @@ -1,5 +1,6 @@ /* eslint-disable no-return-assign, no-param-reassign, no-restricted-syntax */ const get = require('get-value'); +const validator = require('validator'); const { NetworkError, InstrumentationError, @@ -24,15 +25,7 @@ const { JSON_MIME_TYPE } = require('../../util/constant'); function createAxiosUrl(propertyName, value, baseUrl) { return `${baseUrl}/contacts?where%5B0%5D%5Bcol%5D=${propertyName}&where%5B0%5D%5Bexpr%5D=eq&where%5B0%5D%5Bval%5D=${value}`; } -/** - * @param {*} inputText - * @returns Boolean Value - * for validating email match - */ -function validateEmail(inputText) { - const mailformat = /^[\d%+._a-z-]+@[\d.a-z-]+\.[a-z]{2,3}$/; - return mailformat.test(inputText); -} + /** * @param {*} message * @param {*} lookUpField @@ -126,7 +119,7 @@ const validatePayload = (payload) => { throw new InstrumentationError('The provided phone number is invalid'); } - if (payload.email && !validateEmail(payload.email)) { + if (payload.email && !validator.isEmail(payload.email)) { throw new InstrumentationError('The provided email is invalid'); } return true; @@ -220,7 +213,6 @@ const getEndpoint = (Config) => { }; module.exports = { deduceStateField, - validateEmail, validatePhone, deduceAddressFields, validateGroupCall, diff --git a/src/v0/destinations/sendinblue/util.js b/src/v0/destinations/sendinblue/util.js index 3af35cd7b99..813d5c4150b 100644 --- a/src/v0/destinations/sendinblue/util.js +++ b/src/v0/destinations/sendinblue/util.js @@ -1,10 +1,10 @@ const { NetworkError, InstrumentationError } = require('@rudderstack/integrations-lib'); +const validator = require('validator'); const { EMAIL_SUFFIX, getContactDetailsEndpoint } = require('./config'); const { getHashFromArray, getIntegrationsObj, isNotEmpty, - validateEmail, validatePhoneWithCountryCode, getDestinationExternalID, } = require('../../util'); @@ -36,7 +36,7 @@ const checkIfEmailOrPhoneExists = (email, phone) => { }; const validateEmailAndPhone = (email, phone = null) => { - if (email && !validateEmail(email)) { + if (email && !validator.isEmail(email)) { throw new InstrumentationError('The provided email is invalid'); } diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 683cf9b746b..36e04e53950 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -1932,12 +1932,6 @@ const refinePayload = (obj) => { return refinedPayload; }; -const validateEmail = (email) => { - const regex = - /^(([^\s"(),.:;<>@[\\\]]+(\.[^\s"(),.:;<>@[\\\]]+)*)|(".+"))@((\[(?:\d{1,3}\.){3}\d{1,3}])|(([\dA-Za-z-]+\.)+[A-Za-z]{2,}))$/; - return !!regex.test(email); -}; - const validatePhoneWithCountryCode = (phone) => { const regex = /^\+(?:[\d{] ?){6,14}\d$/; return !!regex.test(phone); @@ -2472,7 +2466,6 @@ module.exports = { getErrorStatusCode, getDestAuthCacheInstance, refinePayload, - validateEmail, validateEventName, validatePhoneWithCountryCode, getEventReqMetadata, From 165e06de1ac22cda5c4db0b0b23e6e9972d5fa94 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:55:36 +0530 Subject: [PATCH 032/160] feat: add redis support in shopify pixel for id stitching (#3957) --- src/v0/sources/shopify/util.js | 1 + .../campaignObjectMappings.json | 18 +++ src/v1/sources/shopify/transform.js | 4 + src/v1/sources/shopify/utils.js | 22 +++ src/v1/sources/shopify/utils.test.js | 45 ++++++ .../serverSideTransform.js | 43 +----- .../serverSideUtils.test.js | 61 ++++++-- .../webhookTransformations/serverSideUtlis.js | 71 ++++++++- .../webpixelTransformations/pixelTransform.js | 33 +++- .../integrations/sources/shopify/constants.ts | 141 ++++++++++++++---- .../pixelTestScenarios/ProductEventsTests.ts | 19 ++- 11 files changed, 377 insertions(+), 81 deletions(-) create mode 100644 src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json create mode 100644 src/v1/sources/shopify/utils.js create mode 100644 src/v1/sources/shopify/utils.test.js diff --git a/src/v0/sources/shopify/util.js b/src/v0/sources/shopify/util.js index b7e79e35a16..3665dfff203 100644 --- a/src/v0/sources/shopify/util.js +++ b/src/v0/sources/shopify/util.js @@ -272,6 +272,7 @@ module.exports = { createPropertiesForEcomEvent, extractEmailFromPayload, getAnonymousIdAndSessionId, + getCartToken, checkAndUpdateCartItems, getHashLineItems, getDataFromRedis, diff --git a/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json b/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json new file mode 100644 index 00000000000..319502e377b --- /dev/null +++ b/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json @@ -0,0 +1,18 @@ +[ + { + "sourceKeys": "utm_campaign", + "destKeys": "name" + }, + { + "sourceKeys": "utm_medium", + "destKeys": "medium" + }, + { + "sourceKeys": "utm_term", + "destKeys": "term" + }, + { + "sourceKeys": "utm_content", + "destKeys": "content" + } +] diff --git a/src/v1/sources/shopify/transform.js b/src/v1/sources/shopify/transform.js index 5ebf4a34fc5..7194baf34b6 100644 --- a/src/v1/sources/shopify/transform.js +++ b/src/v1/sources/shopify/transform.js @@ -4,10 +4,14 @@ const { process: processWebhookEvents } = require('../../../v0/sources/shopify/t const { process: processPixelWebhookEvents, } = require('./webhookTransformations/serverSideTransform'); +const { processIdentifierEvent, isIdentifierEvent } = require('./utils'); const process = async (inputEvent) => { const { event } = inputEvent; const { query_parameters } = event; + if (isIdentifierEvent(event)) { + return processIdentifierEvent(event); + } // check identify the event is from the web pixel based on the pixelEventLabel property. const { pixelEventLabel: pixelClientEventLabel } = event; if (pixelClientEventLabel) { diff --git a/src/v1/sources/shopify/utils.js b/src/v1/sources/shopify/utils.js new file mode 100644 index 00000000000..f33e7a9b253 --- /dev/null +++ b/src/v1/sources/shopify/utils.js @@ -0,0 +1,22 @@ +const { RedisDB } = require('../../../util/redis/redisConnector'); + +const NO_OPERATION_SUCCESS = { + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, +}; + +const isIdentifierEvent = (payload) => ['rudderIdentifier'].includes(payload?.event); + +const processIdentifierEvent = async (event) => { + const { cartToken, anonymousId } = event; + await RedisDB.setVal(`${cartToken}`, ['anonymousId', anonymousId]); + return NO_OPERATION_SUCCESS; +}; + +module.exports = { + processIdentifierEvent, + isIdentifierEvent, +}; diff --git a/src/v1/sources/shopify/utils.test.js b/src/v1/sources/shopify/utils.test.js new file mode 100644 index 00000000000..4b25f8defd7 --- /dev/null +++ b/src/v1/sources/shopify/utils.test.js @@ -0,0 +1,45 @@ +const { isIdentifierEvent, processIdentifierEvent } = require('./utils'); +const { RedisDB } = require('../../../util/redis/redisConnector'); + +describe('Identifier Utils Tests', () => { + describe('test isIdentifierEvent', () => { + it('should return true if the event is rudderIdentifier', () => { + const event = { event: 'rudderIdentifier' }; + expect(isIdentifierEvent(event)).toBe(true); + }); + + it('should return false if the event is not rudderIdentifier', () => { + const event = { event: 'checkout started' }; + expect(isIdentifierEvent(event)).toBe(false); + }); + }); + + describe('test processIdentifierEvent', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should set the anonymousId in redis and return NO_OPERATION_SUCCESS', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; + + const response = await processIdentifierEvent(event); + + expect(setValSpy).toHaveBeenCalledWith('cartTokenTest1', ['anonymousId', 'anonymousIdTest1']); + expect(response).toEqual({ + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, + }); + }); + + it('should handle redis errors', async () => { + jest.spyOn(RedisDB, 'setVal').mockRejectedValue(new Error('Redis connection failed')); + const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; + + await expect(processIdentifierEvent(event)).rejects.toThrow('Redis connection failed'); + }); + }); +}); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index d0221f6950a..41f53787da4 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -1,9 +1,8 @@ -/* eslint-disable @typescript-eslint/naming-convention */ const lodash = require('lodash'); const get = require('get-value'); const stats = require('../../../../util/stats'); -const { getShopifyTopic, extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); -const { removeUndefinedAndNullValues, isDefinedAndNotNull } = require('../../../../v0/util'); +const { getShopifyTopic } = require('../../../../v0/sources/shopify/util'); +const { removeUndefinedAndNullValues } = require('../../../../v0/util'); const Message = require('../../../../v0/sources/message'); const { EventType } = require('../../../../constants'); const { @@ -19,7 +18,8 @@ const { RUDDER_ECOM_MAP } = require('../config'); const { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, - getAnonymousIdFromAttributes, + handleAnonymousId, + handleCommonProperties, } = require('./serverSideUtlis'); const NO_OPERATION_SUCCESS = { @@ -65,9 +65,6 @@ const ecomPayloadBuilder = (event, shopifyTopic) => { if (event.billing_address) { message.setProperty('traits.billingAddress', event.billing_address); } - if (!message.userId && event.user_id) { - message.setProperty('userId', event.user_id); - } return message; }; @@ -110,38 +107,12 @@ const processEvent = async (inputEvent, metricMetadata) => { message = trackPayloadBuilder(event, shopifyTopic); break; } - - if (message.userId) { - message.userId = String(message.userId); - } - if (!get(message, 'traits.email')) { - const email = extractEmailFromPayload(event); - if (email) { - message.setProperty('traits.email', email); - } - } // attach anonymousId if the event is track event using note_attributes if (message.type !== EventType.IDENTIFY) { - const anonymousId = getAnonymousIdFromAttributes(event); - if (isDefinedAndNotNull(anonymousId)) { - message.setProperty('anonymousId', anonymousId); - } - } - message.setProperty(`integrations.${INTEGERATION}`, true); - message.setProperty('context.library', { - eventOrigin: 'server', - name: 'RudderStack Shopify Cloud', - version: '2.0.0', - }); - message.setProperty('context.topic', shopifyTopic); - // attaching cart, checkout and order tokens in context object - message.setProperty(`context.cart_token`, event.cart_token); - message.setProperty(`context.checkout_token`, event.checkout_token); - // raw shopify payload passed inside context object under shopifyDetails - message.setProperty('context.shopifyDetails', event); - if (shopifyTopic === 'orders_updated') { - message.setProperty(`context.order_token`, event.token); + handleAnonymousId(message, event); } + // attach userId, email and other contextual properties + message = handleCommonProperties(message, event, shopifyTopic); message = removeUndefinedAndNullValues(message); return message; }; diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index b94ec9c3ddf..7c1f2ad0d24 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -1,15 +1,13 @@ +const { processEvent } = require('./serverSideTransform'); const { getProductsFromLineItems, createPropertiesForEcomEventFromWebhook, getAnonymousIdFromAttributes, + getCartToken, } = require('./serverSideUtlis'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); -const { constructPayload } = require('../../../../v0/util'); - -const { - lineItemsMappingJSON, - productMappingJSON, -} = require('../../../../v0/sources/shopify/config'); +const { lineItemsMappingJSON } = require('../../../../v0/sources/shopify/config'); const Message = require('../../../../v0/sources/message'); jest.mock('../../../../v0/sources/message'); @@ -63,7 +61,6 @@ describe('serverSideUtils.js', () => { }); it('should return array of products', () => { - const mapping = {}; const result = getProductsFromLineItems(LINEITEMS, lineItemsMappingJSON); expect(result).toEqual([ { brand: 'Hydrogen Vendor', price: '600.00', product_id: 7234590408818, quantity: 1 }, @@ -115,7 +112,13 @@ describe('serverSideUtils.js', () => { // Handles empty note_attributes array gracefully it('should return null when note_attributes is an empty array', async () => { const event = { note_attributes: [] }; - const result = await getAnonymousIdFromAttributes(event); + const result = getAnonymousIdFromAttributes(event); + expect(result).toBeNull(); + }); + + it('should return null when note_attributes is not present', async () => { + const event = {}; + const result = getAnonymousIdFromAttributes(event); expect(result).toBeNull(); }); @@ -123,8 +126,48 @@ describe('serverSideUtils.js', () => { const event = { note_attributes: [{ name: 'rudderAnonymousId', value: '123456' }], }; - const result = await getAnonymousIdFromAttributes(event); + const result = getAnonymousIdFromAttributes(event); expect(result).toEqual('123456'); }); }); + + describe('getCartToken', () => { + it('should return null if cart_token is not present', () => { + const event = {}; + const result = getCartToken(event); + expect(result).toBeNull(); + }); + + it('should return cart_token if it is present', () => { + const event = { cart_token: 'cartTokenTest1' }; + const result = getCartToken(event); + expect(result).toEqual('cartTokenTest1'); + }); + }); +}); + +describe('Redis cart token tests', () => { + it('should get anonymousId property from redis', async () => { + const getValSpy = jest + .spyOn(RedisDB, 'getVal') + .mockResolvedValue({ anonymousId: 'anonymousIdTest1' }); + const event = { + cart_token: `cartTokenTest1`, + id: 5778367414385, + line_items: [ + { + id: 14234727743601, + }, + ], + query_parameters: { + topic: ['orders_updated'], + version: ['pixel'], + writeKey: ['dummy-write-key'], + }, + }; + const message = await processEvent(event); + expect(getValSpy).toHaveBeenCalledTimes(1); + expect(getValSpy).toHaveBeenCalledWith('cartTokenTest1'); + expect(message.setProperty).toHaveBeenCalledWith('anonymousId', 'anonymousIdTest1'); + }); }); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index df33d7a347a..ace9d6bb0fb 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -1,6 +1,10 @@ +/* eslint-disable no-param-reassign */ +const get = require('get-value'); const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); +const { extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); const { constructPayload } = require('../../../../v0/util'); -const { lineItemsMappingJSON, productMappingJSON } = require('../config'); +const { INTEGERATION, lineItemsMappingJSON, productMappingJSON } = require('../config'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); /** * Returns an array of products from the lineItems array received from the webhook event @@ -54,8 +58,73 @@ const getAnonymousIdFromAttributes = (event) => { return rudderAnonymousIdObject ? rudderAnonymousIdObject.value : null; }; +/** + * Returns the cart_token from the event message + * @param {Object} event + * @returns {String} cart_token + */ +const getCartToken = (event) => event?.cart_token || null; + +/** + * Handles the anonymousId assignment for the message, based on the event attributes and redis data + * @param {Object} message + * @param {Object} event + */ +const handleAnonymousId = async (message, event) => { + const anonymousId = getAnonymousIdFromAttributes(event); + if (isDefinedAndNotNull(anonymousId)) { + message.setProperty('anonymousId', anonymousId); + } else { + // if anonymousId is not present in note_attributes or note_attributes is not present, query redis for anonymousId + const cartToken = getCartToken(event); + if (cartToken) { + const redisData = await RedisDB.getVal(cartToken); + if (redisData?.anonymousId) { + message.setProperty('anonymousId', redisData.anonymousId); + } + } + } +}; + +/** + Handles userId, email and contextual properties enrichment for the message payload + * @param {Object} message + * @param {Object} event + * @param {String} shopifyTopic +*/ +const handleCommonProperties = (message, event, shopifyTopic) => { + if (message.userId) { + message.userId = String(message.userId); + } + if (!get(message, 'traits.email')) { + const email = extractEmailFromPayload(event); + if (email) { + message.setProperty('traits.email', email); + } + } + message.setProperty(`integrations.${INTEGERATION}`, true); + message.setProperty('context.library', { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }); + message.setProperty('context.topic', shopifyTopic); + // attaching cart, checkout and order tokens in context object + message.setProperty(`context.cart_token`, event.cart_token); + message.setProperty(`context.checkout_token`, event.checkout_token); + // raw shopify payload passed inside context object under shopifyDetails + message.setProperty('context.shopifyDetails', event); + if (shopifyTopic === 'orders_updated') { + message.setProperty(`context.order_token`, event.token); + } + return message; +}; + module.exports = { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, getAnonymousIdFromAttributes, + getCartToken, + handleAnonymousId, + handleCommonProperties, }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js index b1d1c8b2fac..f95459667ab 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js @@ -16,6 +16,7 @@ const { checkoutStepEventBuilder, searchEventBuilder, } = require('./pixelUtils'); +const campaignObjectMappings = require('../pixelEventsMappings/campaignObjectMappings.json'); const { INTEGERATION, PIXEL_EVENT_TOPICS, @@ -85,7 +86,7 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { function processPixelEvent(inputEvent) { // eslint-disable-next-line @typescript-eslint/naming-convention - const { name, query_parameters, clientId, data, id } = inputEvent; + const { name, query_parameters, context, clientId, data, id } = inputEvent; const shopifyDetails = { ...inputEvent }; delete shopifyDetails.context; delete shopifyDetails.query_parameters; @@ -147,6 +148,36 @@ function processPixelEvent(inputEvent) { }); message.setProperty('context.topic', name); message.setProperty('context.shopifyDetails', shopifyDetails); + + // adding campaign object to the message + if (context?.document?.location?.href) { + const url = new URL(context.document.location.href); + const campaignParams = {}; + + // Loop through mappings and extract UTM parameters + campaignObjectMappings.forEach((mapping) => { + const value = url.searchParams.get(mapping.sourceKeys); + if (value) { + campaignParams[mapping.destKeys] = value; + } + }); + + // Extract any UTM parameters not in the mappings + const campaignObjectSourceKeys = campaignObjectMappings.flatMap( + (mapping) => mapping.sourceKeys, + ); + url.searchParams.forEach((value, key) => { + if (key.startsWith('utm_') && !campaignObjectSourceKeys.includes(key)) { + campaignParams[key] = value; + } + }); + + // Only add campaign object if we have any UTM parameters + if (Object.keys(campaignParams).length > 0) { + message.context = message.context || {}; + message.context.campaign = campaignParams; + } + } message.messageId = id; message = removeUndefinedAndNullValues(message); return message; diff --git a/test/integrations/sources/shopify/constants.ts b/test/integrations/sources/shopify/constants.ts index af53a3180e8..cd362adaec3 100644 --- a/test/integrations/sources/shopify/constants.ts +++ b/test/integrations/sources/shopify/constants.ts @@ -1,3 +1,58 @@ +const dummyResponseCommonPayload = { + navigator: { + language: 'en-US', + cookieEnabled: true, + languages: ['en-US', 'en'], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', + }, + window: { + innerHeight: 1028, + innerWidth: 1362, + outerHeight: 1080, + outerWidth: 1728, + pageXOffset: 0, + pageYOffset: 0, + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + origin: 'https://store.myshopify.com', + screen: { + height: 1117, + width: 1728, + }, + screenX: 0, + screenY: 37, + scrollX: 0, + scrollY: 0, + }, + page: { + title: 'Checkout - pixel-testing-rs', + url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + search: '', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', + screen: { + height: 1117, + width: 1728, + }, + library: { + name: 'RudderStack Shopify Cloud', + eventOrigin: 'client', + version: '2.0.0', + }, +}; + export const dummySourceConfig = { ID: 'dummy-source-id', OriginalID: '', @@ -83,25 +138,10 @@ export const dummyContext = { }, }; -export const note_attributes = [ - { - name: 'cartId', - value: '9c623f099fc8819aa4d6a958b65dfe7d', - }, - { - name: 'cartToken', - value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', - }, - { - name: 'rudderAnonymousId', - value: '50ead33e-d763-4854-b0ab-765859ef05cb', - }, -]; - -export const responseDummyContext = { +export const dummyContextwithCampaign = { document: { location: { - href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', hash: '', host: 'store.myshopify.com', hostname: 'store.myshopify.com', @@ -150,21 +190,60 @@ export const responseDummyContext = { scrollX: 0, scrollY: 0, }, - page: { - title: 'Checkout - pixel-testing-rs', - url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - search: '', +}; + +export const note_attributes = [ + { + name: 'cartId', + value: '9c623f099fc8819aa4d6a958b65dfe7d', }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', - screen: { - height: 1117, - width: 1728, + { + name: 'cartToken', + value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', }, - library: { - name: 'RudderStack Shopify Cloud', - eventOrigin: 'client', - version: '2.0.0', + { + name: 'rudderAnonymousId', + value: '50ead33e-d763-4854-b0ab-765859ef05cb', + }, +]; + +export const responseDummyContext = { + document: { + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + referrer: 'https://store.myshopify.com/cart', + characterSet: 'UTF-8', + title: 'Checkout - pixel-testing-rs', + }, + ...dummyResponseCommonPayload, +}; + +export const responseDummyContextwithCampaign = { + document: { + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + referrer: 'https://store.myshopify.com/cart', + title: 'Checkout - pixel-testing-rs', + characterSet: 'UTF-8', }, + // title: 'Checkout - pixel-testing-rs', + ...dummyResponseCommonPayload, }; diff --git a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts index 46bd4f96151..39fceb4da8e 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts @@ -1,5 +1,11 @@ // This file contains the test scenarios related to Shopify pixel events, emitted from web pixel on the browser. -import { dummyContext, dummySourceConfig, responseDummyContext } from '../constants'; +import { + dummyContext, + dummyContextwithCampaign, + dummySourceConfig, + responseDummyContext, + responseDummyContextwithCampaign, +} from '../constants'; export const pixelEventsTestScenarios = [ { @@ -18,7 +24,7 @@ export const pixelEventsTestScenarios = [ type: 'standard', clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', timestamp: '2024-09-15T17:24:30.373Z', - context: dummyContext, + context: dummyContextwithCampaign, pixelEventLabel: true, query_parameters: { topic: ['page_viewed'], @@ -42,7 +48,14 @@ export const pixelEventsTestScenarios = [ batch: [ { context: { - ...responseDummyContext, + ...responseDummyContextwithCampaign, + campaign: { + content: 'web', + medium: 'checkout', + name: 'shopifySale', + term: 'term_checkout', + utm_custom1: 'customutm', + }, shopifyDetails: { clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', data: {}, From 06d8f2a1bdb19346698fdc635cf87098876d0abc Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 20 Jan 2025 10:14:23 +0000 Subject: [PATCH 033/160] chore(release): 1.88.0 --- CHANGELOG.md | 17 +++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa45ed9b5b3..a82aaaa08f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ 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.88.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.1...v1.88.0) (2025-01-20) + + +### Features + +* add redis support in shopify pixel for id stitching ([#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957)) ([165e06d](https://github.com/rudderlabs/rudder-transformer/commit/165e06de1ac22cda5c4db0b0b23e6e9972d5fa94)) +* added drop traits in track call feature for mixpanel ([#3986](https://github.com/rudderlabs/rudder-transformer/issues/3986)) ([6ec3d55](https://github.com/rudderlabs/rudder-transformer/commit/6ec3d552b845535965bc6c7b9990161a168b9a4e)) + + +### Bug Fixes + +* add email validation in HS ([#3972](https://github.com/rudderlabs/rudder-transformer/issues/3972)) ([1c45db8](https://github.com/rudderlabs/rudder-transformer/commit/1c45db8e6ec6b9436ef08eaa9dfcc99c8953397b)) +* fixing mismatch of schedule field value in clicksend destination ([#3975](https://github.com/rudderlabs/rudder-transformer/issues/3975)) ([12e8a52](https://github.com/rudderlabs/rudder-transformer/commit/12e8a528148454e2113c9c68b575d25695c1d55a)) +* refactor code and add validation for values ([#3971](https://github.com/rudderlabs/rudder-transformer/issues/3971)) ([fc09080](https://github.com/rudderlabs/rudder-transformer/commit/fc090806235f2599703098c9f3fc83c4bdf7d599)) +* removing device token from if condition in mixpanel destination ([#3982](https://github.com/rudderlabs/rudder-transformer/issues/3982)) ([b0e0b15](https://github.com/rudderlabs/rudder-transformer/commit/b0e0b15ee3cb7aeab0162c91fdcf98fca1e16722)) +* sonar issues in regex expressions ([#3979](https://github.com/rudderlabs/rudder-transformer/issues/3979)) ([0e0944d](https://github.com/rudderlabs/rudder-transformer/commit/0e0944d2372fa53b1a6db56fd382fc42c57e5068)) + ### [1.87.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.0...v1.87.1) (2025-01-06) diff --git a/package-lock.json b/package-lock.json index b3631b2e57f..b0f89dfa2d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.87.1", + "version": "1.88.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.87.1", + "version": "1.88.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index cf72ab26def..cea3056e662 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.87.1", + "version": "1.88.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 8eab86fbac539d6fbdc516489fb5b557002004b2 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Tue, 21 Jan 2025 13:52:42 +0530 Subject: [PATCH 034/160] chore: revert "feat: add redis support in shopify pixel for id stitching (#3957)" This reverts commit 165e06de1ac22cda5c4db0b0b23e6e9972d5fa94. --- src/v0/sources/shopify/util.js | 1 - .../campaignObjectMappings.json | 18 --- src/v1/sources/shopify/transform.js | 4 - src/v1/sources/shopify/utils.js | 22 --- src/v1/sources/shopify/utils.test.js | 45 ------ .../serverSideTransform.js | 43 +++++- .../serverSideUtils.test.js | 61 ++------ .../webhookTransformations/serverSideUtlis.js | 71 +-------- .../webpixelTransformations/pixelTransform.js | 33 +--- .../integrations/sources/shopify/constants.ts | 141 ++++-------------- .../pixelTestScenarios/ProductEventsTests.ts | 19 +-- 11 files changed, 81 insertions(+), 377 deletions(-) delete mode 100644 src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json delete mode 100644 src/v1/sources/shopify/utils.js delete mode 100644 src/v1/sources/shopify/utils.test.js diff --git a/src/v0/sources/shopify/util.js b/src/v0/sources/shopify/util.js index 3665dfff203..b7e79e35a16 100644 --- a/src/v0/sources/shopify/util.js +++ b/src/v0/sources/shopify/util.js @@ -272,7 +272,6 @@ module.exports = { createPropertiesForEcomEvent, extractEmailFromPayload, getAnonymousIdAndSessionId, - getCartToken, checkAndUpdateCartItems, getHashLineItems, getDataFromRedis, diff --git a/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json b/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json deleted file mode 100644 index 319502e377b..00000000000 --- a/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "sourceKeys": "utm_campaign", - "destKeys": "name" - }, - { - "sourceKeys": "utm_medium", - "destKeys": "medium" - }, - { - "sourceKeys": "utm_term", - "destKeys": "term" - }, - { - "sourceKeys": "utm_content", - "destKeys": "content" - } -] diff --git a/src/v1/sources/shopify/transform.js b/src/v1/sources/shopify/transform.js index 7194baf34b6..5ebf4a34fc5 100644 --- a/src/v1/sources/shopify/transform.js +++ b/src/v1/sources/shopify/transform.js @@ -4,14 +4,10 @@ const { process: processWebhookEvents } = require('../../../v0/sources/shopify/t const { process: processPixelWebhookEvents, } = require('./webhookTransformations/serverSideTransform'); -const { processIdentifierEvent, isIdentifierEvent } = require('./utils'); const process = async (inputEvent) => { const { event } = inputEvent; const { query_parameters } = event; - if (isIdentifierEvent(event)) { - return processIdentifierEvent(event); - } // check identify the event is from the web pixel based on the pixelEventLabel property. const { pixelEventLabel: pixelClientEventLabel } = event; if (pixelClientEventLabel) { diff --git a/src/v1/sources/shopify/utils.js b/src/v1/sources/shopify/utils.js deleted file mode 100644 index f33e7a9b253..00000000000 --- a/src/v1/sources/shopify/utils.js +++ /dev/null @@ -1,22 +0,0 @@ -const { RedisDB } = require('../../../util/redis/redisConnector'); - -const NO_OPERATION_SUCCESS = { - outputToSource: { - body: Buffer.from('OK').toString('base64'), - contentType: 'text/plain', - }, - statusCode: 200, -}; - -const isIdentifierEvent = (payload) => ['rudderIdentifier'].includes(payload?.event); - -const processIdentifierEvent = async (event) => { - const { cartToken, anonymousId } = event; - await RedisDB.setVal(`${cartToken}`, ['anonymousId', anonymousId]); - return NO_OPERATION_SUCCESS; -}; - -module.exports = { - processIdentifierEvent, - isIdentifierEvent, -}; diff --git a/src/v1/sources/shopify/utils.test.js b/src/v1/sources/shopify/utils.test.js deleted file mode 100644 index 4b25f8defd7..00000000000 --- a/src/v1/sources/shopify/utils.test.js +++ /dev/null @@ -1,45 +0,0 @@ -const { isIdentifierEvent, processIdentifierEvent } = require('./utils'); -const { RedisDB } = require('../../../util/redis/redisConnector'); - -describe('Identifier Utils Tests', () => { - describe('test isIdentifierEvent', () => { - it('should return true if the event is rudderIdentifier', () => { - const event = { event: 'rudderIdentifier' }; - expect(isIdentifierEvent(event)).toBe(true); - }); - - it('should return false if the event is not rudderIdentifier', () => { - const event = { event: 'checkout started' }; - expect(isIdentifierEvent(event)).toBe(false); - }); - }); - - describe('test processIdentifierEvent', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('should set the anonymousId in redis and return NO_OPERATION_SUCCESS', async () => { - const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); - const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; - - const response = await processIdentifierEvent(event); - - expect(setValSpy).toHaveBeenCalledWith('cartTokenTest1', ['anonymousId', 'anonymousIdTest1']); - expect(response).toEqual({ - outputToSource: { - body: Buffer.from('OK').toString('base64'), - contentType: 'text/plain', - }, - statusCode: 200, - }); - }); - - it('should handle redis errors', async () => { - jest.spyOn(RedisDB, 'setVal').mockRejectedValue(new Error('Redis connection failed')); - const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; - - await expect(processIdentifierEvent(event)).rejects.toThrow('Redis connection failed'); - }); - }); -}); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 41f53787da4..d0221f6950a 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -1,8 +1,9 @@ +/* eslint-disable @typescript-eslint/naming-convention */ const lodash = require('lodash'); const get = require('get-value'); const stats = require('../../../../util/stats'); -const { getShopifyTopic } = require('../../../../v0/sources/shopify/util'); -const { removeUndefinedAndNullValues } = require('../../../../v0/util'); +const { getShopifyTopic, extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); +const { removeUndefinedAndNullValues, isDefinedAndNotNull } = require('../../../../v0/util'); const Message = require('../../../../v0/sources/message'); const { EventType } = require('../../../../constants'); const { @@ -18,8 +19,7 @@ const { RUDDER_ECOM_MAP } = require('../config'); const { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, - handleAnonymousId, - handleCommonProperties, + getAnonymousIdFromAttributes, } = require('./serverSideUtlis'); const NO_OPERATION_SUCCESS = { @@ -65,6 +65,9 @@ const ecomPayloadBuilder = (event, shopifyTopic) => { if (event.billing_address) { message.setProperty('traits.billingAddress', event.billing_address); } + if (!message.userId && event.user_id) { + message.setProperty('userId', event.user_id); + } return message; }; @@ -107,12 +110,38 @@ const processEvent = async (inputEvent, metricMetadata) => { message = trackPayloadBuilder(event, shopifyTopic); break; } + + if (message.userId) { + message.userId = String(message.userId); + } + if (!get(message, 'traits.email')) { + const email = extractEmailFromPayload(event); + if (email) { + message.setProperty('traits.email', email); + } + } // attach anonymousId if the event is track event using note_attributes if (message.type !== EventType.IDENTIFY) { - handleAnonymousId(message, event); + const anonymousId = getAnonymousIdFromAttributes(event); + if (isDefinedAndNotNull(anonymousId)) { + message.setProperty('anonymousId', anonymousId); + } + } + message.setProperty(`integrations.${INTEGERATION}`, true); + message.setProperty('context.library', { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }); + message.setProperty('context.topic', shopifyTopic); + // attaching cart, checkout and order tokens in context object + message.setProperty(`context.cart_token`, event.cart_token); + message.setProperty(`context.checkout_token`, event.checkout_token); + // raw shopify payload passed inside context object under shopifyDetails + message.setProperty('context.shopifyDetails', event); + if (shopifyTopic === 'orders_updated') { + message.setProperty(`context.order_token`, event.token); } - // attach userId, email and other contextual properties - message = handleCommonProperties(message, event, shopifyTopic); message = removeUndefinedAndNullValues(message); return message; }; diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index 7c1f2ad0d24..b94ec9c3ddf 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -1,13 +1,15 @@ -const { processEvent } = require('./serverSideTransform'); const { getProductsFromLineItems, createPropertiesForEcomEventFromWebhook, getAnonymousIdFromAttributes, - getCartToken, } = require('./serverSideUtlis'); -const { RedisDB } = require('../../../../util/redis/redisConnector'); -const { lineItemsMappingJSON } = require('../../../../v0/sources/shopify/config'); +const { constructPayload } = require('../../../../v0/util'); + +const { + lineItemsMappingJSON, + productMappingJSON, +} = require('../../../../v0/sources/shopify/config'); const Message = require('../../../../v0/sources/message'); jest.mock('../../../../v0/sources/message'); @@ -61,6 +63,7 @@ describe('serverSideUtils.js', () => { }); it('should return array of products', () => { + const mapping = {}; const result = getProductsFromLineItems(LINEITEMS, lineItemsMappingJSON); expect(result).toEqual([ { brand: 'Hydrogen Vendor', price: '600.00', product_id: 7234590408818, quantity: 1 }, @@ -112,13 +115,7 @@ describe('serverSideUtils.js', () => { // Handles empty note_attributes array gracefully it('should return null when note_attributes is an empty array', async () => { const event = { note_attributes: [] }; - const result = getAnonymousIdFromAttributes(event); - expect(result).toBeNull(); - }); - - it('should return null when note_attributes is not present', async () => { - const event = {}; - const result = getAnonymousIdFromAttributes(event); + const result = await getAnonymousIdFromAttributes(event); expect(result).toBeNull(); }); @@ -126,48 +123,8 @@ describe('serverSideUtils.js', () => { const event = { note_attributes: [{ name: 'rudderAnonymousId', value: '123456' }], }; - const result = getAnonymousIdFromAttributes(event); + const result = await getAnonymousIdFromAttributes(event); expect(result).toEqual('123456'); }); }); - - describe('getCartToken', () => { - it('should return null if cart_token is not present', () => { - const event = {}; - const result = getCartToken(event); - expect(result).toBeNull(); - }); - - it('should return cart_token if it is present', () => { - const event = { cart_token: 'cartTokenTest1' }; - const result = getCartToken(event); - expect(result).toEqual('cartTokenTest1'); - }); - }); -}); - -describe('Redis cart token tests', () => { - it('should get anonymousId property from redis', async () => { - const getValSpy = jest - .spyOn(RedisDB, 'getVal') - .mockResolvedValue({ anonymousId: 'anonymousIdTest1' }); - const event = { - cart_token: `cartTokenTest1`, - id: 5778367414385, - line_items: [ - { - id: 14234727743601, - }, - ], - query_parameters: { - topic: ['orders_updated'], - version: ['pixel'], - writeKey: ['dummy-write-key'], - }, - }; - const message = await processEvent(event); - expect(getValSpy).toHaveBeenCalledTimes(1); - expect(getValSpy).toHaveBeenCalledWith('cartTokenTest1'); - expect(message.setProperty).toHaveBeenCalledWith('anonymousId', 'anonymousIdTest1'); - }); }); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index ace9d6bb0fb..df33d7a347a 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -1,10 +1,6 @@ -/* eslint-disable no-param-reassign */ -const get = require('get-value'); const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); -const { extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); const { constructPayload } = require('../../../../v0/util'); -const { INTEGERATION, lineItemsMappingJSON, productMappingJSON } = require('../config'); -const { RedisDB } = require('../../../../util/redis/redisConnector'); +const { lineItemsMappingJSON, productMappingJSON } = require('../config'); /** * Returns an array of products from the lineItems array received from the webhook event @@ -58,73 +54,8 @@ const getAnonymousIdFromAttributes = (event) => { return rudderAnonymousIdObject ? rudderAnonymousIdObject.value : null; }; -/** - * Returns the cart_token from the event message - * @param {Object} event - * @returns {String} cart_token - */ -const getCartToken = (event) => event?.cart_token || null; - -/** - * Handles the anonymousId assignment for the message, based on the event attributes and redis data - * @param {Object} message - * @param {Object} event - */ -const handleAnonymousId = async (message, event) => { - const anonymousId = getAnonymousIdFromAttributes(event); - if (isDefinedAndNotNull(anonymousId)) { - message.setProperty('anonymousId', anonymousId); - } else { - // if anonymousId is not present in note_attributes or note_attributes is not present, query redis for anonymousId - const cartToken = getCartToken(event); - if (cartToken) { - const redisData = await RedisDB.getVal(cartToken); - if (redisData?.anonymousId) { - message.setProperty('anonymousId', redisData.anonymousId); - } - } - } -}; - -/** - Handles userId, email and contextual properties enrichment for the message payload - * @param {Object} message - * @param {Object} event - * @param {String} shopifyTopic -*/ -const handleCommonProperties = (message, event, shopifyTopic) => { - if (message.userId) { - message.userId = String(message.userId); - } - if (!get(message, 'traits.email')) { - const email = extractEmailFromPayload(event); - if (email) { - message.setProperty('traits.email', email); - } - } - message.setProperty(`integrations.${INTEGERATION}`, true); - message.setProperty('context.library', { - eventOrigin: 'server', - name: 'RudderStack Shopify Cloud', - version: '2.0.0', - }); - message.setProperty('context.topic', shopifyTopic); - // attaching cart, checkout and order tokens in context object - message.setProperty(`context.cart_token`, event.cart_token); - message.setProperty(`context.checkout_token`, event.checkout_token); - // raw shopify payload passed inside context object under shopifyDetails - message.setProperty('context.shopifyDetails', event); - if (shopifyTopic === 'orders_updated') { - message.setProperty(`context.order_token`, event.token); - } - return message; -}; - module.exports = { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, getAnonymousIdFromAttributes, - getCartToken, - handleAnonymousId, - handleCommonProperties, }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js index f95459667ab..b1d1c8b2fac 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js @@ -16,7 +16,6 @@ const { checkoutStepEventBuilder, searchEventBuilder, } = require('./pixelUtils'); -const campaignObjectMappings = require('../pixelEventsMappings/campaignObjectMappings.json'); const { INTEGERATION, PIXEL_EVENT_TOPICS, @@ -86,7 +85,7 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { function processPixelEvent(inputEvent) { // eslint-disable-next-line @typescript-eslint/naming-convention - const { name, query_parameters, context, clientId, data, id } = inputEvent; + const { name, query_parameters, clientId, data, id } = inputEvent; const shopifyDetails = { ...inputEvent }; delete shopifyDetails.context; delete shopifyDetails.query_parameters; @@ -148,36 +147,6 @@ function processPixelEvent(inputEvent) { }); message.setProperty('context.topic', name); message.setProperty('context.shopifyDetails', shopifyDetails); - - // adding campaign object to the message - if (context?.document?.location?.href) { - const url = new URL(context.document.location.href); - const campaignParams = {}; - - // Loop through mappings and extract UTM parameters - campaignObjectMappings.forEach((mapping) => { - const value = url.searchParams.get(mapping.sourceKeys); - if (value) { - campaignParams[mapping.destKeys] = value; - } - }); - - // Extract any UTM parameters not in the mappings - const campaignObjectSourceKeys = campaignObjectMappings.flatMap( - (mapping) => mapping.sourceKeys, - ); - url.searchParams.forEach((value, key) => { - if (key.startsWith('utm_') && !campaignObjectSourceKeys.includes(key)) { - campaignParams[key] = value; - } - }); - - // Only add campaign object if we have any UTM parameters - if (Object.keys(campaignParams).length > 0) { - message.context = message.context || {}; - message.context.campaign = campaignParams; - } - } message.messageId = id; message = removeUndefinedAndNullValues(message); return message; diff --git a/test/integrations/sources/shopify/constants.ts b/test/integrations/sources/shopify/constants.ts index cd362adaec3..af53a3180e8 100644 --- a/test/integrations/sources/shopify/constants.ts +++ b/test/integrations/sources/shopify/constants.ts @@ -1,58 +1,3 @@ -const dummyResponseCommonPayload = { - navigator: { - language: 'en-US', - cookieEnabled: true, - languages: ['en-US', 'en'], - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', - }, - window: { - innerHeight: 1028, - innerWidth: 1362, - outerHeight: 1080, - outerWidth: 1728, - pageXOffset: 0, - pageYOffset: 0, - location: { - href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - hash: '', - host: 'store.myshopify.com', - hostname: 'store.myshopify.com', - origin: 'https://store.myshopify.com', - pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - port: '', - protocol: 'https:', - search: '', - }, - origin: 'https://store.myshopify.com', - screen: { - height: 1117, - width: 1728, - }, - screenX: 0, - screenY: 37, - scrollX: 0, - scrollY: 0, - }, - page: { - title: 'Checkout - pixel-testing-rs', - url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - search: '', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', - screen: { - height: 1117, - width: 1728, - }, - library: { - name: 'RudderStack Shopify Cloud', - eventOrigin: 'client', - version: '2.0.0', - }, -}; - export const dummySourceConfig = { ID: 'dummy-source-id', OriginalID: '', @@ -138,10 +83,25 @@ export const dummyContext = { }, }; -export const dummyContextwithCampaign = { +export const note_attributes = [ + { + name: 'cartId', + value: '9c623f099fc8819aa4d6a958b65dfe7d', + }, + { + name: 'cartToken', + value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', + }, + { + name: 'rudderAnonymousId', + value: '50ead33e-d763-4854-b0ab-765859ef05cb', + }, +]; + +export const responseDummyContext = { document: { location: { - href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', hash: '', host: 'store.myshopify.com', hostname: 'store.myshopify.com', @@ -190,60 +150,21 @@ export const dummyContextwithCampaign = { scrollX: 0, scrollY: 0, }, -}; - -export const note_attributes = [ - { - name: 'cartId', - value: '9c623f099fc8819aa4d6a958b65dfe7d', - }, - { - name: 'cartToken', - value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', - }, - { - name: 'rudderAnonymousId', - value: '50ead33e-d763-4854-b0ab-765859ef05cb', - }, -]; - -export const responseDummyContext = { - document: { - location: { - href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - hash: '', - host: 'store.myshopify.com', - hostname: 'store.myshopify.com', - origin: 'https://store.myshopify.com', - pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - port: '', - protocol: 'https:', - search: '', - }, - referrer: 'https://store.myshopify.com/cart', - characterSet: 'UTF-8', + page: { title: 'Checkout - pixel-testing-rs', + url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + search: '', }, - ...dummyResponseCommonPayload, -}; - -export const responseDummyContextwithCampaign = { - document: { - location: { - href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', - hash: '', - host: 'store.myshopify.com', - hostname: 'store.myshopify.com', - origin: 'https://store.myshopify.com', - pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - port: '', - protocol: 'https:', - search: '', - }, - referrer: 'https://store.myshopify.com/cart', - title: 'Checkout - pixel-testing-rs', - characterSet: 'UTF-8', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', + screen: { + height: 1117, + width: 1728, + }, + library: { + name: 'RudderStack Shopify Cloud', + eventOrigin: 'client', + version: '2.0.0', }, - // title: 'Checkout - pixel-testing-rs', - ...dummyResponseCommonPayload, }; diff --git a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts index 39fceb4da8e..46bd4f96151 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts @@ -1,11 +1,5 @@ // This file contains the test scenarios related to Shopify pixel events, emitted from web pixel on the browser. -import { - dummyContext, - dummyContextwithCampaign, - dummySourceConfig, - responseDummyContext, - responseDummyContextwithCampaign, -} from '../constants'; +import { dummyContext, dummySourceConfig, responseDummyContext } from '../constants'; export const pixelEventsTestScenarios = [ { @@ -24,7 +18,7 @@ export const pixelEventsTestScenarios = [ type: 'standard', clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', timestamp: '2024-09-15T17:24:30.373Z', - context: dummyContextwithCampaign, + context: dummyContext, pixelEventLabel: true, query_parameters: { topic: ['page_viewed'], @@ -48,14 +42,7 @@ export const pixelEventsTestScenarios = [ batch: [ { context: { - ...responseDummyContextwithCampaign, - campaign: { - content: 'web', - medium: 'checkout', - name: 'shopifySale', - term: 'term_checkout', - utm_custom1: 'customutm', - }, + ...responseDummyContext, shopifyDetails: { clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', data: {}, From 41e5da06eb04a54ffaab10c1b9c1e7b3f531bdf1 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 21 Jan 2025 08:27:49 +0000 Subject: [PATCH 035/160] chore(release): 1.88.1 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a82aaaa08f2..36831e82049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ 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.88.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.0...v1.88.1) (2025-01-21) + ## [1.88.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.1...v1.88.0) (2025-01-20) diff --git a/package-lock.json b/package-lock.json index b0f89dfa2d5..ab29d6987a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.88.0", + "version": "1.88.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.88.0", + "version": "1.88.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index cea3056e662..8acef6b6af3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.88.0", + "version": "1.88.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From a7d6b8fca8681d2eb3bf1751bf7855a7cc220d3b Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:21:38 +0530 Subject: [PATCH 036/160] fix: sonar issues in user transformations static lookup (#3998) --- src/util/utils.js | 59 ++++++++++++++++++----------------- src/util/utils.test.js | 71 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 29 deletions(-) create mode 100644 src/util/utils.test.js diff --git a/src/util/utils.js b/src/util/utils.js index 82c85b41a58..36554ff5d0a 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -44,35 +44,35 @@ const fetchAddressFromHostName = async (hostname) => { return { address, cacheHit: false }; }; -const staticLookup = (transformationTags) => async (hostname, _, cb) => { - let ip; - const resolveStartTime = new Date(); - try { - const { address, cacheHit } = await fetchAddressFromHostName(hostname); - ip = address; - stats.timing('fetch_dns_resolve_time', resolveStartTime, { ...transformationTags, cacheHit }); - } catch (error) { - logger.error(`DNS Error Code: ${error.code} | Message : ${error.message}`); - stats.timing('fetch_dns_resolve_time', resolveStartTime, { - ...transformationTags, - error: 'true', - }); - cb(null, `unable to resolve IP address for ${hostname}`, RECORD_TYPE_A); - return; - } - - if (!ip) { - cb(null, `resolved empty list of IP address for ${hostname}`, RECORD_TYPE_A); - return; - } - - if (ip.startsWith(LOCALHOST_OCTET)) { - cb(null, `cannot use ${ip} as IP address`, RECORD_TYPE_A); - return; - } - - cb(null, ip, RECORD_TYPE_A); -}; +const staticLookup = + (transformationTags, fetchAddress = fetchAddressFromHostName) => + (hostname, _, cb) => { + const resolveStartTime = new Date(); + + fetchAddress(hostname) + .then(({ address, cacheHit }) => { + stats.timing('fetch_dns_resolve_time', resolveStartTime, { + ...transformationTags, + cacheHit, + }); + + if (!address) { + cb(null, `resolved empty list of IP address for ${hostname}`, RECORD_TYPE_A); + } else if (address.startsWith(LOCALHOST_OCTET)) { + cb(null, `cannot use ${address} as IP address`, RECORD_TYPE_A); + } else { + cb(null, address, RECORD_TYPE_A); + } + }) + .catch((error) => { + logger.error(`DNS Error Code: ${error.code} | Message : ${error.message}`); + stats.timing('fetch_dns_resolve_time', resolveStartTime, { + ...transformationTags, + error: 'true', + }); + cb(null, `unable to resolve IP address for ${hostname}`, RECORD_TYPE_A); + }); + }; const httpAgentWithDnsLookup = (scheme, transformationTags) => { const httpModule = scheme === 'http' ? http : https; @@ -226,4 +226,5 @@ module.exports = { logProcessInfo, extractStackTraceUptoLastSubstringMatch, fetchWithDnsWrapper, + staticLookup, }; diff --git a/src/util/utils.test.js b/src/util/utils.test.js new file mode 100644 index 00000000000..d7974e3ff61 --- /dev/null +++ b/src/util/utils.test.js @@ -0,0 +1,71 @@ +const { staticLookup } = require('./utils'); + +describe('staticLookup', () => { + const transformationTags = { tag: 'value' }; + const RECORD_TYPE_A = 4; + const HOST_NAME = 'example.com'; + const fetchAddressFromHostName = jest.fn(); + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should resolve the hostname and return the IP address', async () => { + const mockAddress = '192.168.1.1'; + fetchAddressFromHostName.mockResolvedValueOnce({ address: mockAddress, cacheHit: true }); + + const resolve = staticLookup(transformationTags, fetchAddressFromHostName); + const callback = (args) => { + expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); + expect(args).toEqual(null, mockAddress, RECORD_TYPE_A); + }; + resolve(HOST_NAME, null, callback); + }); + + it('should handle errors from fetchAddressFromHostName', async () => { + const error = new Error('DNS error'); + error.code = 'ENOTFOUND'; + fetchAddressFromHostName.mockRejectedValueOnce(error); + + const resolve = staticLookup(transformationTags, fetchAddressFromHostName); + const callback = (args) => { + expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); + expect(args).toEqual(null, `unable to resolve IP address for ${HOST_NAME}`, RECORD_TYPE_A); + }; + resolve(HOST_NAME, null, callback); + }); + + it('should handle empty address', async () => { + fetchAddressFromHostName.mockResolvedValueOnce({ address: '', cacheHit: true }); + + const resolve = staticLookup(transformationTags, fetchAddressFromHostName); + const callback = (args) => { + expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); + expect(args).toEqual( + null, + `resolved empty list of IP address for ${HOST_NAME}`, + RECORD_TYPE_A, + ); + }; + resolve(HOST_NAME, null, callback); + }); + + it('should handle localhost address', async () => { + const LOCALHOST_OCTET = '127'; + fetchAddressFromHostName.mockResolvedValueOnce({ + address: `${LOCALHOST_OCTET}.0.0.1`, + cacheHit: true, + }); + + const resolve = staticLookup(transformationTags, fetchAddressFromHostName); + const callback = (args) => { + expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); + expect(args).toEqual( + null, + `cannot use ${LOCALHOST_OCTET}.0.0.1 as IP address`, + RECORD_TYPE_A, + ); + }; + resolve(HOST_NAME, null, callback); + }); +}); From d74c4ab7ef582eb83d67c4b295aa5d3845c15166 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Wed, 22 Jan 2025 10:26:24 +0530 Subject: [PATCH 037/160] fix: sonar issues in adobe analytics (#3999) --- src/v0/destinations/adobe_analytics/utils.js | 60 +++++++++++++------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/src/v0/destinations/adobe_analytics/utils.js b/src/v0/destinations/adobe_analytics/utils.js index ceba177ff14..e5196a30d48 100644 --- a/src/v0/destinations/adobe_analytics/utils.js +++ b/src/v0/destinations/adobe_analytics/utils.js @@ -97,6 +97,25 @@ function escapeToHTML(inputString) { ); } +/** + * Tries to find a value from alternative sources based on the source key. + * @param {Object} message - The input message object. + * @param {string} sourceKey - The key to look for. + * @returns {any} - The found value or null. + */ +function findValueFromSources(message, sourceKey) { + // Try alternative sources defined in SOURCE_KEYS + for (const source of SOURCE_KEYS) { + const value = getMappingFieldValueFormMessage(message, source, sourceKey); + if (isDefinedAndNotNull(value)) { + return value; + } + } + + // Fallback to value retrieval by path + return getValueByPath(message, sourceKey); +} + /** * This function is used for populating the eVars and hVars in the payload * @param {*} destVarMapping @@ -106,31 +125,28 @@ function escapeToHTML(inputString) { * @returns updated paylaod with eVars and hVars added */ function rudderPropToDestMap(destVarMapping, message, payload, destVarStrPrefix) { - const mappedVar = {}; - // pass the Rudder Property mapped in the ui whose evar you want to map - Object.keys(destVarMapping).forEach((key) => { - let val = get(message, `properties.${key}`); - if (isDefinedAndNotNull(val)) { - const destVarKey = destVarStrPrefix + destVarMapping[key]; - mappedVar[destVarKey] = escapeToHTML(val); - } else { - SOURCE_KEYS.some((sourceKey) => { - val = getMappingFieldValueFormMessage(message, sourceKey, key); - if (isDefinedAndNotNull(val)) { - mappedVar[`${destVarStrPrefix}${[destVarMapping[key]]}`] = escapeToHTML(val); - } else { - val = getValueByPath(message, key); - if (isDefinedAndNotNull(val)) { - mappedVar[`${destVarStrPrefix}${[destVarMapping[key]]}`] = escapeToHTML(val); - } - } - }); + const mappedVariables = {}; + + // Iterate over each key in the destination variable mapping + Object.keys(destVarMapping).forEach((sourceKey) => { + let value = message?.properties?.[sourceKey]; + + if (!isDefinedAndNotNull(value)) { + // Try getting the value from alternative sources + value = findValueFromSources(message, sourceKey); + } + + if (isDefinedAndNotNull(value)) { + const destinationKey = `${destVarStrPrefix}${destVarMapping[sourceKey]}`; + mappedVariables[destinationKey] = escapeToHTML(value); } }); - if (Object.keys(mappedVar).length > 0) { - // non-empty object - Object.assign(payload, mappedVar); + + // Add non-empty mapped variables to the payload + if (Object.keys(mappedVariables).length > 0) { + Object.assign(payload, mappedVariables); } + return payload; } From ba2accd14a9d99f2c55a9eab34f65e6e4d989e4a Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:10:39 +0530 Subject: [PATCH 038/160] fix: revert feat added drop traits in track call feature for mixpanel (#4003) * fix: revert feat added drop traits in track call feature for mixpanel * fix: fix device type is undefined --- src/v0/destinations/mp/transform.js | 5 +- src/v0/destinations/mp/util.js | 2 +- .../destinations/mp/processor/data.ts | 111 ------------------ 3 files changed, 2 insertions(+), 116 deletions(-) diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index 1967e110c92..02eca8ed22f 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -163,12 +163,9 @@ const getEventValueForTrackEvent = (message, destination) => { } const unixTimestamp = toUnixTimestampInMS(message.timestamp || message.originalTimestamp); - - const traits = destination.Config?.dropTraitsInTrackEvent ? {} : { ...message.context.traits }; - let properties = { ...message.properties, - ...traits, + ...get(message, 'context.traits'), ...mappedProperties, token: destination.Config.token, distinct_id: message.userId || message.anonymousId, diff --git a/src/v0/destinations/mp/util.js b/src/v0/destinations/mp/util.js index a62dca0f4e7..50a8f9ac2b8 100644 --- a/src/v0/destinations/mp/util.js +++ b/src/v0/destinations/mp/util.js @@ -48,7 +48,7 @@ const populateDeviceFieldsInPayload = (message, rawPayload) => { if (isAppleFamily(device.type)) { payload = constructPayload(message, mPProfileIosConfigJson); updatedRawPayload.$ios_devices = deviceTokenArray; - } else if (device.type.toLowerCase() === 'android') { + } else if (device.type?.toLowerCase() === 'android') { payload = constructPayload(message, mPProfileAndroidConfigJson); updatedRawPayload.$android_devices = deviceTokenArray; } diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index c35d2013c6a..d13cf64cae2 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -6190,115 +6190,4 @@ export const data = [ }, }, }, - { - name: 'mp', - description: 'Track event test when dropTraitsInTrackEvent is true', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: overrideDestination(sampleDestination, { - dropTraitsInTrackEvent: true, - }), - message: { - type: 'track', - event: 'FirstTrackCall12', - sentAt: '2021-09-30T07:15:23.523Z', - channel: 'web', - context: { - os: { name: '', version: '' }, - app: { - name: 'RudderLabs JavaScript SDK', - build: '1.0.0', - version: '1.1.18', - namespace: 'com.rudderlabs.javascript', - }, - page: { - url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', - path: '/Testing/App_for_testingTool/', - title: 'Document', - search: '', - tab_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', - referrer: 'http://127.0.0.1:7307/Testing/', - initial_referrer: 'http://127.0.0.1:7307/Testing/', - referring_domain: '127.0.0.1:7307', - initial_referring_domain: '127.0.0.1:7307', - }, - locale: 'en-US', - screen: { width: 1440, height: 900, density: 2, innerWidth: 590, innerHeight: 665 }, - traits: { - anonymousId: 'ea776ad0-3136-44fb-9216-5b1578609a2b', - userId: 'as09sufa09usaf09as0f9uasf', - id: 'as09sufa09usaf09as0f9uasf', - firstName: 'Bob', - lastName: 'Marley', - name: 'Bob Marley', - age: 43, - email: 'bob@marleymail.com', - phone: '+447748544123', - birthday: '1987-01-01T20:08:59+0000', - createdAt: '2022-01-21T14:10:12+0000', - address: '51,B.L.T road, Kolkata-700060', - description: 'I am great', - gender: 'male', - title: 'Founder', - username: 'bobm', - website: 'https://bobm.com', - randomProperty: 'randomValue', - }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' }, - campaign: {}, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36', - }, - rudderId: '294702c7-8732-4fb3-b39f-f3bdffe1aa88', - messageId: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', - userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', - properties: { foo: 'bar', $deviceId: 'nkasdnkasd' }, - anonymousId: '1dbb5784-b8e2-4074-8644-9920145b7ae5', - integrations: { All: true }, - originalTimestamp: '2021-09-30T07:15:23.523Z', - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api.mixpanel.com/import/', - headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', - 'Content-Type': 'application/json', - }, - params: { strict: 0 }, - body: { - JSON: {}, - JSON_ARRAY: { - batch: - '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', - }, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', - }, - statusCode: 200, - }, - ], - }, - }, - }, ]; From a7ee3cb09a4903214a12cb18b6cb769286e2509c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 22 Jan 2025 08:44:01 +0000 Subject: [PATCH 039/160] chore(release): 1.88.2 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36831e82049..52e5a452c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.88.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.1...v1.88.2) (2025-01-22) + + +### Bug Fixes + +* revert feat added drop traits in track call feature for mixpanel ([#4003](https://github.com/rudderlabs/rudder-transformer/issues/4003)) ([ba2accd](https://github.com/rudderlabs/rudder-transformer/commit/ba2accd14a9d99f2c55a9eab34f65e6e4d989e4a)) + ### [1.88.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.0...v1.88.1) (2025-01-21) ## [1.88.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.1...v1.88.0) (2025-01-20) diff --git a/package-lock.json b/package-lock.json index ab29d6987a6..63074987e06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.88.1", + "version": "1.88.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.88.1", + "version": "1.88.2", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 8acef6b6af3..0d16d5feae6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.88.1", + "version": "1.88.2", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From a86f0094cbef9428e7aeda4965b580f29c89f706 Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Wed, 22 Jan 2025 15:33:07 +0530 Subject: [PATCH 040/160] feat(http): resolves bug fixes raised during testing (#3991) * feat(http): add support for path params mappings * feat(http): uri encode params * feat(http): automatically adding Content-Type using dest config * chore: addressed review comments * feat: updated xml parser package * feat: updated xml parser package * chore: address review comments * chore: address review comments * chore: address review comments * feat: updated json-template-engine to 0.19.4 * chore: updated tests * chore: minor refactoring * chore: added unit tests --- package-lock.json | 144 +++++++++++++- package.json | 4 +- .../v2/destinations/http/procWorkflow.yaml | 13 +- src/cdk/v2/destinations/http/utils.js | 101 +++++++++- src/cdk/v2/destinations/http/utils.test.js | 82 ++++++++ test/integrations/destinations/http/common.ts | 158 ++++++++++++++++ .../http/processor/configuration.ts | 179 +++++++++++++++++- .../destinations/http/router/data.ts | 14 +- 8 files changed, 665 insertions(+), 30 deletions(-) create mode 100644 src/cdk/v2/destinations/http/utils.test.js diff --git a/package-lock.json b/package-lock.json index ab29d6987a6..3f9556170ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", "@rudderstack/integrations-lib": "^0.2.13", - "@rudderstack/json-template-engine": "^0.18.0", + "@rudderstack/json-template-engine": "^0.19.4", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", "ajv": "^8.12.0", @@ -32,6 +32,7 @@ "component-each": "^0.2.6", "crypto-js": "^4.2.0", "dotenv": "^16.0.3", + "fast-xml-parser": "^4.5.1", "flat": "^5.0.2", "form-data": "^4.0.0", "get-value": "^3.0.1", @@ -46,7 +47,6 @@ "json-diff": "^1.0.3", "json-size": "^1.0.0", "jsontoxml": "^1.0.1", - "jstoxml": "^5.0.2", "koa": "^2.15.3", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", @@ -1134,6 +1134,27 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/client-personalize/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/client-s3": { "version": "3.637.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.637.0.tgz", @@ -1570,6 +1591,27 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/client-s3/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/client-sso": { "version": "3.650.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.650.0.tgz", @@ -2014,6 +2056,27 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/client-sso-oidc/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-browser": { "version": "3.649.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", @@ -2481,6 +2544,27 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/client-sts/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/core": { "version": "3.649.0", "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.649.0.tgz", @@ -2502,6 +2586,27 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/core/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/credential-provider-cognito-identity": { "version": "3.650.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.650.0.tgz", @@ -3604,6 +3709,27 @@ "node": ">=16.0.0" } }, + "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/@aws-sdk/middleware-ssec": { "version": "3.609.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.609.0.tgz", @@ -6642,8 +6768,9 @@ } }, "node_modules/@rudderstack/json-template-engine": { - "version": "0.18.0", - "license": "MIT" + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.19.4.tgz", + "integrity": "sha512-/RTQeHCTBPsQt1U4bok7HBFPcIlc+1cMHYx6qCRhgCS+uhCmN84F9GI7K/H3y4nrn1CHctaHvXCwplZZA60FTQ==" }, "node_modules/@rudderstack/workflow-engine": { "version": "0.8.13", @@ -12330,7 +12457,9 @@ "license": "MIT" }, "node_modules/fast-xml-parser": { - "version": "4.4.1", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz", + "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", "funding": [ { "type": "github", @@ -12341,7 +12470,6 @@ "url": "https://paypal.me/naturalintelligence" } ], - "license": "MIT", "dependencies": { "strnum": "^1.0.5" }, @@ -16385,10 +16513,6 @@ "node": ">=0.2.0" } }, - "node_modules/jstoxml": { - "version": "5.0.2", - "license": "MIT" - }, "node_modules/keygrip": { "version": "1.1.0", "license": "MIT", diff --git a/package.json b/package.json index 8acef6b6af3..fced5430f37 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", "@rudderstack/integrations-lib": "^0.2.13", - "@rudderstack/json-template-engine": "^0.18.0", + "@rudderstack/json-template-engine": "^0.19.4", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", "ajv": "^8.12.0", @@ -77,6 +77,7 @@ "component-each": "^0.2.6", "crypto-js": "^4.2.0", "dotenv": "^16.0.3", + "fast-xml-parser": "^4.5.1", "flat": "^5.0.2", "form-data": "^4.0.0", "get-value": "^3.0.1", @@ -91,7 +92,6 @@ "json-diff": "^1.0.3", "json-size": "^1.0.0", "jsontoxml": "^1.0.1", - "jstoxml": "^5.0.2", "koa": "^2.15.3", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", diff --git a/src/cdk/v2/destinations/http/procWorkflow.yaml b/src/cdk/v2/destinations/http/procWorkflow.yaml index 080dcdd80af..e8696eb7a76 100644 --- a/src/cdk/v2/destinations/http/procWorkflow.yaml +++ b/src/cdk/v2/destinations/http/procWorkflow.yaml @@ -36,24 +36,27 @@ steps: template: | const configAuthHeaders = $.getAuthHeaders(.destination.Config); const additionalConfigHeaders = $.getCustomMappings(.message, .destination.Config.headers); + const metadataHeaders = $.metadataHeaders($.context.format); $.context.headers = { ...configAuthHeaders, - ...additionalConfigHeaders + ...additionalConfigHeaders, + ...metadataHeaders, } - name: prepareParams template: | - $.context.params = $.getCustomMappings(.message, .destination.Config.queryParams) + const params = $.getCustomMappings(.message, .destination.Config.queryParams) + $.context.params = $.encodeParamsObject(params) - name: deduceEndPoint template: | - $.context.endpoint = $.addPathParams(.message, .destination.Config.apiUrl); + $.context.endpoint = $.prepareEndpoint(.message, .destination.Config.apiUrl, .destination.Config.pathParams); - name: prepareBody template: | const payload = $.getCustomMappings(.message, .destination.Config.propertiesMapping); - $.context.payload = $.removeUndefinedAndNullValues($.excludeMappedFields(payload, .destination.Config.propertiesMapping)) - $.context.format === "XML" && !$.isEmptyObject($.context.payload) ? $.context.payload = {payload: $.getXMLPayload($.context.payload)}; + $.context.payload = $.excludeMappedFields(payload, .destination.Config.propertiesMapping) + $.context.format === "XML" && !$.isEmptyObject($.context.payload) ? $.context.payload = {payload: $.getXMLPayload($.context.payload)} : $.context.payload = $.removeUndefinedAndNullValues($.context.payload) - name: buildResponseForProcessTransformation template: | diff --git a/src/cdk/v2/destinations/http/utils.js b/src/cdk/v2/destinations/http/utils.js index 355eb034870..6e53bbdc2f8 100644 --- a/src/cdk/v2/destinations/http/utils.js +++ b/src/cdk/v2/destinations/http/utils.js @@ -1,8 +1,9 @@ -const { toXML } = require('jstoxml'); +const { XMLBuilder } = require('fast-xml-parser'); const { groupBy } = require('lodash'); const { createHash } = require('crypto'); const { ConfigurationError } = require('@rudderstack/integrations-lib'); const { BatchUtils } = require('@rudderstack/workflow-engine'); +const jsonpath = require('rs-jsonpath'); const { base64Convertor, applyCustomMappings, @@ -41,12 +42,60 @@ const getCustomMappings = (message, mapping) => { } }; -const addPathParams = (message, apiUrl) => { +const encodeParamsObject = (params) => { + if (!params || typeof params !== 'object') { + return {}; // Return an empty object if input is null, undefined, or not an object + } + return Object.keys(params) + .filter((key) => params[key] !== undefined) + .reduce((acc, key) => { + acc[encodeURIComponent(key)] = encodeURIComponent(params[key]); + return acc; + }, {}); +}; + +const getPathValueFromJsonpath = (message, path) => { + let finalPath = path; + if (path.includes('/')) { + throw new ConfigurationError('Path value cannot contain "/"'); + } + if (path.includes('$')) { + try { + [finalPath = null] = jsonpath.query(message, path); + } catch (error) { + throw new ConfigurationError( + `An error occurred while querying the JSON path: ${error.message}`, + ); + } + if (finalPath === null) { + throw new ConfigurationError('Path not found in the object.'); + } + } + return finalPath; +}; + +const getPathParamsSubString = (message, pathParamsArray) => { + if (pathParamsArray.length === 0) { + return ''; + } + const pathParamsValuesArray = pathParamsArray.map((pathParam) => + encodeURIComponent(getPathValueFromJsonpath(message, pathParam.path)), + ); + return `/${pathParamsValuesArray.join('/')}`; +}; + +const prepareEndpoint = (message, apiUrl, pathParams) => { + let requestUrl; try { - return applyJSONStringTemplate(message, `\`${apiUrl}\``); + requestUrl = applyJSONStringTemplate(message, `\`${apiUrl}\``); } catch (e) { throw new ConfigurationError(`Error in api url template: ${e.message}`); } + if (!Array.isArray(pathParams)) { + return requestUrl; + } + const pathParamsSubString = getPathParamsSubString(message, pathParams); + return `${requestUrl}${pathParamsSubString}`; }; const excludeMappedFields = (payload, mapping) => { @@ -79,10 +128,39 @@ const excludeMappedFields = (payload, mapping) => { return rawPayload; }; -const getXMLPayload = (payload) => - toXML(payload, { - header: true, - }); +const sanitizeKey = (key) => + key + .replace(/[^\w.-]/g, '_') // Replace invalid characters with underscores + .replace(/^[^A-Z_a-z]/, '_'); // Ensure key starts with a letter or underscore + +const preprocessJson = (obj) => { + if (typeof obj !== 'object' || obj === null) { + // Handle null values: add xsi:nil attribute + if (obj === null) { + return { '@_xsi:nil': 'true' }; + } + return obj; // Return primitive values as is + } + + if (Array.isArray(obj)) { + return obj.map(preprocessJson); + } + + return Object.entries(obj).reduce((acc, [key, value]) => { + const sanitizedKey = sanitizeKey(key); + acc[sanitizedKey] = preprocessJson(value); + return acc; + }, {}); +}; + +const getXMLPayload = (payload) => { + const builderOptions = { + ignoreAttributes: false, // Include attributes if they exist + suppressEmptyNode: false, // Ensures that null or undefined values are not omitted + }; + const builder = new XMLBuilder(builderOptions); + return `${builder.build(preprocessJson(payload))}`; +}; const getMergedEvents = (batch) => { const events = []; @@ -94,6 +172,11 @@ const getMergedEvents = (batch) => { return events; }; +const metadataHeaders = (contentType) => + contentType === 'JSON' + ? { 'Content-Type': 'application/json' } + : { 'Content-Type': 'application/xml' }; + const mergeMetadata = (batch) => batch.map((event) => event.metadata[0]); const createHashKey = (endpoint, headers, params) => { @@ -149,8 +232,10 @@ const batchSuccessfulEvents = (events, batchSize) => { module.exports = { getAuthHeaders, getCustomMappings, - addPathParams, + encodeParamsObject, + prepareEndpoint, excludeMappedFields, getXMLPayload, + metadataHeaders, batchSuccessfulEvents, }; diff --git a/src/cdk/v2/destinations/http/utils.test.js b/src/cdk/v2/destinations/http/utils.test.js new file mode 100644 index 00000000000..cf8e875974c --- /dev/null +++ b/src/cdk/v2/destinations/http/utils.test.js @@ -0,0 +1,82 @@ +const { encodeParamsObject, prepareEndpoint, getXMLPayload } = require('./utils'); + +const { XMLBuilder } = require('fast-xml-parser'); +const jsonpath = require('rs-jsonpath'); + +describe('Utils Functions', () => { + describe('encodeParamsObject', () => { + test('should return empty object for invalid inputs', () => { + expect(encodeParamsObject(null)).toEqual({}); + expect(encodeParamsObject(undefined)).toEqual({}); + expect(encodeParamsObject('string')).toEqual({}); + }); + + test('should encode object keys and values', () => { + const params = { key1: 'value1', key2: 'value2 3 4' }; + const expected = { key1: 'value1', key2: 'value2%203%204' }; + expect(encodeParamsObject(params)).toEqual(expected); + }); + }); + + describe('prepareEndpoint', () => { + test('should replace template variables in API URL', () => { + const message = { id: 123 }; + const apiUrl = 'https://api.example.com/resource/${$.id}'; + expect(prepareEndpoint(message, apiUrl, [])).toBe('https://api.example.com/resource/123'); + }); + test('should replace template variables in API URL and add path params', () => { + const message = { id: 123, p2: 'P2' }; + const apiUrl = 'https://api.example.com/resource/${$.id}'; + const pathParams = [ + { + path: 'p1', + }, + { + path: '$.p2', + }, + ]; + expect(prepareEndpoint(message, apiUrl, pathParams)).toBe( + 'https://api.example.com/resource/123/p1/P2', + ); + }); + test('should add path params after uri encoding', () => { + const message = { id: 123, p2: 'P2%&' }; + const apiUrl = 'https://api.example.com/resource/${$.id}'; + const pathParams = [ + { + path: 'p1', + }, + { + path: '$.p2', + }, + ]; + expect(prepareEndpoint(message, apiUrl, pathParams)).toBe( + 'https://api.example.com/resource/123/p1/P2%25%26', + ); + }); + test('should throw error as path contains slash', () => { + const message = { id: 123, p2: 'P2%&' }; + const apiUrl = 'https://api.example.com/resource/${$.id}'; + const pathParams = [ + { + path: 'p1/', + }, + { + path: '$.p2', + }, + ]; + expect(() => prepareEndpoint(message, apiUrl, pathParams)).toThrowError( + 'Path value cannot contain "/"', + ); + }); + }); + + describe('getXMLPayload', () => { + test('should generate XML payload with correct structure', () => { + const payload = { key: null }; + const expectedXML = ''; + const result = getXMLPayload(payload); + expect(result).toBe(expectedXML); + }); + }); +}); diff --git a/test/integrations/destinations/http/common.ts b/test/integrations/destinations/http/common.ts index f0c8bc8a337..8f4ca5d048f 100644 --- a/test/integrations/destinations/http/common.ts +++ b/test/integrations/destinations/http/common.ts @@ -278,6 +278,164 @@ const destinations: Destination[] = [ Transformations: [], WorkspaceID: 'test-workspace-id', }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'basicAuth', + username: 'test-user', + password: '', + method: 'GET', + format: 'JSON', + isBatchingEnabled: true, + maxBatchSize: 2, + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '2', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + { + to: '$.h3', + from: '$.traits.firstName', + }, + ], + queryParams: [ + { + to: "$['q1']", + from: "'val1'", + }, + { + to: '$.q2', + from: '$.traits.email', + }, + ], + pathParams: [ + { + path: '$.userId', + }, + { + path: 'c1', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'basicAuth', + username: 'test-user', + password: '', + method: 'GET', + format: 'JSON', + isBatchingEnabled: true, + maxBatchSize: 2, + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '2', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + { + to: '$.h3', + from: '$.traits.firstName', + }, + ], + queryParams: [ + { + to: 'user name', + from: "'val1'", + }, + { + to: '$.q2', + from: '$.traits.email', + }, + ], + pathParams: [ + { + path: '$.userId', + }, + { + path: 'c1', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: 'test-token', + method: 'POST', + format: 'XML', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + ], + propertiesMapping: [ + { + from: '$.properties', + to: '$', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, ]; const traits = { diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index 43d39952b9a..e2793fa90c3 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -1,6 +1,12 @@ import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, transformResultBuilder } from '../../../testUtils'; -import { destType, destinations, properties, traits } from '../common'; +import { + destType, + destinations, + properties, + traits, + processorInstrumentationErrorStatTags, +} from '../common'; export const configuration: ProcessorTestData[] = [ { @@ -38,6 +44,9 @@ export const configuration: ProcessorTestData[] = [ method: 'POST', userId: '', endpoint: destinations[0].Config.apiUrl, + headers: { + 'Content-Type': 'application/json', + }, JSON: { contacts: { first_name: 'John', @@ -91,6 +100,7 @@ export const configuration: ProcessorTestData[] = [ userId: '', endpoint: 'http://abc.com/contacts/john.doe@example.com/', headers: { + 'Content-Type': 'application/json', 'x-api-key': 'test-api-key', }, }), @@ -137,6 +147,7 @@ export const configuration: ProcessorTestData[] = [ userId: '', endpoint: destinations[1].Config.apiUrl, headers: { + 'Content-Type': 'application/json', Authorization: 'Basic dGVzdC11c2VyOg==', h1: 'val1', h2: 2, @@ -191,13 +202,177 @@ export const configuration: ProcessorTestData[] = [ userId: '', endpoint: destinations[4].Config.apiUrl, headers: { + 'Content-Type': 'application/xml', + Authorization: 'Bearer test-token', + h1: 'val1', + 'content-type': 'application/json', + }, + XML: { + payload: + 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-5', + name: destType, + description: 'Track call with pathParams mapping', + scenario: 'Business', + successCriteria: 'Response should have the give paths added in the endpoint', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[7], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'GET', + userId: '', + endpoint: 'http://abc.com/contacts/userId123/c1', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dGVzdC11c2VyOg==', + h1: 'val1', + h2: 2, + 'content-type': 'application/json', + }, + params: { + q1: 'val1', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-6', + name: destType, + description: 'Track call with query params keys containing space', + scenario: 'Business', + successCriteria: 'Response should contain query params with URI encoded keys', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[8], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'GET', + userId: '', + endpoint: 'http://abc.com/contacts/userId123/c1', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic dGVzdC11c2VyOg==', + h1: 'val1', + h2: 2, + 'content-type': 'application/json', + }, + params: { + 'user%20name': 'val1', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-7', + name: destType, + description: 'Track call with xml format and payload with special characters in keys', + scenario: 'Business', + successCriteria: 'Response should be in xml format with the special characters handled', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[9], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties: { + name: "Rubik's Cube", + "1revenue-wdfqwe'": 4.99, + brand: null, + }, + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[9].Config.apiUrl, + headers: { + 'Content-Type': 'application/xml', Authorization: 'Bearer test-token', h1: 'val1', 'content-type': 'application/json', }, XML: { payload: - 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', + 'Rubik's Cube<_revenue-wdfqwe_>4.99', }, }), statusCode: 200, diff --git a/test/integrations/destinations/http/router/data.ts b/test/integrations/destinations/http/router/data.ts index ea14ec73418..284a80f1090 100644 --- a/test/integrations/destinations/http/router/data.ts +++ b/test/integrations/destinations/http/router/data.ts @@ -185,6 +185,7 @@ export const data = [ endpoint: 'http://abc.com/contacts/john.doe@example.com/', headers: { 'x-api-key': 'test-api-key', + 'Content-Type': 'application/json', }, params: {}, body: { @@ -233,6 +234,7 @@ export const data = [ method: 'GET', endpoint: 'http://abc.com/contacts', headers: { + 'Content-Type': 'application/json', Authorization: 'Basic dGVzdC11c2VyOg==', 'content-type': 'application/json', h1: 'val1', @@ -241,7 +243,7 @@ export const data = [ }, params: { q1: 'val1', - q2: 'john.doe@example.com', + q2: 'john.doe%40example.com', }, body: { JSON: {}, @@ -265,6 +267,7 @@ export const data = [ method: 'GET', endpoint: 'http://abc.com/contacts', headers: { + 'Content-Type': 'application/json', Authorization: 'Basic dGVzdC11c2VyOg==', 'content-type': 'application/json', h1: 'val1', @@ -273,7 +276,7 @@ export const data = [ }, params: { q1: 'val1', - q2: 'john.doe@example.com', + q2: 'john.doe%40example.com', }, body: { JSON: {}, @@ -297,6 +300,7 @@ export const data = [ method: 'GET', endpoint: 'http://abc.com/contacts', headers: { + 'Content-Type': 'application/json', Authorization: 'Basic dGVzdC11c2VyOg==', 'content-type': 'application/json', h1: 'val1', @@ -305,7 +309,7 @@ export const data = [ }, params: { q1: 'val1', - q2: 'alex.t@example.com', + q2: 'alex.t%40example.com', }, body: { JSON: {}, @@ -355,6 +359,7 @@ export const data = [ endpoint: 'http://abc.com/events', params: {}, headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', }, body: { @@ -409,6 +414,7 @@ export const data = [ method: 'POST', endpoint: 'http://abc.com/contacts/1234567890', headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', key: 'value1', }, @@ -433,6 +439,7 @@ export const data = [ method: 'POST', endpoint: 'http://abc.com/contacts/1234567890', headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', }, params: {}, @@ -456,6 +463,7 @@ export const data = [ method: 'POST', endpoint: 'http://abc.com/contacts/2234567890', headers: { + 'Content-Type': 'application/json', 'content-type': 'application/json', }, params: {}, From 454451dba3260a3664088e2bb009fd8a11cbf957 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:26:08 +0530 Subject: [PATCH 041/160] fix: sonar issues in various components (#4006) * fix: sonar issues in various components * fix: sonar properties * fix: sonar properties --- .eslintignore | 3 +- benchmark/index.js | 193 ------------------ benchmark/metaLogger.js | 36 ---- sonar-project.properties | 2 +- src/adapters/network.js | 80 ++++---- src/cdk/v2/destinations/bluecore/utils.js | 123 +++++------ src/cdk/v2/destinations/clicksend/utils.js | 7 +- src/util/customTransformer-faas.js | 1 - .../destinations/active_campaign/transform.js | 2 +- test/integrations/component.test.ts | 2 +- .../destinations/bluecore/identifyTestData.ts | 2 +- 11 files changed, 113 insertions(+), 338 deletions(-) delete mode 100644 benchmark/index.js delete mode 100644 benchmark/metaLogger.js diff --git a/.eslintignore b/.eslintignore index bc11e675809..303356d0450 100644 --- a/.eslintignore +++ b/.eslintignore @@ -26,4 +26,5 @@ scripts/skipPrepareScript.js .eslintignore .prettierignore *.json -Dockerfile* \ No newline at end of file +Dockerfile* +*.properties \ No newline at end of file diff --git a/benchmark/index.js b/benchmark/index.js deleted file mode 100644 index 919fa3c6de0..00000000000 --- a/benchmark/index.js +++ /dev/null @@ -1,193 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -/* eslint-disable func-names */ -/* eslint-disable no-restricted-syntax */ -/* eslint-disable guard-for-in */ -/* eslint-disable no-await-in-loop */ -/* eslint-disable no-use-before-define */ -/* eslint-disable import/no-dynamic-require */ -/* eslint-disable global-require */ -const Benchmark = require('benchmark-suite'); -const fs = require('fs'); -const path = require('path'); -const Commander = require('commander'); -const logger = require('./metaLogger'); -const versionedRouter = require('../src/versionedRouter'); -const cdkV2Handler = require('../src/cdk/v2/handler'); - -const supportedDestinations = ['algolia', 'pinterest_tag']; - -logger.info(); - -const command = new Commander.Command(); -command - .allowUnknownOption() - .option( - '-d, --destinations ', - 'Enter destination names separated by comma', - supportedDestinations.toString(), - ) - .option( - '-bt, --benchmarktype ', - 'Enter the benchmark type (Operations or Memory)', - 'Operations', - ) - .option('-f, --feature ', 'Enter feature name (proc or rt)', 'proc') - .parse(); - -const getTestFileName = (intg, testSufix) => { - const featureSufix = cmdOpts.feature === 'rt' ? '_router' : ''; - return `${intg}${featureSufix}${testSufix}.json`; -}; - -const testDataDir = path.join(__dirname, '../test/__tests__/data'); -const getTestData = (intgList, fileNameSuffixes) => { - const intgTestData = {}; - intgList.forEach((intg) => { - // Use the last valid test data file - fileNameSuffixes.forEach((fileNameSuffix) => { - try { - intgTestData[intg] = JSON.parse( - fs.readFileSync(path.join(testDataDir, getTestFileName(intg, fileNameSuffix)), { - encoding: 'utf-8', - }), - ); - } catch (err) { - // logger.error( - // `Unable to load the data for: "${intg}" suffix: "${fileNameSuffix}"` - // ); - // logger.error(`Raw error: "${err}"`); - } - }); - }); - return intgTestData; -}; - -const cmdOpts = command.opts(); - -// Initialize data for destinations -const destinationsList = cmdOpts.destinations - .split(',') - .map((x) => x.trim()) - .filter((x) => x !== ''); -logger.info('Destinations:', destinationsList, 'feature:', cmdOpts.feature); -logger.info(); -const destDataset = getTestData(destinationsList, ['_input', '']); - -const nativeDestHandlers = {}; -const destCdKWorkflowEngines = {}; - -const benchmarkType = cmdOpts.benchmarktype.trim(); - -const getNativeHandleName = () => { - let handleName = 'process'; - if (cmdOpts.feature === 'rt') { - handleName = 'processRouterDest'; - } - return handleName; -}; - -async function initializeHandlers() { - for (const idx in destinationsList) { - const dest = destinationsList[idx]; - - // Native destination handler - nativeDestHandlers[dest] = versionedRouter.getDestHandler('v0', dest)[getNativeHandleName()]; - - // Get the CDK 2.0 workflow engine instance - destCdKWorkflowEngines[dest] = await cdkV2Handler.getWorkflowEngine(dest, cmdOpts.feature); - } -} - -async function runDataset(suitDesc, input, intg, params) { - logger.info('=========================================='); - logger.info(suitDesc); - logger.info('=========================================='); - - const results = {}; - const suite = new Benchmark(suitDesc, benchmarkType); - - Object.keys(params).forEach((opName) => { - const handler = params[opName].handlerResolver(intg); - const args = params[opName].argsResolver(intg, input); - suite.add(opName, async () => { - try { - await handler(...args); - } catch (err) { - // logger.info(err); - // Do nothing - } - }); - }); - - suite - .on('cycle', (result) => { - results[result.end.name] = { stats: result.end.stats }; - }) - .on('complete', (result) => { - logger.info( - benchmarkType === 'Operations' ? 'Fastest: ' : 'Memory intensive: ', - `"${result.end.name}"`, - ); - logger.info(); - Object.keys(results).forEach((impl) => { - logger.info(`"${impl}" - `, suite.formatStats(results[impl].stats)); - - if (result.end.name !== impl) { - if (benchmarkType === 'Operations') { - logger.info( - `-> "${result.end.name}" is faster by ${( - results[impl].stats.mean / result.end.stats.mean - ).toFixed(1)} times to "${impl}"`, - ); - } else { - logger.info( - `-> "${result.end.name}" consumed ${( - result.end.stats.mean / results[impl].stats.mean - ).toFixed(1)} times memory compared to "${impl}"`, - ); - } - } - - logger.info(); - }); - }); - - await suite.run({ time: 1000 }); -} - -async function runIntgDataset(dataset, type, params) { - for (const intg in dataset) { - for (const tc in dataset[intg]) { - const curTcData = dataset[intg][tc]; - let tcInput = curTcData; - let tcDesc = `${type} - ${intg} - ${cmdOpts.feature} - ${tc}`; - // New test data file structure - if ('description' in curTcData && 'input' in curTcData && 'output' in curTcData) { - tcInput = curTcData.input; - tcDesc += ` - "${curTcData.description}"`; - } - - await runDataset(tcDesc, tcInput, intg, params); - } - } -} - -async function run() { - // Initialize CDK and native handlers - await initializeHandlers(); - - // Destinations - await runIntgDataset(destDataset, 'Destination', { - native: { - handlerResolver: (intg) => nativeDestHandlers[intg], - argsResolver: (_intg, input) => [input], - }, - 'CDK 2.0': { - handlerResolver: () => cdkV2Handler.process, - argsResolver: (intg, input) => [destCdKWorkflowEngines[intg], input], - }, - }); -} - -// Start suites -run(); diff --git a/benchmark/metaLogger.js b/benchmark/metaLogger.js deleted file mode 100644 index b89ad71066d..00000000000 --- a/benchmark/metaLogger.js +++ /dev/null @@ -1,36 +0,0 @@ -/* istanbul ignore file */ - -const logger = require('../src/logger'); - -logger.setLogLevel('random'); - -const debug = (...args) => { - logger.setLogLevel('debug'); - logger.debug(...args); - logger.setLogLevel('random'); -}; - -const info = (...args) => { - logger.setLogLevel('info'); - logger.info(...args); - logger.setLogLevel('random'); -}; - -const warn = (...args) => { - logger.setLogLevel('warn'); - logger.warn(...args); - logger.setLogLevel('random'); -}; - -const error = (...args) => { - logger.setLogLevel('error'); - logger.error(...args); - logger.setLogLevel('random'); -}; - -module.exports = { - debug, - info, - warn, - error, -}; diff --git a/sonar-project.properties b/sonar-project.properties index 6c45b0ce39d..284f159cb3d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -18,7 +18,7 @@ sonar.testExecutionReportPaths=reports/sonar/results-report.xml sonar.eslint.reportPaths=reports/eslint.json # Path to sources -sonar.sources=src,benchmark +sonar.sources=src sonar.inclusions=**/*.js sonar.exclusions=**/*.json,**/*.html,**/*.png,**/*.jpg,**/*.gif,**/*.svg,**/*.yml,src/util/libExtractor.js,src/util/url-search-params.min.js,src/util/lodash-es-core.js diff --git a/src/adapters/network.js b/src/adapters/network.js index aeb1cc128b3..13ebc89aadc 100644 --- a/src/adapters/network.js +++ b/src/adapters/network.js @@ -323,7 +323,7 @@ function stringifyQueryParam(value) { * @param {Object} payload * @returns {String} */ -function getFormData(payload) { +function getFormData(payload = {}) { const data = new URLSearchParams(); Object.keys(payload).forEach((key) => { const payloadValStr = stringifyQueryParam(payload[key]); @@ -332,6 +332,22 @@ function getFormData(payload) { return data; } +function extractPayloadForFormat(payload, format) { + switch (format) { + case 'JSON_ARRAY': + return payload?.batch; + case 'JSON': + return payload; + case 'XML': + return payload?.payload; + case 'FORM': + return getFormData(payload); + default: + logger.debug(`Unknown payload format: ${format}`); + return undefined; + } +} + /** * Prepares the proxy request * @param {*} request @@ -340,33 +356,29 @@ function getFormData(payload) { const prepareProxyRequest = (request) => { const { body, method, params, endpoint, headers, destinationConfig: config } = request; const { payload, payloadFormat } = getPayloadData(body); - let data; - - switch (payloadFormat) { - case 'JSON_ARRAY': - data = payload.batch; - // TODO: add headers - break; - case 'JSON': - data = payload; - break; - case 'XML': - data = payload.payload; - break; - case 'FORM': - data = getFormData(payload); - break; - case 'MULTIPART-FORM': - // TODO: - break; - default: - logger.debug(`body format ${payloadFormat} not supported`); - } + const data = extractPayloadForFormat(payload, payloadFormat); // Ref: https://github.com/rudderlabs/rudder-server/blob/master/router/network.go#L164 headers['User-Agent'] = 'RudderLabs'; return removeUndefinedValues({ endpoint, data, params, headers, method, config }); }; +const getHttpWrapperMethod = (requestType) => { + switch (requestType) { + case 'get': + return httpGET; + case 'put': + return httpPUT; + case 'patch': + return httpPATCH; + case 'delete': + return httpDELETE; + case 'constructor': + return httpSend; + default: + return httpPOST; + } +}; + /** * handles http request and sends the response in a simple format that is followed in transformer * @@ -392,27 +404,7 @@ const prepareProxyRequest = (request) => { }) */ const handleHttpRequest = async (requestType = 'post', ...httpArgs) => { - let httpWrapperMethod; - switch (requestType.toLowerCase()) { - case 'get': - httpWrapperMethod = httpGET; - break; - case 'put': - httpWrapperMethod = httpPUT; - break; - case 'patch': - httpWrapperMethod = httpPATCH; - break; - case 'delete': - httpWrapperMethod = httpDELETE; - break; - case 'constructor': - httpWrapperMethod = httpSend; - break; - default: - httpWrapperMethod = httpPOST; - break; - } + const httpWrapperMethod = getHttpWrapperMethod(requestType.toLowerCase()); const httpResponse = await httpWrapperMethod(...httpArgs); const processedResponse = processAxiosResponse(httpResponse); return { httpResponse, processedResponse }; diff --git a/src/cdk/v2/destinations/bluecore/utils.js b/src/cdk/v2/destinations/bluecore/utils.js index 543b6de745f..e82a1355b51 100644 --- a/src/cdk/v2/destinations/bluecore/utils.js +++ b/src/cdk/v2/destinations/bluecore/utils.js @@ -19,74 +19,83 @@ const { EVENT_NAME_MAPPING, IDENTIFY_EXCLUSION_LIST, TRACK_EXCLUSION_LIST } = re const { EventType } = require('../../../../constants'); const { MAPPING_CONFIG, CONFIG_CATEGORIES } = require('./config'); -/** - * Verifies the correctness of payload for different events. - * - * @param {Object} payload - The payload object containing event information. - * @param {Object} message - The message object containing additional information. - * @throws {InstrumentationError} - Throws an error if required properties are missing. - * @returns {void} - */ -const verifyPayload = (payload, message) => { +const validateCustomerProperties = (payload, eventName) => { + if ( + !isDefinedAndNotNull(payload?.properties?.customer) || + Object.keys(payload.properties.customer).length === 0 + ) { + throw new InstrumentationError( + `[Bluecore] property:: No relevant trait to populate customer information, which is required for ${eventName} action`, + ); + } +}; + +const validateIdentifyAction = (message) => { if ( message.type === EventType.IDENTIFY && isDefinedNotNullNotEmpty(message.traits?.action) && message.traits?.action !== 'identify' ) { throw new InstrumentationError( - "[Bluecore] traits.action must be 'identify' for identify action", + "[Bluecore] traits.action must be 'identify' for identify action", ); } - switch (payload.event) { - case 'search': - if (!payload?.properties?.search_term) { - throw new InstrumentationError( - '[Bluecore] property:: search_query is required for search event', - ); - } - break; - case 'purchase': - if (!isDefinedAndNotNull(payload?.properties?.order_id)) { - throw new InstrumentationError( - '[Bluecore] property:: order_id is required for purchase event', - ); - } - if (!isDefinedAndNotNull(payload?.properties?.total)) { - throw new InstrumentationError( - '[Bluecore] property:: total is required for purchase event', - ); - } - if ( - !isDefinedAndNotNull(payload?.properties?.customer) || - Object.keys(payload.properties.customer).length === 0 - ) { - throw new InstrumentationError( - `[Bluecore] property:: No relevant trait to populate customer information, which is required for ${payload.event} event`, - ); - } - break; - case 'identify': - case 'optin': - case 'unsubscribe': - if (!isDefinedAndNotNullAndNotEmpty(getFieldValueFromMessage(message, 'email'))) { - throw new InstrumentationError( - `[Bluecore] property:: email is required for ${payload.event} action`, - ); - } - if ( - !isDefinedAndNotNull(payload?.properties?.customer) || - Object.keys(payload.properties.customer).length === 0 - ) { - throw new InstrumentationError( - `[Bluecore] property:: No relevant trait to populate customer information, which is required for ${payload.event} action`, - ); - } - break; - default: - break; +}; +const validateSearchEvent = (payload) => { + if (!payload?.properties?.search_term) { + throw new InstrumentationError( + '[Bluecore] property:: search_query is required for search event', + ); } }; +const validatePurchaseEvent = (payload) => { + if (!isDefinedAndNotNull(payload?.properties?.order_id)) { + throw new InstrumentationError('[Bluecore] property:: order_id is required for purchase event'); + } + if (!isDefinedAndNotNull(payload?.properties?.total)) { + throw new InstrumentationError('[Bluecore] property:: total is required for purchase event'); + } + validateCustomerProperties(payload, 'purchase'); +}; + +const validateCustomerEvent = (payload, message) => { + if (!isDefinedAndNotNullAndNotEmpty(getFieldValueFromMessage(message, 'email'))) { + throw new InstrumentationError( + `[Bluecore] property:: email is required for ${payload.event} action`, + ); + } + validateCustomerProperties(payload, payload.event); +}; + +const validateEventSpecificPayload = (payload, message) => { + const eventValidators = { + search: validateSearchEvent, + purchase: validatePurchaseEvent, + identify: validateCustomerEvent, + optin: validateCustomerEvent, + unsubscribe: validateCustomerEvent, + }; + + const validator = eventValidators[payload.event]; + if (validator) { + validator(payload, message); + } +}; + +/** + * Verifies the correctness of payload for different events. + * + * @param {Object} payload - The payload object containing event information. + * @param {Object} message - The message object containing additional information. + * @throws {InstrumentationError} - Throws an error if required properties are missing. + * @returns {void} + */ +const verifyPayload = (payload, message) => { + validateIdentifyAction(message); + validateEventSpecificPayload(payload, message); +}; + /** * Deduces the track event name based on the provided track event name and configuration. * diff --git a/src/cdk/v2/destinations/clicksend/utils.js b/src/cdk/v2/destinations/clicksend/utils.js index 797ea12025e..c6a8c281e3b 100644 --- a/src/cdk/v2/destinations/clicksend/utils.js +++ b/src/cdk/v2/destinations/clicksend/utils.js @@ -4,8 +4,11 @@ const { BatchUtils } = require('@rudderstack/workflow-engine'); const { SMS_SEND_ENDPOINT, MAX_BATCH_SIZE, COMMON_CONTACT_DOMAIN } = require('./config'); const { isDefinedAndNotNullAndNotEmpty, isDefinedAndNotNull } = require('../../../../v0/util'); -const getEndIdentifyPoint = (contactId, contactListId) => - `${COMMON_CONTACT_DOMAIN}/${contactListId}/contacts${isDefinedAndNotNullAndNotEmpty(contactId) ? `/${contactId}` : ''}`; +const getEndIdentifyPoint = (contactId, contactListId) => { + const basePath = `${COMMON_CONTACT_DOMAIN}/${contactListId}/contacts`; + const contactSuffix = isDefinedAndNotNullAndNotEmpty(contactId) ? `/${contactId}` : ''; + return basePath + contactSuffix; +}; const validateIdentifyPayload = (payload) => { if ( diff --git a/src/util/customTransformer-faas.js b/src/util/customTransformer-faas.js index 0f59f5db60f..d8bf556d893 100644 --- a/src/util/customTransformer-faas.js +++ b/src/util/customTransformer-faas.js @@ -34,7 +34,6 @@ function generateFunctionName(userTransformation, libraryVersionIds, testMode, h ids = ids.concat([hashSecret]); } - // FIXME: Why the id's are sorted ?! const hash = crypto.createHash('md5').update(`${ids}`).digest('hex'); return `fn-${userTransformation.workspaceId}-${hash}`.substring(0, 63).toLowerCase(); } diff --git a/src/v0/destinations/active_campaign/transform.js b/src/v0/destinations/active_campaign/transform.js index f21bb1a70d4..3fd5229c371 100644 --- a/src/v0/destinations/active_campaign/transform.js +++ b/src/v0/destinations/active_campaign/transform.js @@ -95,7 +95,7 @@ const customTagProcessor = async ({ message, destination, metadata }, category, // Step - 1 // Fetch already created tags from dest, so that we avoid duplicate tag creation request // Ref - https://developers.activecampaign.com/reference/retrieve-all-tags - endpoint = `${destination.Config.apiUrl}${`${tagEndPoint}?limit=100`}`; + endpoint = `${destination.Config.apiUrl}${tagEndPoint}?limit=100`; requestOptions = { headers: getHeader(destination), }; diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 040843d8110..27007b240dd 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -254,7 +254,7 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { describe(`${testData[0].name} ${testData[0].module}`, () => { test.each(extendedTestData)( - '$feature -> $description$descriptionSuffix (index: $#)', + '$tcData.feature -> $tcData.description $descriptionSuffix (index: $#)', async ({ tcData, sourceTransformV2Flag }) => { tcData?.mockFns?.(mockAdapter); diff --git a/test/integrations/destinations/bluecore/identifyTestData.ts b/test/integrations/destinations/bluecore/identifyTestData.ts index fee27ccf0fa..dbc6c3967c3 100644 --- a/test/integrations/destinations/bluecore/identifyTestData.ts +++ b/test/integrations/destinations/bluecore/identifyTestData.ts @@ -237,7 +237,7 @@ export const identifyData = [ body: [ { error: - "[Bluecore] traits.action must be 'identify' for identify action: Workflow: procWorkflow, Step: prepareIdentifyPayload, ChildStep: undefined, OriginalError: [Bluecore] traits.action must be 'identify' for identify action", + "[Bluecore] traits.action must be 'identify' for identify action: Workflow: procWorkflow, Step: prepareIdentifyPayload, ChildStep: undefined, OriginalError: [Bluecore] traits.action must be 'identify' for identify action", metadata: { destinationId: '', destinationType: '', From 23ad10a4bd470f09a75e9230d8c860b703a5a1f9 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Thu, 23 Jan 2025 19:31:18 +0530 Subject: [PATCH 042/160] feat: add redis support in shopify pixel for id stitching (#4001) * feat: add redis support in shopify pixel for id stitching (#3957) * chore: pixelEventLabel for identifier events also * fix: redis await missing * fix: setProperty issue * fix: refactor basic code flow * chore: handle imports, await functions * chore: add pixel prefix for redis carttoken in shopify * chore: address comments * chore: add stat for serverside missing cart token * chore: add unit test for utm param extractfunction --------- Co-authored-by: Utsab Chowdhury --- src/util/prometheus.js | 6 + src/v0/sources/shopify/util.js | 1 + .../campaignObjectMappings.json | 18 +++ src/v1/sources/shopify/transform.js | 28 +--- src/v1/sources/shopify/transformV1.js | 36 +++++ src/v1/sources/shopify/utils.js | 34 +++++ src/v1/sources/shopify/utils.test.js | 48 ++++++ .../serverSideTransform.js | 47 ++---- .../serverSideUtils.test.js | 61 ++++++-- .../webhookTransformations/serverSideUtlis.js | 79 +++++++++- .../webpixelTransformations/pixelTransform.js | 14 +- .../webpixelTransformations/pixelUtils.js | 37 +++++ .../pixelUtils.test.js | 57 +++++++ .../integrations/sources/shopify/constants.ts | 141 ++++++++++++++---- .../pixelTestScenarios/ProductEventsTests.ts | 19 ++- 15 files changed, 518 insertions(+), 108 deletions(-) create mode 100644 src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json create mode 100644 src/v1/sources/shopify/transformV1.js create mode 100644 src/v1/sources/shopify/utils.js create mode 100644 src/v1/sources/shopify/utils.test.js diff --git a/src/util/prometheus.js b/src/util/prometheus.js index 2a3a1fb22a8..18cbcdf6b7e 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -445,6 +445,12 @@ class Prometheus { type: 'counter', labelNames: ['event', 'writeKey'], }, + { + name: 'shopify_pixel_cart_token_not_found_server_side', + help: 'shopify_pixel_cart_token_not_found_server_side', + type: 'counter', + labelNames: ['event', 'writeKey'], + }, { name: 'shopify_pixel_cart_token_set', help: 'shopify_pixel_cart_token_set', diff --git a/src/v0/sources/shopify/util.js b/src/v0/sources/shopify/util.js index b7e79e35a16..3665dfff203 100644 --- a/src/v0/sources/shopify/util.js +++ b/src/v0/sources/shopify/util.js @@ -272,6 +272,7 @@ module.exports = { createPropertiesForEcomEvent, extractEmailFromPayload, getAnonymousIdAndSessionId, + getCartToken, checkAndUpdateCartItems, getHashLineItems, getDataFromRedis, diff --git a/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json b/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json new file mode 100644 index 00000000000..319502e377b --- /dev/null +++ b/src/v1/sources/shopify/pixelEventsMappings/campaignObjectMappings.json @@ -0,0 +1,18 @@ +[ + { + "sourceKeys": "utm_campaign", + "destKeys": "name" + }, + { + "sourceKeys": "utm_medium", + "destKeys": "medium" + }, + { + "sourceKeys": "utm_term", + "destKeys": "term" + }, + { + "sourceKeys": "utm_content", + "destKeys": "content" + } +] diff --git a/src/v1/sources/shopify/transform.js b/src/v1/sources/shopify/transform.js index 5ebf4a34fc5..23228ecc10f 100644 --- a/src/v1/sources/shopify/transform.js +++ b/src/v1/sources/shopify/transform.js @@ -1,29 +1,13 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -const { processPixelWebEvents } = require('./webpixelTransformations/pixelTransform'); -const { process: processWebhookEvents } = require('../../../v0/sources/shopify/transform'); -const { - process: processPixelWebhookEvents, -} = require('./webhookTransformations/serverSideTransform'); +const { process: processV0 } = require('../../../v0/sources/shopify/transform'); +const { processV1Events } = require('./transformV1'); +const { isShopifyV1Event } = require('./utils'); const process = async (inputEvent) => { const { event } = inputEvent; - const { query_parameters } = event; - // check identify the event is from the web pixel based on the pixelEventLabel property. - const { pixelEventLabel: pixelClientEventLabel } = event; - if (pixelClientEventLabel) { - // this is a event fired from the web pixel loaded on the browser - // by the user interactions with the store. - const pixelWebEventResponse = await processPixelWebEvents(event); - return pixelWebEventResponse; + if (isShopifyV1Event(event)) { + return processV1Events(event); } - if (query_parameters && query_parameters?.version?.[0] === 'pixel') { - // this is a server-side event from the webhook subscription made by the pixel app. - const pixelWebhookEventResponse = await processPixelWebhookEvents(event); - return pixelWebhookEventResponse; - } - // this is a server-side event from the webhook subscription made by the legacy tracker-based app. - const response = await processWebhookEvents(event); - return response; + return processV0(event); }; module.exports = { process }; diff --git a/src/v1/sources/shopify/transformV1.js b/src/v1/sources/shopify/transformV1.js new file mode 100644 index 00000000000..b3e01d95c67 --- /dev/null +++ b/src/v1/sources/shopify/transformV1.js @@ -0,0 +1,36 @@ +const { PlatformError } = require('@rudderstack/integrations-lib'); +const { isIdentifierEvent, processIdentifierEvent } = require('./utils'); +const { processWebhookEvents } = require('./webhookTransformations/serverSideTransform'); +const { processPixelWebEvents } = require('./webpixelTransformations/pixelTransform'); + +const processV1Events = async (event) => { + // eslint-disable-next-line @typescript-eslint/naming-convention + const { query_parameters } = event; + + // these are the events from the front-end tracking, viz. web-pixel or theme-app extension. + const { pixelEventLabel: clientSideEvent } = event; + const isServerSideEvent = query_parameters && query_parameters?.version?.[0] === 'pixel'; + + if (clientSideEvent) { + // check if the event is an identifier event, used to set the anonymousId in the redis for identity stitching. + if (isIdentifierEvent(event)) { + return processIdentifierEvent(event); + } + // handle events from the app pixel. + const pixelWebEventResponse = processPixelWebEvents(event); + return pixelWebEventResponse; + } + if (isServerSideEvent) { + // this is a server-side event from the webhook subscription made by the pixel app. + const pixelWebhookEventResponse = await processWebhookEvents(event); + return pixelWebhookEventResponse; + } + throw new PlatformError( + 'Invalid Event for Shopiyf V1 (not matching client or server side event requirements)', + 500, + ); +}; + +module.exports = { + processV1Events, +}; diff --git a/src/v1/sources/shopify/utils.js b/src/v1/sources/shopify/utils.js new file mode 100644 index 00000000000..9502b2ee595 --- /dev/null +++ b/src/v1/sources/shopify/utils.js @@ -0,0 +1,34 @@ +const { RedisDB } = require('../../../util/redis/redisConnector'); + +const NO_OPERATION_SUCCESS = { + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, +}; + +const isIdentifierEvent = (payload) => ['rudderIdentifier'].includes(payload?.event); + +const processIdentifierEvent = async (event) => { + const { cartToken, anonymousId } = event; + await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', anonymousId]); + return NO_OPERATION_SUCCESS; +}; + +const isShopifyV1Event = (event) => { + // eslint-disable-next-line @typescript-eslint/naming-convention + const { query_parameters } = event; + const { pixelEventLabel: pixelClientEventLabel } = event; + + return !!( + (query_parameters && query_parameters?.version?.[0] === 'pixel') || + pixelClientEventLabel + ); +}; + +module.exports = { + processIdentifierEvent, + isIdentifierEvent, + isShopifyV1Event, +}; diff --git a/src/v1/sources/shopify/utils.test.js b/src/v1/sources/shopify/utils.test.js new file mode 100644 index 00000000000..558cdec7c52 --- /dev/null +++ b/src/v1/sources/shopify/utils.test.js @@ -0,0 +1,48 @@ +const { isIdentifierEvent, processIdentifierEvent } = require('./utils'); +const { RedisDB } = require('../../../util/redis/redisConnector'); + +describe('Identifier Utils Tests', () => { + describe('test isIdentifierEvent', () => { + it('should return true if the event is rudderIdentifier', () => { + const event = { event: 'rudderIdentifier' }; + expect(isIdentifierEvent(event)).toBe(true); + }); + + it('should return false if the event is not rudderIdentifier', () => { + const event = { event: 'checkout started' }; + expect(isIdentifierEvent(event)).toBe(false); + }); + }); + + describe('test processIdentifierEvent', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should set the anonymousId in redis and return NO_OPERATION_SUCCESS', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; + + const response = await processIdentifierEvent(event); + + expect(setValSpy).toHaveBeenCalledWith('pixel:cartTokenTest1', [ + 'anonymousId', + 'anonymousIdTest1', + ]); + expect(response).toEqual({ + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, + }); + }); + + it('should handle redis errors', async () => { + jest.spyOn(RedisDB, 'setVal').mockRejectedValue(new Error('Redis connection failed')); + const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; + + await expect(processIdentifierEvent(event)).rejects.toThrow('Redis connection failed'); + }); + }); +}); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index d0221f6950a..88d6ae4854f 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -1,9 +1,8 @@ -/* eslint-disable @typescript-eslint/naming-convention */ const lodash = require('lodash'); const get = require('get-value'); const stats = require('../../../../util/stats'); -const { getShopifyTopic, extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); -const { removeUndefinedAndNullValues, isDefinedAndNotNull } = require('../../../../v0/util'); +const { getShopifyTopic } = require('../../../../v0/sources/shopify/util'); +const { removeUndefinedAndNullValues } = require('../../../../v0/util'); const Message = require('../../../../v0/sources/message'); const { EventType } = require('../../../../constants'); const { @@ -19,7 +18,8 @@ const { RUDDER_ECOM_MAP } = require('../config'); const { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, - getAnonymousIdFromAttributes, + setAnonymousId, + handleCommonProperties, } = require('./serverSideUtlis'); const NO_OPERATION_SUCCESS = { @@ -65,9 +65,6 @@ const ecomPayloadBuilder = (event, shopifyTopic) => { if (event.billing_address) { message.setProperty('traits.billingAddress', event.billing_address); } - if (!message.userId && event.user_id) { - message.setProperty('userId', event.user_id); - } return message; }; @@ -110,42 +107,16 @@ const processEvent = async (inputEvent, metricMetadata) => { message = trackPayloadBuilder(event, shopifyTopic); break; } - - if (message.userId) { - message.userId = String(message.userId); - } - if (!get(message, 'traits.email')) { - const email = extractEmailFromPayload(event); - if (email) { - message.setProperty('traits.email', email); - } - } // attach anonymousId if the event is track event using note_attributes if (message.type !== EventType.IDENTIFY) { - const anonymousId = getAnonymousIdFromAttributes(event); - if (isDefinedAndNotNull(anonymousId)) { - message.setProperty('anonymousId', anonymousId); - } - } - message.setProperty(`integrations.${INTEGERATION}`, true); - message.setProperty('context.library', { - eventOrigin: 'server', - name: 'RudderStack Shopify Cloud', - version: '2.0.0', - }); - message.setProperty('context.topic', shopifyTopic); - // attaching cart, checkout and order tokens in context object - message.setProperty(`context.cart_token`, event.cart_token); - message.setProperty(`context.checkout_token`, event.checkout_token); - // raw shopify payload passed inside context object under shopifyDetails - message.setProperty('context.shopifyDetails', event); - if (shopifyTopic === 'orders_updated') { - message.setProperty(`context.order_token`, event.token); + await setAnonymousId(message, event, metricMetadata); } + // attach userId, email and other contextual properties + message = handleCommonProperties(message, event, shopifyTopic); message = removeUndefinedAndNullValues(message); return message; }; -const process = async (event) => { +const processWebhookEvents = async (event) => { const metricMetadata = { writeKey: event.query_parameters?.writeKey?.[0], source: 'SHOPIFY', @@ -155,7 +126,7 @@ const process = async (event) => { }; module.exports = { - process, + processWebhookEvents, processEvent, identifyPayloadBuilder, ecomPayloadBuilder, diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index b94ec9c3ddf..070fdafdd71 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -1,15 +1,13 @@ +const { processEvent } = require('./serverSideTransform'); const { getProductsFromLineItems, createPropertiesForEcomEventFromWebhook, getAnonymousIdFromAttributes, + getCartToken, } = require('./serverSideUtlis'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); -const { constructPayload } = require('../../../../v0/util'); - -const { - lineItemsMappingJSON, - productMappingJSON, -} = require('../../../../v0/sources/shopify/config'); +const { lineItemsMappingJSON } = require('../../../../v0/sources/shopify/config'); const Message = require('../../../../v0/sources/message'); jest.mock('../../../../v0/sources/message'); @@ -63,7 +61,6 @@ describe('serverSideUtils.js', () => { }); it('should return array of products', () => { - const mapping = {}; const result = getProductsFromLineItems(LINEITEMS, lineItemsMappingJSON); expect(result).toEqual([ { brand: 'Hydrogen Vendor', price: '600.00', product_id: 7234590408818, quantity: 1 }, @@ -115,7 +112,13 @@ describe('serverSideUtils.js', () => { // Handles empty note_attributes array gracefully it('should return null when note_attributes is an empty array', async () => { const event = { note_attributes: [] }; - const result = await getAnonymousIdFromAttributes(event); + const result = getAnonymousIdFromAttributes(event); + expect(result).toBeNull(); + }); + + it('should return null when note_attributes is not present', async () => { + const event = {}; + const result = getAnonymousIdFromAttributes(event); expect(result).toBeNull(); }); @@ -123,8 +126,48 @@ describe('serverSideUtils.js', () => { const event = { note_attributes: [{ name: 'rudderAnonymousId', value: '123456' }], }; - const result = await getAnonymousIdFromAttributes(event); + const result = getAnonymousIdFromAttributes(event); expect(result).toEqual('123456'); }); }); + + describe('getCartToken', () => { + it('should return null if cart_token is not present', () => { + const event = {}; + const result = getCartToken(event); + expect(result).toBeNull(); + }); + + it('should return cart_token if it is present', () => { + const event = { cart_token: 'cartTokenTest1' }; + const result = getCartToken(event); + expect(result).toEqual('cartTokenTest1'); + }); + }); +}); + +describe('Redis cart token tests', () => { + it('should get anonymousId property from redis', async () => { + const getValSpy = jest + .spyOn(RedisDB, 'getVal') + .mockResolvedValue({ anonymousId: 'anonymousIdTest1' }); + const event = { + cart_token: `cartTokenTest1`, + id: 5778367414385, + line_items: [ + { + id: 14234727743601, + }, + ], + query_parameters: { + topic: ['orders_updated'], + version: ['pixel'], + writeKey: ['dummy-write-key'], + }, + }; + const message = await processEvent(event); + expect(getValSpy).toHaveBeenCalledTimes(1); + expect(getValSpy).toHaveBeenCalledWith('pixel:cartTokenTest1'); + expect(message.anonymousId).toEqual('anonymousIdTest1'); + }); }); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index df33d7a347a..be10294184d 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -1,7 +1,11 @@ +/* eslint-disable no-param-reassign */ +const get = require('get-value'); const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); +const { extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); const { constructPayload } = require('../../../../v0/util'); -const { lineItemsMappingJSON, productMappingJSON } = require('../config'); - +const { INTEGERATION, lineItemsMappingJSON, productMappingJSON } = require('../config'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); +const stats = require('../../../../util/stats'); /** * Returns an array of products from the lineItems array received from the webhook event * @param {Array} lineItems @@ -54,8 +58,79 @@ const getAnonymousIdFromAttributes = (event) => { return rudderAnonymousIdObject ? rudderAnonymousIdObject.value : null; }; +/** + * Returns the cart_token from the event message + * @param {Object} event + * @returns {String} cart_token + */ +const getCartToken = (event) => event?.cart_token || null; + +/** + * Handles the anonymousId assignment for the message, based on the event attributes and redis data + * @param {Object} message rudderstack message object + * @param {Object} event raw shopify event payload + * @param {Object} metricMetadata metric metadata object + */ +const setAnonymousId = async (message, event, metricMetadata) => { + const anonymousId = getAnonymousIdFromAttributes(event); + if (isDefinedAndNotNull(anonymousId)) { + message.anonymousId = anonymousId; + } else { + // if anonymousId is not present in note_attributes or note_attributes is not present, query redis for anonymousId + const cartToken = getCartToken(event); + if (cartToken) { + const redisData = await RedisDB.getVal(`pixel:${cartToken}`); + if (redisData?.anonymousId) { + message.anonymousId = redisData.anonymousId; + } + } else { + stats.increment('shopify_pixel_cart_token_not_found_server_side', { + source: metricMetadata.source, + writeKey: metricMetadata.writeKey, + }); + } + } +}; + +/** + Handles userId, email and contextual properties enrichment for the message payload + * @param {Object} message rudderstack message object + * @param {Object} event raw shopify event payload + * @param {String} shopifyTopic shopify event topic +*/ +const handleCommonProperties = (message, event, shopifyTopic) => { + if (message.userId) { + message.userId = String(message.userId); + } + if (!get(message, 'traits.email')) { + const email = extractEmailFromPayload(event); + if (email) { + message.setProperty('traits.email', email); + } + } + message.setProperty(`integrations.${INTEGERATION}`, true); + message.setProperty('context.library', { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }); + message.setProperty('context.topic', shopifyTopic); + // attaching cart, checkout and order tokens in context object + message.setProperty(`context.cart_token`, event.cart_token); + message.setProperty(`context.checkout_token`, event.checkout_token); + // raw shopify payload passed inside context object under shopifyDetails + message.setProperty('context.shopifyDetails', event); + if (shopifyTopic === 'orders_updated') { + message.setProperty(`context.order_token`, event.token); + } + return message; +}; + module.exports = { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, getAnonymousIdFromAttributes, + getCartToken, + setAnonymousId, + handleCommonProperties, }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js index b1d1c8b2fac..3b83033425c 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js @@ -15,7 +15,9 @@ const { checkoutEventBuilder, checkoutStepEventBuilder, searchEventBuilder, + extractCampaignParams, } = require('./pixelUtils'); +const campaignObjectMappings = require('../pixelEventsMappings/campaignObjectMappings.json'); const { INTEGERATION, PIXEL_EVENT_TOPICS, @@ -68,7 +70,7 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { const cartToken = extractCartToken(inputEvent); try { if (isDefinedNotNullNotEmpty(clientId) && isDefinedNotNullNotEmpty(cartToken)) { - await RedisDB.setVal(cartToken, ['anonymousId', clientId]); + await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', clientId]); stats.increment('shopify_pixel_cart_token_set', { event: inputEvent.name, writeKey: inputEvent.query_parameters.writeKey, @@ -85,7 +87,7 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { function processPixelEvent(inputEvent) { // eslint-disable-next-line @typescript-eslint/naming-convention - const { name, query_parameters, clientId, data, id } = inputEvent; + const { name, query_parameters, context, clientId, data, id } = inputEvent; const shopifyDetails = { ...inputEvent }; delete shopifyDetails.context; delete shopifyDetails.query_parameters; @@ -147,12 +149,18 @@ function processPixelEvent(inputEvent) { }); message.setProperty('context.topic', name); message.setProperty('context.shopifyDetails', shopifyDetails); + + // adding campaign object with utm parameters to the message context + const campaignParams = extractCampaignParams(context, campaignObjectMappings); + if (campaignParams) { + message.context.campaign = campaignParams; + } message.messageId = id; message = removeUndefinedAndNullValues(message); return message; } -const processPixelWebEvents = async (event) => { +const processPixelWebEvents = (event) => { const pixelEvent = processPixelEvent(event); return removeUndefinedAndNullValues(pixelEvent); }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js index 46ae59e0cf8..388be2a16e8 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js @@ -1,4 +1,5 @@ /* eslint-disable no-param-reassign */ +const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); const Message = require('../../../../v0/sources/message'); const { EventType } = require('../../../../constants'); const { @@ -203,6 +204,41 @@ const searchEventBuilder = (inputEvent) => { ); }; +/** + * Extracts UTM parameters from the context object + * @param {*} context context object from the event + * @param {*} campaignMappings mappings for UTM parameters + * @returns campaignParams, an object containing UTM parameters + */ +const extractCampaignParams = (context, campaignMappings) => { + if (context?.document?.location?.href) { + const url = new URL(context.document.location.href); + const campaignParams = {}; + + // Loop through mappings and extract UTM parameters + campaignMappings.forEach((mapping) => { + const value = url.searchParams.get(mapping.sourceKeys); + if (isDefinedAndNotNull(value)) { + campaignParams[mapping.destKeys] = value; + } + }); + + // Extract any UTM parameters not in the mappings + const campaignObjectSourceKeys = campaignMappings.flatMap((mapping) => mapping.sourceKeys); + url.searchParams.forEach((value, key) => { + if (key.startsWith('utm_') && !campaignObjectSourceKeys.includes(key)) { + campaignParams[key] = value; + } + }); + + // Only return campaign object if we have any UTM parameters + if (Object.keys(campaignParams).length > 0) { + return campaignParams; + } + } + return null; +}; + module.exports = { pageViewedEventBuilder, cartViewedEventBuilder, @@ -212,4 +248,5 @@ module.exports = { checkoutEventBuilder, checkoutStepEventBuilder, searchEventBuilder, + extractCampaignParams, }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js index e8f53a5f153..fc82404ee73 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js @@ -7,7 +7,9 @@ const { checkoutEventBuilder, checkoutStepEventBuilder, searchEventBuilder, + extractCampaignParams, } = require('./pixelUtils'); +const campaignObjectMappings = require('../pixelEventsMappings/campaignObjectMappings.json'); const Message = require('../../../../v0/sources/message'); jest.mock('ioredis', () => require('../../../../test/__mocks__/redis')); jest.mock('../../../../v0/sources/message'); @@ -787,4 +789,59 @@ describe('utilV2.js', () => { expect(message.context).toEqual({ userAgent: 'Mozilla/5.0' }); }); }); + + describe('extractCampaignParams', () => { + it('should extract campaign parameters from URL', () => { + const context = { + document: { + location: { + href: 'https://example.com?utm_source=google&utm_medium=cpc&utm_campaign=spring_sale', + }, + }, + }; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toEqual({ + utm_source: 'google', + medium: 'cpc', + name: 'spring_sale', + }); + }); + + it('should return null if no campaign parameters are found', () => { + const context = { + document: { + location: { + href: 'https://example.com', + }, + }, + }; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toBeNull(); + }); + + it('should extract additional UTM parameters not in mappings', () => { + const context = { + document: { + location: { + href: 'https://example.com?utm_source=google&utm_term=shoes', + }, + }, + }; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toEqual({ + utm_source: 'google', + term: 'shoes', + }); + }); + + it('should handle missing context or location gracefully', () => { + const context = {}; + + const result = extractCampaignParams(context, campaignObjectMappings); + expect(result).toBeNull(); + }); + }); }); diff --git a/test/integrations/sources/shopify/constants.ts b/test/integrations/sources/shopify/constants.ts index af53a3180e8..cd362adaec3 100644 --- a/test/integrations/sources/shopify/constants.ts +++ b/test/integrations/sources/shopify/constants.ts @@ -1,3 +1,58 @@ +const dummyResponseCommonPayload = { + navigator: { + language: 'en-US', + cookieEnabled: true, + languages: ['en-US', 'en'], + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', + }, + window: { + innerHeight: 1028, + innerWidth: 1362, + outerHeight: 1080, + outerWidth: 1728, + pageXOffset: 0, + pageYOffset: 0, + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + origin: 'https://store.myshopify.com', + screen: { + height: 1117, + width: 1728, + }, + screenX: 0, + screenY: 37, + scrollX: 0, + scrollY: 0, + }, + page: { + title: 'Checkout - pixel-testing-rs', + url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + search: '', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', + screen: { + height: 1117, + width: 1728, + }, + library: { + name: 'RudderStack Shopify Cloud', + eventOrigin: 'client', + version: '2.0.0', + }, +}; + export const dummySourceConfig = { ID: 'dummy-source-id', OriginalID: '', @@ -83,25 +138,10 @@ export const dummyContext = { }, }; -export const note_attributes = [ - { - name: 'cartId', - value: '9c623f099fc8819aa4d6a958b65dfe7d', - }, - { - name: 'cartToken', - value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', - }, - { - name: 'rudderAnonymousId', - value: '50ead33e-d763-4854-b0ab-765859ef05cb', - }, -]; - -export const responseDummyContext = { +export const dummyContextwithCampaign = { document: { location: { - href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', hash: '', host: 'store.myshopify.com', hostname: 'store.myshopify.com', @@ -150,21 +190,60 @@ export const responseDummyContext = { scrollX: 0, scrollY: 0, }, - page: { - title: 'Checkout - pixel-testing-rs', - url: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - path: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', - search: '', +}; + +export const note_attributes = [ + { + name: 'cartId', + value: '9c623f099fc8819aa4d6a958b65dfe7d', }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36', - screen: { - height: 1117, - width: 1728, + { + name: 'cartToken', + value: 'Z2NwLXVzLWVhc3QxOjAxSkQzNUFXVEI4VkVUNUpTTk1LSzBCMzlF', }, - library: { - name: 'RudderStack Shopify Cloud', - eventOrigin: 'client', - version: '2.0.0', + { + name: 'rudderAnonymousId', + value: '50ead33e-d763-4854-b0ab-765859ef05cb', + }, +]; + +export const responseDummyContext = { + document: { + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + referrer: 'https://store.myshopify.com/cart', + characterSet: 'UTF-8', + title: 'Checkout - pixel-testing-rs', + }, + ...dummyResponseCommonPayload, +}; + +export const responseDummyContextwithCampaign = { + document: { + location: { + href: 'https://store.myshopify.com/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU?checkout%5Bpayment_gateway%5D=shopify_payments&utm_campaign=shopifySale&utm_medium=checkout&utm_term=term_checkout&utm_content=web&utm_custom1=customutm&tag=tag', + hash: '', + host: 'store.myshopify.com', + hostname: 'store.myshopify.com', + origin: 'https://store.myshopify.com', + pathname: '/checkouts/cn/Z2NwLXVzLWVhc3QxOjAxSjY5OVpIRURQNERFMDBKUTVaRkI4UzdU', + port: '', + protocol: 'https:', + search: '', + }, + referrer: 'https://store.myshopify.com/cart', + title: 'Checkout - pixel-testing-rs', + characterSet: 'UTF-8', }, + // title: 'Checkout - pixel-testing-rs', + ...dummyResponseCommonPayload, }; diff --git a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts index 46bd4f96151..39fceb4da8e 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts @@ -1,5 +1,11 @@ // This file contains the test scenarios related to Shopify pixel events, emitted from web pixel on the browser. -import { dummyContext, dummySourceConfig, responseDummyContext } from '../constants'; +import { + dummyContext, + dummyContextwithCampaign, + dummySourceConfig, + responseDummyContext, + responseDummyContextwithCampaign, +} from '../constants'; export const pixelEventsTestScenarios = [ { @@ -18,7 +24,7 @@ export const pixelEventsTestScenarios = [ type: 'standard', clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', timestamp: '2024-09-15T17:24:30.373Z', - context: dummyContext, + context: dummyContextwithCampaign, pixelEventLabel: true, query_parameters: { topic: ['page_viewed'], @@ -42,7 +48,14 @@ export const pixelEventsTestScenarios = [ batch: [ { context: { - ...responseDummyContext, + ...responseDummyContextwithCampaign, + campaign: { + content: 'web', + medium: 'checkout', + name: 'shopifySale', + term: 'term_checkout', + utm_custom1: 'customutm', + }, shopifyDetails: { clientId: 'c7b3f99b-4d34-463b-835f-c879482a7750', data: {}, From 3c20393a0e4e3ec98d316820d187310bfec1faea Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:04:47 +0530 Subject: [PATCH 043/160] feat: add DATA WAREHOUSE to integrations object in shopify pixel source (#3980) * feat: add redis support in shopify pixel for id stitching * chore: update redis set structure * chore: update attribute name Co-authored-by: Utsab Chowdhury * fix: stitched events through redis in pixel * fix: stitched events through redis in pixel * fix: stitched events through redis in pixel * chore: add tests * chore: add campaign object support in web pixel events (#3973) * chore: add campaign object support in web pixel events * chore: add custom utm support * chore: address comments * feat: add DATA WAREHOUSE to intg object in shopify pixel * feat: add DATA WAREHOUSE json path handling for some providers * chore: update json structure to be event specific in shopify * chore: add test * chore: add testx2 * chore: resolve conflict * chore: address comments, refactor wh changes * chore: refactor * chore: resolve conflicts * chore: fix test * feat: add redis support in shopify pixel for id stitching (#3957) * feat: add redis support in shopify pixel for id stitching (#3957) * chore: fix redis test * chore: pixelEventLabel for identifier events also * fix: redis await missing * fix: setProperty issue * fix: refactor basic code flow * chore: handle imports, await functions * chore: add pixel prefix for redis carttoken in shopify * chore: address comments * chore: add stat for serverside missing cart token * chore: add unit test for utm param extractfunction * chore: fix sonar issues in wh index js --------- Co-authored-by: Utsab Chowdhury --- .../webhookTransformations/serverSideUtlis.js | 7 +- .../webpixelTransformations/pixelTransform.js | 5 + src/warehouse/index.js | 11 +- src/warehouse/util.js | 22 ++++ test/__tests__/shopify_warehouse.test.js | 103 ++++++++++++++++++ .../pixelTestScenarios/CheckoutEventsTests.ts | 10 ++ .../pixelTestScenarios/CheckoutStepsTests.ts | 20 ++++ .../pixelTestScenarios/ProductEventsTests.ts | 35 ++++++ .../CheckoutEventsTests.ts | 20 ++++ .../webhookTestScenarios/GenericTrackTests.ts | 10 ++ .../webhookTestScenarios/IdentifyTests.ts | 5 + 11 files changed, 243 insertions(+), 5 deletions(-) create mode 100644 test/__tests__/shopify_warehouse.test.js diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index be10294184d..0d81de99ac3 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -123,14 +123,19 @@ const handleCommonProperties = (message, event, shopifyTopic) => { if (shopifyTopic === 'orders_updated') { message.setProperty(`context.order_token`, event.token); } + message.setProperty('integrations.DATA_WAREHOUSE', { + options: { + jsonPaths: [`${message.type}.context.shopifyDetails`], + }, + }); return message; }; module.exports = { createPropertiesForEcomEventFromWebhook, + getCartToken, getProductsFromLineItems, getAnonymousIdFromAttributes, - getCartToken, setAnonymousId, handleCommonProperties, }; diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js index 3b83033425c..44928686f83 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js @@ -142,6 +142,11 @@ function processPixelEvent(inputEvent) { } message.anonymousId = clientId; message.setProperty(`integrations.${INTEGERATION}`, true); + message.setProperty('integrations.DATA_WAREHOUSE', { + options: { + jsonPaths: [`${message.type}.context.shopifyDetails`], + }, + }); message.setProperty('context.library', { name: 'RudderStack Shopify Cloud', eventOrigin: 'client', diff --git a/src/warehouse/index.js b/src/warehouse/index.js index ea663c9b2fc..c5f167909f7 100644 --- a/src/warehouse/index.js +++ b/src/warehouse/index.js @@ -11,6 +11,7 @@ const { validTimestamp, getVersionedUtils, isRudderSourcesEvent, + mergeJSONPathsFromDataWarehouse, } = require('./util'); const { getMergeRuleEvent } = require('./identity'); @@ -307,8 +308,8 @@ function isStringLikeObject(obj) { let minKey = Infinity; let maxKey = -Infinity; - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; + for (const element of keys) { + const key = element; const value = obj[key]; if (!isNonNegativeInteger(key)) return false; @@ -336,8 +337,8 @@ function stringLikeObjectToString(obj) { .sort((a, b) => a - b); let result = ''; - for (let i = 0; i < keys.length; i++) { - result += obj[keys[i].toString()]; + for (const element of keys) { + result += obj[element.toString()]; } return result; @@ -655,6 +656,8 @@ function processWarehouseMessage(message, options) { const skipReservedKeywordsEscaping = options.integrationOptions.skipReservedKeywordsEscaping || false; + mergeJSONPathsFromDataWarehouse(message, options); + // underscoreDivideNumbers when set to false, if a column has a format like "_v_3_", it will be formatted to "_v3_" // underscoreDivideNumbers when set to true, if a column has a format like "_v_3_", we keep it like that // For older destinations, it will come as true and for new destinations this config will not be present which means we will treat it as false. diff --git a/src/warehouse/util.js b/src/warehouse/util.js index 7f4e224a349..1f2d9215f2c 100644 --- a/src/warehouse/util.js +++ b/src/warehouse/util.js @@ -136,6 +136,27 @@ const getRecordIDForExtract = (message) => { return recordId; }; +function mergeJSONPathsFromDataWarehouse(message, options) { + const dataWarehouseOptions = message.integrations?.['DATA_WAREHOUSE']?.options; + if (!dataWarehouseOptions?.jsonPaths) return; + + const dataWarehouseJSONPaths = Array.isArray(dataWarehouseOptions.jsonPaths) + ? dataWarehouseOptions.jsonPaths + : []; + const currentJSONPaths = Array.isArray(options.integrationOptions?.jsonPaths) + ? options.integrationOptions.jsonPaths + : []; + + switch (options.provider) { + case 'rs': + case 'postgres': + case 'snowflake': + case 'bq': + options.integrationOptions.jsonPaths = [...dataWarehouseJSONPaths, ...currentJSONPaths]; + break; + } +} + module.exports = { isObject, isValidJsonPathKey, @@ -148,4 +169,5 @@ module.exports = { sourceCategoriesToUseRecordId, getCloudRecordID, getRecordIDForExtract, + mergeJSONPathsFromDataWarehouse, }; diff --git a/test/__tests__/shopify_warehouse.test.js b/test/__tests__/shopify_warehouse.test.js new file mode 100644 index 00000000000..080022680bb --- /dev/null +++ b/test/__tests__/shopify_warehouse.test.js @@ -0,0 +1,103 @@ +const event = { + "request": { + "query": { + "whSchemaVersion": "v1" + } + }, + "message": { + "context": { + "shopifyDetails": { + "id": 5778367414385, + "current_total_tax": "10.00", + "current_total_tax_set": { + "shop_money": { + "amount": "10.00", + "currency_code": "USD" + }, + }, + "name": "#1017", + "phone": null, + } + }, + "integrations": { + "SHOPIFY": true, + "DATA_WAREHOUSE": { + "options": { + "jsonPaths": [ + "track.context.shopifyDetails" + ] + } + } + }, + "type": "track", + "event": "Order Updated", + "properties": { + "order_id": "5778367414385", + "currency": "USD", + "products": [ + { + "product_id": "7234590408817", + "price": 600, + "quantity": 1 + } + ] + }, + "userId": "123321", + "traits": {}, + "timestamp": "2024-01-01T01:23:45.678Z", + }, + "destination": { + "Config": {}, + } +}; + +/* + Test for warehouse agnostic DATA_WAREHOUSE JSON column support for Shopify source +*/ +describe('DATA_WAREHOUSE integrations', () => { + it('should process event and return responses for common providers for agnostic support', () => { + const responses = require('../../src/v0/destinations/snowflake/transform').process(event); + expect(responses).toHaveLength(2); + expect(responses[0].metadata.table).toBe('TRACKS'); + expect(responses[1].metadata.table).toBe('ORDER_UPDATED'); + + expect(responses[0].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); + expect(responses[0].data.CONTEXT_SHOPIFY_DETAILS).toBe('{"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null}'); + + expect(responses[1].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); + expect(responses[1].data.CONTEXT_SHOPIFY_DETAILS).toBe('{"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null}'); + }); + + it('should process event and return response for other providers like mssql', () => { + const responses = require('../../src/v0/destinations/mssql/transform').process(event); + expect(responses).toHaveLength(2); + expect(responses[0].metadata.table).toBe('tracks'); + expect(responses[1].metadata.table).toBe('order_updated'); + + expect(responses[0].metadata.columns.context_shopify_details).toBe(undefined); + expect(responses[0].metadata.columns.context_shopify_details_id).toBe('int'); + expect(responses[0].metadata.columns.context_shopify_details_current_total_tax).toBe('string'); + expect(responses[0].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('string'); + expect(responses[0].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('string'); + expect(responses[0].metadata.columns.context_shopify_details_name).toBe('string'); + expect(responses[0].data.context_shopify_details).toBe(undefined); + expect(responses[0].data.context_shopify_details_id).toBe(5778367414385); + expect(responses[0].data.context_shopify_details_current_total_tax).toBe('10.00'); + expect(responses[0].data.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('10.00'); + expect(responses[0].data.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('USD'); + expect(responses[0].data.context_shopify_details_name).toBe('#1017'); + + expect(responses[1].metadata.columns.context_shopify_details).toBe(undefined); + expect(responses[1].metadata.columns.context_shopify_details_id).toBe('int'); + expect(responses[1].metadata.columns.context_shopify_details_current_total_tax).toBe('string'); + expect(responses[1].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('string'); + expect(responses[1].metadata.columns.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('string'); + expect(responses[1].metadata.columns.context_shopify_details_name).toBe('string'); + expect(responses[1].data.context_shopify_details).toBe(undefined); + expect(responses[1].data.context_shopify_details_id).toBe(5778367414385); + expect(responses[1].data.context_shopify_details_current_total_tax).toBe('10.00'); + expect(responses[1].data.context_shopify_details_current_total_tax_set_shop_money_amount).toBe('10.00'); + expect(responses[1].data.context_shopify_details_current_total_tax_set_shop_money_currency_code).toBe('USD'); + expect(responses[1].data.context_shopify_details_name).toBe('#1017'); + }); +}); \ No newline at end of file diff --git a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts index ff1ea39ed13..2b04a33fb8b 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutEventsTests.ts @@ -336,6 +336,11 @@ export const pixelCheckoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Started', @@ -775,6 +780,11 @@ export const pixelCheckoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Completed', diff --git a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts index 3db2e3ab101..95fd2ea26bd 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts @@ -387,6 +387,11 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Address Info Submitted', @@ -921,6 +926,11 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Contact Info Submitted', @@ -1470,6 +1480,11 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Shipping Info Submitted', @@ -2035,6 +2050,11 @@ export const pixelCheckoutStepsScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Payment Info Entered', diff --git a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts index 39fceb4da8e..7427ea5ae76 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts @@ -68,6 +68,11 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['page.context.shopifyDetails'], + }, + }, }, name: 'Page View', type: 'page', @@ -179,6 +184,11 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Product Viewed', @@ -343,6 +353,11 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Cart Viewed', @@ -568,6 +583,11 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Product List Viewed', @@ -738,6 +758,11 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Product Added', @@ -879,6 +904,11 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Product Removed', @@ -968,6 +998,11 @@ export const pixelEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Search Submitted', diff --git a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts index b6fa5be322e..1217b81986f 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts @@ -215,6 +215,11 @@ export const checkoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Checkout Started - Webhook', @@ -530,6 +535,11 @@ export const checkoutEventsTestScenarios = [ event: 'Checkout Updated', integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, properties: { currency: 'USD', @@ -1202,6 +1212,11 @@ export const checkoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Updated', @@ -1592,6 +1607,11 @@ export const checkoutEventsTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Created', diff --git a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts index d68d0a8f59c..422fe0135a2 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts @@ -68,6 +68,11 @@ export const genericTrackTestScenarios = [ event: 'Cart Update', integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, properties: { products: [], @@ -530,6 +535,11 @@ export const genericTrackTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, }, type: 'track', event: 'Order Paid', diff --git a/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts index b03f5635b6a..346485fe1e6 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/IdentifyTests.ts @@ -187,6 +187,11 @@ export const identityTestScenarios = [ }, integrations: { SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['identify.context.shopifyDetails'], + }, + }, }, type: 'identify', userId: '7358220173425', From d05011723b2d95293cf9de40513d669abb798028 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:40:16 +0530 Subject: [PATCH 044/160] chore: update order cancelled, property datatypes (#4007) * feat: add redis support in shopify pixel for id stitching (#3957) * feat: add redis support in shopify pixel for id stitching (#3957) * chore: update order cancelled, property datatypes * chore: pixelEventLabel for identifier events also * fix: redis await missing * fix: setProperty issue * fix: refactor basic code flow * chore: handle imports, await functions * chore: update order cancelled test --------- Co-authored-by: Utsab Chowdhury --- src/v1/sources/shopify/config.js | 12 +- .../webhookEventsMapping/productMapping.json | 5 +- .../serverSideTransform.js | 4 +- .../CheckoutEventsTests.ts | 141 +++++++++++++++++- 4 files changed, 155 insertions(+), 7 deletions(-) diff --git a/src/v1/sources/shopify/config.js b/src/v1/sources/shopify/config.js index 9cb11e471f5..20db7be331e 100644 --- a/src/v1/sources/shopify/config.js +++ b/src/v1/sources/shopify/config.js @@ -35,11 +35,20 @@ const PIXEL_EVENT_MAPPING = { search_submitted: 'Search Submitted', }; +const ECOM_TOPICS = { + CHECKOUTS_CREATE: 'checkouts_create', + CHECKOUTS_UPDATE: 'checkouts_update', + ORDERS_UPDATE: 'orders_updated', + ORDERS_CREATE: 'orders_create', + ORDERS_CANCELLED: 'orders_cancelled', +}; + const RUDDER_ECOM_MAP = { - checkouts_create: 'Checkout Started - Webhook', + checkouts_create: 'Checkout Started Webhook', checkouts_update: 'Checkout Updated', orders_updated: 'Order Updated', orders_create: 'Order Created', + orders_cancelled: 'Order Cancelled', }; const contextualFieldMappingJSON = JSON.parse( @@ -94,6 +103,7 @@ module.exports = { INTEGERATION, PIXEL_EVENT_TOPICS, PIXEL_EVENT_MAPPING, + ECOM_TOPICS, RUDDER_ECOM_MAP, contextualFieldMappingJSON, cartViewedEventMappingJSON, diff --git a/src/v1/sources/shopify/webhookEventsMapping/productMapping.json b/src/v1/sources/shopify/webhookEventsMapping/productMapping.json index e78ed50dfc4..7bd20498286 100644 --- a/src/v1/sources/shopify/webhookEventsMapping/productMapping.json +++ b/src/v1/sources/shopify/webhookEventsMapping/productMapping.json @@ -8,7 +8,10 @@ }, { "sourceKeys": "total_price", - "destKey": "value" + "destKey": "value", + "metadata": { + "type": "toNumber" + } }, { "sourceKeys": "total_tax", diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 88d6ae4854f..1fe92bbee0d 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -9,12 +9,11 @@ const { INTEGERATION, MAPPING_CATEGORIES, IDENTIFY_TOPICS, - ECOM_TOPICS, SUPPORTED_TRACK_EVENTS, SHOPIFY_TRACK_MAP, lineItemsMappingJSON, } = require('../../../../v0/sources/shopify/config'); -const { RUDDER_ECOM_MAP } = require('../config'); +const { ECOM_TOPICS, RUDDER_ECOM_MAP } = require('../config'); const { createPropertiesForEcomEventFromWebhook, getProductsFromLineItems, @@ -93,6 +92,7 @@ const processEvent = async (inputEvent, metricMetadata) => { case ECOM_TOPICS.ORDERS_UPDATE: case ECOM_TOPICS.CHECKOUTS_CREATE: case ECOM_TOPICS.CHECKOUTS_UPDATE: + case ECOM_TOPICS.ORDERS_CANCELLED: message = ecomPayloadBuilder(event, shopifyTopic); break; default: diff --git a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts index 1217b81986f..4938294ef99 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts @@ -222,10 +222,10 @@ export const checkoutEventsTestScenarios = [ }, }, type: 'track', - event: 'Checkout Started - Webhook', + event: 'Checkout Started Webhook', properties: { order_id: '35550298931313', - value: '600.00', + value: 600, tax: 0, currency: 'USD', products: [ @@ -1617,7 +1617,7 @@ export const checkoutEventsTestScenarios = [ event: 'Order Created', properties: { order_id: '5778367414385', - value: '600.00', + value: 600, tax: 0, currency: 'USD', products: [ @@ -1703,4 +1703,139 @@ export const checkoutEventsTestScenarios = [ }, }, }, + { + id: 'c005', + name: 'shopify', + description: 'Track Call -> Order Cancelled event from Pixel app', + module: 'source', + version: 'v1', + input: { + request: { + body: [ + { + event: { + email: 'henry@wfls.com', + total_price: '600.00', + total_tax: '0.00', + updated_at: '2024-11-05T21:54:50-05:00', + line_items: [ + { + id: 14234727743601, + name: 'The Collection Snowboard: Hydrogen', + price: '600.00', + product_id: 7234590408817, + quantity: 1, + sku: '', + title: 'The Collection Snowboard: Hydrogen', + total_discount: '0.00', + variant_id: 41327142600817, + vendor: 'Hydrogen Vendor', + }, + ], + shipping_address: { + first_name: 'henry', + address1: 'Yuimaru Kitchen', + city: 'Johnson City', + zip: '37604', + }, + query_parameters: { + topic: ['orders_cancelled'], + version: ['pixel'], + writeKey: ['2mw9SN679HngnZkCHT4oSVVBVmb'], + }, + }, + source: dummySourceConfig, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + shopifyDetails: { + email: 'henry@wfls.com', + line_items: [ + { + id: 14234727743601, + name: 'The Collection Snowboard: Hydrogen', + price: '600.00', + product_id: 7234590408817, + quantity: 1, + sku: '', + title: 'The Collection Snowboard: Hydrogen', + total_discount: '0.00', + variant_id: 41327142600817, + vendor: 'Hydrogen Vendor', + }, + ], + shipping_address: { + address1: 'Yuimaru Kitchen', + city: 'Johnson City', + first_name: 'henry', + zip: '37604', + }, + total_price: '600.00', + total_tax: '0.00', + updated_at: '2024-11-05T21:54:50-05:00', + }, + topic: 'orders_cancelled', + }, + event: 'Order Cancelled', + integrations: { + SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, + }, + properties: { + products: [ + { + brand: 'Hydrogen Vendor', + price: 600, + product_id: '7234590408817', + quantity: 1, + title: 'The Collection Snowboard: Hydrogen', + }, + ], + tax: 0, + value: 600, + }, + timestamp: '2024-11-06T02:54:50.000Z', + traits: { + email: 'henry@wfls.com', + shippingAddress: { + address1: 'Yuimaru Kitchen', + city: 'Johnson City', + first_name: 'henry', + zip: '37604', + }, + }, + type: 'track', + }, + ], + }, + }, + ], + }, + }, + }, ]; From a986138d43d2cabcaa597b70fa7871b383cb1427 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:55:45 +0530 Subject: [PATCH 045/160] fix: iterable device token registration api issues (#4013) * fix: iterable register device token flow * fix: is identify category comparision simplification * chore: logs to verify device token registration flow * chore: update draft-new-release.yml add vinay --------- Co-authored-by: Vinay Teki --- .github/workflows/draft-new-release.yml | 2 +- src/v0/destinations/iterable/transform.js | 12 +- src/v0/destinations/iterable/util.js | 14 +- src/v0/destinations/iterable/util.test.js | 91 ++++++++++ .../iterable/processor/identifyTestData.ts | 157 ++++++++++++++++++ 5 files changed, 266 insertions(+), 10 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 602ded980fd..ce38023d6ae 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest # Only allow release stakeholders to initiate releases - if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'koladilip' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'yashasvibajpai' || github.actor == 'sanpj2292' || github.actor == 'utsabc') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'yashasvibajpai' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc') + if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'sandeepdsvs' || github.actor == 'koladilip' || github.actor == 'yashasvibajpai' || github.actor == 'sanpj2292' || github.actor == 'utsabc' || github.actor == 'vinayteki95') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'yashasvibajpai' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc') steps: - name: Checkout uses: actions/checkout@v4.2.1 diff --git a/src/v0/destinations/iterable/transform.js b/src/v0/destinations/iterable/transform.js index dd67deef69e..c676097c96a 100644 --- a/src/v0/destinations/iterable/transform.js +++ b/src/v0/destinations/iterable/transform.js @@ -1,6 +1,7 @@ const lodash = require('lodash'); const get = require('get-value'); const { InstrumentationError } = require('@rudderstack/integrations-lib'); +const logger = require('../../../logger'); const { getCatalogEndpoint, hasMultipleResponses, @@ -28,6 +29,7 @@ const { const { JSON_MIME_TYPE } = require('../../util/constant'); const { mappingConfig, ConfigCategory } = require('./config'); const { EventType, MappedToDestinationKey } = require('../../../constants'); +const { MD5 } = require('../../../cdk/v2/bindings/default'); /** * Common payload builder function for all events @@ -108,10 +110,16 @@ const responseBuilder = (message, category, destination) => { * @returns */ const responseBuilderForRegisterDeviceOrBrowserTokenEvents = (message, destination) => { - const { device } = message.context; + const { device, os } = message.context; const category = device?.token ? ConfigCategory.IDENTIFY_DEVICE : ConfigCategory.IDENTIFY_BROWSER; - const response = responseBuilder(message, category, destination); + + const categoryWithEndpoint = getCategoryWithEndpoint(category, destination.Config.dataCenter); + const response = responseBuilder(message, categoryWithEndpoint, destination); response.headers.api_key = destination.Config.registerDeviceOrBrowserApiKey; + logger.info('{{ITERABLE::}} registerDeviceApiCalled', { + destinationId: destination.ID, + token: MD5(device?.token || os?.token || 'no token'), + }); return response; }; diff --git a/src/v0/destinations/iterable/util.js b/src/v0/destinations/iterable/util.js index 764d76f8825..34ee1237598 100644 --- a/src/v0/destinations/iterable/util.js +++ b/src/v0/destinations/iterable/util.js @@ -69,6 +69,11 @@ const validateMandatoryField = (payload) => { } }; +const getCategoryWithEndpoint = (categoryConfig, dataCenter) => ({ + ...categoryConfig, + endpoint: constructEndpoint(dataCenter, categoryConfig), +}); + /** * Check for register device and register browser events * @param {*} message @@ -80,18 +85,13 @@ const hasMultipleResponses = (message, category, config) => { const { context } = message; const isIdentifyEvent = message.type === EventType.IDENTIFY; - const isIdentifyCategory = category === ConfigCategory.IDENTIFY; - const hasToken = context && (context.device?.token || context.os?.token); + const isIdentifyCategory = category.action === ConfigCategory.IDENTIFY.action; + const hasToken = Boolean(context && (context.device?.token || context.os?.token)); const hasRegisterDeviceOrBrowserKey = Boolean(config.registerDeviceOrBrowserApiKey); return isIdentifyEvent && isIdentifyCategory && hasToken && hasRegisterDeviceOrBrowserKey; }; -const getCategoryWithEndpoint = (categoryConfig, dataCenter) => ({ - ...categoryConfig, - endpoint: constructEndpoint(dataCenter, categoryConfig), -}); - /** * Returns category value * @param {*} message diff --git a/src/v0/destinations/iterable/util.test.js b/src/v0/destinations/iterable/util.test.js index 6bbf00ba085..8189a5b1f29 100644 --- a/src/v0/destinations/iterable/util.test.js +++ b/src/v0/destinations/iterable/util.test.js @@ -7,6 +7,8 @@ const { updateUserEventPayloadBuilder, registerDeviceTokenEventPayloadBuilder, registerBrowserTokenEventPayloadBuilder, + hasMultipleResponses, + getCategoryWithEndpoint, } = require('./util'); const { ConfigCategory } = require('./config'); @@ -798,4 +800,93 @@ describe('iterable utils test', () => { ); }); }); + describe('Unit test cases for iterable hasMultipleResponses', () => { + it('should return false when message type is not identify', () => { + const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); + const message = { + type: 'track', + context: { + device: { token: '123' }, + os: { token: '456' }, + }, + }; + const config = { registerDeviceOrBrowserApiKey: 'test-key' }; + + expect(hasMultipleResponses(message, category, config)).toBe(false); + }); + + it('should return false when category is not identify', () => { + const category = getCategoryWithEndpoint(ConfigCategory.PAGE, 'USDC'); + const message = { + type: 'identify', + context: { + device: { token: '123' }, + os: { token: '456' }, + }, + }; + const config = { registerDeviceOrBrowserApiKey: 'test-key' }; + + expect(hasMultipleResponses(message, category, config)).toBe(false); + }); + + it('should return false when no device/os token present', () => { + const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); + const message = { + type: 'identify', + context: { + device: {}, + os: {}, + }, + }; + const config = { registerDeviceOrBrowserApiKey: 'test-key' }; + + expect(hasMultipleResponses(message, category, config)).toBe(false); + }); + + it('should return false when registerDeviceOrBrowserApiKey not present in config', () => { + const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); + const message = { + type: 'identify', + context: { + device: { token: '123' }, + os: { token: '456' }, + }, + }; + const config = {}; + + expect(hasMultipleResponses(message, category, config)).toBe(false); + }); + + it('should return true when all conditions are met with device token', () => { + const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); + const message = { + type: 'identify', + context: { + device: { token: '123' }, + }, + }; + const config = { + dataCenter: '123', + registerDeviceOrBrowserApiKey: 'test-key', + }; + + expect(hasMultipleResponses(message, category, config)).toBe(true); + }); + + it('should return true when all conditions are met with os token', () => { + const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); + const message = { + type: 'identify', + context: { + os: { token: '456' }, + }, + }; + const config = { + dataCenter: '123', + registerDeviceOrBrowserApiKey: 'test-key', + }; + + expect(hasMultipleResponses(message, category, config)).toBe(true); + }); + }); }); diff --git a/test/integrations/destinations/iterable/processor/identifyTestData.ts b/test/integrations/destinations/iterable/processor/identifyTestData.ts index 792e16566c7..606a0de3103 100644 --- a/test/integrations/destinations/iterable/processor/identifyTestData.ts +++ b/test/integrations/destinations/iterable/processor/identifyTestData.ts @@ -36,6 +36,163 @@ const baseMetadata: Metadata = { }; export const identifyTestData: ProcessorTestData[] = [ + { + id: 'iterable-identify-test-has-multiple-responses', + name: 'iterable', + description: 'Indentify call to verify hasMultipleResponses', + scenario: 'Business', + successCriteria: + 'Response should contain status code 200 and it should contain update user payload with new email sent in payload', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', + context: { + os: { + name: '', + version: '1.12.3', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + token: 'token', + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '62amo6xzksaeyupr4y0pfaucwj0upzs6g7yx', + messageId: 'hk02avz2xijdkid4i0mvncbm478g9lybdpgc', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'randomApiKey', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.iterable.com/api/users/update', + headers: { + api_key: 'testApiKey', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + email: 'ruchira@rudderlabs.com', + userId: 'userId', + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + preferUserId: false, + mergeNestedObjects: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: baseMetadata, + statusCode: 200, + }, + { + output: { + body: { + FORM: {}, + JSON: { + device: { + platform: 'APNS', + token: 'token', + }, + email: 'ruchira@rudderlabs.com', + preferUserId: false, + userId: 'userId', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.iterable.com/api/users/registerDeviceToken', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: 'randomApiKey', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, { id: 'iterable-identify-test-1', name: 'iterable', From ad65eeb4e4a1135f1a791c0ea495fbca50071df3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 24 Jan 2025 07:28:49 +0000 Subject: [PATCH 046/160] chore(release): 1.88.3 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52e5a452c8e..89e496ad8b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.88.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.2...v1.88.3) (2025-01-24) + + +### Bug Fixes + +* iterable device token registration api issues ([#4013](https://github.com/rudderlabs/rudder-transformer/issues/4013)) ([a986138](https://github.com/rudderlabs/rudder-transformer/commit/a986138d43d2cabcaa597b70fa7871b383cb1427)) + ### [1.88.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.1...v1.88.2) (2025-01-22) diff --git a/package-lock.json b/package-lock.json index 63074987e06..61fdfb9a63b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.88.2", + "version": "1.88.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.88.2", + "version": "1.88.3", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 0d16d5feae6..4485d386e80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.88.2", + "version": "1.88.3", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 1fc15bfd4b88e0b252c780a278376cea4c594057 Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Fri, 24 Jan 2025 13:22:35 +0530 Subject: [PATCH 047/160] feat: add support for form format (#4000) * feat(http): add support for form format * feat(http): updated form support logic * feat(http): adding namespace tag for xml * chore: addressed review comments * feat: remove template support for apiUrl. Only pathParams is valid * chore: updated regex to resolve sonal issue * chore: updated regex to resolve sonal issue * chore: updated regex to resolve sonal issue * chore: updated regex to resolve sonal issue --- .../v2/destinations/http/procWorkflow.yaml | 12 +- src/cdk/v2/destinations/http/utils.js | 90 ++++----- src/cdk/v2/destinations/http/utils.test.js | 41 +++-- test/integrations/destinations/http/common.ts | 171 +++++++++++++++++- .../http/processor/configuration.ts | 161 ++++++++++++++++- .../destinations/http/router/data.ts | 2 +- 6 files changed, 393 insertions(+), 84 deletions(-) diff --git a/src/cdk/v2/destinations/http/procWorkflow.yaml b/src/cdk/v2/destinations/http/procWorkflow.yaml index e8696eb7a76..57483f31831 100644 --- a/src/cdk/v2/destinations/http/procWorkflow.yaml +++ b/src/cdk/v2/destinations/http/procWorkflow.yaml @@ -30,7 +30,8 @@ steps: - name: deduceBodyFormat template: | - $.context.format = .destination.Config.format ?? 'JSON'; + const format = .destination.Config.format ?? 'JSON'; + $.context.format = $.CONTENT_TYPES_MAP[format]; - name: buildHeaders template: | @@ -45,8 +46,8 @@ steps: - name: prepareParams template: | - const params = $.getCustomMappings(.message, .destination.Config.queryParams) - $.context.params = $.encodeParamsObject(params) + const params = $.getCustomMappings(.message, .destination.Config.queryParams); + $.context.params = $.encodeParamsObject(params); - name: deduceEndPoint template: | @@ -55,13 +56,12 @@ steps: - name: prepareBody template: | const payload = $.getCustomMappings(.message, .destination.Config.propertiesMapping); - $.context.payload = $.excludeMappedFields(payload, .destination.Config.propertiesMapping) - $.context.format === "XML" && !$.isEmptyObject($.context.payload) ? $.context.payload = {payload: $.getXMLPayload($.context.payload)} : $.context.payload = $.removeUndefinedAndNullValues($.context.payload) + $.context.payload = $.prepareBody(payload, $.context.format); - name: buildResponseForProcessTransformation template: | const response = $.defaultRequestConfig(); - $.context.format === "JSON" ? response.body.JSON = $.context.payload: response.body.XML = $.context.payload; + response.body[$.context.format] = $.context.payload; response.endpoint = $.context.endpoint; response.headers = $.context.headers; response.method = $.context.method; diff --git a/src/cdk/v2/destinations/http/utils.js b/src/cdk/v2/destinations/http/utils.js index 6e53bbdc2f8..613e19d4531 100644 --- a/src/cdk/v2/destinations/http/utils.js +++ b/src/cdk/v2/destinations/http/utils.js @@ -8,9 +8,15 @@ const { base64Convertor, applyCustomMappings, isEmptyObject, - applyJSONStringTemplate, + removeUndefinedAndNullValues, } = require('../../../../v0/util'); +const CONTENT_TYPES_MAP = { + JSON: 'JSON', + XML: 'XML', + FORM: 'FORM', +}; + const getAuthHeaders = (config) => { let headers; switch (config.auth) { @@ -85,49 +91,14 @@ const getPathParamsSubString = (message, pathParamsArray) => { }; const prepareEndpoint = (message, apiUrl, pathParams) => { - let requestUrl; - try { - requestUrl = applyJSONStringTemplate(message, `\`${apiUrl}\``); - } catch (e) { - throw new ConfigurationError(`Error in api url template: ${e.message}`); - } if (!Array.isArray(pathParams)) { - return requestUrl; + return apiUrl; } + const requestUrl = apiUrl.replace(/\/{1,10}$/, ''); const pathParamsSubString = getPathParamsSubString(message, pathParams); return `${requestUrl}${pathParamsSubString}`; }; -const excludeMappedFields = (payload, mapping) => { - const rawPayload = { ...payload }; - if (mapping) { - mapping.forEach(({ from, to }) => { - // continue when from === to - if (from === to) return; - - // Remove the '$.' prefix and split the remaining string by '.' - const keys = from.replace(/^\$\./, '').split('.'); - let current = rawPayload; - - // Traverse to the parent of the key to be removed - keys.slice(0, -1).forEach((key) => { - if (current?.[key]) { - current = current[key]; - } else { - current = null; - } - }); - - if (current) { - // Remove the 'from' field from input payload - delete current[keys[keys.length - 1]]; - } - }); - } - - return rawPayload; -}; - const sanitizeKey = (key) => key .replace(/[^\w.-]/g, '_') // Replace invalid characters with underscores @@ -157,9 +128,20 @@ const getXMLPayload = (payload) => { const builderOptions = { ignoreAttributes: false, // Include attributes if they exist suppressEmptyNode: false, // Ensures that null or undefined values are not omitted + attributeNamePrefix: '@_', }; + + if (Object.keys(payload).length !== 1) { + throw new ConfigurationError( + `Error: XML supports only one root key. Please update request body mappings accordingly`, + ); + } + const rootKey = Object.keys(payload)[0]; + const builder = new XMLBuilder(builderOptions); - return `${builder.build(preprocessJson(payload))}`; + const processesPayload = preprocessJson(payload); + processesPayload[rootKey]['@_xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance'; + return `${builder.build(processesPayload)}`; }; const getMergedEvents = (batch) => { @@ -172,10 +154,28 @@ const getMergedEvents = (batch) => { return events; }; -const metadataHeaders = (contentType) => - contentType === 'JSON' - ? { 'Content-Type': 'application/json' } - : { 'Content-Type': 'application/xml' }; +const metadataHeaders = (contentType) => { + switch (contentType) { + case CONTENT_TYPES_MAP.XML: + return { 'Content-Type': 'application/xml' }; + case CONTENT_TYPES_MAP.FORM: + return { 'Content-Type': 'application/x-www-form-urlencoded' }; + default: + return { 'Content-Type': 'application/json' }; + } +}; + +const prepareBody = (payload, contentType) => { + let responseBody; + if (contentType === CONTENT_TYPES_MAP.XML && !isEmptyObject(payload)) { + responseBody = { + payload: getXMLPayload(payload), + }; + } else { + responseBody = removeUndefinedAndNullValues(payload); + } + return responseBody; +}; const mergeMetadata = (batch) => batch.map((event) => event.metadata[0]); @@ -230,12 +230,12 @@ const batchSuccessfulEvents = (events, batchSize) => { }; module.exports = { + CONTENT_TYPES_MAP, getAuthHeaders, getCustomMappings, encodeParamsObject, prepareEndpoint, - excludeMappedFields, - getXMLPayload, metadataHeaders, + prepareBody, batchSuccessfulEvents, }; diff --git a/src/cdk/v2/destinations/http/utils.test.js b/src/cdk/v2/destinations/http/utils.test.js index cf8e875974c..64fc87b66b4 100644 --- a/src/cdk/v2/destinations/http/utils.test.js +++ b/src/cdk/v2/destinations/http/utils.test.js @@ -1,4 +1,4 @@ -const { encodeParamsObject, prepareEndpoint, getXMLPayload } = require('./utils'); +const { encodeParamsObject, prepareEndpoint, prepareBody } = require('./utils'); const { XMLBuilder } = require('fast-xml-parser'); const jsonpath = require('rs-jsonpath'); @@ -21,12 +21,12 @@ describe('Utils Functions', () => { describe('prepareEndpoint', () => { test('should replace template variables in API URL', () => { const message = { id: 123 }; - const apiUrl = 'https://api.example.com/resource/${$.id}'; - expect(prepareEndpoint(message, apiUrl, [])).toBe('https://api.example.com/resource/123'); + const apiUrl = 'https://api.example.com/resource/'; + expect(prepareEndpoint(message, apiUrl, [])).toBe('https://api.example.com/resource'); }); test('should replace template variables in API URL and add path params', () => { const message = { id: 123, p2: 'P2' }; - const apiUrl = 'https://api.example.com/resource/${$.id}'; + const apiUrl = 'https://api.example.com/resource/'; const pathParams = [ { path: 'p1', @@ -36,12 +36,12 @@ describe('Utils Functions', () => { }, ]; expect(prepareEndpoint(message, apiUrl, pathParams)).toBe( - 'https://api.example.com/resource/123/p1/P2', + 'https://api.example.com/resource/p1/P2', ); }); test('should add path params after uri encoding', () => { const message = { id: 123, p2: 'P2%&' }; - const apiUrl = 'https://api.example.com/resource/${$.id}'; + const apiUrl = 'https://api.example.com/resource/'; const pathParams = [ { path: 'p1', @@ -51,7 +51,7 @@ describe('Utils Functions', () => { }, ]; expect(prepareEndpoint(message, apiUrl, pathParams)).toBe( - 'https://api.example.com/resource/123/p1/P2%25%26', + 'https://api.example.com/resource/p1/P2%25%26', ); }); test('should throw error as path contains slash', () => { @@ -71,12 +71,27 @@ describe('Utils Functions', () => { }); }); - describe('getXMLPayload', () => { - test('should generate XML payload with correct structure', () => { - const payload = { key: null }; - const expectedXML = ''; - const result = getXMLPayload(payload); - expect(result).toBe(expectedXML); + describe('prepareBody', () => { + test('should prepare XML payload when content type is XML', () => { + const payload = { root: { key: 'value', key2: null } }; + const expectedXML = + 'value'; + const result = prepareBody(payload, 'XML'); + expect(result).toEqual({ payload: expectedXML }); + }); + + test('should prepare FORM-URLENCODED payload when content type is FORM-URLENCODED', () => { + const payload = { key1: 'value1', key2: 'value2' }; + const expectedFORM = { key1: 'value1', key2: 'value2' }; + const result = prepareBody(payload, 'FORM-URLENCODED'); + expect(result).toEqual(expectedFORM); + }); + + test('should return original payload without null or undefined values for other content types', () => { + const payload = { key1: 'value1', key2: null, key3: undefined, key4: 'value4' }; + const expected = { key1: 'value1', key4: 'value4' }; + const result = prepareBody(payload, 'JSON'); + expect(result).toEqual(expected); }); }); }); diff --git a/test/integrations/destinations/http/common.ts b/test/integrations/destinations/http/common.ts index 8f4ca5d048f..4dc9d4daf27 100644 --- a/test/integrations/destinations/http/common.ts +++ b/test/integrations/destinations/http/common.ts @@ -92,13 +92,18 @@ const destinations: Destination[] = [ }, { Config: { - apiUrl: 'http://abc.com/contacts/{{$.traits.email}}/', + apiUrl: 'http://abc.com/contacts/', auth: 'apiKeyAuth', apiKeyName: 'x-api-key', apiKeyValue: 'test-api-key', method: 'DELETE', isBatchingEnabled: true, maxBatchSize: 4, + pathParams: [ + { + path: '$.traits.email', + }, + ], }, DestinationDefinition: { DisplayName: displayName, @@ -114,13 +119,18 @@ const destinations: Destination[] = [ }, { Config: { - apiUrl: 'http://abc.com/contacts/{{$.traits.email}}/', + apiUrl: 'http://abc.com/contacts/', auth: 'apiKeyAuth', apiKeyName: 'x-api-key', apiKeyValue: 'test-api-key', method: 'GET', isBatchingEnabled: true, maxBatchSize: 4, + pathParams: [ + { + path: '$.traits.email', + }, + ], }, DestinationDefinition: { DisplayName: displayName, @@ -158,27 +168,27 @@ const destinations: Destination[] = [ propertiesMapping: [ { from: '$.event', - to: '$.event', + to: '$.body.event', }, { from: '$.properties.currency', - to: '$.currency', + to: '$.body.currency', }, { from: '$.userId', - to: '$.userId', + to: '$.body.userId', }, { from: '$.properties.products[*].product_id', - to: '$.properties.items[*].item_id', + to: '$.body.properties.items[*].item_id', }, { from: '$.properties.products[*].name', - to: '$.properties.items[*].name', + to: '$.body.properties.items[*].name', }, { from: '$.properties.products[*].price', - to: '$.properties.items[*].price', + to: '$.body.properties.items[*].price', }, ], }, @@ -249,7 +259,7 @@ const destinations: Destination[] = [ }, { Config: { - apiUrl: 'http://abc.com/contacts/{{$.traits.phone}}', + apiUrl: 'http://abc.com/contacts/', auth: 'noAuth', method: 'POST', format: 'JSON', @@ -265,6 +275,11 @@ const destinations: Destination[] = [ from: '.traits.key', }, ], + pathParams: [ + { + path: '$.traits.phone', + }, + ], }, DestinationDefinition: { DisplayName: displayName, @@ -436,6 +451,142 @@ const destinations: Destination[] = [ Transformations: [], WorkspaceID: 'test-workspace-id', }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: 'test-token', + method: 'POST', + format: 'FORM', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + { + to: "$.'content-type'", + from: "'application/json'", + }, + ], + propertiesMapping: [ + { + from: '$.event', + to: '$.event', + }, + { + from: '$.properties.currency', + to: '$.currency', + }, + { + from: '$.userId', + to: '$.userId', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: 'test-token', + method: 'POST', + format: 'FORM', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + ], + propertiesMapping: [ + { + from: '$.event', + to: '$.event', + }, + { + from: '$.properties.currency', + to: '$.currency', + }, + { + from: '$.userId', + to: '$.userId', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, + { + Config: { + apiUrl: 'http://abc.com/events', + auth: 'bearerTokenAuth', + bearerToken: 'test-token', + method: 'POST', + format: 'FORM', + headers: [ + { + to: '$.h1', + from: "'val1'", + }, + { + to: '$.h2', + from: '$.key1', + }, + ], + propertiesMapping: [ + { + from: '$.event', + to: '$.event', + }, + { + from: '$.properties.currency', + to: '$.currency', + }, + { + from: '$.userId', + to: '$.userId', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, ]; const traits = { @@ -487,7 +638,7 @@ const properties = { const processorInstrumentationErrorStatTags = { destType: destTypeInUpperCase, errorCategory: 'dataValidation', - errorType: 'instrumentation', + errorType: 'configuration', feature: 'processor', implementation: 'cdkV2', module: 'destination', diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index e2793fa90c3..54673bbae28 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -98,7 +98,7 @@ export const configuration: ProcessorTestData[] = [ output: transformResultBuilder({ method: 'DELETE', userId: '', - endpoint: 'http://abc.com/contacts/john.doe@example.com/', + endpoint: 'http://abc.com/contacts/john.doe%40example.com', headers: { 'Content-Type': 'application/json', 'x-api-key': 'test-api-key', @@ -209,7 +209,7 @@ export const configuration: ProcessorTestData[] = [ }, XML: { payload: - 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', + 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', }, }), statusCode: 200, @@ -328,9 +328,9 @@ export const configuration: ProcessorTestData[] = [ { id: 'http-configuration-test-7', name: destType, - description: 'Track call with xml format and payload with special characters in keys', + description: 'Track call with xml format with multiple keys', scenario: 'Business', - successCriteria: 'Response should be in xml format with the special characters handled', + successCriteria: 'Should throw error as the body have multiple root keys', feature: 'processor', module: 'destination', version: 'v0', @@ -355,6 +355,49 @@ export const configuration: ProcessorTestData[] = [ method: 'POST', }, }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Error: XML supports only one root key. Please update request body mappings accordingly: Workflow: procWorkflow, Step: prepareBody, ChildStep: undefined, OriginalError: Error: XML supports only one root key. Please update request body mappings accordingly', + statusCode: 400, + metadata: generateMetadata(1), + statTags: { ...processorInstrumentationErrorStatTags }, + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-8', + name: destType, + description: + 'Track call with bearer token, form format, post method, additional headers and properties mapping', + scenario: 'Business', + successCriteria: + 'Response should be in form format with post method, headers and properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + destination: destinations[10], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + }, + }, output: { response: { status: 200, @@ -363,17 +406,117 @@ export const configuration: ProcessorTestData[] = [ output: transformResultBuilder({ method: 'POST', userId: '', - endpoint: destinations[9].Config.apiUrl, + endpoint: destinations[10].Config.apiUrl, headers: { - 'Content-Type': 'application/xml', + 'Content-Type': 'application/x-www-form-urlencoded', Authorization: 'Bearer test-token', h1: 'val1', 'content-type': 'application/json', }, - XML: { - payload: - 'Rubik's Cube<_revenue-wdfqwe_>4.99', + FORM: { + currency: 'USD', + event: 'Order Completed', + userId: 'userId123', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-9', + name: destType, + description: 'Track call with bearer token, form url encoded format', + scenario: 'Business', + successCriteria: + 'Response should be in form format with post method, headers and properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + destination: destinations[11], + message: { + type: 'track', + userId: 'userId123', + event: 'Order Completed', + properties, + }, + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[11].Config.apiUrl, + headers: { + Authorization: 'Bearer test-token', + h1: 'val1', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + FORM: { + currency: 'USD', + event: 'Order Completed', + userId: 'userId123', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, + { + id: 'http-configuration-test-10', + name: destType, + description: 'empty body', + scenario: 'Business', + successCriteria: + 'Response should be in form format with post method, headers and properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + destination: destinations[12], + message: {}, + metadata: generateMetadata(1), + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[12].Config.apiUrl, + headers: { + Authorization: 'Bearer test-token', + h1: 'val1', + 'Content-Type': 'application/x-www-form-urlencoded', }, + FORM: {}, }), statusCode: 200, metadata: generateMetadata(1), diff --git a/test/integrations/destinations/http/router/data.ts b/test/integrations/destinations/http/router/data.ts index 284a80f1090..8fd3a1584cf 100644 --- a/test/integrations/destinations/http/router/data.ts +++ b/test/integrations/destinations/http/router/data.ts @@ -182,7 +182,7 @@ export const data = [ version: '1', type: 'REST', method: 'GET', - endpoint: 'http://abc.com/contacts/john.doe@example.com/', + endpoint: 'http://abc.com/contacts/john.doe%40example.com', headers: { 'x-api-key': 'test-api-key', 'Content-Type': 'application/json', From eac2a2f303dc9dc802f431ac5656138764d98048 Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Fri, 24 Jan 2025 17:27:54 +0530 Subject: [PATCH 048/160] chore: add execution stats header to the ut response (#3882) * chore: added support for stats calculation middleware on the endpoint customTransform * chore: updated the default values * chore: removed lint errors and unused logs --- src/middlewares/stats.ts | 15 +++++++++++++++ src/routes/userTransform.ts | 6 ++++-- src/util/cluster.js | 5 ++++- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 src/middlewares/stats.ts diff --git a/src/middlewares/stats.ts b/src/middlewares/stats.ts new file mode 100644 index 00000000000..6fe0cc1c2cd --- /dev/null +++ b/src/middlewares/stats.ts @@ -0,0 +1,15 @@ +import { Context, Next } from 'koa'; + +export class StatsMiddleware { + private static instanceID: string = process.env.INSTANCE_ID || 'default'; + + private static workerID: string = process.env.WORKER_ID || 'master'; + + public static async executionStats(ctx: Context, next: Next) { + const start = Date.now(); + await next(); + const ms = Date.now() - start; + ctx.set('X-Response-Time', `${ms}ms`); + ctx.set('X-Instance-ID', `${StatsMiddleware.instanceID}/${StatsMiddleware.workerID}`); + } +} diff --git a/src/routes/userTransform.ts b/src/routes/userTransform.ts index fc61ab7b941..e2883bdc22f 100644 --- a/src/routes/userTransform.ts +++ b/src/routes/userTransform.ts @@ -1,7 +1,8 @@ import Router from '@koa/router'; -import { RouteActivationMiddleware } from '../middlewares/routeActivation'; -import { FeatureFlagMiddleware } from '../middlewares/featureFlag'; import { UserTransformController } from '../controllers/userTransform'; +import { FeatureFlagMiddleware } from '../middlewares/featureFlag'; +import { RouteActivationMiddleware } from '../middlewares/routeActivation'; +import { StatsMiddleware } from '../middlewares/stats'; const router = new Router(); @@ -15,6 +16,7 @@ router.post( '/customTransform', RouteActivationMiddleware.isUserTransformRouteActive, FeatureFlagMiddleware.handle, + StatsMiddleware.executionStats, UserTransformController.transform, ); router.post( diff --git a/src/util/cluster.js b/src/util/cluster.js index b9b86cd3c61..6be25018f1d 100644 --- a/src/util/cluster.js +++ b/src/util/cluster.js @@ -28,6 +28,7 @@ async function shutdownWorkers() { } function start(port, app, metricsApp) { + if (cluster.isMaster) { logger.info(`Master (pid: ${process.pid}) has started`); @@ -44,7 +45,9 @@ function start(port, app, metricsApp) { // Fork workers. for (let i = 0; i < numWorkers; i += 1) { - cluster.fork(); + cluster.fork({ + WORKER_ID: `worker-${i + 1}`, + }); } cluster.on('online', (worker) => { From 2eab46557743702a834597d0d0267a17e561516d Mon Sep 17 00:00:00 2001 From: Sankeerth Date: Mon, 27 Jan 2025 12:32:40 +0530 Subject: [PATCH 049/160] fix: add mappings to mp event (#3997) * fix: add mappings to mp event * fix: router tests * chore: merge conflit fix --------- Co-authored-by: Sai Sankeerth --- .../mp/data/MPEventPropertiesConfig.json | 4 ++-- .../destinations/mp/processor/data.ts | 24 +++++++++---------- .../destinations/mp/router/data.ts | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/v0/destinations/mp/data/MPEventPropertiesConfig.json b/src/v0/destinations/mp/data/MPEventPropertiesConfig.json index 956b60248eb..bed246bc7be 100644 --- a/src/v0/destinations/mp/data/MPEventPropertiesConfig.json +++ b/src/v0/destinations/mp/data/MPEventPropertiesConfig.json @@ -76,11 +76,11 @@ "destKey": "mp_lib" }, { - "sourceKeys": "context.page.initialReferrer", + "sourceKeys": ["context.page.initialReferrer", "context.page.initial_referrer"], "destKey": "$initial_referrer" }, { - "sourceKeys": "context.page.initialReferringDomain", + "sourceKeys": ["context.page.initialReferringDomain", "context.page.initial_referring_domain"], "destKey": "$initial_referring_domain" }, { diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index d13cf64cae2..9c385daee4b 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -97,7 +97,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","campaign_id":"test_name","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","campaign_id":"test_name","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -204,7 +204,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"Viewed a Contact Us page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us","category":"Contact","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"Viewed a Contact Us page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us","category":"Contact","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -726,7 +726,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":45.89,"counter":1,"item_purchased":"2","number_of_logins":"","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","campaign_id":"test_name","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342403,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":45.89,"counter":1,"item_purchased":"2","number_of_logins":"","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","campaign_id":"test_name","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342403,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -979,7 +979,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -1138,7 +1138,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","revenue":34,"key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","first_name":"Mickey","lastName":"Mouse","name":"Mickey Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","revenue":34,"key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","first_name":"Mickey","lastName":"Mouse","name":"Mickey Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -1272,7 +1272,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":" new Order Completed totally","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":" new Order Completed totally","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -1406,7 +1406,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":" Order Completed ","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"Billing Amount":"77","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":" Order Completed ","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"Billing Amount":"77","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -2077,7 +2077,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstname":"Mickey","lastname":"Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstname":"Mickey","lastname":"Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -2374,7 +2374,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"Loaded a Page","properties":{"path":"/tests/html/index2.html","referrer":"","search":"","title":"","url":"http://localhost/tests/html/index2.html","category":"communication","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"Loaded a Page","properties":{"path":"/tests/html/index2.html","referrer":"","search":"","title":"","url":"http://localhost/tests/html/index2.html","category":"communication","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -3558,7 +3558,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","anonymousId":"ea776ad0-3136-44fb-9216-5b1578609a2b","userId":"as09sufa09usaf09as0f9uasf","id":"as09sufa09usaf09as0f9uasf","firstName":"Bob","lastName":"Marley","name":"Bob Marley","age":43,"email":"bob@marleymail.com","phone":"+447748544123","birthday":"1987-01-01T20:08:59+0000","createdAt":"2022-01-21T14:10:12+0000","address":"51,B.L.T road, Kolkata-700060","description":"I am great","gender":"male","title":"Founder","username":"bobm","website":"https://bobm.com","randomProperty":"randomValue","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', + '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","anonymousId":"ea776ad0-3136-44fb-9216-5b1578609a2b","userId":"as09sufa09usaf09as0f9uasf","id":"as09sufa09usaf09as0f9uasf","firstName":"Bob","lastName":"Marley","name":"Bob Marley","age":43,"email":"bob@marleymail.com","phone":"+447748544123","birthday":"1987-01-01T20:08:59+0000","createdAt":"2022-01-21T14:10:12+0000","address":"51,B.L.T road, Kolkata-700060","description":"I am great","gender":"male","title":"Founder","username":"bobm","website":"https://bobm.com","randomProperty":"randomValue","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"http://127.0.0.1:7307/Testing/","$initial_referring_domain":"127.0.0.1:7307","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', }, XML: {}, FORM: {}, @@ -5174,7 +5174,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":18.9,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$user_id":"userId01","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"userId01","time":1579847342403,"$device_id":"anonId01","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":18.9,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$user_id":"userId01","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"userId01","time":1579847342403,"$device_id":"anonId01","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -5281,7 +5281,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"$device:anonId01","time":1579847342402,"$device_id":"anonId01","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"$device:anonId01","time":1579847342402,"$device_id":"anonId01","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/mp/router/data.ts b/test/integrations/destinations/mp/router/data.ts index 8716c9daa09..67f4d006c28 100644 --- a/test/integrations/destinations/mp/router/data.ts +++ b/test/integrations/destinations/mp/router/data.ts @@ -450,7 +450,7 @@ export const data = [ JSON_ARRAY: {}, GZIP: { payload: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, @@ -1173,7 +1173,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', }, XML: {}, FORM: {}, From 76af6651e3dbe63f0906e77426ead7b0cf6361fc Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 27 Jan 2025 14:06:30 +0000 Subject: [PATCH 050/160] chore(release): 1.89.0 --- CHANGELOG.md | 18 ++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89e496ad8b8..f150d914da6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ 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.89.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.3...v1.89.0) (2025-01-27) + + +### Features + +* add DATA WAREHOUSE to integrations object in shopify pixel source ([#3980](https://github.com/rudderlabs/rudder-transformer/issues/3980)) ([3c20393](https://github.com/rudderlabs/rudder-transformer/commit/3c20393a0e4e3ec98d316820d187310bfec1faea)), closes [#3973](https://github.com/rudderlabs/rudder-transformer/issues/3973) [#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957) [#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957) +* add redis support in shopify pixel for id stitching ([#4001](https://github.com/rudderlabs/rudder-transformer/issues/4001)) ([23ad10a](https://github.com/rudderlabs/rudder-transformer/commit/23ad10a4bd470f09a75e9230d8c860b703a5a1f9)), closes [#3957](https://github.com/rudderlabs/rudder-transformer/issues/3957) +* add support for form format ([#4000](https://github.com/rudderlabs/rudder-transformer/issues/4000)) ([1fc15bf](https://github.com/rudderlabs/rudder-transformer/commit/1fc15bfd4b88e0b252c780a278376cea4c594057)) +* **http:** resolves bug fixes raised during testing ([#3991](https://github.com/rudderlabs/rudder-transformer/issues/3991)) ([a86f009](https://github.com/rudderlabs/rudder-transformer/commit/a86f0094cbef9428e7aeda4965b580f29c89f706)) + + +### Bug Fixes + +* add mappings to mp event ([#3997](https://github.com/rudderlabs/rudder-transformer/issues/3997)) ([2eab465](https://github.com/rudderlabs/rudder-transformer/commit/2eab46557743702a834597d0d0267a17e561516d)) +* sonar issues in adobe analytics ([#3999](https://github.com/rudderlabs/rudder-transformer/issues/3999)) ([d74c4ab](https://github.com/rudderlabs/rudder-transformer/commit/d74c4ab7ef582eb83d67c4b295aa5d3845c15166)) +* sonar issues in user transformations static lookup ([#3998](https://github.com/rudderlabs/rudder-transformer/issues/3998)) ([a7d6b8f](https://github.com/rudderlabs/rudder-transformer/commit/a7d6b8fca8681d2eb3bf1751bf7855a7cc220d3b)) +* sonar issues in various components ([#4006](https://github.com/rudderlabs/rudder-transformer/issues/4006)) ([454451d](https://github.com/rudderlabs/rudder-transformer/commit/454451dba3260a3664088e2bb009fd8a11cbf957)) + ### [1.88.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.2...v1.88.3) (2025-01-24) diff --git a/package-lock.json b/package-lock.json index f5663895418..0a5bf4db982 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.88.3", + "version": "1.89.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.88.3", + "version": "1.89.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 9d12ee33cb7..460c0801a8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.88.3", + "version": "1.89.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From d00367691400402011d624c5b993d0f152191edd Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Wed, 29 Jan 2025 12:36:55 +0530 Subject: [PATCH 051/160] fix: extend statuscode check to 502 to retry the request (#4029) Co-authored-by: Vinay Teki --- src/util/openfaas/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/openfaas/index.js b/src/util/openfaas/index.js index 98f3340cad8..ec3604f066f 100644 --- a/src/util/openfaas/index.js +++ b/src/util/openfaas/index.js @@ -401,7 +401,7 @@ const executeFaasFunction = async ( throw new RetryRequestError(`Rate limit exceeded for ${name}`); } - if (error.statusCode === 500 || error.statusCode === 503) { + if (error.statusCode === 500 || error.statusCode === 503 || error.statusCode === 502) { throw new RetryRequestError(error.message); } From 8e4d9bfa5aecd6cb31ad3b8756a1ff30bac373f9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 29 Jan 2025 07:29:09 +0000 Subject: [PATCH 052/160] chore(release): 1.89.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f150d914da6..a3660e96464 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.89.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.89.0...v1.89.1) (2025-01-29) + + +### Bug Fixes + +* extend statuscode check to 502 to retry the request ([#4029](https://github.com/rudderlabs/rudder-transformer/issues/4029)) ([d003676](https://github.com/rudderlabs/rudder-transformer/commit/d00367691400402011d624c5b993d0f152191edd)) + ## [1.89.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.3...v1.89.0) (2025-01-27) diff --git a/package-lock.json b/package-lock.json index 0a5bf4db982..9b3edc7a0a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.89.0", + "version": "1.89.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.89.0", + "version": "1.89.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 460c0801a8e..2b09250116b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.89.0", + "version": "1.89.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 241250d10e1d8cb904ec188312e1ec5532379e93 Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Wed, 29 Jan 2025 20:12:20 +0530 Subject: [PATCH 053/160] feat(http): minor bug fixes and enhancements related to XML and FORM formats (#4022) * feat(http): now using xmlRootKey from dest config while building XML payload * feat(http): updated processBody logic to handle nested null values * feat(http): update tests * feat(http): update tests * feat(http): updated json-template-engine version to 0.19.5 * chore: addressed review comments * chore: addressed review comments --- package-lock.json | 8 +-- package.json | 2 +- .../v2/destinations/http/procWorkflow.yaml | 2 +- src/cdk/v2/destinations/http/utils.js | 44 ++++++++-------- src/cdk/v2/destinations/http/utils.test.js | 51 +++++++++++++++---- test/integrations/destinations/http/common.ts | 48 ++++++++++++++--- .../http/processor/configuration.ts | 35 +++++++------ 7 files changed, 132 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a5bf4db982..1947e75a346 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", "@rudderstack/integrations-lib": "^0.2.13", - "@rudderstack/json-template-engine": "^0.19.4", + "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", "ajv": "^8.12.0", @@ -6768,9 +6768,9 @@ } }, "node_modules/@rudderstack/json-template-engine": { - "version": "0.19.4", - "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.19.4.tgz", - "integrity": "sha512-/RTQeHCTBPsQt1U4bok7HBFPcIlc+1cMHYx6qCRhgCS+uhCmN84F9GI7K/H3y4nrn1CHctaHvXCwplZZA60FTQ==" + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.19.5.tgz", + "integrity": "sha512-lA45cp8caboMECfNk/CXuP45hCx+W09mclEDiqqTQXilY1hdWp+r/zpcOBzFGZWSxIdrAp5cfhIYnUENx3XX5g==" }, "node_modules/@rudderstack/workflow-engine": { "version": "0.8.13", diff --git a/package.json b/package.json index 460c0801a8e..1ac0d037fcc 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", "@rudderstack/integrations-lib": "^0.2.13", - "@rudderstack/json-template-engine": "^0.19.4", + "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", "ajv": "^8.12.0", diff --git a/src/cdk/v2/destinations/http/procWorkflow.yaml b/src/cdk/v2/destinations/http/procWorkflow.yaml index 57483f31831..1db0fce1d72 100644 --- a/src/cdk/v2/destinations/http/procWorkflow.yaml +++ b/src/cdk/v2/destinations/http/procWorkflow.yaml @@ -56,7 +56,7 @@ steps: - name: prepareBody template: | const payload = $.getCustomMappings(.message, .destination.Config.propertiesMapping); - $.context.payload = $.prepareBody(payload, $.context.format); + $.context.payload = $.prepareBody(payload, $.context.format, .destination.Config.xmlRootKey); - name: buildResponseForProcessTransformation template: | diff --git a/src/cdk/v2/destinations/http/utils.js b/src/cdk/v2/destinations/http/utils.js index 613e19d4531..38308b687f7 100644 --- a/src/cdk/v2/destinations/http/utils.js +++ b/src/cdk/v2/destinations/http/utils.js @@ -8,7 +8,7 @@ const { base64Convertor, applyCustomMappings, isEmptyObject, - removeUndefinedAndNullValues, + removeUndefinedAndNullRecurse, } = require('../../../../v0/util'); const CONTENT_TYPES_MAP = { @@ -106,10 +106,6 @@ const sanitizeKey = (key) => const preprocessJson = (obj) => { if (typeof obj !== 'object' || obj === null) { - // Handle null values: add xsi:nil attribute - if (obj === null) { - return { '@_xsi:nil': 'true' }; - } return obj; // Return primitive values as is } @@ -124,23 +120,18 @@ const preprocessJson = (obj) => { }, {}); }; -const getXMLPayload = (payload) => { +const getXMLPayload = (payload, rootKey = 'root') => { const builderOptions = { - ignoreAttributes: false, // Include attributes if they exist - suppressEmptyNode: false, // Ensures that null or undefined values are not omitted - attributeNamePrefix: '@_', + ignoreAttributes: false, + suppressEmptyNode: true, }; - if (Object.keys(payload).length !== 1) { - throw new ConfigurationError( - `Error: XML supports only one root key. Please update request body mappings accordingly`, - ); - } - const rootKey = Object.keys(payload)[0]; - const builder = new XMLBuilder(builderOptions); - const processesPayload = preprocessJson(payload); - processesPayload[rootKey]['@_xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance'; + const processesPayload = { + [rootKey]: { + ...preprocessJson(payload), + }, + }; return `${builder.build(processesPayload)}`; }; @@ -165,14 +156,24 @@ const metadataHeaders = (contentType) => { } }; -const prepareBody = (payload, contentType) => { +function stringifyFirstLevelValues(obj) { + return Object.entries(obj).reduce((acc, [key, value]) => { + acc[key] = typeof value === 'string' ? value : JSON.stringify(value); + return acc; + }, {}); +} + +const prepareBody = (payload, contentType, xmlRootKey) => { let responseBody; + removeUndefinedAndNullRecurse(payload); if (contentType === CONTENT_TYPES_MAP.XML && !isEmptyObject(payload)) { responseBody = { - payload: getXMLPayload(payload), + payload: getXMLPayload(payload, xmlRootKey), }; + } else if (contentType === CONTENT_TYPES_MAP.FORM && !isEmptyObject(payload)) { + responseBody = stringifyFirstLevelValues(payload); } else { - responseBody = removeUndefinedAndNullValues(payload); + responseBody = payload || {}; } return responseBody; }; @@ -238,4 +239,5 @@ module.exports = { metadataHeaders, prepareBody, batchSuccessfulEvents, + stringifyFirstLevelValues, }; diff --git a/src/cdk/v2/destinations/http/utils.test.js b/src/cdk/v2/destinations/http/utils.test.js index 64fc87b66b4..bd4e9e05725 100644 --- a/src/cdk/v2/destinations/http/utils.test.js +++ b/src/cdk/v2/destinations/http/utils.test.js @@ -1,4 +1,9 @@ -const { encodeParamsObject, prepareEndpoint, prepareBody } = require('./utils'); +const { + encodeParamsObject, + prepareEndpoint, + prepareBody, + stringifyFirstLevelValues, +} = require('./utils'); const { XMLBuilder } = require('fast-xml-parser'); const jsonpath = require('rs-jsonpath'); @@ -73,25 +78,51 @@ describe('Utils Functions', () => { describe('prepareBody', () => { test('should prepare XML payload when content type is XML', () => { - const payload = { root: { key: 'value', key2: null } }; - const expectedXML = - 'value'; - const result = prepareBody(payload, 'XML'); + const payload = { key: 'value' }; + const expectedXML = 'value'; + const result = prepareBody(payload, 'XML', 'root'); expect(result).toEqual({ payload: expectedXML }); }); test('should prepare FORM-URLENCODED payload when content type is FORM-URLENCODED', () => { - const payload = { key1: 'value1', key2: 'value2' }; - const expectedFORM = { key1: 'value1', key2: 'value2' }; - const result = prepareBody(payload, 'FORM-URLENCODED'); + const payload = { + key1: 'value1', + key2: 'value2', + key3: { subKey: 'value3', subkey2: undefined }, + }; + const expectedFORM = { key1: 'value1', key2: 'value2', key3: '{"subKey":"value3"}' }; + const result = prepareBody(payload, 'FORM'); expect(result).toEqual(expectedFORM); }); test('should return original payload without null or undefined values for other content types', () => { - const payload = { key1: 'value1', key2: null, key3: undefined, key4: 'value4' }; - const expected = { key1: 'value1', key4: 'value4' }; + const payload = { + key1: 'value1', + key2: null, + key3: undefined, + key4: 'value4', + key5: { subKey1: undefined, subKey2: 'value5' }, + }; + const expected = { key1: 'value1', key4: 'value4', key5: { subKey2: 'value5' } }; const result = prepareBody(payload, 'JSON'); expect(result).toEqual(expected); }); }); + + describe('stringifyFirstLevelValues', () => { + test('converts non-string first-level values to strings', () => { + const input = { a: 1, b: true, c: { d: 42 } }; + const expected = { a: '1', b: 'true', c: '{"d":42}' }; + expect(stringifyFirstLevelValues(input)).toEqual(expected); + }); + + test('keeps string values unchanged', () => { + const input = { a: 'hello', b: 'world' }; + expect(stringifyFirstLevelValues(input)).toEqual(input); + }); + + test('handles empty objects', () => { + expect(stringifyFirstLevelValues({})).toEqual({}); + }); + }); }); diff --git a/test/integrations/destinations/http/common.ts b/test/integrations/destinations/http/common.ts index 4dc9d4daf27..455fa534df7 100644 --- a/test/integrations/destinations/http/common.ts +++ b/test/integrations/destinations/http/common.ts @@ -151,6 +151,7 @@ const destinations: Destination[] = [ bearerToken: 'test-token', method: 'POST', format: 'XML', + xmlRootKey: 'body', headers: [ { to: '$.h1', @@ -168,27 +169,27 @@ const destinations: Destination[] = [ propertiesMapping: [ { from: '$.event', - to: '$.body.event', + to: '$.event', }, { from: '$.properties.currency', - to: '$.body.currency', + to: '$.currency', }, { from: '$.userId', - to: '$.body.userId', + to: '$.userId', }, { from: '$.properties.products[*].product_id', - to: '$.body.properties.items[*].item_id', + to: '$.properties.items[*].item_id', }, { from: '$.properties.products[*].name', - to: '$.body.properties.items[*].name', + to: '$.properties.items[*].name', }, { from: '$.properties.products[*].price', - to: '$.body.properties.items[*].price', + to: '$.properties.items[*].price', }, ], }, @@ -587,6 +588,41 @@ const destinations: Destination[] = [ Transformations: [], WorkspaceID: 'test-workspace-id', }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'noAuth', + method: 'POST', + format: 'FORM', + isBatchingEnabled: true, + maxBatchSize: '2', + propertiesMapping: [ + { + from: '$.traits.firstName', + to: '$.contacts.first_name', + }, + { + from: '$.traits.email', + to: '$.contacts.email', + }, + { + from: '$.traits.address.pinCode', + to: '$.contacts.address.pin_code', + }, + ], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, ]; const traits = { diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index 54673bbae28..8c886b77933 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -209,7 +209,7 @@ export const configuration: ProcessorTestData[] = [ }, XML: { payload: - 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', + 'Order CompletedUSDuserId123622c6f5d5cf86a4c77358033Cones of Dunshire40577c6f5d5cf86a4c7735ba03Five Crowns5', }, }), statusCode: 200, @@ -328,9 +328,9 @@ export const configuration: ProcessorTestData[] = [ { id: 'http-configuration-test-7', name: destType, - description: 'Track call with xml format with multiple keys', + description: 'Identify call with properties mapping and form format with nested objects', scenario: 'Business', - successCriteria: 'Should throw error as the body have multiple root keys', + successCriteria: 'Response should be in form format with nested objects stringified', feature: 'processor', module: 'destination', version: 'v0', @@ -338,16 +338,12 @@ export const configuration: ProcessorTestData[] = [ request: { body: [ { - destination: destinations[9], + destination: destinations[13], message: { - type: 'track', + type: 'identify', userId: 'userId123', - event: 'Order Completed', - properties: { - name: "Rubik's Cube", - "1revenue-wdfqwe'": 4.99, - brand: null, - }, + anonymousId: 'anonId123', + traits, }, metadata: generateMetadata(1), }, @@ -360,11 +356,20 @@ export const configuration: ProcessorTestData[] = [ status: 200, body: [ { - error: - 'Error: XML supports only one root key. Please update request body mappings accordingly: Workflow: procWorkflow, Step: prepareBody, ChildStep: undefined, OriginalError: Error: XML supports only one root key. Please update request body mappings accordingly', - statusCode: 400, + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[13].Config.apiUrl, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + FORM: { + contacts: + '{"first_name":"John","email":"john.doe@example.com","address":{"pin_code":"123456"}}', + }, + }), + statusCode: 200, metadata: generateMetadata(1), - statTags: { ...processorInstrumentationErrorStatTags }, }, ], }, From 4cb1eb5e34abd44bd905869168987994f06c2586 Mon Sep 17 00:00:00 2001 From: Dhawal Sanghvi Date: Thu, 30 Jan 2025 13:35:49 +0530 Subject: [PATCH 054/160] chore: aggregate metrics in worker thread - fix typo --- src/util/worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/worker.js b/src/util/worker.js index d1b7b24d969..ce9597a35d4 100644 --- a/src/util/worker.js +++ b/src/util/worker.js @@ -4,7 +4,7 @@ const { MESSAGE_TYPES } = require('./metricsAggregator'); const { AggregatorRegistry } = require('prom-client'); parentPort.on('message', async (message) => { - if ((message.type = MESSAGE_TYPES.AGGREGATE_METRICS_REQ)) { + if ((message.type == MESSAGE_TYPES.AGGREGATE_METRICS_REQ)) { try { const promString = await AggregatorRegistry.aggregate(message.metrics).metrics(); parentPort.postMessage({ type: MESSAGE_TYPES.AGGREGATE_METRICS_RES, metrics: promString }); From 679117243f3ae4decd46e95ee6e6ecd39884c83f Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:37:17 +0530 Subject: [PATCH 055/160] chore: update src/util/worker.js --- src/util/worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/worker.js b/src/util/worker.js index ce9597a35d4..780dc92f67c 100644 --- a/src/util/worker.js +++ b/src/util/worker.js @@ -4,7 +4,7 @@ const { MESSAGE_TYPES } = require('./metricsAggregator'); const { AggregatorRegistry } = require('prom-client'); parentPort.on('message', async (message) => { - if ((message.type == MESSAGE_TYPES.AGGREGATE_METRICS_REQ)) { + if (message.type == MESSAGE_TYPES.AGGREGATE_METRICS_REQ) { try { const promString = await AggregatorRegistry.aggregate(message.metrics).metrics(); parentPort.postMessage({ type: MESSAGE_TYPES.AGGREGATE_METRICS_RES, metrics: promString }); From ee33e5cd6e38d71f417e781c99b7743c3c7e1f4d Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:37:45 +0530 Subject: [PATCH 056/160] chore: update src/util/worker.js --- src/util/worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/worker.js b/src/util/worker.js index 780dc92f67c..df6cbf4984d 100644 --- a/src/util/worker.js +++ b/src/util/worker.js @@ -4,7 +4,7 @@ const { MESSAGE_TYPES } = require('./metricsAggregator'); const { AggregatorRegistry } = require('prom-client'); parentPort.on('message', async (message) => { - if (message.type == MESSAGE_TYPES.AGGREGATE_METRICS_REQ) { + if (message.type === MESSAGE_TYPES.AGGREGATE_METRICS_REQ) { try { const promString = await AggregatorRegistry.aggregate(message.metrics).metrics(); parentPort.postMessage({ type: MESSAGE_TYPES.AGGREGATE_METRICS_RES, metrics: promString }); From ea46afef39bc85727a5258737987e4da1104ac3d Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Fri, 31 Jan 2025 10:59:47 +0530 Subject: [PATCH 057/160] fix: add phone e164 format validation for klaviyo (#4025) --- package-lock.json | 8 +- package.json | 2 +- src/v0/destinations/klaviyo/util.js | 25 +++++ .../klaviyo/processor/screenTestDataV2.ts | 4 +- .../klaviyo/processor/trackTestDataV2.ts | 69 +++++++++++- .../destinations/klaviyo/router/dataV2.ts | 104 ++++++++++++++++++ 6 files changed, 201 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd97d9fd8e6..553490b5830 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "koa": "^2.15.3", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", - "libphonenumber-js": "^1.11.12", + "libphonenumber-js": "^1.11.18", "lodash": "^4.17.21", "match-json": "^1.3.5", "md5": "^2.3.0", @@ -16763,9 +16763,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.11.12", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.12.tgz", - "integrity": "sha512-QkJn9/D7zZ1ucvT++TQSvZuSA2xAWeUytU+DiEQwbPKLyrDpvbul2AFs1CGbRAPpSCCk47aRAb5DX5mmcayp4g==" + "version": "1.11.18", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.18.tgz", + "integrity": "sha512-okMm/MCoFrm1vByeVFLBdkFIXLSHy/AIK2AEGgY3eoicfWZeOZqv3GfhtQgICkzs/tqorAMm3a4GBg5qNCrqzg==" }, "node_modules/lilconfig": { "version": "2.1.0", diff --git a/package.json b/package.json index 79442ea9591..d320dd5c50d 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "koa": "^2.15.3", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", - "libphonenumber-js": "^1.11.12", + "libphonenumber-js": "^1.11.18", "lodash": "^4.17.21", "match-json": "^1.3.5", "md5": "^2.3.0", diff --git a/src/v0/destinations/klaviyo/util.js b/src/v0/destinations/klaviyo/util.js index 4421764d953..42e1d8a8012 100644 --- a/src/v0/destinations/klaviyo/util.js +++ b/src/v0/destinations/klaviyo/util.js @@ -1,5 +1,6 @@ const set = require('set-value'); const lodash = require('lodash'); +const { parsePhoneNumberFromString } = require('libphonenumber-js'); const { NetworkError, InstrumentationError } = require('@rudderstack/integrations-lib'); const { WhiteListedTraits } = require('../../../constants'); const { @@ -32,6 +33,24 @@ const { const REVISION_CONSTANT = '2023-02-22'; +/** + * This function is used to check if the phone number is in E.164 format. It uses libphonenumber-js library to parse the phone number + * @param {*} phoneNumber + * @returns boolean + */ +function isValidE164PhoneNumber(phoneNumber) { + try { + // Remove all non-numeric characters from the phone number like spaces, hyphens, etc. + const sanitizedPhoneNumber = phoneNumber.replace(/[^\d+]/g, ''); + const parsedNumber = parsePhoneNumberFromString(sanitizedPhoneNumber); + // Check if the number is valid and properly formatted in E.164. + return parsedNumber && parsedNumber.format('E.164') === sanitizedPhoneNumber; + } catch (error) { + // If parsing fails, it's not a valid E.164 number, i.e doesn't start with '+' and country code + return false; + } +} + /** * This function calls the create user endpoint ref: https://developers.klaviyo.com/en/reference/create_profile * If the user doesn't exist, it creates a profile for the user and return 201 status code and the response which contains all the profile data @@ -414,6 +433,12 @@ const constructProfile = (message, destination, isIdentifyCall) => { message, MAPPING_CONFIG[CONFIG_CATEGORIES.PROFILEV2.name], ); + if ( + isDefinedAndNotNull(profileAttributes.phone_number) && + !isValidE164PhoneNumber(profileAttributes.phone_number) + ) { + throw new InstrumentationError('Phone number is not in E.164 format.'); + } const { enforceEmailAsPrimary, flattenProperties } = destination.Config; let customPropertyPayload = {}; const { meta, metadataFields } = getProfileMetadataAndMetadataFields(message); diff --git a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts index a50659343c5..ecc1fcd7f7f 100644 --- a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts @@ -55,7 +55,7 @@ export const screenTestData: ProcessorTestData[] = [ id: 'user@1', age: '22', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', anonymousId: '9c6bd77ea9da3e68', append1: 'value1', }, @@ -125,7 +125,7 @@ export const screenTestData: ProcessorTestData[] = [ }, }, }, - phone_number: '9112340375', + phone_number: '+9112340375', properties: { id: 'user@1', age: '22', diff --git a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts index 78a3a0d7185..b2207998d5b 100644 --- a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts @@ -46,7 +46,7 @@ const commonOutputHeaders = { }; const profileAttributes = { email: 'test@rudderstack.com', - phone_number: '9112340375', + phone_number: '+9112340375', anonymous_id: '9c6bd77ea9da3e68', properties: { age: '22', @@ -86,7 +86,7 @@ export const trackTestData: ProcessorTestData[] = [ ...commonTraits, name: 'Test', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', description: 'Sample description', }, }, @@ -174,7 +174,7 @@ export const trackTestData: ProcessorTestData[] = [ description: 'Sample description', name: 'Test', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', }, }, properties: commonProps, @@ -257,7 +257,7 @@ export const trackTestData: ProcessorTestData[] = [ description: 'Sample description', name: 'Test', email: 'test@rudderstack.com', - phone: '9112340375', + phone: '+9112340375', }, }, properties: { ...commonProps, value: { price: 9.99 } }, @@ -293,4 +293,65 @@ export const trackTestData: ProcessorTestData[] = [ }, }, }, + { + id: 'klaviyo-track-150624-test-4', + name: 'klaviyo', + description: '150624 -> Track event call, with phone not in E.164 format', + scenario: 'Business', + successCriteria: + 'Response should an error message and status code should be 400, as Phone number is not in E.164 format.', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(destination, { enforceEmailAsPrimary: true }), + message: generateSimplifiedTrackPayload({ + type: 'track', + event: 'TestEven001', + sentAt: '2025-01-01T11:11:11.111Z', + userId: 'invalidPhoneUser', + context: { + traits: { + ...commonTraits, + description: 'Sample description', + name: 'Test', + email: 'test@rudderstack.com', + phone: '9112340375', + }, + }, + properties: commonProps, + originalTimestamp: '2025-01-01T11:11:11.111Z', + }), + metadata: generateMetadata(4), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Phone number is not in E.164 format.', + statTags: { + destType: 'KLAVIYO', + destinationId: 'default-destinationId', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + statusCode: 400, + metadata: generateMetadata(4), + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/klaviyo/router/dataV2.ts b/test/integrations/destinations/klaviyo/router/dataV2.ts index 5201abc712c..d67d7947b4e 100644 --- a/test/integrations/destinations/klaviyo/router/dataV2.ts +++ b/test/integrations/destinations/klaviyo/router/dataV2.ts @@ -2050,4 +2050,108 @@ export const dataV2: RouterTestData[] = [ }, }, }, + { + id: 'klaviyo-router-150624-test-7', + name: 'klaviyo', + description: + '150624 -> Router tests to check for invalid phone number format in identify and track calls and should throw error', + scenario: 'Framework', + successCriteria: 'Should throw invalid phone number error for identify and track calls', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + userId: 'user123', + type: 'identify', + traits: { subscribe: true }, + context: { + traits: { + email: 'test@rudderstack.com', + phone: '123321000', + consent: 'email', + }, + ip: '14.5.67.21', + library: { name: 'http' }, + }, + timestamp: '2020-01-21T00:21:34.208Z', + }, + destination, + metadata: generateMetadata(1), + }, + { + message: { + type: 'track', + event: 'TestEven001', + sentAt: '2025-01-01T11:11:11.111Z', + userId: 'invalidPhoneUser', + context: { + traits: { + name: 'Test', + email: 'test@rudderstack.com', + phone: '9112340375', + }, + }, + properties: { + price: 120, + }, + originalTimestamp: '2025-01-01T11:11:11.111Z', + }, + metadata: generateMetadata(2), + destination, + }, + ], + destType: 'klaviyo', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + error: 'Phone number is not in E.164 format.', + statTags: { + destType: 'KLAVIYO', + destinationId: 'default-destinationId', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + metadata: [generateMetadata(1)], + batched: false, + statusCode: 400, + destination, + }, + { + error: 'Phone number is not in E.164 format.', + statTags: { + destType: 'KLAVIYO', + destinationId: 'default-destinationId', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', + workspaceId: 'default-workspaceId', + }, + metadata: [generateMetadata(2)], + batched: false, + statusCode: 400, + destination, + }, + ], + }, + }, + }, + }, ]; From d62ba40ff26d1f4fc27b54f1546094f384ee7266 Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Fri, 31 Jan 2025 18:31:51 +0530 Subject: [PATCH 058/160] feat(http): enclose constants with quotes in mappings (#4037) --- src/cdk/v2/destinations/http/utils.js | 22 +++++++++- src/cdk/v2/destinations/http/utils.test.js | 41 +++++++++++++++++++ test/integrations/destinations/http/common.ts | 2 +- .../http/processor/configuration.ts | 6 +-- .../destinations/http/router/data.ts | 6 +-- 5 files changed, 69 insertions(+), 8 deletions(-) diff --git a/src/cdk/v2/destinations/http/utils.js b/src/cdk/v2/destinations/http/utils.js index 38308b687f7..7657a1cd60a 100644 --- a/src/cdk/v2/destinations/http/utils.js +++ b/src/cdk/v2/destinations/http/utils.js @@ -40,9 +40,28 @@ const getAuthHeaders = (config) => { return headers; }; +const enhanceMappings = (mappings) => { + let enhancedMappings = mappings; + if (Array.isArray(mappings)) { + enhancedMappings = mappings.map((mapping) => { + const enhancedMapping = { ...mapping }; + if ( + mapping.hasOwnProperty('from') && + !mapping.from.includes('$') && + !(mapping.from.startsWith("'") && mapping.from.endsWith("'")) + ) { + enhancedMapping.from = `'${mapping.from}'`; + } + return enhancedMapping; + }); + } + return enhancedMappings; +}; + const getCustomMappings = (message, mapping) => { + const enhancedMappings = enhanceMappings(mapping); try { - return applyCustomMappings(message, mapping); + return applyCustomMappings(message, enhancedMappings); } catch (e) { throw new ConfigurationError(`Error in custom mappings: ${e.message}`); } @@ -233,6 +252,7 @@ const batchSuccessfulEvents = (events, batchSize) => { module.exports = { CONTENT_TYPES_MAP, getAuthHeaders, + enhanceMappings, getCustomMappings, encodeParamsObject, prepareEndpoint, diff --git a/src/cdk/v2/destinations/http/utils.test.js b/src/cdk/v2/destinations/http/utils.test.js index bd4e9e05725..5b6eca90a4c 100644 --- a/src/cdk/v2/destinations/http/utils.test.js +++ b/src/cdk/v2/destinations/http/utils.test.js @@ -1,4 +1,5 @@ const { + enhanceMappings, encodeParamsObject, prepareEndpoint, prepareBody, @@ -125,4 +126,44 @@ describe('Utils Functions', () => { expect(stringifyFirstLevelValues({})).toEqual({}); }); }); + + describe('enhanceMappings function', () => { + test("should wrap 'from' property in single quotes if it is not already wrapped and does not contain '$'", () => { + const input = [{ to: 'a', from: 'b' }]; + const output = enhanceMappings(input); + expect(output).toEqual([{ to: 'a', from: "'b'" }]); + }); + + test("should not modify 'from' property if it is already wrapped in single quotes", () => { + const input = [{ to: 'a', from: "'b'" }]; + const output = enhanceMappings(input); + expect(output).toEqual([{ to: 'a', from: "'b'" }]); + }); + + test("should not modify 'from' property if it contains '$'", () => { + const input = [{ to: 'a', from: '$.b' }]; + const output = enhanceMappings(input); + expect(output).toEqual([{ to: 'a', from: '$.b' }]); + }); + + test('should return an empty array if input is an empty array', () => { + const input = []; + const output = enhanceMappings(input); + expect(output).toEqual([]); + }); + + test('should correctly handle multiple mappings in an array', () => { + const input = [ + { to: 'a', from: 'b' }, + { to: 'x', from: "'y'" }, + { to: 'p', from: '$.q' }, + ]; + const output = enhanceMappings(input); + expect(output).toEqual([ + { to: 'a', from: "'b'" }, + { to: 'x', from: "'y'" }, + { to: 'p', from: '$.q' }, + ]); + }); + }); }); diff --git a/test/integrations/destinations/http/common.ts b/test/integrations/destinations/http/common.ts index 455fa534df7..6c2887859f3 100644 --- a/test/integrations/destinations/http/common.ts +++ b/test/integrations/destinations/http/common.ts @@ -273,7 +273,7 @@ const destinations: Destination[] = [ }, { to: '$.key', - from: '.traits.key', + from: '$.traits.key', }, ], pathParams: [ diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index 8c886b77933..51a28fc2abf 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -150,7 +150,7 @@ export const configuration: ProcessorTestData[] = [ 'Content-Type': 'application/json', Authorization: 'Basic dGVzdC11c2VyOg==', h1: 'val1', - h2: 2, + h2: '2', 'content-type': 'application/json', }, params: { @@ -258,7 +258,7 @@ export const configuration: ProcessorTestData[] = [ 'Content-Type': 'application/json', Authorization: 'Basic dGVzdC11c2VyOg==', h1: 'val1', - h2: 2, + h2: '2', 'content-type': 'application/json', }, params: { @@ -311,7 +311,7 @@ export const configuration: ProcessorTestData[] = [ 'Content-Type': 'application/json', Authorization: 'Basic dGVzdC11c2VyOg==', h1: 'val1', - h2: 2, + h2: '2', 'content-type': 'application/json', }, params: { diff --git a/test/integrations/destinations/http/router/data.ts b/test/integrations/destinations/http/router/data.ts index 8fd3a1584cf..c719196e6ba 100644 --- a/test/integrations/destinations/http/router/data.ts +++ b/test/integrations/destinations/http/router/data.ts @@ -238,7 +238,7 @@ export const data = [ Authorization: 'Basic dGVzdC11c2VyOg==', 'content-type': 'application/json', h1: 'val1', - h2: 2, + h2: '2', h3: 'John', }, params: { @@ -271,7 +271,7 @@ export const data = [ Authorization: 'Basic dGVzdC11c2VyOg==', 'content-type': 'application/json', h1: 'val1', - h2: 2, + h2: '2', h3: 'John', }, params: { @@ -304,7 +304,7 @@ export const data = [ Authorization: 'Basic dGVzdC11c2VyOg==', 'content-type': 'application/json', h1: 'val1', - h2: 2, + h2: '2', h3: 'Alex', }, params: { From 16b927a97b64d3033e33a047429d0bbd15c7e1fd Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:55:50 +0530 Subject: [PATCH 059/160] feat: onboarding customerio segment destination (#4028) * feat: onboarding customerio segment destination * feat: added preprocessing of input to filter unavailable customer * fix: minor issue * fix: some changes * feat: refactoring name to customerio_audience * fix: revert preprocessing changes after suggestion * fix: some minor comments * chore: avoid forEach for better code readability * chore: refactor customerio utils * fix: added Config validation * fix: added types * fix: added tests and some minor change * fix: minor change * chore: simplify types and generalise existing types * fix: minor change * fix: addressing comments --------- Co-authored-by: Dilip Kola Co-authored-by: Vinay Teki Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --- src/features.ts | 1 + src/types/index.ts | 16 +- .../customerio_audience/config.ts | 11 + .../customerio_audience/transform.ts | 113 ++++++ .../destinations/customerio_audience/type.ts | 60 +++ .../destinations/customerio_audience/utils.ts | 121 ++++++ .../customerio_audience/common.ts | 97 +++++ .../destinations/customerio_audience/mocks.ts | 5 + .../customerio_audience/router/data.ts | 369 ++++++++++++++++++ 9 files changed, 787 insertions(+), 6 deletions(-) create mode 100644 src/v0/destinations/customerio_audience/config.ts create mode 100644 src/v0/destinations/customerio_audience/transform.ts create mode 100644 src/v0/destinations/customerio_audience/type.ts create mode 100644 src/v0/destinations/customerio_audience/utils.ts create mode 100644 test/integrations/destinations/customerio_audience/common.ts create mode 100644 test/integrations/destinations/customerio_audience/mocks.ts create mode 100644 test/integrations/destinations/customerio_audience/router/data.ts diff --git a/src/features.ts b/src/features.ts index fb91ae28833..460f2720aff 100644 --- a/src/features.ts +++ b/src/features.ts @@ -94,6 +94,7 @@ const defaultFeaturesConfig: FeaturesConfig = { INTERCOM_V2: true, LINKEDIN_AUDIENCE: true, TOPSORT: true, + CUSTOMERIO_AUDIENCE: true, }, regulations: [ 'BRAZE', diff --git a/src/types/index.ts b/src/types/index.ts index 7c07f659df3..a8e05d3ed62 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -122,11 +122,11 @@ type DestinationDefinition = { Config: FixMe; }; -type Destination = { +type Destination = { ID: string; Name: string; DestinationDefinition: DestinationDefinition; - Config: FixMe; + Config: DestinationConfig; Enabled: boolean; WorkspaceID: string; Transformations: UserTransformationInput[]; @@ -164,12 +164,16 @@ type ProcessorTransformationRequest = { credentials?: Credential[]; }; -type RouterTransformationRequestData = { +type RouterTransformationRequestData< + Message = object, + DestinationType = Destination, + ConnectionType = Connection, +> = { request?: object; - message: object; + message: Message; metadata: Metadata; - destination: Destination; - connection?: Connection; + destination: DestinationType; + connection?: ConnectionType; }; type RouterTransformationRequest = { diff --git a/src/v0/destinations/customerio_audience/config.ts b/src/v0/destinations/customerio_audience/config.ts new file mode 100644 index 00000000000..d9b223c59b8 --- /dev/null +++ b/src/v0/destinations/customerio_audience/config.ts @@ -0,0 +1,11 @@ +export const MAX_ITEMS = 1000; + +export const DEFAULT_ID_TYPE = 'id'; + +export const BASE_ENDPOINT = 'https://track.customer.io/api/v1/segments'; + +export const SegmentAction = { + INSERT: 'insert', + UPDATE: 'update', + DELETE: 'delete', +}; diff --git a/src/v0/destinations/customerio_audience/transform.ts b/src/v0/destinations/customerio_audience/transform.ts new file mode 100644 index 00000000000..c8d9f8a89c0 --- /dev/null +++ b/src/v0/destinations/customerio_audience/transform.ts @@ -0,0 +1,113 @@ +import { ConfigurationError } from '@rudderstack/integrations-lib'; +import { SegmentAction } from './config'; +import { CustomerIORouterRequestType, RespList } from './type'; + +const { InstrumentationError } = require('@rudderstack/integrations-lib'); +const { batchResponseBuilder, getEventAction } = require('./utils'); +const { handleRtTfSingleEventError, getEventType } = require('../../util'); +const { EventType } = require('../../../constants'); + +interface ProcessedEvent extends RespList { + eventAction: keyof typeof SegmentAction; +} + +const createEventChunk = (event: CustomerIORouterRequestType): ProcessedEvent => { + const eventAction = getEventAction(event); + const { identifiers } = event?.message || {}; + const id: string | number = Object.values(identifiers)[0]; + + return { + payload: { ids: [id] }, + metadata: event.metadata, + eventAction, + }; +}; + +const validateEvent = (event: CustomerIORouterRequestType): boolean => { + const eventType = getEventType(event?.message); + if (eventType !== EventType.RECORD) { + throw new InstrumentationError(`message type ${eventType} is not supported`); + } + + const eventAction = getEventAction(event); + if (!Object.values(SegmentAction).includes(eventAction)) { + throw new InstrumentationError(`action ${eventAction} is not supported`); + } + + const identifiers = event?.message?.identifiers; + if (!identifiers || Object.keys(identifiers).length === 0) { + throw new InstrumentationError(`identifiers cannot be empty`); + } + + if (Object.keys(identifiers).length > 1) { + throw new InstrumentationError(`only one identifier is supported`); + } + + const id = Object.values(identifiers)[0]; + if (typeof id !== 'string' && typeof id !== 'number') { + throw new ConfigurationError(`identifier type should be a string or integer`); + } + + const audienceId = event?.connection?.config?.destination?.audienceId; + if (!audienceId) { + throw new InstrumentationError('audienceId is required, aborting.'); + } + + const identifierMappings = event?.connection?.config?.destination?.identifierMappings; + if (!identifierMappings || Object.keys(identifierMappings).length === 0) { + throw new InstrumentationError('identifierMappings cannot be empty'); + } + + return true; +}; + +const processRouterDest = async (inputs: CustomerIORouterRequestType[], reqMetadata: any) => { + if (!inputs?.length) return []; + + const { destination, connection } = inputs[0]; + + // Process events and separate valid and error cases + const processedEvents = inputs.map((event) => { + try { + validateEvent(event); + return { + success: true, + data: createEventChunk(event), + }; + } catch (error) { + return { + success: false, + error: handleRtTfSingleEventError(event, error, reqMetadata), + }; + } + }); + + // Separate successful and failed events + const successfulEvents = processedEvents + .filter((result) => result.success) + .map((result) => result.data as ProcessedEvent); + + const errorEvents = processedEvents + .filter((result) => !result.success) + .map((result) => result.error); + + // Split successful events into delete and insert/update lists + const deleteRespList = successfulEvents + .filter((event) => event.eventAction === SegmentAction.DELETE) + .map(({ payload, metadata }) => ({ payload, metadata })); + + const insertOrUpdateRespList = successfulEvents + .filter((event) => event.eventAction !== SegmentAction.DELETE) + .map(({ payload, metadata }) => ({ payload, metadata })); + + const batchSuccessfulRespList = batchResponseBuilder( + insertOrUpdateRespList, + deleteRespList, + destination, + connection, + ); + + return [...batchSuccessfulRespList, ...errorEvents]; +}; + +export { processRouterDest }; diff --git a/src/v0/destinations/customerio_audience/type.ts b/src/v0/destinations/customerio_audience/type.ts new file mode 100644 index 00000000000..5c5335d6c8e --- /dev/null +++ b/src/v0/destinations/customerio_audience/type.ts @@ -0,0 +1,60 @@ +import { Connection, Destination, Metadata, RouterTransformationRequestData } from '../../../types'; + +// Basic response type for audience list operations +export type RespList = { + payload: { + ids: (string | number)[]; + }; + metadata: Metadata; +}; + +// Types for API request components +export type SegmentationPayloadType = { + ids: (string | number)[]; +}; + +export type SegmentationParamType = { + id_type: string; +}; + +export type SegmentationHeadersType = { + 'Content-Type': string; + Authorization: string; +}; + +// CustomerIO specific configuration types +type CustomerIODestinationConfig = { + apiKey: string; + appApiKey: string; + siteId: string; + [key: string]: any; +}; + +type CustomerIOConnectionConfig = { + destination: { + audienceId: string | number; + identifierMappings: { + from: string; + to: string; + }[]; + }; +}; + +// Message type specific to CustomerIO +export type CustomerIOMessageType = { + action: string; + identifiers: Record; + [key: string]: any; +}; + +// Final exported types using generics from base types +export type CustomerIODestinationType = Destination; +export type CustomerIOConnectionType = Connection & { + config: CustomerIOConnectionConfig; +}; + +export type CustomerIORouterRequestType = RouterTransformationRequestData< + CustomerIOMessageType, + CustomerIODestinationType, + CustomerIOConnectionType +>; diff --git a/src/v0/destinations/customerio_audience/utils.ts b/src/v0/destinations/customerio_audience/utils.ts new file mode 100644 index 00000000000..c642618963b --- /dev/null +++ b/src/v0/destinations/customerio_audience/utils.ts @@ -0,0 +1,121 @@ +import { base64Convertor } from '@rudderstack/integrations-lib'; +import { BatchUtils } from '@rudderstack/workflow-engine'; +import { BASE_ENDPOINT, DEFAULT_ID_TYPE, MAX_ITEMS } from './config'; +import { + CustomerIOConnectionType, + CustomerIODestinationType, + CustomerIORouterRequestType, + RespList, + SegmentationHeadersType, + SegmentationParamType, + SegmentationPayloadType, +} from './type'; +import { Metadata } from '../../../types'; + +const getIdType = (connection: CustomerIOConnectionType): string => + connection.config.destination.identifierMappings[0]?.to || DEFAULT_ID_TYPE; + +const getSegmentId = (connection: CustomerIOConnectionType): string | number => + connection.config.destination.audienceId; + +const getHeaders = (destination: CustomerIODestinationType): SegmentationHeadersType => ({ + 'Content-Type': 'application/json', + Authorization: `Basic ${base64Convertor(`${destination.Config.siteId}:${destination.Config.apiKey}`)}`, +}); + +const getParams = (connection: CustomerIOConnectionType): SegmentationParamType => ({ + id_type: getIdType(connection), +}); + +const getMergedPayload = (batch: RespList[]): SegmentationPayloadType => ({ + ids: batch.flatMap((input) => input.payload.ids), +}); + +const getMergedMetadata = (batch: RespList[]): Metadata[] => batch.map((input) => input.metadata); + +const buildBatchedResponse = ( + payload: SegmentationPayloadType, + endpoint: string, + headers: SegmentationHeadersType, + params: SegmentationParamType, + metadata: Metadata[], + destination: CustomerIODestinationType, +) => ({ + batchedRequest: { + body: { + JSON: payload, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + version: '1', + type: 'REST', + method: 'POST', + endpoint, + headers, + params, + files: {}, + }, + metadata, + batched: true, + statusCode: 200, + destination, +}); + +const processBatch = ( + respList: RespList[], + endpoint: string, + destination: CustomerIODestinationType, + connection: CustomerIOConnectionType, +): any[] => { + if (!respList?.length) { + return []; + } + + const headers = getHeaders(destination); + const params = getParams(connection); + const batches = BatchUtils.chunkArrayBySizeAndLength(respList, { maxItems: MAX_ITEMS }); + + return batches.items.map((batch) => { + const mergedPayload = getMergedPayload(batch); + const mergedMetadata = getMergedMetadata(batch); + return buildBatchedResponse( + mergedPayload, + endpoint, + headers, + params, + mergedMetadata, + destination, + ); + }); +}; + +const batchResponseBuilder = ( + insertOrUpdateRespList: RespList[], + deleteRespList: RespList[], + destination: CustomerIODestinationType, + connection: CustomerIOConnectionType, +): any[] => { + const segmentId = getSegmentId(connection); + + const insertResponses = processBatch( + insertOrUpdateRespList, + `${BASE_ENDPOINT}/${segmentId}/add_customers`, + destination, + connection, + ); + + const deleteResponses = processBatch( + deleteRespList, + `${BASE_ENDPOINT}/${segmentId}/remove_customers`, + destination, + connection, + ); + + return [...insertResponses, ...deleteResponses]; +}; + +const getEventAction = (event: CustomerIORouterRequestType): string => + event?.message?.action?.toLowerCase() || ''; + +export { batchResponseBuilder, getEventAction }; diff --git a/test/integrations/destinations/customerio_audience/common.ts b/test/integrations/destinations/customerio_audience/common.ts new file mode 100644 index 00000000000..91723cc12c6 --- /dev/null +++ b/test/integrations/destinations/customerio_audience/common.ts @@ -0,0 +1,97 @@ +import { Connection, Destination } from '../../../../src/types'; +import { VDM_V2_SCHEMA_VERSION } from '../../../../src/v0/util/constant'; + +const destType = 'customerio_audience'; +const destTypeInUpperCase = 'CUSTOMERIO_AUDIENCE'; +const displayName = 'Customer.io Audience'; +const channel = 'web'; +const destination: Destination = { + Config: { + apiKey: 'test-api-key', + appApiKey: 'test-app-api-key', + connectionMode: 'cloud', + siteId: 'test-site-id', + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: {}, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', +}; +const connection: Connection = { + sourceId: 'dummy-source-id', + destinationId: 'dummy-destination-id', + enabled: true, + config: { + destination: { + schemaVersion: VDM_V2_SCHEMA_VERSION, + audienceId: 'test-segment-id', + identifierMappings: [ + { + from: 'some-key', + to: 'id', + }, + ], + }, + }, +}; + +const inValidConnection: Connection = { + ...connection, + config: { + ...connection.config, + destination: { + audienceId: '', + }, + }, +}; + +const insertOrUpdateEndpoint = + 'https://track.customer.io/api/v1/segments/test-segment-id/add_customers'; + +const deleteEndpoint = 'https://track.customer.io/api/v1/segments/test-segment-id/remove_customers'; + +const processorInstrumentationErrorStatTags = { + destType: destTypeInUpperCase, + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', +}; + +const RouterInstrumentationErrorStatTags = { + ...processorInstrumentationErrorStatTags, + feature: 'router', +}; + +const headers = { + 'Content-Type': 'application/json', + Authorization: 'Basic dGVzdC1zaXRlLWlkOnRlc3QtYXBpLWtleQ==', +}; + +const params = { + id_type: 'id', +}; + +export { + destType, + channel, + destination, + connection, + inValidConnection, + processorInstrumentationErrorStatTags, + RouterInstrumentationErrorStatTags, + headers, + params, + insertOrUpdateEndpoint, + deleteEndpoint, +}; diff --git a/test/integrations/destinations/customerio_audience/mocks.ts b/test/integrations/destinations/customerio_audience/mocks.ts new file mode 100644 index 00000000000..2c613706e67 --- /dev/null +++ b/test/integrations/destinations/customerio_audience/mocks.ts @@ -0,0 +1,5 @@ +import * as config from '../../../../src/v0/destinations/customerio_audience/config'; + +export const defaultMockFns = () => { + jest.replaceProperty(config, 'MAX_ITEMS', 3 as typeof config.MAX_ITEMS); +}; diff --git a/test/integrations/destinations/customerio_audience/router/data.ts b/test/integrations/destinations/customerio_audience/router/data.ts new file mode 100644 index 00000000000..ed486f781b6 --- /dev/null +++ b/test/integrations/destinations/customerio_audience/router/data.ts @@ -0,0 +1,369 @@ +import { generateMetadata, generateRecordPayload, overrideDestination } from '../../../testUtils'; +import { defaultMockFns } from '../mocks'; +import { + destType, + destination, + headers, + RouterInstrumentationErrorStatTags, + insertOrUpdateEndpoint, + deleteEndpoint, + connection, + params, + inValidConnection, +} from '../common'; + +const routerRequest1 = { + input: [ + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-1', + }, + action: 'insert', + }), + metadata: generateMetadata(1), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-2', + }, + action: 'insert', + }), + metadata: generateMetadata(2), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-3', + }, + action: 'insert', + }), + metadata: generateMetadata(3), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-4', + }, + action: 'insert', + }), + metadata: generateMetadata(4), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-5', + }, + action: 'update', + }), + metadata: generateMetadata(5), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-6', + }, + action: 'delete', + }), + metadata: generateMetadata(6), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-7', + }, + action: 'delete', + }), + metadata: generateMetadata(7), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-8', + }, + action: 'dummy-action', + }), + metadata: generateMetadata(8), + destination, + connection, + }, + { + message: { + type: 'identify', + anonymousId: 'anonId1', + userId: 'userId1', + integrations: { + All: true, + }, + originalTimestamp: '2024-03-04T15:32:56.409Z', + }, + metadata: generateMetadata(9), + destination, + connection, + }, + { + message: generateRecordPayload({ + action: 'insert', + }), + metadata: generateMetadata(10), + destination, + connection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-7', + email: 'test@gmail.com', + }, + action: 'insert', + }), + metadata: generateMetadata(11), + destination, + connection, + }, + ], + destType, +}; + +// scenario when all the events are malfunctioned +const routerRequest2 = { + input: [ + { + message: generateRecordPayload({ + identifiers: { + id: [], + }, + action: 'insert', + }), + metadata: generateMetadata(1), + destination, + connection: inValidConnection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-1', + }, + action: 'insert', + }), + metadata: generateMetadata(2), + destination, + connection: inValidConnection, + }, + { + message: generateRecordPayload({ + identifiers: { + id: 'test-id-1', + }, + action: 'insert', + }), + metadata: generateMetadata(3), + destination, + connection: { + ...connection, + config: { + ...connection.config, + destination: { + audienceId: 'test-audience-id', + }, + }, + }, + }, + ], + destType, +}; + +export const data = [ + { + id: 'customerio-segment-router-test-1', + name: destType, + description: 'Basic Router Test to test record payloads', + scenario: 'Framework+Business', + successCriteria: 'All events should be transformed successfully and status code should be 200', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: routerRequest1, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: insertOrUpdateEndpoint, + headers, + params, + body: { + JSON: { + ids: ['test-id-1', 'test-id-2', 'test-id-3'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(1), generateMetadata(2), generateMetadata(3)], + batched: true, + statusCode: 200, + destination, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: insertOrUpdateEndpoint, + headers, + params, + body: { + JSON: { + ids: ['test-id-4', 'test-id-5'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(4), generateMetadata(5)], + batched: true, + statusCode: 200, + destination, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: deleteEndpoint, + headers, + params, + body: { + JSON: { + ids: ['test-id-6', 'test-id-7'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [generateMetadata(6), generateMetadata(7)], + batched: true, + statusCode: 200, + destination, + }, + { + metadata: [generateMetadata(8)], + batched: false, + statusCode: 400, + error: 'action dummy-action is not supported', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(9)], + batched: false, + statusCode: 400, + error: 'message type identify is not supported', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(10)], + batched: false, + statusCode: 400, + error: 'identifiers cannot be empty', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(11)], + batched: false, + statusCode: 400, + error: 'only one identifier is supported', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + id: 'customerio-segment-router-test-2', + name: destType, + description: 'Basic Router Test to test record payloads', + scenario: 'Framework', + successCriteria: 'All events should throw error', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: routerRequest2, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [generateMetadata(1)], + batched: false, + statusCode: 400, + error: 'identifier type should be a string or integer', + statTags: { ...RouterInstrumentationErrorStatTags, errorType: 'configuration' }, + destination, + }, + { + metadata: [generateMetadata(2)], + batched: false, + statusCode: 400, + error: 'audienceId is required, aborting.', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + { + metadata: [generateMetadata(3)], + batched: false, + statusCode: 400, + error: 'identifierMappings cannot be empty', + statTags: RouterInstrumentationErrorStatTags, + destination, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, +]; From 74ea15f3caa68d2114735612cca4e6b9f05edf0b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 3 Feb 2025 09:56:06 +0000 Subject: [PATCH 060/160] chore(release): 1.90.0 --- CHANGELOG.md | 14 ++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3660e96464..a51cc18eed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ 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.90.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.89.1...v1.90.0) (2025-02-03) + + +### Features + +* **http:** enclose constants with quotes in mappings ([#4037](https://github.com/rudderlabs/rudder-transformer/issues/4037)) ([d62ba40](https://github.com/rudderlabs/rudder-transformer/commit/d62ba40ff26d1f4fc27b54f1546094f384ee7266)) +* **http:** minor bug fixes and enhancements related to XML and FORM formats ([#4022](https://github.com/rudderlabs/rudder-transformer/issues/4022)) ([241250d](https://github.com/rudderlabs/rudder-transformer/commit/241250d10e1d8cb904ec188312e1ec5532379e93)) +* onboarding customerio segment destination ([#4028](https://github.com/rudderlabs/rudder-transformer/issues/4028)) ([16b927a](https://github.com/rudderlabs/rudder-transformer/commit/16b927a97b64d3033e33a047429d0bbd15c7e1fd)) + + +### Bug Fixes + +* add phone e164 format validation for klaviyo ([#4025](https://github.com/rudderlabs/rudder-transformer/issues/4025)) ([ea46afe](https://github.com/rudderlabs/rudder-transformer/commit/ea46afef39bc85727a5258737987e4da1104ac3d)) + ### [1.89.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.89.0...v1.89.1) (2025-01-29) diff --git a/package-lock.json b/package-lock.json index 553490b5830..1f078475e92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.89.1", + "version": "1.90.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.89.1", + "version": "1.90.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index d320dd5c50d..0ce6152d4c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.89.1", + "version": "1.90.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From e405cf08e36aa83f5c971b6bda920760fb40eeb9 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:28:29 +0530 Subject: [PATCH 061/160] refactor: improve the code coverage (#4023) * refactor: add more tests for middleware and router utils * refactor: add more tests for adobe analytics and network utils --- src/adapters/network.test.js | 368 +++++++++++++++++- src/middleware.test.js | 107 +++++ src/routerUtils.js | 8 +- src/routerUtils.test.js | 126 ++++++ .../adobe_analytics/utils.test.js | 271 +++++++++++++ 5 files changed, 870 insertions(+), 10 deletions(-) create mode 100644 src/middleware.test.js create mode 100644 src/routerUtils.test.js create mode 100644 src/v0/destinations/adobe_analytics/utils.test.js diff --git a/src/adapters/network.test.js b/src/adapters/network.test.js index 7894925ccd6..a4a2787504f 100644 --- a/src/adapters/network.test.js +++ b/src/adapters/network.test.js @@ -1,7 +1,20 @@ const mockLoggerInstance = { info: jest.fn(), }; -const { getFormData, httpPOST, httpGET, httpSend, fireHTTPStats } = require('./network'); +const { + getFormData, + httpPOST, + httpGET, + httpSend, + fireHTTPStats, + proxyRequest, + prepareProxyRequest, + handleHttpRequest, + httpDELETE, + httpPUT, + httpPATCH, + getPayloadData, +} = require('./network'); const { getFuncTestData } = require('../../test/testHelper'); jest.mock('../util/stats', () => ({ timing: jest.fn(), @@ -20,14 +33,28 @@ jest.mock('@rudderstack/integrations-lib', () => { }; }); -jest.mock('axios', () => jest.fn()); +// Mock the axios module +jest.mock('axios', () => { + const mockAxios = jest.fn(); // Mock the default axios function + mockAxios.get = jest.fn(); // Mock axios.get + mockAxios.post = jest.fn(); // Mock axios.post + mockAxios.put = jest.fn(); // Mock axios.put + mockAxios.patch = jest.fn(); // Mock axios.patch + mockAxios.delete = jest.fn(); // Mock axios.delete + + // Mock the axios.create method if needed + mockAxios.create = jest.fn(() => mockAxios); + + return mockAxios; // Return the mocked axios +}); + +const axios = require('axios'); jest.mock('../util/logger', () => ({ ...jest.requireActual('../util/logger'), getMatchedMetadata: jest.fn(), })); -const axios = require('axios'); const loggerUtil = require('../util/logger'); axios.post = jest.fn(); @@ -635,3 +662,338 @@ describe('logging in http methods', () => { expect(mockLoggerInstance.info).toHaveBeenCalledTimes(0); }); }); + +describe('httpDELETE tests', () => { + beforeEach(() => { + mockLoggerInstance.info.mockClear(); + loggerUtil.getMatchedMetadata.mockClear(); + axios.delete.mockClear(); + }); + + test('should call axios.delete with correct parameters and log request/response', async () => { + const statTags = { + metadata: { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + }, + destType: 'DT', + feature: 'feat', + endpointPath: '/m/n/o', + requestMethod: 'delete', + }; + loggerUtil.getMatchedMetadata.mockReturnValue([statTags.metadata]); + + axios.delete.mockResolvedValueOnce({ + status: 200, + data: { a: 1, b: 2, c: 'abc' }, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + + await expect(httpDELETE('https://some.web.com/m/n/o', {}, statTags)).resolves.not.toThrow( + Error, + ); + expect(loggerUtil.getMatchedMetadata).toHaveBeenCalledTimes(2); + expect(mockLoggerInstance.info).toHaveBeenCalledTimes(2); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(1, ' [DT] /m/n/o request', { + body: undefined, + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + url: 'https://some.web.com/m/n/o', + method: 'delete', + }); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(2, ' [DT] /m/n/o response', { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + body: { a: 1, b: 2, c: 'abc' }, + status: 200, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + }); +}); + +describe('httpPUT tests', () => { + beforeEach(() => { + mockLoggerInstance.info.mockClear(); + loggerUtil.getMatchedMetadata.mockClear(); + axios.put.mockClear(); + }); + + test('should call axios.put with correct parameters and log request/response', async () => { + const statTags = { + metadata: { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + }, + destType: 'DT', + feature: 'feat', + endpointPath: '/m/n/o', + requestMethod: 'put', + }; + loggerUtil.getMatchedMetadata.mockReturnValue([statTags.metadata]); + + axios.put.mockResolvedValueOnce({ + status: 200, + data: { a: 1, b: 2, c: 'abc' }, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + + await expect(httpPUT('https://some.web.com/m/n/o', {}, {}, statTags)).resolves.not.toThrow( + Error, + ); + expect(loggerUtil.getMatchedMetadata).toHaveBeenCalledTimes(2); + expect(mockLoggerInstance.info).toHaveBeenCalledTimes(2); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(1, ' [DT] /m/n/o request', { + body: {}, + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + url: 'https://some.web.com/m/n/o', + method: 'put', + }); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(2, ' [DT] /m/n/o response', { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + body: { a: 1, b: 2, c: 'abc' }, + status: 200, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + }); +}); + +describe('httpPATCH tests', () => { + beforeEach(() => { + mockLoggerInstance.info.mockClear(); + loggerUtil.getMatchedMetadata.mockClear(); + axios.patch.mockClear(); + }); + + test('should call axios.patch with correct parameters and log request/response', async () => { + const statTags = { + metadata: { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + }, + destType: 'DT', + feature: 'feat', + endpointPath: '/m/n/o', + requestMethod: 'patch', + }; + loggerUtil.getMatchedMetadata.mockReturnValue([statTags.metadata]); + + axios.patch.mockResolvedValueOnce({ + status: 200, + data: { a: 1, b: 2, c: 'abc' }, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + + await expect(httpPATCH('https://some.web.com/m/n/o', {}, {}, statTags)).resolves.not.toThrow( + Error, + ); + expect(loggerUtil.getMatchedMetadata).toHaveBeenCalledTimes(2); + expect(mockLoggerInstance.info).toHaveBeenCalledTimes(2); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(1, ' [DT] /m/n/o request', { + body: {}, + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + url: 'https://some.web.com/m/n/o', + method: 'patch', + }); + + expect(mockLoggerInstance.info).toHaveBeenNthCalledWith(2, ' [DT] /m/n/o response', { + destType: 'DT', + destinationId: 'd1', + workspaceId: 'w1', + sourceId: 's1', + body: { a: 1, b: 2, c: 'abc' }, + status: 200, + headers: { + 'Content-Type': 'application/json', + 'X-Some-Header': 'headsome', + }, + }); + }); +}); + +describe('getPayloadData tests', () => { + test('should return payload and payloadFormat for non-empty body', () => { + const body = { + JSON: { key: 'value' }, + XML: null, + FORM: null, + }; + const result = getPayloadData(body); + expect(result).toEqual({ payload: { key: 'value' }, payloadFormat: 'JSON' }); + }); + + test('should return undefined payload and payloadFormat for empty body', () => { + const body = {}; + const result = getPayloadData(body); + expect(result).toEqual({ payload: undefined, payloadFormat: undefined }); + }); +}); + +describe('prepareProxyRequest tests', () => { + test('should prepare proxy request with correct headers and payload', () => { + const request = { + body: { JSON: { key: 'value' } }, + method: 'POST', + params: { param1: 'value1' }, + endpoint: 'https://example.com', + headers: { 'Content-Type': 'application/json' }, + destinationConfig: { key: 'value' }, + }; + const result = prepareProxyRequest(request); + expect(result).toEqual({ + endpoint: 'https://example.com', + data: { key: 'value' }, + params: { param1: 'value1' }, + headers: { 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs' }, + method: 'POST', + config: { key: 'value' }, + }); + }); +}); + +describe('handleHttpRequest tests', () => { + beforeEach(() => { + axios.post.mockClear(); + axios.get.mockClear(); + axios.put.mockClear(); + axios.patch.mockClear(); + axios.delete.mockClear(); + }); + + test('should handle POST request correctly', async () => { + axios.post.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('post', 'https://example.com', { key: 'value' }, {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle GET request correctly', async () => { + axios.get.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('get', 'https://example.com', {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle PUT request correctly', async () => { + axios.put.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('put', 'https://example.com', { key: 'value' }, {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle PATCH request correctly', async () => { + axios.patch.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('patch', 'https://example.com', { key: 'value' }, {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); + + test('should handle DELETE request correctly', async () => { + axios.delete.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const result = await handleHttpRequest('delete', 'https://example.com', {}); + expect(result.httpResponse).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + expect(result.processedResponse).toBeDefined(); + }); +}); + +describe('proxyRequest tests', () => { + beforeEach(() => { + axios.mockClear(); + }); + + test('should proxy request correctly', async () => { + axios.mockResolvedValueOnce({ + status: 200, + data: { key: 'value' }, + }); + + const request = { + body: { JSON: { key: 'value' } }, + method: 'POST', + params: { param1: 'value1' }, + endpoint: 'https://example.com', + headers: { 'Content-Type': 'application/json' }, + destinationConfig: { key: 'value' }, + metadata: { destType: 'DT' }, + }; + + const result = await proxyRequest(request, 'DT'); + expect(result).toEqual({ + success: true, + response: { status: 200, data: { key: 'value' } }, + }); + }); +}); diff --git a/src/middleware.test.js b/src/middleware.test.js new file mode 100644 index 00000000000..397dedfbd07 --- /dev/null +++ b/src/middleware.test.js @@ -0,0 +1,107 @@ +const Koa = require('koa'); // Import Koa +const { + addStatMiddleware, + addRequestSizeMiddleware, + getHeapProfile, + getCPUProfile, + initPyroscope, +} = require('./middleware'); + +const Pyroscope = require('@pyroscope/nodejs'); +const stats = require('./util/stats'); +const { getDestTypeFromContext } = require('@rudderstack/integrations-lib'); + +// Mock dependencies +jest.mock('@pyroscope/nodejs'); +jest.mock('./util/stats', () => ({ + timing: jest.fn(), + histogram: jest.fn(), +})); +jest.mock('@rudderstack/integrations-lib', () => ({ + getDestTypeFromContext: jest.fn(), +})); + +describe('Pyroscope Initialization', () => { + it('should initialize Pyroscope with the correct app name', () => { + initPyroscope(); + expect(Pyroscope.init).toHaveBeenCalledWith({ appName: 'rudder-transformer' }); + expect(Pyroscope.startHeapCollecting).toHaveBeenCalled(); + }); +}); + +describe('getCPUProfile', () => { + it('should call Pyroscope.collectCpu with the specified seconds', () => { + const seconds = 5; + getCPUProfile(seconds); + expect(Pyroscope.collectCpu).toHaveBeenCalledWith(seconds); + }); +}); + +describe('getHeapProfile', () => { + it('should call Pyroscope.collectHeap', () => { + getHeapProfile(); + expect(Pyroscope.collectHeap).toHaveBeenCalled(); + }); +}); + +describe('durationMiddleware', () => { + it('should record the duration of the request', async () => { + // Mock getDestTypeFromContext to return a fixed value + getDestTypeFromContext.mockReturnValue('mock-destination-type'); + + const app = new Koa(); // Create a Koa app instance + addStatMiddleware(app); // Pass the app instance to the middleware + + const ctx = { + method: 'GET', + status: 200, + request: { url: '/test' }, + }; + const next = jest.fn().mockResolvedValue(null); + + // Simulate the middleware execution + await app.middleware[0](ctx, next); + + expect(stats.timing).toHaveBeenCalledWith('http_request_duration', expect.any(Date), { + method: 'GET', + code: 200, + route: '/test', + destType: 'mock-destination-type', // Mocked value + }); + }); +}); + +describe('requestSizeMiddleware', () => { + it('should record the size of the request and response', async () => { + const app = new Koa(); // Create a Koa app instance + addRequestSizeMiddleware(app); // Pass the app instance to the middleware + + const ctx = { + method: 'POST', + status: 200, + request: { + url: '/test', + body: { key: 'value' }, + }, + response: { + body: { success: true }, + }, + }; + const next = jest.fn().mockResolvedValue(null); + + // Simulate the middleware execution + await app.middleware[0](ctx, next); + + expect(stats.histogram).toHaveBeenCalledWith('http_request_size', expect.any(Number), { + method: 'POST', + code: 200, + route: '/test', + }); + + expect(stats.histogram).toHaveBeenCalledWith('http_response_size', expect.any(Number), { + method: 'POST', + code: 200, + route: '/test', + }); + }); +}); diff --git a/src/routerUtils.js b/src/routerUtils.js index 081070d78ac..67b6e0d31c4 100644 --- a/src/routerUtils.js +++ b/src/routerUtils.js @@ -4,13 +4,7 @@ const logger = require('./logger'); const { proxyRequest } = require('./adapters/network'); const { nodeSysErrorToStatus } = require('./adapters/utils/networkUtils'); -let areFunctionsEnabled = -1; -const functionsEnabled = () => { - if (areFunctionsEnabled === -1) { - areFunctionsEnabled = process.env.ENABLE_FUNCTIONS === 'false' ? 0 : 1; - } - return areFunctionsEnabled === 1; -}; +const functionsEnabled = () => process.env.ENABLE_FUNCTIONS !== 'false'; const userTransformHandler = () => { if (functionsEnabled()) { diff --git a/src/routerUtils.test.js b/src/routerUtils.test.js new file mode 100644 index 00000000000..81c8ed49919 --- /dev/null +++ b/src/routerUtils.test.js @@ -0,0 +1,126 @@ +const { sendToDestination, userTransformHandler } = require('./routerUtils'); // Update the path accordingly + +const logger = require('./logger'); +const { proxyRequest } = require('./adapters/network'); +const { nodeSysErrorToStatus } = require('./adapters/utils/networkUtils'); + +// Mock dependencies +jest.mock('./logger'); +jest.mock('./adapters/network'); +jest.mock('./adapters/utils/networkUtils'); + +describe('sendToDestination', () => { + beforeEach(() => { + jest.clearAllMocks(); // Clear mocks before each test + }); + + it('should send a request to the destination and return a successful response', async () => { + // Mock proxyRequest to return a successful response + proxyRequest.mockResolvedValue({ + success: true, + response: { + headers: { 'content-type': 'application/json' }, + data: { message: 'Success' }, + status: 200, + }, + }); + + const destination = 'mock-destination'; + const payload = { key: 'value' }; + + const result = await sendToDestination(destination, payload); + + expect(logger.info).toHaveBeenCalledWith('Request recieved for destination', destination); + expect(proxyRequest).toHaveBeenCalledWith(payload); + expect(result).toEqual({ + headers: { 'content-type': 'application/json' }, + response: { message: 'Success' }, + status: 200, + }); + }); + + it('should handle network failure and return a parsed response', async () => { + // Mock proxyRequest to return a network failure + proxyRequest.mockResolvedValue({ + success: false, + response: { + code: 'ENOTFOUND', // Simulate a network error + }, + }); + + // Mock nodeSysErrorToStatus to return a specific error message and status + nodeSysErrorToStatus.mockReturnValue({ + message: 'Network error', + status: 500, + }); + + const destination = 'mock-destination'; + const payload = { key: 'value' }; + + const result = await sendToDestination(destination, payload); + + expect(logger.info).toHaveBeenCalledWith('Request recieved for destination', destination); + expect(proxyRequest).toHaveBeenCalledWith(payload); + expect(nodeSysErrorToStatus).toHaveBeenCalledWith('ENOTFOUND'); + expect(result).toEqual({ + headers: null, + networkFailure: true, + response: 'Network error', + status: 500, + }); + }); + + it('should handle axios error with response and return a parsed response', async () => { + // Mock proxyRequest to return an axios error with response + proxyRequest.mockResolvedValue({ + success: false, + response: { + response: { + headers: { 'content-type': 'application/json' }, + status: 400, + data: 'Bad Request', + }, + }, + }); + + const destination = 'mock-destination'; + const payload = { key: 'value' }; + + const result = await sendToDestination(destination, payload); + + expect(logger.info).toHaveBeenCalledWith('Request recieved for destination', destination); + expect(proxyRequest).toHaveBeenCalledWith(payload); + expect(result).toEqual({ + headers: { 'content-type': 'application/json' }, + status: 400, + response: 'Bad Request', + }); + }); +}); + +describe('userTransformHandler', () => { + beforeEach(() => { + jest.clearAllMocks(); // Clear mocks before each test + jest.resetModules(); // Reset modules to reset process.env + }); + + it('should return userTransformHandler when functions are enabled', () => { + // Mock process.env to enable functions + process.env.ENABLE_FUNCTIONS = 'true'; + + const mockUserTransformHandler = jest.fn(); + jest.mock('./util/customTransformer', () => ({ + userTransformHandler: mockUserTransformHandler, + })); + + const result = userTransformHandler(); + expect(result).toBe(mockUserTransformHandler); + }); + + it('should throw an error when functions are not enabled', () => { + // Mock process.env to disable functions + process.env.ENABLE_FUNCTIONS = 'false'; + + expect(() => userTransformHandler()).toThrow('Functions are not enabled'); + }); +}); diff --git a/src/v0/destinations/adobe_analytics/utils.test.js b/src/v0/destinations/adobe_analytics/utils.test.js new file mode 100644 index 00000000000..df40bf2ff31 --- /dev/null +++ b/src/v0/destinations/adobe_analytics/utils.test.js @@ -0,0 +1,271 @@ +const { + handleContextData, + handleEvar, + handleHier, + handleList, + handleCustomProperties, + stringifyValueAndJoinWithDelimiter, + escapeToHTML, +} = require('./utils'); // Update the path accordingly + +const { InstrumentationError } = require('@rudderstack/integrations-lib'); + +describe('handleContextData', () => { + it('should add context data to the payload when values are found', () => { + const payload = {}; + const destinationConfig = { + contextDataPrefix: 'c_', + contextDataMapping: { + 'user.id': 'userId', + 'user.email': 'userEmail', + }, + }; + const message = { + user: { + id: '123', + email: 'test@example.com', + }, + }; + + const result = handleContextData(payload, destinationConfig, message); + + expect(result.contextData).toEqual({ + c_userId: '123', + c_userEmail: 'test@example.com', + }); + }); + + it('should not add context data to the payload when no values are found', () => { + const payload = {}; + const destinationConfig = { + contextDataPrefix: 'c_', + contextDataMapping: { + 'user.id': 'userId', + 'user.email': 'userEmail', + }, + }; + const message = { + user: { + name: 'John Doe', + }, + }; + + const result = handleContextData(payload, destinationConfig, message); + + expect(result.contextData).toBeUndefined(); + }); +}); + +describe('handleEvar', () => { + it('should map properties to eVars in the payload', () => { + const payload = {}; + const destinationConfig = { + eVarMapping: { + productId: '1', + category: '2', + }, + }; + const message = { + properties: { + productId: 'p123', + category: 'electronics', + }, + }; + + const result = handleEvar(payload, destinationConfig, message); + + expect(result).toEqual({ + eVar1: 'p123', + eVar2: 'electronics', + }); + }); + + it('should not add eVars to the payload when no values are found', () => { + const payload = {}; + const destinationConfig = { + eVarMapping: { + productId: '1', + category: '2', + }, + }; + const message = { + properties: { + name: 'Product Name', + }, + }; + + const result = handleEvar(payload, destinationConfig, message); + + expect(result).toEqual({}); + }); +}); + +describe('handleHier', () => { + it('should map properties to hVars in the payload', () => { + const payload = {}; + const destinationConfig = { + hierMapping: { + section: '1', + subsection: '2', + }, + }; + const message = { + properties: { + section: 'home', + subsection: 'kitchen', + }, + }; + + const result = handleHier(payload, destinationConfig, message); + + expect(result).toEqual({ + hier1: 'home', + hier2: 'kitchen', + }); + }); + + it('should not add hVars to the payload when no values are found', () => { + const payload = {}; + const destinationConfig = { + hierMapping: { + section: '1', + subsection: '2', + }, + }; + const message = { + properties: { + name: 'Section Name', + }, + }; + + const result = handleHier(payload, destinationConfig, message); + + expect(result).toEqual({}); + }); +}); + +describe('handleList', () => { + it('should map properties to list variables in the payload', () => { + const payload = {}; + const destinationConfig = { + listMapping: { + products: '1', + }, + listDelimiter: { + products: ',', + }, + }; + const message = { + properties: { + products: ['p1', 'p2', 'p3'], + }, + }; + + const result = handleList(payload, destinationConfig, message); + + expect(result).toEqual({ + list1: 'p1,p2,p3', + }); + }); + + it('should throw an error when list properties are not strings or arrays', () => { + const payload = {}; + const destinationConfig = { + listMapping: { + products: '1', + }, + listDelimiter: { + products: ',', + }, + }; + const message = { + properties: { + products: 123, // Invalid type + }, + }; + + expect(() => handleList(payload, destinationConfig, message)).toThrow(InstrumentationError); + }); +}); + +describe('handleCustomProperties', () => { + it('should map properties to custom properties in the payload', () => { + const payload = {}; + const destinationConfig = { + customPropsMapping: { + color: '1', + size: '2', + }, + propsDelimiter: { + color: ',', + size: ';', + }, + }; + const message = { + properties: { + color: 'red,green,blue', + size: ['S', 'M', 'L'], + }, + }; + + const result = handleCustomProperties(payload, destinationConfig, message); + + expect(result).toEqual({ + prop1: 'red,green,blue', + prop2: 'S;M;L', + }); + }); + + it('should throw an error when custom properties are not strings or arrays', () => { + const payload = {}; + const destinationConfig = { + customPropsMapping: { + color: '1', + }, + propsDelimiter: { + color: ',', + }, + }; + const message = { + properties: { + color: 123, // Invalid type + }, + }; + + expect(() => handleCustomProperties(payload, destinationConfig, message)).toThrow( + InstrumentationError, + ); + }); +}); + +describe('stringifyValueAndJoinWithDelimiter', () => { + it('should join values with a delimiter after stringifying them', () => { + const values = [1, null, 'test', true]; + const result = stringifyValueAndJoinWithDelimiter(values, '|'); + + expect(result).toBe('1|null|test|true'); + }); + + it('should use the default delimiter if none is provided', () => { + const values = [1, 2, 3]; + const result = stringifyValueAndJoinWithDelimiter(values); + + expect(result).toBe('1;2;3'); + }); +}); + +describe('escapeToHTML', () => { + it('should escape HTML entities in a string', () => { + const input = '
&
'; + const result = escapeToHTML(input); + + expect(result).toBe('<div>&</div>'); + }); + + it('should return non-string values unchanged', () => { + const input = 123; + const result = escapeToHTML(input); + + expect(result).toBe(123); + }); +}); From 24a65a1dc49471afca7fbcfba41648b8553459fa Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Wed, 5 Feb 2025 09:38:38 +0530 Subject: [PATCH 062/160] chore: cleanup native intercom destination (#4045) --- src/v0/destinations/intercom/config.js | 53 ---- .../intercom/data/INTERCOMGroupConfig.json | 53 ---- .../intercom/data/INTERCOMIdentifyConfig.json | 46 ---- .../intercom/data/INTERCOMTrackConfig.json | 36 --- src/v0/destinations/intercom/transform.js | 252 ------------------ src/v0/destinations/intercom/util.js | 32 --- src/v0/destinations/intercom/util.test.js | 176 ------------ 7 files changed, 648 deletions(-) delete mode 100644 src/v0/destinations/intercom/config.js delete mode 100644 src/v0/destinations/intercom/data/INTERCOMGroupConfig.json delete mode 100644 src/v0/destinations/intercom/data/INTERCOMIdentifyConfig.json delete mode 100644 src/v0/destinations/intercom/data/INTERCOMTrackConfig.json delete mode 100644 src/v0/destinations/intercom/transform.js delete mode 100644 src/v0/destinations/intercom/util.js delete mode 100644 src/v0/destinations/intercom/util.test.js diff --git a/src/v0/destinations/intercom/config.js b/src/v0/destinations/intercom/config.js deleted file mode 100644 index ae29eebc1eb..00000000000 --- a/src/v0/destinations/intercom/config.js +++ /dev/null @@ -1,53 +0,0 @@ -const { getMappingConfig } = require('../../util'); - -const BASE_ENDPOINT = 'https://api.intercom.io'; - -// track events | Track -const TRACK_ENDPOINT = `${BASE_ENDPOINT}/events`; -// Create, Update a user with a company | Identify -const IDENTIFY_ENDPOINT = `${BASE_ENDPOINT}/users`; -// create, update, delete a company | Group -const GROUP_ENDPOINT = `${BASE_ENDPOINT}/companies`; - -const ConfigCategory = { - TRACK: { - endpoint: TRACK_ENDPOINT, - name: 'INTERCOMTrackConfig', - }, - IDENTIFY: { - endpoint: IDENTIFY_ENDPOINT, - name: 'INTERCOMIdentifyConfig', - }, - GROUP: { - endpoint: GROUP_ENDPOINT, - name: 'INTERCOMGroupConfig', - }, -}; - -const MappingConfig = getMappingConfig(ConfigCategory, __dirname); - -const ReservedTraitsProperties = [ - 'userId', - 'email', - 'phone', - 'name', - 'createdAt', - 'firstName', - 'lastName', - 'firstname', - 'lastname', - 'company', -]; - -const ReservedCompanyProperties = ['id', 'name', 'industry']; - -// ref:- https://developers.intercom.com/intercom-api-reference/v1.4/reference/event-metadata-types -const MetadataTypes = { richLink: ['url', 'value'], monetaryAmount: ['amount', 'currency'] }; - -module.exports = { - ConfigCategory, - MappingConfig, - ReservedCompanyProperties, - ReservedTraitsProperties, - MetadataTypes, -}; diff --git a/src/v0/destinations/intercom/data/INTERCOMGroupConfig.json b/src/v0/destinations/intercom/data/INTERCOMGroupConfig.json deleted file mode 100644 index 6857c4e1045..00000000000 --- a/src/v0/destinations/intercom/data/INTERCOMGroupConfig.json +++ /dev/null @@ -1,53 +0,0 @@ -[ - { - "destKey": "company_id", - "sourceKeys": "groupId", - "required": true - }, - { - "destKey": "name", - "sourceKeys": "name", - "sourceFromGenericMap": true, - "required": false - }, - { - "destKey": "plan", - "sourceKeys": ["traits.plan", "context.traits.plan"], - "required": false - }, - { - "destKey": "size", - "sourceKeys": ["traits.size", "context.traits.size"], - "metadata": { - "type": "toNumber" - }, - "required": false - }, - { - "destKey": "website", - "sourceKeys": "website", - "sourceFromGenericMap": true, - "required": false - }, - { - "destKey": "industry", - "sourceKeys": ["traits.industry", "context.traits.industry"], - "required": false - }, - { - "destKey": "monthly_spend", - "sourceKeys": ["traits.monthlySpend", "context.traits.monthlySpend"], - "metadata": { - "type": "toNumber" - }, - "required": false - }, - { - "destKey": "remote_created_at", - "sourceKeys": ["traits.remoteCreatedAt", "context.traits.remoteCreatedAt"], - "metadata": { - "type": "toNumber" - }, - "required": false - } -] diff --git a/src/v0/destinations/intercom/data/INTERCOMIdentifyConfig.json b/src/v0/destinations/intercom/data/INTERCOMIdentifyConfig.json deleted file mode 100644 index 726a741161e..00000000000 --- a/src/v0/destinations/intercom/data/INTERCOMIdentifyConfig.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "destKey": "user_id", - "sourceKeys": [ - "userId", - "traits.userId", - "traits.id", - "context.traits.userId", - "context.traits.id" - ], - "required": false - }, - { - "destKey": "email", - "sourceKeys": ["traits.email", "context.traits.email"], - "required": false - }, - { - "destKey": "phone", - "sourceKeys": ["traits.phone", "context.traits.phone"], - "required": false - }, - { - "destKey": "name", - "sourceKeys": ["traits.name", "context.traits.name"], - "required": false - }, - { - "destKey": "signed_up_at", - "sourceKeys": ["traits.createdAt", "context.traits.createdAt"], - "required": false, - "metadata": { - "type": "secondTimestamp" - } - }, - { - "destKey": "last_seen_user_agent", - "sourceKeys": "context.userAgent", - "required": false - }, - { - "destKey": "custom_attributes", - "sourceKeys": ["traits", "context.traits"], - "required": false - } -] diff --git a/src/v0/destinations/intercom/data/INTERCOMTrackConfig.json b/src/v0/destinations/intercom/data/INTERCOMTrackConfig.json deleted file mode 100644 index f33c9a8a982..00000000000 --- a/src/v0/destinations/intercom/data/INTERCOMTrackConfig.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "destKey": "user_id", - "sourceKeys": [ - "userId", - "traits.userId", - "traits.id", - "context.traits.userId", - "context.traits.id" - ], - "required": false - }, - { - "destKey": "email", - "sourceKeys": ["traits.email", "context.traits.email"], - "required": false - }, - { - "destKey": "event_name", - "sourceKeys": "event", - "required": true - }, - { - "destKey": "created", - "sourceKeys": "timestamp", - "sourceFromGenericMap": true, - "required": true, - "metadata": { - "type": "secondTimestamp" - } - }, - { - "destKey": "metadata", - "sourceKeys": "properties" - } -] diff --git a/src/v0/destinations/intercom/transform.js b/src/v0/destinations/intercom/transform.js deleted file mode 100644 index 212eaba13b5..00000000000 --- a/src/v0/destinations/intercom/transform.js +++ /dev/null @@ -1,252 +0,0 @@ -const md5 = require('md5'); -const get = require('get-value'); -const { InstrumentationError } = require('@rudderstack/integrations-lib'); -const { EventType, MappedToDestinationKey } = require('../../../constants'); -const { - ConfigCategory, - MappingConfig, - ReservedTraitsProperties, - ReservedCompanyProperties, -} = require('./config'); -const { - constructPayload, - removeUndefinedAndNullValues, - defaultRequestConfig, - defaultPostRequestConfig, - getFieldValueFromMessage, - addExternalIdToTraits, - simpleProcessRouterDest, - flattenJson, -} = require('../../util'); -const { separateReservedAndRestMetadata } = require('./util'); -const { JSON_MIME_TYPE } = require('../../util/constant'); - -function getCompanyAttribute(company) { - const companiesList = []; - if (company.name || company.id) { - const customAttributes = {}; - Object.keys(company).forEach((key) => { - // the key is not in ReservedCompanyProperties - if (!ReservedCompanyProperties.includes(key)) { - const val = company[key]; - if (val !== Object(val)) { - customAttributes[key] = val; - } else { - customAttributes[key] = JSON.stringify(val); - } - } - }); - - companiesList.push({ - company_id: company.id || md5(company.name), - custom_attributes: removeUndefinedAndNullValues(customAttributes), - name: company.name, - industry: company.industry, - }); - } - return companiesList; -} - -function validateIdentify(message, payload, config) { - const finalPayload = payload; - - finalPayload.update_last_request_at = - config.updateLastRequestAt !== undefined ? config.updateLastRequestAt : true; - if (payload.user_id || payload.email) { - if (payload.name === undefined || payload.name === '') { - const firstName = getFieldValueFromMessage(message, 'firstName'); - const lastName = getFieldValueFromMessage(message, 'lastName'); - if (firstName && lastName) { - finalPayload.name = `${firstName} ${lastName}`; - } else { - finalPayload.name = firstName || lastName; - } - } - - if (get(finalPayload, 'custom_attributes.company')) { - finalPayload.companies = getCompanyAttribute(finalPayload.custom_attributes.company); - } - - if (finalPayload.custom_attributes) { - ReservedTraitsProperties.forEach((trait) => { - delete finalPayload.custom_attributes[trait]; - }); - finalPayload.custom_attributes = flattenJson(finalPayload.custom_attributes); - } - - return finalPayload; - } - throw new InstrumentationError('Either of `email` or `userId` is required for Identify call'); -} - -function validateTrack(payload) { - if (!payload.user_id && !payload.email) { - throw new InstrumentationError('Either of `email` or `userId` is required for Track call'); - } - // pass only string, number, boolean properties - if (payload.metadata) { - // reserved metadata contains JSON objects that does not requires flattening - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(payload.metadata); - return { ...payload, metadata: { ...reservedMetadata, ...flattenJson(restMetadata) } }; - } - - return payload; -} - -const checkIfEmailOrUserIdPresent = (message, Config) => { - const { context, anonymousId } = message; - let { userId } = message; - if (Config.sendAnonymousId && !userId) { - userId = anonymousId; - } - return !!(userId || context.traits?.email); -}; - -function attachUserAndCompany(message, Config) { - const email = message.context?.traits?.email; - const { userId, anonymousId, traits, groupId } = message; - const requestBody = {}; - if (userId) { - requestBody.user_id = userId; - } - if (Config.sendAnonymousId && !userId) { - requestBody.user_id = anonymousId; - } - if (email) { - requestBody.email = email; - } - const companyObj = { - company_id: groupId, - }; - if (traits?.name) { - companyObj.name = traits.name; - } - requestBody.companies = [companyObj]; - const response = defaultRequestConfig(); - response.method = defaultPostRequestConfig.requestMethod; - response.endpoint = ConfigCategory.IDENTIFY.endpoint; - response.headers = { - 'Content-Type': JSON_MIME_TYPE, - Authorization: `Bearer ${Config.apiKey}`, - Accept: JSON_MIME_TYPE, - 'Intercom-Version': '1.4', - }; - response.body.JSON = requestBody; - return response; -} - -function buildCustomAttributes(message, payload) { - const finalPayload = payload; - const { traits } = message; - const customAttributes = {}; - const companyReservedKeys = [ - 'remoteCreatedAt', - 'monthlySpend', - 'industry', - 'website', - 'size', - 'plan', - 'name', - ]; - - if (traits) { - Object.keys(traits).forEach((key) => { - if (!companyReservedKeys.includes(key) && key !== 'userId') { - customAttributes[key] = traits[key]; - } - }); - } - - if (Object.keys(customAttributes).length > 0) { - finalPayload.custom_attributes = flattenJson(customAttributes); - } - - return finalPayload; -} - -function validateAndBuildResponse(message, payload, category, destination) { - const respList = []; - const response = defaultRequestConfig(); - response.method = defaultPostRequestConfig.requestMethod; - response.endpoint = category.endpoint; - response.headers = { - 'Content-Type': JSON_MIME_TYPE, - Authorization: `Bearer ${destination.Config.apiKey}`, - Accept: JSON_MIME_TYPE, - 'Intercom-Version': '1.4', - }; - response.userId = message.anonymousId; - const messageType = message.type.toLowerCase(); - switch (messageType) { - case EventType.IDENTIFY: - response.body.JSON = removeUndefinedAndNullValues( - validateIdentify(message, payload, destination.Config), - ); - break; - case EventType.TRACK: - response.body.JSON = removeUndefinedAndNullValues(validateTrack(payload)); - break; - case EventType.GROUP: { - response.body.JSON = removeUndefinedAndNullValues(buildCustomAttributes(message, payload)); - respList.push(response); - if (checkIfEmailOrUserIdPresent(message, destination.Config)) { - const attachUserAndCompanyResponse = attachUserAndCompany(message, destination.Config); - attachUserAndCompanyResponse.userId = message.anonymousId; - respList.push(attachUserAndCompanyResponse); - } - break; - } - default: - throw new InstrumentationError(`Message type ${messageType} not supported`); - } - - return messageType === EventType.GROUP ? respList : response; -} - -function processSingleMessage(message, destination) { - if (!message.type) { - throw new InstrumentationError('Message Type is not present. Aborting message.'); - } - const { sendAnonymousId } = destination.Config; - const messageType = message.type.toLowerCase(); - let category; - - switch (messageType) { - case EventType.IDENTIFY: - category = ConfigCategory.IDENTIFY; - break; - case EventType.TRACK: - category = ConfigCategory.TRACK; - break; - case EventType.GROUP: - category = ConfigCategory.GROUP; - break; - default: - throw new InstrumentationError(`Message type ${messageType} not supported`); - } - - // build the response and return - let payload; - if (get(message, MappedToDestinationKey)) { - addExternalIdToTraits(message); - payload = getFieldValueFromMessage(message, 'traits'); - } else { - payload = constructPayload(message, MappingConfig[category.name]); - } - if (category !== ConfigCategory.GROUP && sendAnonymousId && !payload.user_id) { - payload.user_id = message.anonymousId; - } - return validateAndBuildResponse(message, payload, category, destination); -} - -function process(event) { - const response = processSingleMessage(event.message, event.destination); - return response; -} - -const processRouterDest = async (inputs, reqMetadata) => { - const respList = await simpleProcessRouterDest(inputs, process, reqMetadata); - return respList; -}; - -module.exports = { process, processRouterDest }; diff --git a/src/v0/destinations/intercom/util.js b/src/v0/destinations/intercom/util.js deleted file mode 100644 index 24a2934f7e0..00000000000 --- a/src/v0/destinations/intercom/util.js +++ /dev/null @@ -1,32 +0,0 @@ -const { MetadataTypes } = require('./config'); - -/** - * Separates reserved metadata from rest of the metadata based on the metadata types - * ref:- https://developers.intercom.com/intercom-api-reference/v1.4/reference/event-metadata-types - * @param {*} metadata - * @returns - */ -function separateReservedAndRestMetadata(metadata) { - const reservedMetadata = {}; - const restMetadata = {}; - if (metadata) { - Object.entries(metadata).forEach(([key, value]) => { - if (value && typeof value === 'object') { - const hasMonetaryAmountKeys = MetadataTypes.monetaryAmount.every((type) => type in value); - const hasRichLinkKeys = MetadataTypes.richLink.every((type) => type in value); - if (hasMonetaryAmountKeys || hasRichLinkKeys) { - reservedMetadata[key] = value; - } else { - restMetadata[key] = value; - } - } else { - restMetadata[key] = value; - } - }); - } - - // Return the separated metadata objects - return { reservedMetadata, restMetadata }; -} - -module.exports = { separateReservedAndRestMetadata }; diff --git a/src/v0/destinations/intercom/util.test.js b/src/v0/destinations/intercom/util.test.js deleted file mode 100644 index 99dbdd1f7ec..00000000000 --- a/src/v0/destinations/intercom/util.test.js +++ /dev/null @@ -1,176 +0,0 @@ -const { separateReservedAndRestMetadata } = require('./util'); - -describe('separateReservedAndRestMetadata utility test', () => { - it('separate reserved and rest metadata', () => { - const metadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const expectedReservedMetadata = { - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const expectedRestMetadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - }; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - - expect(expectedReservedMetadata).toEqual(reservedMetadata); - expect(expectedRestMetadata).toEqual(restMetadata); - }); - - it('reserved metadata types not present in input metadata', () => { - const metadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - }; - const expectedRestMetadata = { - property1: 1, - property2: 'test', - property3: true, - property4: { - property1: 1, - property2: 'test', - property3: { - subProp1: { - a: 'a', - b: 'b', - }, - subProp2: ['a', 'b'], - }, - }, - property5: {}, - property6: [], - property7: null, - property8: undefined, - }; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - - expect({}).toEqual(reservedMetadata); - expect(expectedRestMetadata).toEqual(restMetadata); - }); - - it('metadata input contains only reserved metadata types', () => { - const metadata = { - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const expectedReservedMetadata = { - revenue: { - amount: 1232, - currency: 'inr', - test: 123, - }, - price: { - amount: 3000, - currency: 'USD', - }, - article: { - url: 'https://example.org/ab1de.html', - value: 'the dude abides', - }, - }; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - - expect(expectedReservedMetadata).toEqual(reservedMetadata); - expect({}).toEqual(restMetadata); - }); - - it('empty metadata object', () => { - const metadata = {}; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - expect({}).toEqual(reservedMetadata); - expect({}).toEqual(restMetadata); - }); - - it('null/undefined metadata', () => { - const metadata = null; - const { reservedMetadata, restMetadata } = separateReservedAndRestMetadata(metadata); - expect({}).toEqual(reservedMetadata); - expect({}).toEqual(restMetadata); - }); -}); From 91ef21dbc4fd06ee4eae469ff338b165931a0377 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:11:23 +0530 Subject: [PATCH 063/160] refactor: fix sonar issues in various components (#4017) * refactor: fix sonar issues in various components * chore: add test for missing lines * refactor: revert intercom as it will be deleted soon * chore: add unused-imports eslint rule * chore: remove unused-imports eslint rule it wasn't behaving very well with typescript so removed. --- package-lock.json | 4 +- src/v0/destinations/braze/util.js | 2 +- src/v0/destinations/clevertap/transform.js | 1 - .../fb_custom_audience/recordTransform.js | 214 +++++++++--------- .../ga4_v2/customMappingsHandler.js | 2 - .../google_cloud_function/util.js | 1 - test/integrations/component.test.ts | 42 ++-- .../fb_custom_audience/router/data.ts | 18 +- .../fb_custom_audience/router/rETL.ts | 27 ++- 9 files changed, 174 insertions(+), 137 deletions(-) diff --git a/package-lock.json b/package-lock.json index 553490b5830..b659934e61e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18312,7 +18312,9 @@ "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==" }, "node_modules/nanoid": { - "version": "3.3.7", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { diff --git a/src/v0/destinations/braze/util.js b/src/v0/destinations/braze/util.js index 74cb7fb9533..87119b91171 100644 --- a/src/v0/destinations/braze/util.js +++ b/src/v0/destinations/braze/util.js @@ -771,7 +771,7 @@ const collectStatsForAliasFailure = (brazeResponse, destinationId) => { if (!isDefinedAndNotNull(brazeResponse)) { return; } - const { aliases_processed: aliasesProcessed, errors } = brazeResponse; + const { aliases_processed: aliasesProcessed } = brazeResponse; if (aliasesProcessed === 0) { stats.increment('braze_alias_failure_count', { destination_id: destinationId }); } diff --git a/src/v0/destinations/clevertap/transform.js b/src/v0/destinations/clevertap/transform.js index e558b119f15..ee190246de5 100644 --- a/src/v0/destinations/clevertap/transform.js +++ b/src/v0/destinations/clevertap/transform.js @@ -404,7 +404,6 @@ const process = (event) => processEvent(event.message, event.destination); const processRouterDest = (inputs, reqMetadata) => { const eventsChunk = []; const errorRespList = []; - // const { destination } = inputs[0]; inputs.forEach((event) => { try { diff --git a/src/v0/destinations/fb_custom_audience/recordTransform.js b/src/v0/destinations/fb_custom_audience/recordTransform.js index db1fbeec595..719a53619e3 100644 --- a/src/v0/destinations/fb_custom_audience/recordTransform.js +++ b/src/v0/destinations/fb_custom_audience/recordTransform.js @@ -23,54 +23,68 @@ const { generateAppSecretProof, } = require('./util'); -const processRecordEventArray = ( - recordChunksArray, - userSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - operation, - audienceId, -) => { +/** + * Processes a single record and updates the data element. + * @param {Object} record - The record to process. + * @param {Array} userSchema - The schema defining user properties. + * @param {boolean} isHashRequired - Whether hashing is required. + * @param {boolean} disableFormat - Whether formatting is disabled. + * @returns {Object} - The processed data element and metadata. + */ +const processRecord = (record, userSchema, isHashRequired, disableFormat) => { + const { fields } = record.message; + let dataElement = []; + let nullUserData = true; + + userSchema.forEach((eachProperty) => { + const userProperty = fields[eachProperty]; + let updatedProperty = userProperty; + + if (isHashRequired && !disableFormat) { + updatedProperty = ensureApplicableFormat(eachProperty, userProperty); + } + + dataElement = getUpdatedDataElement(dataElement, isHashRequired, eachProperty, updatedProperty); + + if (dataElement[dataElement.length - 1]) { + nullUserData = false; + } + }); + + if (nullUserData) { + stats.increment('fb_custom_audience_event_having_all_null_field_values_for_a_user', { + destinationId: record.destination.ID, + nullFields: userSchema, + }); + } + + return { dataElement, metadata: record.metadata }; +}; + +/** + * Processes an array of record chunks and prepares the payload for sending. + * @param {Array} recordChunksArray - The array of record chunks. + * @param {Object} config - Configuration object containing userSchema, isHashRequired, disableFormat, etc. + * @param {Object} destination - The destination configuration. + * @param {string} operation - The operation to perform (e.g., 'add', 'remove'). + * @param {string} audienceId - The audience ID. + * @returns {Array} - The response events to send. + */ +const processRecordEventArray = (recordChunksArray, config, destination, operation, audienceId) => { + const { userSchema, isHashRequired, disableFormat, paramsPayload, prepareParams } = config; const toSendEvents = []; const metadata = []; + recordChunksArray.forEach((recordArray) => { - const data = []; - recordArray.forEach((input) => { - const { fields } = input.message; - let dataElement = []; - let nullUserData = true; - - userSchema.forEach((eachProperty) => { - const userProperty = fields[eachProperty]; - let updatedProperty = userProperty; - - if (isHashRequired && !disableFormat) { - updatedProperty = ensureApplicableFormat(eachProperty, userProperty); - } - - dataElement = getUpdatedDataElement( - dataElement, - isHashRequired, - eachProperty, - updatedProperty, - ); - - if (dataElement[dataElement.length - 1]) { - nullUserData = false; - } - }); - - if (nullUserData) { - stats.increment('fb_custom_audience_event_having_all_null_field_values_for_a_user', { - destinationId: destination.ID, - nullFields: userSchema, - }); - } - data.push(dataElement); - metadata.push(input.metadata); + const data = recordArray.map((input) => { + const { dataElement, metadata: recordMetadata } = processRecord( + input, + userSchema, + isHashRequired, + disableFormat, + ); + metadata.push(recordMetadata); + return dataElement; }); const prepareFinalPayload = lodash.cloneDeep(paramsPayload); @@ -90,16 +104,19 @@ const processRecordEventArray = ( }; const builtResponse = responseBuilderSimple(wrappedResponse, audienceId); - toSendEvents.push(builtResponse); }); }); - const response = getSuccessRespEvents(toSendEvents, metadata, destination, true); - - return response; + return getSuccessRespEvents(toSendEvents, metadata, destination, true); }; +/** + * Prepares the payload for the given events and configuration. + * @param {Array} events - The events to process. + * @param {Object} config - The configuration object. + * @returns {Array} - The final response payload. + */ function preparePayload(events, config) { const { audienceId, userSchema, isRaw, type, subType, isHashRequired, disableFormat } = config; const { destination } = events[0]; @@ -138,64 +155,32 @@ function preparePayload(events, config) { record.message.action?.toLowerCase(), ); - let insertResponse; - let deleteResponse; - let updateResponse; - - if (groupedRecordsByAction.delete) { - const deleteRecordChunksArray = returnArrayOfSubarrays( - groupedRecordsByAction.delete, - MAX_USER_COUNT, - ); - deleteResponse = processRecordEventArray( - deleteRecordChunksArray, - cleanUserSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - 'remove', - audienceId, - ); - } - - if (groupedRecordsByAction.insert) { - const insertRecordChunksArray = returnArrayOfSubarrays( - groupedRecordsByAction.insert, - MAX_USER_COUNT, - ); - - insertResponse = processRecordEventArray( - insertRecordChunksArray, - cleanUserSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - 'add', - audienceId, - ); - } + const processAction = (action, operation) => { + if (groupedRecordsByAction[action]) { + const recordChunksArray = returnArrayOfSubarrays( + groupedRecordsByAction[action], + MAX_USER_COUNT, + ); + return processRecordEventArray( + recordChunksArray, + { + userSchema: cleanUserSchema, + isHashRequired, + disableFormat, + paramsPayload, + prepareParams, + }, + destination, + operation, + audienceId, + ); + } + return null; + }; - if (groupedRecordsByAction.update) { - const updateRecordChunksArray = returnArrayOfSubarrays( - groupedRecordsByAction.update, - MAX_USER_COUNT, - ); - updateResponse = processRecordEventArray( - updateRecordChunksArray, - cleanUserSchema, - isHashRequired, - disableFormat, - paramsPayload, - prepareParams, - destination, - 'add', - audienceId, - ); - } + const deleteResponse = processAction('delete', 'remove'); + const insertResponse = processAction('insert', 'add'); + const updateResponse = processAction('update', 'add'); const errorResponse = getErrorResponse(groupedRecordsByAction); @@ -203,7 +188,6 @@ function preparePayload(events, config) { deleteResponse, insertResponse, updateResponse, - errorResponse, ); if (finalResponse.length === 0) { @@ -214,6 +198,11 @@ function preparePayload(events, config) { return finalResponse; } +/** + * Processes record inputs for V1 flow. + * @param {Array} groupedRecordInputs - The grouped record inputs. + * @returns {Array} - The processed payload. + */ function processRecordInputsV1(groupedRecordInputs) { const { destination } = groupedRecordInputs[0]; const { message } = groupedRecordInputs[0]; @@ -239,11 +228,15 @@ function processRecordInputsV1(groupedRecordInputs) { }); } +/** + * Processes record inputs for V2 flow. + * @param {Array} groupedRecordInputs - The grouped record inputs. + * @returns {Array} - The processed payload. + */ const processRecordInputsV2 = (groupedRecordInputs) => { const { connection, message } = groupedRecordInputs[0]; const { isHashRequired, disableFormat, type, subType, isRaw, audienceId } = connection.config.destination; - // Ref: https://www.notion.so/rudderstacks/VDM-V2-Final-Config-and-Record-EventPayload-8cc80f3d88ad46c7bc43df4b87a0bbff const identifiers = message?.identifiers; let userSchema; if (identifiers) { @@ -267,6 +260,11 @@ const processRecordInputsV2 = (groupedRecordInputs) => { }); }; +/** + * Processes record inputs based on the flow type. + * @param {Array} groupedRecordInputs - The grouped record inputs. + * @returns {Array} - The processed payload. + */ function processRecordInputs(groupedRecordInputs) { const event = groupedRecordInputs[0]; // First check for rETL flow and second check for ES flow diff --git a/src/v0/destinations/ga4_v2/customMappingsHandler.js b/src/v0/destinations/ga4_v2/customMappingsHandler.js index b5818d6fff1..2bdfd375e25 100644 --- a/src/v0/destinations/ga4_v2/customMappingsHandler.js +++ b/src/v0/destinations/ga4_v2/customMappingsHandler.js @@ -23,7 +23,6 @@ const { isEmptyObject, removeUndefinedAndNullValues, isHybridModeEnabled, - getIntegrationsObj, applyCustomMappings, } = require('../../util'); const { trackCommonConfig, ConfigCategory, mappingConfig } = require('../ga4/config'); @@ -145,7 +144,6 @@ const handleCustomMappings = (message, Config) => { const boilerplateOperations = (ga4Payload, message, Config, eventName) => { removeReservedParameterPrefixNames(ga4Payload.events[0].params); ga4Payload.events[0].name = eventName; - const integrationsObj = getIntegrationsObj(message, 'ga4_v2'); if (ga4Payload.events[0].params) { ga4Payload.events[0].params = removeInvalidParams( diff --git a/src/v0/destinations/google_cloud_function/util.js b/src/v0/destinations/google_cloud_function/util.js index 8f85460902c..a960f02ab04 100644 --- a/src/v0/destinations/google_cloud_function/util.js +++ b/src/v0/destinations/google_cloud_function/util.js @@ -30,7 +30,6 @@ function generateBatchedPayload(events) { let batchEventResponse = events.map((event) => event.message); // Batch event into dest batch structure events.forEach((ev) => { - // batchResponseList.push(ev.message.body.JSON); metadata.push(ev.metadata); }); batchEventResponse = { diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 27007b240dd..a0794f4ce02 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -80,6 +80,7 @@ beforeAll(async () => { }); afterAll(async () => { + await createHttpTerminator({ server }).terminate(); if (opts.generate === 'true') { const callsDataStr = responses.join('\n'); const calls = ` @@ -89,7 +90,6 @@ afterAll(async () => { `; appendFileSync(join(__dirname, 'destinations', opts.destination, 'network.ts'), calls); } - await createHttpTerminator({ server }).terminate(); }); let mockAdapter; if (!opts.generate || opts.generate === 'false') { @@ -234,27 +234,31 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { }); } - const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => { - if (tcData.module === tags.MODULES.SOURCE) { - return [ - { - tcData, - sourceTransformV2Flag: false, - descriptionSuffix: ' (sourceTransformV2Flag: false)', - }, - { - tcData, - sourceTransformV2Flag: true, - descriptionSuffix: ' (sourceTransformV2Flag: true)', - }, - ]; - } - return [{ tcData }]; - }); + const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => + tcData.module === tags.MODULES.SOURCE + ? [ + { + tcData, + sourceTransformV2Flag: false, + descriptionSuffix: ' (sourceTransformV2Flag: false)', + }, + { + tcData, + sourceTransformV2Flag: true, + descriptionSuffix: ' (sourceTransformV2Flag: true)', + }, + ] + : [ + { + tcData, + descriptionSuffix: '', + }, + ], + ); describe(`${testData[0].name} ${testData[0].module}`, () => { test.each(extendedTestData)( - '$tcData.feature -> $tcData.description $descriptionSuffix (index: $#)', + '$tcData.feature -> $tcData.description$descriptionSuffix (index: $#)', async ({ tcData, sourceTransformV2Flag }) => { tcData?.mockFns?.(mockAdapter); diff --git a/test/integrations/destinations/fb_custom_audience/router/data.ts b/test/integrations/destinations/fb_custom_audience/router/data.ts index 834b6315f6a..5946c7d6b8c 100644 --- a/test/integrations/destinations/fb_custom_audience/router/data.ts +++ b/test/integrations/destinations/fb_custom_audience/router/data.ts @@ -849,9 +849,10 @@ export const data = [ }, { name: 'fb_custom_audience', - description: 'rETL record V2 tests', + description: 'rETL record V2 tests with null values', scenario: 'Framework', - successCriteria: 'all record events should be transformed correctly based on their operation', + successCriteria: + 'all record events should be transformed correctly including records with null values', feature: 'router', module: 'destination', version: 'v0', @@ -890,6 +891,7 @@ export const data = [ 'b100c2ec0718fe6b4805b623aeec6710719d042ceea55f5c8135b010ec1c7b36', '1e14a2f476f7611a8b22bc85d14237fdc88aac828737e739416c32c5bce3bd16', ], + ['', ''], ], }, }, @@ -939,6 +941,18 @@ export const data = [ userId: 'default-userId', workspaceId: 'default-workspaceId', }, + { + attemptNum: 1, + destinationId: 'default-destinationId', + dontBatch: false, + jobId: 4, + secret: { + accessToken: 'default-accessToken', + }, + sourceId: 'default-sourceId', + userId: 'default-userId', + workspaceId: 'default-workspaceId', + }, ], batched: true, statusCode: 200, diff --git a/test/integrations/destinations/fb_custom_audience/router/rETL.ts b/test/integrations/destinations/fb_custom_audience/router/rETL.ts index f8d5fc89a03..5182b5380df 100644 --- a/test/integrations/destinations/fb_custom_audience/router/rETL.ts +++ b/test/integrations/destinations/fb_custom_audience/router/rETL.ts @@ -116,8 +116,8 @@ export const rETLRecordV2RouterRequest: RouterTransformationRequest = { version: '895/merge', }, }, - recordId: '2', - rudderId: '2', + recordId: '3', + rudderId: '3', identifiers: { EMAIL: 'subscribed@eewrfrd.com', FI: 'ghui', @@ -126,6 +126,29 @@ export const rETLRecordV2RouterRequest: RouterTransformationRequest = { }, metadata: generateMetadata(3), }, + { + destination: destinationV2, + connection: connection, + message: { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '4', + rudderId: '4', + identifiers: { + EMAIL: null, + FI: null, + }, + type: 'record', + }, + metadata: generateMetadata(4), + }, ], destType: 'fb_custom_audience', }; From ce86cecbc0a2edbdff8878541771a2ebcf3f6dd9 Mon Sep 17 00:00:00 2001 From: Sankeerth Date: Wed, 5 Feb 2025 14:27:05 +0530 Subject: [PATCH 064/160] fix: airship array handling (#4011) * fix: airship array handling * fix: add doc refs, validate timestamp attr value & auto format timestamp - add test-cases for the same * chore: add test-case for checking json attributes * fix: json attr presence logic - add component test-cases --------- Co-authored-by: Sai Sankeerth --- src/constants/destinationCanonicalNames.js | 1 + src/v0/destinations/airship/transform.js | 72 +-- src/v0/destinations/airship/utils.test.ts | 433 ++++++++++++++++++ src/v0/destinations/airship/utils.ts | 209 +++++++++ .../airship/processor/business.ts | 232 ++++++++++ .../destinations/airship/processor/data.ts | 3 + 6 files changed, 886 insertions(+), 64 deletions(-) create mode 100644 src/v0/destinations/airship/utils.test.ts create mode 100644 src/v0/destinations/airship/utils.ts create mode 100644 test/integrations/destinations/airship/processor/business.ts diff --git a/src/constants/destinationCanonicalNames.js b/src/constants/destinationCanonicalNames.js index e9b7dc136b9..819ada2aa1b 100644 --- a/src/constants/destinationCanonicalNames.js +++ b/src/constants/destinationCanonicalNames.js @@ -187,6 +187,7 @@ const DestCanonicalNames = { wunderkind: ['wunderkind', 'Wunderkind', 'WUNDERKIND'], cordial: ['cordial', 'Cordial', 'CORDIAL'], clevertap: ['clevertap', 'Clevertap', 'CleverTap', 'CLEVERTAP'], + airship: ['airship', 'Airship', 'AIRSHIP'], }; module.exports = { DestHandlerMap, DestCanonicalNames }; diff --git a/src/v0/destinations/airship/transform.js b/src/v0/destinations/airship/transform.js index 50b5f309553..d2244b542a3 100644 --- a/src/v0/destinations/airship/transform.js +++ b/src/v0/destinations/airship/transform.js @@ -7,7 +7,6 @@ const { groupMapping, BASE_URL_EU, BASE_URL_US, - RESERVED_TRAITS_MAPPING, AIRSHIP_TRACK_EXCLUSION, } = require('./config'); @@ -25,6 +24,7 @@ const { convertToUuid, } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); +const { prepareAttributePayload, prepareTagPayload } = require('./utils'); const DEFAULT_ACCEPT_HEADER = 'application/vnd.urbanairship+json; version=3'; @@ -37,7 +37,7 @@ const transformSessionId = (rawSessionId) => { }; const identifyResponseBuilder = (message, { Config }) => { - const tagPayload = constructPayload(message, identifyMapping); + const initialTagPayload = constructPayload(message, identifyMapping); const { apiKey, dataCenter } = Config; if (!apiKey) @@ -55,38 +55,10 @@ const identifyResponseBuilder = (message, { Config }) => { } // Creating tags and attribute payload - tagPayload.add = { rudderstack_integration: [] }; - tagPayload.remove = { rudderstack_integration: [] }; - let timestamp = getFieldValueFromMessage(message, 'timestamp'); - timestamp = new Date(timestamp).toISOString().replace(/\.\d{3}/, ''); + const tagPayload = prepareTagPayload(traits, initialTagPayload); // Creating attribute payload - const attributePayload = { attributes: [] }; - Object.keys(traits).forEach((key) => { - // tags - if (typeof traits[key] === 'boolean') { - const tag = key.toLowerCase().replace(/\./g, '_'); - if (traits[key] === true) { - tagPayload.add.rudderstack_integration.push(tag); - } - if (traits[key] === false) { - tagPayload.remove.rudderstack_integration.push(tag); - } - } - // attribute - if (typeof traits[key] !== 'boolean') { - const attribute = { action: 'set' }; - const keyMapped = RESERVED_TRAITS_MAPPING[key] || RESERVED_TRAITS_MAPPING[key.toLowerCase()]; - if (keyMapped) { - attribute.key = keyMapped; - } else { - attribute.key = key.replace(/\./g, '_'); - } - attribute.value = traits[key]; - attribute.timestamp = timestamp; - attributePayload.attributes.push(attribute); - } - }); + const attributePayload = prepareAttributePayload(traits, message); let tagResponse; let attributeResponse; @@ -183,7 +155,7 @@ const trackResponseBuilder = async (message, { Config }) => { }; const groupResponseBuilder = (message, { Config }) => { - const tagPayload = constructPayload(message, groupMapping); + const initTagPayload = constructPayload(message, groupMapping); const { apiKey, dataCenter } = Config; if (!apiKey) @@ -200,37 +172,9 @@ const groupResponseBuilder = (message, { Config }) => { ); } - tagPayload.add = { rudderstack_integration_group: [] }; - tagPayload.remove = { rudderstack_integration_group: [] }; - let timestamp = getFieldValueFromMessage(message, 'timestamp'); - timestamp = new Date(timestamp).toISOString().replace(/\.\d{3}/, ''); - - const attributePayload = { attributes: [] }; - Object.keys(traits).forEach((key) => { - // tags - if (typeof traits[key] === 'boolean') { - const tag = key.toLowerCase().replace(/\./g, '_'); - if (traits[key] === true) { - tagPayload.add.rudderstack_integration_group.push(tag); - } - if (traits[key] === false) { - tagPayload.remove.rudderstack_integration_group.push(tag); - } - } - // attribute - if (typeof traits[key] !== 'boolean') { - const attribute = { action: 'set' }; - const keyMapped = RESERVED_TRAITS_MAPPING[key.toLowerCase()]; - if (keyMapped) { - attribute.key = keyMapped; - } else { - attribute.key = key.replace(/\./g, '_'); - } - attribute.value = traits[key]; - attribute.timestamp = timestamp; - attributePayload.attributes.push(attribute); - } - }); + const tagPayload = prepareTagPayload(traits, initTagPayload, 'group'); + + const attributePayload = prepareAttributePayload(traits, message); let tagResponse; let attributeResponse; diff --git a/src/v0/destinations/airship/utils.test.ts b/src/v0/destinations/airship/utils.test.ts new file mode 100644 index 00000000000..cf637abb73c --- /dev/null +++ b/src/v0/destinations/airship/utils.test.ts @@ -0,0 +1,433 @@ +import { RudderMessage } from '../../../types'; +import { convertToUuid, flattenJson, getFieldValueFromMessage } from '../../util'; +import { getAirshipTimestamp, isValidTimestamp, prepareAttributePayload } from './utils'; + +type timestampTc = { + description: string; + input: string; + output?: string; + error?: string; +}; + +describe('Airship utils - getAirshipTimestamp', () => { + const timestampCases: timestampTc[] = [ + { + description: 'should return the same timestamp', + input: '2025-01-23T12:00:00Z', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should remove milliseconds', + input: '2025-01-23T12:00:00.123Z', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should remove milliseconds - 2', + input: '2025-01-23T12:00:00.123456Z', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should return with correct format when T is present but Z is not present', + input: '2025-01-23T12:00:00', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should return with correct format when T & Z is not present', + input: '2025-01-23 12:00:00', + output: '2025-01-23T12:00:00Z', + }, + { + description: 'should throw error when timestamp is not supported', + input: 'abcd', + error: 'timestamp is not supported: abcd', + }, + { + description: + 'should return with correct format when timestamp contains microseconds without Z', + input: '2025-01-23T12:00:00.123456', + output: '2025-01-23T12:00:00Z', + }, + ]; + + test.each(timestampCases)('getAirshipTimestamp - $description', ({ input, output, error }) => { + const message = { + timestamp: input, + } as unknown as RudderMessage; + if (error) { + expect(() => getAirshipTimestamp(message)).toThrow(error); + } else { + const timestamp = getAirshipTimestamp(message); + expect(timestamp).toBe(output); + } + }); +}); + +describe('Airship utils - prepareAttributePayload', () => { + const commonContextProps = { + app: { + build: '1', + name: 'Polarsteps', + namespace: 'com.polarsteps.Polarsteps', + version: '8.2.11', + }, + device: { + attTrackingStatus: 0, + id: '1d89c859-76c6-4374-ac0a-e32dee541e12', + manufacturer: 'Apple', + model: 'arm64', + name: 'iPhone 14 Pro Max', + type: 'iOS', + }, + library: { + name: 'rudder-ios-library', + version: '1.31.0', + }, + locale: 'en-US', + network: { + cellular: false, + wifi: true, + }, + os: { + name: 'iOS', + version: '17.0', + }, + screen: { + density: 3, + height: 932, + width: 430, + }, + sessionId: 1736246350, + timezone: 'Europe/Amsterdam', + }; + const commonEventProps = { + anonymousId: 'd00de6f3-2ea3-44bd-8fc5-0c318cb0b9d9', + channel: 'mobile', + messageId: 'b95d29ee-f9c8-486c-b9ef-acf231759612', + originalTimestamp: '2025-01-07T10:57:38.768Z', + receivedAt: '2025-01-07T10:57:49.882Z', + request_ip: '77.248.183.43', + rudderId: 'b931e94b-3b22-462c-8b58-243cb4b37366', + sentAt: '2025-01-07T10:57:47.707Z', + userId: '1c5577e3-8d2d-4ecd-9361-88c2bfb254c5', + }; + it('should return the correct attribute payload when jsonAttributes is not present in integrations object ', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + widgets_installed: ['no_widgets_installed', 'widgets_installed'], + }, + }, + event: 'identify', + integrations: { + All: true, + }, + type: 'identify', + } as unknown as RudderMessage; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'widgets_installed[0]', + value: 'no_widgets_installed', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'widgets_installed[1]', + value: 'widgets_installed', + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); + + it('should throw error when jsonAttributes is present in integrations object and jsonAttribute(widgets_installed#123) is array', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + widgets_installed: ['no_widgets_installed', 'widgets_installed'], + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + type: 'identify', + } as unknown as RudderMessage; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + expect(() => prepareAttributePayload(flattenedTraits, message)).toThrow( + 'JsonAttribute as array is not supported for widgets_installed#123 in Airship', + ); + }); + + it('should return the correct attribute payload when jsonAttributes is present in integrations object and jsonAttribute(widgets_installed#123) is object', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + }, + type: 'identify', + } as unknown as RudderMessage; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'widgets_installed#123', + value: { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); + + it('should return the correct attribute payload when jsonAttributes is present in integrations object and jsonAttribute(data) is object & traits include an object', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + data: { + recordId: '123', + recordType: 'user', + }, + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + }, + type: 'identify', + } as unknown as RudderMessage; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'data_recordId', + value: '123', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'data_recordType', + value: 'user', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'widgets_installed#123', + value: { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); + + it('should return the correct attribute payload when jsonAttributes is present in integrations object and jsonAttribute(widgets_installed#123) is object & traits include an object', () => { + const message = { + ...commonEventProps, + context: { + ...commonContextProps, + traits: { + af_install_time: '2024-12-09 12:26:29.643', + af_status: 'Organic', + firstName: 'Orcun', + lastName: 'Test', + data: { + recordId: '123', + recordType: 'user', + }, + widgets_installed: ['no_widgets_installed', 'widgets_installed'], + }, + }, + event: 'identify', + integrations: { + All: true, + AIRSHIP: { + JSONAttributes: { + 'widgets_installed#123': { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + }, + }, + }, + type: 'identify', + } as unknown as RudderMessage; + + const expectedAttributePayload = { + attributes: [ + { + action: 'set', + key: 'af_install_time', + value: '2024-12-09T12:26:29Z', + timestamp: '2025-01-07T10:57:38Z', + }, + { action: 'set', key: 'af_status', value: 'Organic', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'first_name', value: 'Orcun', timestamp: '2025-01-07T10:57:38Z' }, + { action: 'set', key: 'last_name', value: 'Test', timestamp: '2025-01-07T10:57:38Z' }, + { + action: 'set', + key: 'data_recordId', + value: '123', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'data_recordType', + value: 'user', + timestamp: '2025-01-07T10:57:38Z', + }, + { + action: 'set', + key: 'widgets_installed#123', + value: { + widgets: ['no_widgets_installed', 'widgets_installed'], + }, + timestamp: '2025-01-07T10:57:38Z', + }, + ], + }; + + const traits = getFieldValueFromMessage(message, 'traits'); + const flattenedTraits = flattenJson(traits); + // @ts-expect-error error with type + const attributePayload = prepareAttributePayload(flattenedTraits, message); + expect(attributePayload).toEqual(expectedAttributePayload); + }); +}); + +describe('Airship utils - isValidTimestamp', () => { + it('should return true when timestamp is a valid Unix timestamp', () => { + const timestamp = 1736246350; + expect(isValidTimestamp(timestamp)).toBe(true); + }); + + it('should return true when timestamp is a valid Unix timestamp with milliseconds', () => { + const timestamp = 1736246350 * 1000; + expect(isValidTimestamp(timestamp)).toBe(true); + }); + + it('should return true when timestamp is a valid date string', () => { + const timestamp = '2025-01-23T12:00:00Z'; + expect(isValidTimestamp(timestamp)).toBe(true); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string(invalid_timestamp)', () => { + const timestamp = 'invalid_timestamp'; + expect(isValidTimestamp(timestamp)).toBe(false); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string(uuid)', () => { + const timestamp = convertToUuid('invalid_timestamp'); + expect(isValidTimestamp(timestamp)).toBe(false); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string(91504)', () => { + const timestamp = 91504; + expect(isValidTimestamp(timestamp)).toBe(false); + }); + + it('should return false when timestamp is not a valid Unix timestamp or date string("91504")', () => { + const timestamp = '91504'; + expect(isValidTimestamp(timestamp)).toBe(false); + }); +}); diff --git a/src/v0/destinations/airship/utils.ts b/src/v0/destinations/airship/utils.ts new file mode 100644 index 00000000000..d8c48fa2d04 --- /dev/null +++ b/src/v0/destinations/airship/utils.ts @@ -0,0 +1,209 @@ +import moment from 'moment'; +import { InstrumentationError } from '@rudderstack/integrations-lib'; +import { RudderMessage } from '../../../types'; +import { getFieldValueFromMessage, getIntegrationsObj } from '../../util'; +import { RESERVED_TRAITS_MAPPING } from './config'; + +export type TagPayloadEventType = 'identify' | 'group'; + +type AirshipTagProperties = { + identify: 'rudderstack_integration'; + group: 'rudderstack_integration_group'; +}; + +const AIRSHIP_TAG_PROPERTIES: Record = { + identify: 'rudderstack_integration', + group: 'rudderstack_integration_group', +}; + +type AirshipTag = { + [K in keyof Pick]: string[]; +}; + +type TagPayload = { + add: AirshipTag[T]; + remove: AirshipTag[T]; + [key: string]: unknown; +}; + +type AttributeValue = string | number | object; + +type Attribute = { + action: 'set' | 'remove'; + key: string; + value?: AttributeValue; + timestamp: string; +}; + +type AttributePayload = { + attributes: Attribute[]; +}; + +type AirshipIntegrationsObj = { + JSONAttributes: Record; + removeAttributes: string[]; +}; + +type AirshipObjectAttributes = Partial<{ + jsonAttributes: Attribute[]; + removeAttributes: Omit[]; +}>; + +const getDigitCount = (num: number): number => Math.floor(Math.log10(Math.abs(num))) + 1; + +export const isValidTimestamp = (timestamp: string | number): boolean => { + // Check if timestamp is a valid Unix timestamp (10 digits) + if (typeof timestamp === 'number' || !Number.isNaN(Number(timestamp))) { + return getDigitCount(Number(timestamp)) >= 10; + } + + // Check if timestamp is a valid date string + const date = moment.utc(timestamp); + return date.isValid() && date.year() >= 1970; +}; + +// Airship timestamp format: https://docs.airship.com/api/ua/#api-request-format +const AIRSHIP_TIMESTAMP_FORMAT = 'YYYY-MM-DD[T]HH:mm:ss[Z]'; + +const convertToAirshipTimestamp = (timestamp: string) => { + if (!timestamp || !moment(timestamp).isValid()) { + throw new InstrumentationError(`timestamp is not supported: ${timestamp}`); + } + return moment.utc(timestamp).format(AIRSHIP_TIMESTAMP_FORMAT); +}; + +export const getAirshipTimestamp = (message: RudderMessage) => { + const timestamp = getFieldValueFromMessage(message, 'timestamp'); + return convertToAirshipTimestamp(timestamp); +}; + +export const prepareTagPayload = ( + flattenedTraits: Record, + initTagPayload: TagPayload, + eventType: TagPayloadEventType = 'identify', +): TagPayload => { + const property = AIRSHIP_TAG_PROPERTIES[eventType]; + const initialTagPayload: TagPayload = { + ...initTagPayload, + add: { + [property]: [], + } as unknown as AirshipTag[TagPayloadEventType], + remove: { + [property]: [], + } as unknown as AirshipTag[TagPayloadEventType], + }; + + const tagPayload = Object.entries(flattenedTraits).reduce((acc, [key, value]) => { + // tags + if (typeof value === 'boolean') { + const tag = key.toLowerCase().replace(/\./g, '_'); + if (value === true) { + acc.add[property].push(tag); + } + if (value === false) { + acc.remove[property].push(tag); + } + } + return acc; + }, initialTagPayload); + return tagPayload; +}; + +const getJsonAttributesFromIntegrationsObj = (message: RudderMessage): AirshipObjectAttributes => { + const integrationsObj = getIntegrationsObj( + message, + 'airship' as any, + ) as Partial; + const timestamp = getAirshipTimestamp(message); + const airshipObjectAttributes: AirshipObjectAttributes = {}; + if (integrationsObj?.JSONAttributes) { + airshipObjectAttributes.jsonAttributes = Object.entries(integrationsObj.JSONAttributes).map( + ([key, value]) => { + // object attribute type in Airship: https://docs.airship.com/api/ua/#schemas-setattributeobject + if (Array.isArray(value)) { + throw new InstrumentationError( + `JsonAttribute as array is not supported for ${key} in Airship`, + ); + } + return { + action: 'set', + key, + value: value as AttributeValue, + timestamp, + }; + }, + ); + } + if (integrationsObj?.removeAttributes) { + // Remove Attributes in Airship: https://docs.airship.com/api/ua/#schemas-removeattributeobject + airshipObjectAttributes.removeAttributes = integrationsObj.removeAttributes.map((key) => ({ + action: 'remove', + key, + timestamp, + })); + } + return airshipObjectAttributes; +}; + +export const getAttributeValue = (value: string | number | object): AttributeValue => { + if (isValidTimestamp(value as string)) { + return convertToAirshipTimestamp(value as string); + } + return value as AttributeValue; +}; + +export const prepareAttributePayload = ( + flattenedTraits: Record, + message: RudderMessage, +): AttributePayload => { + const timestamp = getAirshipTimestamp(message); + const initialAttributePayload: AttributePayload = { attributes: [] }; + const airshipObjectAttributes: AirshipObjectAttributes = + getJsonAttributesFromIntegrationsObj(message); + + const isJsonAttributesPresent = + Array.isArray(airshipObjectAttributes?.jsonAttributes) && + airshipObjectAttributes?.jsonAttributes.length > 0; + + const attributePayload = Object.entries(flattenedTraits).reduce((acc, [key, value]) => { + // attribute + if (typeof value !== 'boolean') { + const attribute: Attribute = { action: 'set', key: '', value: '', timestamp }; + const keyMapped = RESERVED_TRAITS_MAPPING[key] || RESERVED_TRAITS_MAPPING[key.toLowerCase()]; + const isKeyObjectType = key.includes('.') || (key.includes('[') && key.includes(']')); + if (keyMapped) { + attribute.key = keyMapped; + } else { + attribute.key = key.replace(/\./g, '_'); + } + if (isJsonAttributesPresent && isKeyObjectType) { + // Skip these keys + // they can be in the form of an array or object + const keyParts = key?.split(/[[\]_]+/g) || []; + if (keyParts.length === 0) { + // If key doesn't include any of the delimiters like '[' or ']' or '_' , skip it + return acc; + } + // Skip keys that exist in both traits and integrations object to avoid duplication + const isKeyPresentInJsonAttributes = airshipObjectAttributes.jsonAttributes?.some((attr) => + attr.key.includes(keyParts[0]), + ); + if (isKeyPresentInJsonAttributes) { + // Skip this key + return acc; + } + } + attribute.value = getAttributeValue(value as AttributeValue); + acc.attributes.push(attribute); + } + return acc; + }, initialAttributePayload); + + attributePayload.attributes = [ + ...attributePayload.attributes, + ...(airshipObjectAttributes?.jsonAttributes || []), + ...(airshipObjectAttributes?.removeAttributes || []), + ]; + + return attributePayload; +}; diff --git a/test/integrations/destinations/airship/processor/business.ts b/test/integrations/destinations/airship/processor/business.ts new file mode 100644 index 00000000000..0fbf140720c --- /dev/null +++ b/test/integrations/destinations/airship/processor/business.ts @@ -0,0 +1,232 @@ +const arrayHandlingCases = [ + { + description: + '[identify] should send array traits as is to airship when present in integrationsObject(even when similar key is present in traits)', + inputEvent: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testone@gmail.com', + firstName: 'test', + lastName: 'one', + colors: ['red', 'blue'], + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-US', + ip: '0.0.0.0', + os: { name: '', version: '' }, + screen: { density: 2 }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', + originalTimestamp: '2019-10-14T09:03:17.562Z', + anonymousId: '123456', + userId: 'testuserId1', + integrations: { + All: true, + Airship: { + JSONAttributes: { + 'colors#r012': { + colors: ['green', 'yellow'], + }, + }, + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + expectedOutputResponse: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://go.urbanairship.com/api/named_users/testuserId1/attributes', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/vnd.urbanairship+json; version=3', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + attributes: [ + { + action: 'set', + key: 'email', + value: 'testone@gmail.com', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'first_name', + value: 'test', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'last_name', + value: 'one', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'colors#r012', + value: { + colors: ['green', 'yellow'], + }, + timestamp: '2019-10-14T09:03:17Z', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + // not expected in reality & leads to error in airship, but just to test the delimiter handling + { + description: '[identify] should handle keys with delimiters and JSON attributes correctly', + inputEvent: { + channel: 'web', + context: { + traits: { + preferences: ['value1'], // should be processed as preferences_0 + 'settings.theme': 'dark', + 'data[test]_value': 'test', + simple: 'value', // no delimiters + 'company[location]': 'SF', // should be processed since not in JSONAttributes + }, + }, + type: 'identify', + messageId: '84e26acc-56a5-4835-8233-591137fca468', + originalTimestamp: '2019-10-14T09:03:17.562Z', + userId: 'testuserId1', + integrations: { + All: true, + Airship: { + JSONAttributes: { + 'company#pow2': { + name: 'Test Corp', + size: 100, + }, + }, + }, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + expectedOutputResponse: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://go.urbanairship.com/api/named_users/testuserId1/attributes', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/vnd.urbanairship+json; version=3', + Authorization: 'Bearer dummyApiKey', + }, + params: {}, + body: { + JSON: { + attributes: [ + { + action: 'set', + key: 'preferences[0]', + value: 'value1', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'settings_theme', + value: 'dark', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'data[test]_value', + value: 'test', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'simple', + value: 'value', + timestamp: '2019-10-14T09:03:17Z', + }, + { + action: 'set', + key: 'company#pow2', + value: { + name: 'Test Corp', + size: 100, + }, + timestamp: '2019-10-14T09:03:17Z', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, +]; + +const getIdentifyTestCase = ({ description, inputEvent, expectedOutputResponse }) => { + return { + name: 'airship', + description: description, + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: inputEvent, + destination: { + Config: { + apiKey: 'dummyApiKey', + appKey: 'O2YARRI15I', + dataCenter: false, + }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: expectedOutputResponse, + }, + }; +}; + +export const identifyTestCases = arrayHandlingCases.map((tc) => getIdentifyTestCase(tc)); diff --git a/test/integrations/destinations/airship/processor/data.ts b/test/integrations/destinations/airship/processor/data.ts index 973a6be0ecc..cd1a7fac9b7 100644 --- a/test/integrations/destinations/airship/processor/data.ts +++ b/test/integrations/destinations/airship/processor/data.ts @@ -1,4 +1,7 @@ +import { identifyTestCases } from './business'; + export const data = [ + ...identifyTestCases, { name: 'airship', description: 'Test 0', From b71d1d496a15fc2d4e6deb8f232cffa74a2c88fb Mon Sep 17 00:00:00 2001 From: Jayachand Mopidevi Date: Wed, 5 Feb 2025 16:07:07 +0530 Subject: [PATCH 065/160] chore: add transformation tags to input and output event stats (#3984) * chore: add transformation tags to input and output event stats --- src/services/userTransform.ts | 24 ++++++++++++++++++------ src/util/prometheus.js | 26 ++++++++++++-------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/services/userTransform.ts b/src/services/userTransform.ts index 2afad88c56a..345985d5179 100644 --- a/src/services/userTransform.ts +++ b/src/services/userTransform.ts @@ -38,7 +38,6 @@ export class UserTransformService { `${event.metadata.destinationId}_${event.metadata.sourceId}`, ); stats.counter('user_transform_function_group_size', Object.entries(groupedEvents).length, {}); - stats.histogram('user_transform_input_events', events.length, {}); const transformedEvents: FixMe[] = []; let librariesVersionIDs: FixMe[] = []; @@ -63,11 +62,12 @@ export class UserTransformService { const messageIdsInOutputSet = new Set(); + const workspaceId = eventsToProcess[0]?.metadata.workspaceId; const commonMetadata = { sourceId: eventsToProcess[0]?.metadata?.sourceId, destinationId: eventsToProcess[0]?.metadata.destinationId, destinationType: eventsToProcess[0]?.metadata.destinationType, - workspaceId: eventsToProcess[0]?.metadata.workspaceId, + workspaceId, transformationId: eventsToProcess[0]?.metadata.transformationId, messageIds, }; @@ -76,6 +76,7 @@ export class UserTransformService { eventsToProcess.length > 0 && eventsToProcess[0].metadata ? getMetadata(eventsToProcess[0].metadata) : {}; + const transformationTags = getTransformationMetadata(eventsToProcess[0]?.metadata); if (!transformationVersionId) { const errorMessage = 'Transformation VersionID not found'; @@ -87,6 +88,11 @@ export class UserTransformService { } as ProcessorTransformationResponse); return transformedEvents; } + stats.counter('user_transform_input_events', events.length, { workspaceId }); + logger.info('user_transform_input_events', { + inCount: events.length, + ...transformationTags, + }); const userFuncStartTime = new Date(); try { const destTransformedEvents: UserTransformationResponse[] = await userTransformHandler()( @@ -167,22 +173,28 @@ export class UserTransformService { stats.counter('user_transform_errors', eventsToProcess.length, { status, ...metaTags, - ...getTransformationMetadata(eventsToProcess[0]?.metadata), + ...transformationTags, }); } finally { stats.timingSummary('user_transform_request_latency_summary', userFuncStartTime, { ...metaTags, - ...getTransformationMetadata(eventsToProcess[0]?.metadata), + ...transformationTags, }); stats.summary('user_transform_batch_size_summary', requestSize, { ...metaTags, - ...getTransformationMetadata(eventsToProcess[0]?.metadata), + ...transformationTags, }); } stats.counter('user_transform_requests', 1, {}); - stats.histogram('user_transform_output_events', transformedEvents.length, {}); + stats.counter('user_transform_output_events', transformedEvents.length, { + workspaceId, + }); + logger.info('user_transform_output_events', { + outCount: transformedEvents.length, + ...transformationTags, + }); return transformedEvents; }), ); diff --git a/src/util/prometheus.js b/src/util/prometheus.js index 18cbcdf6b7e..af3f1c5fc19 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -864,6 +864,18 @@ class Prometheus { { name: 'get_tracking_plan', help: 'get_tracking_plan', type: 'histogram', labelNames: [] }, // User transform metrics // counter + { + name: 'user_transform_input_events', + help: 'Number of input events to user transform', + type: 'counter', + labelNames: ['workspaceId'], + }, + { + name: 'user_transform_output_events', + help: 'user_transform_output_events', + type: 'counter', + labelNames: ['workspaceId'], + }, { name: 'user_transform_function_group_size', help: 'user_transform_function_group_size', @@ -954,20 +966,6 @@ class Prometheus { type: 'histogram', labelNames: ['identifier', 'transformationId', 'workspaceId'], }, - { - name: 'user_transform_input_events', - help: 'Number of input events to user transform', - type: 'histogram', - labelNames: [], - buckets: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 150, 200], - }, - { - name: 'user_transform_output_events', - help: 'user_transform_output_events', - type: 'histogram', - labelNames: [], - buckets: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 150, 200], - }, // summary { name: 'user_transform_request_latency_summary', From 62705c0613f3c38b8f3e6baf047467ce97878625 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Thu, 6 Feb 2025 11:52:54 +0530 Subject: [PATCH 066/160] fix: update google ads api version for gaoc (#4047) * fix: update google ads api version for gaoc * chore: add unit tests --- .../config.js | 2 +- .../utils.test.js | 8 ++-- .../dataDelivery/business.ts | 18 ++++---- .../dataDelivery/oauth.ts | 12 ++--- .../network.ts | 34 +++++++------- .../processor/data.ts | 44 +++++++++---------- .../router/data.ts | 10 ++--- 7 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/v0/destinations/google_adwords_offline_conversions/config.js b/src/v0/destinations/google_adwords_offline_conversions/config.js index 6eec1068a6b..ce0fc45e47e 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/config.js +++ b/src/v0/destinations/google_adwords_offline_conversions/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const API_VERSION = 'v16'; +const API_VERSION = 'v17'; const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers/:customerId`; diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js index b6c66537829..59141fce3bc 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js @@ -163,7 +163,7 @@ describe('getExisitingUserIdentifier util tests', () => { describe('getClickConversionPayloadAndEndpoint util tests', () => { it('getClickConversionPayloadAndEndpoint flow check when default field identifier is present', () => { let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', payload: { conversions: [ { @@ -193,7 +193,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { delete fittingPayload.traits.email; delete fittingPayload.properties.email; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', payload: { conversions: [ { @@ -225,7 +225,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { delete fittingPayload.traits.phone; delete fittingPayload.properties.email; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', payload: { conversions: [ { @@ -263,7 +263,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { }, ]; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', payload: { conversions: [ { diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts index 87aafea0afa..08abb008cf5 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts @@ -235,7 +235,7 @@ export const testScenariosForV0API = [ params: params.param1, JSON: invalidArgumentRequestPayload, endpoint: - 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs', }), method: 'POST', }, @@ -309,7 +309,7 @@ export const testScenariosForV0API = [ headers: headers.header1, params: params.param1, JSON: validRequestPayload1, - endpoint: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + endpoint: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', }), method: 'POST', }, @@ -350,7 +350,7 @@ export const testScenariosForV0API = [ params: params.param2, JSON: validRequestPayload2, endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', }), method: 'POST', }, @@ -400,7 +400,7 @@ export const testScenariosForV0API = [ params: params.param3, JSON: validRequestPayload2, endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', }), method: 'POST', }, @@ -453,7 +453,7 @@ export const testScenariosForV1API = [ params: params.param1, JSON: invalidArgumentRequestPayload, endpoint: - 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs', }, metadataArray, ), @@ -500,7 +500,7 @@ export const testScenariosForV1API = [ params: params.param1, JSON: validRequestPayload1, endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', }, metadataArray, ), @@ -545,7 +545,7 @@ export const testScenariosForV1API = [ params: params.param2, JSON: validRequestPayload2, endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', }, metadataArray, ), @@ -591,7 +591,7 @@ export const testScenariosForV1API = [ params: params.param3, JSON: validRequestPayload2, endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', }, metadataArray, ), @@ -637,7 +637,7 @@ export const testScenariosForV1API = [ params: params.param4, JSON: notAllowedToAccessFeatureRequestPayload, endpoint: - 'https://googleads.googleapis.com/v16/customers/1234567893:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/1234567893:uploadClickConversions', }, metadataArray, ), diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts index 4437ebb912c..2a79a5e3112 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts @@ -95,7 +95,7 @@ export const v0oauthScenarios = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + endpoint: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', }), method: 'POST', }, @@ -138,7 +138,7 @@ export const v0oauthScenarios = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v16/customers/1234/offlineUserDataJobs', + endpoint: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs', }), method: 'POST', }, @@ -184,7 +184,7 @@ export const v1oauthScenarios = [ { ...commonRequestParameters, endpoint: - 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', }, metadataArray, ), @@ -230,7 +230,7 @@ export const v1oauthScenarios = [ body: generateProxyV1Payload( { ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v16/customers/1234/offlineUserDataJobs', + endpoint: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs', }, metadataArray, ), @@ -282,7 +282,7 @@ export const v1oauthScenarios = [ 'login-customer-id': 'logincustomerid', }, endpoint: - 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', }, metadataArray, ), @@ -354,7 +354,7 @@ export const v1oauthScenarios = [ 'login-customer-id': 'logincustomerid', }, endpoint: - 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', }, metadataArray, ), diff --git a/test/integrations/destinations/google_adwords_offline_conversions/network.ts b/test/integrations/destinations/google_adwords_offline_conversions/network.ts index 0ab6bef1db7..66856933d99 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/network.ts @@ -30,7 +30,7 @@ const commonResponse = { export const networkCallsData = [ { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs:create', + url: 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs:create', data: { job: { storeSalesMetadata: { @@ -59,7 +59,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/googleAds:searchStream', + url: 'https://googleads.googleapis.com/v17/customers/1112223333/googleAds:searchStream', data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`, }, @@ -92,7 +92,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations', + url: 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations', data: { enable_partial_failure: false, enable_warnings: false, @@ -173,7 +173,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs:create', + url: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs:create', data: { job: { storeSalesMetadata: { @@ -202,7 +202,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations', + url: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations', data: { enable_partial_failure: false, enable_warnings: false, @@ -245,7 +245,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run', + url: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run', data: { validate_only: false }, params: { destination: 'google_adwords_offline_conversion' }, headers: { @@ -267,7 +267,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request with invalid authentication credentials', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create', + url: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs:create', data: { job: { storeSalesMetadata: { @@ -303,7 +303,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request with invalid authentication scopes', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234/offlineUserDataJobs:create', + url: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs:create', data: { job: { storeSalesMetadata: { @@ -336,7 +336,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567890/googleAds:searchStream', + url: 'https://googleads.googleapis.com/v17/customers/1234567890/googleAds:searchStream', data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`, }, @@ -364,7 +364,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891/googleAds:searchStream', + url: 'https://googleads.googleapis.com/v17/customers/1234567891/googleAds:searchStream', data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", @@ -397,7 +397,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891/googleAds:searchStream', + url: 'https://googleads.googleapis.com/v17/customers/1234567891/googleAds:searchStream', data: { query: 'SELECT conversion_custom_variable.name FROM conversion_custom_variable' }, headers: { Authorization: 'Bearer abcd1234', @@ -431,7 +431,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + url: 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', data: { conversions: [ { @@ -498,7 +498,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567891:uploadClickConversions', + url: 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', data: { conversions: [ { @@ -559,7 +559,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567893/googleAds:searchStream', + url: 'https://googleads.googleapis.com/v17/customers/1234567893/googleAds:searchStream', data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", @@ -592,7 +592,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1234567893:uploadClickConversions', + url: 'https://googleads.googleapis.com/v17/customers/1234567893:uploadClickConversions', data: { conversions: [ { @@ -678,7 +678,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs:create', + url: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs:create', data: { job: { storeSalesMetadata: { @@ -704,7 +704,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', httpReq: { - url: 'https://googleads.googleapis.com/v16/customers/1112223333/googleAds:searchStream', + url: 'https://googleads.googleapis.com/v17/customers/1112223333/googleAds:searchStream', data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", diff --git a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts index 7ce05c17e06..82ea4fcfcee 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts @@ -176,7 +176,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -467,7 +467,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -758,7 +758,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -1049,7 +1049,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2023,7 +2023,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2129,7 +2129,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2353,7 +2353,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2553,7 +2553,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2789,7 +2789,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -3012,7 +3012,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -3520,7 +3520,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -3763,7 +3763,7 @@ export const data = [ XML: {}, }, endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', files: {}, headers: { Authorization: 'Bearer abcd1234', @@ -3937,7 +3937,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4129,7 +4129,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4466,7 +4466,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4665,7 +4665,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4867,7 +4867,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5031,7 +5031,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5191,7 +5191,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5349,7 +5349,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5504,7 +5504,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5665,7 +5665,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1112223333/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', diff --git a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts index bcc718485b3..bb0b4c6c44b 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts @@ -484,7 +484,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/7693729833/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -566,7 +566,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/7693729833:uploadCallConversions', + 'https://googleads.googleapis.com/v17/customers/7693729833:uploadCallConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -681,7 +681,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadClickConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -816,7 +816,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/9625812972:uploadCallConversions', + 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -1170,7 +1170,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://googleads.googleapis.com/v16/customers/1234556775/offlineUserDataJobs', + 'https://googleads.googleapis.com/v17/customers/1234556775/offlineUserDataJobs', headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', From 787aae7537e2f12da2e4e0c1bc02af4d127f0948 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 6 Feb 2025 06:28:15 +0000 Subject: [PATCH 067/160] chore(release): 1.90.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a51cc18eed9..2e0c2254396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.90.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.0...v1.90.1) (2025-02-06) + + +### Bug Fixes + +* update google ads api version for gaoc ([#4047](https://github.com/rudderlabs/rudder-transformer/issues/4047)) ([62705c0](https://github.com/rudderlabs/rudder-transformer/commit/62705c0613f3c38b8f3e6baf047467ce97878625)) + ## [1.90.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.89.1...v1.90.0) (2025-02-03) diff --git a/package-lock.json b/package-lock.json index 1f078475e92..ebe79b957ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.90.0", + "version": "1.90.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.90.0", + "version": "1.90.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 0ce6152d4c8..b6fb5b42884 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.90.0", + "version": "1.90.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From bdd735df38d92b6658250e500d13f3e4b4c7ffad Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:43:16 +0530 Subject: [PATCH 068/160] feat: added drop traits in track call feature for mixpanel (#4034) * feat: added drop traits in track call feature for mixpanel * Apply suggestions from code review Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> * chore: apply suggestions from code review Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> * fix: fix commit message * fix: added tests and fixed the drop traits condition * chore: update src/v0/destinations/mp/transform.js --------- Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --- src/v0/destinations/mp/transform.js | 7 +- .../destinations/mp/processor/data.ts | 175 ++++++++++++++++++ 2 files changed, 181 insertions(+), 1 deletion(-) diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index 02eca8ed22f..1860f9c9db8 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -163,9 +163,14 @@ const getEventValueForTrackEvent = (message, destination) => { } const unixTimestamp = toUnixTimestampInMS(message.timestamp || message.originalTimestamp); + + const traits = destination.Config?.dropTraitsInTrackEvent + ? {} + : { ...message?.context?.traits }; + let properties = { ...message.properties, - ...get(message, 'context.traits'), + ...traits, ...mappedProperties, token: destination.Config.token, distinct_id: message.userId || message.anonymousId, diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index 9c385daee4b..064b25520a9 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -6190,4 +6190,179 @@ export const data = [ }, }, }, + { + name: 'mp', + description: 'Track event test when dropTraitsInTrackEvent is true', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(sampleDestination, { + dropTraitsInTrackEvent: true, + }), + message: { + type: 'track', + event: 'FirstTrackCall12', + sentAt: '2021-09-30T07:15:23.523Z', + channel: 'web', + context: { + os: { name: '', version: '' }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.18', + namespace: 'com.rudderlabs.javascript', + }, + page: { + url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + path: '/Testing/App_for_testingTool/', + title: 'Document', + search: '', + tab_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + referrer: 'http://127.0.0.1:7307/Testing/', + initial_referrer: 'http://127.0.0.1:7307/Testing/', + referring_domain: '127.0.0.1:7307', + initial_referring_domain: '127.0.0.1:7307', + }, + locale: 'en-US', + screen: { width: 1440, height: 900, density: 2, innerWidth: 590, innerHeight: 665 }, + traits: { + anonymousId: 'ea776ad0-3136-44fb-9216-5b1578609a2b', + userId: 'as09sufa09usaf09as0f9uasf', + id: 'as09sufa09usaf09as0f9uasf', + firstName: 'Bob', + lastName: 'Marley', + name: 'Bob Marley', + age: 43, + email: 'bob@marleymail.com', + phone: '+447748544123', + birthday: '1987-01-01T20:08:59+0000', + createdAt: '2022-01-21T14:10:12+0000', + address: '51,B.L.T road, Kolkata-700060', + description: 'I am great', + gender: 'male', + title: 'Founder', + username: 'bobm', + website: 'https://bobm.com', + randomProperty: 'randomValue', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36', + }, + rudderId: '294702c7-8732-4fb3-b39f-f3bdffe1aa88', + messageId: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + properties: { foo: 'bar', $deviceId: 'nkasdnkasd' }, + anonymousId: '1dbb5784-b8e2-4074-8644-9920145b7ae5', + integrations: { All: true }, + originalTimestamp: '2021-09-30T07:15:23.523Z', + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.mixpanel.com/import/', + headers: { + Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + 'Content-Type': 'application/json', + }, + params: { strict: 0 }, + body: { + JSON: {}, + JSON_ARRAY: { + batch: + '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"http://127.0.0.1:7307/Testing/","$initial_referring_domain":"127.0.0.1:7307","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', + }, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'mp', + description: + 'Track event test when dropTraitsInTrackEvent is false/undefined and context.traits is undefined', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: overrideDestination(sampleDestination, {}), + message: { + type: 'track', + event: 'FirstTrackCall12', + sentAt: '2021-09-30T07:15:23.523Z', + channel: 'web', + rudderId: '294702c7-8732-4fb3-b39f-f3bdffe1aa88', + messageId: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + properties: { foo: 'bar', $deviceId: 'nkasdnkasd' }, + anonymousId: '1dbb5784-b8e2-4074-8644-9920145b7ae5', + integrations: { All: true }, + originalTimestamp: '2021-09-30T07:15:23.523Z', + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.mixpanel.com/import/', + headers: { + Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + 'Content-Type': 'application/json', + }, + params: { strict: 0 }, + body: { + JSON: {}, + JSON_ARRAY: { + batch: + '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523}}]', + }, + XML: {}, + FORM: {}, + }, + files: {}, + userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; From 72978c656c38bea826a6255f3463041485d19a7a Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:37:15 +0530 Subject: [PATCH 069/160] chore: add units tests for iterable utils and config fxns (#4026) * chore: add units tests for iterable utils and config fxns * chore: add more tests * chore: add more testsx2 * refactor: iterable util unit tests --------- Co-authored-by: Dilip Kola --- src/v0/destinations/iterable/util.js | 2 + src/v0/destinations/iterable/util.test.js | 1638 +++++++++-------- test/integrations/component.test.ts | 38 +- .../iterable/processor/identifyTestData.ts | 217 +++ .../iterable/processor/validationTestData.ts | 55 + .../destinations/iterable/router/data.ts | 130 +- 6 files changed, 1329 insertions(+), 751 deletions(-) diff --git a/src/v0/destinations/iterable/util.js b/src/v0/destinations/iterable/util.js index 34ee1237598..c68583afb62 100644 --- a/src/v0/destinations/iterable/util.js +++ b/src/v0/destinations/iterable/util.js @@ -760,4 +760,6 @@ module.exports = { registerDeviceTokenEventPayloadBuilder, registerBrowserTokenEventPayloadBuilder, getCategoryWithEndpoint, + prepareAndSplitUpdateUserBatchesBasedOnPayloadSize, + getMergeNestedObjects, }; diff --git a/src/v0/destinations/iterable/util.test.js b/src/v0/destinations/iterable/util.test.js index 8189a5b1f29..2fadfbe44f1 100644 --- a/src/v0/destinations/iterable/util.test.js +++ b/src/v0/destinations/iterable/util.test.js @@ -9,207 +9,192 @@ const { registerBrowserTokenEventPayloadBuilder, hasMultipleResponses, getCategoryWithEndpoint, + getCategoryUsingEventName, + prepareAndSplitUpdateUserBatchesBasedOnPayloadSize, + getMergeNestedObjects, } = require('./util'); -const { ConfigCategory } = require('./config'); +const { ConfigCategory, constructEndpoint } = require('./config'); -const getTestMessage = () => { - let message = { - event: 'testEventName', - anonymousId: 'anonId', - traits: { - email: 'abc@test.com', - name: 'rudder', - address: { - city: 'kolkata', - country: 'India', - }, - createdAt: '2014-05-21T15:54:20Z', - timestamp: '2014-05-21T15:54:20Z', +const testMessage = { + event: 'testEventName', + anonymousId: 'anonId', + traits: { + email: 'abc@test.com', + name: 'rudder', + address: { + city: 'kolkata', + country: 'India', }, - properties: { - category: 'test', - email: 'test@test.com', - templateId: 1234, - campaignId: 5678, - name: 'pageName', + createdAt: '2014-05-21T15:54:20Z', + timestamp: '2014-05-21T15:54:20Z', + }, + properties: { + category: 'test', + email: 'test@test.com', + templateId: 1234, + campaignId: 5678, + name: 'pageName', + }, + context: { + device: { + token: 1234, }, - context: { - device: { - token: 1234, - }, - os: { - token: 5678, - }, - mappedToDestination: false, - externalId: [ - { - id: '12345', - identifierType: 'test_identifier', - }, - ], + os: { + token: 5678, }, - }; - return message; + mappedToDestination: false, + externalId: [ + { + id: '12345', + identifierType: 'test_identifier', + }, + ], + }, }; -const getTestConfig = () => { - let config = { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: true, - trackCategorisedPages: false, - trackNamedPages: false, - }; - return config; +const testConfig = { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: true, + trackCategorisedPages: false, + trackNamedPages: false, }; -const getTestEcommMessage = () => { - let message = { - event: 'testEventName', - anonymousId: 'anonId', - traits: { - userId: 'userId', - email: 'abc@test.com', - name: 'rudder', - address: { - city: 'kolkata', - country: 'India', - }, - createdAt: '2014-05-21T15:54:20Z', - timestamp: '2014-05-21T15:54:20Z', +const testEcommMessage = { + event: 'testEventName', + anonymousId: 'anonId', + traits: { + userId: 'userId', + email: 'abc@test.com', + name: 'rudder', + address: { + city: 'kolkata', + country: 'India', }, - properties: { - product_id: 1234, - sku: 'abcd', - name: 'no product array present', - category: 'categoryTest1, categoryTest2', - price: '10', - quantity: '2', - total: '20', - campaignId: '1111', - templateId: '2222', + createdAt: '2014-05-21T15:54:20Z', + timestamp: '2014-05-21T15:54:20Z', + }, + properties: { + product_id: 1234, + sku: 'abcd', + name: 'no product array present', + category: 'categoryTest1, categoryTest2', + price: '10', + quantity: '2', + total: '20', + campaignId: '1111', + templateId: '2222', + }, + context: { + device: { + token: 1234, }, - context: { - device: { - token: 1234, - }, - os: { - token: 5678, - }, - mappedToDestination: false, - externalId: [ - { - id: '12345', - identifierType: 'test_identifier', - }, - ], + os: { + token: 5678, }, - }; - return message; + mappedToDestination: false, + externalId: [ + { + id: '12345', + identifierType: 'test_identifier', + }, + ], + }, }; describe('iterable utils test', () => { - describe('Unit test cases for iterable registerDeviceTokenEventPayloadBuilder', () => { - it('for no device type', async () => { - let expectedOutput = { - device: { - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, - }, - platform: 'GCM', - token: 1234, - }, - email: 'abc@test.com', - preferUserId: true, - userId: 'anonId', - }; - expect(registerDeviceTokenEventPayloadBuilder(getTestMessage(), getTestConfig())).toEqual( - expectedOutput, - ); - }); - it('For apple family device type', async () => { - const fittingPayload = { ...getTestMessage() }; - fittingPayload.context.device.type = 'ios'; - let expectedOutput = { - device: { - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, - }, - platform: 'APNS', - token: 1234, - }, - email: 'abc@test.com', - preferUserId: true, - userId: 'anonId', - }; - expect(registerDeviceTokenEventPayloadBuilder(fittingPayload, getTestConfig())).toEqual( - expectedOutput, - ); - }); + describe('Unit test cases for iterable constructEndpoint', () => { + test.each([ + { + dataCenter: 'USDC', + category: { endpoint: 'users/update' }, + expected: 'https://api.iterable.com/api/users/update', + }, + { + dataCenter: 'EUDC', + category: { endpoint: 'users/update' }, + expected: 'https://api.eu.iterable.com/api/users/update', + }, + { + dataCenter: 'INVALID', + category: { endpoint: 'events/track' }, + expected: 'https://api.iterable.com/api/events/track', + }, + ])( + 'should construct endpoint for dataCenter=$dataCenter and category=$category', + ({ dataCenter, category, expected }) => { + const result = constructEndpoint(dataCenter, category); + expect(result).toBe(expected); + }, + ); + }); - it('For non apple family device type', async () => { - let fittingPayload = { ...getTestMessage() }; - fittingPayload.context.device.type = 'android'; - let expectedOutput = { - device: { - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, + describe('Unit test cases for iterable registerDeviceTokenEventPayloadBuilder', () => { + test.each([ + { + deviceType: undefined, + expectedPlatform: 'GCM', + }, + { + deviceType: 'ios', + expectedPlatform: 'APNS', + }, + { + deviceType: 'android', + expectedPlatform: 'GCM', + }, + ])( + 'should build payload for deviceType=$deviceType with platform=$expectedPlatform', + ({ deviceType, expectedPlatform }) => { + const message = { ...testMessage }; + if (deviceType) { + message.context.device.type = deviceType; + } + const expectedOutput = { + device: { + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, + platform: expectedPlatform, + token: 1234, }, - platform: 'GCM', - token: 1234, - }, - email: 'abc@test.com', - preferUserId: true, - userId: 'anonId', - }; - expect(registerDeviceTokenEventPayloadBuilder(fittingPayload, getTestConfig())).toEqual( - expectedOutput, - ); - }); + email: 'abc@test.com', + preferUserId: true, + userId: 'anonId', + }; + expect(registerDeviceTokenEventPayloadBuilder(message, testConfig)).toEqual(expectedOutput); + }, + ); }); + describe('Unit test cases for iterable registerBrowserTokenEventPayloadBuilder', () => { - it('flow check', async () => { - let expectedOutput = { browserToken: 5678, email: 'abc@test.com', userId: 'anonId' }; - expect(registerBrowserTokenEventPayloadBuilder(getTestMessage())).toEqual(expectedOutput); + it('should build payload for browser token', () => { + const expectedOutput = { browserToken: 5678, email: 'abc@test.com', userId: 'anonId' }; + expect(registerBrowserTokenEventPayloadBuilder(testMessage)).toEqual(expectedOutput); }); }); + describe('Unit test cases for iterable updateUserEventPayloadBuilder', () => { - it('flow check without externalId', async () => { - let expectedOutput = { - dataFields: { + test.each([ + { + mappedToDestination: false, + externalId: undefined, + expectedDataFields: { address: { city: 'kolkata', country: 'India' }, createdAt: '2014-05-21T15:54:20Z', email: 'abc@test.com', name: 'rudder', timestamp: '2014-05-21T15:54:20Z', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'anonId', - }; - expect( - updateUserEventPayloadBuilder(getTestMessage(), ConfigCategory.IDENTIFY, getTestConfig()), - ).toEqual(expectedOutput); - }); - - it('flow check with externalId', async () => { - let fittingPayload = { ...getTestMessage() }; - fittingPayload.context.mappedToDestination = true; - let expectedOutput = { - dataFields: { + }, + { + mappedToDestination: true, + externalId: '12345', + expectedDataFields: { address: { city: 'kolkata', country: 'India' }, createdAt: '2014-05-21T15:54:20Z', email: 'abc@test.com', @@ -217,29 +202,55 @@ describe('iterable utils test', () => { test_identifier: '12345', timestamp: '2014-05-21T15:54:20Z', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'anonId', - }; - expect( - updateUserEventPayloadBuilder(fittingPayload, ConfigCategory.IDENTIFY, getTestConfig()), - ).toEqual(expectedOutput); - }); + }, + ])( + 'should build payload with mappedToDestination=$mappedToDestination and externalId=$externalId', + ({ mappedToDestination, externalId, expectedDataFields }) => { + const message = { ...testMessage }; + message.context.mappedToDestination = mappedToDestination; + if (externalId) { + message.context.externalId[0].id = externalId; + } + const expectedOutput = { + dataFields: expectedDataFields, + email: 'abc@test.com', + mergeNestedObjects: true, + preferUserId: true, + userId: 'anonId', + }; + expect(updateUserEventPayloadBuilder(message, ConfigCategory.IDENTIFY, testConfig)).toEqual( + expectedOutput, + ); + }, + ); }); - describe('Unit test cases for iterbale pageEventPayloadBuilder', () => { - it('For trackAllPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: true, + + describe('Unit test cases for iterable pageEventPayloadBuilder', () => { + test.each([ + { + config: { trackAllPages: true, trackCategorisedPages: false, trackNamedPages: false }, + eventName: 'pageName page', + }, + { + config: { trackAllPages: false, trackCategorisedPages: true, trackNamedPages: false }, + eventName: 'pageName page', + }, + { + config: { trackAllPages: false, trackCategorisedPages: false, trackNamedPages: true }, + eventName: 'pageName page', + }, + { + config: { + mapToSingleEvent: true, + trackAllPages: false, trackCategorisedPages: false, - trackNamedPages: false, + trackNamedPages: true, }, - Enabled: true, - }; - let expectedOutput = { + eventName: 'Loaded a Page', + }, + ])('should build page event payload with config=$config', ({ config, eventName }) => { + const destination = { Config: { ...testConfig, ...config }, Enabled: true }; + const expectedOutput = { campaignId: 5678, createdAt: 1400687660000, dataFields: { @@ -250,643 +261,812 @@ describe('iterable utils test', () => { templateId: 1234, }, email: 'test@test.com', - eventName: 'pageName page', + eventName, templateId: 1234, userId: 'anonId', }; expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), + pageEventPayloadBuilder({ ...testMessage, type: 'page' }, destination, ConfigCategory.PAGE), ).toEqual(expectedOutput); }); + }); - it('For trackCategorisedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: true, - trackNamedPages: false, + describe('Unit test cases for iterable screenEventPayloadBuilder', () => { + test.each([ + { + description: 'For trackAllPages', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: true, + trackCategorisedPages: false, + trackNamedPages: false, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - - it('For trackNamedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'For trackCategorisedPages', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: false, + trackCategorisedPages: true, + trackNamedPages: false, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - - it('For mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: true, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'For trackNamedPages', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: false, + trackCategorisedPages: false, + trackNamedPages: true, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'Loaded a Page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - - it('For non-mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'For mapToSingleEvent', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: true, + trackAllPages: false, + trackCategorisedPages: false, + trackNamedPages: true, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'Loaded a Screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName page', - templateId: 1234, - userId: 'anonId', - }; - expect( - pageEventPayloadBuilder( - { ...getTestMessage(), type: 'page' }, - destination, - ConfigCategory.PAGE, - ), - ).toEqual(expectedOutput); - }); - }); - describe('Unit test cases for iterbale screenEventPayloadBuilder', () => { - it('For trackAllPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: true, - trackCategorisedPages: false, - trackNamedPages: false, + }, + { + description: 'For non-mapToSingleEvent', + destination: { + Config: { + apiKey: '12345', + mapToSingleEvent: false, + trackAllPages: false, + trackCategorisedPages: false, + trackNamedPages: true, + }, + Enabled: true, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'pageName screen', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); + }, + ])('$description', ({ destination, expectedOutput }) => { + const message = { ...testMessage, type: 'screen' }; + const result = screenEventPayloadBuilder(message, destination, ConfigCategory.SCREEN); + expect(result).toEqual(expectedOutput); }); + }); - it('For trackCategorisedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: true, - trackNamedPages: false, - }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + describe('Unit test cases for iterable trackEventPayloadBuilder', () => { + test.each([ + { + description: 'Valid payload with all fields', + message: testMessage, + category: ConfigCategory.TRACK, + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'testEventName', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); - }); - - it('For trackNamedPages', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'Payload without campaignId and templateId', + message: { + ...testMessage, + properties: { + ...testMessage.properties, + campaignId: undefined, + templateId: undefined, + }, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { - campaignId: 5678, - category: 'test', + category: ConfigCategory.TRACK, + expectedOutput: { + campaignId: undefined, + createdAt: 1400687660000, + dataFields: { + campaignId: undefined, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: undefined, + }, email: 'test@test.com', - name: 'pageName', - templateId: 1234, + eventName: 'testEventName', + templateId: undefined, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); - }); - - it('For mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: true, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'Payload without email', + message: { + ...testMessage, + properties: { + ...testMessage.properties, + email: undefined, + }, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + category: ConfigCategory.TRACK, + expectedOutput: { campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: undefined, + name: 'pageName', + templateId: 1234, + }, + email: undefined, + eventName: 'testEventName', templateId: 1234, + userId: 'anonId', }, - email: 'test@test.com', - eventName: 'Loaded a Screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); - }); - - it('For non-mapToSingleEvent', async () => { - let destination = { - Config: { - apiKey: '12345', - mapToSingleEvent: false, - trackAllPages: false, - trackCategorisedPages: false, - trackNamedPages: true, + }, + { + description: 'Payload without userId', + message: { + ...testMessage, + anonymousId: undefined, }, - Enabled: true, - }; - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { + category: ConfigCategory.TRACK, + expectedOutput: { campaignId: 5678, - category: 'test', + createdAt: 1400687660000, + dataFields: { + campaignId: 5678, + category: 'test', + email: 'test@test.com', + name: 'pageName', + templateId: 1234, + }, email: 'test@test.com', - name: 'pageName', + eventName: 'testEventName', templateId: 1234, + userId: undefined, }, - email: 'test@test.com', - eventName: 'pageName screen', - templateId: 1234, - userId: 'anonId', - }; - expect( - screenEventPayloadBuilder( - { ...getTestMessage(), type: 'screen' }, - destination, - ConfigCategory.SCREEN, - ), - ).toEqual(expectedOutput); + }, + ])('$description', ({ message, category, expectedOutput }) => { + const result = trackEventPayloadBuilder(message, category); + expect(result).toEqual(expectedOutput); }); - }); - describe('Unit test cases for iterable trackEventPayloadBuilder', () => { - it('flow check', async () => { - let expectedOutput = { - campaignId: 5678, - createdAt: 1400687660000, - dataFields: { - campaignId: 5678, - category: 'test', - email: 'test@test.com', - name: 'pageName', - templateId: 1234, - }, - email: 'test@test.com', - eventName: 'testEventName', - templateId: 1234, - userId: 'anonId', + + test('should throw an error if neither email nor userId is present', () => { + const invalidMessage = { + ...testMessage, + properties: { ...testMessage.properties, email: undefined }, + anonymousId: undefined, }; - expect(trackEventPayloadBuilder(getTestMessage(), ConfigCategory.TRACK)).toEqual( - expectedOutput, + + expect(() => trackEventPayloadBuilder(invalidMessage, ConfigCategory.TRACK)).toThrow( + 'userId or email is mandatory for this request', ); }); }); + describe('Unit test cases for iterable purchaseEventPayloadBuilder', () => { - it('flow check without product array', async () => { - let expectedOutput = { - campaignId: 1111, - createdAt: 1400687660000, - dataFields: { - campaignId: '1111', - category: 'categoryTest1, categoryTest2', - name: 'no product array present', - price: '10', - product_id: 1234, - quantity: '2', - sku: 'abcd', - templateId: '2222', - total: '20', - }, - items: [ - { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, + test.each([ + { + description: 'Valid payload without product array', + message: testEcommMessage, + category: ConfigCategory.TRACK_PURCHASE, + config: testConfig, + expectedOutput: { + campaignId: 1111, + createdAt: 1400687660000, + dataFields: { + campaignId: '1111', + category: 'categoryTest1, categoryTest2', name: 'no product array present', - price: 10, - quantity: 2, + price: '10', + product_id: 1234, + quantity: '2', sku: 'abcd', + templateId: '2222', + total: '20', }, - ], - templateId: 2222, - total: 20, - user: { - dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', - email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', - userId: 'userId', - }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', - }, - }; - expect( - purchaseEventPayloadBuilder( - getTestEcommMessage(), - ConfigCategory.TRACK_PURCHASE, - getTestConfig(), - ), - ).toEqual(expectedOutput); - }); - - it('flow check with product array', async () => { - let fittingPayload = { ...getTestEcommMessage() }; - fittingPayload.properties.products = [ - { - product_id: 1234, - sku: 'abcd', - name: 'no product array present', - category: 'categoryTest1, categoryTest2', - price: '10', - quantity: '2', - total: '20', - }, - ]; - let expectedOutput = { - campaignId: 1111, - createdAt: 1400687660000, - dataFields: { - campaignId: '1111', - category: 'categoryTest1, categoryTest2', - name: 'no product array present', - price: '10', - product_id: 1234, - products: [ + items: [ { - category: 'categoryTest1, categoryTest2', + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, name: 'no product array present', - price: '10', - product_id: 1234, - quantity: '2', + price: 10, + quantity: 2, sku: 'abcd', - total: '20', }, ], - quantity: '2', - sku: 'abcd', - templateId: '2222', - total: '20', + templateId: 2222, + total: 20, + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, + email: 'abc@test.com', + mergeNestedObjects: true, + preferUserId: true, + userId: 'userId', + }, }, - items: [ - { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, + }, + { + description: 'Valid payload with product array', + message: { + ...testEcommMessage, + properties: { + ...testEcommMessage.properties, + products: [ + { + product_id: 1234, + sku: 'abcd', + name: 'product 1', + category: 'categoryTest1, categoryTest2', + price: '10', + quantity: '2', + total: '20', + }, + ], + }, + }, + category: ConfigCategory.TRACK_PURCHASE, + config: testConfig, + expectedOutput: { + campaignId: 1111, + createdAt: 1400687660000, + dataFields: { + campaignId: '1111', + category: 'categoryTest1, categoryTest2', name: 'no product array present', - price: 10, - quantity: 2, + price: '10', + product_id: 1234, + products: [ + { + category: 'categoryTest1, categoryTest2', + name: 'product 1', + price: '10', + product_id: 1234, + quantity: '2', + sku: 'abcd', + total: '20', + }, + ], + quantity: '2', sku: 'abcd', + templateId: '2222', + total: '20', }, - ], - templateId: 2222, - total: 20, - user: { - dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', + items: [ + { + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, + name: 'product 1', + price: 10, + quantity: 2, + sku: 'abcd', + }, + ], + templateId: 2222, + total: 20, + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', + mergeNestedObjects: true, + preferUserId: true, userId: 'userId', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', }, + }, + ])('$description', ({ message, category, config, expectedOutput }) => { + const result = purchaseEventPayloadBuilder(message, category, config); + expect(result).toEqual(expectedOutput); + }); + + test('should throw an error if neither email nor userId is present', () => { + const invalidMessage = { + ...testEcommMessage, + traits: { ...testEcommMessage.traits, email: undefined, userId: undefined }, + anonymousId: undefined, }; - expect( - purchaseEventPayloadBuilder(fittingPayload, ConfigCategory.TRACK_PURCHASE, getTestConfig()), - ).toEqual(expectedOutput); + + expect(() => + purchaseEventPayloadBuilder(invalidMessage, ConfigCategory.TRACK_PURCHASE, testConfig), + ).toThrow('userId or email is mandatory for this request'); }); }); + describe('Unit test cases for iterable updateCartEventPayloadBuilder', () => { - it('flow check without product array', async () => { - let expectedOutput = { - items: [ - { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, - name: 'no product array present', - price: 10, - quantity: 2, - sku: 'abcd', - }, - ], - user: { - dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', + test.each([ + { + description: 'Valid payload without product array', + message: testEcommMessage, + config: testConfig, + expectedOutput: { + items: [ + { + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, + name: 'no product array present', + price: 10, + quantity: 2, + sku: 'abcd', + }, + ], + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', + mergeNestedObjects: true, + preferUserId: true, userId: 'userId', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', }, - }; - expect( - updateCartEventPayloadBuilder(getTestEcommMessage(), ConfigCategory.UPDATE_CART), - ).toEqual(expectedOutput); - }); - - it('flow check with product array', async () => { - let fittingPayload = { ...getTestEcommMessage() }; - fittingPayload.properties.products = [ - { - product_id: 1234, - sku: 'abcd', - name: 'no product array present', - category: 'categoryTest1, categoryTest2', - price: '10', - quantity: '2', - total: '20', - }, - ]; - let expectedOutput = { - items: [ - { - categories: ['categoryTest1', ' categoryTest2'], - id: 1234, - name: 'no product array present', - price: 10, - quantity: 2, - sku: 'abcd', + }, + { + description: 'Valid payload with product array', + message: { + ...testEcommMessage, + properties: { + ...testEcommMessage.properties, + products: [ + { + product_id: 1234, + sku: 'abcd', + name: 'product 1', + category: 'categoryTest1, categoryTest2', + price: '10', + quantity: '2', + total: '20', + }, + ], }, - ], - user: { - dataFields: { - address: { city: 'kolkata', country: 'India' }, - createdAt: '2014-05-21T15:54:20Z', + }, + config: testConfig, + expectedOutput: { + items: [ + { + categories: ['categoryTest1', ' categoryTest2'], + id: 1234, + name: 'product 1', + price: 10, + quantity: 2, + sku: 'abcd', + }, + ], + user: { + dataFields: { + address: { city: 'kolkata', country: 'India' }, + createdAt: '2014-05-21T15:54:20Z', + email: 'abc@test.com', + name: 'rudder', + timestamp: '2014-05-21T15:54:20Z', + userId: 'userId', + }, email: 'abc@test.com', - name: 'rudder', - timestamp: '2014-05-21T15:54:20Z', + mergeNestedObjects: true, + preferUserId: true, userId: 'userId', }, - email: 'abc@test.com', - mergeNestedObjects: true, - preferUserId: true, - userId: 'userId', }, + }, + ])('$description', ({ message, config, expectedOutput }) => { + const result = updateCartEventPayloadBuilder(message, config); + expect(result).toEqual(expectedOutput); + }); + + test('should throw an error if neither email nor userId is present', () => { + const invalidMessage = { + ...testEcommMessage, + traits: { ...testEcommMessage.traits, email: undefined, userId: undefined }, + anonymousId: undefined, }; - expect(updateCartEventPayloadBuilder(fittingPayload, ConfigCategory.UPDATE_CART)).toEqual( - expectedOutput, + + expect(() => updateCartEventPayloadBuilder(invalidMessage, testConfig)).toThrow( + 'userId or email is mandatory for this request', ); }); }); + describe('Unit test cases for iterable hasMultipleResponses', () => { - it('should return false when message type is not identify', () => { - const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); - const message = { - type: 'track', - context: { - device: { token: '123' }, - os: { token: '456' }, + test.each([ + { + description: 'should return false when message type is not identify', + message: { + type: 'track', + context: { + device: { token: '123' }, + os: { token: '456' }, + }, }, - }; - const config = { registerDeviceOrBrowserApiKey: 'test-key' }; - - expect(hasMultipleResponses(message, category, config)).toBe(false); - }); - - it('should return false when category is not identify', () => { - const category = getCategoryWithEndpoint(ConfigCategory.PAGE, 'USDC'); - const message = { - type: 'identify', - context: { - device: { token: '123' }, - os: { token: '456' }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { registerDeviceOrBrowserApiKey: 'test-key' }, + expected: false, + }, + { + description: 'should return false when category is not identify', + message: { + type: 'identify', + context: { + device: { token: '123' }, + os: { token: '456' }, + }, }, - }; - const config = { registerDeviceOrBrowserApiKey: 'test-key' }; - - expect(hasMultipleResponses(message, category, config)).toBe(false); - }); - - it('should return false when no device/os token present', () => { - const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); - const message = { - type: 'identify', - context: { - device: {}, - os: {}, + category: getCategoryWithEndpoint(ConfigCategory.PAGE, 'USDC'), + config: { registerDeviceOrBrowserApiKey: 'test-key' }, + expected: false, + }, + { + description: 'should return false when no device/os token is present', + message: { + type: 'identify', + context: { + device: {}, + os: {}, + }, }, - }; - const config = { registerDeviceOrBrowserApiKey: 'test-key' }; - - expect(hasMultipleResponses(message, category, config)).toBe(false); + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { registerDeviceOrBrowserApiKey: 'test-key' }, + expected: false, + }, + { + description: + 'should return false when registerDeviceOrBrowserApiKey is not present in config', + message: { + type: 'identify', + context: { + device: { token: '123' }, + os: { token: '456' }, + }, + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: {}, + expected: false, + }, + { + description: 'should return true when all conditions are met with device token', + message: { + type: 'identify', + context: { + device: { token: '123' }, + }, + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'test-key', + }, + expected: true, + }, + { + description: 'should return true when all conditions are met with os token', + message: { + type: 'identify', + context: { + os: { token: '456' }, + }, + }, + category: getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'), + config: { + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'test-key', + }, + expected: true, + }, + ])('$description', ({ message, category, config, expected }) => { + const result = hasMultipleResponses(message, category, config); + expect(result).toBe(expected); }); + }); - it('should return false when registerDeviceOrBrowserApiKey not present in config', () => { - const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); - const message = { - type: 'identify', - context: { - device: { token: '123' }, - os: { token: '456' }, + describe('Unit test cases for iterable getCategoryUsingEventName', () => { + test.each([ + { + description: 'should return TRACK_PURCHASE category when event is "order completed"', + message: { + event: 'order completed', + properties: { + total: 100, + }, }, - }; - const config = {}; - - expect(hasMultipleResponses(message, category, config)).toBe(false); + dataCenter: 'USDC', + expected: { + name: 'IterableTrackPurchaseConfig', + action: 'trackPurchase', + endpoint: 'https://api.iterable.com/api/commerce/trackPurchase', + }, + }, + { + description: 'should return UPDATE_CART category when event is "product added"', + message: { + event: 'product added', + properties: { + total: 100, + }, + }, + dataCenter: 'USDC', + expected: { + ...ConfigCategory.UPDATE_CART, + endpoint: 'https://api.iterable.com/api/commerce/updateCart', + }, + }, + { + description: 'should return UPDATE_CART category when event is "product removed"', + message: { + event: 'PRODUCT REMOVED', + properties: { + total: 100, + }, + }, + dataCenter: 'EUDC', + expected: { + ...ConfigCategory.UPDATE_CART, + endpoint: 'https://api.eu.iterable.com/api/commerce/updateCart', + }, + }, + { + description: 'should return TRACK category when event is a generic event', + message: { + event: 'custom event', + properties: { + total: 100, + }, + }, + dataCenter: 'USDC', + expected: { + ...ConfigCategory.TRACK, + endpoint: 'https://api.iterable.com/api/events/track', + }, + }, + ])('$description', ({ message, dataCenter, expected }) => { + const result = getCategoryUsingEventName(message, dataCenter); + expect(result).toEqual(expected); }); - - it('should return true when all conditions are met with device token', () => { - const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); - const message = { - type: 'identify', - context: { - device: { token: '123' }, + }); + describe('Unit test cases for iterable prepareAndSplitUpdateUserBatchesBasedOnPayloadSize', () => { + test.each([ + { + description: 'should split events into multiple batches when payload size exceeds limit', + chunk: [ + { + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1', data: 'a'.repeat(3000000) } } }, + }, + { + metadata: { jobId: '2' }, + destination: 'dest1', + message: { body: { JSON: { id: '2', data: 'b'.repeat(3000000) } } }, + }, + ], + registerDeviceOrBrowserTokenEvents: { + 1: { deviceToken: 'token1' }, + 2: { deviceToken: 'token2' }, }, - }; - const config = { - dataCenter: '123', - registerDeviceOrBrowserApiKey: 'test-key', - }; + expectedBatches: [ + { + users: [{ id: '1', data: 'a'.repeat(3000000) }], + metadata: [{ jobId: '1' }], + nonBatchedRequests: [{ deviceToken: 'token1' }], + destination: 'dest1', + }, + { + users: [{ id: '2', data: 'b'.repeat(3000000) }], + metadata: [{ jobId: '2' }], + nonBatchedRequests: [{ deviceToken: 'token2' }], + destination: 'dest1', + }, + ], + }, + { + description: 'should return empty batches array for empty input chunk', + chunk: [], + registerDeviceOrBrowserTokenEvents: {}, + expectedBatches: [], + }, + { + description: 'should create batches with users, metadata, and non-batched requests arrays', + chunk: [ + { + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1' } } }, + }, + { + metadata: { jobId: '2' }, + destination: 'dest1', + message: { body: { JSON: { id: '2' } } }, + }, + ], + registerDeviceOrBrowserTokenEvents: {}, + expectedBatches: [ + { + users: [{ id: '1' }, { id: '2' }], + metadata: [{ jobId: '1' }, { jobId: '2' }], + nonBatchedRequests: [], + destination: 'dest1', + }, + ], + }, + { + description: 'should add device/browser token events to nonBatchedRequests array', + chunk: [ + { + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1' } } }, + }, + ], + registerDeviceOrBrowserTokenEvents: { + 1: { deviceToken: 'token1' }, + }, + expectedBatches: [ + { + users: [{ id: '1' }], + metadata: [{ jobId: '1' }], + nonBatchedRequests: [{ deviceToken: 'token1' }], + destination: 'dest1', + }, + ], + }, + { + description: 'should create final batch even if size limit not reached', + chunk: [ + { + metadata: { jobId: '1' }, + destination: 'dest1', + message: { body: { JSON: { id: '1' } } }, + }, + ], + registerDeviceOrBrowserTokenEvents: { + 1: { deviceToken: 'token1' }, + }, + expectedBatches: [ + { + users: [{ id: '1' }], + metadata: [{ jobId: '1' }], + nonBatchedRequests: [{ deviceToken: 'token1' }], + destination: 'dest1', + }, + ], + }, + ])('$description', ({ chunk, registerDeviceOrBrowserTokenEvents, expectedBatches }) => { + const result = prepareAndSplitUpdateUserBatchesBasedOnPayloadSize( + chunk, + registerDeviceOrBrowserTokenEvents, + ); - expect(hasMultipleResponses(message, category, config)).toBe(true); + expect(result).toEqual(expectedBatches); }); + }); - it('should return true when all conditions are met with os token', () => { - const category = getCategoryWithEndpoint(ConfigCategory.IDENTIFY, 'USDC'); - const message = { - type: 'identify', - context: { - os: { token: '456' }, - }, - }; - const config = { - dataCenter: '123', - registerDeviceOrBrowserApiKey: 'test-key', - }; - - expect(hasMultipleResponses(message, category, config)).toBe(true); + describe('Unit test cases for iterable getMergeNestedObjects', () => { + test.each([ + { + description: 'should return true when mergeNestedObjects is undefined', + config: {}, + expected: true, + }, + { + description: 'should return true when mergeNestedObjects is true', + config: { mergeNestedObjects: true }, + expected: true, + }, + { + description: 'should return false when mergeNestedObjects is false', + config: { mergeNestedObjects: false }, + expected: false, + }, + ])('$description', ({ config, expected }) => { + const result = getMergeNestedObjects(config); + expect(result).toBe(expected); }); }); }); diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index a0794f4ce02..7ca4062038a 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -234,27 +234,23 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { }); } - const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => - tcData.module === tags.MODULES.SOURCE - ? [ - { - tcData, - sourceTransformV2Flag: false, - descriptionSuffix: ' (sourceTransformV2Flag: false)', - }, - { - tcData, - sourceTransformV2Flag: true, - descriptionSuffix: ' (sourceTransformV2Flag: true)', - }, - ] - : [ - { - tcData, - descriptionSuffix: '', - }, - ], - ); + const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => { + if (tcData.module === tags.MODULES.SOURCE) { + return [ + { + tcData, + sourceTransformV2Flag: false, + descriptionSuffix: ' (sourceTransformV2Flag: false)', + }, + { + tcData, + sourceTransformV2Flag: true, + descriptionSuffix: ' (sourceTransformV2Flag: true)', + }, + ]; + } + return [{ tcData, descriptionSuffix: '' }]; + }); describe(`${testData[0].name} ${testData[0].module}`, () => { test.each(extendedTestData)( diff --git a/test/integrations/destinations/iterable/processor/identifyTestData.ts b/test/integrations/destinations/iterable/processor/identifyTestData.ts index 606a0de3103..f61ab0b6749 100644 --- a/test/integrations/destinations/iterable/processor/identifyTestData.ts +++ b/test/integrations/destinations/iterable/processor/identifyTestData.ts @@ -193,6 +193,223 @@ export const identifyTestData: ProcessorTestData[] = [ }, }, }, + { + id: 'iterable-identify-test-has-multiple-responses', + name: 'iterable', + description: 'Indentify call to verify hasMultipleResponses', + scenario: 'Business', + successCriteria: + 'Response should contain status code 200 and it should contain update user payload with new email sent in payload', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'identify', + sentAt: '2020-08-28T16:26:16.473Z', + userId: 'userId', + channel: 'web', + context: { + os: { + name: '', + version: '1.12.3', + token: 'randomBrowserToken', + }, + app: { + name: 'RudderLabs JavaScript SDK', + build: '1.0.0', + version: '1.1.11', + namespace: 'com.rudderlabs.javascript', + }, + traits: { + email: 'ruchira@rudderlabs.com', + }, + locale: 'en-US', + device: { + id: 'id', + type: 'ios', + }, + screen: { + density: 2, + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.11', + }, + campaign: {}, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0', + }, + rudderId: '62amo6xzksaeyupr4y0pfaucwj0upzs6g7yx', + messageId: 'hk02avz2xijdkid4i0mvncbm478g9lybdpgc', + anonymousId: 'anonId', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: { + ID: '123', + Name: 'iterable', + DestinationDefinition: { + ID: '123', + Name: 'iterable', + DisplayName: 'Iterable', + Config: {}, + }, + Config: { + apiKey: 'testApiKey', + dataCenter: 'USDC', + registerDeviceOrBrowserApiKey: 'randomApiKey', + preferUserId: false, + trackAllPages: true, + trackNamedPages: false, + mapToSingleEvent: false, + trackCategorisedPages: false, + }, + Enabled: true, + WorkspaceID: '123', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + destinationDefinitionId: 'default-dest-def', + destinationId: 'default-destinationId', + destinationType: 'default-destination-type', + dontBatch: false, + eventName: 'default-event', + eventType: 'default-type', + instanceId: 'default-instance', + jobId: 1, + jobRunId: 'default-job-run', + mergedTpConfig: {}, + messageId: 'default-message-id', + messageIds: ['default-message-id'], + namespace: 'default-namespace', + oauthAccessToken: 'default-token', + receivedAt: '2025-01-06T03:57:13.523Z', + recordId: {}, + rudderId: 'default-rudder-id', + sourceBatchId: 'default-batch', + sourceCategory: 'default-category', + sourceDefinitionId: 'default-source-def', + sourceId: 'default-sourceId', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + sourceTpConfig: {}, + sourceType: 'default-source-type', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + transformationId: 'default-transform', + workspaceId: 'default-workspaceId', + }, + output: { + body: { + FORM: {}, + JSON: { + dataFields: { + email: 'ruchira@rudderlabs.com', + }, + email: 'ruchira@rudderlabs.com', + mergeNestedObjects: true, + preferUserId: false, + userId: 'userId', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.iterable.com/api/users/update', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: 'testApiKey', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + { + metadata: { + destinationDefinitionId: 'default-dest-def', + destinationId: 'default-destinationId', + destinationType: 'default-destination-type', + dontBatch: false, + eventName: 'default-event', + eventType: 'default-type', + instanceId: 'default-instance', + jobId: 1, + jobRunId: 'default-job-run', + mergedTpConfig: {}, + messageId: 'default-message-id', + messageIds: ['default-message-id'], + namespace: 'default-namespace', + oauthAccessToken: 'default-token', + receivedAt: '2025-01-06T03:57:13.523Z', + recordId: {}, + rudderId: 'default-rudder-id', + sourceBatchId: 'default-batch', + sourceCategory: 'default-category', + sourceDefinitionId: 'default-source-def', + sourceId: 'default-sourceId', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + sourceTpConfig: {}, + sourceType: 'default-source-type', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + transformationId: 'default-transform', + workspaceId: 'default-workspaceId', + }, + output: { + body: { + FORM: {}, + JSON: { + browserToken: 'randomBrowserToken', + email: 'ruchira@rudderlabs.com', + userId: 'userId', + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.iterable.com/api/users/registerBrowserToken', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: 'randomApiKey', + }, + method: 'POST', + params: {}, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, { id: 'iterable-identify-test-1', name: 'iterable', diff --git a/test/integrations/destinations/iterable/processor/validationTestData.ts b/test/integrations/destinations/iterable/processor/validationTestData.ts index 8f0813de3f2..28cdc37212b 100644 --- a/test/integrations/destinations/iterable/processor/validationTestData.ts +++ b/test/integrations/destinations/iterable/processor/validationTestData.ts @@ -333,4 +333,59 @@ export const validationTestData: ProcessorTestData[] = [ }, }, }, + { + id: 'iterable-validation-test-6', + name: 'iterable', + description: '[Error]: Missing message type', + scenario: 'Framework', + successCriteria: + 'Response should contain status code 400 and it should throw instrumentation error with respective message type', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + context: {}, + event: 'testEvent', + properties: { + url: 'https://nodominoes.com', + title: 'Pizza', + referrer: 'https://google.com', + }, + sentAt: '2020-08-28T16:26:16.473Z', + originalTimestamp: '2020-08-28T16:26:06.468Z', + }, + metadata: baseMetadata, + destination: baseDestination, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: 'Event type is required', + statTags: { + destType: 'ITERABLE', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + destinationId: 'default-destinationId', + workspaceId: 'default-workspaceId', + }, + }, + ], + }, + }, + }, ]; diff --git a/test/integrations/destinations/iterable/router/data.ts b/test/integrations/destinations/iterable/router/data.ts index 63c6f12a5e8..ff9809f5dc7 100644 --- a/test/integrations/destinations/iterable/router/data.ts +++ b/test/integrations/destinations/iterable/router/data.ts @@ -1,7 +1,6 @@ import { RouterTestData } from '../../../testTypes'; import {} from '../../../../../src/types'; import { generateMetadata } from '../../../testUtils'; -import { getBrowserInfo } from '../../../../../src/v0/util'; export const data: RouterTestData[] = [ { @@ -1381,4 +1380,133 @@ export const data: RouterTestData[] = [ }, }, }, + { + id: 'router-1736135082963', + name: 'iterable', + description: 'Already transformed event sent in the message body', + scenario: 'Default router scenario', + successCriteria: 'Router test should pass successfully', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + statusCode: 200, + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.eu.iterable.com/api/catalogs/test-ruchira/items', + headers: { + 'Content-Type': 'application/json', + api_key: '583af2f8-15ba-49c0-8511-76383e7de07e', + }, + params: {}, + body: { + JSON: { + documents: { + Tiffany: { + ruchira: 'donaldbaker@ellis.com', + new_field2: 'GB', + }, + ABC: { + ruchira: 'abc@ellis.com', + new_field2: 'GB1', + }, + }, + replaceUploadedFieldsOnly: true, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: generateMetadata(4), + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: {}, + }, + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + destType: 'iterable', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: true, + batchedRequest: { + body: { + FORM: {}, + JSON: { + documents: {}, + replaceUploadedFieldsOnly: true, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.eu.iterable.com/api/catalogs/test-ruchira/items', + files: {}, + headers: { + 'Content-Type': 'application/json', + api_key: '583af2f8-15ba-49c0-8511-76383e7de07e', + }, + method: 'POST', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', + hubID: '22066036', + }, + DestinationDefinition: { + Config: {}, + DisplayName: 'Default Display Name', + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + }, + Enabled: true, + ID: 'default-destination-id', + IsConnectionEnabled: true, + IsProcessorEnabled: true, + Name: 'Default Destination', + RevisionID: 'default-revision', + Transformations: [], + WorkspaceID: 'default-workspace', + }, + metadata: [generateMetadata(4)], + statusCode: 200, + }, + ], + }, + }, + }, + }, ]; From f44d5a56fd6ee183aea73eaba7e73c121f8bc470 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Tue, 11 Feb 2025 15:07:12 +0530 Subject: [PATCH 070/160] fix: improve error handling for webhook v2 --- src/constants/index.js | 5 +++ .../conversionStrategies/strategyV2ToV0.ts | 35 +++++++++++++------ .../conversionStrategies/strategyV2ToV1.ts | 34 ++++++++++++------ src/controllers/util/index.test.ts | 6 ++-- src/services/source/nativeIntegration.ts | 6 ++-- src/types/index.ts | 4 +++ test/integrations/sources/adjust/data.ts | 2 ++ test/integrations/sources/appsflyer/data.ts | 1 + test/integrations/sources/canny/data.ts | 2 ++ test/integrations/sources/gainsightpx/data.ts | 1 + test/integrations/sources/iterable/data.ts | 2 ++ test/integrations/sources/shopify/data.ts | 3 ++ 12 files changed, 77 insertions(+), 24 deletions(-) diff --git a/src/constants/index.js b/src/constants/index.js index f8ca53a94c9..05a258ee646 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -55,6 +55,10 @@ const HTTP_CUSTOM_STATUS_CODES = { FILTERED: 298, }; +const ErrorMessages = { + JSONParseError: 'Malformed JSON in request body', +}; + module.exports = { EventType, GENERIC_TRUE_VALUES, @@ -64,4 +68,5 @@ module.exports = { TraitsMapping, WhiteListedTraits, HTTP_CUSTOM_STATUS_CODES, + ErrorMessages, }; diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts index 1145cf97632..2c91d82e403 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts @@ -1,17 +1,32 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; +import { ErrorMessages } from '../../../constants'; export class StrategyV2ToV0 extends VersionConversionStrategy> { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult>[] { - return sourceEvents.map((sourceEvent) => { - try { - const v0Event = JSON.parse(sourceEvent.request.body); - return { output: v0Event }; - } catch (err) { - const conversionError = - err instanceof Error ? err : new Error('error converting v2 to v0 spec'); - return { conversionError }; - } - }); + return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); + } + + private convertSingleEvent( + sourceEvent: SourceInputV2, + ): SourceInputConversionResult> { + try { + const v0Event = this.parseRequestBody(sourceEvent.request.body); + return { output: v0Event }; + } catch (err) { + const conversionError = + err instanceof TransformationError ? err : new Error('error converting v2 to v0 spec'); + + return { conversionError }; + } + } + + private parseRequestBody(body: string): NonNullable { + try { + return JSON.parse(body); + } catch (err) { + throw new TransformationError(ErrorMessages.JSONParseError); + } } } diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts index 52cade0d9d3..068bc4ce63a 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts @@ -1,17 +1,31 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInput, SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; export class StrategyV2ToV1 extends VersionConversionStrategy { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult[] { - return sourceEvents.map((sourceEvent) => { - try { - const v1Event = { event: JSON.parse(sourceEvent.request.body), source: sourceEvent.source }; - return { output: v1Event }; - } catch (err) { - const conversionError = - err instanceof Error ? err : new Error('error converting v2 to v1 spec'); - return { conversionError }; - } - }); + return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); + } + + private convertSingleEvent(sourceEvent: SourceInputV2): SourceInputConversionResult { + try { + const v1Event = { + event: this.parseRequestBody(sourceEvent.request.body), + source: sourceEvent.source, + }; + return { output: v1Event }; + } catch (err) { + const conversionError = + err instanceof TransformationError ? err : new Error('error converting v2 to v1 spec'); + return { conversionError }; + } + } + + private parseRequestBody(body: string): NonNullable { + try { + return JSON.parse(body); + } catch (err) { + throw new TransformationError('Malformed JSON in request body'); + } } } diff --git a/src/controllers/util/index.test.ts b/src/controllers/util/index.test.ts index 4559bccc523..1f53ba3c1b3 100644 --- a/src/controllers/util/index.test.ts +++ b/src/controllers/util/index.test.ts @@ -1,3 +1,5 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; +import { ErrorMessages } from '../../constants'; import { Destination, Metadata, @@ -222,7 +224,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v0', input: [ { - conversionError: new SyntaxError('Unexpected end of JSON input'), + conversionError: new TransformationError(ErrorMessages.JSONParseError), }, ], }; @@ -321,7 +323,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v1', input: [ { - conversionError: new SyntaxError('Unexpected end of JSON input'), + conversionError: new TransformationError(ErrorMessages.JSONParseError), }, ], }; diff --git a/src/services/source/nativeIntegration.ts b/src/services/source/nativeIntegration.ts index 078716df96c..6b590a62e4f 100644 --- a/src/services/source/nativeIntegration.ts +++ b/src/services/source/nativeIntegration.ts @@ -2,6 +2,7 @@ import { FetchHandler } from '../../helpers/fetchHandlers'; import { SourceService } from '../../interfaces/SourceService'; import { ErrorDetailer, + ErrorDetailerOptions, MetaTransferObject, RudderMessage, SourceInputConversionResult, @@ -15,13 +16,14 @@ import { SourcePostTransformationService } from './postTransformation'; import logger from '../../logger'; export class NativeIntegrationSourceService implements SourceService { - public getTags(): MetaTransferObject { + public getTags(extraErrorDetails: ErrorDetailerOptions = {}): MetaTransferObject { const metaTO = { errorDetails: { module: tags.MODULES.SOURCE, implementation: tags.IMPLEMENTATIONS.NATIVE, destinationId: 'Non determinable', workspaceId: 'Non determinable', + ...extraErrorDetails, } as ErrorDetailer, errorContext: '[Native Integration Service] Failure During Source Transform', } as MetaTransferObject; @@ -36,7 +38,7 @@ export class NativeIntegrationSourceService implements SourceService { _requestMetadata: NonNullable, ): Promise { const sourceHandler = FetchHandler.getSourceHandler(sourceType, version); - const metaTO = this.getTags(); + const metaTO = this.getTags({ srcType: sourceType }); const respList: SourceTransformationResponse[] = await Promise.all( sourceEvents.map(async (sourceEvent) => { try { diff --git a/src/types/index.ts b/src/types/index.ts index a8e05d3ed62..59bee82f422 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -270,6 +270,9 @@ type ErrorDetailer = { module: string; implementation: string; feature: string; +} & ErrorDetailerOptions; + +type ErrorDetailerOptions = { errorCategory?: string; errorType?: string; meta?: string; @@ -390,6 +393,7 @@ export { Connection, Destination, ErrorDetailer, + ErrorDetailerOptions, MessageIdMetadataMap, MetaTransferObject, Metadata, diff --git a/test/integrations/sources/adjust/data.ts b/test/integrations/sources/adjust/data.ts index bfd61d4ed32..e898692a2d0 100644 --- a/test/integrations/sources/adjust/data.ts +++ b/test/integrations/sources/adjust/data.ts @@ -120,6 +120,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, @@ -176,6 +177,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/appsflyer/data.ts b/test/integrations/sources/appsflyer/data.ts index 5ec64a07a87..c0e0bcc94fa 100644 --- a/test/integrations/sources/appsflyer/data.ts +++ b/test/integrations/sources/appsflyer/data.ts @@ -687,6 +687,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'appsflyer', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/canny/data.ts b/test/integrations/sources/canny/data.ts index ac471904f93..50a99bb4832 100644 --- a/test/integrations/sources/canny/data.ts +++ b/test/integrations/sources/canny/data.ts @@ -1573,6 +1573,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'canny', workspaceId: 'Non determinable', }, }, @@ -1650,6 +1651,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'canny', workspaceId: 'Non determinable', }, }, diff --git a/test/integrations/sources/gainsightpx/data.ts b/test/integrations/sources/gainsightpx/data.ts index b0380015800..b3e3147ea9c 100644 --- a/test/integrations/sources/gainsightpx/data.ts +++ b/test/integrations/sources/gainsightpx/data.ts @@ -853,6 +853,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'gainsightpx', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/iterable/data.ts b/test/integrations/sources/iterable/data.ts index 8912c83434a..e544cd2bc33 100644 --- a/test/integrations/sources/iterable/data.ts +++ b/test/integrations/sources/iterable/data.ts @@ -101,6 +101,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, @@ -145,6 +146,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/shopify/data.ts b/test/integrations/sources/shopify/data.ts index fdf20094921..1cc10371daf 100644 --- a/test/integrations/sources/shopify/data.ts +++ b/test/integrations/sources/shopify/data.ts @@ -65,6 +65,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -104,6 +105,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -148,6 +150,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, From 6d297853ee46a22ca08005c96411d9b97819f177 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Tue, 11 Feb 2025 16:06:06 +0530 Subject: [PATCH 071/160] Revert "fix: improve error handling for webhook v2" --- src/constants/index.js | 5 --- .../conversionStrategies/strategyV2ToV0.ts | 35 ++++++------------- .../conversionStrategies/strategyV2ToV1.ts | 34 ++++++------------ src/controllers/util/index.test.ts | 6 ++-- src/services/source/nativeIntegration.ts | 6 ++-- src/types/index.ts | 4 --- test/integrations/sources/adjust/data.ts | 2 -- test/integrations/sources/appsflyer/data.ts | 1 - test/integrations/sources/canny/data.ts | 2 -- test/integrations/sources/gainsightpx/data.ts | 1 - test/integrations/sources/iterable/data.ts | 2 -- test/integrations/sources/shopify/data.ts | 3 -- 12 files changed, 24 insertions(+), 77 deletions(-) diff --git a/src/constants/index.js b/src/constants/index.js index 05a258ee646..f8ca53a94c9 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -55,10 +55,6 @@ const HTTP_CUSTOM_STATUS_CODES = { FILTERED: 298, }; -const ErrorMessages = { - JSONParseError: 'Malformed JSON in request body', -}; - module.exports = { EventType, GENERIC_TRUE_VALUES, @@ -68,5 +64,4 @@ module.exports = { TraitsMapping, WhiteListedTraits, HTTP_CUSTOM_STATUS_CODES, - ErrorMessages, }; diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts index 2c91d82e403..1145cf97632 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts @@ -1,32 +1,17 @@ -import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; -import { ErrorMessages } from '../../../constants'; export class StrategyV2ToV0 extends VersionConversionStrategy> { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult>[] { - return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); - } - - private convertSingleEvent( - sourceEvent: SourceInputV2, - ): SourceInputConversionResult> { - try { - const v0Event = this.parseRequestBody(sourceEvent.request.body); - return { output: v0Event }; - } catch (err) { - const conversionError = - err instanceof TransformationError ? err : new Error('error converting v2 to v0 spec'); - - return { conversionError }; - } - } - - private parseRequestBody(body: string): NonNullable { - try { - return JSON.parse(body); - } catch (err) { - throw new TransformationError(ErrorMessages.JSONParseError); - } + return sourceEvents.map((sourceEvent) => { + try { + const v0Event = JSON.parse(sourceEvent.request.body); + return { output: v0Event }; + } catch (err) { + const conversionError = + err instanceof Error ? err : new Error('error converting v2 to v0 spec'); + return { conversionError }; + } + }); } } diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts index 068bc4ce63a..52cade0d9d3 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts @@ -1,31 +1,17 @@ -import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInput, SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; export class StrategyV2ToV1 extends VersionConversionStrategy { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult[] { - return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); - } - - private convertSingleEvent(sourceEvent: SourceInputV2): SourceInputConversionResult { - try { - const v1Event = { - event: this.parseRequestBody(sourceEvent.request.body), - source: sourceEvent.source, - }; - return { output: v1Event }; - } catch (err) { - const conversionError = - err instanceof TransformationError ? err : new Error('error converting v2 to v1 spec'); - return { conversionError }; - } - } - - private parseRequestBody(body: string): NonNullable { - try { - return JSON.parse(body); - } catch (err) { - throw new TransformationError('Malformed JSON in request body'); - } + return sourceEvents.map((sourceEvent) => { + try { + const v1Event = { event: JSON.parse(sourceEvent.request.body), source: sourceEvent.source }; + return { output: v1Event }; + } catch (err) { + const conversionError = + err instanceof Error ? err : new Error('error converting v2 to v1 spec'); + return { conversionError }; + } + }); } } diff --git a/src/controllers/util/index.test.ts b/src/controllers/util/index.test.ts index 1f53ba3c1b3..4559bccc523 100644 --- a/src/controllers/util/index.test.ts +++ b/src/controllers/util/index.test.ts @@ -1,5 +1,3 @@ -import { TransformationError } from '@rudderstack/integrations-lib'; -import { ErrorMessages } from '../../constants'; import { Destination, Metadata, @@ -224,7 +222,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v0', input: [ { - conversionError: new TransformationError(ErrorMessages.JSONParseError), + conversionError: new SyntaxError('Unexpected end of JSON input'), }, ], }; @@ -323,7 +321,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v1', input: [ { - conversionError: new TransformationError(ErrorMessages.JSONParseError), + conversionError: new SyntaxError('Unexpected end of JSON input'), }, ], }; diff --git a/src/services/source/nativeIntegration.ts b/src/services/source/nativeIntegration.ts index 6b590a62e4f..078716df96c 100644 --- a/src/services/source/nativeIntegration.ts +++ b/src/services/source/nativeIntegration.ts @@ -2,7 +2,6 @@ import { FetchHandler } from '../../helpers/fetchHandlers'; import { SourceService } from '../../interfaces/SourceService'; import { ErrorDetailer, - ErrorDetailerOptions, MetaTransferObject, RudderMessage, SourceInputConversionResult, @@ -16,14 +15,13 @@ import { SourcePostTransformationService } from './postTransformation'; import logger from '../../logger'; export class NativeIntegrationSourceService implements SourceService { - public getTags(extraErrorDetails: ErrorDetailerOptions = {}): MetaTransferObject { + public getTags(): MetaTransferObject { const metaTO = { errorDetails: { module: tags.MODULES.SOURCE, implementation: tags.IMPLEMENTATIONS.NATIVE, destinationId: 'Non determinable', workspaceId: 'Non determinable', - ...extraErrorDetails, } as ErrorDetailer, errorContext: '[Native Integration Service] Failure During Source Transform', } as MetaTransferObject; @@ -38,7 +36,7 @@ export class NativeIntegrationSourceService implements SourceService { _requestMetadata: NonNullable, ): Promise { const sourceHandler = FetchHandler.getSourceHandler(sourceType, version); - const metaTO = this.getTags({ srcType: sourceType }); + const metaTO = this.getTags(); const respList: SourceTransformationResponse[] = await Promise.all( sourceEvents.map(async (sourceEvent) => { try { diff --git a/src/types/index.ts b/src/types/index.ts index 59bee82f422..a8e05d3ed62 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -270,9 +270,6 @@ type ErrorDetailer = { module: string; implementation: string; feature: string; -} & ErrorDetailerOptions; - -type ErrorDetailerOptions = { errorCategory?: string; errorType?: string; meta?: string; @@ -393,7 +390,6 @@ export { Connection, Destination, ErrorDetailer, - ErrorDetailerOptions, MessageIdMetadataMap, MetaTransferObject, Metadata, diff --git a/test/integrations/sources/adjust/data.ts b/test/integrations/sources/adjust/data.ts index e898692a2d0..bfd61d4ed32 100644 --- a/test/integrations/sources/adjust/data.ts +++ b/test/integrations/sources/adjust/data.ts @@ -120,7 +120,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, @@ -177,7 +176,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/appsflyer/data.ts b/test/integrations/sources/appsflyer/data.ts index c0e0bcc94fa..5ec64a07a87 100644 --- a/test/integrations/sources/appsflyer/data.ts +++ b/test/integrations/sources/appsflyer/data.ts @@ -687,7 +687,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'appsflyer', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/canny/data.ts b/test/integrations/sources/canny/data.ts index 50a99bb4832..ac471904f93 100644 --- a/test/integrations/sources/canny/data.ts +++ b/test/integrations/sources/canny/data.ts @@ -1573,7 +1573,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'canny', workspaceId: 'Non determinable', }, }, @@ -1651,7 +1650,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'canny', workspaceId: 'Non determinable', }, }, diff --git a/test/integrations/sources/gainsightpx/data.ts b/test/integrations/sources/gainsightpx/data.ts index b3e3147ea9c..b0380015800 100644 --- a/test/integrations/sources/gainsightpx/data.ts +++ b/test/integrations/sources/gainsightpx/data.ts @@ -853,7 +853,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'gainsightpx', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/iterable/data.ts b/test/integrations/sources/iterable/data.ts index e544cd2bc33..8912c83434a 100644 --- a/test/integrations/sources/iterable/data.ts +++ b/test/integrations/sources/iterable/data.ts @@ -101,7 +101,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, @@ -146,7 +145,6 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/shopify/data.ts b/test/integrations/sources/shopify/data.ts index 1cc10371daf..fdf20094921 100644 --- a/test/integrations/sources/shopify/data.ts +++ b/test/integrations/sources/shopify/data.ts @@ -65,7 +65,6 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -105,7 +104,6 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -150,7 +148,6 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', - srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, From c3f2d4ea140564da934e1efd71a19c7fae0bea65 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Tue, 11 Feb 2025 16:29:55 +0530 Subject: [PATCH 072/160] chore: adding vinay to hotfix branch creation workflow --- .github/workflows/create-hotfix-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-hotfix-branch.yml b/.github/workflows/create-hotfix-branch.yml index 994283a9f43..3cdc27609ee 100644 --- a/.github/workflows/create-hotfix-branch.yml +++ b/.github/workflows/create-hotfix-branch.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest # Only allow these users to create new hotfix branch from 'main' - if: github.ref == 'refs/heads/main' && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'koladilip' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'utsabc') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc') + if: github.ref == 'refs/heads/main' && (github.actor == 'vinayteki95' || github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'koladilip' || github.actor == 'saikumarrs' || github.actor == 'sandeepdsvs' || github.actor == 'shrouti1507' || github.actor == 'anantjain45823' || github.actor == 'chandumlg' || github.actor == 'mihir-4116' || github.actor == 'utsabc') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'saikumarrs' || github.triggering_actor == 'sandeepdsvs' || github.triggering_actor == 'koladilip' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'anantjain45823' || github.triggering_actor == 'chandumlg' || github.triggering_actor == 'mihir-4116' || github.triggering_actor == 'sanpj2292' || github.triggering_actor == 'utsabc' || github.triggering_actor == 'vinayteki95') steps: - name: Create Branch uses: peterjgrainger/action-create-branch@v2.4.0 From 9f224ec03b91f1a4d85b117dbf6972bb1ef40c6d Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Tue, 11 Feb 2025 16:37:45 +0530 Subject: [PATCH 073/160] fix: better error handling in webhook v2 --- src/constants/index.js | 5 +++ .../conversionStrategies/strategyV2ToV0.ts | 35 +++++++++++++------ .../conversionStrategies/strategyV2ToV1.ts | 34 ++++++++++++------ src/controllers/util/index.test.ts | 6 ++-- src/services/source/nativeIntegration.ts | 6 ++-- src/types/index.ts | 4 +++ test/integrations/sources/adjust/data.ts | 2 ++ test/integrations/sources/appsflyer/data.ts | 1 + test/integrations/sources/canny/data.ts | 2 ++ test/integrations/sources/gainsightpx/data.ts | 1 + test/integrations/sources/iterable/data.ts | 2 ++ test/integrations/sources/shopify/data.ts | 3 ++ 12 files changed, 77 insertions(+), 24 deletions(-) diff --git a/src/constants/index.js b/src/constants/index.js index f8ca53a94c9..05a258ee646 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -55,6 +55,10 @@ const HTTP_CUSTOM_STATUS_CODES = { FILTERED: 298, }; +const ErrorMessages = { + JSONParseError: 'Malformed JSON in request body', +}; + module.exports = { EventType, GENERIC_TRUE_VALUES, @@ -64,4 +68,5 @@ module.exports = { TraitsMapping, WhiteListedTraits, HTTP_CUSTOM_STATUS_CODES, + ErrorMessages, }; diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts index 1145cf97632..2c91d82e403 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV0.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV0.ts @@ -1,17 +1,32 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; +import { ErrorMessages } from '../../../constants'; export class StrategyV2ToV0 extends VersionConversionStrategy> { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult>[] { - return sourceEvents.map((sourceEvent) => { - try { - const v0Event = JSON.parse(sourceEvent.request.body); - return { output: v0Event }; - } catch (err) { - const conversionError = - err instanceof Error ? err : new Error('error converting v2 to v0 spec'); - return { conversionError }; - } - }); + return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); + } + + private convertSingleEvent( + sourceEvent: SourceInputV2, + ): SourceInputConversionResult> { + try { + const v0Event = this.parseRequestBody(sourceEvent.request.body); + return { output: v0Event }; + } catch (err) { + const conversionError = + err instanceof TransformationError ? err : new Error('error converting v2 to v0 spec'); + + return { conversionError }; + } + } + + private parseRequestBody(body: string): NonNullable { + try { + return JSON.parse(body); + } catch (err) { + throw new TransformationError(ErrorMessages.JSONParseError); + } } } diff --git a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts index 52cade0d9d3..068bc4ce63a 100644 --- a/src/controllers/util/conversionStrategies/strategyV2ToV1.ts +++ b/src/controllers/util/conversionStrategies/strategyV2ToV1.ts @@ -1,17 +1,31 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; import { SourceInput, SourceInputConversionResult, SourceInputV2 } from '../../../types'; import { VersionConversionStrategy } from './abstractions'; export class StrategyV2ToV1 extends VersionConversionStrategy { convert(sourceEvents: SourceInputV2[]): SourceInputConversionResult[] { - return sourceEvents.map((sourceEvent) => { - try { - const v1Event = { event: JSON.parse(sourceEvent.request.body), source: sourceEvent.source }; - return { output: v1Event }; - } catch (err) { - const conversionError = - err instanceof Error ? err : new Error('error converting v2 to v1 spec'); - return { conversionError }; - } - }); + return sourceEvents.map((sourceEvent) => this.convertSingleEvent(sourceEvent)); + } + + private convertSingleEvent(sourceEvent: SourceInputV2): SourceInputConversionResult { + try { + const v1Event = { + event: this.parseRequestBody(sourceEvent.request.body), + source: sourceEvent.source, + }; + return { output: v1Event }; + } catch (err) { + const conversionError = + err instanceof TransformationError ? err : new Error('error converting v2 to v1 spec'); + return { conversionError }; + } + } + + private parseRequestBody(body: string): NonNullable { + try { + return JSON.parse(body); + } catch (err) { + throw new TransformationError('Malformed JSON in request body'); + } } } diff --git a/src/controllers/util/index.test.ts b/src/controllers/util/index.test.ts index 4559bccc523..1f53ba3c1b3 100644 --- a/src/controllers/util/index.test.ts +++ b/src/controllers/util/index.test.ts @@ -1,3 +1,5 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; +import { ErrorMessages } from '../../constants'; import { Destination, Metadata, @@ -222,7 +224,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v0', input: [ { - conversionError: new SyntaxError('Unexpected end of JSON input'), + conversionError: new TransformationError(ErrorMessages.JSONParseError), }, ], }; @@ -321,7 +323,7 @@ describe('adaptInputToVersion', () => { implementationVersion: 'v1', input: [ { - conversionError: new SyntaxError('Unexpected end of JSON input'), + conversionError: new TransformationError(ErrorMessages.JSONParseError), }, ], }; diff --git a/src/services/source/nativeIntegration.ts b/src/services/source/nativeIntegration.ts index 078716df96c..6b590a62e4f 100644 --- a/src/services/source/nativeIntegration.ts +++ b/src/services/source/nativeIntegration.ts @@ -2,6 +2,7 @@ import { FetchHandler } from '../../helpers/fetchHandlers'; import { SourceService } from '../../interfaces/SourceService'; import { ErrorDetailer, + ErrorDetailerOptions, MetaTransferObject, RudderMessage, SourceInputConversionResult, @@ -15,13 +16,14 @@ import { SourcePostTransformationService } from './postTransformation'; import logger from '../../logger'; export class NativeIntegrationSourceService implements SourceService { - public getTags(): MetaTransferObject { + public getTags(extraErrorDetails: ErrorDetailerOptions = {}): MetaTransferObject { const metaTO = { errorDetails: { module: tags.MODULES.SOURCE, implementation: tags.IMPLEMENTATIONS.NATIVE, destinationId: 'Non determinable', workspaceId: 'Non determinable', + ...extraErrorDetails, } as ErrorDetailer, errorContext: '[Native Integration Service] Failure During Source Transform', } as MetaTransferObject; @@ -36,7 +38,7 @@ export class NativeIntegrationSourceService implements SourceService { _requestMetadata: NonNullable, ): Promise { const sourceHandler = FetchHandler.getSourceHandler(sourceType, version); - const metaTO = this.getTags(); + const metaTO = this.getTags({ srcType: sourceType }); const respList: SourceTransformationResponse[] = await Promise.all( sourceEvents.map(async (sourceEvent) => { try { diff --git a/src/types/index.ts b/src/types/index.ts index a8e05d3ed62..59bee82f422 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -270,6 +270,9 @@ type ErrorDetailer = { module: string; implementation: string; feature: string; +} & ErrorDetailerOptions; + +type ErrorDetailerOptions = { errorCategory?: string; errorType?: string; meta?: string; @@ -390,6 +393,7 @@ export { Connection, Destination, ErrorDetailer, + ErrorDetailerOptions, MessageIdMetadataMap, MetaTransferObject, Metadata, diff --git a/test/integrations/sources/adjust/data.ts b/test/integrations/sources/adjust/data.ts index bfd61d4ed32..e898692a2d0 100644 --- a/test/integrations/sources/adjust/data.ts +++ b/test/integrations/sources/adjust/data.ts @@ -120,6 +120,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, @@ -176,6 +177,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'adjust', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/appsflyer/data.ts b/test/integrations/sources/appsflyer/data.ts index 5ec64a07a87..c0e0bcc94fa 100644 --- a/test/integrations/sources/appsflyer/data.ts +++ b/test/integrations/sources/appsflyer/data.ts @@ -687,6 +687,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'appsflyer', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/canny/data.ts b/test/integrations/sources/canny/data.ts index ac471904f93..50a99bb4832 100644 --- a/test/integrations/sources/canny/data.ts +++ b/test/integrations/sources/canny/data.ts @@ -1573,6 +1573,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'canny', workspaceId: 'Non determinable', }, }, @@ -1650,6 +1651,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'canny', workspaceId: 'Non determinable', }, }, diff --git a/test/integrations/sources/gainsightpx/data.ts b/test/integrations/sources/gainsightpx/data.ts index b0380015800..b3e3147ea9c 100644 --- a/test/integrations/sources/gainsightpx/data.ts +++ b/test/integrations/sources/gainsightpx/data.ts @@ -853,6 +853,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'gainsightpx', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/iterable/data.ts b/test/integrations/sources/iterable/data.ts index 8912c83434a..e544cd2bc33 100644 --- a/test/integrations/sources/iterable/data.ts +++ b/test/integrations/sources/iterable/data.ts @@ -101,6 +101,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, @@ -145,6 +146,7 @@ export const data = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'iterable', workspaceId: 'Non determinable', }, statusCode: 400, diff --git a/test/integrations/sources/shopify/data.ts b/test/integrations/sources/shopify/data.ts index fdf20094921..1cc10371daf 100644 --- a/test/integrations/sources/shopify/data.ts +++ b/test/integrations/sources/shopify/data.ts @@ -65,6 +65,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -104,6 +105,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, @@ -148,6 +150,7 @@ const serverSideEventsScenarios = [ errorCategory: 'transformation', implementation: 'native', module: 'source', + srcType: 'shopify', workspaceId: 'Non determinable', }, statusCode: 400, From 3d4a5a6c58bfad696dae54f38f88308afb6d350d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 11 Feb 2025 11:12:06 +0000 Subject: [PATCH 074/160] chore(release): 1.90.2 --- CHANGELOG.md | 10 ++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e0c2254396..9b6530b7e52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ 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.90.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.1...v1.90.2) (2025-02-11) + + +### Bug Fixes + +* better error handling in webhook v2 ([9f224ec](https://github.com/rudderlabs/rudder-transformer/commit/9f224ec03b91f1a4d85b117dbf6972bb1ef40c6d)) +* improve error handling for webhook v2 ([f44d5a5](https://github.com/rudderlabs/rudder-transformer/commit/f44d5a56fd6ee183aea73eaba7e73c121f8bc470)) +* improve error handling for webhook v2 ([#4061](https://github.com/rudderlabs/rudder-transformer/issues/4061)) ([5d1e1bd](https://github.com/rudderlabs/rudder-transformer/commit/5d1e1bdb26bacddb3838bd16752b333d7814c294)) +* improve error handling for webhook v2 ([#4062](https://github.com/rudderlabs/rudder-transformer/issues/4062)) ([d795830](https://github.com/rudderlabs/rudder-transformer/commit/d79583087e98d713afb9b38d3a25d4e580a36c76)) + ### [1.90.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.0...v1.90.1) (2025-02-06) diff --git a/package-lock.json b/package-lock.json index ebe79b957ce..e144641a8e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.90.1", + "version": "1.90.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.90.1", + "version": "1.90.2", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index b6fb5b42884..87531f00ebb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.90.1", + "version": "1.90.2", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From ccc68cfec44614e2c643f7db112737105128e553 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:54:43 +0530 Subject: [PATCH 075/160] chore: security upgrade node from 18.20.3-alpine3.18 to 18.20.6-alpine3.21 (#4056) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6131ebbd54c..f7f7a125502 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.4 -FROM node:18.20.3-alpine3.18 AS base +FROM node:18.20.6-alpine3.21 AS base ENV HUSKY 0 RUN apk update From 3fdc92b93869e875c50c482f890283c97611dc4f Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:32:14 +0530 Subject: [PATCH 076/160] fix: fixing wrong identifiers in payload for twitter ads destination (#3988) * fix: fixing wrong identifiers in payload for twitter ads destination * fix: added more test * fix: minor change * fix: addressing comments * fix: added some comments * refactor: twitter ads transform.js * refactor: twitter ads transform.js * refactor: add tests for twitter ads * refactor: add tests for twitter ads * refactor: add tests for twitter ads * refactor: add tests for twitter ads * refactor: twitter ads populate contents function * refactor: twitter ads populate contents function --------- Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> Co-authored-by: Dilip Kola --- src/v0/destinations/twitter_ads/transform.js | 171 +-- .../twitter_ads/processor/data.ts | 1164 ++++++++++++++++- .../destinations/twitter_ads/router/data.ts | 223 ++++ 3 files changed, 1472 insertions(+), 86 deletions(-) diff --git a/src/v0/destinations/twitter_ads/transform.js b/src/v0/destinations/twitter_ads/transform.js index 71536be2d91..4258935bfbb 100644 --- a/src/v0/destinations/twitter_ads/transform.js +++ b/src/v0/destinations/twitter_ads/transform.js @@ -80,114 +80,125 @@ function populateEventId(event, requestJson, destination) { } function populateContents(requestJson) { - const reqJson = { ...requestJson }; - if (reqJson.contents) { - const transformedContents = requestJson.contents - .map((obj) => ({ - ...(obj.id && { content_id: obj.id }), - ...(obj.groupId && { content_group_id: obj.groupId }), - ...(obj.name && { content_name: obj.name }), - ...(obj.price && { content_price: parseFloat(obj.price) }), - ...(obj.type && { content_type: obj.type }), - ...(obj.quantity && { num_items: parseInt(obj.quantity, 10) }), - })) - .filter((tfObj) => Object.keys(tfObj).length > 0); - if (transformedContents.length > 0) { - reqJson.contents = transformedContents; - } - } - return reqJson; + const { contents, ...rest } = requestJson; + + if (!Array.isArray(contents)) return requestJson; + + const transformedContents = contents + .map(({ id, groupId, name, price, type, quantity }) => { + const transformed = {}; + if (id) { + transformed.content_id = id; + } + if (groupId) { + transformed.content_group_id = groupId; + } + if (name) { + transformed.content_name = name; + } + if (type) { + transformed.content_type = type; + } + if (price && Number.isFinite(parseFloat(price))) { + transformed.content_price = parseFloat(price); + } + if (quantity && Number.isFinite(parseInt(quantity, 10))) { + transformed.num_items = parseInt(quantity, 10); + } + return Object.keys(transformed).length > 0 ? transformed : null; + }) + .filter(Boolean); // Removes null entries + + return transformedContents.length > 0 ? { ...rest, contents: transformedContents } : rest; } -// process track call -function processTrack(message, metadata, destination) { - let requestJson = constructPayload(message, mappingConfig[ConfigCategories.TRACK.name]); - - requestJson.event_id = - requestJson.event_id || populateEventId(message.event, requestJson, destination); - - requestJson.conversion_time = isDefinedAndNotNull(requestJson.conversion_time) - ? requestJson.conversion_time - : message.timestamp; - +// Separate identifier creation logic for better maintainability +function createIdentifiers(properties) { + if (!properties) { + throw new InstrumentationError( + '[TWITTER ADS]: properties must be present in event. Aborting message', + ); + } const identifiers = []; + const { email, phone, twclid, ip_address: ipAddress, user_agent: userAgent } = properties; - if (message.properties.email) { - let email = message.properties.email.trim(); - if (email) { - email = email.toLowerCase(); - identifiers.push({ hashed_email: sha256(email) }); - } + // Handle email + if (email?.trim()) { + identifiers.push({ + hashed_email: sha256(email.trim().toLowerCase()), + }); } - if (message.properties.phone) { - const phone = message.properties.phone.trim(); - if (phone) { - identifiers.push({ hashed_phone_number: sha256(phone) }); - } + // Handle phone + if (phone?.trim()) { + identifiers.push({ + hashed_phone_number: sha256(phone.trim()), + }); } - if (message.properties.twclid) { - identifiers.push({ twclid: message.properties.twclid }); + // Handle twclid + if (twclid) { + identifiers.push({ twclid }); } - if (message.properties.ip_address) { - const ipAddress = message.properties.ip_address.trim(); - if (ipAddress) { - identifiers.push({ ip_address: ipAddress }); + // Handle IP and user agent + const trimmedIp = ipAddress?.trim(); + const trimmedUserAgent = userAgent?.trim(); + // ip_address or/and user_agent is required to be + // passed in conjunction with another identifier + // ref: https://developer.x.com/en/docs/x-ads-api/measurement/web-conversions/api-reference/conversions + if (trimmedIp && trimmedUserAgent) { + identifiers.push({ + ip_address: trimmedIp, + user_agent: trimmedUserAgent, + }); + } else { + if (identifiers.length === 0) { + throw new InstrumentationError( + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + ); } - } - - if (message.properties.user_agent) { - const userAgent = message.properties.user_agent.trim(); - if (userAgent) { - identifiers.push({ user_agent: userAgent }); + if (trimmedIp) { + identifiers[0].ip_address = trimmedIp; + } + if (trimmedUserAgent) { + identifiers[0].user_agent = trimmedUserAgent; } } - requestJson = populateContents(requestJson); + return identifiers; +} +// process track call +function processTrack(message, metadata, destination) { + const identifiers = createIdentifiers(message.properties); + let requestJson = constructPayload(message, mappingConfig[ConfigCategories.TRACK.name]); requestJson.identifiers = identifiers; - const endpointUrl = prepareUrl(message, destination); - - return buildResponse(message, requestJson, metadata, endpointUrl); -} + // Populate required fields + requestJson.event_id = + requestJson.event_id || populateEventId(message.event, requestJson, destination); -function validateRequest(message) { - const { properties } = message; + requestJson.conversion_time = isDefinedAndNotNull(requestJson.conversion_time) + ? requestJson.conversion_time + : message.timestamp; - if (!properties) { - throw new InstrumentationError( - '[TWITTER ADS]: properties must be present in event. Aborting message', - ); - } + // Add identifiers and transform contents + requestJson = populateContents(requestJson); - if ( - !properties.email && - !properties.phone && - !properties.twclid && - !properties.ip_address && - !properties.user_agent - ) { - throw new InstrumentationError( - '[TWITTER ADS]: one of twclid, phone, email, ip_address or user_agent must be present in properties.', - ); - } + const endpointUrl = prepareUrl(message, destination); + return buildResponse(message, requestJson, metadata, endpointUrl); } function process(event) { const { message, metadata, destination } = event; - validateRequest(message); - const messageType = message.type?.toLowerCase(); - if (messageType === EventType.TRACK) { - return processTrack(message, metadata, destination); + if (messageType !== EventType.TRACK) { + throw new InstrumentationError(`Message type ${messageType} not supported`); } - - throw new InstrumentationError(`Message type ${messageType} not supported`); + return processTrack(message, metadata, destination); } const processRouterDest = async (inputs, reqMetadata) => { diff --git a/test/integrations/destinations/twitter_ads/processor/data.ts b/test/integrations/destinations/twitter_ads/processor/data.ts index 0ae21ffc98e..8c622f22393 100644 --- a/test/integrations/destinations/twitter_ads/processor/data.ts +++ b/test/integrations/destinations/twitter_ads/processor/data.ts @@ -292,7 +292,7 @@ export const data = [ }, statusCode: 400, error: - '[TWITTER ADS]: one of twclid, phone, email, ip_address or user_agent must be present in properties.', + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', statTags: { errorCategory: 'dataValidation', errorType: 'instrumentation', @@ -969,6 +969,192 @@ export const data = [ ], }, }, + output: { + response: { + status: 200, + body: [ + { + error: + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for track event with user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + }, + properties: { + affiliation: 'Google Store', + user_agent: + ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + metadata: { + secret: { + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for track event with ip_address and user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + ip_address: '8.25.197.25', + user_agent: + ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, output: { response: { status: 200, @@ -994,6 +1180,8 @@ export const data = [ identifiers: [ { ip_address: '8.25.197.25', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', }, ], }, @@ -1022,7 +1210,7 @@ export const data = [ }, { name: 'twitter_ads', - description: 'Test case for track event with user_agent as an identifier', + description: 'Test case for track event with email and ip_address as an identifier', feature: 'processor', module: 'destination', version: 'v0', @@ -1036,17 +1224,28 @@ export const data = [ channel: 'web', context: { source: 'test', + userAgent: 'chrome', traits: { anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', email: 'abc@gmail.com', phone: '+1234589947', ge: 'male', }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', properties: { affiliation: 'Google Store', - user_agent: - ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + ip_address: '8.25.197.25', + email: 'abc@ax.com', }, anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', integrations: { @@ -1055,6 +1254,9 @@ export const data = [ }, metadata: { secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', accessTokenSecret: 'testAccessTokenSecret', }, }, @@ -1097,11 +1299,14 @@ export const data = [ JSON: { conversions: [ { + conversion_time: '2020-08-14T05:30:30.118Z', + user_agent: 'chrome', event_id: 'tw-odt2o-odt2q', identifiers: [ { - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + ip_address: '8.25.197.25', }, ], }, @@ -1116,6 +1321,953 @@ export const data = [ }, metadata: { secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for track event with phone and user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + phone: '+919927455678', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + user_agent: 'chrome', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_phone_number: + 'b308962b96b40cce7981493a372db9478edae79f83c2d8ca6cd15a39566f8c56', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: + 'Test case for track event with twclid and ip_address with user_agent as an identifier', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + channel: 'web', + context: { + source: 'test', + userAgent: 'chrome', + traits: { + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + email: 'abc@gmail.com', + phone: '+1234589947', + ge: 'male', + }, + device: { + advertisingId: 'abc123', + }, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.6', + }, + }, + messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + twclid: '543', + ip_address: '8.25.197.25', + user_agent: + ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1', + integrations: { + All: true, + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + rudderAccountId: '2EOknn1JNH7WK1MfNku4fGYKkRK', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + user_agent: 'chrome', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + twclid: '543', + }, + { + ip_address: '8.25.197.25', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36.', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for email with only ip_address (no user_agent)', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + properties: { + email: 'test@example.com', + ip_address: '8.25.197.25', + // user_agent is intentionally missing + }, + timestamp: '2020-08-14T05:30:30.118Z', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_email: + '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b', + ip_address: '8.25.197.25', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for email with only user_agent (no ip_address)', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + properties: { + email: 'test@example.com', + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', + // ip_address is intentionally missing + }, + timestamp: '2020-08-14T05:30:30.118Z', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-odt2o-odt2q', + identifiers: [ + { + hashed_email: + '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b', + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for content transformations with missing price and quantity', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'abc@ax.com', + contents: [ + { + // No price or quantity + id: '12', + name: 'Product 1', + type: 'physical', + groupId: 'group1', + }, + { + // Only price, no quantity + id: '13', + price: '200', + name: 'Product 2', + type: 'digital', + }, + { + // Only quantity, no price + id: '14', + quantity: '3', + name: 'Product 3', + groupId: 'group2', + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + ], + contents: [ + { + content_id: '12', + content_name: 'Product 1', + content_type: 'physical', + content_group_id: 'group1', + }, + { + content_id: '13', + content_name: 'Product 2', + content_type: 'digital', + content_price: 200, + }, + { + content_id: '14', + content_name: 'Product 3', + content_group_id: 'group2', + num_items: 3, + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for content with no mappable fields', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'abc@ax.com', + contents: [ + { + // No mappable fields - should be filtered out + someOtherField: 'value', + anotherField: 123, + }, + { + // Valid content - should be included + id: '13', + name: 'Product 2', + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + ], + contents: [ + { + content_id: '13', + content_name: 'Product 2', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for missing eventNameToIdMappings in config', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'Product Viewed', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'test@example.com', + ip_address: '8.25.197.25', + user_agent: 'Mozilla/5.0', + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + // twitterAdsEventNames is intentionally missing + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + "[TWITTER ADS]: Event - 'Product Viewed' do not have a corresponding eventId in configuration. Aborting", + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for empty string identifiers', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: '', + phone: '', + twclid: '', + ip_address: '', + user_agent: '', + // All identifier fields present but empty + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + statusCode: 400, + error: + '[TWITTER ADS]: one of twclid, phone, email or ip_address with user_agent must be present in properties.', + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for all invalid contents', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'test@example.com', + value: '100', + currency: 'USD', + contents: [ + { + // No valid mappable fields + invalidField1: 'value1', + invalidField2: 'value2', + }, + { + // Another invalid content + someField: 123, + otherField: true, + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + value: '100', + price_currency: 'USD', + identifiers: [ + { + hashed_email: + '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b', + }, + ], + // contents field should not be present as all contents were invalid + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', accessTokenSecret: 'testAccessTokenSecret', }, }, diff --git a/test/integrations/destinations/twitter_ads/router/data.ts b/test/integrations/destinations/twitter_ads/router/data.ts index 7e8061dd7e5..f1fe2a10e66 100644 --- a/test/integrations/destinations/twitter_ads/router/data.ts +++ b/test/integrations/destinations/twitter_ads/router/data.ts @@ -193,6 +193,229 @@ export const data = [ }, }, }, + { + name: 'twitter_ads', + description: 'Test case for missing properties in message', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + destType: 'twitter_ads', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { rudderEventName: 'Home Page Viewed', twitterEventId: 'tw-odt2o-odt2q' }, + ], + }, + }, + statusCode: 400, + error: '[TWITTER ADS]: properties must be present in event. Aborting message', + metadata: [ + { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + ], + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'router', + }, + }, + ], + }, + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for missing OAuth secret', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'track', + event: 'Home Page Viewed', + properties: { + email: 'test@test.com', + }, + }, + metadata: {}, // Missing secret + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'Home Page Viewed', + twitterEventId: 'tw-odt2o-odt2q', + }, + ], + }, + }, + }, + ], + destType: 'twitter_ads', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { rudderEventName: 'Home Page Viewed', twitterEventId: 'tw-odt2o-odt2q' }, + ], + }, + }, + statusCode: 500, + error: '[TWITTER ADS]:: OAuth - access keys not found', + metadata: [{}], + statTags: { + errorCategory: 'platform', + errorType: 'oAuthSecret', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'router', + }, + }, + ], + }, + }, + }, + }, + { + name: 'twitter_ads', + description: 'Test case for unsupported message type', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + type: 'identify', // Unsupported message type + properties: { + email: 'test@test.com', + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + }, + }, + }, + ], + destType: 'twitter_ads', + }, + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + destination: { + Config: { + pixelId: 'dummyPixelId', + }, + }, + statusCode: 400, + error: 'Message type identify not supported', + metadata: [ + { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + ], + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'TWITTER_ADS', + module: 'destination', + implementation: 'native', + feature: 'router', + }, + }, + ], + }, + }, + }, + }, ].map((tc) => ({ ...tc, mockFns: (_) => { From 2b350fe22919d99b803cb17629b30f0c83dc5f8a Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:41:42 +0530 Subject: [PATCH 077/160] feat: add support for hashed cart token as anonymousid (#4048) * chore: add support for hashed cart token as anonymousid * chore: cart token hash in all events traits * chore: add tests * chore: use uuid from integrations lib * chore: update lib version used * chore: refactor, address comment * chore: add stat for non stitched events * chore: update stat * chore: update stat * chore: remove unused stat * chore: add stat test for cart token miss * refactor: ignore warning in timestamp util * refactor: ignore warning in timestamp util --------- Co-authored-by: Dilip Kola --- package-lock.json | 26 +- package.json | 2 +- src/util/prometheus.js | 12 +- .../helper.test.js | 8 + .../serverSideTransform.js | 3 + .../serverSideUtils.test.js | 72 ++++- .../webhookTransformations/serverSideUtlis.js | 52 +++- test/integrations/sources/shopify/mocks.ts | 2 + .../CheckoutEventsTests.ts | 256 +++++++++++++++++- .../webhookTestScenarios/GenericTrackTests.ts | 1 + 10 files changed, 404 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8ce4e55978e..be9e161d3ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.13", + "@rudderstack/integrations-lib": "^0.2.16", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", @@ -6746,16 +6746,15 @@ } }, "node_modules/@rudderstack/integrations-lib": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.13.tgz", - "integrity": "sha512-MBI+OQpnYAuOzRlbGCnUX6oVfQsYA7daZ8z07WmqQYQtWFOfd2yFbaxKclu+R/a8W7+jBo4gvbW+ScEW6h+Mgg==", - "license": "MIT", + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.16.tgz", + "integrity": "sha512-wckZxn1EMu8nTV/sPmrWOTbKyC5WCM574q5q//B+AHhy68+c0pwvGq1nuSf2m+c6WaXgwUwxn28TcLc5w5Ga+g==", "dependencies": { "axios": "^1.4.0", - "axios-mock-adapter": "^1.22.0", "crypto": "^1.0.1", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", + "fast-xml-parser": "^4.5.0", "get-value": "^3.0.1", "handlebars": "^4.7.8", "lodash": "^4.17.21", @@ -6764,9 +6763,22 @@ "set-value": "^4.1.0", "sha256": "^0.2.0", "tslib": "^2.4.0", + "uuid": "^11.0.5", "winston": "^3.11.0" } }, + "node_modules/@rudderstack/integrations-lib/node_modules/uuid": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz", + "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/@rudderstack/json-template-engine": { "version": "0.19.5", "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.19.5.tgz", @@ -8693,6 +8705,7 @@ }, "node_modules/axios-mock-adapter": { "version": "1.22.0", + "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", @@ -14238,6 +14251,7 @@ }, "node_modules/is-buffer": { "version": "2.0.5", + "dev": true, "funding": [ { "type": "github", diff --git a/package.json b/package.json index 87531f00ebb..1cd28a28b76 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.13", + "@rudderstack/integrations-lib": "^0.2.16", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", diff --git a/src/util/prometheus.js b/src/util/prometheus.js index af3f1c5fc19..40c0b8c9048 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -445,12 +445,6 @@ class Prometheus { type: 'counter', labelNames: ['event', 'writeKey'], }, - { - name: 'shopify_pixel_cart_token_not_found_server_side', - help: 'shopify_pixel_cart_token_not_found_server_side', - type: 'counter', - labelNames: ['event', 'writeKey'], - }, { name: 'shopify_pixel_cart_token_set', help: 'shopify_pixel_cart_token_set', @@ -463,6 +457,12 @@ class Prometheus { type: 'counter', labelNames: ['event', 'writeKey'], }, + { + name: 'shopify_pixel_id_stitch_gaps', + help: 'shopify_pixel_id_stitch_gaps', + type: 'counter', + labelNames: ['event', 'reason', 'source', 'writeKey'], + }, { name: 'outgoing_request_count', help: 'Outgoing HTTP requests count', diff --git a/src/v0/destinations/google_adwords_offline_conversions/helper.test.js b/src/v0/destinations/google_adwords_offline_conversions/helper.test.js index 2ac5c6cfa04..a94097245d9 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/helper.test.js +++ b/src/v0/destinations/google_adwords_offline_conversions/helper.test.js @@ -2,6 +2,14 @@ const moment = require('moment-timezone'); const { formatTimestamp } = require('./helper'); describe('google adwords offline conversions - helper', () => { + beforeAll(() => { + jest.spyOn(console, 'warn').mockImplementation(() => {}); + }); + + afterAll(() => { + console.warn.mockRestore(); + }); + it('should correctly format to IST', () => { moment.tz.setDefault('Asia/Calcutta'); expect(formatTimestamp('2019-10-14 11:15:18.299Z')).toEqual('2019-10-14 16:45:18+05:30'); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 1fe92bbee0d..6d893a0c040 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -19,6 +19,7 @@ const { getProductsFromLineItems, setAnonymousId, handleCommonProperties, + addCartTokenHashToTraits, } = require('./serverSideUtlis'); const NO_OPERATION_SUCCESS = { @@ -113,6 +114,8 @@ const processEvent = async (inputEvent, metricMetadata) => { } // attach userId, email and other contextual properties message = handleCommonProperties(message, event, shopifyTopic); + // add cart_token_hash to traits if cart_token is present + message = addCartTokenHashToTraits(message, event); message = removeUndefinedAndNullValues(message); return message; }; diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index 070fdafdd71..ad0902bbee5 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -4,12 +4,19 @@ const { createPropertiesForEcomEventFromWebhook, getAnonymousIdFromAttributes, getCartToken, + setAnonymousId, + addCartTokenHashToTraits, } = require('./serverSideUtlis'); const { RedisDB } = require('../../../../util/redis/redisConnector'); +const stats = require('../../../../util/stats'); const { lineItemsMappingJSON } = require('../../../../v0/sources/shopify/config'); const Message = require('../../../../v0/sources/message'); +const { property } = require('lodash'); jest.mock('../../../../v0/sources/message'); +jest.mock('../../../../util/stats', () => ({ + increment: jest.fn(), +})); const LINEITEMS = [ { @@ -131,7 +138,7 @@ describe('serverSideUtils.js', () => { }); }); - describe('getCartToken', () => { + describe('Test getCartToken', () => { it('should return null if cart_token is not present', () => { const event = {}; const result = getCartToken(event); @@ -144,6 +151,31 @@ describe('serverSideUtils.js', () => { expect(result).toEqual('cartTokenTest1'); }); }); + + describe('Test addCartTokenHashToTraits', () => { + // Add cart token hash to traits when cart token exists in event + it('should add cart_token_hash to message traits when cart token exists', () => { + const message = { traits: { existingTrait: 'value' } }; + const event = { cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ' }; + const expectedHash = '9125e1da-57b9-5bdc-953e-eb2b0ded5edc'; + + addCartTokenHashToTraits(message, event); + + expect(message.traits).toEqual({ + existingTrait: 'value', + cart_token_hash: expectedHash, + }); + }); + + // Do not add cart token hash to traits when cart token does not exist in event + it('should not add cart_token_hash to message traits when cart token does not exist', () => { + const message = { traits: { existingTrait: 'value' } }; + const event = { property: 'value' }; + addCartTokenHashToTraits(message, event); + + expect(message.traits).toEqual({ existingTrait: 'value' }); + }); + }); }); describe('Redis cart token tests', () => { @@ -170,4 +202,42 @@ describe('Redis cart token tests', () => { expect(getValSpy).toHaveBeenCalledWith('pixel:cartTokenTest1'); expect(message.anonymousId).toEqual('anonymousIdTest1'); }); + + it('should generate new anonymousId using UUID v5 when no existing ID is found', async () => { + const message = {}; + const event = { + note_attributes: [], + }; + const metricMetadata = { source: 'test', writeKey: 'test-key' }; + const cartToken = 'test-cart-token'; + const mockRedisData = null; + const expectedAnonymousId = '40a532a2-88be-5e3a-8687-56e34739e89d'; + jest.mock('uuid', () => ({ + v5: jest.fn(() => expectedAnonymousId), + DNS: 'dns-namespace', + })); + RedisDB.getVal = jest.spyOn(RedisDB, 'getVal').mockResolvedValue(mockRedisData); + await setAnonymousId(message, { ...event, cart_token: cartToken }, metricMetadata); + expect(message.anonymousId).toBe(expectedAnonymousId); + }); + + it('should handle undefined event parameter without error', async () => { + const message = {}; + + const metricMetadata = { + source: 'test-source', + writeKey: 'test-key', + }; + + await setAnonymousId(message, undefined, metricMetadata); + + expect(message.anonymousId).toBeUndefined(); + + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_id_stitch_gaps', { + event: message.event, + reason: 'cart_token_miss', + source: metricMetadata.source, + writeKey: metricMetadata.writeKey, + }); + }); }); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index 0d81de99ac3..e6da784b455 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ const get = require('get-value'); -const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); +const { isDefinedAndNotNull, uuidv5 } = require('@rudderstack/integrations-lib'); const { extractEmailFromPayload } = require('../../../../v0/sources/shopify/util'); const { constructPayload } = require('../../../../v0/util'); const { INTEGERATION, lineItemsMappingJSON, productMappingJSON } = require('../config'); @@ -65,6 +65,23 @@ const getAnonymousIdFromAttributes = (event) => { */ const getCartToken = (event) => event?.cart_token || null; +/** + * Adds the cartTokenHash to the traits object in the message + * @param {Object} message + * @param {String} event + * */ +const addCartTokenHashToTraits = (message, event) => { + const cartToken = getCartToken(event); + if (cartToken) { + const cartTokenHash = uuidv5(cartToken); + message.traits = { + ...message.traits, + cart_token_hash: cartTokenHash, + }; + } + return message; +}; + /** * Handles the anonymousId assignment for the message, based on the event attributes and redis data * @param {Object} message rudderstack message object @@ -73,22 +90,36 @@ const getCartToken = (event) => event?.cart_token || null; */ const setAnonymousId = async (message, event, metricMetadata) => { const anonymousId = getAnonymousIdFromAttributes(event); + const cartToken = getCartToken(event); + const cartTokenHash = cartToken ? uuidv5(cartToken) : null; if (isDefinedAndNotNull(anonymousId)) { message.anonymousId = anonymousId; - } else { - // if anonymousId is not present in note_attributes or note_attributes is not present, query redis for anonymousId - const cartToken = getCartToken(event); - if (cartToken) { - const redisData = await RedisDB.getVal(`pixel:${cartToken}`); - if (redisData?.anonymousId) { - message.anonymousId = redisData.anonymousId; - } + } + // if anonymousId is not present in note_attributes or note_attributes is not present, query redis for anonymousId + // when cart_token is present + else if (cartToken) { + const redisData = await RedisDB.getVal(`pixel:${cartToken}`); + if (redisData?.anonymousId) { + message.anonymousId = redisData.anonymousId; } else { - stats.increment('shopify_pixel_cart_token_not_found_server_side', { + // if anonymousId is not present in note_attributes or redis, generate a new anonymousId + // the anonymousId will be generated by hashing the cart_token using uuidv5 + // this hash will be present in the traits object as cart_token_hash + message.anonymousId = cartTokenHash; + stats.increment('shopify_pixel_id_stitch_gaps', { + event: message.event, + reason: 'redis_cache_miss', source: metricMetadata.source, writeKey: metricMetadata.writeKey, }); } + } else { + stats.increment('shopify_pixel_id_stitch_gaps', { + event: message.event, + reason: 'cart_token_miss', + source: metricMetadata.source, + writeKey: metricMetadata.writeKey, + }); } }; @@ -138,4 +169,5 @@ module.exports = { getAnonymousIdFromAttributes, setAnonymousId, handleCommonProperties, + addCartTokenHashToTraits, }; diff --git a/test/integrations/sources/shopify/mocks.ts b/test/integrations/sources/shopify/mocks.ts index e1895e78124..9a3fe2f989b 100644 --- a/test/integrations/sources/shopify/mocks.ts +++ b/test/integrations/sources/shopify/mocks.ts @@ -1,5 +1,7 @@ import utils from '../../../../src/v0/util'; +import { RedisDB } from '../../../../src/util/redis/redisConnector'; export const mockFns = (_) => { jest.spyOn(utils, 'generateUUID').mockReturnValue('5d3e2cb6-4011-5c9c-b7ee-11bc1e905097'); + jest.spyOn(RedisDB, 'getVal').mockResolvedValue({}); }; diff --git a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts index 4938294ef99..19e66f450a5 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts @@ -1,5 +1,6 @@ // This file contains the test scenarios for the server-side events from the Shopify GraphQL API for // the v1 transformation flow +import { mockFns } from '../mocks'; import { dummySourceConfig, note_attributes } from '../constants'; export const checkoutEventsTestScenarios = [ @@ -100,11 +101,6 @@ export const checkoutEventsTestScenarios = [ }, }, source: dummySourceConfig, - query_parameters: { - topic: ['carts_update'], - writeKey: ['2mw9SN679HngnXXXHT4oSVVBVmb'], - version: ['pixel'], - }, }, ], method: 'POST', @@ -240,6 +236,7 @@ export const checkoutEventsTestScenarios = [ timestamp: '2024-11-06T02:22:02.000Z', traits: { shippingAddress: [], + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', }, anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, @@ -576,6 +573,7 @@ export const checkoutEventsTestScenarios = [ province_code: 'AZ', zip: '85003', }, + cart_token_hash: '9e189f39-da46-58df-81b4-5e507d9ef64e', adminGraphqlApiId: 'gid://shopify/Customer/7188389789809', currency: 'USD', email: 'testuser101@gmail.com', @@ -1258,6 +1256,7 @@ export const checkoutEventsTestScenarios = [ country_name: 'United States', default: true, }, + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', state: 'disabled', verifiedEmail: true, taxExempt: false, @@ -1654,6 +1653,7 @@ export const checkoutEventsTestScenarios = [ country_name: 'United States', default: true, }, + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', state: 'disabled', currency: 'USD', taxExemptions: [], @@ -1838,4 +1838,248 @@ export const checkoutEventsTestScenarios = [ }, }, }, -]; + { + id: 'c001', + name: 'shopify', + description: + 'Track Call -> Checkout Started event from Pixel app, with no anonymoudId in redis. anonymousId is set as hash of cart_token (race condition scenario)', + module: 'source', + version: 'v1', + input: { + request: { + body: [ + { + event: { + id: 35550298931313, + token: '84ad78572dae52a8cbea7d55371afe89', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + email: null, + gateway: null, + buyer_accepts_marketing: false, + buyer_accepts_sms_marketing: false, + sms_marketing_phone: null, + created_at: '2024-11-06T02:22:00+00:00', + updated_at: '2024-11-05T21:22:02-05:00', + landing_site: '/', + note: '', + note_attributes: [], + referring_site: '', + shipping_lines: [], + shipping_address: [], + taxes_included: false, + total_weight: 0, + currency: 'USD', + completed_at: null, + phone: null, + customer_locale: 'en-US', + line_items: [ + { + key: '41327142600817', + fulfillment_service: 'manual', + gift_card: false, + grams: 0, + presentment_title: 'The Collection Snowboard: Hydrogen', + presentment_variant_title: '', + product_id: 7234590408817, + quantity: 1, + requires_shipping: true, + sku: '', + tax_lines: [], + taxable: true, + title: 'The Collection Snowboard: Hydrogen', + variant_id: 41327142600817, + variant_title: '', + variant_price: '600.00', + vendor: 'Hydrogen Vendor', + unit_price_measurement: { + measured_type: null, + quantity_value: null, + quantity_unit: null, + reference_value: null, + reference_unit: null, + }, + compare_at_price: null, + line_price: '600.00', + price: '600.00', + applied_discounts: [], + destination_location_id: null, + user_id: null, + rank: null, + origin_location_id: null, + properties: {}, + }, + ], + name: '#35550298931313', + abandoned_checkout_url: + 'https://pixel-testing-rs.myshopify.com/59026964593/checkouts/ac/Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ/recover?key=0385163be3875d3a2117e982d9cc3517&locale=en-US', + discount_codes: [], + tax_lines: [], + presentment_currency: 'USD', + source_name: 'web', + total_line_items_price: '600.00', + total_tax: '0.00', + total_discounts: '0.00', + subtotal_price: '600.00', + total_price: '600.00', + total_duties: '0.00', + device_id: null, + user_id: null, + location_id: null, + source_identifier: null, + source_url: null, + source: null, + closed_at: null, + query_parameters: { + topic: ['checkouts_create'], + version: ['pixel'], + writeKey: ['2mw9SN679HngnXXXHT4oSVVBVmb'], + }, + }, + source: dummySourceConfig, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + library: { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }, + integration: { + name: 'SHOPIFY', + }, + topic: 'checkouts_create', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + shopifyDetails: { + id: 35550298931313, + token: '84ad78572dae52a8cbea7d55371afe89', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + email: null, + gateway: null, + buyer_accepts_marketing: false, + buyer_accepts_sms_marketing: false, + sms_marketing_phone: null, + created_at: '2024-11-06T02:22:00+00:00', + updated_at: '2024-11-05T21:22:02-05:00', + landing_site: '/', + note: '', + note_attributes: [], + referring_site: '', + shipping_lines: [], + shipping_address: [], + taxes_included: false, + total_weight: 0, + currency: 'USD', + completed_at: null, + phone: null, + customer_locale: 'en-US', + line_items: [ + { + key: '41327142600817', + fulfillment_service: 'manual', + gift_card: false, + grams: 0, + presentment_title: 'The Collection Snowboard: Hydrogen', + presentment_variant_title: '', + product_id: 7234590408817, + quantity: 1, + requires_shipping: true, + sku: '', + tax_lines: [], + taxable: true, + title: 'The Collection Snowboard: Hydrogen', + variant_id: 41327142600817, + variant_title: '', + variant_price: '600.00', + vendor: 'Hydrogen Vendor', + unit_price_measurement: { + measured_type: null, + quantity_value: null, + quantity_unit: null, + reference_value: null, + reference_unit: null, + }, + compare_at_price: null, + line_price: '600.00', + price: '600.00', + applied_discounts: [], + destination_location_id: null, + user_id: null, + rank: null, + origin_location_id: null, + properties: {}, + }, + ], + name: '#35550298931313', + abandoned_checkout_url: + 'https://pixel-testing-rs.myshopify.com/59026964593/checkouts/ac/Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ/recover?key=0385163be3875d3a2117e982d9cc3517&locale=en-US', + discount_codes: [], + tax_lines: [], + presentment_currency: 'USD', + source_name: 'web', + total_line_items_price: '600.00', + total_tax: '0.00', + total_discounts: '0.00', + subtotal_price: '600.00', + total_price: '600.00', + total_duties: '0.00', + device_id: null, + user_id: null, + location_id: null, + source_identifier: null, + source_url: null, + source: null, + closed_at: null, + }, + }, + integrations: { + SHOPIFY: true, + DATA_WAREHOUSE: { + options: { + jsonPaths: ['track.context.shopifyDetails'], + }, + }, + }, + type: 'track', + event: 'Checkout Started Webhook', + properties: { + order_id: '35550298931313', + value: 600, + tax: 0, + currency: 'USD', + products: [ + { + product_id: '7234590408817', + price: 600.0, + brand: 'Hydrogen Vendor', + quantity: 1, + }, + ], + }, + timestamp: '2024-11-06T02:22:02.000Z', + traits: { + shippingAddress: [], + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', + }, + anonymousId: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', + }, + ], + }, + }, + ], + }, + }, + }, +].map((d1) => ({ ...d1, mockFns })); diff --git a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts index 422fe0135a2..8385122b222 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts @@ -556,6 +556,7 @@ export const genericTrackTestScenarios = [ }, traits: { email: 'henry@wfls.com', + cart_token_hash: '9125e1da-57b9-5bdc-953e-eb2b0ded5edc', }, anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, From bfad78df9b1635a8054478ee5603a6783178a389 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:52:20 +0530 Subject: [PATCH 078/160] chore: address sonar qube issues (#4059) * chore: address sonar qube issues * refactor: snapchat utils * refactor: snapchat utils and add tests --------- Co-authored-by: Dilip Kola --- src/util/eventValidation.js | 4 +- src/v0/destinations/hs/transform.js | 2 +- .../destinations/snapchat_conversion/util.js | 26 +- .../snapchat_conversion/util.test.js | 353 ++++++++++++++++++ 4 files changed, 364 insertions(+), 21 deletions(-) create mode 100644 src/v0/destinations/snapchat_conversion/util.test.js diff --git a/src/util/eventValidation.js b/src/util/eventValidation.js index 46a494ee5ce..a009bc8f5cd 100644 --- a/src/util/eventValidation.js +++ b/src/util/eventValidation.js @@ -133,7 +133,7 @@ async function validate(event) { // UnPlanned event case - since no event schema is found. Violation is raised // Return this violation error only in case of track calls. - if (!eventSchema || eventSchema === {}) { + if (!eventSchema || Object.keys(eventSchema).length === 0) { if (event.message.type !== 'track') { return []; } @@ -173,7 +173,7 @@ async function validate(event) { let ajv = isDraft4 ? ajv4 : ajv19; const ajvCache = isDraft4 ? ajv4Cache : ajv19Cache; - if (merged !== {}) { + if (Object.keys(merged).length > 0) { const configHash = hash(merged); ajv = ajvCache.get(configHash); if (!ajv) { diff --git a/src/v0/destinations/hs/transform.js b/src/v0/destinations/hs/transform.js index b6ca213f031..68747bae6d8 100644 --- a/src/v0/destinations/hs/transform.js +++ b/src/v0/destinations/hs/transform.js @@ -86,7 +86,7 @@ const processBatchRouter = async (inputs, reqMetadata) => { try { if (mappedToDestination && GENERIC_TRUE_VALUES.includes(mappedToDestination?.toString())) { // skip splitting the batches to inserts and updates if object it is an association - if (objectType.toLowerCase() !== 'association') { + if (objectType?.toLowerCase() !== 'association') { propertyMap = await getProperties(destination, metadata); // get info about existing objects and splitting accordingly. tempInputs = await splitEventsForCreateUpdate(tempInputs, destination, metadata); diff --git a/src/v0/destinations/snapchat_conversion/util.js b/src/v0/destinations/snapchat_conversion/util.js index ee0329995c1..2a9b50e00b0 100644 --- a/src/v0/destinations/snapchat_conversion/util.js +++ b/src/v0/destinations/snapchat_conversion/util.js @@ -34,24 +34,14 @@ function getHashedValue(identifier) { } function getNormalizedPhoneNumber(message) { - const regexExp = /^[\da-f]{64}$/gi; - let phoneNumber = getFieldValueFromMessage(message, 'phone'); - if (regexExp.test(phoneNumber)) { - return phoneNumber; - } - let leadingZero = true; - if (phoneNumber) { - for (let i = 0; i < phoneNumber.length; i += 1) { - if (Number.isNaN(parseInt(phoneNumber[i], 10)) || (phoneNumber[i] === '0' && leadingZero)) { - phoneNumber = phoneNumber.replace(phoneNumber[i], ''); - i -= 1; - } else { - leadingZero = false; - } - } - return phoneNumber; - } - return null; + const regexExp = /^[\da-f]{64}$/i; + const phoneNumber = getFieldValueFromMessage(message, 'phone'); + + if (!phoneNumber) return null; + if (regexExp.test(phoneNumber)) return phoneNumber; + + // Remove leading zeros and non-numeric characters + return phoneNumber.replace(/\D/g, '').replace(/^0+/, '') || null; } function getDataUseValue(message) { diff --git a/src/v0/destinations/snapchat_conversion/util.test.js b/src/v0/destinations/snapchat_conversion/util.test.js new file mode 100644 index 00000000000..835b56351bb --- /dev/null +++ b/src/v0/destinations/snapchat_conversion/util.test.js @@ -0,0 +1,353 @@ +const { + msUnixTimestamp, + getItemIds, + getPriceSum, + getDataUseValue, + getNormalizedPhoneNumber, + getHashedValue, + channelMapping, + generateBatchedPayloadForArray, +} = require('./util'); + +describe('Snapchat Conversion Utils', () => { + describe('getNormalizedPhoneNumber', () => { + const testCases = [ + { + name: 'should remove non-numeric characters and leading zeros from phone number', + input: { traits: { phone: '+1 (234) 567-8900' } }, + expected: '12345678900', + }, + { + name: 'should remove leading zeros from phone number when present', + input: { traits: { phone: '00123456789' } }, + expected: '123456789', + }, + { + name: 'should remove non-numeric characters and leading zeros from mixed alphanumeric input', + input: { traits: { phone: 'abc0123def0456' } }, + expected: '1230456', + }, + { + name: 'should return null when phone number is not present', + input: { traits: {} }, + expected: null, + }, + { + name: 'should return null when message is empty', + input: {}, + expected: null, + }, + { + name: 'should return the original hash when phone is already a 64-char hex', + input: { traits: { phone: 'a'.repeat(64) } }, + expected: 'a'.repeat(64), + }, + { + name: 'should return null when phone normalizes to empty string', + input: { traits: { phone: '000' } }, + expected: null, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = getNormalizedPhoneNumber(input); + expect(result).toBe(expected); + }); + }); + }); +}); + +describe('msUnixTimestamp', () => { + const testCases = [ + { + name: 'should convert timestamp to milliseconds unix timestamp', + input: new Date('2024-01-01T00:00:00Z'), + expected: + new Date('2024-01-01T00:00:00Z').getTime() * 1000 + + new Date('2024-01-01T00:00:00Z').getMilliseconds(), + }, + { + name: 'should handle different timezone', + input: new Date('2024-01-01T12:30:45+05:30'), + expected: + new Date('2024-01-01T12:30:45+05:30').getTime() * 1000 + + new Date('2024-01-01T12:30:45+05:30').getMilliseconds(), + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(msUnixTimestamp(input)).toBe(expected); + }); + }); +}); + +describe('getHashedValue', () => { + const testCases = [ + { + name: 'should return null for null input', + input: null, + expected: null, + }, + { + name: 'should return null for undefined input', + input: undefined, + expected: null, + }, + { + name: 'should return null for empty string', + input: '', + expected: null, + }, + { + name: 'should return original value if already a 64-char hex', + input: 'a'.repeat(64), + expected: 'a'.repeat(64), + }, + { + name: 'should hash non-hex64 values', + input: 'test', + expectedLength: 64, + expectedPattern: /^[a-f0-9]{64}$/i, + }, + ]; + + testCases.forEach(({ name, input, expected, expectedLength, expectedPattern }) => { + it(name, () => { + const result = getHashedValue(input); + if (expected !== undefined) { + expect(result).toBe(expected); + } + if (expectedLength) { + expect(result).toHaveLength(expectedLength); + } + if (expectedPattern) { + expect(result).toMatch(expectedPattern); + } + }); + }); +}); + +describe('getItemIds', () => { + const testCases = [ + { + name: 'should return null when products is not an array', + input: { properties: {} }, + expected: null, + }, + { + name: 'should return array of product_ids', + input: { + properties: { + products: [{ product_id: '123' }, { product_id: '456' }], + }, + }, + expected: ['123', '456'], + }, + { + name: 'should skip products without product_id', + input: { + properties: { + products: [{ product_id: '123' }, { name: 'test' }, { product_id: '456' }], + }, + }, + expected: ['123', '456'], + }, + { + name: 'should return null when products is null', + input: { properties: { products: null } }, + expected: null, + }, + { + name: 'should handle empty products array', + input: { properties: { products: [] } }, + expected: [], + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(getItemIds(input)).toEqual(expected); + }); + }); +}); + +describe('getPriceSum', () => { + const testCases = [ + { + name: 'should return null when products is not an array', + input: { properties: {} }, + expected: 'null', + }, + { + name: 'should sum prices * quantities', + input: { + properties: { + products: [ + { price: '10.5', quantity: 2 }, + { price: '20.0', quantity: 1 }, + ], + }, + }, + expected: '41', + }, + { + name: 'should use quantity=1 when not specified', + input: { + properties: { + products: [{ price: '10.5' }, { price: '20.0' }], + }, + }, + expected: '30.5', + }, + { + name: 'should skip invalid prices or quantities', + input: { + properties: { + products: [ + { price: 'invalid', quantity: 2 }, + { price: '20.0', quantity: 'invalid' }, + { price: '10.0', quantity: 2 }, + ], + }, + }, + expected: '20', + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(getPriceSum(input)).toBe(expected); + }); + }); +}); + +describe('getDataUseValue', () => { + const testCases = [ + { + name: 'should return null when att is not defined', + input: {}, + expected: null, + }, + { + name: 'should return ["lmu"] when att is 2', + input: { + context: { + device: { + attTrackingStatus: 2, + }, + }, + }, + expected: "['lmu']", + }, + { + name: 'should return null when att is 3', + input: { + context: { + device: { + attTrackingStatus: 3, + }, + }, + }, + expected: null, + }, + { + name: 'should return null for other att values', + input: { + context: { + device: { + attTrackingStatus: 1, + }, + }, + }, + expected: null, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(getDataUseValue(input)).toBe(expected); + }); + }); +}); + +describe('generateBatchedPayloadForArray', () => { + const testCases = [ + { + name: 'should generate batched payload with correct structure', + input: { + events: [{ body: { JSON: { event: 1 } } }, { body: { JSON: { event: 2 } } }], + destination: { + Config: { + apiKey: 'test-api-key', + }, + }, + }, + expected: { + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer test-api-key', + }, + endpoint: 'https://tr.snapchat.com/v2/conversion', + body: { + JSON_ARRAY: { + batch: JSON.stringify([{ event: 1 }, { event: 2 }]), + }, + }, + }, + }, + { + name: 'should handle empty events array', + input: { + events: [], + destination: { + Config: { + apiKey: 'test-api-key', + }, + }, + }, + expected: { + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer test-api-key', + }, + endpoint: 'https://tr.snapchat.com/v2/conversion', + body: { + JSON_ARRAY: { + batch: '[]', + }, + }, + }, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = generateBatchedPayloadForArray(input.events, input.destination); + expect(result.headers).toEqual(expected.headers); + expect(result.endpoint).toEqual(expected.endpoint); + expect(result.body.JSON_ARRAY).toEqual(expected.body.JSON_ARRAY); + }); + }); +}); + +describe('channelMapping', () => { + const testCases = [ + { + name: 'should have correct mapping values', + expected: { + web: 'WEB', + mobile: 'MOBILE_APP', + mobile_app: 'MOBILE_APP', + offline: 'OFFLINE', + }, + }, + ]; + + testCases.forEach(({ name, expected }) => { + it(name, () => { + expect(channelMapping).toEqual(expected); + }); + }); +}); From 05553eb5cbf3aa0afd752dca9af74e32722876ed Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Thu, 13 Feb 2025 21:18:49 +0530 Subject: [PATCH 079/160] feat(http): add support for isDefaultMapping (#4073) --- .../v2/destinations/http/procWorkflow.yaml | 3 +- test/integrations/destinations/http/common.ts | 23 +++++++++ .../http/processor/configuration.ts | 50 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/src/cdk/v2/destinations/http/procWorkflow.yaml b/src/cdk/v2/destinations/http/procWorkflow.yaml index 1db0fce1d72..1371eded905 100644 --- a/src/cdk/v2/destinations/http/procWorkflow.yaml +++ b/src/cdk/v2/destinations/http/procWorkflow.yaml @@ -55,7 +55,8 @@ steps: - name: prepareBody template: | - const payload = $.getCustomMappings(.message, .destination.Config.propertiesMapping); + const propertiesMapping = .destination.Config.isDefaultMapping ? [{"to": "$", "from": "$"}] : .destination.Config.propertiesMapping; + const payload = $.getCustomMappings(.message, propertiesMapping); $.context.payload = $.prepareBody(payload, $.context.format, .destination.Config.xmlRootKey); - name: buildResponseForProcessTransformation diff --git a/test/integrations/destinations/http/common.ts b/test/integrations/destinations/http/common.ts index 6c2887859f3..7f9cc61048f 100644 --- a/test/integrations/destinations/http/common.ts +++ b/test/integrations/destinations/http/common.ts @@ -623,6 +623,29 @@ const destinations: Destination[] = [ Transformations: [], WorkspaceID: 'test-workspace-id', }, + { + Config: { + apiUrl: 'http://abc.com/contacts', + auth: 'noAuth', + method: 'POST', + format: 'JSON', + isBatchingEnabled: true, + maxBatchSize: '2', + isDefaultMapping: true, + propertiesMapping: [], + }, + DestinationDefinition: { + DisplayName: displayName, + ID: '123', + Name: destTypeInUpperCase, + Config: { cdkV2Enabled: true }, + }, + Enabled: true, + ID: '123', + Name: destTypeInUpperCase, + Transformations: [], + WorkspaceID: 'test-workspace-id', + }, ]; const traits = { diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index 51a28fc2abf..62676ba63de 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -530,4 +530,54 @@ export const configuration: ProcessorTestData[] = [ }, }, }, + { + id: 'http-configuration-test-11', + name: destType, + description: 'Identify call with default properties mapping', + scenario: 'Business', + successCriteria: 'Response should be in json format with default properties mapping', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: destinations[14], + message: { + type: 'identify', + userId: 'userId123', + anonymousId: 'anonId123', + }, + metadata: generateMetadata(1), + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: transformResultBuilder({ + method: 'POST', + userId: '', + endpoint: destinations[14].Config.apiUrl, + headers: { + 'Content-Type': 'application/json', + }, + JSON: { + type: 'identify', + userId: 'userId123', + anonymousId: 'anonId123', + }, + }), + statusCode: 200, + metadata: generateMetadata(1), + }, + ], + }, + }, + }, ]; From a27e61b512568b58a599b6585c35cc842c96eb7d Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Fri, 14 Feb 2025 12:26:38 +0530 Subject: [PATCH 080/160] refactor: zoho record processing (#4054) * refactor: zoho to not asssume same action in all events of a batch * refactor: zoho to not asssume same action in all events of a batch * refactor: zoho to not asssume same action in all events of a batch * refactor: remove unused import in zoho tests * refactor: remove unused import in zoho tests * refactor: add missing tests * refactor: zoho utils using cursor * refactor: zoho utils using cursor * chore: add more tests for zoho utils * chore: add more tests for zoho utils * refactor: update zoho search record id function * refactor: update zoho format multi select fields function * refactor: add more util tests for zoho * refactor: use function to express condition * chore: add more test for zoho * chore: add more test for zoho --- src/cdk/v2/destinations/zoho/config.js | 4 +- .../v2/destinations/zoho/transformRecord.js | 17 +- src/cdk/v2/destinations/zoho/utils.js | 165 ++-- src/cdk/v2/destinations/zoho/utils.test.js | 783 +++++++++++++----- src/util/common.js | 4 + src/util/common.test.js | 151 ++++ 6 files changed, 815 insertions(+), 309 deletions(-) create mode 100644 src/util/common.test.js diff --git a/src/cdk/v2/destinations/zoho/config.js b/src/cdk/v2/destinations/zoho/config.js index d942d9e369d..0eea0c096fd 100644 --- a/src/cdk/v2/destinations/zoho/config.js +++ b/src/cdk/v2/destinations/zoho/config.js @@ -10,8 +10,8 @@ const DATA_CENTRE_BASE_ENDPOINTS_MAP = { }; const getBaseEndpoint = (dataServer) => DATA_CENTRE_BASE_ENDPOINTS_MAP[dataServer]; -const COMMON_RECORD_ENDPOINT = (dataCenter = 'US') => - `${getBaseEndpoint(dataCenter)}/crm/v6/moduleType`; +const COMMON_RECORD_ENDPOINT = (dataCenter) => + `${getBaseEndpoint(dataCenter || 'US')}/crm/v6/moduleType`; // ref: https://www.zoho.com/crm/developer/docs/api/v6/insert-records.html#:~:text=%2DX%20POST-,System%2Ddefined%20mandatory%20fields%20for%20each%20module,-While%20inserting%20records const MODULE_MANDATORY_FIELD_CONFIG = { diff --git a/src/cdk/v2/destinations/zoho/transformRecord.js b/src/cdk/v2/destinations/zoho/transformRecord.js index 8f4586e46b4..20f97cf7ab6 100644 --- a/src/cdk/v2/destinations/zoho/transformRecord.js +++ b/src/cdk/v2/destinations/zoho/transformRecord.js @@ -33,7 +33,7 @@ const responseBuilder = ( identifierType, operationModuleType, commonEndPoint, - action, + isUpsert, metadata, ) => { const { trigger, addDefaultDuplicateCheck, multiSelectFieldLevelDecision } = config; @@ -43,7 +43,7 @@ const responseBuilder = ( Authorization: `Zoho-oauthtoken ${metadata[0].secret.accessToken}`, }; - if (action === 'insert' || action === 'update') { + if (isUpsert) { const payload = { duplicate_check_fields: handleDuplicateCheck( addDefaultDuplicateCheck, @@ -70,7 +70,6 @@ const batchResponseBuilder = ( identifierType, operationModuleType, upsertEndPoint, - action, ) => { const upsertResponseArray = []; const deletionResponseArray = []; @@ -101,7 +100,7 @@ const batchResponseBuilder = ( identifierType, operationModuleType, upsertEndPoint, - action, + true, upsertmetadataChunks.items[0], ), ); @@ -115,7 +114,7 @@ const batchResponseBuilder = ( identifierType, operationModuleType, upsertEndPoint, - action, + false, deletionmetadataChunks.items[0], ), ); @@ -226,13 +225,12 @@ const handleDeletion = async ( */ const processInput = async ( input, - action, operationModuleType, Config, transformedResponseToBeBatched, errorResponseList, ) => { - const { fields } = input.message; + const { fields, action } = input.message; if (isEmptyObject(fields)) { const emptyFieldsError = new InstrumentationError('`fields` cannot be empty'); @@ -285,7 +283,6 @@ const processRecordInputs = async (inputs, destination) => { const response = []; const errorResponseList = []; const { Config } = destination; - const { action } = inputs[0].message; const transformedResponseToBeBatched = { upsertData: [], @@ -296,13 +293,12 @@ const processRecordInputs = async (inputs, destination) => { const { operationModuleType, identifierType, upsertEndPoint } = deduceModuleInfo(inputs, Config); - validateConfigurationIssue(Config, operationModuleType, action); + validateConfigurationIssue(Config, operationModuleType); await Promise.all( inputs.map((input) => processInput( input, - action, operationModuleType, Config, transformedResponseToBeBatched, @@ -322,7 +318,6 @@ const processRecordInputs = async (inputs, destination) => { identifierType, operationModuleType, upsertEndPoint, - action, ); if (upsertResponseArray.length === 0 && deletionResponseArray.length === 0) { diff --git a/src/cdk/v2/destinations/zoho/utils.js b/src/cdk/v2/destinations/zoho/utils.js index 4f5c4e86206..d86ea05e334 100644 --- a/src/cdk/v2/destinations/zoho/utils.js +++ b/src/cdk/v2/destinations/zoho/utils.js @@ -1,48 +1,54 @@ const { - MappedToDestinationKey, getHashFromArray, isDefinedAndNotNull, ConfigurationError, isDefinedAndNotNullAndNotEmpty, } = require('@rudderstack/integrations-lib'); -const get = require('get-value'); const { getDestinationExternalIDInfoForRetl, isHttpStatusSuccess } = require('../../../../v0/util'); const zohoConfig = require('./config'); const { handleHttpRequest } = require('../../../../adapters/network'); +const { CommonUtils } = require('../../../../util/common'); const deduceModuleInfo = (inputs, Config) => { - const singleRecordInput = inputs[0].message; - const operationModuleInfo = {}; - const mappedToDestination = get(singleRecordInput, MappedToDestinationKey); - if (mappedToDestination) { - const { objectType, identifierType } = getDestinationExternalIDInfoForRetl( - singleRecordInput, - 'ZOHO', - ); - operationModuleInfo.operationModuleType = objectType; - operationModuleInfo.upsertEndPoint = zohoConfig - .COMMON_RECORD_ENDPOINT(Config.region) - .replace('moduleType', objectType); - operationModuleInfo.identifierType = identifierType; + if (!Array.isArray(inputs) || inputs.length === 0) { + return {}; + } + + const firstRecord = inputs[0].message; + const mappedToDestination = firstRecord?.context?.mappedToDestination; + + if (!mappedToDestination) { + return {}; } - return operationModuleInfo; + + const { objectType, identifierType } = getDestinationExternalIDInfoForRetl(firstRecord, 'ZOHO'); + return { + operationModuleType: objectType, + upsertEndPoint: zohoConfig + .COMMON_RECORD_ENDPOINT(Config.region) + .replace('moduleType', objectType), + identifierType, + }; }; -// eslint-disable-next-line consistent-return +// Keeping the original function name and return structure function validatePresenceOfMandatoryProperties(objectName, object) { - if (zohoConfig.MODULE_MANDATORY_FIELD_CONFIG.hasOwnProperty(objectName)) { - const requiredFields = zohoConfig.MODULE_MANDATORY_FIELD_CONFIG[objectName]; - const missingFields = - requiredFields.filter( - (field) => !object.hasOwnProperty(field) || !isDefinedAndNotNullAndNotEmpty(object[field]), - ) || []; - return { status: missingFields.length > 0, missingField: missingFields }; + if (!zohoConfig.MODULE_MANDATORY_FIELD_CONFIG.hasOwnProperty(objectName)) { + return undefined; // Maintaining original undefined return for custom objects } - // No mandatory check performed for custom objects + + const requiredFields = zohoConfig.MODULE_MANDATORY_FIELD_CONFIG[objectName]; + const missingFields = requiredFields.filter( + (field) => !object.hasOwnProperty(field) || !isDefinedAndNotNullAndNotEmpty(object[field]), + ); + + return { + status: missingFields.length > 0, + missingField: missingFields, + }; } const formatMultiSelectFields = (config, fields) => { - // Convert multiSelectFieldLevelDecision array into a hash map for quick lookups const multiSelectFields = getHashFromArray( config.multiSelectFieldLevelDecision, 'from', @@ -50,32 +56,33 @@ const formatMultiSelectFields = (config, fields) => { false, ); - Object.keys(fields).forEach((eachFieldKey) => { - if (multiSelectFields.hasOwnProperty(eachFieldKey)) { - // eslint-disable-next-line no-param-reassign - fields[eachFieldKey] = [fields[eachFieldKey]]; + // Creating a shallow copy to avoid mutations + const formattedFields = { ...fields }; + + Object.keys(formattedFields).forEach((eachFieldKey) => { + if ( + multiSelectFields.hasOwnProperty(eachFieldKey) && + isDefinedAndNotNull(formattedFields[eachFieldKey]) + ) { + formattedFields[eachFieldKey] = [formattedFields[eachFieldKey]]; } }); - return fields; + + return formattedFields; }; -// Utility to handle duplicate check const handleDuplicateCheck = (addDefaultDuplicateCheck, identifierType, operationModuleType) => { - let duplicateCheckFields = [identifierType]; + let additionalFields = []; if (addDefaultDuplicateCheck) { const moduleDuplicateCheckField = zohoConfig.MODULE_WISE_DUPLICATE_CHECK_FIELD[operationModuleType]; - - if (isDefinedAndNotNull(moduleDuplicateCheckField)) { - duplicateCheckFields = [...moduleDuplicateCheckField]; - duplicateCheckFields.unshift(identifierType); - } else { - duplicateCheckFields.push('Name'); // user chosen duplicate field always carries higher priority - } + additionalFields = isDefinedAndNotNull(moduleDuplicateCheckField) + ? moduleDuplicateCheckField + : ['Name']; } - return [...new Set(duplicateCheckFields)]; + return Array.from(new Set([identifierType, ...additionalFields])); }; function escapeAndEncode(value) { @@ -93,42 +100,53 @@ function transformToURLParams(fields, Config) { return `${regionBasedEndPoint}/crm/v6/Leads/search?criteria=${criteria}`; } -// ref : https://www.zoho.com/crm/developer/docs/api/v6/search-records.html const searchRecordId = async (fields, metadata, Config) => { - const searchURL = transformToURLParams(fields, Config); - const searchResult = await handleHttpRequest( - 'get', - searchURL, - { - headers: { - Authorization: `Zoho-oauthtoken ${metadata.secret.accessToken}`, + try { + const searchURL = transformToURLParams(fields, Config); + const searchResult = await handleHttpRequest( + 'get', + searchURL, + { + headers: { + Authorization: `Zoho-oauthtoken ${metadata.secret.accessToken}`, + }, }, - }, - { - destType: 'zoho', - feature: 'deleteRecords', - requestMethod: 'GET', - endpointPath: 'crm/v6/Leads/search?criteria=', - module: 'router', - }, - ); - if (!isHttpStatusSuccess(searchResult.processedResponse.status)) { + { + destType: 'zoho', + feature: 'deleteRecords', + requestMethod: 'GET', + endpointPath: 'crm/v6/Leads/search?criteria=', + module: 'router', + }, + ); + + if (!isHttpStatusSuccess(searchResult.processedResponse.status)) { + return { + erroneous: true, + message: searchResult.processedResponse.response, + }; + } + + if ( + searchResult.processedResponse.status === 204 || + !CommonUtils.isNonEmptyArray(searchResult.processedResponse.response?.data) + ) { + return { + erroneous: true, + message: 'No contact is found with record details', + }; + } + return { - erroneous: true, - message: searchResult.processedResponse.response, + erroneous: false, + message: searchResult.processedResponse.response.data.map((record) => record.id), }; - } - if (searchResult.processedResponse.status === 204) { + } catch (error) { return { erroneous: true, - message: 'No contact is found with record details', + message: error.message, }; } - const recordIds = searchResult.processedResponse.response.data.map((record) => record.id); - return { - erroneous: false, - message: recordIds, - }; }; // ref : https://www.zoho.com/crm/developer/docs/api/v6/upsert-records.html#:~:text=The%20trigger%20input%20can%20be%20workflow%2C%20approval%2C%20or%20blueprint.%20If%20the%20trigger%20is%20not%20mentioned%2C%20the%20workflows%2C%20approvals%20and%20blueprints%20related%20to%20the%20API%20will%20get%20executed.%20Enter%20the%20trigger%20value%20as%20%5B%5D%20to%20not%20execute%20the%20workflows. @@ -142,18 +160,15 @@ const calculateTrigger = (trigger) => { return [trigger]; }; -const validateConfigurationIssue = (Config, operationModuleType, action) => { +const validateConfigurationIssue = (Config, operationModuleType) => { const hashMapMultiselect = getHashFromArray( Config.multiSelectFieldLevelDecision, 'from', 'to', false, ); - if ( - Object.keys(hashMapMultiselect).length > 0 && - Config.module !== operationModuleType && - action !== 'delete' - ) { + + if (Object.keys(hashMapMultiselect).length > 0 && Config.module !== operationModuleType) { throw new ConfigurationError( 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', ); diff --git a/src/cdk/v2/destinations/zoho/utils.test.js b/src/cdk/v2/destinations/zoho/utils.test.js index 5a11794ef57..e959f6b6c3b 100644 --- a/src/cdk/v2/destinations/zoho/utils.test.js +++ b/src/cdk/v2/destinations/zoho/utils.test.js @@ -1,263 +1,604 @@ +jest.mock('../../../../adapters/network'); +const { ConfigurationError } = require('@rudderstack/integrations-lib'); +const { handleHttpRequest } = require('../../../../adapters/network'); const { handleDuplicateCheck, deduceModuleInfo, validatePresenceOfMandatoryProperties, - formatMultiSelectFields, validateConfigurationIssue, + formatMultiSelectFields, + transformToURLParams, + calculateTrigger, + searchRecordId, } = require('./utils'); -const { ConfigurationError } = require('@rudderstack/integrations-lib'); - describe('handleDuplicateCheck', () => { - // Returns identifierType when addDefaultDuplicateCheck is false - it('should return identifierType when addDefaultDuplicateCheck is false', () => { - const identifierType = 'email'; - const addDefaultDuplicateCheck = false; - const operationModuleType = 'Leads'; - const moduleWiseDuplicateCheckField = {}; - - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - moduleWiseDuplicateCheckField, - ); - - expect(result).toEqual([identifierType]); + const testCases = [ + { + name: 'should return identifierType when addDefaultDuplicateCheck is false', + input: { + identifierType: 'email', + addDefaultDuplicateCheck: false, + operationModuleType: 'Leads', + moduleWiseDuplicateCheckField: {}, + }, + expected: ['email'], + }, + { + name: 'handles valid operationModuleType and already included identifierType', + input: { + identifierType: 'Email', + addDefaultDuplicateCheck: true, + operationModuleType: 'Leads', + }, + expected: ['Email'], + }, + { + name: "should return identifierType and 'Name' when addDefaultDuplicateCheck is true and moduleDuplicateCheckField is not defined", + input: { + identifierType: 'id', + addDefaultDuplicateCheck: true, + operationModuleType: 'type3', + }, + expected: ['id', 'Name'], + }, + { + name: 'should handle null values in moduleWiseDuplicateCheckField', + input: { + identifierType: 'Identifier', + addDefaultDuplicateCheck: true, + operationModuleType: 'type1', + }, + expected: ['Identifier', 'Name'], + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = handleDuplicateCheck( + input.addDefaultDuplicateCheck, + input.identifierType, + input.operationModuleType, + input.moduleWiseDuplicateCheckField, + ); + expect(result).toEqual(expected); + }); }); +}); - it('Handles valid operationModuleType and already included identifierType', () => { - const identifierType = 'Email'; - const addDefaultDuplicateCheck = true; - const operationModuleType = 'Leads'; - - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - ); - - expect(result).toEqual(['Email']); +describe('formatMultiSelectFields', () => { + const testCases = [ + { + name: 'should convert a field value to an array if a mapping exists in multiSelectFieldLevelDecision', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'tagsArray' }], + }, + fields: { tags: 'value' }, + }, + expected: { tags: ['value'] }, + }, + { + name: 'should leave fields unchanged if mapping fields exists but null', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'tagsArray' }], + }, + fields: { tags: null, other: 'val' }, + }, + expected: { tags: null, other: 'val' }, + }, + { + name: 'should leave fields unchanged if no mapping exists', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'categories', to: 'catArray' }], + }, + fields: { tags: 'value', other: 'val' }, + }, + expected: { tags: 'value', other: 'val' }, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = formatMultiSelectFields(input.config, { ...input.fields }); + expect(result).toEqual(expected); + }); }); +}); - // Returns identifierType and 'Name' when addDefaultDuplicateCheck is true and moduleDuplicateCheckField is not defined - it("should return identifierType and 'Name' when addDefaultDuplicateCheck is true and moduleDuplicateCheckField is not defined", () => { - const identifierType = 'id'; - const operationModuleType = 'type3'; - const addDefaultDuplicateCheck = true; - - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - ); - - expect(result).toEqual(['id', 'Name']); +describe('transformToURLParams', () => { + const testCases = [ + { + name: 'should build a proper URL with encoded criteria based on fields and config', + input: { + fields: { First_Name: 'John, Doe', Age: '30' }, + config: { region: 'US' }, + }, + expected: `https://www.zohoapis.com/crm/v6/Leads/search?criteria=(First_Name:equals:John%5C%2C%20Doe)and(Age:equals:30)`, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const url = transformToURLParams(input.fields, input.config); + expect(url).toEqual(expected); + }); }); +}); - // Handles null values in moduleWiseDuplicateCheckField - it('should handle null values in moduleWiseDuplicateCheckField', () => { - const addDefaultDuplicateCheck = true; - const identifierType = 'Identifier'; - const operationModuleType = 'type1'; - - const result = handleDuplicateCheck( - addDefaultDuplicateCheck, - identifierType, - operationModuleType, - ); - - expect(result).toEqual(['Identifier', 'Name']); +describe('calculateTrigger', () => { + const testCases = [ + { + name: 'should return null when trigger is "Default"', + input: 'Default', + expected: null, + }, + { + name: 'should return an empty array when trigger is "None"', + input: 'None', + expected: [], + }, + { + name: 'should return an array containing the trigger for Custom', + input: 'Custom', + expected: ['Custom'], + }, + { + name: 'should return an array containing the trigger for Approval', + input: 'Approval', + expected: ['Approval'], + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + expect(calculateTrigger(input)).toEqual(expected); + }); }); }); -describe('deduceModuleInfo', () => { - const Config = { region: 'US' }; +describe('searchRecordId', () => { + const mockFields = { Email: 'test@example.com' }; + const mockMetadata = { secret: { accessToken: 'mock-token' } }; + const mockConfig = { region: 'us' }; - it('should return empty object when mappedToDestination is not present', () => { - const inputs = [{}]; - const result = deduceModuleInfo(inputs, Config); - expect(result).toEqual({}); + beforeEach(() => { + jest.clearAllMocks(); }); - it('should return operationModuleInfo when mappedToDestination is present', () => { - const inputs = [ - { - message: { - context: { - externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], - mappedToDestination: true, + const testCases = [ + { + name: 'should handle non-array response data', + response: { + processedResponse: { + status: 200, + response: { + data: 'not-an-array', + }, + }, + }, + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle missing response data property', + response: { + processedResponse: { + status: 200, + response: {}, + }, + }, + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle null response data', + response: { + processedResponse: { + status: 200, + response: { + data: null, }, }, }, - ]; + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle empty array response data', + response: { + processedResponse: { + status: 200, + response: { + data: [], + }, + }, + }, + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle valid array response data with single record', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], + }, + }, + }, + expected: { + erroneous: false, + message: ['123'], + }, + }, + { + name: 'should handle valid array response data with multiple records', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }, { id: '456' }], + }, + }, + }, + expected: { + erroneous: false, + message: ['123', '456'], + }, + }, + { + name: 'should handle non-success HTTP status code', + response: { + processedResponse: { + status: 400, + response: 'Bad Request Error', + }, + }, + expected: { + erroneous: true, + message: 'Bad Request Error', + }, + }, + { + name: 'should handle HTTP request error', + error: new Error('Network Error'), + expected: { + erroneous: true, + message: 'Network Error', + }, + }, + ]; + + testCases.forEach(({ name, response, error, expected }) => { + it(name, async () => { + if (error) { + handleHttpRequest.mockRejectedValueOnce(error); + } else { + handleHttpRequest.mockResolvedValueOnce(response); + } + + const result = await searchRecordId(mockFields, mockMetadata, mockConfig); - const result = deduceModuleInfo(inputs, Config); - expect(result).toEqual({ - operationModuleType: 'Leads', - upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', - identifierType: 'Email', + expect(result).toEqual(expected); }); }); +}); - it('should handle different regions in config', () => { - const inputs = [ - { - message: { - context: { - externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], - mappedToDestination: 'true', +describe('deduceModuleInfo', () => { + const testCases = [ + { + name: 'should return empty object when mappedToDestination is not present', + input: { + inputs: [{}], + config: { region: 'US' }, + }, + expected: {}, + }, + { + name: 'should return operationModuleInfo when mappedToDestination is present', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: true, + }, + }, }, - }, + ], + config: { region: 'US' }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: 'Email', + }, + }, + { + name: 'should handle different regions in config', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: 'true', + }, + }, + }, + ], + config: { region: 'EU' }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.eu/crm/v6/Leads', + identifierType: 'Email', }, - ]; - const Config = { region: 'EU' }; + }, + { + name: 'should handle null input', + input: { + inputs: null, + config: {}, + }, + expected: {}, + }, + { + name: 'should handle undefined input', + input: { + inputs: undefined, + config: {}, + }, + expected: {}, + }, + { + name: 'should handle non-array input', + input: { + inputs: 'not an array', + config: {}, + }, + expected: {}, + }, + { + name: 'should handle empty array', + input: { + inputs: [], + config: {}, + }, + expected: {}, + }, + { + name: 'should use default US region when config.region is null', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: true, + }, + }, + }, + ], + config: { region: null }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: 'Email', + }, + }, + { + name: 'should use default US region when config.region is undefined', + input: { + inputs: [ + { + message: { + context: { + externalId: [{ type: 'ZOHO-Leads', id: '12345', identifierType: 'Email' }], + mappedToDestination: true, + }, + }, + }, + ], + config: {}, // region is undefined + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: 'Email', + }, + }, + ]; - const result = deduceModuleInfo(inputs, Config); - expect(result).toEqual({ - operationModuleType: 'Leads', - upsertEndPoint: 'https://www.zohoapis.eu/crm/v6/Leads', - identifierType: 'Email', + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = deduceModuleInfo(input.inputs, input.config); + expect(result).toEqual(expected); }); }); }); describe('validatePresenceOfMandatoryProperties', () => { - it('should not throw an error if the object has all required fields', () => { - const objectName = 'Leads'; - const object = { Last_Name: 'Doe' }; - - expect(() => validatePresenceOfMandatoryProperties(objectName, object)).not.toThrow(); - }); - - it('should return missing field if mandatory field contains empty string', () => { - const objectName = 'Leads'; - const object = { Last_Name: '' }; - - const result = validatePresenceOfMandatoryProperties(objectName, object); - - expect(result).toEqual({ missingField: ['Last_Name'], status: true }); - }); - - it('should return missing field if mandatory field contains empty null', () => { - const objectName = 'Leads'; - const object = { Last_Name: null }; - - const result = validatePresenceOfMandatoryProperties(objectName, object); - - expect(result).toEqual({ missingField: ['Last_Name'], status: true }); - }); - - it('should not throw an error if the objectName is not in MODULE_MANDATORY_FIELD_CONFIG', () => { - const objectName = 'CustomObject'; - const object = { Some_Field: 'Some Value' }; - - expect(() => validatePresenceOfMandatoryProperties(objectName, object)).not.toThrow(); - }); - - it('should throw an error if the object is missing multiple required fields', () => { - const objectName = 'Deals'; - const object = { Deal_Name: 'Big Deal' }; - const output = validatePresenceOfMandatoryProperties(objectName, object); - expect(output).toEqual({ - missingField: ['Stage', 'Pipeline'], - status: true, + const testCases = [ + { + name: 'should not throw an error if the object has all required fields', + input: { + objectName: 'Leads', + object: { Last_Name: 'Doe' }, + }, + expected: { missingField: [], status: false }, + expectError: false, + }, + { + name: 'should return missing field if mandatory field contains empty string', + input: { + objectName: 'Leads', + object: { Last_Name: '' }, + }, + expected: { missingField: ['Last_Name'], status: true }, + expectError: false, + }, + { + name: 'should return missing field if mandatory field contains empty null', + input: { + objectName: 'Leads', + object: { Last_Name: null }, + }, + expected: { missingField: ['Last_Name'], status: true }, + expectError: false, + }, + { + name: 'should not throw an error if the objectName is not in MODULE_MANDATORY_FIELD_CONFIG', + input: { + objectName: 'CustomObject', + object: { Some_Field: 'Some Value' }, + }, + expected: undefined, + expectError: false, + }, + { + name: 'should return multiple missing fields for Deals', + input: { + objectName: 'Deals', + object: { Deal_Name: 'Big Deal' }, + }, + expected: { + missingField: ['Stage', 'Pipeline'], + status: true, + }, + expectError: false, + }, + { + name: 'should not throw an error if the object has all required fields for Deals', + input: { + objectName: 'Deals', + object: { Deal_Name: 'Big Deal', Stage: 'Negotiation', Pipeline: 'Sales' }, + }, + expected: { missingField: [], status: false }, + expectError: false, + }, + ]; + + testCases.forEach(({ name, input, expected, expectError }) => { + it(name, () => { + if (expectError) { + expect(() => + validatePresenceOfMandatoryProperties(input.objectName, input.object), + ).toThrow(); + } else { + const result = validatePresenceOfMandatoryProperties(input.objectName, input.object); + expect(result).toEqual(expected); + } }); }); - - it('should not throw an error if the object has all required fields for Deals', () => { - const objectName = 'Deals'; - const object = { Deal_Name: 'Big Deal', Stage: 'Negotiation', Pipeline: 'Sales' }; - - expect(() => validatePresenceOfMandatoryProperties(objectName, object)).not.toThrow(); - }); }); describe('validateConfigurationIssue', () => { - test('should throw ConfigurationError when hashMapMultiselect is not empty, Config.module is different from operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).toThrow( - ConfigurationError, - ); - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).toThrow( - 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', - ); - }); - - test('should not throw an error when hashMapMultiselect is not empty, Config.module is the same as operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleA'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); - }); - - test('should not throw an error when hashMapMultiselect is empty, Config.module is different from operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); - }); - - test('should not throw an error when hashMapMultiselect is empty, Config.module is the same as operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [], - module: 'moduleA', - }; - const operationModuleType = 'moduleA'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); - }); - - test('should not throw an error when multiSelectFieldLevelDecision has entries without from key', () => { - const Config = { - multiSelectFieldLevelDecision: [{ to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); - }); - - test('should throw ConfigurationError when multiSelectFieldLevelDecision has mixed case from keys, Config.module is different from operationModuleType, and action is not delete', () => { - const Config = { - multiSelectFieldLevelDecision: [ - { from: 'FIELD1', to: 'true' }, - { from: 'field2', to: 'false' }, - ], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'create'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).toThrow( - ConfigurationError, - ); - }); - - test('should not throw an error when hashMapMultiselect is not empty, Config.module is different from operationModuleType, and action is delete', () => { - const Config = { - multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], - module: 'moduleA', - }; - const operationModuleType = 'moduleB'; - const action = 'delete'; - - expect(() => validateConfigurationIssue(Config, operationModuleType, action)).not.toThrow(); + const testCases = [ + { + name: 'should throw ConfigurationError when hashMapMultiselect is not empty, Config.module is different from operationModuleType, and action is not delete', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: true, + errorType: ConfigurationError, + errorMessage: + 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', + }, + { + name: 'should not throw an error when hashMapMultiselect is not empty, Config.module is the same as operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'field1', to: 'true' }], + module: 'moduleA', + }, + operationModuleType: 'moduleA', + }, + expectError: false, + }, + { + name: 'should not throw an error when hashMapMultiselect is empty, Config.module is different from operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: false, + }, + { + name: 'should not throw an error when hashMapMultiselect is empty, Config.module is the same as operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [], + module: 'moduleA', + }, + operationModuleType: 'moduleA', + }, + expectError: false, + }, + { + name: 'should not throw an error when multiSelectFieldLevelDecision has entries without from key', + input: { + config: { + multiSelectFieldLevelDecision: [{ to: 'true' }], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: false, + }, + { + name: 'should throw ConfigurationError when multiSelectFieldLevelDecision has mixed case from keys, Config.module is different from operationModuleType', + input: { + config: { + multiSelectFieldLevelDecision: [ + { from: 'FIELD1', to: 'true' }, + { from: 'field2', to: 'false' }, + ], + module: 'moduleA', + }, + operationModuleType: 'moduleB', + }, + expectError: true, + errorType: ConfigurationError, + errorMessage: + 'Object Chosen in Visual Data Mapper is not consistent with Module type selected in destination configuration. Aborting Events.', + }, + ]; + + testCases.forEach(({ name, input, expectError, errorType, errorMessage }) => { + it(name, () => { + if (expectError) { + expect(() => validateConfigurationIssue(input.config, input.operationModuleType)).toThrow( + errorType, + ); + expect(() => validateConfigurationIssue(input.config, input.operationModuleType)).toThrow( + errorMessage, + ); + } else { + expect(() => + validateConfigurationIssue(input.config, input.operationModuleType), + ).not.toThrow(); + } + }); }); }); diff --git a/src/util/common.js b/src/util/common.js index 8bf34f2eca2..5e601cd8ed3 100644 --- a/src/util/common.js +++ b/src/util/common.js @@ -24,6 +24,10 @@ const CommonUtils = { setDiff(mainSet, comparisionSet) { return [...mainSet].filter((item) => !comparisionSet.has(item)); }, + + isNonEmptyArray(array) { + return Array.isArray(array) && array.length > 0; + }, }; module.exports = { diff --git a/src/util/common.test.js b/src/util/common.test.js new file mode 100644 index 00000000000..0259c5411e8 --- /dev/null +++ b/src/util/common.test.js @@ -0,0 +1,151 @@ +const { CommonUtils } = require('./common'); + +describe('CommonUtils', () => { + describe('isNonEmptyArray', () => { + const testCases = [ + { name: 'array with numbers', input: [1, 2, 3], expected: true }, + { name: 'array with single string', input: ['a'], expected: true }, + { name: 'array with object', input: [{}], expected: true }, + { name: 'empty array', input: [], expected: false }, + { name: 'null', input: null, expected: false }, + { name: 'undefined', input: undefined, expected: false }, + { name: 'number', input: 42, expected: false }, + { name: 'string', input: 'string', expected: false }, + { name: 'object', input: {}, expected: false }, + { name: 'boolean', input: false, expected: false }, + ]; + + test.each(testCases)('$name', ({ input, expected }) => { + expect(CommonUtils.isNonEmptyArray(input)).toBe(expected); + }); + }); + + describe('objectDiff', () => { + const testCases = [ + { + name: 'different values in flat objects', + obj1: { a: 1, b: 2 }, + obj2: { a: 1, b: 3 }, + expected: { b: [2, 3] }, + }, + { + name: 'nested objects with differences', + obj1: { a: { b: 1, c: 2 }, d: 3 }, + obj2: { a: { b: 1, c: 3 }, d: 3 }, + expected: { 'a.c': [2, 3] }, + }, + { + name: 'missing keys in second object', + obj1: { a: 1, b: 2 }, + obj2: { a: 1 }, + expected: { b: [2, undefined] }, + }, + { + name: 'missing keys in first object', + obj1: { a: 1 }, + obj2: { a: 1, b: 2 }, + expected: { b: [undefined, 2] }, + }, + { + name: 'null inputs', + obj1: null, + obj2: { a: 1 }, + expected: { a: [undefined, 1] }, + }, + { + name: 'empty objects', + obj1: {}, + obj2: {}, + expected: {}, + }, + ]; + + test.each(testCases)('$name', ({ obj1, obj2, expected }) => { + expect(CommonUtils.objectDiff(obj1, obj2)).toEqual(expected); + }); + }); + + describe('toArray', () => { + const testCases = [ + { + name: 'existing array remains unchanged', + input: [1, 2, 3], + expected: [1, 2, 3], + }, + { + name: 'single number becomes array', + input: 42, + expected: [42], + }, + { + name: 'string becomes array', + input: 'test', + expected: ['test'], + }, + { + name: 'object becomes array', + input: { a: 1 }, + expected: [{ a: 1 }], + }, + { + name: 'null becomes array', + input: null, + expected: [null], + }, + { + name: 'undefined becomes array', + input: undefined, + expected: [undefined], + }, + ]; + + test.each(testCases)('$name', ({ input, expected }) => { + expect(CommonUtils.toArray(input)).toEqual(expected); + }); + }); + + describe('setDiff', () => { + const testCases = [ + { + name: 'sets with different elements', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([2, 3, 4]), + expected: [1], + }, + { + name: 'identical sets', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([1, 2, 3]), + expected: [], + }, + { + name: 'completely different sets', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([4, 5, 6]), + expected: [1, 2, 3], + }, + { + name: 'empty comparison set', + mainSet: new Set([1, 2, 3]), + comparisonSet: new Set([]), + expected: [1, 2, 3], + }, + { + name: 'empty main set', + mainSet: new Set([]), + comparisonSet: new Set([1, 2, 3]), + expected: [], + }, + { + name: 'both empty sets', + mainSet: new Set([]), + comparisonSet: new Set([]), + expected: [], + }, + ]; + + test.each(testCases)('$name', ({ mainSet, comparisonSet, expected }) => { + expect(CommonUtils.setDiff(mainSet, comparisonSet)).toEqual(expected); + }); + }); +}); From ae399a931362b4edb061ca51244b4b2b9f0b7faa Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 17 Jan 2025 18:52:45 +0530 Subject: [PATCH 081/160] chore: refactor adjust source to webhook v2 --- go/go.mod | 6 ++- go/go.sum | 18 +++++++-- src/features.ts | 3 +- src/sources/adjust/transform.js | 36 +++++++++++++---- src/v0/sources/adjust/core.js | 33 +++++++++++++++ src/v0/sources/adjust/transform.js | 65 ++++++++---------------------- src/v0/sources/adjust/utils.js | 11 +++++ 7 files changed, 110 insertions(+), 62 deletions(-) create mode 100644 src/v0/sources/adjust/core.js diff --git a/go/go.mod b/go/go.mod index 26ebf86140a..26d0f4d316c 100644 --- a/go/go.mod +++ b/go/go.mod @@ -1,11 +1,13 @@ module github.com/rudderlabs/rudder-transformer/go -go 1.22.4 +go 1.23.4 -require github.com/stretchr/testify v1.9.0 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go/go.sum b/go/go.sum index 60ce688a041..4b32c3e7ceb 100644 --- a/go/go.sum +++ b/go/go.sum @@ -1,10 +1,22 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/src/features.ts b/src/features.ts index 460f2720aff..2d626dcff9a 100644 --- a/src/features.ts +++ b/src/features.ts @@ -113,7 +113,8 @@ const defaultFeaturesConfig: FeaturesConfig = { ], supportSourceTransformV1: true, supportTransformerProxyV1: true, - upgradedToSourceTransformV2: process.env.UPGRADED_TO_SOURCE_TRANSFORM_V2 === 'true' || false, // redundant but required to show that the default is false + upgradedToSourceTransformV2: true, + // upgradedToSourceTransformV2: process.env.UPGRADED_TO_SOURCE_TRANSFORM_V2 === 'true' || false, // redundant but required to show that the default is false }; export default defaultFeaturesConfig; diff --git a/src/sources/adjust/transform.js b/src/sources/adjust/transform.js index 42ed933a970..792125c6718 100644 --- a/src/sources/adjust/transform.js +++ b/src/sources/adjust/transform.js @@ -1,18 +1,38 @@ -const { processEvent: processV0Event } = require('../../v0/sources/adjust/transform'); +// const lodash = require('lodash'); +const { TransformationError } = require('@rudderstack/integrations-lib'); const { CommonUtils } = require('../../util/common'); +const logger = require('../../logger'); +const { flattenParams } = require('../../v0/sources/adjust/utils'); +const { processPayload } = require('../../v0/sources/adjust/core'); -const convertV2ToV0 = (sourceEvent) => { - const v0Event = JSON.parse(sourceEvent.request.body); - if (sourceEvent.request.query_parameters) { - v0Event.query_parameters = sourceEvent.request.query_parameters; +const getPayloadFromRequest = (inputRequest) => { + // This function extracts the query_parameters from the request + // and flattens it to get the payload + + const { request } = inputRequest; + if (!request) { + throw new TransformationError('request field is missing from webhook V2 payload'); + } + + const { query_parameters: qParams } = request; + logger.debug(`[Adjust] Input event: query_params: ${JSON.stringify(qParams)}`); + if (!qParams) { + throw new TransformationError('Query_parameters is missing'); } - return v0Event; + + return flattenParams(qParams); }; const process = (requests) => { + // This function just converts the + // - incoming payload to array + // - extracts params and constructs payload + // - sends it to processPayload for transformation const requestsArray = CommonUtils.toArray(requests); - const v0Events = requestsArray.map(convertV2ToV0); - return v0Events.map(processV0Event); + return requestsArray.map((inputRequest) => { + const formattedPayload = getPayloadFromRequest(inputRequest); + return processPayload(formattedPayload); + }); }; module.exports = { process }; diff --git a/src/v0/sources/adjust/core.js b/src/v0/sources/adjust/core.js new file mode 100644 index 00000000000..cf235d21098 --- /dev/null +++ b/src/v0/sources/adjust/core.js @@ -0,0 +1,33 @@ +const path = require('path'); +const fs = require('fs'); +const Message = require('../message'); +const { excludedFieldList } = require('./config'); +const { extractCustomFields, generateUUID } = require('../../util'); +const { convertToISODate } = require('./utils'); + +// ref : https://help.adjust.com/en/article/global-callbacks#general-recommended-placeholders +// import mapping json using JSON.parse to preserve object key order +const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); + +const processPayload = (payload) => { + const message = new Message(`Adjust`); + + // event type is always track + const eventType = 'track'; + message.setEventType(eventType); + message.setPropertiesV2(payload, mapping); + let customProperties = {}; + customProperties = extractCustomFields(payload, customProperties, 'root', excludedFieldList); + message.properties = { ...message.properties, ...customProperties }; + + if (payload.created_at) { + const ts = convertToISODate(payload.created_at); + message.setProperty('originalTimestamp', ts); + message.setProperty('timestamp', ts); + } + // adjust does not has the concept of user but we need to set some random anonymousId in order to make the server accept the message + message.anonymousId = generateUUID(); + return message; +}; + +module.exports = { processPayload }; diff --git a/src/v0/sources/adjust/transform.js b/src/v0/sources/adjust/transform.js index 8769cc310f3..78620d334fa 100644 --- a/src/v0/sources/adjust/transform.js +++ b/src/v0/sources/adjust/transform.js @@ -1,62 +1,31 @@ -const lodash = require('lodash'); -const path = require('path'); -const fs = require('fs'); +// const lodash = require('lodash'); const { TransformationError } = require('@rudderstack/integrations-lib'); const logger = require('../../../logger'); -const Message = require('../message'); const { CommonUtils } = require('../../../util/common'); -const { excludedFieldList } = require('./config'); -const { extractCustomFields, generateUUID } = require('../../util'); -const { convertToISODate } = require('./utils'); +const { flattenParams } = require('./utils'); +const { processPayload } = require('./core'); -// ref : https://help.adjust.com/en/article/global-callbacks#general-recommended-placeholders -// import mapping json using JSON.parse to preserve object key order -const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); - -const formatProperties = (input) => { - const { query_parameters: qParams } = input; +const getPayloadFromEvent = (event) => { + // This function extracts the query_parameters from the event + // and flattens it to get the payload + const { query_parameters: qParams } = event; logger.debug(`[Adjust] Input event: query_params: ${JSON.stringify(qParams)}`); if (!qParams) { throw new TransformationError('Query_parameters is missing'); } - const formattedOutput = {}; - Object.entries(qParams).forEach(([key, [value]]) => { - formattedOutput[key] = value; - }); - return formattedOutput; + return flattenParams(qParams); }; -const processEvent = (inputEvent) => { - const message = new Message(`Adjust`); - const event = lodash.cloneDeep(inputEvent); - const formattedPayload = formatProperties(event); - // event type is always track - const eventType = 'track'; - message.setEventType(eventType); - message.setPropertiesV2(formattedPayload, mapping); - let customProperties = {}; - customProperties = extractCustomFields( - formattedPayload, - customProperties, - 'root', - excludedFieldList, - ); - message.properties = { ...message.properties, ...customProperties }; - - if (formattedPayload.created_at) { - const ts = convertToISODate(formattedPayload.created_at); - message.setProperty('originalTimestamp', ts); - message.setProperty('timestamp', ts); - } - // adjust does not has the concept of user but we need to set some random anonymousId in order to make the server accept the message - message.anonymousId = generateUUID(); - return message; -}; - -// This fucntion just converts the incoming payload to array of already not and sends it to processEvent const process = (events) => { + // This function just converts the + // - incoming payload to array if not an array + // - extracts params and constructs payload + // - sends it to processPayload for transformation const eventsArray = CommonUtils.toArray(events); - return eventsArray.map(processEvent); + return eventsArray.map((inputEvent) => { + const formattedPayload = getPayloadFromEvent(inputEvent); + return processPayload(formattedPayload); + }); }; -module.exports = { process, processEvent }; +module.exports = { process }; diff --git a/src/v0/sources/adjust/utils.js b/src/v0/sources/adjust/utils.js index 73ec696e342..15ec7109018 100644 --- a/src/v0/sources/adjust/utils.js +++ b/src/v0/sources/adjust/utils.js @@ -22,6 +22,17 @@ const convertToISODate = (rawTimestamp) => { return date.toISOString(); }; +const flattenParams = (qParams) => { + const formattedOutput = {}; + if (qParams) { + Object.entries(qParams).forEach(([key, [value]]) => { + formattedOutput[key] = value; + }); + } + return formattedOutput; +}; + module.exports = { convertToISODate, + flattenParams, }; From 5570745c29fe3ef96daf6741dea198aaa7f8cc38 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 17 Jan 2025 19:30:12 +0530 Subject: [PATCH 082/160] chore: refactor adjust source to webhook v2 --- .eslintignore | 2 +- .github/workflows/verify.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintignore b/.eslintignore index 303356d0450..02dc2ae0874 100644 --- a/.eslintignore +++ b/.eslintignore @@ -27,4 +27,4 @@ scripts/skipPrepareScript.js .prettierignore *.json Dockerfile* -*.properties \ No newline at end of file +*.properties diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 604ff1eaeee..393c33b1e4c 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -40,6 +40,7 @@ jobs: echo "No JS/TS files to format or lint." exit 0 fi + echo "$changed_files" > changed_files.txt - name: Run format Checks run: | From 4d803ef454a72ddf62d69b223fa6c76d47ff6dfc Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 17 Jan 2025 19:47:49 +0530 Subject: [PATCH 083/160] chore: remove unnecessary comments --- src/sources/adjust/transform.js | 1 - src/v0/sources/adjust/transform.js | 1 - 2 files changed, 2 deletions(-) diff --git a/src/sources/adjust/transform.js b/src/sources/adjust/transform.js index 792125c6718..45324e3ce4f 100644 --- a/src/sources/adjust/transform.js +++ b/src/sources/adjust/transform.js @@ -1,4 +1,3 @@ -// const lodash = require('lodash'); const { TransformationError } = require('@rudderstack/integrations-lib'); const { CommonUtils } = require('../../util/common'); const logger = require('../../logger'); diff --git a/src/v0/sources/adjust/transform.js b/src/v0/sources/adjust/transform.js index 78620d334fa..c8963f6af94 100644 --- a/src/v0/sources/adjust/transform.js +++ b/src/v0/sources/adjust/transform.js @@ -1,4 +1,3 @@ -// const lodash = require('lodash'); const { TransformationError } = require('@rudderstack/integrations-lib'); const logger = require('../../../logger'); const { CommonUtils } = require('../../../util/common'); From 350a2427c498741b4409ce5f521e672537bae20a Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 17 Jan 2025 20:04:23 +0530 Subject: [PATCH 084/160] chore: features v2 flag disabled post testing --- src/features.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/features.ts b/src/features.ts index 2d626dcff9a..460f2720aff 100644 --- a/src/features.ts +++ b/src/features.ts @@ -113,8 +113,7 @@ const defaultFeaturesConfig: FeaturesConfig = { ], supportSourceTransformV1: true, supportTransformerProxyV1: true, - upgradedToSourceTransformV2: true, - // upgradedToSourceTransformV2: process.env.UPGRADED_TO_SOURCE_TRANSFORM_V2 === 'true' || false, // redundant but required to show that the default is false + upgradedToSourceTransformV2: process.env.UPGRADED_TO_SOURCE_TRANSFORM_V2 === 'true' || false, // redundant but required to show that the default is false }; export default defaultFeaturesConfig; From c6b14520006f7b5f10ea0824f693f602dc379bf4 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Wed, 22 Jan 2025 19:01:04 +0530 Subject: [PATCH 085/160] chore: deprecate v0 implementation and move everything to v2 --- src/{v0 => }/sources/adjust/config.ts | 0 src/sources/adjust/core.js | 38 ++++++++++++++ src/{v0 => }/sources/adjust/mapping.json | 0 src/sources/adjust/transform.js | 4 +- src/{v0 => }/sources/adjust/utils.js | 0 src/{v0 => }/sources/adjust/utils.test.js | 0 src/v0/sources/adjust-deprecated/config.ts | 16 ++++++ .../{adjust => adjust-deprecated}/core.js | 5 ++ src/v0/sources/adjust-deprecated/mapping.json | 52 +++++++++++++++++++ .../transform.js | 0 src/v0/sources/adjust-deprecated/utils.js | 38 ++++++++++++++ .../sources/adjust-deprecated/utils.test.js | 37 +++++++++++++ 12 files changed, 188 insertions(+), 2 deletions(-) rename src/{v0 => }/sources/adjust/config.ts (100%) create mode 100644 src/sources/adjust/core.js rename src/{v0 => }/sources/adjust/mapping.json (100%) rename src/{v0 => }/sources/adjust/utils.js (100%) rename src/{v0 => }/sources/adjust/utils.test.js (100%) create mode 100644 src/v0/sources/adjust-deprecated/config.ts rename src/v0/sources/{adjust => adjust-deprecated}/core.js (91%) create mode 100644 src/v0/sources/adjust-deprecated/mapping.json rename src/v0/sources/{adjust => adjust-deprecated}/transform.js (100%) create mode 100644 src/v0/sources/adjust-deprecated/utils.js create mode 100644 src/v0/sources/adjust-deprecated/utils.test.js diff --git a/src/v0/sources/adjust/config.ts b/src/sources/adjust/config.ts similarity index 100% rename from src/v0/sources/adjust/config.ts rename to src/sources/adjust/config.ts diff --git a/src/sources/adjust/core.js b/src/sources/adjust/core.js new file mode 100644 index 00000000000..600c42a81f0 --- /dev/null +++ b/src/sources/adjust/core.js @@ -0,0 +1,38 @@ +const path = require('path'); +const fs = require('fs'); +const Message = require('../../v0/sources/message'); +const { excludedFieldList } = require('./config'); +const { extractCustomFields, generateUUID } = require('../../v0/util'); +const { convertToISODate } = require('./utils'); + +// ref : https://help.adjust.com/en/article/global-callbacks#general-recommended-placeholders +// import mapping json using JSON.parse to preserve object key order +const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); + +const processPayload = (payload) => { + const message = new Message(`Adjust`); + + // event type is always track + const eventType = 'track'; + message.setEventType(eventType); + message.setPropertiesV2(payload, mapping); + let customProperties = {}; + + // to remove writeKey from custom properties we can add it to excludedFieldList + excludedFieldList.push('writeKey'); + + customProperties = extractCustomFields(payload, customProperties, 'root', excludedFieldList); + + message.properties = { ...message.properties, ...customProperties }; + + if (payload.created_at) { + const ts = convertToISODate(payload.created_at); + message.setProperty('originalTimestamp', ts); + message.setProperty('timestamp', ts); + } + // adjust does not has the concept of user but we need to set some random anonymousId in order to make the server accept the message + message.anonymousId = generateUUID(); + return message; +}; + +module.exports = { processPayload }; diff --git a/src/v0/sources/adjust/mapping.json b/src/sources/adjust/mapping.json similarity index 100% rename from src/v0/sources/adjust/mapping.json rename to src/sources/adjust/mapping.json diff --git a/src/sources/adjust/transform.js b/src/sources/adjust/transform.js index 45324e3ce4f..206ea13c800 100644 --- a/src/sources/adjust/transform.js +++ b/src/sources/adjust/transform.js @@ -1,8 +1,8 @@ const { TransformationError } = require('@rudderstack/integrations-lib'); const { CommonUtils } = require('../../util/common'); const logger = require('../../logger'); -const { flattenParams } = require('../../v0/sources/adjust/utils'); -const { processPayload } = require('../../v0/sources/adjust/core'); +const { flattenParams } = require('./utils'); +const { processPayload } = require('./core'); const getPayloadFromRequest = (inputRequest) => { // This function extracts the query_parameters from the request diff --git a/src/v0/sources/adjust/utils.js b/src/sources/adjust/utils.js similarity index 100% rename from src/v0/sources/adjust/utils.js rename to src/sources/adjust/utils.js diff --git a/src/v0/sources/adjust/utils.test.js b/src/sources/adjust/utils.test.js similarity index 100% rename from src/v0/sources/adjust/utils.test.js rename to src/sources/adjust/utils.test.js diff --git a/src/v0/sources/adjust-deprecated/config.ts b/src/v0/sources/adjust-deprecated/config.ts new file mode 100644 index 00000000000..d1c6ab8242b --- /dev/null +++ b/src/v0/sources/adjust-deprecated/config.ts @@ -0,0 +1,16 @@ +export const excludedFieldList = [ + 'activity_kind', + 'event', + 'event_name', + 'gps_adid', + 'idfa', + 'idfv', + 'adid', + 'tracker', + 'tracker_name', + 'app_name', + 'ip_address', + 'tracking_enabled', + 'tracker_token', + 'created_at', +]; diff --git a/src/v0/sources/adjust/core.js b/src/v0/sources/adjust-deprecated/core.js similarity index 91% rename from src/v0/sources/adjust/core.js rename to src/v0/sources/adjust-deprecated/core.js index cf235d21098..c838e4abaae 100644 --- a/src/v0/sources/adjust/core.js +++ b/src/v0/sources/adjust-deprecated/core.js @@ -17,7 +17,12 @@ const processPayload = (payload) => { message.setEventType(eventType); message.setPropertiesV2(payload, mapping); let customProperties = {}; + + // to remove writeKey from custom properties we can add it to excludedFieldList + excludedFieldList.push('writeKey'); + customProperties = extractCustomFields(payload, customProperties, 'root', excludedFieldList); + message.properties = { ...message.properties, ...customProperties }; if (payload.created_at) { diff --git a/src/v0/sources/adjust-deprecated/mapping.json b/src/v0/sources/adjust-deprecated/mapping.json new file mode 100644 index 00000000000..60ea66281e4 --- /dev/null +++ b/src/v0/sources/adjust-deprecated/mapping.json @@ -0,0 +1,52 @@ +[ + { + "sourceKeys": "activity_kind", + "destKeys": "properties.activity_kind" + }, + { + "sourceKeys": "event", + "destKeys": "properties.event_token" + }, + { + "sourceKeys": "event_name", + "destKeys": "event" + }, + { + "sourceKeys": "gps_adid", + "destKeys": "properties.gps_adid" + }, + { + "sourceKeys": "idfa", + "destKeys": "context.device.advertisingId" + }, + { + "sourceKeys": "idfv", + "destKeys": "context.device.id" + }, + { + "sourceKeys": "adid", + "destKeys": "context.device.id " + }, + { + "sourceKeys": "tracker", + "destKeys": "properties.tracker" + }, + { + "sourceKeys": "tracker_name", + "destKeys": "properties.tracker_name" + }, + { "sourceKeys": "tracker_token", "destKeys": "properties.tracker_token" }, + + { + "sourceKeys": "app_name", + "destKeys": "context.app.name" + }, + { + "sourceKeys": "ip_address", + "destKeys": ["context.ip", "request_ip"] + }, + { + "sourceKeys": "tracking_enabled", + "destKeys": "properties.tracking_enabled" + } +] diff --git a/src/v0/sources/adjust/transform.js b/src/v0/sources/adjust-deprecated/transform.js similarity index 100% rename from src/v0/sources/adjust/transform.js rename to src/v0/sources/adjust-deprecated/transform.js diff --git a/src/v0/sources/adjust-deprecated/utils.js b/src/v0/sources/adjust-deprecated/utils.js new file mode 100644 index 00000000000..15ec7109018 --- /dev/null +++ b/src/v0/sources/adjust-deprecated/utils.js @@ -0,0 +1,38 @@ +const { TransformationError } = require('@rudderstack/integrations-lib'); + +const convertToISODate = (rawTimestamp) => { + if (typeof rawTimestamp !== 'number' && typeof rawTimestamp !== 'string') { + throw new TransformationError( + `Invalid timestamp type: expected number or string, received ${typeof rawTimestamp}`, + ); + } + + const createdAt = Number(rawTimestamp); + + if (Number.isNaN(createdAt)) { + throw new TransformationError(`Failed to parse timestamp: "${rawTimestamp}"`); + } + + const date = new Date(createdAt * 1000); + + if (Number.isNaN(date.getTime())) { + throw new TransformationError(`Failed to create valid date for timestamp "${rawTimestamp}"`); + } + + return date.toISOString(); +}; + +const flattenParams = (qParams) => { + const formattedOutput = {}; + if (qParams) { + Object.entries(qParams).forEach(([key, [value]]) => { + formattedOutput[key] = value; + }); + } + return formattedOutput; +}; + +module.exports = { + convertToISODate, + flattenParams, +}; diff --git a/src/v0/sources/adjust-deprecated/utils.test.js b/src/v0/sources/adjust-deprecated/utils.test.js new file mode 100644 index 00000000000..f5a0caa832b --- /dev/null +++ b/src/v0/sources/adjust-deprecated/utils.test.js @@ -0,0 +1,37 @@ +const { convertToISODate } = require('./utils'); +const { TransformationError } = require('@rudderstack/integrations-lib'); + +describe('convertToISODate', () => { + // Converts valid numeric timestamp to ISO date string + it('should return ISO date string when given a valid numeric timestamp', () => { + const timestamp = 1633072800; // Example timestamp for 2021-10-01T00:00:00.000Z + const result = convertToISODate(timestamp); + expect(result).toBe('2021-10-01T07:20:00.000Z'); + }); + + // Throws error for non-numeric string input + it('should throw TransformationError when given a non-numeric string', () => { + const invalidTimestamp = 'invalid'; + expect(() => convertToISODate(invalidTimestamp)).toThrow(TransformationError); + }); + + // Converts valid numeric string timestamp to ISO date string + it('should convert valid numeric string timestamp to ISO date string', () => { + const rawTimestamp = '1633072800'; // Corresponds to 2021-10-01T00:00:00.000Z + const result = convertToISODate(rawTimestamp); + expect(result).toBe('2021-10-01T07:20:00.000Z'); + }); + + // Throws error for non-number and non-string input + it('should throw error for non-number and non-string input', () => { + expect(() => convertToISODate({})).toThrow(TransformationError); + expect(() => convertToISODate([])).toThrow(TransformationError); + expect(() => convertToISODate(null)).toThrow(TransformationError); + expect(() => convertToISODate(undefined)).toThrow(TransformationError); + }); + + it('should throw error for timestamp that results in invalid date when multiplied', () => { + const hugeTimestamp = 999999999999999; // This will become invalid when multiplied by 1000 + expect(() => convertToISODate(hugeTimestamp)).toThrow(TransformationError); + }); +}); From 5192d513e7aa65bc1a4d283cf6769f40ce241e68 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Thu, 6 Feb 2025 20:42:47 +0530 Subject: [PATCH 086/160] chore: add unit tests, fix docs --- src/controllers/util/index.ts | 7 +-- src/sources/adjust/transform.js | 25 +++++--- src/sources/adjust/utils.js | 19 +++++- src/sources/adjust/utils.test.js | 105 +++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 16 deletions(-) diff --git a/src/controllers/util/index.ts b/src/controllers/util/index.ts index 4d24f607b45..a25b59ee3cf 100644 --- a/src/controllers/util/index.ts +++ b/src/controllers/util/index.ts @@ -15,7 +15,6 @@ import { getValueFromMessage } from '../../v0/util'; import genericFieldMap from '../../v0/util/data/GenericFieldMapping.json'; import { EventType, MappedToDestinationKey } from '../../constants'; import { versionConversionFactory } from './versionConversion'; -import defaultFeaturesConfig from '../../features'; export class ControllerUtility { private static sourceVersionMap: Map = new Map(); @@ -42,11 +41,7 @@ export class ControllerUtility { return this.sourceVersionMap; } - const versions = ['v0', 'v1']; - if (defaultFeaturesConfig.upgradedToSourceTransformV2) { - // this makes it easy to revert to v0,v1 spec if something doesn't work out using ENV variables - versions.push('v2'); - } + const versions = ['v0', 'v1', 'v2']; versions.forEach((version) => { const files = fs.readdirSync(this.getSourceDirPath(version), { diff --git a/src/sources/adjust/transform.js b/src/sources/adjust/transform.js index 206ea13c800..b916723ad65 100644 --- a/src/sources/adjust/transform.js +++ b/src/sources/adjust/transform.js @@ -4,10 +4,13 @@ const logger = require('../../logger'); const { flattenParams } = require('./utils'); const { processPayload } = require('./core'); +/** + * Extracts and flattens query parameters from the webhook request + * @param {Object} inputRequest - The incoming webhook request object + * @returns {Object} Flattened query parameters + * @throws {TransformationError} If request or query_parameters are missing + */ const getPayloadFromRequest = (inputRequest) => { - // This function extracts the query_parameters from the request - // and flattens it to get the payload - const { request } = inputRequest; if (!request) { throw new TransformationError('request field is missing from webhook V2 payload'); @@ -15,18 +18,24 @@ const getPayloadFromRequest = (inputRequest) => { const { query_parameters: qParams } = request; logger.debug(`[Adjust] Input event: query_params: ${JSON.stringify(qParams)}`); - if (!qParams) { + if (!qParams || Object.keys(qParams).length === 0) { throw new TransformationError('Query_parameters is missing'); } return flattenParams(qParams); }; +/** + * Processes incoming webhook requests from Adjust + * @param {Object|Array} requests - Single request object or array of webhook requests + * @returns {Array} Array of transformed payloads ready to be sent to rudder-server + * @description + * This function: + * - converts incoming payload to array + * - extracts params and constructs payload + * - sends it to processPayload for transformation + */ const process = (requests) => { - // This function just converts the - // - incoming payload to array - // - extracts params and constructs payload - // - sends it to processPayload for transformation const requestsArray = CommonUtils.toArray(requests); return requestsArray.map((inputRequest) => { const formattedPayload = getPayloadFromRequest(inputRequest); diff --git a/src/sources/adjust/utils.js b/src/sources/adjust/utils.js index 15ec7109018..e7728c760ff 100644 --- a/src/sources/adjust/utils.js +++ b/src/sources/adjust/utils.js @@ -1,5 +1,11 @@ const { TransformationError } = require('@rudderstack/integrations-lib'); +/** + * Converts a raw timestamp to ISO 8601 date string format + * @param {number|string} rawTimestamp - The timestamp to convert (expects Unix timestamp in seconds) + * @returns {string} The timestamp converted to ISO 8601 format + * @throws {TransformationError} If the timestamp is invalid or cannot be parsed + */ const convertToISODate = (rawTimestamp) => { if (typeof rawTimestamp !== 'number' && typeof rawTimestamp !== 'string') { throw new TransformationError( @@ -22,11 +28,20 @@ const convertToISODate = (rawTimestamp) => { return date.toISOString(); }; +/** + * Flattens an object containing array parameters into a simple key-value object with first element of array as value + * @param {Object.} qParams - Object containing parameters where values are arrays + * @returns {Object.} Flattened object where array values are replaced with their first element + * @description + * This function flattens an object containing array parameters into a simple key-value object + * with first element of array as value if it is an array, otherwise the value is returned as is + * In case of empty array, the value is returned as undefined + */ const flattenParams = (qParams) => { const formattedOutput = {}; if (qParams) { - Object.entries(qParams).forEach(([key, [value]]) => { - formattedOutput[key] = value; + Object.entries(qParams).forEach(([key, value]) => { + formattedOutput[key] = Array.isArray(value) ? value[0] : value; }); } return formattedOutput; diff --git a/src/sources/adjust/utils.test.js b/src/sources/adjust/utils.test.js index f5a0caa832b..6f6ba2b2ca9 100644 --- a/src/sources/adjust/utils.test.js +++ b/src/sources/adjust/utils.test.js @@ -35,3 +35,108 @@ describe('convertToISODate', () => { expect(() => convertToISODate(hugeTimestamp)).toThrow(TransformationError); }); }); + +describe('flattenParams', () => { + const { flattenParams } = require('./utils'); + + it('should flatten object with array values to their first elements', () => { + const input = { + key1: ['value1'], + key2: ['value2'], + key3: [123], + }; + const expected = { + key1: 'value1', + key2: 'value2', + key3: 123, + }; + expect(flattenParams(input)).toEqual(expected); + }); + + it('should return empty object when input is null or undefined', () => { + expect(flattenParams(null)).toEqual({}); + expect(flattenParams(undefined)).toEqual({}); + }); + + it('should handle empty object input', () => { + expect(flattenParams({})).toEqual({}); + }); + + it('should handle array with undefined or null first elements', () => { + const input = { + key1: [undefined], + key2: [null], + }; + const expected = { + key1: undefined, + key2: null, + }; + expect(flattenParams(input)).toEqual(expected); + }); + + it('should handle mixed type values in arrays', () => { + const input = { + number: [42], + string: ['test'], + boolean: [true], + object: [{ nested: 'value' }], + }; + const expected = { + number: 42, + string: 'test', + boolean: true, + object: { nested: 'value' }, + }; + expect(flattenParams(input)).toEqual(expected); + }); + + it('should handle empty arrays as values', () => { + const input = { + key1: [], + key2: ['value'], + key3: [], + }; + const expected = { + key1: undefined, + key2: 'value', + key3: undefined, + }; + expect(flattenParams(input)).toEqual(expected); + }); + + it('should keep non-array values unchanged', () => { + const input = { + string: 'direct string', + number: 42, + boolean: true, + object: { test: 'value' }, + array: ['first', 'second'], + }; + const expected = { + string: 'direct string', + number: 42, + boolean: true, + object: { test: 'value' }, + array: 'first', + }; + expect(flattenParams(input)).toEqual(expected); + }); + + it('should handle mixed array and non-array values', () => { + const input = { + arrayValue: ['first'], + emptyArray: [], + directValue: 'string', + nullValue: null, + undefinedValue: undefined, + }; + const expected = { + arrayValue: 'first', + emptyArray: undefined, + directValue: 'string', + nullValue: null, + undefinedValue: undefined, + }; + expect(flattenParams(input)).toEqual(expected); + }); +}); From 7560be5653704d43d6dfe227346b4c4df246dc86 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Thu, 13 Feb 2025 12:39:02 +0530 Subject: [PATCH 087/160] chore: remove deprecated adjust code --- src/v0/sources/adjust-deprecated/config.ts | 16 ------ src/v0/sources/adjust-deprecated/core.js | 38 -------------- src/v0/sources/adjust-deprecated/mapping.json | 52 ------------------- src/v0/sources/adjust-deprecated/transform.js | 30 ----------- src/v0/sources/adjust-deprecated/utils.js | 38 -------------- .../sources/adjust-deprecated/utils.test.js | 37 ------------- 6 files changed, 211 deletions(-) delete mode 100644 src/v0/sources/adjust-deprecated/config.ts delete mode 100644 src/v0/sources/adjust-deprecated/core.js delete mode 100644 src/v0/sources/adjust-deprecated/mapping.json delete mode 100644 src/v0/sources/adjust-deprecated/transform.js delete mode 100644 src/v0/sources/adjust-deprecated/utils.js delete mode 100644 src/v0/sources/adjust-deprecated/utils.test.js diff --git a/src/v0/sources/adjust-deprecated/config.ts b/src/v0/sources/adjust-deprecated/config.ts deleted file mode 100644 index d1c6ab8242b..00000000000 --- a/src/v0/sources/adjust-deprecated/config.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const excludedFieldList = [ - 'activity_kind', - 'event', - 'event_name', - 'gps_adid', - 'idfa', - 'idfv', - 'adid', - 'tracker', - 'tracker_name', - 'app_name', - 'ip_address', - 'tracking_enabled', - 'tracker_token', - 'created_at', -]; diff --git a/src/v0/sources/adjust-deprecated/core.js b/src/v0/sources/adjust-deprecated/core.js deleted file mode 100644 index c838e4abaae..00000000000 --- a/src/v0/sources/adjust-deprecated/core.js +++ /dev/null @@ -1,38 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const Message = require('../message'); -const { excludedFieldList } = require('./config'); -const { extractCustomFields, generateUUID } = require('../../util'); -const { convertToISODate } = require('./utils'); - -// ref : https://help.adjust.com/en/article/global-callbacks#general-recommended-placeholders -// import mapping json using JSON.parse to preserve object key order -const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); - -const processPayload = (payload) => { - const message = new Message(`Adjust`); - - // event type is always track - const eventType = 'track'; - message.setEventType(eventType); - message.setPropertiesV2(payload, mapping); - let customProperties = {}; - - // to remove writeKey from custom properties we can add it to excludedFieldList - excludedFieldList.push('writeKey'); - - customProperties = extractCustomFields(payload, customProperties, 'root', excludedFieldList); - - message.properties = { ...message.properties, ...customProperties }; - - if (payload.created_at) { - const ts = convertToISODate(payload.created_at); - message.setProperty('originalTimestamp', ts); - message.setProperty('timestamp', ts); - } - // adjust does not has the concept of user but we need to set some random anonymousId in order to make the server accept the message - message.anonymousId = generateUUID(); - return message; -}; - -module.exports = { processPayload }; diff --git a/src/v0/sources/adjust-deprecated/mapping.json b/src/v0/sources/adjust-deprecated/mapping.json deleted file mode 100644 index 60ea66281e4..00000000000 --- a/src/v0/sources/adjust-deprecated/mapping.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "sourceKeys": "activity_kind", - "destKeys": "properties.activity_kind" - }, - { - "sourceKeys": "event", - "destKeys": "properties.event_token" - }, - { - "sourceKeys": "event_name", - "destKeys": "event" - }, - { - "sourceKeys": "gps_adid", - "destKeys": "properties.gps_adid" - }, - { - "sourceKeys": "idfa", - "destKeys": "context.device.advertisingId" - }, - { - "sourceKeys": "idfv", - "destKeys": "context.device.id" - }, - { - "sourceKeys": "adid", - "destKeys": "context.device.id " - }, - { - "sourceKeys": "tracker", - "destKeys": "properties.tracker" - }, - { - "sourceKeys": "tracker_name", - "destKeys": "properties.tracker_name" - }, - { "sourceKeys": "tracker_token", "destKeys": "properties.tracker_token" }, - - { - "sourceKeys": "app_name", - "destKeys": "context.app.name" - }, - { - "sourceKeys": "ip_address", - "destKeys": ["context.ip", "request_ip"] - }, - { - "sourceKeys": "tracking_enabled", - "destKeys": "properties.tracking_enabled" - } -] diff --git a/src/v0/sources/adjust-deprecated/transform.js b/src/v0/sources/adjust-deprecated/transform.js deleted file mode 100644 index c8963f6af94..00000000000 --- a/src/v0/sources/adjust-deprecated/transform.js +++ /dev/null @@ -1,30 +0,0 @@ -const { TransformationError } = require('@rudderstack/integrations-lib'); -const logger = require('../../../logger'); -const { CommonUtils } = require('../../../util/common'); -const { flattenParams } = require('./utils'); -const { processPayload } = require('./core'); - -const getPayloadFromEvent = (event) => { - // This function extracts the query_parameters from the event - // and flattens it to get the payload - const { query_parameters: qParams } = event; - logger.debug(`[Adjust] Input event: query_params: ${JSON.stringify(qParams)}`); - if (!qParams) { - throw new TransformationError('Query_parameters is missing'); - } - return flattenParams(qParams); -}; - -const process = (events) => { - // This function just converts the - // - incoming payload to array if not an array - // - extracts params and constructs payload - // - sends it to processPayload for transformation - const eventsArray = CommonUtils.toArray(events); - return eventsArray.map((inputEvent) => { - const formattedPayload = getPayloadFromEvent(inputEvent); - return processPayload(formattedPayload); - }); -}; - -module.exports = { process }; diff --git a/src/v0/sources/adjust-deprecated/utils.js b/src/v0/sources/adjust-deprecated/utils.js deleted file mode 100644 index 15ec7109018..00000000000 --- a/src/v0/sources/adjust-deprecated/utils.js +++ /dev/null @@ -1,38 +0,0 @@ -const { TransformationError } = require('@rudderstack/integrations-lib'); - -const convertToISODate = (rawTimestamp) => { - if (typeof rawTimestamp !== 'number' && typeof rawTimestamp !== 'string') { - throw new TransformationError( - `Invalid timestamp type: expected number or string, received ${typeof rawTimestamp}`, - ); - } - - const createdAt = Number(rawTimestamp); - - if (Number.isNaN(createdAt)) { - throw new TransformationError(`Failed to parse timestamp: "${rawTimestamp}"`); - } - - const date = new Date(createdAt * 1000); - - if (Number.isNaN(date.getTime())) { - throw new TransformationError(`Failed to create valid date for timestamp "${rawTimestamp}"`); - } - - return date.toISOString(); -}; - -const flattenParams = (qParams) => { - const formattedOutput = {}; - if (qParams) { - Object.entries(qParams).forEach(([key, [value]]) => { - formattedOutput[key] = value; - }); - } - return formattedOutput; -}; - -module.exports = { - convertToISODate, - flattenParams, -}; diff --git a/src/v0/sources/adjust-deprecated/utils.test.js b/src/v0/sources/adjust-deprecated/utils.test.js deleted file mode 100644 index f5a0caa832b..00000000000 --- a/src/v0/sources/adjust-deprecated/utils.test.js +++ /dev/null @@ -1,37 +0,0 @@ -const { convertToISODate } = require('./utils'); -const { TransformationError } = require('@rudderstack/integrations-lib'); - -describe('convertToISODate', () => { - // Converts valid numeric timestamp to ISO date string - it('should return ISO date string when given a valid numeric timestamp', () => { - const timestamp = 1633072800; // Example timestamp for 2021-10-01T00:00:00.000Z - const result = convertToISODate(timestamp); - expect(result).toBe('2021-10-01T07:20:00.000Z'); - }); - - // Throws error for non-numeric string input - it('should throw TransformationError when given a non-numeric string', () => { - const invalidTimestamp = 'invalid'; - expect(() => convertToISODate(invalidTimestamp)).toThrow(TransformationError); - }); - - // Converts valid numeric string timestamp to ISO date string - it('should convert valid numeric string timestamp to ISO date string', () => { - const rawTimestamp = '1633072800'; // Corresponds to 2021-10-01T00:00:00.000Z - const result = convertToISODate(rawTimestamp); - expect(result).toBe('2021-10-01T07:20:00.000Z'); - }); - - // Throws error for non-number and non-string input - it('should throw error for non-number and non-string input', () => { - expect(() => convertToISODate({})).toThrow(TransformationError); - expect(() => convertToISODate([])).toThrow(TransformationError); - expect(() => convertToISODate(null)).toThrow(TransformationError); - expect(() => convertToISODate(undefined)).toThrow(TransformationError); - }); - - it('should throw error for timestamp that results in invalid date when multiplied', () => { - const hugeTimestamp = 999999999999999; // This will become invalid when multiplied by 1000 - expect(() => convertToISODate(hugeTimestamp)).toThrow(TransformationError); - }); -}); From 6b8fb99a453eceae3f64dc2bcd47ecfede5dee43 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 14 Feb 2025 14:45:32 +0530 Subject: [PATCH 088/160] chore: migrate tests to v2 for adjust --- test/integrations/sources/adjust/data.ts | 66 +++++++++++------------- 1 file changed, 29 insertions(+), 37 deletions(-) diff --git a/test/integrations/sources/adjust/data.ts b/test/integrations/sources/adjust/data.ts index e898692a2d0..bb81450e9d5 100644 --- a/test/integrations/sources/adjust/data.ts +++ b/test/integrations/sources/adjust/data.ts @@ -10,13 +10,17 @@ export const data = [ name: 'adjust', description: 'Simple track call', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - id: 'adjust', + request: { + body: JSON.stringify({ + id: 'adjust', + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', + }), query_parameters: { gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], adid: ['18546f6171f67e29d1cb983322ad1329'], @@ -26,16 +30,12 @@ export const data = [ created_at: ['1404214665'], event_name: ['Click'], }, - updated_at: '2023-02-10T12:16:07.251Z', - created_at: '2023-02-10T12:05:04.402Z', }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -49,20 +49,11 @@ export const data = [ { anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Adjust', - }, - device: { - 'id ': '18546f6171f67e29d1cb983322ad1329', - }, - }, - integrations: { - Adjust: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Adjust' }, + device: { 'id ': '18546f6171f67e29d1cb983322ad1329' }, }, + integrations: { Adjust: false }, type: 'track', event: 'Click', originalTimestamp: '2014-07-01T11:37:45.000Z', @@ -88,24 +79,25 @@ export const data = [ name: 'adjust', description: 'Simple track call with no query parameters', module: 'source', - version: 'v1', + version: 'v2', skipGo: 'FIXME', input: { request: { body: [ { - event: { - id: 'adjust', - updated_at: '2023-02-10T12:16:07.251Z', - created_at: '2023-02-10T12:05:04.402Z', + request: { + body: JSON.stringify({ + id: 'adjust', + updated_at: '2023-02-10T12:16:07.251Z', + created_at: '2023-02-10T12:05:04.402Z', + }), + query_parameters: undefined, }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -136,14 +128,18 @@ export const data = [ name: 'adjust', description: 'Simple track call with wrong created at', module: 'source', - version: 'v1', + version: 'v2', skipGo: 'FIXME', input: { request: { body: [ { - event: { - id: 'adjust', + request: { + body: JSON.stringify({ + id: 'adjust', + updated_at: '2023-02-10T12:16:07.251Z', + created_at: 'test', + }), query_parameters: { gps_adid: ['38400000-8cf0-11bd-b23e-10b96e40000d'], adid: ['18546f6171f67e29d1cb983322ad1329'], @@ -153,16 +149,12 @@ export const data = [ created_at: ['test'], event_name: ['Click'], }, - updated_at: '2023-02-10T12:16:07.251Z', - created_at: 'test', }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, From 5100e9211b6b9766925fa5029a49300c7de87ce6 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 14 Feb 2025 14:51:49 +0530 Subject: [PATCH 089/160] chore: revert go changes to same as develop --- .eslintignore | 2 +- .github/workflows/verify.yml | 1 - go/go.mod | 6 ++---- go/go.sum | 18 +++--------------- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.eslintignore b/.eslintignore index 02dc2ae0874..303356d0450 100644 --- a/.eslintignore +++ b/.eslintignore @@ -27,4 +27,4 @@ scripts/skipPrepareScript.js .prettierignore *.json Dockerfile* -*.properties +*.properties \ No newline at end of file diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 393c33b1e4c..604ff1eaeee 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -40,7 +40,6 @@ jobs: echo "No JS/TS files to format or lint." exit 0 fi - echo "$changed_files" > changed_files.txt - name: Run format Checks run: | diff --git a/go/go.mod b/go/go.mod index 26d0f4d316c..26ebf86140a 100644 --- a/go/go.mod +++ b/go/go.mod @@ -1,13 +1,11 @@ module github.com/rudderlabs/rudder-transformer/go -go 1.23.4 +go 1.22.4 -require github.com/stretchr/testify v1.10.0 +require github.com/stretchr/testify v1.9.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go/go.sum b/go/go.sum index 4b32c3e7ceb..60ce688a041 100644 --- a/go/go.sum +++ b/go/go.sum @@ -1,22 +1,10 @@ -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From c200518b5b32457db2a66fa290dc9c075999aeb0 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 14 Feb 2025 15:15:48 +0530 Subject: [PATCH 090/160] chore: update flatten params function and improve tests structure --- src/sources/adjust/utils.js | 9 +- src/sources/adjust/utils.test.js | 321 +++++++++++++++++++------------ 2 files changed, 199 insertions(+), 131 deletions(-) diff --git a/src/sources/adjust/utils.js b/src/sources/adjust/utils.js index e7728c760ff..40509ffdee3 100644 --- a/src/sources/adjust/utils.js +++ b/src/sources/adjust/utils.js @@ -1,4 +1,4 @@ -const { TransformationError } = require('@rudderstack/integrations-lib'); +const { TransformationError, isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); /** * Converts a raw timestamp to ISO 8601 date string format @@ -35,13 +35,16 @@ const convertToISODate = (rawTimestamp) => { * @description * This function flattens an object containing array parameters into a simple key-value object * with first element of array as value if it is an array, otherwise the value is returned as is - * In case of empty array, the value is returned as undefined + * In case of empty array, the key is removed from the output */ const flattenParams = (qParams) => { const formattedOutput = {}; if (qParams) { Object.entries(qParams).forEach(([key, value]) => { - formattedOutput[key] = Array.isArray(value) ? value[0] : value; + const finalValue = Array.isArray(value) ? value[0] : value; + if (isDefinedAndNotNull(finalValue)) { + formattedOutput[key] = finalValue; + } }); } return formattedOutput; diff --git a/src/sources/adjust/utils.test.js b/src/sources/adjust/utils.test.js index 6f6ba2b2ca9..cc9a145a20b 100644 --- a/src/sources/adjust/utils.test.js +++ b/src/sources/adjust/utils.test.js @@ -2,141 +2,206 @@ const { convertToISODate } = require('./utils'); const { TransformationError } = require('@rudderstack/integrations-lib'); describe('convertToISODate', () => { - // Converts valid numeric timestamp to ISO date string - it('should return ISO date string when given a valid numeric timestamp', () => { - const timestamp = 1633072800; // Example timestamp for 2021-10-01T00:00:00.000Z - const result = convertToISODate(timestamp); - expect(result).toBe('2021-10-01T07:20:00.000Z'); - }); - - // Throws error for non-numeric string input - it('should throw TransformationError when given a non-numeric string', () => { - const invalidTimestamp = 'invalid'; - expect(() => convertToISODate(invalidTimestamp)).toThrow(TransformationError); - }); - - // Converts valid numeric string timestamp to ISO date string - it('should convert valid numeric string timestamp to ISO date string', () => { - const rawTimestamp = '1633072800'; // Corresponds to 2021-10-01T00:00:00.000Z - const result = convertToISODate(rawTimestamp); - expect(result).toBe('2021-10-01T07:20:00.000Z'); - }); + const testCases = [ + { + name: 'valid numeric timestamp', + input: 1633072800, + expected: '2021-10-01T07:20:00.000Z', + shouldThrow: false, + }, + { + name: 'non-numeric string', + input: 'invalid', + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'valid numeric string timestamp', + input: '1633072800', + expected: '2021-10-01T07:20:00.000Z', + shouldThrow: false, + }, + { + name: 'object input', + input: {}, + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'array input', + input: [], + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'null input', + input: null, + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'undefined input', + input: undefined, + shouldThrow: true, + errorType: TransformationError, + }, + { + name: 'huge timestamp that becomes invalid', + input: 999999999999999, + shouldThrow: true, + errorType: TransformationError, + }, + ]; - // Throws error for non-number and non-string input - it('should throw error for non-number and non-string input', () => { - expect(() => convertToISODate({})).toThrow(TransformationError); - expect(() => convertToISODate([])).toThrow(TransformationError); - expect(() => convertToISODate(null)).toThrow(TransformationError); - expect(() => convertToISODate(undefined)).toThrow(TransformationError); - }); - - it('should throw error for timestamp that results in invalid date when multiplied', () => { - const hugeTimestamp = 999999999999999; // This will become invalid when multiplied by 1000 - expect(() => convertToISODate(hugeTimestamp)).toThrow(TransformationError); + testCases.forEach(({ name, input, expected, shouldThrow, errorType }) => { + it(`should handle ${name}`, () => { + if (shouldThrow) { + expect(() => convertToISODate(input)).toThrow(errorType); + } else { + const result = convertToISODate(input); + expect(result).toBe(expected); + } + }); }); }); describe('flattenParams', () => { const { flattenParams } = require('./utils'); - it('should flatten object with array values to their first elements', () => { - const input = { - key1: ['value1'], - key2: ['value2'], - key3: [123], - }; - const expected = { - key1: 'value1', - key2: 'value2', - key3: 123, - }; - expect(flattenParams(input)).toEqual(expected); - }); - - it('should return empty object when input is null or undefined', () => { - expect(flattenParams(null)).toEqual({}); - expect(flattenParams(undefined)).toEqual({}); - }); - - it('should handle empty object input', () => { - expect(flattenParams({})).toEqual({}); - }); - - it('should handle array with undefined or null first elements', () => { - const input = { - key1: [undefined], - key2: [null], - }; - const expected = { - key1: undefined, - key2: null, - }; - expect(flattenParams(input)).toEqual(expected); - }); - - it('should handle mixed type values in arrays', () => { - const input = { - number: [42], - string: ['test'], - boolean: [true], - object: [{ nested: 'value' }], - }; - const expected = { - number: 42, - string: 'test', - boolean: true, - object: { nested: 'value' }, - }; - expect(flattenParams(input)).toEqual(expected); - }); - - it('should handle empty arrays as values', () => { - const input = { - key1: [], - key2: ['value'], - key3: [], - }; - const expected = { - key1: undefined, - key2: 'value', - key3: undefined, - }; - expect(flattenParams(input)).toEqual(expected); - }); - - it('should keep non-array values unchanged', () => { - const input = { - string: 'direct string', - number: 42, - boolean: true, - object: { test: 'value' }, - array: ['first', 'second'], - }; - const expected = { - string: 'direct string', - number: 42, - boolean: true, - object: { test: 'value' }, - array: 'first', - }; - expect(flattenParams(input)).toEqual(expected); - }); + const testCases = [ + { + name: 'flatten array values to first elements', + input: { + key1: ['value1'], + key2: ['value2'], + key3: [123], + }, + expected: { + key1: 'value1', + key2: 'value2', + key3: 123, + }, + }, + { + name: 'handle null input', + input: null, + expected: {}, + }, + { + name: 'handle undefined input', + input: undefined, + expected: {}, + }, + { + name: 'handle empty object', + input: {}, + expected: {}, + }, + { + name: 'ignore null/undefined array elements', + input: { + key1: [undefined], + key2: [null], + key3: [undefined, 'value'], + key4: [null, 'value'], + }, + expected: {}, + }, + { + name: 'handle mixed type values in arrays', + input: { + number: [42], + string: ['test'], + boolean: [true], + object: [{ nested: 'value' }], + date: [new Date('2024-01-01')], + }, + expected: { + number: 42, + string: 'test', + boolean: true, + object: { nested: 'value' }, + date: new Date('2024-01-01'), + }, + }, + { + name: 'handle empty arrays', + input: { + key1: [], + key2: ['value'], + key3: [], + }, + expected: { + key2: 'value', + }, + }, + { + name: 'keep non-array values unchanged', + input: { + string: 'direct string', + number: 42, + boolean: true, + object: { test: 'value' }, + array: ['first', 'second'], + }, + expected: { + string: 'direct string', + number: 42, + boolean: true, + object: { test: 'value' }, + array: 'first', + }, + }, + { + name: 'handle mixed array and non-array values', + input: { + arrayValue: ['first'], + emptyArray: [], + directValue: 'string', + nullValue: null, + undefinedValue: undefined, + }, + expected: { + arrayValue: 'first', + directValue: 'string', + }, + }, + { + name: 'handle nested arrays', + input: { + nested: [ + [1, 2], + [3, 4], + ], + mixed: [['a', 'b'], 'c'], + }, + expected: { + nested: [1, 2], + mixed: ['a', 'b'], + }, + }, + { + name: 'handle special values in arrays', + input: { + nan: [NaN], + infinity: [Infinity], + negInfinity: [-Infinity], + zero: [0], + negZero: [-0], + }, + expected: { + nan: NaN, + infinity: Infinity, + negInfinity: -Infinity, + zero: 0, + negZero: -0, + }, + }, + ]; - it('should handle mixed array and non-array values', () => { - const input = { - arrayValue: ['first'], - emptyArray: [], - directValue: 'string', - nullValue: null, - undefinedValue: undefined, - }; - const expected = { - arrayValue: 'first', - emptyArray: undefined, - directValue: 'string', - nullValue: null, - undefinedValue: undefined, - }; - expect(flattenParams(input)).toEqual(expected); + testCases.forEach(({ name, input, expected }) => { + it(`should ${name}`, () => { + expect(flattenParams(input)).toEqual(expected); + }); }); }); From 711e18bfcec1518830076bbe7e49ba7b2f2e3757 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:00:12 +0530 Subject: [PATCH 091/160] fix: content_price should be a number with decimal point in twitter ads (#4075) * fix: content_price should be a numeric string with float point in twitter ads * fix: minor change * fix: added test and some minor change * chore: update twitter_ads transform.js * Revert "chore: update twitter_ads transform.js" This reverts commit cc173f4d4f09cb7cdfa57a0cd0fed3cc6107ab74. --------- Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> Co-authored-by: Dilip Kola --- src/v0/destinations/twitter_ads/transform.js | 6 +- .../twitter_ads/processor/data.ts | 133 +++++++++++++++++- .../destinations/twitter_ads/router/data.ts | 4 +- 3 files changed, 135 insertions(+), 8 deletions(-) diff --git a/src/v0/destinations/twitter_ads/transform.js b/src/v0/destinations/twitter_ads/transform.js index 4258935bfbb..74bb1fc4f34 100644 --- a/src/v0/destinations/twitter_ads/transform.js +++ b/src/v0/destinations/twitter_ads/transform.js @@ -100,7 +100,11 @@ function populateContents(requestJson) { transformed.content_type = type; } if (price && Number.isFinite(parseFloat(price))) { - transformed.content_price = parseFloat(price); + const parsedPrice = parseFloat(price); + // content_price should be a string + transformed.content_price = Number.isInteger(parsedPrice) + ? parsedPrice.toFixed(2) + : parsedPrice.toString(); } if (quantity && Number.isFinite(parseInt(quantity, 10))) { transformed.num_items = parseInt(quantity, 10); diff --git a/test/integrations/destinations/twitter_ads/processor/data.ts b/test/integrations/destinations/twitter_ads/processor/data.ts index 8c622f22393..61a03fc64b4 100644 --- a/test/integrations/destinations/twitter_ads/processor/data.ts +++ b/test/integrations/destinations/twitter_ads/processor/data.ts @@ -137,12 +137,12 @@ export const data = [ contents: [ { content_id: '12', - content_price: 123.3345, + content_price: '123.3345', num_items: 12, }, { content_id: '4', - content_price: 200, + content_price: '200.00', num_items: 11, }, ], @@ -851,12 +851,12 @@ export const data = [ contents: [ { content_id: '12', - content_price: 123.3345, + content_price: '123.3345', num_items: 12, }, { content_id: '4', - content_price: 200, + content_price: '200.00', num_items: 11, }, ], @@ -1883,7 +1883,7 @@ export const data = [ content_id: '13', content_name: 'Product 2', content_type: 'digital', - content_price: 200, + content_price: '200.00', }, { content_id: '14', @@ -2277,6 +2277,129 @@ export const data = [ }, }, }, + { + name: 'twitter_ads', + description: 'Test case for content transformations with invalid content price', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + type: 'track', + event: 'ABC Searched', + timestamp: '2020-08-14T05:30:30.118Z', + properties: { + email: 'abc@ax.com', + contents: [ + { + // invalid price + id: '12', + price: 'random-price-string', + name: 'Product 1', + type: 'physical', + groupId: 'group1', + }, + { + // valid price + id: '13', + price: '0', + name: 'Product 2', + type: 'digital', + }, + ], + }, + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + destination: { + Config: { + pixelId: 'dummyPixelId', + twitterAdsEventNames: [ + { + rudderEventName: 'ABC Searched', + twitterEventId: 'tw-234234324234', + }, + ], + }, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://ads-api.twitter.com/12/measurement/conversions/dummyPixelId', + headers: { + Authorization: authHeaderConstant, + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + conversions: [ + { + conversion_time: '2020-08-14T05:30:30.118Z', + event_id: 'tw-234234324234', + identifiers: [ + { + hashed_email: + '4c3c8a8cba2f3bb1e9e617301f85d1f68e816a01c7b716f482f2ab9adb8181fb', + }, + ], + contents: [ + { + content_id: '12', + content_name: 'Product 1', + content_type: 'physical', + content_group_id: 'group1', + }, + { + content_id: '13', + content_name: 'Product 2', + content_type: 'digital', + content_price: '0.00', + }, + ], + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: { + secret: { + consumerKey: 'qwe', + consumerSecret: 'fdghv', + accessToken: 'dummyAccessToken', + accessTokenSecret: 'testAccessTokenSecret', + }, + }, + statusCode: 200, + }, + ], + }, + }, + }, ].map((tc) => ({ ...tc, mockFns: (_) => { diff --git a/test/integrations/destinations/twitter_ads/router/data.ts b/test/integrations/destinations/twitter_ads/router/data.ts index f1fe2a10e66..900387a654b 100644 --- a/test/integrations/destinations/twitter_ads/router/data.ts +++ b/test/integrations/destinations/twitter_ads/router/data.ts @@ -127,8 +127,8 @@ export const data = [ conversions: [ { contents: [ - { content_id: '12', content_price: 123.3345, num_items: 12 }, - { content_id: '4', content_price: 200, num_items: 11 }, + { content_id: '12', content_price: '123.3345', num_items: 12 }, + { content_id: '4', content_price: '200.00', num_items: 11 }, ], conversion_id: '213123', conversion_time: '2023-06-01T06:03:08.739Z', From 3aa2290ab73db13111af0471e070fd6b03774f15 Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Mon, 17 Feb 2025 14:37:01 +0530 Subject: [PATCH 092/160] chore: now fetching docker hub token from DOCKERHUB_TOKEN instead of DOCKERHUB_PROD_TOKEN (#4081) * chore: now fetching docker hub token from DOCKERHUB_TOKEN instead of DOCKERHUB_PROD_TOKEN * chore: updated all references of DOCKERHUB_PROD_TOKEN to DOCKERHUB_TOKEN --- .github/workflows/build-pr-artifacts.yml | 4 ++-- .github/workflows/build-push-docker-image.yml | 8 ++++---- .github/workflows/prepare-for-dev-deploy.yml | 4 ++-- .github/workflows/prepare-for-prod-dt-deploy.yml | 2 +- .github/workflows/prepare-for-prod-ut-deploy.yml | 2 +- .github/workflows/prepare-for-staging-deploy.yml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-pr-artifacts.yml b/.github/workflows/build-pr-artifacts.yml index 46670fba846..9053bac5221 100644 --- a/.github/workflows/build-pr-artifacts.yml +++ b/.github/workflows/build-pr-artifacts.yml @@ -53,7 +53,7 @@ jobs: load_target: development push_target: production secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} build-user-transformer-image: name: Build User Transformer Docker Image - PR @@ -69,4 +69,4 @@ jobs: load_target: development push_target: production secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/build-push-docker-image.yml b/.github/workflows/build-push-docker-image.yml index e0571a24f87..4a4f28dfa95 100644 --- a/.github/workflows/build-push-docker-image.yml +++ b/.github/workflows/build-push-docker-image.yml @@ -33,7 +33,7 @@ on: workflow_url: type: string secrets: - DOCKERHUB_PROD_TOKEN: + DOCKERHUB_TOKEN: required: true env: @@ -101,7 +101,7 @@ jobs: uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3.7.1 @@ -154,7 +154,7 @@ jobs: uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3.7.1 @@ -202,7 +202,7 @@ jobs: uses: docker/login-action@v3.3.0 with: username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.7.1 diff --git a/.github/workflows/prepare-for-dev-deploy.yml b/.github/workflows/prepare-for-dev-deploy.yml index b5482bcddf1..853e2c47dcc 100644 --- a/.github/workflows/prepare-for-dev-deploy.yml +++ b/.github/workflows/prepare-for-dev-deploy.yml @@ -62,7 +62,7 @@ jobs: push_target: production use_merge_sha: true secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} build-user-transformer-image: name: Build User Transformer Docker Image - Dev @@ -78,4 +78,4 @@ jobs: load_target: development push_target: production secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/prepare-for-prod-dt-deploy.yml b/.github/workflows/prepare-for-prod-dt-deploy.yml index 56fda56b708..c3a9bd1a7e5 100644 --- a/.github/workflows/prepare-for-prod-dt-deploy.yml +++ b/.github/workflows/prepare-for-prod-dt-deploy.yml @@ -60,7 +60,7 @@ jobs: use_merge_sha: true skip_tests: ${{startsWith(github.event.pull_request.head.ref, 'hotfix-release/')}} secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} create-pull-request: name: Update Helm Charts For Production and Create Pull Request diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index 4c108b23d64..a2240673603 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -64,7 +64,7 @@ jobs: use_merge_sha: true skip_tests: ${{startsWith(github.event.pull_request.head.ref, 'hotfix-release/')}} secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} create-pull-request: name: Update Helm Charts For Production and Create Pull Request diff --git a/.github/workflows/prepare-for-staging-deploy.yml b/.github/workflows/prepare-for-staging-deploy.yml index cdf27f78327..ab1e39c1770 100644 --- a/.github/workflows/prepare-for-staging-deploy.yml +++ b/.github/workflows/prepare-for-staging-deploy.yml @@ -54,7 +54,7 @@ jobs: push_target: production use_merge_sha: true secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} build-user-transformer-image: name: Build User Transformer Docker Image - Staging @@ -71,7 +71,7 @@ jobs: load_target: development push_target: production secrets: - DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} create-pull-request: name: Update Helm Charts For Staging and Create Pull Request From c272267d2c46beaf37d043ab9448b9698053ecee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 15:03:43 +0530 Subject: [PATCH 093/160] chore(deps): bump koa from 2.15.3 to 2.15.4 (#4071) --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index be9e161d3ed..96393c9e4eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "json-diff": "^1.0.3", "json-size": "^1.0.0", "jsontoxml": "^1.0.1", - "koa": "^2.15.3", + "koa": "^2.15.4", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", "libphonenumber-js": "^1.11.18", @@ -16560,9 +16560,10 @@ } }, "node_modules/koa": { - "version": "2.15.3", - "resolved": "https://registry.npmjs.org/koa/-/koa-2.15.3.tgz", - "integrity": "sha512-j/8tY9j5t+GVMLeioLaxweJiKUayFhlGqNTzf2ZGwL0ZCQijd2RLHK0SLW5Tsko8YyyqCZC2cojIb0/s62qTAg==", + "version": "2.15.4", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.15.4.tgz", + "integrity": "sha512-7fNBIdrU2PEgLljXoPWoyY4r1e+ToWCmzS/wwMPbUNs7X+5MMET1ObhJBlUkF5uZG9B6QhM2zS1TsH6adegkiQ==", + "license": "MIT", "dependencies": { "accepts": "^1.3.5", "cache-content-type": "^1.0.0", diff --git a/package.json b/package.json index 1cd28a28b76..c4c6e74ff98 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "json-diff": "^1.0.3", "json-size": "^1.0.0", "jsontoxml": "^1.0.1", - "koa": "^2.15.3", + "koa": "^2.15.4", "koa-bodyparser": "^4.4.0", "koa2-swagger-ui": "^5.7.0", "libphonenumber-js": "^1.11.18", From 8ddbbe6dc0b902223d3c47483885fa8df5df16d1 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 17 Feb 2025 10:11:54 +0000 Subject: [PATCH 094/160] chore(release): 1.91.0 --- CHANGELOG.md | 16 ++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b6530b7e52..87adf7fae6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ 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.91.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.2...v1.91.0) (2025-02-17) + + +### Features + +* add support for hashed cart token as anonymousid ([#4048](https://github.com/rudderlabs/rudder-transformer/issues/4048)) ([2b350fe](https://github.com/rudderlabs/rudder-transformer/commit/2b350fe22919d99b803cb17629b30f0c83dc5f8a)) +* added drop traits in track call feature for mixpanel ([#4034](https://github.com/rudderlabs/rudder-transformer/issues/4034)) ([bdd735d](https://github.com/rudderlabs/rudder-transformer/commit/bdd735df38d92b6658250e500d13f3e4b4c7ffad)) +* **http:** add support for isDefaultMapping ([#4073](https://github.com/rudderlabs/rudder-transformer/issues/4073)) ([05553eb](https://github.com/rudderlabs/rudder-transformer/commit/05553eb5cbf3aa0afd752dca9af74e32722876ed)) + + +### Bug Fixes + +* airship array handling ([#4011](https://github.com/rudderlabs/rudder-transformer/issues/4011)) ([ce86cec](https://github.com/rudderlabs/rudder-transformer/commit/ce86cecbc0a2edbdff8878541771a2ebcf3f6dd9)) +* content_price should be a number with decimal point in twitter ads ([#4075](https://github.com/rudderlabs/rudder-transformer/issues/4075)) ([711e18b](https://github.com/rudderlabs/rudder-transformer/commit/711e18bfcec1518830076bbe7e49ba7b2f2e3757)) +* fixing wrong identifiers in payload for twitter ads destination ([#3988](https://github.com/rudderlabs/rudder-transformer/issues/3988)) ([3fdc92b](https://github.com/rudderlabs/rudder-transformer/commit/3fdc92b93869e875c50c482f890283c97611dc4f)) + ### [1.90.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.1...v1.90.2) (2025-02-11) diff --git a/package-lock.json b/package-lock.json index 96393c9e4eb..512a881f5d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.90.2", + "version": "1.91.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.90.2", + "version": "1.91.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index c4c6e74ff98..db408842e71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.90.2", + "version": "1.91.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 17ff7f96a2a911485592afb379dd2886ee8b9982 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Wed, 19 Feb 2025 11:51:09 +0530 Subject: [PATCH 095/160] fix: snapchat util function for normalizing phone number (#4093) --- src/v0/destinations/snapchat_conversion/util.js | 2 +- src/v0/destinations/snapchat_conversion/util.test.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/v0/destinations/snapchat_conversion/util.js b/src/v0/destinations/snapchat_conversion/util.js index 2a9b50e00b0..b7adaf91a5f 100644 --- a/src/v0/destinations/snapchat_conversion/util.js +++ b/src/v0/destinations/snapchat_conversion/util.js @@ -41,7 +41,7 @@ function getNormalizedPhoneNumber(message) { if (regexExp.test(phoneNumber)) return phoneNumber; // Remove leading zeros and non-numeric characters - return phoneNumber.replace(/\D/g, '').replace(/^0+/, '') || null; + return String(phoneNumber).replace(/\D/g, '').replace(/^0+/, '') || null; } function getDataUseValue(message) { diff --git a/src/v0/destinations/snapchat_conversion/util.test.js b/src/v0/destinations/snapchat_conversion/util.test.js index 835b56351bb..d886b8f981e 100644 --- a/src/v0/destinations/snapchat_conversion/util.test.js +++ b/src/v0/destinations/snapchat_conversion/util.test.js @@ -47,6 +47,16 @@ describe('Snapchat Conversion Utils', () => { input: { traits: { phone: '000' } }, expected: null, }, + { + name: 'should handle integer phone numbers', + input: { traits: { phone: 1234567890 } }, + expected: '1234567890', + }, + { + name: 'should handle object in place of phone number', + input: { traits: { phone: { test: 'test' } } }, + expected: null, + }, ]; testCases.forEach(({ name, input, expected }) => { From 412484b7831b8d766882a42459861cbd4608c949 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 19 Feb 2025 06:26:58 +0000 Subject: [PATCH 096/160] chore(release): 1.91.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87adf7fae6f..224ac1ed4a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.91.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.0...v1.91.1) (2025-02-19) + + +### Bug Fixes + +* snapchat util function for normalizing phone number ([#4093](https://github.com/rudderlabs/rudder-transformer/issues/4093)) ([17ff7f9](https://github.com/rudderlabs/rudder-transformer/commit/17ff7f96a2a911485592afb379dd2886ee8b9982)) + ## [1.91.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.90.2...v1.91.0) (2025-02-17) diff --git a/package-lock.json b/package-lock.json index 512a881f5d4..50daad40afd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.91.0", + "version": "1.91.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.91.0", + "version": "1.91.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index db408842e71..4d78bdc050d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.91.0", + "version": "1.91.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From fb5bedc47f73880fc908ccd091d83e128f077116 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:37:16 +0530 Subject: [PATCH 097/160] chore: update google ads api version from 17 to 18 (#4084) --- .../config.js | 4 +- .../config.js | 3 +- .../utils.test.js | 10 +-- .../config.js | 2 +- .../dataDelivery/business.ts | 3 +- .../dataDelivery/oauth.ts | 3 +- .../network.ts | 3 +- .../processor/data.ts | 2 +- .../router/data.ts | 8 +-- .../dataDelivery/business.ts | 28 +++----- .../dataDelivery/oauth.ts | 17 +++-- .../network.ts | 36 +++++----- .../processor/data.ts | 69 +++++++------------ .../router/data.ts | 17 ++--- .../dataDelivery/business.ts | 2 +- .../dataDelivery/oauth.ts | 3 +- .../network.ts | 2 +- .../processor/data.ts | 3 +- .../router/data.ts | 3 +- 19 files changed, 100 insertions(+), 118 deletions(-) diff --git a/src/v0/destinations/google_adwords_enhanced_conversions/config.js b/src/v0/destinations/google_adwords_enhanced_conversions/config.js index 8a3f8ab673d..8afc126749e 100644 --- a/src/v0/destinations/google_adwords_enhanced_conversions/config.js +++ b/src/v0/destinations/google_adwords_enhanced_conversions/config.js @@ -1,8 +1,8 @@ const { getMappingConfig } = require('../../util'); -const API_VERSION = 'v17'; +const API_VERSION = 'v18'; -const BASE_ENDPOINT = 'https://googleads.googleapis.com/v17/customers'; +const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers`; const CONFIG_CATEGORIES = { TRACK_CONFIG: { type: 'track', name: 'trackConfig' }, diff --git a/src/v0/destinations/google_adwords_offline_conversions/config.js b/src/v0/destinations/google_adwords_offline_conversions/config.js index ce0fc45e47e..62b56109010 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/config.js +++ b/src/v0/destinations/google_adwords_offline_conversions/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const API_VERSION = 'v17'; +const API_VERSION = 'v18'; const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers/:customerId`; @@ -65,4 +65,5 @@ module.exports = { trackAddStoreAddressConversionsMapping: MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_STORE_ADDRESS_IDENTIFIER.name], consentConfigMap, + API_VERSION, }; diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js index 59141fce3bc..f05fd291822 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js @@ -6,6 +6,8 @@ const { getCallConversionPayload, } = require('./utils'); +const API_VERSION = 'v18'; + const getTestMessage = () => { let message = { event: 'testEventName', @@ -163,7 +165,7 @@ describe('getExisitingUserIdentifier util tests', () => { describe('getClickConversionPayloadAndEndpoint util tests', () => { it('getClickConversionPayloadAndEndpoint flow check when default field identifier is present', () => { let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { @@ -193,7 +195,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { delete fittingPayload.traits.email; delete fittingPayload.properties.email; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { @@ -225,7 +227,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { delete fittingPayload.traits.phone; delete fittingPayload.properties.email; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { @@ -263,7 +265,7 @@ describe('getClickConversionPayloadAndEndpoint util tests', () => { }, ]; let expectedOutput = { - endpoint: 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, payload: { conversions: [ { diff --git a/src/v0/destinations/google_adwords_remarketing_lists/config.js b/src/v0/destinations/google_adwords_remarketing_lists/config.js index 1e943aee562..7c89b6bc357 100644 --- a/src/v0/destinations/google_adwords_remarketing_lists/config.js +++ b/src/v0/destinations/google_adwords_remarketing_lists/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const API_VERSION = 'v17'; +const API_VERSION = 'v18'; const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers`; const CONFIG_CATEGORIES = { diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts index d318066e7d4..290e8db0ce4 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts @@ -4,7 +4,8 @@ import { generateProxyV1Payload, } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; + +const API_VERSION = 'v18'; const headers = { Authorization: 'Bearer abcd1234', diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts index c6e29925dd8..d9e1a49689b 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts @@ -1,4 +1,5 @@ -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; +const API_VERSION = 'v18'; + import { generateProxyV1Payload, generateProxyV0Payload, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts index 270ec2dc77e..eeb3551cb48 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts @@ -1,4 +1,5 @@ -import { API_VERSION } from '../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; +const API_VERSION = 'v18'; + export const networkCallsData = [ { httpReq: { diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts index 1d20e887e98..c33be0d4af4 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts @@ -1,4 +1,4 @@ -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_enhanced_conversions/config'; +const API_VERSION = 'v18'; export const data = [ { name: 'google_adwords_enhanced_conversions', diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts index 5ac05b5a530..2d61da37d68 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -1,3 +1,5 @@ +const API_VERSION = 'v18'; + const events = [ { metadata: { @@ -657,8 +659,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, files: {}, headers: { Authorization: 'Bearer abcd1234', @@ -828,8 +829,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567890:uploadConversionAdjustments', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, files: {}, headers: { Authorization: 'Bearer abcd1234', diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts index 08abb008cf5..818e7a4e1c5 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts @@ -4,6 +4,8 @@ import { generateProxyV1Payload, } from '../../../testUtils'; +const API_VERSION = 'v18'; + const transactionAttribute = { CUSTOM_KEY: 'CUSTOM_VALUE', currency_code: 'INR', @@ -234,8 +236,7 @@ export const testScenariosForV0API = [ headers: headers.header1, params: params.param1, JSON: invalidArgumentRequestPayload, - endpoint: - 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs`, }), method: 'POST', }, @@ -309,7 +310,7 @@ export const testScenariosForV0API = [ headers: headers.header1, params: params.param1, JSON: validRequestPayload1, - endpoint: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, }), method: 'POST', }, @@ -349,8 +350,7 @@ export const testScenariosForV0API = [ headers: headers.header2, params: params.param2, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }), method: 'POST', }, @@ -399,8 +399,7 @@ export const testScenariosForV0API = [ headers: headers.header2, params: params.param3, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }), method: 'POST', }, @@ -452,8 +451,7 @@ export const testScenariosForV1API = [ headers: headers.header1, params: params.param1, JSON: invalidArgumentRequestPayload, - endpoint: - 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs`, }, metadataArray, ), @@ -499,8 +497,7 @@ export const testScenariosForV1API = [ headers: headers.header1, params: params.param1, JSON: validRequestPayload1, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, }, metadataArray, ), @@ -544,8 +541,7 @@ export const testScenariosForV1API = [ headers: headers.header2, params: params.param2, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }, metadataArray, ), @@ -590,8 +586,7 @@ export const testScenariosForV1API = [ headers: headers.header2, params: params.param3, JSON: validRequestPayload2, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, }, metadataArray, ), @@ -636,8 +631,7 @@ export const testScenariosForV1API = [ headers: headers.header2, params: params.param4, JSON: notAllowedToAccessFeatureRequestPayload, - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234567893:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567893:uploadClickConversions`, }, metadataArray, ), diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts index 2a79a5e3112..d774bad8697 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts @@ -4,6 +4,8 @@ import { generateProxyV0Payload, } from '../../../testUtils'; +const API_VERSION = 'v18'; + const commonHeaders = { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -95,7 +97,7 @@ export const v0oauthScenarios = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }), method: 'POST', }, @@ -138,7 +140,7 @@ export const v0oauthScenarios = [ request: { body: generateProxyV0Payload({ ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs`, }), method: 'POST', }, @@ -183,8 +185,7 @@ export const v1oauthScenarios = [ body: generateProxyV1Payload( { ...commonRequestParameters, - endpoint: - 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }, metadataArray, ), @@ -230,7 +231,7 @@ export const v1oauthScenarios = [ body: generateProxyV1Payload( { ...commonRequestParameters, - endpoint: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs`, }, metadataArray, ), @@ -281,8 +282,7 @@ export const v1oauthScenarios = [ 'developer-token': 'ijkl91011', 'login-customer-id': 'logincustomerid', }, - endpoint: - 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }, metadataArray, ), @@ -353,8 +353,7 @@ export const v1oauthScenarios = [ 'developer-token': 'ijkl91011', 'login-customer-id': 'logincustomerid', }, - endpoint: - 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, }, metadataArray, ), diff --git a/test/integrations/destinations/google_adwords_offline_conversions/network.ts b/test/integrations/destinations/google_adwords_offline_conversions/network.ts index 66856933d99..48efbbb7333 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/network.ts @@ -1,3 +1,5 @@ +const API_VERSION = 'v18'; + const commonResponse = { status: 401, data: [ @@ -30,7 +32,7 @@ const commonResponse = { export const networkCallsData = [ { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -59,7 +61,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1112223333/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`, }, @@ -92,7 +94,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/11122233331/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID_FOR_ADD_FAILURE:addOperations`, data: { enable_partial_failure: false, enable_warnings: false, @@ -173,7 +175,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -202,7 +204,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:addOperations`, data: { enable_partial_failure: false, enable_warnings: false, @@ -245,7 +247,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs/OFFLINE_USER_DATA_JOB_ID:run`, data: { validate_only: false }, params: { destination: 'google_adwords_offline_conversion' }, headers: { @@ -267,7 +269,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request with invalid authentication credentials', httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -303,7 +305,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request with invalid authentication scopes', httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -336,7 +338,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234567890/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890/googleAds:searchStream`, data: { query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`, }, @@ -364,7 +366,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234567891/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891/googleAds:searchStream`, data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", @@ -397,7 +399,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234567891/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891/googleAds:searchStream`, data: { query: 'SELECT conversion_custom_variable.name FROM conversion_custom_variable' }, headers: { Authorization: 'Bearer abcd1234', @@ -431,7 +433,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, data: { conversions: [ { @@ -498,7 +500,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234567891:uploadClickConversions', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891:uploadClickConversions`, data: { conversions: [ { @@ -559,7 +561,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234567893/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567893/googleAds:searchStream`, data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", @@ -592,7 +594,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1234567893:uploadClickConversions', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567893:uploadClickConversions`, data: { conversions: [ { @@ -678,7 +680,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs:create', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs:create`, data: { job: { storeSalesMetadata: { @@ -704,7 +706,7 @@ export const networkCallsData = [ description: 'Mock response from destination depicting a request from user who has not enabled 2 factor authentication', httpReq: { - url: 'https://googleads.googleapis.com/v17/customers/1112223333/googleAds:searchStream', + url: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/googleAds:searchStream`, data: { query: "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", diff --git a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts index 82ea4fcfcee..08906c46d7b 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts @@ -1,4 +1,7 @@ import { timestampMock } from '../mocks'; + +const API_VERSION = 'v18'; + export const data = [ { name: 'google_adwords_offline_conversions', @@ -175,8 +178,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -466,8 +468,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -757,8 +758,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -1048,8 +1048,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2022,8 +2021,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2128,8 +2126,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2352,8 +2349,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2552,8 +2548,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -2788,8 +2783,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -3011,8 +3005,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -3519,8 +3512,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -3762,8 +3754,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, files: {}, headers: { Authorization: 'Bearer abcd1234', @@ -3936,8 +3927,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4128,8 +4118,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4465,8 +4454,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4664,8 +4652,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -4866,8 +4853,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5030,8 +5016,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5190,8 +5175,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5348,8 +5332,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5503,8 +5486,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -5664,8 +5646,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1112223333/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', diff --git a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts index bb0b4c6c44b..cf632434be8 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts @@ -1,5 +1,7 @@ import { timestampMock } from '../mocks'; +const API_VERSION = 'v18'; + export const data = [ { name: 'google_adwords_offline_conversions', @@ -483,8 +485,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -565,8 +566,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/7693729833:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833:uploadCallConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -680,8 +680,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadClickConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -815,8 +814,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/9625812972:uploadCallConversions', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', @@ -1169,8 +1167,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: - 'https://googleads.googleapis.com/v17/customers/1234556775/offlineUserDataJobs', + endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234556775/offlineUserDataJobs`, headers: { Authorization: 'Bearer abcd1234', 'Content-Type': 'application/json', diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts index 9fea895a9f9..5a0ea981e29 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts @@ -4,7 +4,7 @@ import { generateProxyV1Payload, } from '../../../testUtils'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; +const API_VERSION = 'v18'; export const commonHeaders = { Authorization: 'Bearer dummy-access', diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts index e8a1cfc07e1..08b1adb1913 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts @@ -1,6 +1,7 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { commonHeaders, commonParams, validRequestPayload1 } from './business'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; + +const API_VERSION = 'v18'; const commonStatTags = { destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS', diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts index a367c18737c..f0bb8759c54 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts @@ -1,4 +1,4 @@ -import { API_VERSION } from '../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; +const API_VERSION = 'v18'; export const networkCallsData = [ { diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts b/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts index 4398bc14e16..ef9bb85430a 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts @@ -1,4 +1,5 @@ -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; +const API_VERSION = 'v18'; + export const data = [ { name: 'google_adwords_remarketing_lists', diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts b/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts index 12d5c65f8f1..1f341889378 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts @@ -4,7 +4,8 @@ import { rETLRecordRouterRequestVDMv2General, rETLRecordRouterRequestVDMv2UserId, } from './record'; -import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config'; + +const API_VERSION = 'v18'; export const data = [ { From 558eab64652da9f75ca9bc4a5484460e3a95b8e9 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:34:28 +0530 Subject: [PATCH 098/160] feat: id stitching improvement in shopify pixel transformations (#4060) * feat: add userId to web pixel events from redis if available * feat: stitching id in anonymous checkouts across checkouts (#4074) * chore: move anonymousId to userId redis setting to common util * chore: add userId enrichment for server side events * chore: address comments * chore: update ttl for cart token and userId mappings in redis * chore: address comments, add action support in identifier event * feat: add support for idenitify calls when anonymousid userId both present in ecom events (#4092) * feat: add support for idenitify calls when anonymousid userId both present * chore: update code, add test * chore: traits are inside context * chore: add stats for mapping get set operations * chore: fix codecov sonar issues --- src/util/prometheus.js | 12 + src/v1/sources/shopify/config.js | 5 + src/v1/sources/shopify/transformV1.js | 2 +- src/v1/sources/shopify/utils.js | 39 ++- src/v1/sources/shopify/utils.test.js | 120 ++++++++- .../serverSideTransform.js | 61 ++++- .../serverSideUtils.test.js | 6 +- .../webhookTransformations/serverSideUtlis.js | 10 +- .../webpixelTransformations/pixelTransform.js | 26 +- test/integrations/sources/shopify/mocks.ts | 9 +- .../pixelTestScenarios/ProductEventsTests.ts | 10 +- .../CheckoutEventsTests.ts | 228 ++++++++++++++++++ .../webhookTestScenarios/GenericTrackTests.ts | 12 +- 13 files changed, 494 insertions(+), 46 deletions(-) diff --git a/src/util/prometheus.js b/src/util/prometheus.js index 40c0b8c9048..540dc6b807d 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -463,6 +463,18 @@ class Prometheus { type: 'counter', labelNames: ['event', 'reason', 'source', 'writeKey'], }, + { + name: 'shopify_pixel_userid_mapping', + help: 'shopify_pixel_userid_mapping', + type: 'counter', + labelNames: ['action', 'operation'], + }, + { + name: 'shopify_pixel_cart_token_mapping', + help: 'shopify_pixel_cart_token_mapping', + type: 'counter', + labelNames: ['action', 'operation'], + }, { name: 'outgoing_request_count', help: 'Outgoing HTTP requests count', diff --git a/src/v1/sources/shopify/config.js b/src/v1/sources/shopify/config.js index 20db7be331e..f39a3e3cd19 100644 --- a/src/v1/sources/shopify/config.js +++ b/src/v1/sources/shopify/config.js @@ -79,6 +79,10 @@ const checkoutStartedCompletedEventMappingJSON = JSON.parse( ), ); +const identifyMappingJSON = JSON.parse( + fs.readFileSync(path.resolve(__dirname, 'webhookEventsMapping', 'identifyMapping.json')), +); + const productMappingJSON = JSON.parse( fs.readFileSync(path.resolve(__dirname, 'webhookEventsMapping', 'productMapping.json')), ); @@ -114,4 +118,5 @@ module.exports = { pixelEventToCartTokenLocationMapping, productMappingJSON, lineItemsMappingJSON, + identifyMappingJSON, }; diff --git a/src/v1/sources/shopify/transformV1.js b/src/v1/sources/shopify/transformV1.js index b3e01d95c67..bf8f6d7241c 100644 --- a/src/v1/sources/shopify/transformV1.js +++ b/src/v1/sources/shopify/transformV1.js @@ -17,7 +17,7 @@ const processV1Events = async (event) => { return processIdentifierEvent(event); } // handle events from the app pixel. - const pixelWebEventResponse = processPixelWebEvents(event); + const pixelWebEventResponse = await processPixelWebEvents(event); return pixelWebEventResponse; } if (isServerSideEvent) { diff --git a/src/v1/sources/shopify/utils.js b/src/v1/sources/shopify/utils.js index 9502b2ee595..4a63e780759 100644 --- a/src/v1/sources/shopify/utils.js +++ b/src/v1/sources/shopify/utils.js @@ -1,4 +1,5 @@ const { RedisDB } = require('../../../util/redis/redisConnector'); +const stats = require('../../../util/stats'); const NO_OPERATION_SUCCESS = { outputToSource: { @@ -8,11 +9,44 @@ const NO_OPERATION_SUCCESS = { statusCode: 200, }; +/** + * Updates the anonymousId to userId mapping in Redis + * @param {String} anonymousId + * @param {String} userId + */ +const updateAnonymousIdToUserIdInRedis = async (anonymousId, userId) => { + if (anonymousId && userId) { + // set the anonymousId to userId mapping in Redis for 24 hours + await RedisDB.setVal(`pixel:${anonymousId}`, ['userId', userId], 86400).then(() => { + stats.increment('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'set', + }); + }); + } +}; + const isIdentifierEvent = (payload) => ['rudderIdentifier'].includes(payload?.event); +/** + * Sets the cartToken <-> anonymousId mapping or anonymousId <-> userId mapping in Redis based on the event action + * @param {Object} event + * @returns {Object} NO_OPERATION_SUCCESS + */ const processIdentifierEvent = async (event) => { - const { cartToken, anonymousId } = event; - await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', anonymousId]); + const { cartToken, anonymousId, userId, action } = event; + if (cartToken && anonymousId && action === 'stitchCartTokenToAnonId') { + // set the cartToken to anonymousId mapping in Redis for 12 hours + await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', anonymousId], 43200).then(() => { + stats.increment('shopify_pixel_cart_token_mapping', { + action: 'stitchCartTokenToAnonId', + operation: 'set', + }); + }); + } + if (action === 'stitchUserIdToAnonId') { + updateAnonymousIdToUserIdInRedis(anonymousId, userId); + } return NO_OPERATION_SUCCESS; }; @@ -31,4 +65,5 @@ module.exports = { processIdentifierEvent, isIdentifierEvent, isShopifyV1Event, + updateAnonymousIdToUserIdInRedis, }; diff --git a/src/v1/sources/shopify/utils.test.js b/src/v1/sources/shopify/utils.test.js index 558cdec7c52..2945b69e870 100644 --- a/src/v1/sources/shopify/utils.test.js +++ b/src/v1/sources/shopify/utils.test.js @@ -1,5 +1,14 @@ -const { isIdentifierEvent, processIdentifierEvent } = require('./utils'); +const { + isIdentifierEvent, + processIdentifierEvent, + updateAnonymousIdToUserIdInRedis, +} = require('./utils'); const { RedisDB } = require('../../../util/redis/redisConnector'); +const stats = require('../../../util/stats'); + +jest.mock('../../../util/stats', () => ({ + increment: jest.fn(), +})); describe('Identifier Utils Tests', () => { describe('test isIdentifierEvent', () => { @@ -19,16 +28,25 @@ describe('Identifier Utils Tests', () => { jest.clearAllMocks(); }); - it('should set the anonymousId in redis and return NO_OPERATION_SUCCESS', async () => { + it('should set the cartToken mapping in redis and increment stats', async () => { const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); - const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; + const event = { + cartToken: 'cartTokenTest1', + anonymousId: 'anonymousIdTest1', + action: 'stitchCartTokenToAnonId', + }; const response = await processIdentifierEvent(event); - expect(setValSpy).toHaveBeenCalledWith('pixel:cartTokenTest1', [ - 'anonymousId', - 'anonymousIdTest1', - ]); + expect(setValSpy).toHaveBeenCalledWith( + 'pixel:cartTokenTest1', + ['anonymousId', 'anonymousIdTest1'], + 43200, + ); + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_cart_token_mapping', { + action: 'stitchCartTokenToAnonId', + operation: 'set', + }); expect(response).toEqual({ outputToSource: { body: Buffer.from('OK').toString('base64'), @@ -38,11 +56,93 @@ describe('Identifier Utils Tests', () => { }); }); - it('should handle redis errors', async () => { - jest.spyOn(RedisDB, 'setVal').mockRejectedValue(new Error('Redis connection failed')); - const event = { cartToken: 'cartTokenTest1', anonymousId: 'anonymousIdTest1' }; + it('should update the anonymousId to userId mapping in redis and increment stats', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { + anonymousId: 'anonymousIdTest1', + userId: 'userIdTest1', + action: 'stitchUserIdToAnonId', + }; + + const response = await processIdentifierEvent(event); + + expect(setValSpy).toHaveBeenCalled(); + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'set', + }); + expect(response).toEqual({ + outputToSource: { + body: Buffer.from('OK').toString('base64'), + contentType: 'text/plain', + }, + statusCode: 200, + }); + }); + + it('should handle redis errors and increment error stats', async () => { + const error = new Error('Redis connection failed'); + jest.spyOn(RedisDB, 'setVal').mockRejectedValue(error); + const event = { + cartToken: 'cartTokenTest1', + anonymousId: 'anonymousIdTest1', + action: 'stitchCartTokenToAnonId', + }; await expect(processIdentifierEvent(event)).rejects.toThrow('Redis connection failed'); + expect(stats.increment).not.toHaveBeenCalled(); + }); + }); + + describe('test updateAnonymousIdToUserIdInRedis', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should update the anonymousId to userId in redis and increment stats', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { + anonymousId: 'anonymousTest1', + userId: 'userIdTest1', + }; + + await updateAnonymousIdToUserIdInRedis(event.anonymousId, event.userId); + + expect(setValSpy).toHaveBeenCalledWith( + 'pixel:anonymousTest1', + ['userId', 'userIdTest1'], + 86400, + ); + expect(stats.increment).toHaveBeenCalledWith('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'set', + }); + }); + + it('should handle redis errors in updateAnonymousIdToUserIdInRedis', async () => { + const error = new Error('Redis connection failed'); + jest.spyOn(RedisDB, 'setVal').mockRejectedValue(error); + const event = { + anonymousId: 'anonymousTest1', + userId: 'userIdTest1', + }; + + await expect( + updateAnonymousIdToUserIdInRedis(event.anonymousId, event.userId), + ).rejects.toThrow('Redis connection failed'); + expect(stats.increment).not.toHaveBeenCalled(); + }); + + it('should handle null values and not call Redis or stats', async () => { + const setValSpy = jest.spyOn(RedisDB, 'setVal').mockResolvedValue('OK'); + const event = { + anonymousId: null, + userId: null, + }; + + await updateAnonymousIdToUserIdInRedis(event.anonymousId, event.userId); + expect(setValSpy).not.toHaveBeenCalled(); + expect(stats.increment).not.toHaveBeenCalled(); }); }); }); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 6d893a0c040..08a64bba0f9 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -1,18 +1,17 @@ const lodash = require('lodash'); const get = require('get-value'); +const { isDefinedNotNullNotEmpty } = require('@rudderstack/integrations-lib'); const stats = require('../../../../util/stats'); const { getShopifyTopic } = require('../../../../v0/sources/shopify/util'); const { removeUndefinedAndNullValues } = require('../../../../v0/util'); const Message = require('../../../../v0/sources/message'); const { EventType } = require('../../../../constants'); const { - INTEGERATION, - MAPPING_CATEGORIES, IDENTIFY_TOPICS, SUPPORTED_TRACK_EVENTS, SHOPIFY_TRACK_MAP, - lineItemsMappingJSON, } = require('../../../../v0/sources/shopify/config'); +const { INTEGERATION, identifyMappingJSON, lineItemsMappingJSON } = require('../config'); const { ECOM_TOPICS, RUDDER_ECOM_MAP } = require('../config'); const { createPropertiesForEcomEventFromWebhook, @@ -21,6 +20,8 @@ const { handleCommonProperties, addCartTokenHashToTraits, } = require('./serverSideUtlis'); +const { updateAnonymousIdToUserIdInRedis } = require('../utils'); +const { RedisDB } = require('../../../../util/redis/redisConnector'); const NO_OPERATION_SUCCESS = { outputToSource: { @@ -33,7 +34,7 @@ const NO_OPERATION_SUCCESS = { const identifyPayloadBuilder = (event) => { const message = new Message(INTEGERATION); message.setEventType(EventType.IDENTIFY); - message.setPropertiesV2(event, MAPPING_CATEGORIES[EventType.IDENTIFY]); + message.setPropertiesV2(event, identifyMappingJSON); if (event.updated_at) { // converting shopify updated_at timestamp to rudder timestamp format message.setTimestamp(new Date(event.updated_at).toISOString()); @@ -51,14 +52,11 @@ const ecomPayloadBuilder = (event, shopifyTopic) => { // Map Customer details if present const customerDetails = get(event, 'customer'); if (customerDetails) { - message.setPropertiesV2(customerDetails, MAPPING_CATEGORIES[EventType.IDENTIFY]); + message.setPropertiesV2(customerDetails, identifyMappingJSON); } if (event.updated_at) { message.setTimestamp(new Date(event.updated_at).toISOString()); } - if (event.customer) { - message.setPropertiesV2(event.customer, MAPPING_CATEGORIES[EventType.IDENTIFY]); - } if (event.shipping_address) { message.setProperty('traits.shippingAddress', event.shipping_address); } @@ -79,6 +77,32 @@ const trackPayloadBuilder = (event, shopifyTopic) => { return message; }; +/** + * Creates an identify event with userId and anonymousId from message object and identifyMappingJSON + * @param {String} message + * @returns {Message} identifyEvent + */ +const createIdentifyEvent = (message) => { + const { userId, anonymousId, traits } = message; + const identifyEvent = new Message(INTEGERATION); + identifyEvent.setEventType(EventType.IDENTIFY); + identifyEvent.userId = userId; + identifyEvent.anonymousId = anonymousId; + const mappedTraits = {}; + identifyMappingJSON.forEach((mapping) => { + if (mapping.destKeys.startsWith('traits.')) { + const traitKey = mapping.destKeys.replace('traits.', ''); + const sourceValue = get(traits, traitKey); + if (sourceValue !== undefined) { + lodash.set(mappedTraits, traitKey, sourceValue); + } + } + }); + // Set the mapped traits + identifyEvent.context.traits = removeUndefinedAndNullValues(mappedTraits); + return identifyEvent; +}; + const processEvent = async (inputEvent, metricMetadata) => { let message; const event = lodash.cloneDeep(inputEvent); @@ -111,12 +135,31 @@ const processEvent = async (inputEvent, metricMetadata) => { // attach anonymousId if the event is track event using note_attributes if (message.type !== EventType.IDENTIFY) { await setAnonymousId(message, event, metricMetadata); + await updateAnonymousIdToUserIdInRedis(message.anonymousId, message.userId); } - // attach userId, email and other contextual properties + // attach email and other contextual properties message = handleCommonProperties(message, event, shopifyTopic); // add cart_token_hash to traits if cart_token is present message = addCartTokenHashToTraits(message, event); + const redisData = await RedisDB.getVal(`pixel:${message.anonymousId}`); + if (isDefinedNotNullNotEmpty(redisData)) { + message.userId = redisData.userId; + stats.increment('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'get', + }); + } + if (message.userId) { + message.userId = String(message.userId); + } message = removeUndefinedAndNullValues(message); + + // if the message payload contains both anonymousId and userId, hence the user is identified + // then create an identify event by multiplexing the original event and return both the message and identify event + if (message.anonymousId && message.userId) { + const identifyEvent = createIdentifyEvent(message); + return [message, identifyEvent]; + } return message; }; const processWebhookEvents = async (event) => { diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index ad0902bbee5..197d10aad34 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -12,7 +12,6 @@ const stats = require('../../../../util/stats'); const { lineItemsMappingJSON } = require('../../../../v0/sources/shopify/config'); const Message = require('../../../../v0/sources/message'); -const { property } = require('lodash'); jest.mock('../../../../v0/sources/message'); jest.mock('../../../../util/stats', () => ({ increment: jest.fn(), @@ -185,6 +184,9 @@ describe('Redis cart token tests', () => { .mockResolvedValue({ anonymousId: 'anonymousIdTest1' }); const event = { cart_token: `cartTokenTest1`, + customer: { + id: 'customer-id-001', + }, id: 5778367414385, line_items: [ { @@ -198,7 +200,7 @@ describe('Redis cart token tests', () => { }, }; const message = await processEvent(event); - expect(getValSpy).toHaveBeenCalledTimes(1); + expect(getValSpy).toHaveBeenCalledTimes(2); expect(getValSpy).toHaveBeenCalledWith('pixel:cartTokenTest1'); expect(message.anonymousId).toEqual('anonymousIdTest1'); }); diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js index e6da784b455..8a9ec2ba05e 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtlis.js @@ -6,6 +6,7 @@ const { constructPayload } = require('../../../../v0/util'); const { INTEGERATION, lineItemsMappingJSON, productMappingJSON } = require('../config'); const { RedisDB } = require('../../../../util/redis/redisConnector'); const stats = require('../../../../util/stats'); + /** * Returns an array of products from the lineItems array received from the webhook event * @param {Array} lineItems @@ -101,6 +102,10 @@ const setAnonymousId = async (message, event, metricMetadata) => { const redisData = await RedisDB.getVal(`pixel:${cartToken}`); if (redisData?.anonymousId) { message.anonymousId = redisData.anonymousId; + stats.increment('shopify_pixel_cart_token_mapping', { + action: 'stitchCartTokenToAnonId', + operation: 'get', + }); } else { // if anonymousId is not present in note_attributes or redis, generate a new anonymousId // the anonymousId will be generated by hashing the cart_token using uuidv5 @@ -124,15 +129,12 @@ const setAnonymousId = async (message, event, metricMetadata) => { }; /** - Handles userId, email and contextual properties enrichment for the message payload + Handles email and contextual properties enrichment for the message payload * @param {Object} message rudderstack message object * @param {Object} event raw shopify event payload * @param {String} shopifyTopic shopify event topic */ const handleCommonProperties = (message, event, shopifyTopic) => { - if (message.userId) { - message.userId = String(message.userId); - } if (!get(message, 'traits.email')) { const email = extractEmailFromPayload(event); if (email) { diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js index 44928686f83..80f2fb10e23 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelTransform.js @@ -70,7 +70,7 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { const cartToken = extractCartToken(inputEvent); try { if (isDefinedNotNullNotEmpty(clientId) && isDefinedNotNullNotEmpty(cartToken)) { - await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', clientId]); + await RedisDB.setVal(`pixel:${cartToken}`, ['anonymousId', clientId], 43200); stats.increment('shopify_pixel_cart_token_set', { event: inputEvent.name, writeKey: inputEvent.query_parameters.writeKey, @@ -85,16 +85,13 @@ const handleCartTokenRedisOperations = async (inputEvent, clientId) => { } }; -function processPixelEvent(inputEvent) { +async function processPixelEvent(inputEvent) { // eslint-disable-next-line @typescript-eslint/naming-convention - const { name, query_parameters, context, clientId, data, id } = inputEvent; + const { name, query_parameters, context, clientId, id } = inputEvent; const shopifyDetails = { ...inputEvent }; delete shopifyDetails.context; delete shopifyDetails.query_parameters; delete shopifyDetails.pixelEventLabel; - const { checkout } = data ?? {}; - const { order } = checkout ?? {}; - const { customer } = order ?? {}; let message = {}; switch (name) { case PIXEL_EVENT_TOPICS.PAGE_VIEWED: @@ -116,7 +113,6 @@ function processPixelEvent(inputEvent) { break; case PIXEL_EVENT_TOPICS.CHECKOUT_STARTED: case PIXEL_EVENT_TOPICS.CHECKOUT_COMPLETED: - if (customer.id) message.userId = customer.id || ''; handleCartTokenRedisOperations(inputEvent, clientId); message = checkoutEventBuilder(inputEvent); break; @@ -124,7 +120,6 @@ function processPixelEvent(inputEvent) { case PIXEL_EVENT_TOPICS.CHECKOUT_CONTACT_INFO_SUBMITTED: case PIXEL_EVENT_TOPICS.CHECKOUT_SHIPPING_INFO_SUBMITTED: case PIXEL_EVENT_TOPICS.PAYMENT_INFO_SUBMITTED: - if (customer.id) message.userId = customer.id || ''; handleCartTokenRedisOperations(inputEvent, clientId); message = checkoutStepEventBuilder(inputEvent); break; @@ -161,12 +156,23 @@ function processPixelEvent(inputEvent) { message.context.campaign = campaignParams; } message.messageId = id; + + // attach userId to the message if anonymousId is present in Redis + // this allows stitching of events from the same user across multiple checkouts + const redisData = await RedisDB.getVal(`pixel:${message.anonymousId}`); + if (isDefinedNotNullNotEmpty(redisData)) { + message.userId = redisData.userId; + stats.increment('shopify_pixel_userid_mapping', { + action: 'stitchUserIdToAnonId', + operation: 'get', + }); + } message = removeUndefinedAndNullValues(message); return message; } -const processPixelWebEvents = (event) => { - const pixelEvent = processPixelEvent(event); +const processPixelWebEvents = async (event) => { + const pixelEvent = await processPixelEvent(event); return removeUndefinedAndNullValues(pixelEvent); }; diff --git a/test/integrations/sources/shopify/mocks.ts b/test/integrations/sources/shopify/mocks.ts index 9a3fe2f989b..929d6e17fd3 100644 --- a/test/integrations/sources/shopify/mocks.ts +++ b/test/integrations/sources/shopify/mocks.ts @@ -3,5 +3,12 @@ import { RedisDB } from '../../../../src/util/redis/redisConnector'; export const mockFns = (_) => { jest.spyOn(utils, 'generateUUID').mockReturnValue('5d3e2cb6-4011-5c9c-b7ee-11bc1e905097'); - jest.spyOn(RedisDB, 'getVal').mockResolvedValue({}); + jest.spyOn(RedisDB, 'getVal').mockImplementation((key) => { + if (key === 'pixel:c7b3f99b-4d34-463b-835f-c879482a7750') { + return Promise.resolve({ userId: 'test-user-id' }); + } + return Promise.resolve({}); + }); + // Mock setVal to track anonymousId to userId mapping + jest.spyOn(RedisDB, 'setVal').mockReturnValue(Promise.resolve()); }; diff --git a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts index 7427ea5ae76..1e9797bd8d8 100644 --- a/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts +++ b/test/integrations/sources/shopify/pixelTestScenarios/ProductEventsTests.ts @@ -1,4 +1,5 @@ // This file contains the test scenarios related to Shopify pixel events, emitted from web pixel on the browser. +import { mockFns } from '../mocks'; import { dummyContext, dummyContextwithCampaign, @@ -76,6 +77,7 @@ export const pixelEventsTestScenarios = [ }, name: 'Page View', type: 'page', + userId: 'test-user-id', properties: {}, anonymousId: 'c7b3f99b-4d34-463b-835f-c879482a7750', messageId: 'sh-f6b6f548-5FEF-4DAE-9CAB-39EE6F94E09B', @@ -191,6 +193,7 @@ export const pixelEventsTestScenarios = [ }, }, type: 'track', + userId: 'test-user-id', event: 'Product Viewed', properties: { product_id: '7234590834801', @@ -360,6 +363,7 @@ export const pixelEventsTestScenarios = [ }, }, type: 'track', + userId: 'test-user-id', event: 'Cart Viewed', properties: { products: [ @@ -590,6 +594,7 @@ export const pixelEventsTestScenarios = [ }, }, type: 'track', + userId: 'test-user-id', event: 'Product List Viewed', properties: { cart_id: 'c7b3f99b-4d34-463b-835f-c879482a7750', @@ -765,6 +770,7 @@ export const pixelEventsTestScenarios = [ }, }, type: 'track', + userId: 'test-user-id', event: 'Product Added', properties: { image_url: @@ -911,6 +917,7 @@ export const pixelEventsTestScenarios = [ }, }, type: 'track', + userId: 'test-user-id', event: 'Product Removed', properties: { image_url: @@ -1005,6 +1012,7 @@ export const pixelEventsTestScenarios = [ }, }, type: 'track', + userId: 'test-user-id', event: 'Search Submitted', properties: { query: 'skate', @@ -1070,4 +1078,4 @@ export const pixelEventsTestScenarios = [ }, }, }, -]; +].map((p1) => ({ ...p1, mockFns })); diff --git a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts index 19e66f450a5..76b3fb76141 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts @@ -606,6 +606,73 @@ export const checkoutEventsTestScenarios = [ type: 'track', userId: '7188389789809', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + acceptsMarketing: false, + address: { + address1: 'oakwood bridge', + address2: 'Hedgetown', + city: 'KLF', + company: null, + country: 'United States', + country_code: 'US', + country_name: 'United States', + customer_id: 7188389789809, + default: true, + first_name: 'testuser', + id: null, + last_name: 'dummy', + name: 'testuser dummy', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85003', + }, + adminGraphqlApiId: 'gid://shopify/Customer/7188389789809', + currency: 'USD', + email: 'testuser101@gmail.com', + firstName: 'testuser', + lastName: 'dummy', + orderCount: 0, + shippingAddress: { + address1: 'oakwood bridge', + address2: 'Hedgetown', + city: 'KLF', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'testuser', + last_name: 'dummy', + latitude: null, + longitude: null, + name: 'testuser dummy', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85003', + }, + state: 'disabled', + tags: '', + taxExempt: false, + totalSpent: '0.00', + verifiedEmail: true, + }, + }, + integrations: { + SHOPIFY: false, + }, + type: 'identify', + userId: '7188389789809', + }, ], }, }, @@ -1302,6 +1369,88 @@ export const checkoutEventsTestScenarios = [ timestamp: '2024-11-06T02:54:50.000Z', anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + country_name: 'United States', + customer_id: 7358220173425, + default: true, + first_name: 'henry', + id: 8715246862449, + last_name: 'waffles', + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + adminGraphqlApiId: 'gid://shopify/Customer/7358220173425', + billingAddress: { + address1: 'Yuma Proving Ground', + address2: 'suite 001', + city: 'Yuma Proving Ground', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'yodi', + last_name: 'waffles', + latitude: 33.0177811, + longitude: -114.2525392, + name: 'yodi waffles', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85365', + }, + currency: 'USD', + email: 'henry@wfls.com', + firstName: 'yodi', + lastName: 'waffles', + shippingAddress: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'henry', + last_name: 'waffles', + latitude: 36.3528845, + longitude: -82.4006335, + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + state: 'disabled', + tags: '', + taxExempt: false, + taxExemptions: [], + verifiedEmail: true, + }, + }, + integrations: { + SHOPIFY: false, + }, + type: 'identify', + userId: '7358220173425', + }, ], }, }, @@ -1696,6 +1845,85 @@ export const checkoutEventsTestScenarios = [ timestamp: '2024-11-06T02:54:50.000Z', anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + country_name: 'United States', + customer_id: 7358220173425, + default: true, + first_name: 'henry', + id: 8715246862449, + last_name: 'waffles', + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + adminGraphqlApiId: 'gid://shopify/Customer/7358220173425', + billingAddress: { + address1: 'Yuma Proving Ground', + address2: 'suite 001', + city: 'Yuma Proving Ground', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'yodi', + last_name: 'waffles', + latitude: 33.0177811, + longitude: -114.2525392, + name: 'yodi waffles', + phone: null, + province: 'Arizona', + province_code: 'AZ', + zip: '85365', + }, + currency: 'USD', + email: 'henry@wfls.com', + firstName: 'yodi', + lastName: 'waffles', + shippingAddress: { + address1: 'Yuimaru Kitchen', + address2: '6', + city: 'Johnson City', + company: null, + country: 'United States', + country_code: 'US', + first_name: 'henry', + last_name: 'waffles', + latitude: 36.3528845, + longitude: -82.4006335, + name: 'henry waffles', + phone: null, + province: 'Tennessee', + province_code: 'TN', + zip: '37604', + }, + state: 'disabled', + taxExemptions: [], + }, + }, + integrations: { + SHOPIFY: false, + }, + type: 'identify', + userId: '7358220173425', + }, ], }, }, diff --git a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts index 8385122b222..e4080d9ac8c 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts @@ -260,7 +260,7 @@ export const genericTrackTestScenarios = [ gift_card: false, grams: 0, name: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, price_set: { shop_money: { amount: '600.00', @@ -272,7 +272,7 @@ export const genericTrackTestScenarios = [ }, }, product_exists: true, - product_id: 7234590408817, + product_id: '7234590408817', properties: [], quantity: 1, requires_shipping: true, @@ -474,7 +474,7 @@ export const genericTrackTestScenarios = [ gift_card: false, grams: 0, name: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, price_set: { shop_money: { amount: '600.00', @@ -486,7 +486,7 @@ export const genericTrackTestScenarios = [ }, }, product_exists: true, - product_id: 7234590408817, + product_id: '7234590408817', properties: [], quantity: 1, requires_shipping: true, @@ -546,9 +546,9 @@ export const genericTrackTestScenarios = [ properties: { products: [ { - product_id: 7234590408817, + product_id: '7234590408817', title: 'The Collection Snowboard: Hydrogen', - price: '600.00', + price: 600, brand: 'Hydrogen Vendor', quantity: 1, }, From d9eb0c5da16eccedac8d1b9bf524ef8bd6569fa4 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:21:36 +0530 Subject: [PATCH 099/160] fix: mixpanel ios property mapping ios_app_release and ios_app_version (#4072) --- src/v0/destinations/mp/data/MPProfilePropertiesIOS.json | 4 ++-- src/v0/destinations/mp/util.test.js | 8 ++++---- test/integrations/destinations/mp/processor/data.ts | 6 +++--- test/integrations/destinations/mp/router/data.ts | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json b/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json index 7220ebda231..0ffffdefc19 100644 --- a/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json +++ b/src/v0/destinations/mp/data/MPProfilePropertiesIOS.json @@ -12,11 +12,11 @@ "destKey": "$ios_version" }, { - "sourceKeys": "context.app.build", + "sourceKeys": "context.app.version", "destKey": "$ios_app_release" }, { - "sourceKeys": "context.app.version", + "sourceKeys": "context.app.build", "destKey": "$ios_app_version" }, { diff --git a/src/v0/destinations/mp/util.test.js b/src/v0/destinations/mp/util.test.js index 4813b1fe1ff..f749e0fc177 100644 --- a/src/v0/destinations/mp/util.test.js +++ b/src/v0/destinations/mp/util.test.js @@ -528,8 +528,8 @@ describe('Unit test cases for getTransformedJSON', () => { $os: 'iOS', $ios_device_model: 'Android SDK built for x86', $ios_version: '8.1.0', - $ios_app_release: '1', - $ios_app_version: '1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', }; expect(result).toEqual(expectedResult); @@ -611,8 +611,8 @@ describe('Unit test cases for getTransformedJSON', () => { $os: 'iOS', $ios_device_model: 'Android SDK built for x86', $ios_version: '8.1.0', - $ios_app_release: '1', - $ios_app_version: '1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', }; expect(result).toEqual(expectedResult); diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index 064b25520a9..8023f60fa26 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -2252,7 +2252,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', }, XML: {}, FORM: {}, @@ -2565,7 +2565,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","createdat":"2020-01-23T08:54:02.362Z","$ios_devices":["test_device_token"],"$ios_device_model":"Android SDK built for x86","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","createdat":"2020-01-23T08:54:02.362Z","$ios_devices":["test_device_token"],"$ios_device_model":"Android SDK built for x86","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', }, XML: {}, FORM: {}, @@ -5798,7 +5798,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/mp/router/data.ts b/test/integrations/destinations/mp/router/data.ts index 67f4d006c28..c7b30a32b8f 100644 --- a/test/integrations/destinations/mp/router/data.ts +++ b/test/integrations/destinations/mp/router/data.ts @@ -563,7 +563,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', }, XML: {}, FORM: {}, @@ -1285,7 +1285,7 @@ export const data = [ JSON: {}, JSON_ARRAY: { batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1","$ios_app_version":"1.0"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', }, XML: {}, FORM: {}, From 7d61ef3a64c02dbca071c1d8263104f42c59342e Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 21 Feb 2025 10:27:16 +0530 Subject: [PATCH 100/160] chore: update linkedin ads api version to latest 202502 --- src/cdk/v2/destinations/linkedin_ads/config.js | 2 +- .../destinations/linkedin_ads/dataDelivery/business.ts | 2 +- .../destinations/linkedin_ads/dataDelivery/oauth.ts | 2 +- test/integrations/destinations/linkedin_ads/network.ts | 2 +- .../linkedin_ads/processor/configLevelFeaturesTestData.ts | 2 +- .../destinations/linkedin_ads/processor/trackTestData.ts | 2 +- .../destinations/linkedin_ads/processor/validationTestData.ts | 2 +- test/integrations/destinations/linkedin_ads/router/data.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cdk/v2/destinations/linkedin_ads/config.js b/src/cdk/v2/destinations/linkedin_ads/config.js index 344980e7d0d..5fe93c46f8c 100644 --- a/src/cdk/v2/destinations/linkedin_ads/config.js +++ b/src/cdk/v2/destinations/linkedin_ads/config.js @@ -3,7 +3,7 @@ const { getMappingConfig } = require('../../../../v0/util'); // ref : https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/conversions-api?view=li-lms-2024-02&tabs=http#adding-multiple-conversion-events-in-a-batch const BATCH_ENDPOINT = 'https://api.linkedin.com/rest/conversionEvents'; const API_HEADER_METHOD = 'BATCH_CREATE'; -const API_VERSION = '202402'; // yyyymm format +const API_VERSION = '202502'; // yyyymm format const API_PROTOCOL_VERSION = '2.0.0'; const CONFIG_CATEGORIES = { diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts index ff4fa4455f6..8614eb322ec 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts @@ -82,7 +82,7 @@ export const metadata = { export const headerBlockWithCorrectAccessToken = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202502', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts index 5cc643d9723..be8d32fbb4e 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts @@ -49,7 +49,7 @@ export const metadata = { export const headerBlockWithCorrectAccessToken = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202502', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/network.ts b/test/integrations/destinations/linkedin_ads/network.ts index 890ad485895..65bf69e54f4 100644 --- a/test/integrations/destinations/linkedin_ads/network.ts +++ b/test/integrations/destinations/linkedin_ads/network.ts @@ -1,7 +1,7 @@ export const headerBlockWithCorrectAccessToken = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202502', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts index 19e34e6549e..be46d95beeb 100644 --- a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts @@ -57,7 +57,7 @@ const commonTimestamp = new Date('2023-10-14'); const commonHeader = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202502', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts index f8fd0a46395..06028aaaf9a 100644 --- a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts @@ -115,7 +115,7 @@ const commonStatTags = { const commonHeader = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202502', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts index e93da3e2059..12a00309b5f 100644 --- a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts @@ -78,7 +78,7 @@ const commonStats = { const commonHeader = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202502', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/router/data.ts b/test/integrations/destinations/linkedin_ads/router/data.ts index 16abc0cd060..6614536d163 100644 --- a/test/integrations/destinations/linkedin_ads/router/data.ts +++ b/test/integrations/destinations/linkedin_ads/router/data.ts @@ -419,7 +419,7 @@ export const data = [ 'Content-Type': 'application/json', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', - 'LinkedIn-Version': '202402', + 'LinkedIn-Version': '202502', Authorization: 'Bearer dummyToken', }, params: {}, From c1d3100cc6e54743ddacfe93e176808afddbd5b5 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 17 Feb 2025 13:14:07 +0530 Subject: [PATCH 101/160] chore: modify all test cases to use v2 spec --- test/integrations/sources/appcenter/data.ts | 179 +- test/integrations/sources/appsflyer/data.ts | 1985 +++++++++-------- test/integrations/sources/auth0/data.ts | 1315 ++++++----- test/integrations/sources/braze/data.ts | 792 +++---- test/integrations/sources/canny/data.ts | 1422 ++++++------ test/integrations/sources/close_crm/data.ts | 333 ++- test/integrations/sources/cordial/data.ts | 523 ++--- test/integrations/sources/customerio/data.ts | 731 +++--- test/integrations/sources/formsort/data.ts | 58 +- test/integrations/sources/gainsightpx/data.ts | 1759 ++++++++------- test/integrations/sources/iterable/data.ts | 1225 +++++----- test/integrations/sources/mailjet/data.ts | 233 +- test/integrations/sources/mailmodo/data.ts | 330 ++- test/integrations/sources/moengage/data.ts | 625 +++--- test/integrations/sources/monday/data.ts | 244 +- test/integrations/sources/olark/data.ts | 239 +- test/integrations/sources/ortto/data.ts | 332 ++- test/integrations/sources/pagerduty/data.ts | 511 +++-- test/integrations/sources/pipedream/data.ts | 193 +- test/integrations/sources/refiner/data.ts | 424 ++-- test/integrations/sources/revenuecat/data.ts | 312 ++- test/integrations/sources/satismeter/data.ts | 376 ++-- test/integrations/sources/segment/data.ts | 180 +- test/integrations/sources/signl4/data.ts | 280 ++- test/integrations/sources/slack/data.ts | 229 +- 25 files changed, 7817 insertions(+), 7013 deletions(-) diff --git a/test/integrations/sources/appcenter/data.ts b/test/integrations/sources/appcenter/data.ts index 0342b622d2a..79f1b8ef7b4 100644 --- a/test/integrations/sources/appcenter/data.ts +++ b/test/integrations/sources/appcenter/data.ts @@ -5,14 +5,19 @@ export const data = [ name: 'appcenter', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - text: 'Hello from your abc-test app in App Center!', - sent_at: '2023-01-02T07: 53: 28.3117824Z', - url: 'https://appcenter.ms/users/abc-rudderstack.com/apps/abc-test', + request: { + body: JSON.stringify({ + text: 'Hello from your abc-test app in App Center!', + sent_at: '2023-01-02T07: 53: 28.3117824Z', + url: 'https://appcenter.ms/users/abc-rudderstack.com/apps/abc-test', + }), + }, + source: {}, }, ], method: 'POST', @@ -39,26 +44,31 @@ export const data = [ name: 'appcenter', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - app_name: 'MSAppCenterTesting', - branch: 'master', - build_status: 'Succeeded', - build_id: '1', - build_link: - 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1', - build_reason: 'manual', - finish_time: '2021-03-02T16:41:29.891411Z', - icon_link: null, - notification_settings_link: - 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', - os: 'Android', - start_time: '2021-03-02T16:34:13.9184874Z', - source_version: '7ed5c7b279316f19e9a0c45bb0fb49c0655471af', - sent_at: '2021-03-02T16:41:55.8819564Z', + request: { + body: JSON.stringify({ + app_name: 'MSAppCenterTesting', + branch: 'master', + build_status: 'Succeeded', + build_id: '1', + build_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/1', + build_reason: 'manual', + finish_time: '2021-03-02T16:41:29.891411Z', + icon_link: null, + notification_settings_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', + os: 'Android', + start_time: '2021-03-02T16:34:13.9184874Z', + source_version: '7ed5c7b279316f19e9a0c45bb0fb49c0655471af', + sent_at: '2021-03-02T16:41:55.8819564Z', + }), + }, + source: {}, }, ], method: 'POST', @@ -117,26 +127,31 @@ export const data = [ name: 'appcenter', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - app_name: 'MSAppCenterTesting', - branch: 'master', - build_status: 'Broken', - build_id: '2', - build_link: - 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2', - build_reason: 'automatic', - finish_time: '2021-03-02T16:52:04.2587506Z', - icon_link: null, - notification_settings_link: - 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', - os: 'Android', - start_time: '2021-03-02T16:50:52.2584107Z', - source_version: '0624e1e3e48eaf2371c37316208ff83bdd5c123b', - sent_at: '2021-03-02T16:52:35.8848052Z', + request: { + body: JSON.stringify({ + app_name: 'MSAppCenterTesting', + branch: 'master', + build_status: 'Broken', + build_id: '2', + build_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/build/branches/master/builds/2', + build_reason: 'automatic', + finish_time: '2021-03-02T16:52:04.2587506Z', + icon_link: null, + notification_settings_link: + 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/settings/notifications', + os: 'Android', + start_time: '2021-03-02T16:50:52.2584107Z', + source_version: '0624e1e3e48eaf2371c37316208ff83bdd5c123b', + sent_at: '2021-03-02T16:52:35.8848052Z', + }), + }, + source: {}, }, ], method: 'POST', @@ -195,34 +210,39 @@ export const data = [ name: 'appcenter', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - app_name: 'MSAppCenterTesting', - app_display_name: 'MSAppCenterTesting', - release_id: '1', - platform: 'Android', - uploaded_at: '2021-03-02T17:49:35.463Z', - fingerprint: '9cbdc86d96c5359d2af3972fdda46624', - release_notes: 'Degraded to 4.0.0', - version: '1614707021', - short_version: '1.0', - min_os: '7.1', - mandatory_update: true, - size: 2919106, - provisioning_profile_name: null, - provisioning_profile_type: null, - bundle_identifier: 'tech.desusai.msappcentertesting', - install_link: - 'https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email', - icon_link: - 'https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r', - distribution_group_id: '00000000-0000-0000-0000-000000000000', - installable: true, - sent_at: '2021-03-02T17:49:37.127635Z', - app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + request: { + body: JSON.stringify({ + app_name: 'MSAppCenterTesting', + app_display_name: 'MSAppCenterTesting', + release_id: '1', + platform: 'Android', + uploaded_at: '2021-03-02T17:49:35.463Z', + fingerprint: '9cbdc86d96c5359d2af3972fdda46624', + release_notes: 'Degraded to 4.0.0', + version: '1614707021', + short_version: '1.0', + min_os: '7.1', + mandatory_update: true, + size: 2919106, + provisioning_profile_name: null, + provisioning_profile_type: null, + bundle_identifier: 'tech.desusai.msappcentertesting', + install_link: + 'https://install.appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/releases/1?source=email', + icon_link: + 'https://appcenter-filemanagement-distrib2ede6f06e.azureedge.net/dbbd3d57-9c09-448b-9782-0d57200f7c9b/ic_launcher.png?sv=2019-02-02&sr=c&sig=BNzQcMcvTbwf4fv59ByGiYXsr%2BA9PYDFyGJCqsE2RO0%3D&se=2021-03-09T17%3A49%3A35Z&sp=r', + distribution_group_id: '00000000-0000-0000-0000-000000000000', + installable: true, + sent_at: '2021-03-02T17:49:37.127635Z', + app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + }), + }, + source: {}, }, ], method: 'POST', @@ -292,27 +312,32 @@ export const data = [ name: 'appcenter', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - id: '1139624368u', - name: 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)', - reason: 'java.lang.ArithmeticException: divide by zero', - file_name: null, - line_number: null, - url: 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u', - app_display_name: 'MSAppCenterTesting', - app_platform: 'Java', - app_version: '1.0(1)', - stack_trace: [ - 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);', - ], - affected_users: 0, - crash_count: 0, - sent_at: '2021-03-02T18:14:33.9713246Z', - app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + request: { + body: JSON.stringify({ + id: '1139624368u', + name: 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25)', + reason: 'java.lang.ArithmeticException: divide by zero', + file_name: null, + line_number: null, + url: 'https://appcenter.ms/users/venkat-rudderstack.com/apps/MSAppCenterTesting/crashes/errors/1139624368u', + app_display_name: 'MSAppCenterTesting', + app_platform: 'Java', + app_version: '1.0(1)', + stack_trace: [ + 'tech.desusai.msappcentertesting.MainActivity$1.onClick (MainActivity.java:25);', + ], + affected_users: 0, + crash_count: 0, + sent_at: '2021-03-02T18:14:33.9713246Z', + app_id: 'ce8b5280-4605-4c1c-8c48-bd54c8fdda31', + }), + }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/appsflyer/data.ts b/test/integrations/sources/appsflyer/data.ts index c0e0bcc94fa..7f84fc0577f 100644 --- a/test/integrations/sources/appsflyer/data.ts +++ b/test/integrations/sources/appsflyer/data.ts @@ -9,123 +9,128 @@ export const data = [ name: 'appsflyer', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - customer_user_id: 'hi.from@appsflyer.example.com', - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: null, - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - device_type: 'iPhoneXR', - idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - event_name: 'My Apps', - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'ios', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'iPhoneXR', + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -160,10 +165,19 @@ export const data = [ network: { wifi: true }, os: { name: 'ios', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -267,7 +281,13 @@ export const data = [ timestamp: '2020-01-15 14:57:24.898', originalTimestamp: '2020-01-15 14:57:24.898', platform: 'ios', - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -281,123 +301,128 @@ export const data = [ name: 'appsflyer', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - customer_user_id: 'hi.from@appsflyer.example.com', - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - device_type: 'Nokia 5.3', - idfa: null, - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - event_name: 'My Apps', - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'android', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'Nokia 5.3', + idfa: null, + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'android', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -432,10 +457,19 @@ export const data = [ network: { wifi: true }, os: { name: 'android', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -539,7 +573,13 @@ export const data = [ timestamp: '2020-01-15 14:57:24.898', originalTimestamp: '2020-01-15 14:57:24.898', platform: 'android', - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -553,122 +593,127 @@ export const data = [ name: 'appsflyer', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - customer_user_id: 'hi.from@appsflyer.example.com', - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: null, - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - device_type: 'iPhoneXR', - idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'ios', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'iPhoneXR', + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -700,122 +745,127 @@ export const data = [ name: 'appsflyer', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: null, - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - device_type: 'iPhoneXR', - idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - event_name: 'My Apps', - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'ios', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + device_type: 'iPhoneXR', + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -849,8 +899,19 @@ export const data = [ }, network: { wifi: true }, os: { name: 'ios', version: '12.3.1' }, - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, type: 'track', @@ -953,7 +1014,13 @@ export const data = [ timestamp: '2020-01-15 14:57:24.898', originalTimestamp: '2020-01-15 14:57:24.898', platform: 'ios', - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -967,122 +1034,127 @@ export const data = [ name: 'appsflyer', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - customer_user_id: 'hi.from@appsflyer.example.com', - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: null, - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - event_name: 'My Apps', - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'ios', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ios', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -1116,10 +1188,19 @@ export const data = [ network: { wifi: true }, os: { name: 'ios', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -1223,7 +1304,13 @@ export const data = [ timestamp: '2020-01-15 14:57:24.898', originalTimestamp: '2020-01-15 14:57:24.898', platform: 'ios', - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -1237,122 +1324,127 @@ export const data = [ name: 'appsflyer', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - customer_user_id: 'hi.from@appsflyer.example.com', - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: null, - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - event_name: 'My Apps', - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'watchos', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'watchos', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -1386,10 +1478,19 @@ export const data = [ network: { wifi: true }, os: { name: 'watchos', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -1493,7 +1594,13 @@ export const data = [ timestamp: '2020-01-15 14:57:24.898', originalTimestamp: '2020-01-15 14:57:24.898', platform: 'watchos', - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -1507,122 +1614,127 @@ export const data = [ name: 'appsflyer', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - customer_user_id: 'hi.from@appsflyer.example.com', - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: null, - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - event_name: 'My Apps', - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'ipados', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'ipados', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -1656,10 +1768,19 @@ export const data = [ network: { wifi: true }, os: { name: 'ipados', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -1763,7 +1884,13 @@ export const data = [ timestamp: '2020-01-15 14:57:24.898', originalTimestamp: '2020-01-15 14:57:24.898', platform: 'ipados', - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -1777,122 +1904,127 @@ export const data = [ name: 'appsflyer', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', - device_category: 'phone', - af_sub1: null, - customer_user_id: 'hi.from@appsflyer.example.com', - is_lat: null, - contributor_2_af_prt: null, - bundle_id: 'com.appsflyer.AppsFlyer', - gp_broadcast_referrer: '', - contributor_2_touch_time: null, - contributor_3_touch_type: null, - event_source: 'SDK', - af_cost_value: null, - contributor_1_match_type: null, - app_version: '1.4.1', - contributor_3_af_prt: null, - custom_data: null, - contributor_2_touch_type: null, - gp_install_begin: null, - city: 'Khu Pho Binh Hoa', - amazon_aid: null, - gp_referrer: null, - af_cost_model: null, - af_c_id: null, - attributed_touch_time_selected_timezone: null, - selected_currency: 'USD', - app_name: 'AppsFlyer', - install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - postal_code: '823941', - wifi: true, - install_time: '2019-01-20 04:51:16.000', - operator: null, - attributed_touch_type: null, - af_attribution_lookback: null, - campaign_type: null, - keyword_match_type: null, - af_adset_id: null, - device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', - contributor_2_media_source: null, - conversion_type: null, - contributor_2_match_type: null, - api_version: '2.0', - attributed_touch_time: null, - revenue_in_selected_currency: null, - is_retargeting: false, - country_code: 'VN', - gp_click_time: null, - contributor_1_af_prt: null, - match_type: null, - appsflyer_id: '1547985076649-5309999', - dma: 'None', - http_referrer: null, - af_sub5: null, - af_prt: null, - event_revenue_currency: 'USD', - store_reinstall: null, - install_app_store: null, - media_source: 'organic', - deeplink_url: null, - campaign: null, - af_keywords: null, - region: 'AS', - cost_in_selected_currency: null, - event_value: '{}', - ip: '1.1.1.1', - oaid: null, - event_time: '2020-01-15 14:57:24.898', - is_receipt_validated: null, - contributor_1_campaign: null, - af_sub4: null, - imei: null, - contributor_3_campaign: null, - event_revenue_usd: null, - af_sub2: null, - original_url: null, - contributor_2_campaign: null, - android_id: null, - contributor_3_media_source: null, - af_adset: null, - af_ad: null, - state: '57', - network_account_id: null, - idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', - retargeting_conversion_type: null, - af_channel: null, - af_cost_currency: null, - contributor_1_media_source: null, - keyword_id: null, - device_download_time: '2019-01-20 04:51:16.000', - contributor_1_touch_type: null, - af_reengagement_window: null, - af_siteid: null, - language: 'en-US', - app_id: 'id1217828636', - contributor_1_touch_time: null, - event_revenue: null, - af_ad_type: null, - carrier: null, - event_name: 'My Apps', - af_sub_siteid: null, - advertising_id: null, - os_version: '12.3.1', - platform: 'tvos', - af_sub3: null, - contributor_3_match_type: null, - selected_timezone: 'UTC', - af_ad_id: null, - contributor_3_touch_time: null, - user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', - is_primary_attribution: true, - sdk_version: 'v4.10.0', - event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + request: { + body: JSON.stringify({ + idfv: '868049A3-4B2F-4A11-9B00-CFFC362XXXXX', + device_category: 'phone', + af_sub1: null, + customer_user_id: 'hi.from@appsflyer.example.com', + is_lat: null, + contributor_2_af_prt: null, + bundle_id: 'com.appsflyer.AppsFlyer', + gp_broadcast_referrer: '', + contributor_2_touch_time: null, + contributor_3_touch_type: null, + event_source: 'SDK', + af_cost_value: null, + contributor_1_match_type: null, + app_version: '1.4.1', + contributor_3_af_prt: null, + custom_data: null, + contributor_2_touch_type: null, + gp_install_begin: null, + city: 'Khu Pho Binh Hoa', + amazon_aid: null, + gp_referrer: null, + af_cost_model: null, + af_c_id: null, + attributed_touch_time_selected_timezone: null, + selected_currency: 'USD', + app_name: 'AppsFlyer', + install_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + postal_code: '823941', + wifi: true, + install_time: '2019-01-20 04:51:16.000', + operator: null, + attributed_touch_type: null, + af_attribution_lookback: null, + campaign_type: null, + keyword_match_type: null, + af_adset_id: null, + device_download_time_selected_timezone: '2019-01-20 04:51:16.000+0000', + contributor_2_media_source: null, + conversion_type: null, + contributor_2_match_type: null, + api_version: '2.0', + attributed_touch_time: null, + revenue_in_selected_currency: null, + is_retargeting: false, + country_code: 'VN', + gp_click_time: null, + contributor_1_af_prt: null, + match_type: null, + appsflyer_id: '1547985076649-5309999', + dma: 'None', + http_referrer: null, + af_sub5: null, + af_prt: null, + event_revenue_currency: 'USD', + store_reinstall: null, + install_app_store: null, + media_source: 'organic', + deeplink_url: null, + campaign: null, + af_keywords: null, + region: 'AS', + cost_in_selected_currency: null, + event_value: '{}', + ip: '1.1.1.1', + oaid: null, + event_time: '2020-01-15 14:57:24.898', + is_receipt_validated: null, + contributor_1_campaign: null, + af_sub4: null, + imei: null, + contributor_3_campaign: null, + event_revenue_usd: null, + af_sub2: null, + original_url: null, + contributor_2_campaign: null, + android_id: null, + contributor_3_media_source: null, + af_adset: null, + af_ad: null, + state: '57', + network_account_id: null, + idfa: 'A7071198-3848-40A5-B3D0-94578D9BZZZZ', + retargeting_conversion_type: null, + af_channel: null, + af_cost_currency: null, + contributor_1_media_source: null, + keyword_id: null, + device_download_time: '2019-01-20 04:51:16.000', + contributor_1_touch_type: null, + af_reengagement_window: null, + af_siteid: null, + language: 'en-US', + app_id: 'id1217828636', + contributor_1_touch_time: null, + event_revenue: null, + af_ad_type: null, + carrier: null, + event_name: 'My Apps', + af_sub_siteid: null, + advertising_id: null, + os_version: '12.3.1', + platform: 'tvos', + af_sub3: null, + contributor_3_match_type: null, + selected_timezone: 'UTC', + af_ad_id: null, + contributor_3_touch_time: null, + user_agent: 'AppsFlyer/1 CFNetwork/978.0.7 Darwin/18.6.0', + is_primary_attribution: true, + sdk_version: 'v4.10.0', + event_time_selected_timezone: '2020-01-15 14:57:24.898+0000', + }), + }, + source: {}, }, ], method: 'POST', @@ -1926,10 +2058,19 @@ export const data = [ network: { wifi: true }, os: { name: 'tvos', version: '12.3.1' }, traits: { - address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' }, + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, userId: 'hi.from@appsflyer.example.com', }, - externalId: [{ type: 'appsflyerExternalId', value: '1547985076649-5309999' }], + externalId: [ + { + type: 'appsflyerExternalId', + value: '1547985076649-5309999', + }, + ], }, integrations: { AF: false }, properties: { @@ -2033,7 +2174,13 @@ export const data = [ timestamp: '2020-01-15 14:57:24.898', originalTimestamp: '2020-01-15 14:57:24.898', platform: 'tvos', - traits: { address: { city: 'Khu Pho Binh Hoa', zip: '823941', country: 'VN' } }, + traits: { + address: { + city: 'Khu Pho Binh Hoa', + zip: '823941', + country: 'VN', + }, + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], diff --git a/test/integrations/sources/auth0/data.ts b/test/integrations/sources/auth0/data.ts index b012887bc43..7f675116624 100644 --- a/test/integrations/sources/auth0/data.ts +++ b/test/integrations/sources/auth0/data.ts @@ -9,240 +9,247 @@ export const data = [ name: 'auth0', description: 'successful signup', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031055712103169676686005480714681762668315934738', - data: { - date: '2022-10-31T05:57:06.859Z', - type: 'ss', - description: '', - connection: 'Username-Password-Authentication', - connection_id: 'con_djwCjiwyID0vZy1S', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: 'All Applications', - ip: '35.166.202.113', - user_agent: 'unknown', - details: { - body: { - email: 'testRudderlabs+21@gmail.com', - tenant: 'dev-cu4jy2zgao6yx15x', - password: 'dummyPassword', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686005480714681762668315934738', + data: { + date: '2022-10-31T05:57:06.859Z', + type: 'ss', + description: '', connection: 'Username-Password-Authentication', + connection_id: 'con_djwCjiwyID0vZy1S', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: 'All Applications', + ip: '35.166.202.113', + user_agent: 'unknown', + details: { + body: { + email: 'testRudderlabs+21@gmail.com', + tenant: 'dev-cu4jy2zgao6yx15x', + password: 'dummyPassword', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + connection: 'Username-Password-Authentication', + }, + }, + user_id: 'auth0|dummyPassword', + user_name: 'testRudderlabs+21@gmail.com', + strategy: 'auth0', + strategy_type: 'database', + log_id: '90020221031055712103169676686005480714681762668315934738', }, - }, - user_id: 'auth0|dummyPassword', - user_name: 'testRudderlabs+21@gmail.com', - strategy: 'auth0', - strategy_type: 'database', - log_id: '90020221031055712103169676686005480714681762668315934738', + }), }, + source: {}, }, { - log_id: '90020221031055712103169676686007898566320991926665347090', - data: { - date: '2022-10-31T05:57:06.874Z', - type: 'sapi', - description: 'Create a User', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.166.202.113', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686007898566320991926665347090', + data: { + date: '2022-10-31T05:57:06.874Z', + type: 'sapi', + description: 'Create a User', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', ip: '35.166.202.113', - auth: { - user: { - name: 'rudder test', - email: 'test@rudderstack.com', - user_id: 'auth0|dummyPassword', - }, - strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], - }, - }, - body: { - email: 'testRudderlabs+21@gmail.com', - password: 'dummyPassword', - connection: 'Username-Password-Authentication', - }, - path: '/api/v2/users', - query: {}, - method: 'post', - channel: 'https://manage.auth0.com/', - userAgent: + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - }, - response: { - body: { - name: 'testRudderlabs+21@gmail.com', - email: 'testRudderlabs+21@gmail.com', - picture: - 'https://s.gravatar.com/avatar/0902f9d02b92aed9f0ac59aaf9475b60?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fbh.png', - user_id: 'auth0|dummyPassword', - nickname: 'testRudderlabs+21', - created_at: '2022-10-31T05:57:06.864Z', - identities: [ - { - user_id: 'auth0|dummyPassword', - isSocial: false, - provider: 'auth0', + details: { + request: { + ip: '35.166.202.113', + auth: { + user: { + name: 'rudder test', + email: 'test@rudderstack.com', + user_id: 'auth0|dummyPassword', + }, + strategy: 'jwt', + credentials: { + jti: '571921bf7833a97efabf08d765a0ec8f', + scopes: [ + 'create:actions', + 'create:actions_log_sessions', + 'create:client_credentials', + 'create:client_grants', + 'create:clients', + 'create:connections', + 'create:custom_domains', + 'create:email_provider', + 'create:email_templates', + 'create:guardian_enrollment_tickets', + 'create:integrations', + 'create:log_streams', + 'create:organization_connections', + 'create:organization_invitations', + 'create:organization_member_roles', + 'create:organization_members', + 'create:organizations', + 'create:requested_scopes', + 'create:resource_servers', + 'create:roles', + 'create:rules', + 'create:shields', + 'create:signing_keys', + 'create:tenant_invitations', + 'create:test_email_dispatch', + 'create:users', + 'delete:actions', + 'delete:anomaly_blocks', + 'delete:branding', + 'delete:client_credentials', + 'delete:client_grants', + 'delete:clients', + 'delete:connections', + 'delete:custom_domains', + 'delete:device_credentials', + 'delete:email_provider', + 'delete:email_templates', + 'delete:grants', + 'delete:guardian_enrollments', + 'delete:integrations', + 'delete:log_streams', + 'delete:organization_connections', + 'delete:organization_invitations', + 'delete:organization_member_roles', + 'delete:organization_members', + 'delete:organizations', + 'delete:owners', + 'delete:requested_scopes', + 'delete:resource_servers', + 'delete:roles', + 'delete:rules', + 'delete:rules_configs', + 'delete:shields', + 'delete:tenant_invitations', + 'delete:tenant_members', + 'delete:tenants', + 'delete:users', + 'read:actions', + 'read:anomaly_blocks', + 'read:attack_protection', + 'read:branding', + 'read:checks', + 'read:client_credentials', + 'read:client_grants', + 'read:client_keys', + 'read:clients', + 'read:connections', + 'read:custom_domains', + 'read:device_credentials', + 'read:email_provider', + 'read:email_templates', + 'read:email_triggers', + 'read:entity_counts', + 'read:grants', + 'read:guardian_factors', + 'read:insights', + 'read:integrations', + 'read:log_streams', + 'read:logs', + 'read:mfa_policies', + 'read:organization_connections', + 'read:organization_invitations', + 'read:organization_member_roles', + 'read:organization_members', + 'read:organizations', + 'read:prompts', + 'read:requested_scopes', + 'read:resource_servers', + 'read:roles', + 'read:rules', + 'read:rules_configs', + 'read:shields', + 'read:signing_keys', + 'read:stats', + 'read:tenant_invitations', + 'read:tenant_members', + 'read:tenant_settings', + 'read:triggers', + 'read:users', + 'run:checks', + 'update:actions', + 'update:attack_protection', + 'update:branding', + 'update:client_credentials', + 'update:client_grants', + 'update:client_keys', + 'update:clients', + 'update:connections', + 'update:custom_domains', + 'update:email_provider', + 'update:email_templates', + 'update:email_triggers', + 'update:guardian_factors', + 'update:integrations', + 'update:log_streams', + 'update:mfa_policies', + 'update:organization_connections', + 'update:organizations', + 'update:prompts', + 'update:requested_scopes', + 'update:resource_servers', + 'update:roles', + 'update:rules', + 'update:rules_configs', + 'update:shields', + 'update:signing_keys', + 'update:tenant_members', + 'update:tenant_settings', + 'update:triggers', + 'update:users', + ], + }, + }, + body: { + email: 'testRudderlabs+21@gmail.com', + password: 'dummyPassword', connection: 'Username-Password-Authentication', }, - ], - updated_at: '2022-10-31T05:57:06.864Z', - email_verified: false, + path: '/api/v2/users', + query: {}, + method: 'post', + channel: 'https://manage.auth0.com/', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + response: { + body: { + name: 'testRudderlabs+21@gmail.com', + email: 'testRudderlabs+21@gmail.com', + picture: + 'https://s.gravatar.com/avatar/0902f9d02b92aed9f0ac59aaf9475b60?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fbh.png', + user_id: 'auth0|dummyPassword', + nickname: 'testRudderlabs+21', + created_at: '2022-10-31T05:57:06.864Z', + identities: [ + { + user_id: 'auth0|dummyPassword', + isSocial: false, + provider: 'auth0', + connection: 'Username-Password-Authentication', + }, + ], + updated_at: '2022-10-31T05:57:06.864Z', + email_verified: false, + }, + statusCode: 201, + }, }, - statusCode: 201, + user_id: 'auth0|dummyPassword', + log_id: '90020221031055712103169676686007898566320991926665347090', }, - }, - user_id: 'auth0|dummyPassword', - log_id: '90020221031055712103169676686007898566320991926665347090', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -267,15 +274,10 @@ export const data = [ userId: 'auth0|dummyPassword', user_name: 'testRudderlabs+21@gmail.com', }, - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'unknown', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686005480714681762668315934738', @@ -293,9 +295,7 @@ export const data = [ description: '', source_type: 'ss', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.859Z', }, ], @@ -311,19 +311,12 @@ export const data = [ userId: 'auth0|dummyPassword', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'auth0|dummyPassword', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'auth0|dummyPassword' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686007898566320991926665347090', @@ -513,9 +506,7 @@ export const data = [ description: 'Create a User', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.874Z', }, ], @@ -524,68 +515,60 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'add member to an organization', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031061004280169676882609459981150114445973782546', - data: { - date: '2022-10-31T06:09:59.135Z', - type: 'sapi', - description: 'Add members to an organization', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.167.74.121', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031061004280169676882609459981150114445973782546', + data: { + date: '2022-10-31T06:09:59.135Z', + type: 'sapi', + description: 'Add members to an organization', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', ip: '35.167.74.121', - auth: { - user: { - name: 'rudder test', - email: 'test@rudderstack.com', - user_id: 'google-oauth2|123456', - }, - strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + details: { + request: { + ip: '35.167.74.121', + auth: { + user: { + name: 'rudder test', + email: 'test@rudderstack.com', + user_id: 'google-oauth2|123456', + }, + strategy: 'jwt', + credentials: { jti: '571921bf7833a97efabf08d765a0ec8f' }, + }, + body: { members: ['auth0|123456'] }, + path: '/api/v2/organizations/org_eoe8p2atZ7furBxg/members', + query: {}, + method: 'post', + channel: 'https://manage.auth0.com/', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', }, + response: { body: {}, statusCode: 204 }, }, - body: { - members: ['auth0|123456'], - }, - path: '/api/v2/organizations/org_eoe8p2atZ7furBxg/members', - query: {}, - method: 'post', - channel: 'https://manage.auth0.com/', - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + user_id: 'google-oauth2|123456', + log_id: '90020221031061004280169676882609459981150114445973782546', }, - response: { - body: {}, - statusCode: 204, - }, - }, - user_id: 'google-oauth2|123456', - log_id: '90020221031061004280169676882609459981150114445973782546', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -602,19 +585,12 @@ export const data = [ userId: 'google-oauth2|123456', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'google-oauth2|123456', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'google-oauth2|123456' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.167.74.121', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, groupId: 'org_eoe8p2atZ7furBxg', properties: { @@ -629,13 +605,9 @@ export const data = [ user_id: 'google-oauth2|123456', }, strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', - }, - }, - body: { - members: ['auth0|123456'], + credentials: { jti: '571921bf7833a97efabf08d765a0ec8f' }, }, + body: { members: ['auth0|123456'] }, path: '/api/v2/organizations/org_eoe8p2atZ7furBxg/members', query: {}, method: 'post', @@ -643,19 +615,14 @@ export const data = [ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', }, - response: { - body: {}, - statusCode: 204, - }, + response: { body: {}, statusCode: 204 }, }, client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', client_name: '', description: 'Add members to an organization', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T06:09:59.135Z', }, ], @@ -664,272 +631,276 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'update tenant settings', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031061527239169676960191065529099349299958906898', - data: { - date: '2022-10-31T06:15:25.201Z', - type: 'sapi', - description: 'Update tenant settings', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.160.3.103', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031061527239169676960191065529099349299958906898', + data: { + date: '2022-10-31T06:15:25.201Z', + type: 'sapi', + description: 'Update tenant settings', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', ip: '35.160.3.103', - auth: { - user: { - name: 'rudder test', - email: 'test@rudderstack.com', - user_id: 'google-oauth2|123456', - }, - strategy: 'jwt', - credentials: { - jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], - }, - }, - body: { - picture_url: '', - support_url: '', - friendly_name: 'mecro-action', - support_email: 'support@test.com', - }, - path: '/api/v2/tenants/settings', - query: {}, - method: 'patch', - channel: 'https://manage.auth0.com/', - userAgent: + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - }, - response: { - body: { - flags: { - enable_sso: true, - universal_login: true, - disable_impersonation: true, - allow_changing_enable_sso: false, - revoke_refresh_token_grant: false, - disable_clickjack_protection_headers: false, - new_universal_login_experience_enabled: true, - enforce_client_authentication_on_passwordless_start: true, - cannot_change_enforce_client_authentication_on_passwordless_start: true, + details: { + request: { + ip: '35.160.3.103', + auth: { + user: { + name: 'rudder test', + email: 'test@rudderstack.com', + user_id: 'google-oauth2|123456', + }, + strategy: 'jwt', + credentials: { + jti: '571921bf7833a97efabf08d765a0ec8f', + scopes: [ + 'create:actions', + 'create:actions_log_sessions', + 'create:client_credentials', + 'create:client_grants', + 'create:clients', + 'create:connections', + 'create:custom_domains', + 'create:email_provider', + 'create:email_templates', + 'create:guardian_enrollment_tickets', + 'create:integrations', + 'create:log_streams', + 'create:organization_connections', + 'create:organization_invitations', + 'create:organization_member_roles', + 'create:organization_members', + 'create:organizations', + 'create:requested_scopes', + 'create:resource_servers', + 'create:roles', + 'create:rules', + 'create:shields', + 'create:signing_keys', + 'create:tenant_invitations', + 'create:test_email_dispatch', + 'create:users', + 'delete:actions', + 'delete:anomaly_blocks', + 'delete:branding', + 'delete:client_credentials', + 'delete:client_grants', + 'delete:clients', + 'delete:connections', + 'delete:custom_domains', + 'delete:device_credentials', + 'delete:email_provider', + 'delete:email_templates', + 'delete:grants', + 'delete:guardian_enrollments', + 'delete:integrations', + 'delete:log_streams', + 'delete:organization_connections', + 'delete:organization_invitations', + 'delete:organization_member_roles', + 'delete:organization_members', + 'delete:organizations', + 'delete:owners', + 'delete:requested_scopes', + 'delete:resource_servers', + 'delete:roles', + 'delete:rules', + 'delete:rules_configs', + 'delete:shields', + 'delete:tenant_invitations', + 'delete:tenant_members', + 'delete:tenants', + 'delete:users', + 'read:actions', + 'read:anomaly_blocks', + 'read:attack_protection', + 'read:branding', + 'read:checks', + 'read:client_credentials', + 'read:client_grants', + 'read:client_keys', + 'read:clients', + 'read:connections', + 'read:custom_domains', + 'read:device_credentials', + 'read:email_provider', + 'read:email_templates', + 'read:email_triggers', + 'read:entity_counts', + 'read:grants', + 'read:guardian_factors', + 'read:insights', + 'read:integrations', + 'read:log_streams', + 'read:logs', + 'read:mfa_policies', + 'read:organization_connections', + 'read:organization_invitations', + 'read:organization_member_roles', + 'read:organization_members', + 'read:organizations', + 'read:prompts', + 'read:requested_scopes', + 'read:resource_servers', + 'read:roles', + 'read:rules', + 'read:rules_configs', + 'read:shields', + 'read:signing_keys', + 'read:stats', + 'read:tenant_invitations', + 'read:tenant_members', + 'read:tenant_settings', + 'read:triggers', + 'read:users', + 'run:checks', + 'update:actions', + 'update:attack_protection', + 'update:branding', + 'update:client_credentials', + 'update:client_grants', + 'update:client_keys', + 'update:clients', + 'update:connections', + 'update:custom_domains', + 'update:email_provider', + 'update:email_templates', + 'update:email_triggers', + 'update:guardian_factors', + 'update:integrations', + 'update:log_streams', + 'update:mfa_policies', + 'update:organization_connections', + 'update:organizations', + 'update:prompts', + 'update:requested_scopes', + 'update:resource_servers', + 'update:roles', + 'update:rules', + 'update:rules_configs', + 'update:shields', + 'update:signing_keys', + 'update:tenant_members', + 'update:tenant_settings', + 'update:triggers', + 'update:users', + ], + }, + }, + body: { + picture_url: '', + support_url: '', + friendly_name: 'mecro-action', + support_email: 'support@test.com', + }, + path: '/api/v2/tenants/settings', + query: {}, + method: 'patch', + channel: 'https://manage.auth0.com/', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + }, + response: { + body: { + flags: { + enable_sso: true, + universal_login: true, + disable_impersonation: true, + allow_changing_enable_sso: false, + revoke_refresh_token_grant: false, + disable_clickjack_protection_headers: false, + new_universal_login_experience_enabled: true, + enforce_client_authentication_on_passwordless_start: true, + cannot_change_enforce_client_authentication_on_passwordless_start: true, + }, + picture_url: '', + support_url: '', + friendly_name: 'mecro-action', + support_email: 'support@test.com', + enabled_locales: ['en'], + sandbox_version: '16', + universal_login: {}, + }, + statusCode: 200, }, - picture_url: '', - support_url: '', - friendly_name: 'mecro-action', - support_email: 'support@test.com', - enabled_locales: ['en'], - sandbox_version: '16', - universal_login: {}, }, - statusCode: 200, + user_id: 'google-oauth2|123456', + log_id: '90020221031061527239169676960191065529099349299958906898', }, - }, - user_id: 'google-oauth2|123456', - log_id: '90020221031061527239169676960191065529099349299958906898', + }), }, + source: {}, }, { - log_id: '90020221031061530247169676961198100736838335677367058450', - data: { - date: '2022-10-31T06:15:25.196Z', - type: 'gd_tenant_update', - description: 'Guardian - Updates tenant settings', - ip: '35.160.3.103', - details: { - request: { + request: { + body: JSON.stringify({ + log_id: '90020221031061530247169676961198100736838335677367058450', + data: { + date: '2022-10-31T06:15:25.196Z', + type: 'gd_tenant_update', + description: 'Guardian - Updates tenant settings', ip: '35.160.3.103', - auth: { - scopes: [ - 'read:authenticators', - 'remove:authenticators', - 'update:authenticators', - 'create:authenticators', - 'read:enrollments', - 'delete:enrollments', - 'read:factors', - 'update:factors', - 'update:tenant_settings', - 'update:users', - 'create:enrollment_tickets', - 'create:users', - ], - subject: 'google-oauth2|123456', - strategy: 'jwt_api2_internal_token', - }, - body: { - picture_url: '[REDACTED]', - friendly_name: '[REDACTED]', - }, - path: '/api/tenants/settings', - query: {}, - method: 'PATCH', - }, - response: { - body: { - name: 'dev-cu4jy2zgao6yx15x', - picture_url: '[REDACTED]', - friendly_name: '[REDACTED]', - guardian_mfa_page: '[REDACTED]', + details: { + request: { + ip: '35.160.3.103', + auth: { + scopes: [ + 'read:authenticators', + 'remove:authenticators', + 'update:authenticators', + 'create:authenticators', + 'read:enrollments', + 'delete:enrollments', + 'read:factors', + 'update:factors', + 'update:tenant_settings', + 'update:users', + 'create:enrollment_tickets', + 'create:users', + ], + subject: 'google-oauth2|123456', + strategy: 'jwt_api2_internal_token', + }, + body: { + picture_url: '[REDACTED]', + friendly_name: '[REDACTED]', + }, + path: '/api/tenants/settings', + query: {}, + method: 'PATCH', + }, + response: { + body: { + name: 'dev-cu4jy2zgao6yx15x', + picture_url: '[REDACTED]', + friendly_name: '[REDACTED]', + guardian_mfa_page: '[REDACTED]', + }, + statusCode: 200, + }, }, - statusCode: 200, + user_id: 'google-oauth2|123456', + log_id: '90020221031061530247169676961198100736838335677367058450', }, - }, - user_id: 'google-oauth2|123456', - log_id: '90020221031061530247169676961198100736838335677367058450', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -947,19 +918,12 @@ export const data = [ userId: 'google-oauth2|123456', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'google-oauth2|123456', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'google-oauth2|123456' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.160.3.103', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031061527239169676960191065529099349299958906898', @@ -1151,9 +1115,7 @@ export const data = [ description: 'Update tenant settings', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T06:15:25.201Z', }, ], @@ -1169,17 +1131,10 @@ export const data = [ userId: 'google-oauth2|123456', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, - traits: { - userId: 'google-oauth2|123456', - }, + library: { name: 'unknown', version: 'unknown' }, + traits: { userId: 'google-oauth2|123456' }, request_ip: '35.160.3.103', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031061530247169676961198100736838335677367058450', @@ -1225,9 +1180,7 @@ export const data = [ description: 'Guardian - Updates tenant settings', source_type: 'gd_tenant_update', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T06:15:25.196Z', }, ], @@ -1236,52 +1189,51 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'missing userId', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031055712103169676686005480714681762668315934738', - data: { - date: '2022-10-31T05:57:06.859Z', - type: 'ss', - description: '', - connection: 'Username-Password-Authentication', - connection_id: 'con_djwCjiwyID0vZy1S', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: 'All Applications', - ip: '35.166.202.113', - user_agent: 'unknown', - details: { - body: { - email: 'testRudderlabs+21@gmail.com', - tenant: 'dev-cu4jy2zgao6yx15x', - password: 'dummyPassword', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686005480714681762668315934738', + data: { + date: '2022-10-31T05:57:06.859Z', + type: 'ss', + description: '', connection: 'Username-Password-Authentication', + connection_id: 'con_djwCjiwyID0vZy1S', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: 'All Applications', + ip: '35.166.202.113', + user_agent: 'unknown', + details: { + body: { + email: 'testRudderlabs+21@gmail.com', + tenant: 'dev-cu4jy2zgao6yx15x', + password: 'dummyPassword', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + connection: 'Username-Password-Authentication', + }, + }, + user_id: '', + user_name: 'testRudderlabs+21@gmail.com', + strategy: 'auth0', + strategy_type: 'database', + log_id: '90020221031055712103169676686005480714681762668315934738', }, - }, - user_id: '', - user_name: 'testRudderlabs+21@gmail.com', - strategy: 'auth0', - strategy_type: 'database', - log_id: '90020221031055712103169676686005480714681762668315934738', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1306,15 +1258,10 @@ export const data = [ userId: '', user_name: 'testRudderlabs+21@gmail.com', }, - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'unknown', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686005480714681762668315934738', @@ -1332,9 +1279,7 @@ export const data = [ description: '', source_type: 'ss', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.859Z', }, ], @@ -1343,66 +1288,70 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'missing userId for all the requests in a batch', module: 'source', - version: 'v0', - + version: 'v2', input: { request: { body: [ { - log_id: '90020221031055712103169676686005480714681762668315934738', - data: { - date: '2022-10-31T05:57:06.859Z', - type: 'ss', - description: '', - connection: 'Username-Password-Authentication', - connection_id: 'con_djwCjiwyID0vZy1S', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: 'All Applications', - ip: '35.166.202.113', - user_agent: 'unknown', - details: { - body: { - email: 'testRudderlabs+21@gmail.com', - tenant: 'dev-cu4jy2zgao6yx15x', - password: 'dummyPassword', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686005480714681762668315934738', + data: { + date: '2022-10-31T05:57:06.859Z', + type: 'ss', + description: '', connection: 'Username-Password-Authentication', + connection_id: 'con_djwCjiwyID0vZy1S', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: 'All Applications', + ip: '35.166.202.113', + user_agent: 'unknown', + details: { + body: { + email: 'testRudderlabs+21@gmail.com', + tenant: 'dev-cu4jy2zgao6yx15x', + password: 'dummyPassword', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + connection: 'Username-Password-Authentication', + }, + }, + user_id: '', + user_name: 'testRudderlabs+21@gmail.com', + strategy: 'auth0', + strategy_type: 'database', + log_id: '90020221031055712103169676686005480714681762668315934738', }, - }, - user_id: '', - user_name: 'testRudderlabs+21@gmail.com', - strategy: 'auth0', - strategy_type: 'database', - log_id: '90020221031055712103169676686005480714681762668315934738', + }), }, + source: {}, }, { - log_id: '90020221031055712103169676686007898566320991926665347090', - data: { - date: '2022-10-31T05:57:06.874Z', - type: 'sapi', - description: 'Create a User', - client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', - client_name: '', - ip: '35.166.202.113', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', - log_id: '90020221031055712103169676686007898566320991926665347090', + request: { + body: JSON.stringify({ + log_id: '90020221031055712103169676686007898566320991926665347090', + data: { + date: '2022-10-31T05:57:06.874Z', + type: 'sapi', + description: 'Create a User', + client_id: 'vQcJNDTxsM1W72eHFonRJdzyOvawlwIt', + client_name: '', + ip: '35.166.202.113', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', + log_id: '90020221031055712103169676686007898566320991926665347090', + }, + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1427,15 +1376,10 @@ export const data = [ userId: '', user_name: 'testRudderlabs+21@gmail.com', }, - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'unknown', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686005480714681762668315934738', @@ -1453,9 +1397,7 @@ export const data = [ description: '', source_type: 'ss', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.859Z', }, ], @@ -1470,16 +1412,11 @@ export const data = [ sentAt: '2022-10-31T05:57:06.874Z', anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - library: { - name: 'unknown', - version: 'unknown', - }, + library: { name: 'unknown', version: 'unknown' }, userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36', request_ip: '35.166.202.113', - integration: { - name: 'Auth0', - }, + integration: { name: 'Auth0' }, }, properties: { log_id: '90020221031055712103169676686007898566320991926665347090', @@ -1488,9 +1425,7 @@ export const data = [ description: 'Create a User', source_type: 'sapi', }, - integrations: { - Auth0: false, - }, + integrations: { Auth0: false }, originalTimestamp: '2022-10-31T05:57:06.874Z', }, ], @@ -1499,34 +1434,26 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'auth0', description: 'empty batch', module: 'source', - version: 'v0', + version: 'v2', skipGo: 'Created this case manually', input: { request: { body: [], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, - output: { - response: { - status: 200, - body: [], - }, - }, - mockFns: () => { - defaultMockFns(); - }, + output: { response: { status: 200, body: [] } }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); }, -]; +})); diff --git a/test/integrations/sources/braze/data.ts b/test/integrations/sources/braze/data.ts index a4031e1bd04..516355daad3 100644 --- a/test/integrations/sources/braze/data.ts +++ b/test/integrations/sources/braze/data.ts @@ -10,25 +10,25 @@ export const data = [ name: 'braze', description: 'event mapping done in UI', module: 'source', - version: 'v1', + version: 'v2', skipGo: 'Custom source config', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.inappmessage.Click', - properties: { - device_model: 'samsung', - }, - user: { - user_id: 'user_id', - external_user_id: 'externalUserId', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.inappmessage.Click', + properties: { device_model: 'samsung' }, + user: { + user_id: 'user_id', + external_user_id: 'externalUserId', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -48,9 +48,7 @@ export const data = [ }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -64,21 +62,12 @@ export const data = [ { anonymousId: 'user_id', context: { - device: { - model: 'samsung', - }, - integration: { - name: 'Braze', - }, - library: { - name: 'unknown', - version: 'unknown', - }, + device: { model: 'samsung' }, + integration: { name: 'Braze' }, + library: { name: 'unknown', version: 'unknown' }, }, event: 'In-App Message Clicked', - integrations: { - Braze: false, - }, + integrations: { Braze: false }, type: 'track', userId: 'externalUserId', }, @@ -93,25 +82,24 @@ export const data = [ name: 'braze', description: 'The event is not mapped in the UI', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.inappmessage.Click', - properties: { - device_model: 'samsung', - }, - user: { - user_id: 'user_id', - external_user_id: 'externalUserId', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.inappmessage.Click', + properties: { device_model: 'samsung' }, + user: { + user_id: 'user_id', + external_user_id: 'externalUserId', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -119,21 +107,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -147,21 +128,12 @@ export const data = [ { anonymousId: 'user_id', context: { - device: { - model: 'samsung', - }, - integration: { - name: 'Braze', - }, - library: { - name: 'unknown', - version: 'unknown', - }, + device: { model: 'samsung' }, + integration: { name: 'Braze' }, + library: { name: 'unknown', version: 'unknown' }, }, event: 'users.messages.inappmessage.Click', - integrations: { - Braze: false, - }, + integrations: { Braze: false }, type: 'track', userId: 'externalUserId', }, @@ -176,37 +148,38 @@ export const data = [ name: 'braze', description: 'users.messages.inappmessage.Click event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.inappmessage.Click', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1607988752, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - device_id: 'fedcba87-6543-210f-edc-ba9876543210', - timezone: 'America/Chicago', - }, - properties: { - app_id: '01234567-89ab-cdef-0123-456789abcdef', - campaign_id: '11234567-89ab-cdef-0123-456789abcdef', - campaign_name: 'Test Campaign', - message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', - platform: 'android', - os_version: 'Android (N)', - device_model: 'Nexus 5X', - button_id: '0', - send_id: 'f123456789abcdef01234567', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.inappmessage.Click', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1607988752, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + device_id: 'fedcba87-6543-210f-edc-ba9876543210', + timezone: 'America/Chicago', + }, + properties: { + app_id: '01234567-89ab-cdef-0123-456789abcdef', + campaign_id: '11234567-89ab-cdef-0123-456789abcdef', + campaign_name: 'Test Campaign', + message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', + platform: 'android', + os_version: 'Android (N)', + device_model: 'Nexus 5X', + button_id: '0', + send_id: 'f123456789abcdef01234567', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -214,21 +187,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -277,35 +243,36 @@ export const data = [ name: 'braze', description: 'users.messages.pushnotification.Send event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.pushnotification.Send', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - device_id: 'fedcba87-6543-210f-edc-ba9876543210', - timezone: 'America/Chicago', - }, - properties: { - app_id: '01234567-89ab-cdef-0123-456789abcdef', - platform: 'ios', - campaign_id: '11234567-89ab-cdef-0123-456789abcdef', - campaign_name: 'Test Campaign', - message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', - send_id: 'f123456789abcdef01234567', - dispatch_id: '01234567-89ab-cdef-0123-456789abcdef', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.pushnotification.Send', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + device_id: 'fedcba87-6543-210f-edc-ba9876543210', + timezone: 'America/Chicago', + }, + properties: { + app_id: '01234567-89ab-cdef-0123-456789abcdef', + platform: 'ios', + campaign_id: '11234567-89ab-cdef-0123-456789abcdef', + campaign_name: 'Test Campaign', + message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', + send_id: 'f123456789abcdef01234567', + dispatch_id: '01234567-89ab-cdef-0123-456789abcdef', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -313,21 +280,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -373,35 +333,36 @@ export const data = [ name: 'braze', description: 'users.messages.email.Open event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.email.Open', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - timezone: 'America/Chicago', - }, - properties: { - campaign_id: '11234567-89ab-cdef-0123-456789abcdef', - campaign_name: 'Test Campaign', - dispatch_id: '12345qwert', - message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', - email_address: 'test@test.com', - send_id: 'f123456789abcdef01234567', - user_agent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.email.Open', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + timezone: 'America/Chicago', + }, + properties: { + campaign_id: '11234567-89ab-cdef-0123-456789abcdef', + campaign_name: 'Test Campaign', + dispatch_id: '12345qwert', + message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', + email_address: 'test@test.com', + send_id: 'f123456789abcdef01234567', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -409,21 +370,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -469,34 +423,35 @@ export const data = [ name: 'braze', description: 'users.messages.sms.Delivery send', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.sms.Delivery', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - timezone: 'America/Chicago', - }, - properties: { - campaign_id: '11234567-89ab-cdef-0123-456789abcdef', - campaign_name: 'Test Campaign', - dispatch_id: '12345qwert', - message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', - to_phone_number: '+16462345678', - subscription_group_id: '41234567-89ab-cdef-0123-456789abcdef', - from_phone_number: '+12123470922', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.sms.Delivery', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + timezone: 'America/Chicago', + }, + properties: { + campaign_id: '11234567-89ab-cdef-0123-456789abcdef', + campaign_name: 'Test Campaign', + dispatch_id: '12345qwert', + message_variation_id: 'c1234567-89ab-cdef-0123-456789abcdef', + to_phone_number: '+16462345678', + subscription_group_id: '41234567-89ab-cdef-0123-456789abcdef', + from_phone_number: '+12123470922', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -504,21 +459,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -563,38 +511,39 @@ export const data = [ name: 'braze', description: 'users.messages.inappmessage.Click event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.inappmessage.Click', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - device_id: 'fedcba87-6543-210f-edc-ba9876543210', - timezone: 'America/Chicago', - }, - properties: { - app_id: '01234567-89ab-cdef-0123-456789abcdef', - canvas_id: '11234567-89ab-cdef-0123-456789abcdef', - canvas_name: 'My Cool Campaign', - canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', - canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', - platform: 'android', - os_version: 'Android (N)', - device_model: 'Nexus 5X', - button_id: '0', - send_id: 'f123456789abcdef01234567', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.inappmessage.Click', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + device_id: 'fedcba87-6543-210f-edc-ba9876543210', + timezone: 'America/Chicago', + }, + properties: { + app_id: '01234567-89ab-cdef-0123-456789abcdef', + canvas_id: '11234567-89ab-cdef-0123-456789abcdef', + canvas_name: 'My Cool Campaign', + canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', + canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', + platform: 'android', + os_version: 'Android (N)', + device_model: 'Nexus 5X', + button_id: '0', + send_id: 'f123456789abcdef01234567', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -602,21 +551,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -666,36 +608,37 @@ export const data = [ name: 'braze', description: 'users.messages.pushnotification.Send event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.pushnotification.Send', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - device_id: 'fedcba87-6543-210f-edc-ba9876543210', - timezone: 'America/Chicago', - }, - properties: { - app_id: '01234567-89ab-cdef-0123-456789abcdef', - platform: 'ios', - canvas_id: '11234567-89ab-cdef-0123-456789abcdef', - canvas_name: 'My Cool Campaign', - canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', - canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', - send_id: 'f123456789abcdef01234567', - dispatch_id: '01234567-89ab-cdef-0123-456789abcdef', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.pushnotification.Send', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + device_id: 'fedcba87-6543-210f-edc-ba9876543210', + timezone: 'America/Chicago', + }, + properties: { + app_id: '01234567-89ab-cdef-0123-456789abcdef', + platform: 'ios', + canvas_id: '11234567-89ab-cdef-0123-456789abcdef', + canvas_name: 'My Cool Campaign', + canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', + canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', + send_id: 'f123456789abcdef01234567', + dispatch_id: '01234567-89ab-cdef-0123-456789abcdef', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -703,21 +646,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -764,36 +700,37 @@ export const data = [ name: 'braze', description: 'users.messages.email.Open event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.email.Open', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - timezone: 'America/Chicago', - }, - properties: { - canvas_id: '11234567-89ab-cdef-0123-456789abcdef', - canvas_name: 'My Cool Canvas', - canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', - canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', - dispatch_id: '12345qwert', - email_address: 'test@test.com', - send_id: 'f123456789abcdef01234567', - user_agent: - 'Mozilla/5.0(Macintosh;IntelMacOSX10_13_5)AppleWebKit/537.36(KHTML,likeGecko)Chrome/67.0.3396.99Safari/537.36', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.email.Open', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + timezone: 'America/Chicago', + }, + properties: { + canvas_id: '11234567-89ab-cdef-0123-456789abcdef', + canvas_name: 'My Cool Canvas', + canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', + canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', + dispatch_id: '12345qwert', + email_address: 'test@test.com', + send_id: 'f123456789abcdef01234567', + user_agent: + 'Mozilla/5.0(Macintosh;IntelMacOSX10_13_5)AppleWebKit/537.36(KHTML,likeGecko)Chrome/67.0.3396.99Safari/537.36', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -801,21 +738,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -862,35 +792,36 @@ export const data = [ name: 'braze', description: 'users.messages.sms.Delivery event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.messages.sms.Delivery', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - timezone: 'America/Chicago', - }, - properties: { - canvas_id: '11234567-89ab-cdef-0123-456789abcdef', - canvas_name: 'MyCoolCanvas', - canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', - canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', - dispatch_id: '12345qwert', - to_phone_number: '+16462345678', - subscription_group_id: '41234567-89ab-cdef-0123-456789abcdef', - from_phone_number: '+12123470922', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.messages.sms.Delivery', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + timezone: 'America/Chicago', + }, + properties: { + canvas_id: '11234567-89ab-cdef-0123-456789abcdef', + canvas_name: 'MyCoolCanvas', + canvas_variation_id: '31234567-89ab-cdef-0123-456789abcdef', + canvas_step_id: '41234567-89ab-cdef-0123-456789abcdef', + dispatch_id: '12345qwert', + to_phone_number: '+16462345678', + subscription_group_id: '41234567-89ab-cdef-0123-456789abcdef', + from_phone_number: '+12123470922', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -898,21 +829,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -958,41 +882,42 @@ export const data = [ name: 'braze', description: 'users.behaviors.CustomEvent any custom event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.behaviors.CustomEvent', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - device_id: 'fedcba87-6543-210f-edc-ba9876543210', - timezone: 'America/Chicago', - }, - properties: { - app_id: '01234567-89ab-cdef-0123-456789abcdef', - platform: 'ios', - os_version: 'iOS10.3.1', - device_model: 'iPhone7Plus', - name: 'customeventname', - ad_id: '01234567-89ab-cdef-0123-456789abcdef', - ad_id_type: 'roku_ad_id', - ad_tracking_enabled: true, - custom_properties: { - stringpropertyname: 'a', - numberpropertyname: 1, - listpropertyname: ['a', 'b'], + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.behaviors.CustomEvent', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + device_id: 'fedcba87-6543-210f-edc-ba9876543210', + timezone: 'America/Chicago', + }, + properties: { + app_id: '01234567-89ab-cdef-0123-456789abcdef', + platform: 'ios', + os_version: 'iOS10.3.1', + device_model: 'iPhone7Plus', + name: 'customeventname', + ad_id: '01234567-89ab-cdef-0123-456789abcdef', + ad_id_type: 'roku_ad_id', + ad_tracking_enabled: true, + custom_properties: { + stringpropertyname: 'a', + numberpropertyname: 1, + listpropertyname: ['a', 'b'], + }, }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -1000,21 +925,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1067,43 +985,44 @@ export const data = [ name: 'braze', description: 'users.behaviors.Purchase event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.behaviors.Purchase', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - device_id: 'fedcba87-6543-210f-edc-ba9876543210', - timezone: 'America/Chicago', - }, - properties: { - app_id: '01234567-89ab-cdef-0123-456789abcdef', - platform: 'ios', - os_version: 'iOS10.3.1', - device_model: 'iPhone7Plus', - product_id: '1234', - price: 12.34, - currency: 'AED', - ad_id: '01234567-89ab-cdef-0123-456789abcdef', - ad_id_type: 'roku_ad_id', - ad_tracking_enabled: true, - purchase_properties: { - stringpropertyname: 'a', - numberpropertyname: 1, - listpropertyname: ['a', 'b'], + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.behaviors.Purchase', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + device_id: 'fedcba87-6543-210f-edc-ba9876543210', + timezone: 'America/Chicago', + }, + properties: { + app_id: '01234567-89ab-cdef-0123-456789abcdef', + platform: 'ios', + os_version: 'iOS10.3.1', + device_model: 'iPhone7Plus', + product_id: '1234', + price: 12.34, + currency: 'AED', + ad_id: '01234567-89ab-cdef-0123-456789abcdef', + ad_id_type: 'roku_ad_id', + ad_tracking_enabled: true, + purchase_properties: { + stringpropertyname: 'a', + numberpropertyname: 1, + listpropertyname: ['a', 'b'], + }, }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -1111,21 +1030,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -1180,32 +1092,33 @@ export const data = [ name: 'braze', description: 'users.behaviors.app.SessionStart event', module: 'source', - version: 'v1', - + version: 'v2', input: { request: { body: [ { - event: { - events: [ - { - event_type: 'users.behaviors.app.SessionStart', - id: 'a1234567-89ab-cdef-0123-456789abcdef', - time: 1477502783, - user: { - user_id: '0123456789abcdef01234567', - external_user_id: 'user_id', - device_id: 'fedcba87-6543-210f-edc-ba9876543210', - }, - properties: { - app_id: '01234567-89ab-cdef-0123-456789abcdef', - platform: 'ios', - os_version: 'iOS10.3.1', - device_model: 'iPhone7Plus', - session_id: 'b1234567-89ab-cdef-0123-456789abcdef', + request: { + body: JSON.stringify({ + events: [ + { + event_type: 'users.behaviors.app.SessionStart', + id: 'a1234567-89ab-cdef-0123-456789abcdef', + time: 1477502783, + user: { + user_id: '0123456789abcdef01234567', + external_user_id: 'user_id', + device_id: 'fedcba87-6543-210f-edc-ba9876543210', + }, + properties: { + app_id: '01234567-89ab-cdef-0123-456789abcdef', + platform: 'ios', + os_version: 'iOS10.3.1', + device_model: 'iPhone7Plus', + session_id: 'b1234567-89ab-cdef-0123-456789abcdef', + }, }, - }, - ], + ], + }), }, source: { ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', @@ -1213,21 +1126,14 @@ export const data = [ Name: 'Braze source', SourceDefinition: commonSourceDefinition, Config: { - customMapping: [ - { - from: 'randomEvent', - to: 'In-App Message Clicked', - }, - ], + customMapping: [{ from: 'randomEvent', to: 'In-App Message Clicked' }], }, ...commonSourceConfigProperties, }, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, diff --git a/test/integrations/sources/canny/data.ts b/test/integrations/sources/canny/data.ts index 50a99bb4832..de626abf19f 100644 --- a/test/integrations/sources/canny/data.ts +++ b/test/integrations/sources/canny/data.ts @@ -9,50 +9,61 @@ export const data = [ name: 'canny', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-28T10:52:46.294Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 13, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - category: null, - commentCount: 0, - created: '2022-07-28T10:52:46.172Z', - customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], - details: 'Array of images', - eta: null, - id: '62e26a7e1d4ea13c124337bd', - imageURLs: [ - 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', - 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', - ], - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Custom Fields Testing', - url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + request: { + body: JSON.stringify({ + created: '2022-07-28T10:52:46.294Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 13, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-28T10:52:46.172Z', + customFields: [ + { + id: '62e13820d7949d44b92d3876', + name: 'abc', + value: '123', + }, + ], + details: 'Array of images', + eta: null, + id: '62e26a7e1d4ea13c124337bd', + imageURLs: [ + 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', + 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', + ], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Custom Fields Testing', + url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + }, + objectType: 'post', + type: 'post.created', + }), }, - objectType: 'post', - type: 'post.created', + source: {}, }, ], method: 'POST', @@ -81,7 +92,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-28T10:52:46.294Z', originalTimestamp: '2022-07-28T10:52:46.294Z', @@ -98,7 +114,13 @@ export const data = [ category: null, commentCount: 0, created: '2022-07-28T10:52:46.172Z', - customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + customFields: [ + { + id: '62e13820d7949d44b92d3876', + name: 'abc', + value: '123', + }, + ], details: 'Array of images', eta: null, id: '62e26a7e1d4ea13c124337bd', @@ -126,55 +148,60 @@ export const data = [ name: 'canny', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T10:35:16.390Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 10, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - category: null, - commentCount: 0, - created: '2022-07-26T08:18:52.459Z', - deletedBy: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - details: "This is the post's details", - eta: null, - id: '62dfa36c9950e94655320fe7', - imageURLs: [], - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Post Title', - url: 'https://rudder.canny.io/admin/board/features/p/post-title-4', + request: { + body: JSON.stringify({ + created: '2022-07-26T10:35:16.390Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 10, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-26T08:18:52.459Z', + deletedBy: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + details: "This is the post's details", + eta: null, + id: '62dfa36c9950e94655320fe7', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-4', + }, + objectType: 'post', + type: 'post.deleted', + }), }, - objectType: 'post', - type: 'post.deleted', + source: {}, }, ], method: 'POST', @@ -203,7 +230,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T10:35:16.390Z', originalTimestamp: '2022-07-26T10:35:16.390Z', @@ -253,55 +285,62 @@ export const data = [ name: 'canny', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T18:32:28.337Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - by: null, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - category: null, - commentCount: 0, - created: '2022-07-26T10:43:43.752Z', - details: "This is the post's details", - eta: null, - id: '62dfc55ffe7f6f465b9b4568', - imageURLs: [], - issue: { - description: - "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", - id: '10001', - key: 'TES-2', - status: 'To Do', - summary: 'Canny Source Testing', - url: 'https://rudderstack-user.atlassian.net/browse/TES-2', - }, - owner: null, - score: 2, - status: 'open', - tags: [], - title: 'Post Title', - url: 'https://rudder.canny.io/admin/board/features/p/post-title-8', + request: { + body: JSON.stringify({ + created: '2022-07-26T18:32:28.337Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + category: null, + commentCount: 0, + created: '2022-07-26T10:43:43.752Z', + details: "This is the post's details", + eta: null, + id: '62dfc55ffe7f6f465b9b4568', + imageURLs: [], + issue: { + description: + "This is the post's details\n" + + '\n' + + 'https://rudder.canny.io/admin/board/features/p/post-title-8', + id: '10001', + key: 'TES-2', + status: 'To Do', + summary: 'Canny Source Testing', + url: 'https://rudderstack-user.atlassian.net/browse/TES-2', + }, + owner: null, + score: 2, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-8', + }, + objectType: 'post', + type: 'post.jira_issue_linked', + }), }, - objectType: 'post', - type: 'post.jira_issue_linked', + source: {}, }, ], method: 'POST', @@ -330,7 +369,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T18:32:28.337Z', originalTimestamp: '2022-07-26T18:32:28.337Z', @@ -353,7 +397,9 @@ export const data = [ imageURLs: [], issue: { description: - "This is the post's details\n\nhttps://rudder.canny.io/admin/board/features/p/post-title-8", + "This is the post's details\n" + + '\n' + + 'https://rudder.canny.io/admin/board/features/p/post-title-8', id: '10001', key: 'TES-2', status: 'To Do', @@ -380,55 +426,62 @@ export const data = [ name: 'canny', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-27T04:08:24.377Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - by: null, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - category: null, - commentCount: 0, - created: '2022-07-26T11:32:31.228Z', - details: 'Array of images', - eta: null, - id: '62dfd0cfb2870d468c9618dd', - imageURLs: [], - issue: { - description: - 'Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2', - id: '10002', - key: 'TES-3', - status: 'To Do', - summary: 'Images testing', - url: 'https://rudderstack-user.atlassian.net/browse/TES-3', - }, - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Images testing', - url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + request: { + body: JSON.stringify({ + created: '2022-07-27T04:08:24.377Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + category: null, + commentCount: 0, + created: '2022-07-26T11:32:31.228Z', + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + issue: { + description: + 'Array of images\n' + + '\n' + + 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + id: '10002', + key: 'TES-3', + status: 'To Do', + summary: 'Images testing', + url: 'https://rudderstack-user.atlassian.net/browse/TES-3', + }, + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + objectType: 'post', + type: 'post.jira_issue_unlinked', + }), }, - objectType: 'post', - type: 'post.jira_issue_unlinked', + source: {}, }, ], method: 'POST', @@ -457,7 +510,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-27T04:08:24.377Z', originalTimestamp: '2022-07-27T04:08:24.377Z', @@ -481,7 +539,9 @@ export const data = [ imageURLs: [], issue: { description: - 'Array of images\n\nhttps://rudder.canny.io/admin/board/features/p/images-testing-2', + 'Array of images\n' + + '\n' + + 'https://rudder.canny.io/admin/board/features/p/images-testing-2', id: '10002', key: 'TES-3', status: 'To Do', @@ -507,63 +567,68 @@ export const data = [ name: 'canny', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T18:07:03.143Z', - object: { - author: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - category: null, - changeComment: { - imageURLs: ['https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp'], - value: '', - }, - changedAt: '2022-07-26T18:07:03.143Z', - changer: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - commentCount: 1, - created: '2022-07-26T08:22:31.089Z', - details: "This is the post's details", - eta: null, - id: '62dfa4479950e9465532a31e', - imageURLs: [], - jira: { linkedIssues: [], linkedIssueIDs: [] }, - owner: null, - score: 2, - status: 'planned', - tags: [], - title: 'Post Title', - url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + request: { + body: JSON.stringify({ + created: '2022-07-26T18:07:03.143Z', + object: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + changeComment: { + imageURLs: ['https://canny.io/images/0a4b1c6a967ad9fc17f0c71dc11d1de2.webp'], + value: '', + }, + changedAt: '2022-07-26T18:07:03.143Z', + changer: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + commentCount: 1, + created: '2022-07-26T08:22:31.089Z', + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + jira: { linkedIssues: [], linkedIssueIDs: [] }, + owner: null, + score: 2, + status: 'planned', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + objectType: 'post', + type: 'post.status_changed', + }), }, - objectType: 'post', - type: 'post.status_changed', + source: {}, }, ], method: 'POST', @@ -593,7 +658,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T18:07:03.143Z', originalTimestamp: '2022-07-26T18:07:03.143Z', @@ -650,64 +720,69 @@ export const data = [ name: 'canny', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T10:52:17.712Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 11, - url: 'https://rudder.canny.io/admin/board/features', - }, - created: '2022-07-26T10:52:17.618Z', - id: '62dfc761af6e2b467381b103', - imageURLs: ['https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp'], - internal: true, - mentions: [], - parentID: null, - post: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, + request: { + body: JSON.stringify({ + created: '2022-07-26T10:52:17.712Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 11, + url: 'https://rudder.canny.io/admin/board/features', + }, + created: '2022-07-26T10:52:17.618Z', + id: '62dfc761af6e2b467381b103', + imageURLs: ['https://canny.io/images/59ef1b731f87d1c84bbdc078d0b9221e.webp'], + internal: true, + mentions: [], + parentID: null, + post: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 2, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + private: false, + value: 'webhook-test', }, - by: null, - category: null, - commentCount: 1, - details: "This is the post's details", - eta: null, - id: '62dfa4479950e9465532a31e', - imageURLs: [], - owner: null, - score: 2, - status: 'open', - tags: [], - title: 'Post Title', - url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', - }, - private: false, - value: 'webhook-test', + objectType: 'comment', + type: 'comment.created', + }), }, - objectType: 'comment', - type: 'comment.created', + source: {}, }, ], method: 'POST', @@ -736,7 +811,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T10:52:17.712Z', originalTimestamp: '2022-07-26T10:52:17.712Z', @@ -795,62 +875,67 @@ export const data = [ name: 'canny', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-27T04:12:09.290Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - created: '2022-07-27T04:11:59.942Z', - id: '62e0bb0faf6e2b467328b133', - imageURLs: [], - parentID: null, - post: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, + request: { + body: JSON.stringify({ + created: '2022-07-27T04:12:09.290Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + created: '2022-07-27T04:11:59.942Z', + id: '62e0bb0faf6e2b467328b133', + imageURLs: [], + parentID: null, + post: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + private: false, + value: 'good', }, - by: null, - category: null, - commentCount: 0, - details: 'Array of images', - eta: null, - id: '62dfd0cfb2870d468c9618dd', - imageURLs: [], - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Images testing', - url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', - }, - private: false, - value: 'good', + objectType: 'comment', + type: 'comment.deleted', + }), }, - objectType: 'comment', - type: 'comment.deleted', + source: {}, }, ], method: 'POST', @@ -879,7 +964,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-27T04:12:09.290Z', originalTimestamp: '2022-07-27T04:12:09.290Z', @@ -936,62 +1026,67 @@ export const data = [ name: 'canny', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T11:32:31.378Z', - object: { - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - created: '2022-07-26T11:32:31.263Z', - id: '62dfd0cfb2870d468c9618f5', - post: { - author: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, + request: { + body: JSON.stringify({ + created: '2022-07-26T11:32:31.378Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T11:32:31.263Z', + id: '62dfd0cfb2870d468c9618f5', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + score: 1, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, }, - by: null, - category: null, - commentCount: 0, - details: 'Array of images', - eta: null, - id: '62dfd0cfb2870d468c9618dd', - imageURLs: [], - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Images testing', - url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', - }, - score: 1, - voter: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, + objectType: 'vote', + type: 'vote.created', + }), }, - objectType: 'vote', - type: 'vote.created', + source: {}, }, ], method: 'POST', @@ -1021,7 +1116,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T11:32:31.378Z', originalTimestamp: '2022-07-26T11:32:31.378Z', @@ -1077,69 +1177,74 @@ export const data = [ name: 'canny', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T18:09:27.358Z', - object: { - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - created: '2022-07-26T08:22:31.109Z', - id: '62dfa4479950e9465532a338', - post: { - author: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - by: null, - category: null, - commentCount: 1, - details: "This is the post's details", - eta: null, - id: '62dfa4479950e9465532a31e', - imageURLs: [], - owner: null, - score: 1, - status: 'planned', - tags: [ - { - id: '62e02db67ad24c46bc175f56', - name: 'abc-tag', - postCount: 1, - url: 'https://rudder.canny.io/admin/board/features?tags=abc-tag', + request: { + body: JSON.stringify({ + created: '2022-07-26T18:09:27.358Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', }, - ], - title: 'Post Title', - url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', - }, - score: 0, - voter: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, + by: null, + created: '2022-07-26T08:22:31.109Z', + id: '62dfa4479950e9465532a338', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 1, + status: 'planned', + tags: [ + { + id: '62e02db67ad24c46bc175f56', + name: 'abc-tag', + postCount: 1, + url: 'https://rudder.canny.io/admin/board/features?tags=abc-tag', + }, + ], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + score: 0, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + objectType: 'vote', + type: 'vote.deleted', + }), }, - objectType: 'vote', - type: 'vote.deleted', + source: {}, }, ], method: 'POST', @@ -1169,7 +1274,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T18:09:27.358Z', originalTimestamp: '2022-07-26T18:09:27.358Z', @@ -1232,50 +1342,61 @@ export const data = [ name: 'canny', description: 'test-9', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-28T10:52:46.294Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: 'sampleuserId', - }, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 13, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - category: null, - commentCount: 0, - created: '2022-07-28T10:52:46.172Z', - customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], - details: 'Array of images', - eta: null, - id: '62e26a7e1d4ea13c124337bd', - imageURLs: [ - 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', - 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', - ], - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Custom Fields Testing', - url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + request: { + body: JSON.stringify({ + created: '2022-07-28T10:52:46.294Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: 'sampleuserId', + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 13, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-28T10:52:46.172Z', + customFields: [ + { + id: '62e13820d7949d44b92d3876', + name: 'abc', + value: '123', + }, + ], + details: 'Array of images', + eta: null, + id: '62e26a7e1d4ea13c124337bd', + imageURLs: [ + 'https://canny.io/images/6371453a825c79351c52a6063c3af476.jpg', + 'https://canny.io/images/47db6ee5035bfb45ea87a74f2eb17928.jpg', + ], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Custom Fields Testing', + url: 'https://rudder.canny.io/admin/board/features/p/custom-fields-testing', + }, + objectType: 'post', + type: 'post.created', + }), }, - objectType: 'post', - type: 'post.created', + source: {}, }, ], method: 'POST', @@ -1304,7 +1425,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-28T10:52:46.294Z', originalTimestamp: '2022-07-28T10:52:46.294Z', @@ -1321,7 +1447,13 @@ export const data = [ category: null, commentCount: 0, created: '2022-07-28T10:52:46.172Z', - customFields: [{ id: '62e13820d7949d44b92d3876', name: 'abc', value: '123' }], + customFields: [ + { + id: '62e13820d7949d44b92d3876', + name: 'abc', + value: '123', + }, + ], details: 'Array of images', eta: null, id: '62e26a7e1d4ea13c124337bd', @@ -1349,62 +1481,67 @@ export const data = [ name: 'canny', description: 'test-10', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T11:32:31.378Z', - object: { - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - created: '2022-07-26T11:32:31.263Z', - id: '62dfd0cfb2870d468c9618f5', - post: { - author: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, + request: { + body: JSON.stringify({ + created: '2022-07-26T11:32:31.378Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + created: '2022-07-26T11:32:31.263Z', + id: '62dfd0cfb2870d468c9618f5', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 0, + details: 'Array of images', + eta: null, + id: '62dfd0cfb2870d468c9618dd', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Images testing', + url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', + }, + score: 1, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: '123', + }, }, - by: null, - category: null, - commentCount: 0, - details: 'Array of images', - eta: null, - id: '62dfd0cfb2870d468c9618dd', - imageURLs: [], - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Images testing', - url: 'https://rudder.canny.io/admin/board/features/p/images-testing-2', - }, - score: 1, - voter: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: '123', - }, + objectType: 'vote', + type: 'vote.created', + }), }, - objectType: 'vote', - type: 'vote.created', + source: {}, }, ], method: 'POST', @@ -1434,7 +1571,12 @@ export const data = [ name: 'Rudder Test', url: 'https://rudder.canny.io/admin/users/dummyUser', }, - externalId: [{ type: 'cannyUserId', id: '62d14c90fff7c80d0ec08375' }], + externalId: [ + { + type: 'cannyUserId', + id: '62d14c90fff7c80d0ec08375', + }, + ], }, timestamp: '2022-07-26T11:32:31.378Z', originalTimestamp: '2022-07-26T11:32:31.378Z', @@ -1490,69 +1632,74 @@ export const data = [ name: 'canny', description: 'test-11', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T18:09:27.358Z', - object: { - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 12, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - created: '2022-07-26T08:22:31.109Z', - id: '62dfa4479950e9465532a338', - post: { - author: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - by: null, - category: null, - commentCount: 1, - details: "This is the post's details", - eta: null, - id: '62dfa4479950e9465532a31e', - imageURLs: [], - owner: null, - score: 1, - status: 'planned', - tags: [ - { - id: '62e02db67ad24c46bc175f56', - name: 'abc-tag', - postCount: 1, - url: 'https://rudder.canny.io/admin/board/features?tags=abc-tag', + request: { + body: JSON.stringify({ + created: '2022-07-26T18:09:27.358Z', + object: { + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 12, + url: 'https://rudder.canny.io/admin/board/features', }, - ], - title: 'Post Title', - url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', - }, - score: 0, - voter: { - avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', - created: '2022-07-15T11:16:32.648Z', - email: null, - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, + by: null, + created: '2022-07-26T08:22:31.109Z', + id: '62dfa4479950e9465532a338', + post: { + author: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + by: null, + category: null, + commentCount: 1, + details: "This is the post's details", + eta: null, + id: '62dfa4479950e9465532a31e', + imageURLs: [], + owner: null, + score: 1, + status: 'planned', + tags: [ + { + id: '62e02db67ad24c46bc175f56', + name: 'abc-tag', + postCount: 1, + url: 'https://rudder.canny.io/admin/board/features?tags=abc-tag', + }, + ], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-7', + }, + score: 0, + voter: { + avatarURL: 'https://canny.io/images/cddfd145056cd4bc04132ee0e7de04ee.png', + created: '2022-07-15T11:16:32.648Z', + email: null, + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + }, + objectType: 'vote', + type: 'vote.deleted', + }), }, - objectType: 'vote', - type: 'vote.deleted', + source: {}, }, ], method: 'POST', @@ -1585,53 +1732,58 @@ export const data = [ name: 'canny', description: 'test-12', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - created: '2022-07-26T10:35:16.390Z', - object: { - author: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - board: { - created: '2022-07-25T12:11:19.895Z', - id: '62de88676bc28b44aaaf25cc', - name: 'features', - postCount: 10, - url: 'https://rudder.canny.io/admin/board/features', - }, - by: null, - category: null, - commentCount: 0, - created: '2022-07-26T08:18:52.459Z', - deletedBy: { - created: '2022-07-15T11:16:32.648Z', - email: 'test@rudderstack.com', - id: '62d14c90fff7c80d0ec08375', - isAdmin: true, - name: 'Rudder Test', - url: 'https://rudder.canny.io/admin/users/dummyUser', - userID: null, - }, - details: "This is the post's details", - eta: null, - id: '62dfa36c9950e94655320fe7', - imageURLs: [], - owner: null, - score: 1, - status: 'open', - tags: [], - title: 'Post Title', - url: 'https://rudder.canny.io/admin/board/features/p/post-title-4', + request: { + body: JSON.stringify({ + created: '2022-07-26T10:35:16.390Z', + object: { + author: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + board: { + created: '2022-07-25T12:11:19.895Z', + id: '62de88676bc28b44aaaf25cc', + name: 'features', + postCount: 10, + url: 'https://rudder.canny.io/admin/board/features', + }, + by: null, + category: null, + commentCount: 0, + created: '2022-07-26T08:18:52.459Z', + deletedBy: { + created: '2022-07-15T11:16:32.648Z', + email: 'test@rudderstack.com', + id: '62d14c90fff7c80d0ec08375', + isAdmin: true, + name: 'Rudder Test', + url: 'https://rudder.canny.io/admin/users/dummyUser', + userID: null, + }, + details: "This is the post's details", + eta: null, + id: '62dfa36c9950e94655320fe7', + imageURLs: [], + owner: null, + score: 1, + status: 'open', + tags: [], + title: 'Post Title', + url: 'https://rudder.canny.io/admin/board/features/p/post-title-4', + }, + objectType: 'post', + }), }, - objectType: 'post', + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/close_crm/data.ts b/test/integrations/sources/close_crm/data.ts index 08b9d13a1b0..66c8841d1eb 100644 --- a/test/integrations/sources/close_crm/data.ts +++ b/test/integrations/sources/close_crm/data.ts @@ -9,78 +9,78 @@ export const data = [ name: 'close_crm', description: 'lead update', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - event: { - date_created: '2019-01-15T12:48:23.395000', - meta: { - request_method: 'PUT', - request_path: '/api/v1/opportunity/object_id/', - }, - id: 'ev_123', - action: 'updated', - date_updated: '2019-01-15T12:48:23.395000', - changed_fields: [ - 'confidence', - 'date_updated', - 'status_id', - 'status_label', - 'status_type', - ], - previous_data: { - status_type: 'active', - confidence: 70, - date_updated: '2019-01-15T12:47:39.873000+00:00', - status_id: 'stat_123', - status_label: 'Active', - }, - organization_id: 'orga_123', - data: { - contact_name: 'Mr. Jones', - user_name: 'Joe Kemp', - value_period: 'one_time', - updated_by_name: 'Joe Kemp', - date_created: '2019-01-15T12:41:24.496000+00:00', - user_id: 'user_123', - updated_by: 'user_123', - value_currency: 'USD', + request: { + body: JSON.stringify({ + event: { + date_created: '2019-01-15T12:48:23.395000', + meta: { + request_method: 'PUT', + request_path: '/api/v1/opportunity/object_id/', + }, + id: 'ev_123', + action: 'updated', + date_updated: '2019-01-15T12:48:23.395000', + changed_fields: [ + 'confidence', + 'date_updated', + 'status_id', + 'status_label', + 'status_type', + ], + previous_data: { + status_type: 'active', + confidence: 70, + date_updated: '2019-01-15T12:47:39.873000+00:00', + status_id: 'stat_123', + status_label: 'Active', + }, organization_id: 'orga_123', - status_label: 'Won', - contact_id: 'cont_123', - status_type: 'won', - created_by_name: 'Joe Kemp', - id: 'id_12', - lead_name: 'KLine', - date_lost: null, - note: '', - date_updated: '2019-01-15T12:48:23.392000+00:00', - status_id: 'stat_12', - value: 100000, - created_by: 'user_123', - value_formatted: '$1,000', - date_won: '2019-01-15', + data: { + contact_name: 'Mr. Jones', + user_name: 'Joe Kemp', + value_period: 'one_time', + updated_by_name: 'Joe Kemp', + date_created: '2019-01-15T12:41:24.496000+00:00', + user_id: 'user_123', + updated_by: 'user_123', + value_currency: 'USD', + organization_id: 'orga_123', + status_label: 'Won', + contact_id: 'cont_123', + status_type: 'won', + created_by_name: 'Joe Kemp', + id: 'id_12', + lead_name: 'KLine', + date_lost: null, + note: '', + date_updated: '2019-01-15T12:48:23.392000+00:00', + status_id: 'stat_12', + value: 100000, + created_by: 'user_123', + value_formatted: '$1,000', + date_won: '2019-01-15', + lead_id: 'lead_123', + confidence: 100, + }, + request_id: 'req_123', + object_id: 'object_id', + user_id: 'user_123', + object_type: 'opportunity', lead_id: 'lead_123', - confidence: 100, }, - request_id: 'req_123', - object_id: 'object_id', - user_id: 'user_123', - object_type: 'opportunity', - lead_id: 'lead_123', - }, - subscription_id: 'whsub_123', + subscription_id: 'whsub_123', + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -93,17 +93,10 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'CloseCRM', - }, - }, - integrations: { - CloseCRM: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'CloseCRM' }, }, + integrations: { CloseCRM: false }, type: 'track', event: 'opportunity updated', messageId: 'ev_123', @@ -159,59 +152,52 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'close_crm', description: 'group creation', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - subscription_id: 'whsub_123', - event: { - id: 'ev_123', - date_created: '2024-06-13T03:53:33.917000', - date_updated: '2024-06-13T03:53:33.917000', - organization_id: 'orga_123', - user_id: 'user_123', - request_id: 'req_123', - api_key_id: null, - oauth_client_id: null, - oauth_scope: null, - object_type: 'group', - object_id: 'group_123', - lead_id: null, - action: 'created', - changed_fields: [], - meta: { - request_path: '/api/v1/graphql/', - request_method: 'POST', - }, - data: { - id: 'group_123', - name: 'Test group', - members: [ - { - user_id: 'user_123', - }, - ], + request: { + body: JSON.stringify({ + subscription_id: 'whsub_123', + event: { + id: 'ev_123', + date_created: '2024-06-13T03:53:33.917000', + date_updated: '2024-06-13T03:53:33.917000', + organization_id: 'orga_123', + user_id: 'user_123', + request_id: 'req_123', + api_key_id: null, + oauth_client_id: null, + oauth_scope: null, + object_type: 'group', + object_id: 'group_123', + lead_id: null, + action: 'created', + changed_fields: [], + meta: { + request_path: '/api/v1/graphql/', + request_method: 'POST', + }, + data: { + id: 'group_123', + name: 'Test group', + members: [{ user_id: 'user_123' }], + }, + previous_data: {}, }, - previous_data: {}, - }, + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -225,29 +211,18 @@ export const data = [ { anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', context: { - integration: { - name: 'CloseCRM', - }, - library: { - name: 'unknown', - version: 'unknown', - }, + integration: { name: 'CloseCRM' }, + library: { name: 'unknown', version: 'unknown' }, }, event: 'group created', - integrations: { - CloseCRM: false, - }, + integrations: { CloseCRM: false }, messageId: 'ev_123', originalTimestamp: '2024-06-ThT03:53:33.917+00:00', properties: { action: 'created', data: { id: 'group_123', - members: [ - { - user_id: 'user_123', - }, - ], + members: [{ user_id: 'user_123' }], name: 'Test group', }, date_created: '2024-06-13T03:53:33.917000', @@ -272,68 +247,65 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'close_crm', description: 'lead deletion', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - subscription_id: 'whsub_123', - event: { - id: 'ev_123', - date_created: '2024-06-14T05:16:04.138000', - date_updated: '2024-06-14T05:16:04.138000', - organization_id: 'orga_123', - user_id: 'user_123', - request_id: 'req_123', - api_key_id: 'api_123', - oauth_client_id: null, - oauth_scope: null, - object_type: 'lead', - object_id: 'lead_123', - lead_id: 'lead_123', - action: 'deleted', - changed_fields: [], - meta: { - request_path: '/api/v1/lead/lead_123/', - request_method: 'DELETE', - }, - data: {}, - previous_data: { - created_by_name: 'Rudder User', - addresses: [], - description: '', - url: null, - date_created: '2024-06-14T05:13:42.239000+00:00', - status_id: 'stat_123', - contact_ids: ['cont_123'], - id: 'lead_12', - date_updated: '2024-06-14T05:13:42.262000+00:00', - updated_by_name: 'Rudder User', - status_label: 'Potential', - name: 'test name', - display_name: 'test name', + request: { + body: JSON.stringify({ + subscription_id: 'whsub_123', + event: { + id: 'ev_123', + date_created: '2024-06-14T05:16:04.138000', + date_updated: '2024-06-14T05:16:04.138000', organization_id: 'orga_123', - updated_by: 'user_123', - created_by: 'user_123', + user_id: 'user_123', + request_id: 'req_123', + api_key_id: 'api_123', + oauth_client_id: null, + oauth_scope: null, + object_type: 'lead', + object_id: 'lead_123', + lead_id: 'lead_123', + action: 'deleted', + changed_fields: [], + meta: { + request_path: '/api/v1/lead/lead_123/', + request_method: 'DELETE', + }, + data: {}, + previous_data: { + created_by_name: 'Rudder User', + addresses: [], + description: '', + url: null, + date_created: '2024-06-14T05:13:42.239000+00:00', + status_id: 'stat_123', + contact_ids: ['cont_123'], + id: 'lead_12', + date_updated: '2024-06-14T05:13:42.262000+00:00', + updated_by_name: 'Rudder User', + status_label: 'Potential', + name: 'test name', + display_name: 'test name', + organization_id: 'orga_123', + updated_by: 'user_123', + created_by: 'user_123', + }, }, - }, + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -346,17 +318,10 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'CloseCRM', - }, - }, - integrations: { - CloseCRM: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'CloseCRM' }, }, + integrations: { CloseCRM: false }, type: 'track', event: 'lead deleted', userId: 'lead_123', @@ -388,8 +353,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/cordial/data.ts b/test/integrations/sources/cordial/data.ts index acb02e9fbfc..4da265a9ca2 100644 --- a/test/integrations/sources/cordial/data.ts +++ b/test/integrations/sources/cordial/data.ts @@ -9,61 +9,59 @@ export const data = [ name: 'cordial', description: 'Simple Single object Input event with normal channel and action', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - contact: { - _id: '6690fe3655e334xx028xxx', - channels: { - email: { - address: 'jondoe@example.com', - subscribeStatus: 'subscribed', - subscribedAt: '2024-07-12T09:58:14+0000', + request: { + body: JSON.stringify({ + contact: { + _id: '6690fe3655e334xx028xxx', + channels: { + email: { + address: 'jondoe@example.com', + subscribeStatus: 'subscribed', + subscribedAt: '2024-07-12T09:58:14+0000', + }, }, + createdAt: '2024-07-12T09:58:14+0000', + address: { city: 'San Miego' }, + first_name: 'John', + last_name: 'Doe', + lastUpdateSource: 'api', + lastModified: '2024-07-12T13:00:49+0000', + cID: '6690fe3655e334xx028xxx', }, - createdAt: '2024-07-12T09:58:14+0000', - address: { - city: 'San Miego', - }, - first_name: 'John', - last_name: 'Doe', - lastUpdateSource: 'api', - lastModified: '2024-07-12T13:00:49+0000', - cID: '6690fe3655e334xx028xxx', - }, - event: { - _id: '669141857b8cxxx1ba0da2xx', - cID: '6690fe3655e334xx028xxx', - ts: '2024-07-12T14:45:25+00:00', - ats: '2024-07-12T14:45:25+0000', - a: 'browse', - tzo: -7, - rl: 'a', - UID: '4934ee07118197xx3f74d5xxxx7b0076', - time: '2024-07-12T14:45:25+0000', - action: 'browse', - bmID: '', - first: 0, - properties: { - category: 'Shirts', - url: 'http://example.com/shirts', - description: 'A really cool khaki shirt.', - price: 9.99, - title: 'Khaki Shirt', - test_key: 'value', + event: { + _id: '669141857b8cxxx1ba0da2xx', + cID: '6690fe3655e334xx028xxx', + ts: '2024-07-12T14:45:25+00:00', + ats: '2024-07-12T14:45:25+0000', + a: 'browse', + tzo: -7, + rl: 'a', + UID: '4934ee07118197xx3f74d5xxxx7b0076', + time: '2024-07-12T14:45:25+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + category: 'Shirts', + url: 'http://example.com/shirts', + description: 'A really cool khaki shirt.', + price: 9.99, + title: 'Khaki Shirt', + test_key: 'value', + }, }, - }, + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -76,13 +74,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '6690fe3655e334xx028xxx', email: 'jondoe@example.com', @@ -95,20 +88,21 @@ export const data = [ }, }, createdAt: '2024-07-12T09:58:14+0000', - address: { - city: 'San Miego', - }, + address: { city: 'San Miego' }, first_name: 'John', last_name: 'Doe', lastUpdateSource: 'api', lastModified: '2024-07-12T13:00:49+0000', cID: '6690fe3655e334xx028xxx', }, - externalId: [{ id: '6690fe3655e334xx028xxx', type: 'cordialContactId' }], - }, - integrations: { - Cordial: false, + externalId: [ + { + id: '6690fe3655e334xx028xxx', + type: 'cordialContactId', + }, + ], }, + integrations: { Cordial: false }, type: 'track', event: 'browse', originalTimestamp: '2024-07-12T14:45:25+00:00', @@ -142,154 +136,147 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'cordial', description: 'Multiple object Input event with batched payload', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: [ - { - contact: { - _id: '633b2fd70a12be027e0b0xxx', - lang_locale: 'EN-US', - channels: { - email: { - address: 'johndoe@example.com', - subscribeStatus: 'none', + request: { + body: JSON.stringify([ + { + contact: { + _id: '633b2fd70a12be027e0b0xxx', + lang_locale: 'EN-US', + channels: { + email: { + address: 'johndoe@example.com', + subscribeStatus: 'none', + }, }, + createdAt: '2022-10-03T18:54:15+0000', + email_sha256_hash: + 'f959bdf883831ebb96612eb9xxxx1e0c9481780adf5f70xxx862155531bf61df', + first_name: 'john', + last_name: 'doe', + lastUpdateSource: 'cordial', + lastModified: '2024-07-24T07:52:46+0000', + cID: '633b2fd70a12be027e0b0xxx', }, - createdAt: '2022-10-03T18:54:15+0000', - email_sha256_hash: - 'f959bdf883831ebb96612eb9xxxx1e0c9481780adf5f70xxx862155531bf61df', - first_name: 'john', - last_name: 'doe', - lastUpdateSource: 'cordial', - lastModified: '2024-07-24T07:52:46+0000', - cID: '633b2fd70a12be027e0b0xxx', - }, - event: { - _id: '66a0b2ce5344b55fxxxc5a64', - cID: '633b2fd70a12be027e0b0xxx', - ts: '2024-07-24T07:52:46+00:00', - ats: '2024-07-24T07:52:39+0000', - g: { - countryISO: 'PL', - country: 'Poland', - state: 'MZ', - city: 'Warszawa', - postalCode: '00-686', - geoLoc: { - lat: 52.22744369506836, - lon: 21.009017944335938, + event: { + _id: '66a0b2ce5344b55fxxxc5a64', + cID: '633b2fd70a12be027e0b0xxx', + ts: '2024-07-24T07:52:46+00:00', + ats: '2024-07-24T07:52:39+0000', + g: { + countryISO: 'PL', + country: 'Poland', + state: 'MZ', + city: 'Warszawa', + postalCode: '00-686', + geoLoc: { + lat: 52.22744369506836, + lon: 21.009017944335938, + }, + tz: 'Europe/Warsaw', }, - tz: 'Europe/Warsaw', - }, - d: { - type: 'computer', - device: 'Macintosh', - platform: 'OS X', - browser: 'Chrome', - robot: false, - }, - a: 'browse', - UID: '471af949fffe749c2ebfxxx950ea73c', - sp: { - bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e', - }, - tzo: -7, - rl: '6', - time: '2024-07-24T07:52:39+0000', - action: 'browse', - bmID: '', - first: 0, - properties: { - url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', - product_item_group_id: ['1094269'], - product_category: ['allproducts'], - product_name: ['wtp ab'], - product_group: ['women'], - }, - }, - }, - { - contact: { - _id: '633b2fd12312be027e0b0xxx', - lang_locale: 'EN-US', - channels: { - email: { - address: 'johndoe1@example.com', - subscribeStatus: 'none', + d: { + type: 'computer', + device: 'Macintosh', + platform: 'OS X', + browser: 'Chrome', + robot: false, + }, + a: 'browse', + UID: '471af949fffe749c2ebfxxx950ea73c', + sp: { bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e' }, + tzo: -7, + rl: '6', + time: '2024-07-24T07:52:39+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', + product_item_group_id: ['1094269'], + product_category: ['allproducts'], + product_name: ['wtp ab'], + product_group: ['women'], }, }, - createdAt: '2022-10-03T18:54:15+0000', - email_sha256_hash: - 'f95912b883831eab11612eb9xxxx1e0c9481780ad45770xxx862155531bf61df', - first_name: 'john', - last_name: 'doe', - lastUpdateSource: 'cordial', - lastModified: '2024-07-24T07:52:46+0000', - cID: '633b2fd12312be027e0b0xxx', }, - event: { - _id: '66aku0b2ce527b55fx1xc5a64', - cID: '633b2fd12312be027e0b0xxx', - ts: '2024-07-24T07:52:46+00:00', - ats: '2024-07-24T07:52:39+0000', - g: { - countryISO: 'PL', - country: 'Poland', - state: 'MZ', - city: 'Warszawa', - postalCode: '00-686', - geoLoc: { - lat: 52.22744369506836, - lon: 21.009017944335938, + { + contact: { + _id: '633b2fd12312be027e0b0xxx', + lang_locale: 'EN-US', + channels: { + email: { + address: 'johndoe1@example.com', + subscribeStatus: 'none', + }, }, - tz: 'Europe/Warsaw', - }, - d: { - type: 'computer', - device: 'Macintosh', - platform: 'OS X', - browser: 'Chrome', - robot: false, - }, - a: 'browse', - UID: '471af949fffe74sdh382ebfxxx950ea73c', - sp: { - bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e', + createdAt: '2022-10-03T18:54:15+0000', + email_sha256_hash: + 'f95912b883831eab11612eb9xxxx1e0c9481780ad45770xxx862155531bf61df', + first_name: 'john', + last_name: 'doe', + lastUpdateSource: 'cordial', + lastModified: '2024-07-24T07:52:46+0000', + cID: '633b2fd12312be027e0b0xxx', }, - tzo: -7, - rl: '6', - time: '2024-07-24T07:52:39+0000', - action: 'browse', - bmID: '', - first: 0, - properties: { - url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', - product_item_group_id: ['1094269'], - product_category: ['allproducts'], - product_name: ['wtp ab'], - product_group: ['women'], + event: { + _id: '66aku0b2ce527b55fx1xc5a64', + cID: '633b2fd12312be027e0b0xxx', + ts: '2024-07-24T07:52:46+00:00', + ats: '2024-07-24T07:52:39+0000', + g: { + countryISO: 'PL', + country: 'Poland', + state: 'MZ', + city: 'Warszawa', + postalCode: '00-686', + geoLoc: { + lat: 52.22744369506836, + lon: 21.009017944335938, + }, + tz: 'Europe/Warsaw', + }, + d: { + type: 'computer', + device: 'Macintosh', + platform: 'OS X', + browser: 'Chrome', + robot: false, + }, + a: 'browse', + UID: '471af949fffe74sdh382ebfxxx950ea73c', + sp: { bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e' }, + tzo: -7, + rl: '6', + time: '2024-07-24T07:52:39+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + url: 'https://aaff-008.dx.commercecloud.salesforce.com/s/UGG-US/cart', + product_item_group_id: ['1094269'], + product_category: ['allproducts'], + product_name: ['wtp ab'], + product_group: ['women'], + }, }, }, - }, - ], + ]), + }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -302,13 +289,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '633b2fd70a12be027e0b0xxx', email: 'johndoe@example.com', @@ -336,11 +318,14 @@ export const data = [ browser: 'Chrome', robot: false, }, - externalId: [{ id: '633b2fd70a12be027e0b0xxx', type: 'cordialContactId' }], - }, - integrations: { - Cordial: false, + externalId: [ + { + id: '633b2fd70a12be027e0b0xxx', + type: 'cordialContactId', + }, + ], }, + integrations: { Cordial: false }, type: 'track', event: 'browse', properties: { @@ -367,9 +352,7 @@ export const data = [ }, a: 'browse', UID: '471af949fffe749c2ebfxxx950ea73c', - sp: { - bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e', - }, + sp: { bid: 'cf6de7f1-cce5-40xx-ac9c-7c82a2xxc09e' }, tzo: -7, rl: '6', time: '2024-07-24T07:52:39+0000', @@ -384,13 +367,8 @@ export const data = [ }, { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '633b2fd12312be027e0b0xxx', email: 'johndoe1@example.com', @@ -418,11 +396,14 @@ export const data = [ browser: 'Chrome', robot: false, }, - externalId: [{ id: '633b2fd12312be027e0b0xxx', type: 'cordialContactId' }], - }, - integrations: { - Cordial: false, + externalId: [ + { + id: '633b2fd12312be027e0b0xxx', + type: 'cordialContactId', + }, + ], }, + integrations: { Cordial: false }, type: 'track', event: 'browse', properties: { @@ -449,9 +430,7 @@ export const data = [ }, a: 'browse', UID: '471af949fffe74sdh382ebfxxx950ea73c', - sp: { - bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e', - }, + sp: { bid: 'cf6de7f1-123ce5-20xx-ac9c-7c82a2xxc09e' }, tzo: -7, rl: '6', time: '2024-07-24T07:52:39+0000', @@ -470,74 +449,69 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'cordial', description: 'Simple Single object Input event with no CId', module: 'source', - version: 'v1', + version: 'v2', input: { request: { body: [ { - event: { - contact: { - _id: '6690fe3655e334xx028xx1', - channels: { - email: { - address: 'jondoe@example.com', - subscribeStatus: 'subscribed', - subscribedAt: '2024-07-12T09:58:14+0000', + request: { + body: JSON.stringify({ + contact: { + _id: '6690fe3655e334xx028xx1', + channels: { + email: { + address: 'jondoe@example.com', + subscribeStatus: 'subscribed', + subscribedAt: '2024-07-12T09:58:14+0000', + }, }, + createdAt: '2024-07-12T09:58:14+0000', + address: { city: 'San Miego' }, + first_name: 'John', + last_name: 'Doe', + lastUpdateSource: 'api', + lastModified: '2024-07-12T13:00:49+0000', }, - createdAt: '2024-07-12T09:58:14+0000', - address: { - city: 'San Miego', - }, - first_name: 'John', - last_name: 'Doe', - lastUpdateSource: 'api', - lastModified: '2024-07-12T13:00:49+0000', - }, - event: { - _id: '669141857b8cxxx1ba0da2x1', - ts: '2024-07-12T14:45:25+00:00', - ats: '2024-07-12T14:45:25+0000', - d: { - type: 'computer', - device: false, - platform: false, - browser: false, - robot: true, - }, - a: 'browse', - tzo: -7, - rl: 'a', - UID: '4934ee07197xx3f74d5xxxx7b0076', - time: '2024-07-12T14:45:25+0000', - action: 'browse', - bmID: '', - first: 0, - properties: { - category: 'Shirts', - url: 'http://example.com/shirts', - description: 'A really cool khaki shirt.', - price: 9.99, - title: 'Khaki Shirt', - test_key: 'value', + event: { + _id: '669141857b8cxxx1ba0da2x1', + ts: '2024-07-12T14:45:25+00:00', + ats: '2024-07-12T14:45:25+0000', + d: { + type: 'computer', + device: false, + platform: false, + browser: false, + robot: true, + }, + a: 'browse', + tzo: -7, + rl: 'a', + UID: '4934ee07197xx3f74d5xxxx7b0076', + time: '2024-07-12T14:45:25+0000', + action: 'browse', + bmID: '', + first: 0, + properties: { + category: 'Shirts', + url: 'http://example.com/shirts', + description: 'A really cool khaki shirt.', + price: 9.99, + title: 'Khaki Shirt', + test_key: 'value', + }, }, - }, + }), }, source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -550,13 +524,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'Cordial', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'Cordial' }, traits: { userId: '6690fe3655e334xx028xx1', email: 'jondoe@example.com', @@ -569,9 +538,7 @@ export const data = [ }, }, createdAt: '2024-07-12T09:58:14+0000', - address: { - city: 'San Miego', - }, + address: { city: 'San Miego' }, first_name: 'John', last_name: 'Doe', lastUpdateSource: 'api', @@ -586,9 +553,7 @@ export const data = [ }, externalId: [], }, - integrations: { - Cordial: false, - }, + integrations: { Cordial: false }, type: 'track', event: 'browse', originalTimestamp: '2024-07-12T14:45:25+00:00', @@ -621,8 +586,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/customerio/data.ts b/test/integrations/sources/customerio/data.ts index b831b1d0b07..ee4df648619 100644 --- a/test/integrations/sources/customerio/data.ts +++ b/test/integrations/sources/customerio/data.ts @@ -9,20 +9,25 @@ export const data = [ name: 'customerio', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: 'abc', + }), }, - event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', - object_type: 'customer', - metric: 'subscribed', - timestamp: 'abc', + source: {}, }, ], method: 'POST', @@ -60,20 +65,25 @@ export const data = [ name: 'customerio', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: '1585250199', + }), }, - event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', - object_type: 'customer', - metric: 'subscribed', - timestamp: '1585250199', + source: {}, }, ], method: 'POST', @@ -111,20 +121,25 @@ export const data = [ name: 'customerio', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', + object_type: 'customer', + metric: 'subscribed', + timestamp: 1585250199, + }), }, - event_id: '01E4C4CT6YDC7Y5M7FE1GWWPQJ', - object_type: 'customer', - metric: 'subscribed', - timestamp: 1585250199, + source: {}, }, ], method: 'POST', @@ -164,20 +179,25 @@ export const data = [ name: 'customerio', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4C6P79C12J5A6KPE6XNFD', + object_type: 'customer', + metric: 'unsubscribed', + timestamp: 1585250179, + }), }, - event_id: '01E4C4C6P79C12J5A6KPE6XNFD', - object_type: 'customer', - metric: 'unsubscribed', - timestamp: 1585250179, + source: {}, }, ], method: 'POST', @@ -217,22 +237,27 @@ export const data = [ name: 'customerio', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 36, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + request: { + body: JSON.stringify({ + data: { + action_id: 36, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + }, + event_id: '01E4C4G1S0AMNG0XVF2M7RPH5S', + object_type: 'email', + metric: 'drafted', + timestamp: 1585250305, + }), }, - event_id: '01E4C4G1S0AMNG0XVF2M7RPH5S', - object_type: 'email', - metric: 'drafted', - timestamp: 1585250305, + source: {}, }, ], method: 'POST', @@ -276,25 +301,30 @@ export const data = [ name: 'customerio', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - content_id: 1146, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=', - failure_message: '550 5.5.0 Requested action not taken: mailbox unavailable', - newsletter_id: 736, - recipient: 'test@example.com', - subject: 'Thanks for joining!', + request: { + body: JSON.stringify({ + data: { + content_id: 1146, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RMehBAAAAXE7r_ONUGXly9DBGkpq1JS31=', + failure_message: '550 5.5.0 Requested action not taken: mailbox unavailable', + newsletter_id: 736, + recipient: 'test@example.com', + subject: 'Thanks for joining!', + }, + event_id: '12ASDG7S9P6MAZPTJ78DAND9GDC', + object_type: 'email', + metric: 'bounced', + timestamp: 1234567890, + }), }, - event_id: '12ASDG7S9P6MAZPTJ78DAND9GDC', - object_type: 'email', - metric: 'bounced', - timestamp: 1234567890, + source: {}, }, ], method: 'POST', @@ -341,26 +371,31 @@ export const data = [ name: 'customerio', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 36, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgABcRhIBqSp7kiPekGBIeVh', - href: 'http://google.com', - link_id: 1, - recipient: 'test@example.com', - subject: 'hello', + request: { + body: JSON.stringify({ + data: { + action_id: 36, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgABcRhIBqSp7kiPekGBIeVh', + href: 'http://google.com', + link_id: 1, + recipient: 'test@example.com', + subject: 'hello', + }, + event_id: '01E4C8BES5XT87ZWRJFTB35YJ3', + object_type: 'email', + metric: 'clicked', + timestamp: 1585254348, + }), }, - event_id: '01E4C8BES5XT87ZWRJFTB35YJ3', - object_type: 'email', - metric: 'clicked', - timestamp: 1585254348, + source: {}, }, ], method: 'POST', @@ -407,26 +442,31 @@ export const data = [ name: 'customerio', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 42, - campaign_id: 23, - content: 'Welcome to the club, we are with you.', - customer_id: 'user-123', - delivery_id: 'RAECAAFwnUSneIa0ZXkmq8EdkAM==', - headers: { 'Custom-Header': ['custom-value'] }, - identifiers: { id: 'user-123' }, - recipient: 'test@example.com', - subject: 'Thanks for signing up', + request: { + body: JSON.stringify({ + data: { + action_id: 42, + campaign_id: 23, + content: 'Welcome to the club, we are with you.', + customer_id: 'user-123', + delivery_id: 'RAECAAFwnUSneIa0ZXkmq8EdkAM==', + headers: { 'Custom-Header': ['custom-value'] }, + identifiers: { id: 'user-123' }, + recipient: 'test@example.com', + subject: 'Thanks for signing up', + }, + event_id: '01E2EMRMM6TZ12TF9WGZN0WJQT', + metric: 'sent', + object_type: 'email', + timestamp: 1644227937, + }), }, - event_id: '01E2EMRMM6TZ12TF9WGZN0WJQT', - metric: 'sent', - object_type: 'email', - timestamp: 1644227937, + source: {}, }, ], method: 'POST', @@ -473,23 +513,28 @@ export const data = [ name: 'customerio', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: 'user-123', - delivery_id: 'REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==', - identifiers: { cio_id: '7ef807109981', id: 'user-123' }, - recipient: 'test@example.com', - subject: 'Thanks for signing up', - transactional_message_id: 2, + request: { + body: JSON.stringify({ + data: { + customer_id: 'user-123', + delivery_id: 'REAC4wUAAYYJgQgkyRqwwEPeOA6Nfv==', + identifiers: { cio_id: '7ef807109981', id: 'user-123' }, + recipient: 'test@example.com', + subject: 'Thanks for signing up', + transactional_message_id: 2, + }, + event_id: '01ER4R5WB62QWCNREKFB4DYXGR', + metric: 'delivered', + object_type: 'email', + timestamp: 1675196819, + }), }, - event_id: '01ER4R5WB62QWCNREKFB4DYXGR', - metric: 'delivered', - object_type: 'email', - timestamp: 1675196819, + source: {}, }, ], method: 'POST', @@ -508,7 +553,10 @@ export const data = [ context: { library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Customer.io' }, - traits: { cioId: '7ef807109981', email: 'test@example.com' }, + traits: { + cioId: '7ef807109981', + email: 'test@example.com', + }, }, integrations: { 'Customer.io': false }, type: 'track', @@ -534,23 +582,28 @@ export const data = [ name: 'customerio', description: 'test-9', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 38, - campaign_id: 6, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RAEABQFxN56fWzydfV4_EGvfobI=', - failure_message: 'NoDevicesSynced', + request: { + body: JSON.stringify({ + data: { + action_id: 38, + campaign_id: 6, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RAEABQFxN56fWzydfV4_EGvfobI=', + failure_message: 'NoDevicesSynced', + }, + event_id: '01E4VSX8SZ0T9AQMH4Q16NRB89', + object_type: 'push', + metric: 'attempted', + timestamp: 1585776075, + }), }, - event_id: '01E4VSX8SZ0T9AQMH4Q16NRB89', - object_type: 'push', - metric: 'attempted', - timestamp: 1585776075, + source: {}, }, ], method: 'POST', @@ -595,29 +648,34 @@ export const data = [ name: 'customerio', description: 'test-10', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 37, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', - recipients: [ - { - device_id: - 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', - device_platform: 'android', + request: { + body: JSON.stringify({ + data: { + action_id: 37, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + device_platform: 'android', + }, + ], }, - ], + event_id: '01E4C4HDQ7P1X9KTKF0ZX7PWHE', + object_type: 'push', + metric: 'sent', + timestamp: 1585250350, + }), }, - event_id: '01E4C4HDQ7P1X9KTKF0ZX7PWHE', - object_type: 'push', - metric: 'sent', - timestamp: 1585250350, + source: {}, }, ], method: 'POST', @@ -668,30 +726,35 @@ export const data = [ name: 'customerio', description: 'test-11', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 37, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', - href: 'ciosas://product/2', - link_id: 1, - recipients: [ - { - device_id: - 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + request: { + body: JSON.stringify({ + data: { + action_id: 37, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + href: 'ciosas://product/2', + link_id: 1, + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + }, + ], }, - ], + event_id: '01E4V2SBHYK4TNTG8WKMP39G9R', + object_type: 'push', + metric: 'clicked', + timestamp: 1585751829, + }), }, - event_id: '01E4V2SBHYK4TNTG8WKMP39G9R', - object_type: 'push', - metric: 'clicked', - timestamp: 1585751829, + source: {}, }, ], method: 'POST', @@ -742,24 +805,29 @@ export const data = [ name: 'customerio', description: 'test-12', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 41, - campaign_id: 7, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'ROk1AAIBcR4iT6mueuxiDtzO8HXv', - failure_message: - "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309.", + request: { + body: JSON.stringify({ + data: { + action_id: 41, + campaign_id: 7, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'ROk1AAIBcR4iT6mueuxiDtzO8HXv', + failure_message: + "Twilio Error 21408: Permission to send an SMS has not been enabled for the region indicated by the 'To' number: +18008675309.", + }, + event_id: '01E4F3DCS83P8HT7R3E6DWQN1X', + object_type: 'sms', + metric: 'attempted', + timestamp: 1234567890, + }), }, - event_id: '01E4F3DCS83P8HT7R3E6DWQN1X', - object_type: 'sms', - metric: 'attempted', - timestamp: 1234567890, + source: {}, }, ], method: 'POST', @@ -805,25 +873,30 @@ export const data = [ name: 'customerio', description: 'test-13', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 38, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgIBcRh6qzHz-8gKvscP2UZa', - href: 'https://app.com/verify', - link_id: 1, - recipient: '+18008675309', + request: { + body: JSON.stringify({ + data: { + action_id: 38, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgIBcRh6qzHz-8gKvscP2UZa', + href: 'https://app.com/verify', + link_id: 1, + recipient: '+18008675309', + }, + event_id: '01E4XXPN42JDF4B1ATQKTZ8WHV', + object_type: 'sms', + metric: 'clicked', + timestamp: 1585847161, + }), }, - event_id: '01E4XXPN42JDF4B1ATQKTZ8WHV', - object_type: 'sms', - metric: 'clicked', - timestamp: 1585847161, + source: {}, }, ], method: 'POST', @@ -869,23 +942,28 @@ export const data = [ name: 'customerio', description: 'test-14', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 39, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgQBcRhNAufb0s30bmz5HD7Y', - recipient: '#signups', + request: { + body: JSON.stringify({ + data: { + action_id: 39, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgQBcRhNAufb0s30bmz5HD7Y', + recipient: '#signups', + }, + event_id: '01E4C4TQKD6KJ274870J5DE2HB', + object_type: 'slack', + metric: 'sent', + timestamp: 1585250655, + }), }, - event_id: '01E4C4TQKD6KJ274870J5DE2HB', - object_type: 'slack', - metric: 'sent', - timestamp: 1585250655, + source: {}, }, ], method: 'POST', @@ -930,25 +1008,30 @@ export const data = [ name: 'customerio', description: 'test-15', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 39, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgQBcRhocpCJE3mFfwvRzNe6', - href: 'http://bing.com', - link_id: 1, - recipient: '#signups', + request: { + body: JSON.stringify({ + data: { + action_id: 39, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgQBcRhocpCJE3mFfwvRzNe6', + href: 'http://bing.com', + link_id: 1, + recipient: '#signups', + }, + event_id: '01E4C6HJTBNDX18XC4B88M3Y2G', + object_type: 'slack', + metric: 'clicked', + timestamp: 1585252451, + }), }, - event_id: '01E4C6HJTBNDX18XC4B88M3Y2G', - object_type: 'slack', - metric: 'clicked', - timestamp: 1585252451, + source: {}, }, ], method: 'POST', @@ -994,23 +1077,28 @@ export const data = [ name: 'customerio', description: 'test-16', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 39, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgQBcRhIBqRiZAc0fyQiLvkC', - failure_message: 'value passed for channel was invalid', + request: { + body: JSON.stringify({ + data: { + action_id: 39, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgQBcRhIBqRiZAc0fyQiLvkC', + failure_message: 'value passed for channel was invalid', + }, + event_id: '01E4C4HDQ77BCN0X23Z3WBE764', + object_type: 'slack', + metric: 'failed', + timestamp: 1585250350, + }), }, - event_id: '01E4C4HDQ77BCN0X23Z3WBE764', - object_type: 'slack', - metric: 'failed', - timestamp: 1585250350, + source: {}, }, ], method: 'POST', @@ -1055,22 +1143,27 @@ export const data = [ name: 'customerio', description: 'test-17', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 40, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgEBcRhIBqSrYcXDr2ks6Pj9', + request: { + body: JSON.stringify({ + data: { + action_id: 40, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgEBcRhIBqSrYcXDr2ks6Pj9', + }, + event_id: '01E4C4G1S04QCV1NASF4NWMQNR', + object_type: 'webhook', + metric: 'drafted', + timestamp: 1585250305, + }), }, - event_id: '01E4C4G1S04QCV1NASF4NWMQNR', - object_type: 'webhook', - metric: 'drafted', - timestamp: 1585250305, + source: {}, }, ], method: 'POST', @@ -1114,23 +1207,28 @@ export const data = [ name: 'customerio', description: 'test-18', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 38, - broadcast_id: 6, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RAECAQFxNeUBx6LqgjqrN1j-BJc=', - failure_message: "Variable 'customer.test' is missing", + request: { + body: JSON.stringify({ + data: { + action_id: 38, + broadcast_id: 6, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RAECAQFxNeUBx6LqgjqrN1j-BJc=', + failure_message: "Variable 'customer.test' is missing", + }, + event_id: '01E4TYA2KA9T0XGHCRJ784B774', + object_type: 'webhook', + metric: 'attempted', + timestamp: 1585747134, + }), }, - event_id: '01E4TYA2KA9T0XGHCRJ784B774', - object_type: 'webhook', - metric: 'attempted', - timestamp: 1585747134, + source: {}, }, ], method: 'POST', @@ -1175,23 +1273,28 @@ export const data = [ name: 'customerio', description: 'test-19', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 40, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgEBcRhNAufr2aU82jtDZEh6', - recipient: 'https://test.example.com/process', + request: { + body: JSON.stringify({ + data: { + action_id: 40, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgEBcRhNAufr2aU82jtDZEh6', + recipient: 'https://test.example.com/process', + }, + event_id: '01E4C6EP0HCKRHKFARMZ5XEH7A', + object_type: 'webhook', + metric: 'sent', + timestamp: 1585252357, + }), }, - event_id: '01E4C6EP0HCKRHKFARMZ5XEH7A', - object_type: 'webhook', - metric: 'sent', - timestamp: 1585252357, + source: {}, }, ], method: 'POST', @@ -1236,25 +1339,30 @@ export const data = [ name: 'customerio', description: 'test-20', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 40, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgEBcRhNAufr2aU82jtDZEh6', - href: 'http://bing.com', - link_id: 1, - recipient: 'https://test.example.com/process', + request: { + body: JSON.stringify({ + data: { + action_id: 40, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgEBcRhNAufr2aU82jtDZEh6', + href: 'http://bing.com', + link_id: 1, + recipient: 'https://test.example.com/process', + }, + event_id: '01E4C6F5N1Y54TVGJTN64Y1ZS9', + object_type: 'webhook', + metric: 'clicked', + timestamp: 1585252373, + }), }, - event_id: '01E4C6F5N1Y54TVGJTN64Y1ZS9', - object_type: 'webhook', - metric: 'clicked', - timestamp: 1585252373, + source: {}, }, ], method: 'POST', @@ -1300,23 +1408,28 @@ export const data = [ name: 'customerio', description: 'test-21', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 38, - broadcast_id: 6, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RAECAQFxNeK3bC4SYqhQqFGBQrQ=', - failure_message: 'HTTP 404 Not Found []', + request: { + body: JSON.stringify({ + data: { + action_id: 38, + broadcast_id: 6, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RAECAQFxNeK3bC4SYqhQqFGBQrQ=', + failure_message: 'HTTP 404 Not Found []', + }, + event_id: '01E4TY5FVB0ZQ4KVDKRME0XSYZ', + object_type: 'webhook', + metric: 'failed', + timestamp: 1585746984, + }), }, - event_id: '01E4TY5FVB0ZQ4KVDKRME0XSYZ', - object_type: 'webhook', - metric: 'failed', - timestamp: 1585746984, + source: {}, }, ], method: 'POST', @@ -1361,30 +1474,35 @@ export const data = [ name: 'customerio', description: 'test-22', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - action_id: 37, - broadcast_id: 9, - customer_id: '0200102', - identifiers: { id: '0200102' }, - delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', - href: 'ciosas://product/2', - link_id: 1, - recipients: [ - { - device_id: - 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + request: { + body: JSON.stringify({ + data: { + action_id: 37, + broadcast_id: 9, + customer_id: '0200102', + identifiers: { id: '0200102' }, + delivery_id: 'RPILAgUBcRhIBqSfeiIwdIYJKxTY', + href: 'ciosas://product/2', + link_id: 1, + recipients: [ + { + device_id: + 'eeC2XC_NVPo:APA91bEYRSgmu-dAZcOWi7RzKBbT9gdY3WJACOpLQEMAmAOsChJMAZWirvSlSF3EuHxb7qdwlYeOyCWtbsnR14Vyx5nwBmg5J3SyPxfNn-ey1tNgXIj5UOq8IBk2VwzMApk-xzD4JJof', + }, + ], }, - ], + event_id: '01E4V2SBHYK4TNTG8WKMP39G9S', + object_type: 'push', + metric: 'delivered', + timestamp: 1585751830, + }), }, - event_id: '01E4V2SBHYK4TNTG8WKMP39G9S', - object_type: 'push', - metric: 'delivered', - timestamp: 1585751830, + source: {}, }, ], method: 'POST', @@ -1435,20 +1553,25 @@ export const data = [ name: 'customerio', description: 'test-23: email subscribed', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - data: { - customer_id: '0200102', - identifiers: { id: '0200102' }, - email_address: 'test@example.com', + request: { + body: JSON.stringify({ + data: { + customer_id: '0200102', + identifiers: { id: '0200102' }, + email_address: 'test@example.com', + }, + event_id: '01E4C4C6P79C12J5A6KPE6XNFD', + object_type: 'email', + metric: 'subscribed', + timestamp: 1585250179, + }), }, - event_id: '01E4C4C6P79C12J5A6KPE6XNFD', - object_type: 'email', - metric: 'subscribed', - timestamp: 1585250179, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/formsort/data.ts b/test/integrations/sources/formsort/data.ts index ef275f6c1c4..854ba8a72e5 100644 --- a/test/integrations/sources/formsort/data.ts +++ b/test/integrations/sources/formsort/data.ts @@ -3,23 +3,28 @@ export const data = [ name: 'formsort', description: 'when we receive finalized as false', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - answers: { - yes: true, - enter_email: 'test@user.com', - enter_name: '2022-11-17', - yes_or_no: false, + request: { + body: JSON.stringify({ + answers: { + yes: true, + enter_email: 'test@user.com', + enter_name: '2022-11-17', + yes_or_no: false, + }, + responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', + flow_label: 'new-flow-2022-11-25', + variant_label: 'main', + variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', + finalized: false, + created_at: '2022-11-25T14:41:22+00:00', + }), }, - responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', - flow_label: 'new-flow-2022-11-25', - variant_label: 'main', - variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', - finalized: false, - created_at: '2022-11-25T14:41:22+00:00', + source: {}, }, ], method: 'POST', @@ -65,23 +70,28 @@ export const data = [ name: 'formsort', description: 'when we receive finalized as true', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - answers: { - yes: true, - enter_email: 'test@user.com', - enter_name: '2022-11-17', - yes_or_no: false, + request: { + body: JSON.stringify({ + answers: { + yes: true, + enter_email: 'test@user.com', + enter_name: '2022-11-17', + yes_or_no: false, + }, + responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', + flow_label: 'new-flow-2022-11-25', + variant_label: 'main', + variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', + finalized: true, + created_at: '2022-11-25T14:41:22+00:00', + }), }, - responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', - flow_label: 'new-flow-2022-11-25', - variant_label: 'main', - variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', - finalized: true, - created_at: '2022-11-25T14:41:22+00:00', + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/gainsightpx/data.ts b/test/integrations/sources/gainsightpx/data.ts index b3e3147ea9c..6f3bd56ee4a 100644 --- a/test/integrations/sources/gainsightpx/data.ts +++ b/test/integrations/sources/gainsightpx/data.ts @@ -3,95 +3,100 @@ export const data = [ name: 'gainsightpx', description: 'Identify Call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'SIGN_UP', - eventId: '1283c08b-f290-4bc4-9deb-75c7867d69ee', - propertyKey: 'AP-EOXPSEZGC5LA-2-1', - date: 1665582808376, - sessionId: 'AP-EOXPSEZGC5LA-2-1665582441084-16821368', - globalContext: {}, - userType: 'USER', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SIGN_UP', + eventId: '1283c08b-f290-4bc4-9deb-75c7867d69ee', + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + date: 1665582808376, + sessionId: 'AP-EOXPSEZGC5LA-2-1665582441084-16821368', + globalContext: {}, + userType: 'USER', + }, + configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + }), }, - configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + source: {}, }, ], method: 'POST', @@ -155,105 +160,110 @@ export const data = [ name: 'gainsightpx', description: 'Custom Track Call ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'CUSTOM', - eventId: 'df58cbd6-2736-4f8a-ad26-6049eac2e150', - propertyKey: 'AP-EOXPSEZGC5LA-2-1', - date: 1665656881448, - sessionId: 'AP-EOXPSEZGC5LA-2-1665656622955-48127533', - globalContext: {}, - userType: 'USER', - eventName: 'Product Clicked', - attributes: { - 'Audience Size': 5000, - name: 'TESTing TRACK CALL FIRST', - 'Launched date': 1520532660000, - Launched: true, - }, - url: 'http://127.0.0.1:5501/GPXTEST2.html', - referrer: '', - remoteHost: '122.161.66.140', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'CUSTOM', + eventId: 'df58cbd6-2736-4f8a-ad26-6049eac2e150', + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + date: 1665656881448, + sessionId: 'AP-EOXPSEZGC5LA-2-1665656622955-48127533', + globalContext: {}, + userType: 'USER', + eventName: 'Product Clicked', + attributes: { + 'Audience Size': 5000, + name: 'TESTing TRACK CALL FIRST', + 'Launched date': 1520532660000, + Launched: true, + }, + url: 'http://127.0.0.1:5501/GPXTEST2.html', + referrer: '', + remoteHost: '122.161.66.140', + }, + configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + }), }, - configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + source: {}, }, ], method: 'POST', @@ -329,101 +339,106 @@ export const data = [ name: 'gainsightpx', description: 'Feedback Track Call ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'FEEDBACK', - eventId: 'd007bd76-decb-4a77-8456-d84fb15c6a83', - propertyKey: 'AP-E9VUBBLZ6BIS-2-1', - date: 1665415753621, - sessionId: 'AP-E9VUBBLZ6BIS-2-1665415678379-45445457', - globalContext: null, - userType: 'USER', - subject: 'feedback title', - category: 'Labels test', - description: 'feedback body', - labels: ['492120f5-3573-11ec-bef0-42010a800545'], - remoteHost: '122.161.66.140', - source: 'Knowledge Center Bot', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'FEEDBACK', + eventId: 'd007bd76-decb-4a77-8456-d84fb15c6a83', + propertyKey: 'AP-E9VUBBLZ6BIS-2-1', + date: 1665415753621, + sessionId: 'AP-E9VUBBLZ6BIS-2-1665415678379-45445457', + globalContext: null, + userType: 'USER', + subject: 'feedback title', + category: 'Labels test', + description: 'feedback body', + labels: ['492120f5-3573-11ec-bef0-42010a800545'], + remoteHost: '122.161.66.140', + source: 'Knowledge Center Bot', + }, + configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + }), }, - configId: '32f07727-d231-4c9d-881e-fb50b80bad63', + source: {}, }, ], method: 'POST', @@ -500,96 +515,102 @@ export const data = [ name: 'gainsightpx', description: 'Feature Match Track Call ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'FEATURE_MATCH', - eventId: 'ae1e5538-1736-4088-86d1-e90a10ffe901-05951b40-944f-4052-9a4a-51c74683f658', - propertyKey: 'AP-8MF5LPSWUBFW-2-1', - date: 1665582808376, - sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', - globalContext: { role: 'Admin' }, - userType: 'USER', - featureId: '05951b40-944f-4052-9a4a-51c74683f658', - featureName: 'Charts', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'FEATURE_MATCH', + eventId: + 'ae1e5538-1736-4088-86d1-e90a10ffe901-05951b40-944f-4052-9a4a-51c74683f658', + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + date: 1665582808376, + sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', + globalContext: { role: 'Admin' }, + userType: 'USER', + featureId: '05951b40-944f-4052-9a4a-51c74683f658', + featureName: 'Charts', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -660,95 +681,100 @@ export const data = [ name: 'gainsightpx', description: 'Segment Match Track Call and no userId and yes anonymousId as event.sessionId', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'SEGMENT', - eventId: 'ddb9ca94-beb1-449c-bdcd-b53190f8e784', - propertyKey: 'AP-8MF5LPSWUBFW-2-1', - date: 1665582808376, - sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', - globalContext: { role: 'Admin' }, - userType: 'USER', - segmentId: 'e3ab2e48-24f9-4602-ab92-b9f1f4343845', - segmentName: 'Linux User', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SEGMENT', + eventId: 'ddb9ca94-beb1-449c-bdcd-b53190f8e784', + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + date: 1665582808376, + sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', + globalContext: { role: 'Admin' }, + userType: 'USER', + segmentId: 'e3ab2e48-24f9-4602-ab92-b9f1f4343845', + segmentName: 'Linux User', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -819,22 +845,27 @@ export const data = [ name: 'gainsightpx', description: 'No Match Track Call ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - eventType: 'Unavailable', - eventId: 'ddb9ca94-beb1-449c-bdcd-b53190f8e784', - propertyKey: 'AP-8MF5LPSWUBFW-2-1', - date: 1601303075964, - sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', - globalContext: { role: 'Admin' }, - userType: 'USER', - segmentId: 'e3ab2e48-24f9-4602-ab92-b9f1f4343845', - segmentName: 'Linux User', + request: { + body: JSON.stringify({ + event: { + eventType: 'Unavailable', + eventId: 'ddb9ca94-beb1-449c-bdcd-b53190f8e784', + propertyKey: 'AP-8MF5LPSWUBFW-2-1', + date: 1601303075964, + sessionId: 'AP-8MF5LPSWUBFW-2-1601303023809-98881162', + globalContext: { role: 'Admin' }, + userType: 'USER', + segmentId: 'e3ab2e48-24f9-4602-ab92-b9f1f4343845', + segmentName: 'Linux User', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -866,115 +897,120 @@ export const data = [ name: 'gainsightpx', description: 'Survey Track Call -> Multi Question Survey ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'SURVEY', - eventId: 'c9883e3b-05d4-4f96-8b9c-e2ce10430493', - propertyKey: 'AP-N6SV00EVMR1E-2-1', - date: 1601303075964, - sessionId: 'AP-N6SV00EVMR1E-2-1605265939566-23853426', - globalContext: { role: 'Admin' }, - userType: 'EMPTY_USER_TYPE', - contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', - engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', - engagementName: 'Quarterly Survey', - surveyType: 'Multi Question', - interaction: 'SINGLE_STEP_SURVEY_RESPONDED', - score: 0, - activation: 'Auto', - executionId: '1ad2d383-d1fa-425d-84f0-2a531e17a5d9', - executionDate: 1605265939965, - questionType: 'Multi choice', - questionId: 'de9e6bf1-351c-46ec-907d-c985bd420c2b', - questionHtml: - '
Favorite travel destinations
', - questionText: 'Favorite travel destinations', - answers: [ - { - answerId: '563e2103-2906-4088-869f-bcccd185f288', - answerHtml: '
Europe
', - answerText: 'Europe', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, }, - ], + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SURVEY', + eventId: 'c9883e3b-05d4-4f96-8b9c-e2ce10430493', + propertyKey: 'AP-N6SV00EVMR1E-2-1', + date: 1601303075964, + sessionId: 'AP-N6SV00EVMR1E-2-1605265939566-23853426', + globalContext: { role: 'Admin' }, + userType: 'EMPTY_USER_TYPE', + contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', + engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', + engagementName: 'Quarterly Survey', + surveyType: 'Multi Question', + interaction: 'SINGLE_STEP_SURVEY_RESPONDED', + score: 0, + activation: 'Auto', + executionId: '1ad2d383-d1fa-425d-84f0-2a531e17a5d9', + executionDate: 1605265939965, + questionType: 'Multi choice', + questionId: 'de9e6bf1-351c-46ec-907d-c985bd420c2b', + questionHtml: + '
Favorite travel destinations
', + questionText: 'Favorite travel destinations', + answers: [ + { + answerId: '563e2103-2906-4088-869f-bcccd185f288', + answerHtml: '
Europe
', + answerText: 'Europe', + }, + ], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1064,110 +1100,119 @@ export const data = [ name: 'gainsightpx', description: 'Survey Track Call -> NPS ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'SURVEY', - eventId: 'c9883e3b-05d4-4f96-8b9c-e2ce10430493', - propertyKey: 'AP-N6SV00EVMR1E-2-1', - date: 1601303075964, - sessionId: 'AP-N6SV00EVMR1E-2-1605265939566-23853426', - globalContext: { role: 'Admin' }, - userType: 'EMPTY_USER_TYPE', - contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', - engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', - engagementName: 'Quarterly Survey', - surveyType: 'Multi Question', - interaction: 'SINGLE_STEP_SURVEY_RESPONDED', - score: 0, - scoreType: null, - stepNumber: null, - userInput: 'I like new features', - activation: 'Auto', - executionId: '1ad2d383-d1fa-425d-84f0-2a531e17a5d9', - executionDate: 1605265939965, - questionType: 'Open text question', - questionHtml: - '
\n
\n How was your experience?\n
\n
\n', - questionText: 'How was your experience?', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SURVEY', + eventId: 'c9883e3b-05d4-4f96-8b9c-e2ce10430493', + propertyKey: 'AP-N6SV00EVMR1E-2-1', + date: 1601303075964, + sessionId: 'AP-N6SV00EVMR1E-2-1605265939566-23853426', + globalContext: { role: 'Admin' }, + userType: 'EMPTY_USER_TYPE', + contentType: 'IN_APP_MULTIPLE_QUESTION_SURVEY', + engagementId: 'e5362226-75da-4ef6-999a-823727e3d7a7', + engagementName: 'Quarterly Survey', + surveyType: 'Multi Question', + interaction: 'SINGLE_STEP_SURVEY_RESPONDED', + score: 0, + scoreType: null, + stepNumber: null, + userInput: 'I like new features', + activation: 'Auto', + executionId: '1ad2d383-d1fa-425d-84f0-2a531e17a5d9', + executionDate: 1605265939965, + questionType: 'Open text question', + questionHtml: + '
\n' + + '
\n' + + ' How was your experience?\n' + + '
\n' + + '
\n', + questionText: 'How was your experience?', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1229,7 +1274,11 @@ export const data = [ questionType: 'Open text question', score: 0, questionHtml: - '
\n
\n How was your experience?\n
\n
\n', + '
\n' + + '
\n' + + ' How was your experience?\n' + + '
\n' + + '
\n', questionText: 'How was your experience?', }, }, @@ -1250,103 +1299,108 @@ export const data = [ name: 'gainsightpx', description: 'Engagement Track Call ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'ENGAGEMENT', - eventId: '6494e73a-976b-4ee5-b8a8-de9effff7e80', - propertyKey: 'AP-N6SV00EVMR1E-2-1', - date: 1605262539389, - sessionId: 'AP-N6SV00EVMR1E-2-1605262502068-24197555', - globalContext: { role: 'Admin' }, - userType: 'EMPTY_USER_TYPE', - contentType: 'IN_APP_DIALOG', - engagementId: '83c30d4e-88c3-4054-a0fa-33451a6ea7fc', - engagementType: 'Dialog', - engagementName: 'Release Announcement', - interaction: 'VIEWED', - stepNumber: 1, - activation: 'Auto', - executionId: 'b633945f-d4a5-404a-ae39-5ced5b542240', - executionDate: 1605262539389, + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'ENGAGEMENT', + eventId: '6494e73a-976b-4ee5-b8a8-de9effff7e80', + propertyKey: 'AP-N6SV00EVMR1E-2-1', + date: 1605262539389, + sessionId: 'AP-N6SV00EVMR1E-2-1605262502068-24197555', + globalContext: { role: 'Admin' }, + userType: 'EMPTY_USER_TYPE', + contentType: 'IN_APP_DIALOG', + engagementId: '83c30d4e-88c3-4054-a0fa-33451a6ea7fc', + engagementType: 'Dialog', + engagementName: 'Release Announcement', + interaction: 'VIEWED', + stepNumber: 1, + activation: 'Auto', + executionId: 'b633945f-d4a5-404a-ae39-5ced5b542240', + executionDate: 1605262539389, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1421,120 +1475,125 @@ export const data = [ name: 'gainsightpx', description: 'SegmentIO S2S Track Call ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - user: { - aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', - identifyId: 'New!', - type: 'USER', - gender: 'EMPTY_GENDER', - email: 'userEmail@address.com', - firstName: 'test', - lastName: 'rudderlabs', - lastSeenDate: 1665582808669, - signUpDate: 1665582791753, - firstVisitDate: 1665582791753, - title: 'Mr.', - phone: '', - score: 0, - role: '', - subscriptionId: '', - accountId: 'IBM', - numberOfVisits: 1, - location: { - countryName: 'India', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665582808376, - lastModifiedDate: 1665582808717, - customAttributes: null, - globalUnsubscribe: false, - sfdcContactId: '', - lastVisitedUserAgentData: null, - id: 'New!', - lastInferredLocation: null, - }, - account: { - id: 'IBM', - name: 'International Business Machine', - trackedSubscriptionId: '', - sfdcId: '', - lastSeenDate: 1665582808669, - dunsNumber: '', - industry: '', - numberOfEmployees: 0, - sicCode: '', - website: '', - naicsCode: '', - plan: '', - location: { - countryName: '', - countryCode: '', - stateName: '', - stateCode: '', - city: '', - street: '', - postalCode: '', - continent: '', - regionName: '', - timeZone: '', - coordinates: { latitude: 0, longitude: 0 }, - }, - numberOfUsers: 0, - propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], - createDate: 1665578567565, - lastModifiedDate: 1665582808669, - customAttributes: null, - parentGroupId: '', - }, - event: { - eventType: 'SEGMENT_IO', - eventId: 'ajs-next-69810a17571dc115ccead5281cc3fb7d', - propertyKey: 'AP-EOXPSEZGC5LA-2-1', - date: 1666687235178, - sessionId: '31a524fa-1490-48db-9600-adfb1fa95333', - globalContext: {}, - userType: 'USER', - segmentIOEvent: { - pxPropertyKey: 'AP-EOXPSEZGC5LA-2', - type: 'group', - userId: '1001', - anonymousId: 'a4303a13-eb10-46d8-8935-d787daf1cfbd', - context: { - ip: '122.161.67.121', - library: { name: 'analytics.js', version: 'next-1.45.0' }, - locale: 'en-GB', - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36', - page: { - path: '/abc.html', - title: 'Engage Testing', - url: 'http://127.0.0.1:5501/abc.html', + request: { + body: JSON.stringify({ + user: { + aptrinsicId: 'cab9c469-8602-4933-acdb-68338fbb9ab1', + identifyId: 'New!', + type: 'USER', + gender: 'EMPTY_GENDER', + email: 'userEmail@address.com', + firstName: 'test', + lastName: 'rudderlabs', + lastSeenDate: 1665582808669, + signUpDate: 1665582791753, + firstVisitDate: 1665582791753, + title: 'Mr.', + phone: '', + score: 0, + role: '', + subscriptionId: '', + accountId: 'IBM', + numberOfVisits: 1, + location: { + countryName: 'India', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665582808376, + lastModifiedDate: 1665582808717, + customAttributes: null, + globalUnsubscribe: false, + sfdcContactId: '', + lastVisitedUserAgentData: null, + id: 'New!', + lastInferredLocation: null, + }, + account: { + id: 'IBM', + name: 'International Business Machine', + trackedSubscriptionId: '', + sfdcId: '', + lastSeenDate: 1665582808669, + dunsNumber: '', + industry: '', + numberOfEmployees: 0, + sicCode: '', + website: '', + naicsCode: '', + plan: '', + location: { + countryName: '', + countryCode: '', + stateName: '', + stateCode: '', + city: '', + street: '', + postalCode: '', + continent: '', + regionName: '', + timeZone: '', + coordinates: { latitude: 0, longitude: 0 }, + }, + numberOfUsers: 0, + propertyKeys: ['AP-EOXPSEZGC5LA-2-1'], + createDate: 1665578567565, + lastModifiedDate: 1665582808669, + customAttributes: null, + parentGroupId: '', + }, + event: { + eventType: 'SEGMENT_IO', + eventId: 'ajs-next-69810a17571dc115ccead5281cc3fb7d', + propertyKey: 'AP-EOXPSEZGC5LA-2-1', + date: 1666687235178, + sessionId: '31a524fa-1490-48db-9600-adfb1fa95333', + globalContext: {}, + userType: 'USER', + segmentIOEvent: { + pxPropertyKey: 'AP-EOXPSEZGC5LA-2', + type: 'group', + userId: '1001', + anonymousId: 'a4303a13-eb10-46d8-8935-d787daf1cfbd', + context: { + ip: '122.161.67.121', + library: { name: 'analytics.js', version: 'next-1.45.0' }, + locale: 'en-GB', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36', + page: { + path: '/abc.html', + title: 'Engage Testing', + url: 'http://127.0.0.1:5501/abc.html', + }, + }, + messageId: 'ajs-next-69810a17571dc115ccead5281cc3fb7d', + receivedAt: '2022-10-25T08:40:35.184Z', + sentAt: '2022-10-25T08:40:34.809Z', + timestamp: '2022-10-25T08:40:35.178Z', + traits: { name: 'International Business Machine' }, + version: 2, + channel: 'client', + groupId: 'IBM', }, }, - messageId: 'ajs-next-69810a17571dc115ccead5281cc3fb7d', - receivedAt: '2022-10-25T08:40:35.184Z', - sentAt: '2022-10-25T08:40:34.809Z', - timestamp: '2022-10-25T08:40:35.178Z', - traits: { name: 'International Business Machine' }, - version: 2, - channel: 'client', - groupId: 'IBM', - }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/iterable/data.ts b/test/integrations/sources/iterable/data.ts index e544cd2bc33..1f38695e5a0 100644 --- a/test/integrations/sources/iterable/data.ts +++ b/test/integrations/sources/iterable/data.ts @@ -3,23 +3,28 @@ export const data = [ name: 'iterable', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'test@rudderstack.com', - eventName: 'emailSubscribe', - dataFields: { - profileUpdatedAt: '2022-04-19 03:33:50 +00:00', - publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', - signupSource: 'WebForm', - email: 'test@rudderstack.com', - createdAt: '2022-04-19 03:33:50 +00:00', - messageTypeIds: [], - emailListIds: [1589748], - channelIds: [], + request: { + body: JSON.stringify({ + email: 'test@rudderstack.com', + eventName: 'emailSubscribe', + dataFields: { + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + email: 'test@rudderstack.com', + createdAt: '2022-04-19 03:33:50 +00:00', + messageTypeIds: [], + emailListIds: [1589748], + channelIds: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -67,22 +72,27 @@ export const data = [ name: 'iterable', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventName: 'emailSubscribe', - dataFields: { - profileUpdatedAt: '2022-04-19 03:33:50 +00:00', - publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', - signupSource: 'WebForm', - email: 'test@abcd.com', - createdAt: '2022-04-19 03:33:50 +00:00', - messageTypeIds: [], - emailListIds: [1589748], - channelIds: [], + request: { + body: JSON.stringify({ + eventName: 'emailSubscribe', + dataFields: { + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + email: 'test@abcd.com', + createdAt: '2022-04-19 03:33:50 +00:00', + messageTypeIds: [], + emailListIds: [1589748], + channelIds: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -114,20 +124,25 @@ export const data = [ name: 'iterable', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'test@ruddstack.com', - eventTitle: 'smsReceived', - dataFields: { - fromPhoneNumber: '+16503926753', - toPhoneNumber: '+14155824541', - smsMessage: 'Message text', - email: 'docs@iterable.com', - createdAt: '2016-12-05 22:51:25 +00:00', + request: { + body: JSON.stringify({ + email: 'test@ruddstack.com', + eventTitle: 'smsReceived', + dataFields: { + fromPhoneNumber: '+16503926753', + toPhoneNumber: '+14155824541', + smsMessage: 'Message text', + email: 'docs@iterable.com', + createdAt: '2016-12-05 22:51:25 +00:00', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -159,10 +174,20 @@ export const data = [ name: 'iterable', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { - body: [{ email: 'test@rudderstack.com', eventName: 'inAppSendSkip' }], + body: [ + { + request: { + body: JSON.stringify({ + email: 'test@rudderstack.com', + eventName: 'inAppSendSkip', + }), + }, + source: {}, + }, + ], method: 'POST', headers: { 'Content-Type': 'application/json' }, }, @@ -197,30 +222,35 @@ export const data = [ name: 'iterable', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'test@rudderstack.com', - eventName: 'emailSend', - dataFields: { - contentId: 331201, - email: 'test@rudderstack.com', - createdAt: '2016-12-02 20:21:04 +00:00', - campaignId: 59667, - templateId: 93849, - messageId: 'd0aa7801f91f4824997a631f3ed583c3', - emailSubject: 'My subject', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 3420, - messageTypeId: 3866, - experimentId: null, - emailId: 'c59667:t93849:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'test@rudderstack.com', + eventName: 'emailSend', + dataFields: { + contentId: 331201, + email: 'test@rudderstack.com', + createdAt: '2016-12-02 20:21:04 +00:00', + campaignId: 59667, + templateId: 93849, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c59667:t93849:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -275,30 +305,35 @@ export const data = [ name: 'iterable', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'invalid_email@iterable.com', - eventName: 'emailBounce', - dataFields: { - emailSubject: 'My subject', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 2598, - messageTypeId: 2870, - experimentId: null, - recipientState: 'HardBounce', - templateId: 167484, - email: 'invalid_email@iterable.com', - createdAt: '2017-05-15 23:59:47 +00:00', - campaignId: 114746, - messageId: 'd0aa7801f91f4824997a631f3ed583c3', - emailId: 'c114746:t167484:invalid_email@iterable.com', + request: { + body: JSON.stringify({ + email: 'invalid_email@iterable.com', + eventName: 'emailBounce', + dataFields: { + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2598, + messageTypeId: 2870, + experimentId: null, + recipientState: 'HardBounce', + templateId: 167484, + email: 'invalid_email@iterable.com', + createdAt: '2017-05-15 23:59:47 +00:00', + campaignId: 114746, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailId: 'c114746:t167484:invalid_email@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -353,39 +388,44 @@ export const data = [ name: 'iterable', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'emailClick', - dataFields: { - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36', - ip: '162.245.22.184', - templateId: 93849, - userAgentDevice: 'Mac', - url: 'https://www.iterable.com', - canonicalUrlId: '3145668988', - city: 'San Francisco', - region: 'CA', - email: 'docs@iterable.com', - createdAt: '2016-12-02 20:31:39 +00:00', - campaignId: 59667, - messageId: 'd0aa7801f91f4824997a631f3ed583c3', - emailSubject: 'My subject', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 3420, - messageTypeId: 3866, - experimentId: null, - linkUrl: 'https://www.iterable.com', - linkId: '3145668988', - emailId: 'c59667:t93849:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'emailClick', + dataFields: { + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36', + ip: '162.245.22.184', + templateId: 93849, + userAgentDevice: 'Mac', + url: 'https://www.iterable.com', + canonicalUrlId: '3145668988', + city: 'San Francisco', + region: 'CA', + email: 'docs@iterable.com', + createdAt: '2016-12-02 20:31:39 +00:00', + campaignId: 59667, + messageId: 'd0aa7801f91f4824997a631f3ed583c3', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + linkUrl: 'https://www.iterable.com', + linkId: '3145668988', + emailId: 'c59667:t93849:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -449,30 +489,35 @@ export const data = [ name: 'iterable', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'emailComplaint', - dataFields: { - recipientState: 'Complaint', - templateId: 79190, - email: 'docs@iterable.com', - createdAt: '2016-12-09 18:52:19 +00:00', - campaignId: 49313, - messageId: 'd3c44d47b4994306b4db8d16a94db025', - emailSubject: 'My subject', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'test template', - channelId: 3420, - messageTypeId: 3866, - experimentId: null, - emailId: 'c49313:t79190:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'emailComplaint', + dataFields: { + recipientState: 'Complaint', + templateId: 79190, + email: 'docs@iterable.com', + createdAt: '2016-12-09 18:52:19 +00:00', + campaignId: 49313, + messageId: 'd3c44d47b4994306b4db8d16a94db025', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'test template', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -527,34 +572,39 @@ export const data = [ name: 'iterable', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'emailOpen', - dataFields: { - userAgent: - 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', - proxySource: 'Gmail', - ip: '66.249.84.204', - templateId: 79190, - device: 'Gmail', - email: 'docs@iterable.com', - createdAt: '2016-12-02 18:51:45 +00:00', - campaignId: 49313, - messageId: '210badf49fe54f2591d64ad0d055f4fb', - emailSubject: 'My subject', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 3420, - messageTypeId: 3866, - experimentId: null, - emailId: 'c49313:t79190:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'emailOpen', + dataFields: { + userAgent: + 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', + proxySource: 'Gmail', + ip: '66.249.84.204', + templateId: 79190, + device: 'Gmail', + email: 'docs@iterable.com', + createdAt: '2016-12-02 18:51:45 +00:00', + campaignId: 49313, + messageId: '210badf49fe54f2591d64ad0d055f4fb', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -613,20 +663,25 @@ export const data = [ name: 'iterable', description: 'test-9', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'emailSendSkip', - dataFields: { - createdAt: '2019-08-07 18:56:10 +00:00', - reason: 'DuplicateMarketingMessage', - campaignId: 721398, - messageId: '98430abe1b9842c991ce221010121553', - email: 'docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'emailSendSkip', + dataFields: { + createdAt: '2019-08-07 18:56:10 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 721398, + messageId: '98430abe1b9842c991ce221010121553', + email: 'docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -671,23 +726,28 @@ export const data = [ name: 'iterable', description: 'test-10', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'test@rudderstack.com', - eventName: 'emailSubscribe', - dataFields: { - profileUpdatedAt: '2022-04-19 03:33:50 +00:00', - publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', - signupSource: 'WebForm', - email: 'test@abcd.com', - createdAt: '2022-04-19 03:33:50 +00:00', - messageTypeIds: [], - emailListIds: [1589748], - channelIds: [], + request: { + body: JSON.stringify({ + email: 'test@rudderstack.com', + eventName: 'emailSubscribe', + dataFields: { + profileUpdatedAt: '2022-04-19 03:33:50 +00:00', + publicIdString: 'ad474bf7-e785-480f-b9d0-861b85ab5bf5', + signupSource: 'WebForm', + email: 'test@abcd.com', + createdAt: '2022-04-19 03:33:50 +00:00', + messageTypeIds: [], + emailListIds: [1589748], + channelIds: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -735,35 +795,40 @@ export const data = [ name: 'iterable', description: 'test-11', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'emailUnSubscribe', - dataFields: { - campaignId: 1089024, - messageId: 'bf008db8ab194b65816398c05bf30f99', - emailId: 'c1089024:t1526112:docs@iterable.com', - workflowName: 'My test workflow', - messageTypeIds: [], - locale: null, - templateId: 1526112, - emailSubject: 'Upcoming events!', - labels: [], - unsubSource: 'EmailLink', - createdAt: '2020-03-20 23:34:15 +00:00', - templateName: 'My test template', - emailListIds: [], - messageTypeId: 31082, - experimentId: null, - channelIds: [27447], - campaignName: 'My test campaign', - workflowId: 76786, - email: 'docs@iterable.com', - channelId: 27447, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'emailUnSubscribe', + dataFields: { + campaignId: 1089024, + messageId: 'bf008db8ab194b65816398c05bf30f99', + emailId: 'c1089024:t1526112:docs@iterable.com', + workflowName: 'My test workflow', + messageTypeIds: [], + locale: null, + templateId: 1526112, + emailSubject: 'Upcoming events!', + labels: [], + unsubSource: 'EmailLink', + createdAt: '2020-03-20 23:34:15 +00:00', + templateName: 'My test template', + emailListIds: [], + messageTypeId: 31082, + experimentId: null, + channelIds: [27447], + campaignName: 'My test campaign', + workflowId: 76786, + email: 'docs@iterable.com', + channelId: 27447, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -823,40 +888,45 @@ export const data = [ name: 'iterable', description: 'test-12', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - userId: '1', - eventName: 'hostedUnsubscribeClick', - dataFields: { - country: 'United States', - city: 'San Jose', - campaignId: 1074721, - ip: '192.168.0.1', - userAgentDevice: 'Mac', - messageId: 'ceb3d4d929fc406ca93b28a0ef1efff1', - emailId: 'c1074721:t1506266:docs@iterable.com', - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', - workflowName: 'My workflow', - locale: null, - templateId: 1506266, - emailSubject: 'My email subject', - url: 'https://iterable.com', - labels: [], - createdAt: '2020-03-21 00:24:08 +00:00', - templateName: 'My email template', - messageTypeId: 13406, - experimentId: null, - region: 'CA', - campaignName: 'My email campaign', - workflowId: 60102, - email: 'docs@iterable.com', - channelId: 12466, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + userId: '1', + eventName: 'hostedUnsubscribeClick', + dataFields: { + country: 'United States', + city: 'San Jose', + campaignId: 1074721, + ip: '192.168.0.1', + userAgentDevice: 'Mac', + messageId: 'ceb3d4d929fc406ca93b28a0ef1efff1', + emailId: 'c1074721:t1506266:docs@iterable.com', + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + workflowName: 'My workflow', + locale: null, + templateId: 1506266, + emailSubject: 'My email subject', + url: 'https://iterable.com', + labels: [], + createdAt: '2020-03-21 00:24:08 +00:00', + templateName: 'My email template', + messageTypeId: 13406, + experimentId: null, + region: 'CA', + campaignName: 'My email campaign', + workflowId: 60102, + email: 'docs@iterable.com', + channelId: 12466, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -920,18 +990,23 @@ export const data = [ name: 'iterable', description: 'test-13', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'inAppClick', - dataFields: { - email: 'docs@iterable.com', - createdAt: '2018-03-27 00:44:40 +00:00', - campaignId: 269450, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'inAppClick', + dataFields: { + email: 'docs@iterable.com', + createdAt: '2018-03-27 00:44:40 +00:00', + campaignId: 269450, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -955,7 +1030,10 @@ export const data = [ }, event: 'inAppClick', integrations: { Iterable: false }, - properties: { createdAt: '2018-03-27 00:44:40 +00:00', campaignId: 269450 }, + properties: { + createdAt: '2018-03-27 00:44:40 +00:00', + campaignId: 269450, + }, receivedAt: '2018-03-27T00:44:40.000Z', timestamp: '2018-03-27T00:44:40.000Z', type: 'track', @@ -971,18 +1049,23 @@ export const data = [ name: 'iterable', description: 'test-14', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'inAppOpen', - dataFields: { - email: 'docs@iterable.com', - createdAt: '2018-03-27 00:44:30 +00:00', - campaignId: 269450, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'inAppOpen', + dataFields: { + email: 'docs@iterable.com', + createdAt: '2018-03-27 00:44:30 +00:00', + campaignId: 269450, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1006,7 +1089,10 @@ export const data = [ }, event: 'inAppOpen', integrations: { Iterable: false }, - properties: { createdAt: '2018-03-27 00:44:30 +00:00', campaignId: 269450 }, + properties: { + createdAt: '2018-03-27 00:44:30 +00:00', + campaignId: 269450, + }, receivedAt: '2018-03-27T00:44:30.000Z', timestamp: '2018-03-27T00:44:30.000Z', type: 'track', @@ -1022,34 +1108,39 @@ export const data = [ name: 'iterable', description: 'test-15', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'inAppSend', - dataFields: { - messageContext: { saveToInbox: false, trigger: 'immediate' }, - campaignId: 732678, - contentId: 18997, - messageId: 'vA16d48VVi4LQ5hMuZuquKzL0BXTdQJJUMJRjKnL1', - workflowName: null, - emailId: 'c732678:t1032729:docs@iterable.com', - locale: null, - templateId: 1032729, - inAppBody: '', - email: 'docs@iterable.com', - createdAt: '2016-12-10 01:00:38 +00:00', - campaignId: 74768, - templateId: 113554, - pushMessage: 'Push message text', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 2203, - messageTypeId: 2439, - experimentId: null, - payload: { path: 'yourpath/subpath' }, - sound: '', - badge: null, - contentAvailable: false, - deeplink: null, - locale: null, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'pushBounce', + dataFields: { + platformEndpoint: '', + email: 'docs@iterable.com', + createdAt: '2016-12-10 01:00:38 +00:00', + campaignId: 74768, + templateId: 113554, + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'yourpath/subpath' }, + sound: '', + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1280,34 +1381,39 @@ export const data = [ name: 'iterable', description: 'test-18', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'pushOpen', - dataFields: { - appAlreadyRunning: false, - email: 'docs@iterable.com', - createdAt: '2016-12-08 01:25:22 +00:00', - campaignId: 74768, - templateId: 113554, - pushMessage: 'Push message text', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 2203, - messageTypeId: 2439, - experimentId: null, - payload: { path: 'shop_home' }, - sound: null, - badge: null, - contentAvailable: false, - deeplink: null, - locale: null, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'pushOpen', + dataFields: { + appAlreadyRunning: false, + email: 'docs@iterable.com', + createdAt: '2016-12-08 01:25:22 +00:00', + campaignId: 74768, + templateId: 113554, + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'shop_home' }, + sound: null, + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1366,36 +1472,41 @@ export const data = [ name: 'iterable', description: 'test-19', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'pushSend', - dataFields: { - contentId: 6724, - platformEndpoint: '', - email: 'docs@iterable.com', - createdAt: '2016-12-08 00:53:11 +00:00', - campaignId: 74758, - templateId: 113541, - messageId: '73f2d3f13cd04db0b56c6143b179adc5', - pushMessage: 'Push message text', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 1744, - messageTypeId: 1759, - experimentId: null, - payload: { a: '2' }, - sound: '', - badge: '', - contentAvailable: false, - deeplink: null, - locale: null, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'pushSend', + dataFields: { + contentId: 6724, + platformEndpoint: '', + email: 'docs@iterable.com', + createdAt: '2016-12-08 00:53:11 +00:00', + campaignId: 74758, + templateId: 113541, + messageId: '73f2d3f13cd04db0b56c6143b179adc5', + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 1744, + messageTypeId: 1759, + experimentId: null, + payload: { a: '2' }, + sound: '', + badge: '', + contentAvailable: false, + deeplink: null, + locale: null, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1456,20 +1567,25 @@ export const data = [ name: 'iterable', description: 'test-20', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'pushSendSkip', - dataFields: { - createdAt: '2019-08-07 22:28:51 +00:00', - reason: 'DuplicateMarketingMessage', - campaignId: 732667, - messageId: '8306ae0c74324635b7554947c5ec0e56', - email: 'docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'pushSendSkip', + dataFields: { + createdAt: '2019-08-07 22:28:51 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 732667, + messageId: '8306ae0c74324635b7554947c5ec0e56', + email: 'docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1514,36 +1630,41 @@ export const data = [ name: 'iterable', description: 'test-21', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'pushUninstall', - dataFields: { - isGhostPush: false, - platformEndpoint: '', - email: 'docs@iterable.com', - createdAt: '2016-12-09 20:50:54 +00:00', - campaignId: 74768, - templateId: 113554, - messageId: '73f2d3f13cd04db0b56c6143b179adc5', - pushMessage: 'Push message text', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 2203, - messageTypeId: 2439, - experimentId: null, - payload: { path: 'your_folder/30' }, - sound: '', - badge: null, - contentAvailable: false, - deeplink: null, - locale: null, + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'pushUninstall', + dataFields: { + isGhostPush: false, + platformEndpoint: '', + email: 'docs@iterable.com', + createdAt: '2016-12-09 20:50:54 +00:00', + campaignId: 74768, + templateId: 113554, + messageId: '73f2d3f13cd04db0b56c6143b179adc5', + pushMessage: 'Push message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 2203, + messageTypeId: 2439, + experimentId: null, + payload: { path: 'your_folder/30' }, + sound: '', + badge: null, + contentAvailable: false, + deeplink: null, + locale: null, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1604,38 +1725,43 @@ export const data = [ name: 'iterable', description: 'test-22', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'smsBounce', - dataFields: { - smsProviderResponse: { - status: 404, - message: - 'The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found', - code: 20404, - more_info: 'https://www.twilio.com/docs/errors/20404', - }, - email: 'docs@iterable.com', - createdAt: '2016-12-05 22:43:24 +00:00', - campaignId: 74003, - templateId: 112561, - smsMessage: "Here is example message, please respond with 'received'", - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 4270, - messageTypeId: 4769, - experimentId: null, - fromPhoneNumberId: 268, - imageUrl: null, - locale: null, - emailId: 'c74003:t112561:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'smsBounce', + dataFields: { + smsProviderResponse: { + status: 404, + message: + 'The requested resource /2010-04-01/Accounts/ACCOUNT_NUMBER/Messages.json was not found', + code: 20404, + more_info: 'https://www.twilio.com/docs/errors/20404', + }, + email: 'docs@iterable.com', + createdAt: '2016-12-05 22:43:24 +00:00', + campaignId: 74003, + templateId: 112561, + smsMessage: "Here is example message, please respond with 'received'", + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 4270, + messageTypeId: 4769, + experimentId: null, + fromPhoneNumberId: 268, + imageUrl: null, + locale: null, + emailId: 'c74003:t112561:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1698,34 +1824,39 @@ export const data = [ name: 'iterable', description: 'test-23', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'smsClick', - dataFields: { - campaignId: 1234567, - campaignName: 'My test campaign', - workflowId: null, - workflowName: null, - templateName: 'My template', - locale: null, - channelId: 98765, - messageTypeId: 43210, - experimentId: null, - labels: [], - smsMessage: 'Test SMS! https://www.example.com', - fromPhoneNumberId: 1234, - imageUrl: null, - clickedUrl: 'https://www.example.com', - email: 'docs@iterable.com', - createdAt: '2022-03-10 05:00:14 +00:00', - templateId: 1112222, - messageId: 'ebd8f3cfc1f74353b423c5e0f3dd8b39', - emailId: 'c1234567:t9876543:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'smsClick', + dataFields: { + campaignId: 1234567, + campaignName: 'My test campaign', + workflowId: null, + workflowName: null, + templateName: 'My template', + locale: null, + channelId: 98765, + messageTypeId: 43210, + experimentId: null, + labels: [], + smsMessage: 'Test SMS! https://www.example.com', + fromPhoneNumberId: 1234, + imageUrl: null, + clickedUrl: 'https://www.example.com', + email: 'docs@iterable.com', + createdAt: '2022-03-10 05:00:14 +00:00', + templateId: 1112222, + messageId: 'ebd8f3cfc1f74353b423c5e0f3dd8b39', + emailId: 'c1234567:t9876543:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1784,20 +1915,25 @@ export const data = [ name: 'iterable', description: 'test-24', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'smsReceived', - dataFields: { - fromPhoneNumber: '+16503926753', - toPhoneNumber: '+14155824541', - smsMessage: 'Message text', - email: 'docs@iterable.com', - createdAt: '2016-12-05 22:51:25 +00:00', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'smsReceived', + dataFields: { + fromPhoneNumber: '+16503926753', + toPhoneNumber: '+14155824541', + smsMessage: 'Message text', + email: 'docs@iterable.com', + createdAt: '2016-12-05 22:51:25 +00:00', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1842,34 +1978,39 @@ export const data = [ name: 'iterable', description: 'test-25', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'smsSend', - dataFields: { - toPhoneNumber: '+16503926753', - fromSMSSenderId: 258, - contentId: 2086, - email: 'docs@iterable.com', - createdAt: '2016-12-05 21:50:32 +00:00', - campaignId: 73974, - templateId: 112523, - smsMessage: 'Message text', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 4270, - messageTypeId: 4769, - experimentId: null, - fromPhoneNumberId: 258, - imageUrl: null, - locale: null, - emailId: 'c73974:t112523:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'smsSend', + dataFields: { + toPhoneNumber: '+16503926753', + fromSMSSenderId: 258, + contentId: 2086, + email: 'docs@iterable.com', + createdAt: '2016-12-05 21:50:32 +00:00', + campaignId: 73974, + templateId: 112523, + smsMessage: 'Message text', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 4270, + messageTypeId: 4769, + experimentId: null, + fromPhoneNumberId: 258, + imageUrl: null, + locale: null, + emailId: 'c73974:t112523:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1928,20 +2069,25 @@ export const data = [ name: 'iterable', description: 'test-26', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'smsSendSkip', - dataFields: { - createdAt: '2019-08-07 18:49:48 +00:00', - reason: 'DuplicateMarketingMessage', - campaignId: 729390, - messageId: '2c780bf42f26485db0fc6571d2e0f6a0', - email: 'docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'smsSendSkip', + dataFields: { + createdAt: '2019-08-07 18:49:48 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 729390, + messageId: '2c780bf42f26485db0fc6571d2e0f6a0', + email: 'docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -1986,34 +2132,39 @@ export const data = [ name: 'iterable', description: 'test-27', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'emailSend', - dataFields: { - contentId: 274222, - email: 'docs@iterable.com', - createdAt: '2016-12-02 18:51:40 +00:00', - campaignId: 49313, - transactionalData: { - __comment: - 'transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total.', - }, - templateId: 79190, - messageId: '210badf49fe54f2591d64ad0d055f4fb', - emailSubject: 'My subject', - campaignName: 'My campaign name', - workflowId: null, - workflowName: null, - templateName: 'My template name', - channelId: 3420, - messageTypeId: 3866, - experimentId: null, - emailId: 'c49313:t79190:docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'emailSend', + dataFields: { + contentId: 274222, + email: 'docs@iterable.com', + createdAt: '2016-12-02 18:51:40 +00:00', + campaignId: 49313, + transactionalData: { + __comment: + 'transactionalData lists the fields contained in the dataFields property of the API call or event used to trigger the email, campaign, or workflow. transactionalData must contain no more than 12k characters in total.', + }, + templateId: 79190, + messageId: '210badf49fe54f2591d64ad0d055f4fb', + emailSubject: 'My subject', + campaignName: 'My campaign name', + workflowId: null, + workflowName: null, + templateName: 'My template name', + channelId: 3420, + messageTypeId: 3866, + experimentId: null, + emailId: 'c49313:t79190:docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -2072,37 +2223,42 @@ export const data = [ name: 'iterable', description: 'test-28', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'webPushSend', - dataFields: { - campaignId: 723636, - browserToken: - 'cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b', - contentId: 3681, - messageId: 'af4c726ae76b48c7871b6d0d7760d47c', - workflowName: 'My workflow name', - emailId: 'c723636:t1020396:docs@iterable.com', - locale: null, - webPushIcon: null, - templateId: 1020396, - labels: [], - createdAt: '2019-08-07 23:43:02 +00:00', - templateName: 'My template name', - webPushMessage: '', - messageTypeId: 9106, - webPushBody: null, - experimentId: null, - webPushClickAction: null, - campaignName: 'My campaign name', - workflowId: 53505, - channelId: 8539, - email: 'docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'webPushSend', + dataFields: { + campaignId: 723636, + browserToken: + 'cZn_inqLGPk:APA91bHsn5jo0-4V55RB38eCeLHj8ZXVJYciU7k6Kipbit3lrRlEe2Dt6bNzR4lSf6r2YNVdWY8l90hV0jmb_Y7y5ufcJ68xNI7wbsH6Q2jbEghA_Qo4kWbtu6A4NZN4gxc1xsEbyh7b', + contentId: 3681, + messageId: 'af4c726ae76b48c7871b6d0d7760d47c', + workflowName: 'My workflow name', + emailId: 'c723636:t1020396:docs@iterable.com', + locale: null, + webPushIcon: null, + templateId: 1020396, + labels: [], + createdAt: '2019-08-07 23:43:02 +00:00', + templateName: 'My template name', + webPushMessage: '', + messageTypeId: 9106, + webPushBody: null, + experimentId: null, + webPushClickAction: null, + campaignName: 'My campaign name', + workflowId: 53505, + channelId: 8539, + email: 'docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -2164,20 +2320,25 @@ export const data = [ name: 'iterable', description: 'test-29', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - email: 'docs@iterable.com', - eventName: 'webPushSendSkip', - dataFields: { - createdAt: '2019-08-07 23:43:48 +00:00', - reason: 'DuplicateMarketingMessage', - campaignId: 723636, - messageId: '4238c918b20a41dfbe9a910275b76f12', - email: 'docs@iterable.com', + request: { + body: JSON.stringify({ + email: 'docs@iterable.com', + eventName: 'webPushSendSkip', + dataFields: { + createdAt: '2019-08-07 23:43:48 +00:00', + reason: 'DuplicateMarketingMessage', + campaignId: 723636, + messageId: '4238c918b20a41dfbe9a910275b76f12', + email: 'docs@iterable.com', + }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/mailjet/data.ts b/test/integrations/sources/mailjet/data.ts index 2a8f3eaf460..cc66aedbd94 100644 --- a/test/integrations/sources/mailjet/data.ts +++ b/test/integrations/sources/mailjet/data.ts @@ -3,25 +3,30 @@ export const data = [ name: 'mailjet', description: 'MailJet email open event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: 'open', - time: 1664443614, - MessageID: 94857068804950690, - Message_GUID: '54d6cdec-f659-4547-8926-13d9c4126b82', - email: 'test@rudderstack.com', - mj_campaign_id: 108760, - mj_contact_id: 399962859, - customcampaign: 'mj.nl=58424', - ip: '66.249.84.231', - geo: 'US', - agent: - 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', - CustomID: '', - Payload: '', + request: { + body: JSON.stringify({ + event: 'open', + time: 1664443614, + MessageID: 94857068804950690, + Message_GUID: '54d6cdec-f659-4547-8926-13d9c4126b82', + email: 'test@rudderstack.com', + mj_campaign_id: 108760, + mj_contact_id: 399962859, + customcampaign: 'mj.nl=58424', + ip: '66.249.84.231', + geo: 'US', + agent: + 'Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)', + CustomID: '', + Payload: '', + }), + }, + source: {}, }, ], method: 'POST', @@ -69,23 +74,28 @@ export const data = [ name: 'mailjet', description: 'MailJet email bounce event where input event is of type ', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: 'bounce', - time: 1664444171, - MessageID: 55169098999352350, - Message_GUID: '447d7eab-3335-4aba-9a51-09454bc14b81', - email: 'test@rudderstack.com', - mj_campaign_id: 108892, - mj_contact_id: 373142816, - customcampaign: 'mj.nl=58486', - blocked: false, - hard_bounce: false, - error_related_to: 'system', - error: 'connection issue', + request: { + body: JSON.stringify({ + event: 'bounce', + time: 1664444171, + MessageID: 55169098999352350, + Message_GUID: '447d7eab-3335-4aba-9a51-09454bc14b81', + email: 'test@rudderstack.com', + mj_campaign_id: 108892, + mj_contact_id: 373142816, + customcampaign: 'mj.nl=58486', + blocked: false, + hard_bounce: false, + error_related_to: 'system', + error: 'connection issue', + }), + }, + source: {}, }, ], method: 'POST', @@ -110,7 +120,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'bounce', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:11.000Z', userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', }, @@ -125,21 +138,26 @@ export const data = [ name: 'mailjet', description: 'MailJet email sent event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: 'sent', - time: 1664444171, - MessageID: 92886743924596480, - Message_GUID: '0230c73a-2b77-4aea-8ef2-ed15d0edc5fd', - email: 'test@rudderstack.com', - mj_campaign_id: 108892, - mj_contact_id: 372651182, - customcampaign: 'mj.nl=58486', - smtp_reply: - '250 2.0.0 OK DMARC:Quarantine 1664444171 u17-20020adfdd51000000b0022cc3f2bf13si3225188wrm.271 - gsmtp', + request: { + body: JSON.stringify({ + event: 'sent', + time: 1664444171, + MessageID: 92886743924596480, + Message_GUID: '0230c73a-2b77-4aea-8ef2-ed15d0edc5fd', + email: 'test@rudderstack.com', + mj_campaign_id: 108892, + mj_contact_id: 372651182, + customcampaign: 'mj.nl=58486', + smtp_reply: + '250 2.0.0 OK DMARC:Quarantine 1664444171 u17-20020adfdd51000000b0022cc3f2bf13si3225188wrm.271 - gsmtp', + }), + }, + source: {}, }, ], method: 'POST', @@ -164,7 +182,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'sent', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:11.000Z', userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', }, @@ -179,23 +200,28 @@ export const data = [ name: 'mailjet', description: 'MailJet email bounce event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: 'bounce', - time: 1664444170, - MessageID: 56013522696710744, - Message_GUID: 'dbe4f0a3-4a5a-4784-a724-a9794d3c0444', - email: 'test@rudderstack.com', - mj_campaign_id: 108892, - mj_contact_id: 373142182, - customcampaign: 'mj.nl=58486', - blocked: false, - hard_bounce: false, - error_related_to: 'system', - error: 'connection issue', + request: { + body: JSON.stringify({ + event: 'bounce', + time: 1664444170, + MessageID: 56013522696710744, + Message_GUID: 'dbe4f0a3-4a5a-4784-a724-a9794d3c0444', + email: 'test@rudderstack.com', + mj_campaign_id: 108892, + mj_contact_id: 373142182, + customcampaign: 'mj.nl=58486', + blocked: false, + hard_bounce: false, + error_related_to: 'system', + error: 'connection issue', + }), + }, + source: {}, }, ], method: 'POST', @@ -220,7 +246,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'bounce', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:10.000Z', userId: '5b6a3426dba2cb24e4f0aeec43bee9d7', }, @@ -235,23 +264,28 @@ export const data = [ name: 'mailjet', description: 'MailJet when no email is present', module: 'source', - version: 'v0', + version: 'v2', skipGo: 'FIXME', input: { request: { body: [ { - event: 'bounce', - time: 1664444170, - MessageID: 56013522696710744, - Message_GUID: 'dbe4f0a3-4a5a-4784-a724-a9794d3c0444', - mj_campaign_id: 108892, - mj_contact_id: 373142182, - customcampaign: 'mj.nl=58486', - blocked: false, - hard_bounce: false, - error_related_to: 'system', - error: 'connection issue', + request: { + body: JSON.stringify({ + event: 'bounce', + time: 1664444170, + MessageID: 56013522696710744, + Message_GUID: 'dbe4f0a3-4a5a-4784-a724-a9794d3c0444', + mj_campaign_id: 108892, + mj_contact_id: 373142182, + customcampaign: 'mj.nl=58486', + blocked: false, + hard_bounce: false, + error_related_to: 'system', + error: 'connection issue', + }), + }, + source: {}, }, ], method: 'POST', @@ -275,7 +309,10 @@ export const data = [ integrations: { MailJet: false }, type: 'track', event: 'bounce', - properties: { customcampaign: 'mj.nl=58486', mj_campaign_id: 108892 }, + properties: { + customcampaign: 'mj.nl=58486', + mj_campaign_id: 108892, + }, originalTimestamp: '2022-09-29T09:36:10.000Z', }, ], @@ -289,37 +326,47 @@ export const data = [ name: 'mailjet', description: 'MailJet Multiple payloads in single request', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: 'open', - time: 1704458040, - MessageID: 987654, - Message_GUID: '876r-oihugyf-7tfygh', - email: 'abc@r.com', - mj_campaign_id: 321, - mj_contact_id: 123, - customcampaign: 'test_campaign', - url: 'https://www.example.com/', - ip: 'ip_info', - geo: 'some geo info', - agent: 'mailjet api test', + request: { + body: JSON.stringify({ + event: 'open', + time: 1704458040, + MessageID: 987654, + Message_GUID: '876r-oihugyf-7tfygh', + email: 'abc@r.com', + mj_campaign_id: 321, + mj_contact_id: 123, + customcampaign: 'test_campaign', + url: 'https://www.example.com/', + ip: 'ip_info', + geo: 'some geo info', + agent: 'mailjet api test', + }), + }, + source: {}, }, { - event: 'click', - time: 1704458041, - MessageID: 12345234567, - Message_GUID: '12345-kjhgfd-2efv', - email: 'abc@r.com', - mj_campaign_id: 12, - mj_contact_id: 32532, - customcampaign: 'test_campaign', - url: 'https://www.example.com/', - ip: 'ip_info', - geo: 'some geo info', - agent: 'mailjet api test', + request: { + body: JSON.stringify({ + event: 'click', + time: 1704458041, + MessageID: 12345234567, + Message_GUID: '12345-kjhgfd-2efv', + email: 'abc@r.com', + mj_campaign_id: 12, + mj_contact_id: 32532, + customcampaign: 'test_campaign', + url: 'https://www.example.com/', + ip: 'ip_info', + geo: 'some geo info', + agent: 'mailjet api test', + }), + }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/mailmodo/data.ts b/test/integrations/sources/mailmodo/data.ts index aa34363831c..0b6d857dcf0 100644 --- a/test/integrations/sources/mailmodo/data.ts +++ b/test/integrations/sources/mailmodo/data.ts @@ -3,21 +3,26 @@ export const data = [ name: 'mailmodo', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - triggerData: { - data: {}, - triggerSource: 'CsvList', - email: 'gouhgc@mailmodo.com', - triggerDetails: - 'file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e', - userId: 'd3775892hvh4f2f-b9d5-e49810eb2cae', - journeyId: '1a69df39hgvh4e0b-8b5c-73776157aa37', - eventProperty: {}, + request: { + body: JSON.stringify({ + triggerData: { + data: {}, + triggerSource: 'CsvList', + email: 'gouhgc@mailmodo.com', + triggerDetails: + 'file:1a69df39hfbfg4e0b-8b5c-73776157aa37/7647792f-4ebc-4f9d-ac79-05fb0356137e', + userId: 'd3775892hvh4f2f-b9d5-e49810eb2cae', + journeyId: '1a69df39hgvh4e0b-8b5c-73776157aa37', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -36,7 +41,10 @@ export const data = [ anonymousId: 'f43848cce166e51b097cbed2851adc16ed9d4c341928f1c790215c50cefb59b0', context: { externalId: [ - { id: 'd3775892hvh4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892hvh4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gouhgc@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -63,27 +71,37 @@ export const data = [ name: 'mailmodo', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - fuuid: '27905', - 'next-step-id': 'success', - 'total-steps': '3', - responseId: 'b9a5d224-cc5a-4e64-9800-5a3db9515fdf', - recipientEmail: 'test.rudderlabs21997@gmail.com', - formId: 'formosztd5', - recordedAt: { ts: 1662695704, date: '2022-09-09', hour: 9, minute: 25 }, - submissionSource: 'amp', - elementjbtz42: 'Everything ', - element8jzo13: ['Reliable', 'High Quality', 'Useful'], - recipientData: { email: 'test.rudderlabs21997@gmail.com' }, - recommend: '9', - liking: 'upvote', - satisfaction: '4', - campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', - campaignName: 'Campaign-testing', + request: { + body: JSON.stringify({ + fuuid: '27905', + 'next-step-id': 'success', + 'total-steps': '3', + responseId: 'b9a5d224-cc5a-4e64-9800-5a3db9515fdf', + recipientEmail: 'test.rudderlabs21997@gmail.com', + formId: 'formosztd5', + recordedAt: { + ts: 1662695704, + date: '2022-09-09', + hour: 9, + minute: 25, + }, + submissionSource: 'amp', + elementjbtz42: 'Everything ', + element8jzo13: ['Reliable', 'High Quality', 'Useful'], + recipientData: { email: 'test.rudderlabs21997@gmail.com' }, + recommend: '9', + liking: 'upvote', + satisfaction: '4', + campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', + campaignName: 'Campaign-testing', + }), + }, + source: {}, }, ], method: 'POST', @@ -138,19 +156,24 @@ export const data = [ name: 'mailmodo', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - triggerData: { - data: {}, - triggerSource: 'Manual Add To List', - email: 'gou****@mailmodo.com', - userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', - journeyId: '349e986e-f56c-****-bc3b-b5f13c3e34da', - eventProperty: {}, + request: { + body: JSON.stringify({ + triggerData: { + data: {}, + triggerSource: 'Manual Add To List', + email: 'gou****@mailmodo.com', + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: '349e986e-f56c-****-bc3b-b5f13c3e34da', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -169,7 +192,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -194,19 +220,24 @@ export const data = [ name: 'mailmodo', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - triggerData: { - data: {}, - triggerSource: 'Dashboard-change in property: first_name', - email: 'gou****@mailmodo.com', - userId: 'cc56708d-****-****-8c07-a4bfa5a7b79b', - journeyId: 'a78d7221-de34-47d8-81c6-5ad70cf4ee38', - eventProperty: {}, + request: { + body: JSON.stringify({ + triggerData: { + data: {}, + triggerSource: 'Dashboard-change in property: first_name', + email: 'gou****@mailmodo.com', + userId: 'cc56708d-****-****-8c07-a4bfa5a7b79b', + journeyId: 'a78d7221-de34-47d8-81c6-5ad70cf4ee38', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -225,7 +256,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'cc56708d-****-****-8c07-a4bfa5a7b79b', type: 'mailmodoUserId' }, + { + id: 'cc56708d-****-****-8c07-a4bfa5a7b79b', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -250,31 +284,41 @@ export const data = [ name: 'mailmodo', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - triggerData: { - data: {}, - formSubmissionData: { - element6ehxt3: 'Te**', - element6jkcy4: 'Bang****', - fuuid: '47949', - 'next-step-id': 'step7tr7n2', - 'total-steps': '3', - responseId: '4a8bfda7-****-4a8c-9cd1-a30d30a6dab9', - recipientEmail: 'gou****@mailmodo.com', - formId: 'formmqxnu2', - recordedAt: { ts: 1657097786, date: '2022-07-06', hour: 14, minute: 26 }, - submissionSource: 'amp', - }, - email: 'gou****@mailmodo.com', - triggerSource: 'form submission', - userId: '11bff3e8-****-4e93-a533-fd8f9defc768', - journeyId: '03664747-****-412e-8790-de9e9abe96a5', - eventProperty: {}, + request: { + body: JSON.stringify({ + triggerData: { + data: {}, + formSubmissionData: { + element6ehxt3: 'Te**', + element6jkcy4: 'Bang****', + fuuid: '47949', + 'next-step-id': 'step7tr7n2', + 'total-steps': '3', + responseId: '4a8bfda7-****-4a8c-9cd1-a30d30a6dab9', + recipientEmail: 'gou****@mailmodo.com', + formId: 'formmqxnu2', + recordedAt: { + ts: 1657097786, + date: '2022-07-06', + hour: 14, + minute: 26, + }, + submissionSource: 'amp', + }, + email: 'gou****@mailmodo.com', + triggerSource: 'form submission', + userId: '11bff3e8-****-4e93-a533-fd8f9defc768', + journeyId: '03664747-****-412e-8790-de9e9abe96a5', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -293,7 +337,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: '11bff3e8-****-4e93-a533-fd8f9defc768', type: 'mailmodoUserId' }, + { + id: '11bff3e8-****-4e93-a533-fd8f9defc768', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -328,25 +375,30 @@ export const data = [ name: 'mailmodo', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - triggerData: { - data: {}, - eventProperty: { - Name: 'APPLE iPhone 13 (Blue, 128 GB)', - Category: 'Mobiles', - 'Is Purchased': 'false', - Price: '829', - Currency: 'USD', - }, - triggerSource: 'New Custom Event Trigger - Product Viewed', - email: 'gou****@mailmodo.com', - userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', - journeyId: '3f135bf7-****-4e31-b265-f61cfe1bd423', + request: { + body: JSON.stringify({ + triggerData: { + data: {}, + eventProperty: { + Name: 'APPLE iPhone 13 (Blue, 128 GB)', + Category: 'Mobiles', + 'Is Purchased': 'false', + Price: '829', + Currency: 'USD', + }, + triggerSource: 'New Custom Event Trigger - Product Viewed', + email: 'gou****@mailmodo.com', + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: '3f135bf7-****-4e31-b265-f61cfe1bd423', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -365,7 +417,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -395,19 +450,24 @@ export const data = [ name: 'mailmodo', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - triggerData: { - email: 'gou****@mailmodo.com', - data: {}, - userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', - journeyId: 'b1ee6bf6-****-4b5a-b7b5-0637853cd8c3', - triggerSource: 'Api', - eventProperty: {}, + request: { + body: JSON.stringify({ + triggerData: { + email: 'gou****@mailmodo.com', + data: {}, + userId: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + journeyId: 'b1ee6bf6-****-4b5a-b7b5-0637853cd8c3', + triggerSource: 'Api', + eventProperty: {}, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -426,7 +486,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', type: 'mailmodoUserId' }, + { + id: 'd3775892-****-4f2f-b9d5-e49810eb2cae', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -451,24 +514,29 @@ export const data = [ name: 'mailmodo', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventData: { type: 'html' }, - triggerData: { - data: {}, - triggerSource: 'CsvList', - email: 'gou****@mailmodo.com', - triggerDetails: - 'file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af', - userId: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', - journeyId: '5d31c2b4-****-4a84-acd3-834cae80231b', - eventProperty: {}, + request: { + body: JSON.stringify({ + eventData: { type: 'html' }, + triggerData: { + data: {}, + triggerSource: 'CsvList', + email: 'gou****@mailmodo.com', + triggerDetails: + 'file:5d31c2b4-****-4a84-acd3-834cae80231b/5a61e0b8-b6f6-4d7d-abf2-90357d6638af', + userId: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', + journeyId: '5d31c2b4-****-4a84-acd3-834cae80231b', + eventProperty: {}, + }, + lastCampaignEmailRef: '064c76e7-****-4780-a001-226c066aaa12', + lastCampaignId: '31422f76-****-4a72-a630-dd6f9f615bc3', + }), }, - lastCampaignEmailRef: '064c76e7-****-4780-a001-226c066aaa12', - lastCampaignId: '31422f76-****-4a72-a630-dd6f9f615bc3', + source: {}, }, ], method: 'POST', @@ -487,7 +555,10 @@ export const data = [ anonymousId: '26c9ad4b531287858155ffa834be13dddc2c45df6e29af7230408953d732dd92', context: { externalId: [ - { id: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', type: 'mailmodoUserId' }, + { + id: 'cc56708d-****-4fea-8c07-a4bfa5a7b79b', + type: 'mailmodoUserId', + }, ], traits: { email: 'gou****@mailmodo.com' }, integration: { name: 'Mailmodo', version: '1.0.0' }, @@ -517,27 +588,37 @@ export const data = [ name: 'mailmodo', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - fuuid: '98255', - 'next-step-id': 'success', - 'total-steps': '3', - responseId: 'ad20a980-4fce-44b6-887d-2236df514a76', - recipientEmail: 'test@rudderstack.com', - formId: 'formosztd5', - recordedAt: { ts: 1662695887, date: '2022-09-09', hour: 9, minute: 28 }, - submissionSource: 'amp', - elementjbtz42: 'peace', - element8jzo13: ['Useful'], - recipientData: { email: 'test@rudderstack.com', first_name: 'abcda' }, - recommend: '1', - liking: 'downvote', - satisfaction: '1', - campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', - campaignName: 'Campaign-testing', + request: { + body: JSON.stringify({ + fuuid: '98255', + 'next-step-id': 'success', + 'total-steps': '3', + responseId: 'ad20a980-4fce-44b6-887d-2236df514a76', + recipientEmail: 'test@rudderstack.com', + formId: 'formosztd5', + recordedAt: { + ts: 1662695887, + date: '2022-09-09', + hour: 9, + minute: 28, + }, + submissionSource: 'amp', + elementjbtz42: 'peace', + element8jzo13: ['Useful'], + recipientData: { email: 'test@rudderstack.com', first_name: 'abcda' }, + recommend: '1', + liking: 'downvote', + satisfaction: '1', + campaignId: '0b53e1bf-84ae-4198-9184-8a4d6e1fa3dd', + campaignName: 'Campaign-testing', + }), + }, + source: {}, }, ], method: 'POST', @@ -557,7 +638,10 @@ export const data = [ context: { integration: { name: 'Mailmodo', version: '1.0.0' }, library: { name: 'unknown', version: 'unknown' }, - traits: { email: 'test@rudderstack.com', first_name: 'abcda' }, + traits: { + email: 'test@rudderstack.com', + first_name: 'abcda', + }, }, event: 'Form Submitted', integrations: { Mailmodo: false }, diff --git a/test/integrations/sources/moengage/data.ts b/test/integrations/sources/moengage/data.ts index c307959121f..50c127f4830 100644 --- a/test/integrations/sources/moengage/data.ts +++ b/test/integrations/sources/moengage/data.ts @@ -1,132 +1,126 @@ -const data = [ +export const data = [ { name: 'moengage', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', - channel: 'web', - context: { - timezone: 'Wrong/Timezone', - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.1.6', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.1.6', - }, - locale: 'en-GB', - os: { - name: '', - version: '', - }, - page: { - path: '/testing/script-test.html', - referrer: '', - search: '', - title: '', - url: 'http://localhost:3243/testing/script-test.html', - }, - screen: { - density: 2, - }, - traits: { - company: { - id: 'abc123', - }, - createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', - email: 'rudderTest@gmail.com', - name: 'Rudder Test', - plan: 'Enterprise', - }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', - }, - event: 'Order Completed', - integrations: { - All: true, - }, - messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', - originalTimestamp: '2020-10-16T08:10:12.782Z', - properties: { - checkout_id: 'what is checkout id here??', - coupon: 'APPARELSALE', - currency: 'GBP', - order_id: 'transactionId', - products: [ - { - brand: '', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/bacon-jam.jpg', - name: 'Food/Drink', - position: 1, - price: 3, - product_id: 'product-bacon-jam', - quantity: 2, - sku: 'sku-1', - typeOfProduct: 'Food', - url: 'https://www.example.com/product/bacon-jam', - value: 6, - variant: 'Extra topped', - }, - { - brand: 'Levis', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/t-shirt.jpg', - name: 'T-Shirt', - position: 2, - price: 12.99, - product_id: 'product-t-shirt', - quantity: 1, - sku: 'sku-2', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/t-shirt', - value: 12.99, - variant: 'White', + request: { + body: JSON.stringify({ + anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + channel: 'web', + context: { + timezone: 'Wrong/Timezone', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.6', + }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, - { - brand: 'Levis', - category: 'Merch', + event: 'Order Completed', + integrations: { All: true }, + messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', + originalTimestamp: '2020-10-16T08:10:12.782Z', + properties: { + checkout_id: 'what is checkout id here??', coupon: 'APPARELSALE', currency: 'GBP', - image_url: 'https://www.example.com/product/offer-t-shirt.jpg', - name: 'T-Shirt-on-offer', - position: 1, - price: 12.99, - product_id: 'offer-t-shirt', - quantity: 1, - sku: 'sku-3', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/offer-t-shirt', - value: 12.99, - variant: 'Black', + order_id: 'transactionId', + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, }, - ], - revenue: 31.98, - shipping: 4, - value: 31.98, + receivedAt: '2020-10-16T13:40:12.792+05:30', + request_ip: '[::1]', + sentAt: '2020-10-16T08:10:12.783Z', + timestamp: '2020-10-16T13:40:12.791+05:30', + type: 'track', + userId: 'rudder123', + }), }, - receivedAt: '2020-10-16T13:40:12.792+05:30', - request_ip: '[::1]', - sentAt: '2020-10-16T08:10:12.783Z', - timestamp: '2020-10-16T13:40:12.791+05:30', - type: 'track', - userId: 'rudder123', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -153,10 +147,7 @@ const data = [ version: '1.1.6', }, locale: 'en-GB', - os: { - name: '', - version: '', - }, + os: { name: '', version: '' }, page: { path: '/testing/script-test.html', referrer: '', @@ -164,13 +155,9 @@ const data = [ title: '', url: 'http://localhost:3243/testing/script-test.html', }, - screen: { - density: 2, - }, + screen: { density: 2 }, traits: { - company: { - id: 'abc123', - }, + company: { id: 'abc123' }, createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', email: 'rudderTest@gmail.com', name: 'Rudder Test', @@ -180,9 +167,7 @@ const data = [ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, event: 'Order Completed', - integrations: { - All: true, - }, + integrations: { All: true }, messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', originalTimestamp: '2020-10-16T08:10:12.782Z', properties: { @@ -263,204 +248,196 @@ const data = [ name: 'moengage', description: 'Batch of events', module: 'source', - version: 'v0', + version: 'v2', overrideReceivedAt: true, overrideRequestIP: true, input: { request: { body: [ { - batch: [ - { - type: 'page', - event: 'home', - sentAt: '2020-11-12T21:12:54.117Z', - userId: 'sajal', - channel: 'mobile', - context: { - traits: {}, - library: { - name: 'rudder-sdk-ruby-sync', - version: '1.0.7', - }, - page: { - path: '/Rectified.html', - referrer: 'http://localhost:1112/', - search: '', - title: '', - url: 'http://localhost:1112/Rectified.html', - }, - userAgent: - 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.3.0.QFKINXM)', - }, - rudderId: 'asdfasdfsadf', - properties: { - name: 'asdfsadf', - }, - timestamp: '2020-11-12T21:12:41.320Z', - anonymousId: '123123123123', - }, - { - anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', - channel: 'web', - context: { - timezone: 'Asia/Tokyo', - app: { - build: '1.0.0', - name: 'RudderLabs JavaScript SDK', - namespace: 'com.rudderlabs.javascript', - version: '1.1.6', - }, - library: { - name: 'RudderLabs JavaScript SDK', - version: '1.1.6', - }, - locale: 'en-GB', - os: { - name: '', - version: '', - }, - page: { - path: '/testing/script-test.html', - referrer: '', - search: '', - title: '', - url: 'http://localhost:3243/testing/script-test.html', - }, - screen: { - density: 2, - }, - traits: { - company: { - id: 'abc123', + request: { + body: JSON.stringify({ + batch: [ + { + type: 'page', + event: 'home', + sentAt: '2020-11-12T21:12:54.117Z', + userId: 'sajal', + channel: 'mobile', + context: { + traits: {}, + library: { + name: 'rudder-sdk-ruby-sync', + version: '1.0.7', + }, + page: { + path: '/Rectified.html', + referrer: 'http://localhost:1112/', + search: '', + title: '', + url: 'http://localhost:1112/Rectified.html', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.3.0.QFKINXM)', }, - createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', - email: 'rudderTest@gmail.com', - name: 'Rudder Test', - plan: 'Enterprise', + rudderId: 'asdfasdfsadf', + properties: { name: 'asdfsadf' }, + timestamp: '2020-11-12T21:12:41.320Z', + anonymousId: '123123123123', }, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', - }, - event: 'Order Completed', - integrations: { - All: true, - }, - messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', - originalTimestamp: '2020-10-16T08:10:12.782Z', - properties: { - checkout_id: 'what is checkout id here??', - coupon: 'APPARELSALE', - currency: 'GBP', - order_id: 'transactionId', - category: 'some category', - originalArray: [ - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - { - nested_field: 'nested value', - tags: ['tag_1', 'tag_2', 'tag_3'], - }, - ], - products: [ - { - brand: '', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/bacon-jam.jpg', - name: 'Food/Drink', - position: 1, - price: 3, - product_id: 'product-bacon-jam', - quantity: 2, - sku: 'sku-1', - typeOfProduct: 'Food', - url: 'https://www.example.com/product/bacon-jam', - value: 6, - variant: 'Extra topped', - }, - { - brand: 'Levis', - category: 'Merch', - currency: 'GBP', - image_url: 'https://www.example.com/product/t-shirt.jpg', - name: 'T-Shirt', - position: 2, - price: 12.99, - product_id: 'product-t-shirt', - quantity: 1, - sku: 'sku-2', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/t-shirt', - value: 12.99, - variant: 'White', + { + anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + channel: 'web', + context: { + timezone: 'Asia/Tokyo', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.1.6', + }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, - { - brand: 'Levis', - category: 'Merch', + event: 'Order Completed', + integrations: { All: true }, + messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', + originalTimestamp: '2020-10-16T08:10:12.782Z', + properties: { + checkout_id: 'what is checkout id here??', coupon: 'APPARELSALE', currency: 'GBP', - image_url: 'https://www.example.com/product/offer-t-shirt.jpg', - name: 'T-Shirt-on-offer', - position: 1, - price: 12.99, - product_id: 'offer-t-shirt', - quantity: 1, - sku: 'sku-3', - typeOfProduct: 'Shirt', - url: 'https://www.example.com/product/offer-t-shirt', - value: 12.99, - variant: 'Black', + order_id: 'transactionId', + category: 'some category', + originalArray: [ + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3'], + }, + ], + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, }, - ], - revenue: 31.98, - shipping: 4, - value: 31.98, - }, - receivedAt: '2020-10-16T13:40:12.792+05:30', - request_ip: '[::1]', - sentAt: '2020-10-16T08:10:12.783Z', - timestamp: '2020-10-16T13:40:12.791+05:30', - type: 'track', - userId: 'rudder123', - }, - ], + receivedAt: '2020-10-16T13:40:12.792+05:30', + request_ip: '[::1]', + sentAt: '2020-10-16T08:10:12.783Z', + timestamp: '2020-10-16T13:40:12.791+05:30', + type: 'track', + userId: 'rudder123', + }, + ], + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -479,10 +456,7 @@ const data = [ channel: 'mobile', context: { traits: {}, - library: { - name: 'rudder-sdk-ruby-sync', - version: '1.0.7', - }, + library: { name: 'rudder-sdk-ruby-sync', version: '1.0.7' }, page: { path: '/Rectified.html', referrer: 'http://localhost:1112/', @@ -494,9 +468,7 @@ const data = [ 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.3.0.QFKINXM)', }, rudderId: 'asdfasdfsadf', - properties: { - name: 'asdfsadf', - }, + properties: { name: 'asdfsadf' }, timestamp: '2020-11-12T21:12:41.320Z', anonymousId: '123123123123', }, @@ -516,10 +488,7 @@ const data = [ version: '1.1.6', }, locale: 'en-GB', - os: { - name: '', - version: '', - }, + os: { name: '', version: '' }, page: { path: '/testing/script-test.html', referrer: '', @@ -527,13 +496,9 @@ const data = [ title: '', url: 'http://localhost:3243/testing/script-test.html', }, - screen: { - density: 2, - }, + screen: { density: 2 }, traits: { - company: { - id: 'abc123', - }, + company: { id: 'abc123' }, createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', email: 'rudderTest@gmail.com', name: 'Rudder Test', @@ -543,9 +508,7 @@ const data = [ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', }, event: 'Order Completed', - integrations: { - All: true, - }, + integrations: { All: true }, messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', originalTimestamp: '2020-10-16T08:10:12.782Z', properties: { @@ -662,7 +625,3 @@ const data = [ }, }, ]; - -module.exports = { - data, -}; diff --git a/test/integrations/sources/monday/data.ts b/test/integrations/sources/monday/data.ts index 1bb26930901..a57794ca40d 100644 --- a/test/integrations/sources/monday/data.ts +++ b/test/integrations/sources/monday/data.ts @@ -3,28 +3,33 @@ export const data = [ name: 'monday', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - userId: 33556506, - originalTriggerUuid: null, - boardId: 3139815405, - pulseId: 3160188786, - pulseName: 'New Sprint Item', - groupId: 'topics', - groupName: 'Group Title', - groupColor: '#579bfc', - isTopGroup: true, - columnValues: {}, - app: 'monday', - type: 'create_pulse', - triggerTime: '2022-08-30T09:02:39.191Z', - subscriptionId: 150881106, - triggerUuid: '049869226bf6711705c62e301a2c3eee', + request: { + body: JSON.stringify({ + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + pulseId: 3160188786, + pulseName: 'New Sprint Item', + groupId: 'topics', + groupName: 'Group Title', + groupColor: '#579bfc', + isTopGroup: true, + columnValues: {}, + app: 'monday', + type: 'create_pulse', + triggerTime: '2022-08-30T09:02:39.191Z', + subscriptionId: 150881106, + triggerUuid: '049869226bf6711705c62e301a2c3eee', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -78,23 +83,28 @@ export const data = [ name: 'monday', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - userId: 33556506, - originalTriggerUuid: null, - boardId: 3139815405, - itemId: 3160188786, - itemName: 'New Sprint Item', - app: 'monday', - type: 'delete_pulse', - triggerTime: '2022-08-30T09:06:09.176Z', - subscriptionId: 150882006, - triggerUuid: '4e4f87c8255c4ba4ba2f5e9934cb6d40', + request: { + body: JSON.stringify({ + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + itemId: 3160188786, + itemName: 'New Sprint Item', + app: 'monday', + type: 'delete_pulse', + triggerTime: '2022-08-30T09:06:09.176Z', + subscriptionId: 150882006, + triggerUuid: '4e4f87c8255c4ba4ba2f5e9934cb6d40', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -143,39 +153,48 @@ export const data = [ name: 'monday', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - userId: 33556506, - originalTriggerUuid: null, - boardId: 3139815405, - groupId: 'topics', - pulseId: 3160181387, - pulseName: 'New Sprint Item', - columnId: 'status', - columnType: 'color', - columnTitle: 'Status', - value: { - label: { - index: 1, - text: 'Done', - style: { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, - is_done: true, + request: { + body: JSON.stringify({ + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + groupId: 'topics', + pulseId: 3160181387, + pulseName: 'New Sprint Item', + columnId: 'status', + columnType: 'color', + columnTitle: 'Status', + value: { + label: { + index: 1, + text: 'Done', + style: { + color: '#00c875', + border: '#00B461', + var_name: 'green-shadow', + }, + is_done: true, + }, + post_id: null, + }, + previousValue: null, + changedAt: 1661859406.8970098, + isTopGroup: true, + app: 'monday', + type: 'update_column_value', + triggerTime: '2022-08-30T11:36:47.406Z', + subscriptionId: 150894742, + triggerUuid: '51730730740a9d00ec45203bd392a9bd', }, - post_id: null, - }, - previousValue: null, - changedAt: 1661859406.8970098, - isTopGroup: true, - app: 'monday', - type: 'update_column_value', - triggerTime: '2022-08-30T11:36:47.406Z', - subscriptionId: 150894742, - triggerUuid: '51730730740a9d00ec45203bd392a9bd', + }), }, + source: {}, }, ], method: 'POST', @@ -206,7 +225,11 @@ export const data = [ label: { text: 'Done', index: 1, - style: { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + style: { + color: '#00c875', + border: '#00B461', + var_name: 'green-shadow', + }, is_done: true, }, post_id: null, @@ -240,25 +263,30 @@ export const data = [ name: 'monday', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - userId: 33556506, - originalTriggerUuid: null, - boardId: 3139815405, - groupId: 'topics', - pulseId: 3160181387, - value: { name: 'New Sprint Item renamed' }, - previousValue: { name: 'New Sprint Item' }, - app: 'monday', - type: 'update_name', - triggerTime: '2022-08-30T11:40:17.351Z', - subscriptionId: 150910867, - triggerUuid: '05ce13d32d0256c4fb7dd5de25b1a1ba', + request: { + body: JSON.stringify({ + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + groupId: 'topics', + pulseId: 3160181387, + value: { name: 'New Sprint Item renamed' }, + previousValue: { name: 'New Sprint Item' }, + app: 'monday', + type: 'update_name', + triggerTime: '2022-08-30T11:40:17.351Z', + subscriptionId: 150910867, + triggerUuid: '05ce13d32d0256c4fb7dd5de25b1a1ba', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -309,31 +337,36 @@ export const data = [ name: 'monday', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - userId: 33556506, - originalTriggerUuid: null, - boardId: 3160805239, - pulseId: 3161163765, - pulseName: 'new subitem', - groupId: 'topics', - groupName: 'Subitems', - groupColor: '#579bfc', - isTopGroup: true, - columnValues: {}, - app: 'monday', - type: 'create_pulse', - triggerTime: '2022-08-30T12:56:27.281Z', - subscriptionId: 150911592, - triggerUuid: '70a2219427804e47a508a91b5c244543', - parentItemId: '3160181387', - parentItemBoardId: '3139815405', - itemId: 3161163765, + request: { + body: JSON.stringify({ + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3160805239, + pulseId: 3161163765, + pulseName: 'new subitem', + groupId: 'topics', + groupName: 'Subitems', + groupColor: '#579bfc', + isTopGroup: true, + columnValues: {}, + app: 'monday', + type: 'create_pulse', + triggerTime: '2022-08-30T12:56:27.281Z', + subscriptionId: 150911592, + triggerUuid: '70a2219427804e47a508a91b5c244543', + parentItemId: '3160181387', + parentItemBoardId: '3139815405', + itemId: 3161163765, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -390,23 +423,28 @@ export const data = [ name: 'monday', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - userId: 33556506, - originalTriggerUuid: null, - boardId: 3139815405, - itemId: 3160181387, - itemName: 'New Sprint Item renamed', - app: 'monday', - type: 'archive_pulse', - triggerTime: '2022-08-30T12:58:15.844Z', - subscriptionId: 150925947, - triggerUuid: 'aa8bd5dbb6fd592aedd57322dd776379', + request: { + body: JSON.stringify({ + event: { + userId: 33556506, + originalTriggerUuid: null, + boardId: 3139815405, + itemId: 3160181387, + itemName: 'New Sprint Item renamed', + app: 'monday', + type: 'archive_pulse', + triggerTime: '2022-08-30T12:58:15.844Z', + subscriptionId: 150925947, + triggerUuid: 'aa8bd5dbb6fd592aedd57322dd776379', + }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/olark/data.ts b/test/integrations/sources/olark/data.ts index 3486e849076..f3262dc1a28 100644 --- a/test/integrations/sources/olark/data.ts +++ b/test/integrations/sources/olark/data.ts @@ -3,34 +3,42 @@ export const data = [ name: 'olark', description: 'Olark webhook response', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - kind: 'Conversation', - id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', - manuallySubmitted: false, - items: [ - { - kind: 'OfflineMessage', - timestamp: '1669285628.796693', - body: 'name: test rudderlabs\nemail: ruddertest@gmail.com\nMessage: I am Fine', - }, - ], - tags: [], - visitor: { - kind: 'Visitor', - id: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', - fullName: 'test', - emailAddress: 'ruddertest@gmail.com', - ip: '', - country: 'India', - countryCode: 'IN', - browser: 'Chrome 105.0.0.0', - operatingSystem: 'Macintosh', - conversationBeginPage: 'http://localhost:5503/', + request: { + body: JSON.stringify({ + kind: 'Conversation', + id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', + manuallySubmitted: false, + items: [ + { + kind: 'OfflineMessage', + timestamp: '1669285628.796693', + body: + 'name: test rudderlabs\n' + + 'email: ruddertest@gmail.com\n' + + 'Message: I am Fine', + }, + ], + tags: [], + visitor: { + kind: 'Visitor', + id: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', + fullName: 'test', + emailAddress: 'ruddertest@gmail.com', + ip: '', + country: 'India', + countryCode: 'IN', + browser: 'Chrome 105.0.0.0', + operatingSystem: 'Macintosh', + conversationBeginPage: 'http://localhost:5503/', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -53,7 +61,11 @@ export const data = [ context: { os: { name: 'Macintosh' }, page: { url: 'http://localhost:5503/' }, - traits: { name: 'test', email: 'ruddertest@gmail.com', country: 'India' }, + traits: { + name: 'test', + email: 'ruddertest@gmail.com', + country: 'India', + }, browser: { name: 'Chrome', version: '105.0.0.0' }, library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Olark' }, @@ -62,7 +74,10 @@ export const data = [ tags: [], items: [ { - body: 'name: test rudderlabs\nemail: ruddertest@gmail.com\nMessage: I am Fine', + body: + 'name: test rudderlabs\n' + + 'email: ruddertest@gmail.com\n' + + 'Message: I am Fine', kind: 'OfflineMessage', timestamp: '1669285628.796693', }, @@ -81,58 +96,68 @@ export const data = [ name: 'olark', description: 'Olark webhook response', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - kind: 'Conversation', - id: 'NOTAREALTRANSCRIPT5LGcbVTa3hKBRB', - manuallySubmitted: false, - items: [ - { - kind: 'MessageToVisitor', - nickname: 'Olark operator', - operatorId: '6208911878914048', - timestamp: '1473774819.263083', - body: 'Hi from an operator', - }, - { - kind: 'MessageToOperator', - nickname: 'Returning Visitor | USA (San Francisco, CA) #7617', - timestamp: '1473774821.411154', - body: 'Hi from a visitor', - visitor_nickname: 'Olark Visitor', - }, - ], - tags: ['test_example'], - visitor: { - kind: 'Visitor', - id: 'NOTAREALVISITORIDS5LGl6QUrK2OaPP', - fullName: 'Olark', - phoneNumber: '5555555555', - emailAddress: 'support+integrationtest@olark.com', - ip: '', - city: 'San Francisco', - region: 'CA', - country: 'United States', - countryCode: 'US', - organization: 'Visitor Organization', - browser: 'Internet Explorer 11', - operatingSystem: 'Windows', - referrer: 'http://www.olark.com', - conversationBeginPage: 'http://www.olark.com', - chat_feedback: { overall_chat: 4, responsiveness: 5, knowledge: 4, friendliness: 5 }, - }, - operators: { - '6208911878914048': { - kind: 'Operator', - id: '6208911878914048', - nickname: 'integration', - emailAddress: 'integration-accounts@rudderstack.com', - username: 'integration-accounts-92750bc547', - }, + request: { + body: JSON.stringify({ + kind: 'Conversation', + id: 'NOTAREALTRANSCRIPT5LGcbVTa3hKBRB', + manuallySubmitted: false, + items: [ + { + kind: 'MessageToVisitor', + nickname: 'Olark operator', + operatorId: '6208911878914048', + timestamp: '1473774819.263083', + body: 'Hi from an operator', + }, + { + kind: 'MessageToOperator', + nickname: 'Returning Visitor | USA (San Francisco, CA) #7617', + timestamp: '1473774821.411154', + body: 'Hi from a visitor', + visitor_nickname: 'Olark Visitor', + }, + ], + tags: ['test_example'], + visitor: { + kind: 'Visitor', + id: 'NOTAREALVISITORIDS5LGl6QUrK2OaPP', + fullName: 'Olark', + phoneNumber: '5555555555', + emailAddress: 'support+integrationtest@olark.com', + ip: '', + city: 'San Francisco', + region: 'CA', + country: 'United States', + countryCode: 'US', + organization: 'Visitor Organization', + browser: 'Internet Explorer 11', + operatingSystem: 'Windows', + referrer: 'http://www.olark.com', + conversationBeginPage: 'http://www.olark.com', + chat_feedback: { + overall_chat: 4, + responsiveness: 5, + knowledge: 4, + friendliness: 5, + }, + }, + operators: { + '6208911878914048': { + kind: 'Operator', + id: '6208911878914048', + nickname: 'integration', + emailAddress: 'integration-accounts@rudderstack.com', + username: 'integration-accounts-92750bc547', + }, + }, + }), }, + source: {}, }, ], method: 'POST', @@ -162,7 +187,10 @@ export const data = [ userId: 'NOTAREALVISITORIDS5LGl6QUrK2OaPP', context: { os: { name: 'Windows' }, - page: { url: 'http://www.olark.com', referrer: 'http://www.olark.com' }, + page: { + url: 'http://www.olark.com', + referrer: 'http://www.olark.com', + }, traits: { city: 'San Francisco', name: 'Olark', @@ -207,35 +235,47 @@ export const data = [ name: 'olark', description: 'Olark webhook response', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - kind: 'Conversation', - id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', - manuallySubmitted: false, - items: [ - { - kind: 'OfflineMessage', - timestamp: '1669288532.567071', - body: 'name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv', - }, - ], - tags: [], - groups: [{ kind: 'Group', id: 'ca77f4296fb7568909ad864aebf48201', name: 'Group 1' }], - visitor: { - kind: 'Visitor', - id: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', - fullName: 'test rudderstack', - emailAddress: 'rudder14@gmail.com', - ip: '', - country: 'India', - countryCode: 'IN', - browser: 'Chrome 105.0.0.0', - operatingSystem: 'Macintosh', - conversationBeginPage: 'http://localhost:5503/', + request: { + body: JSON.stringify({ + kind: 'Conversation', + id: 'ho6HrHxoabmm6q0G103JU0JFaor0BobA', + manuallySubmitted: false, + items: [ + { + kind: 'OfflineMessage', + timestamp: '1669288532.567071', + body: + 'name: test rudderstack\n' + 'email: rudder14@gmail.com\n' + 'Message: veavv', + }, + ], + tags: [], + groups: [ + { + kind: 'Group', + id: 'ca77f4296fb7568909ad864aebf48201', + name: 'Group 1', + }, + ], + visitor: { + kind: 'Visitor', + id: '45WjM9eMYwJ7cJMo103JU0JaForAA6Db', + fullName: 'test rudderstack', + emailAddress: 'rudder14@gmail.com', + ip: '', + country: 'India', + countryCode: 'IN', + browser: 'Chrome 105.0.0.0', + operatingSystem: 'Macintosh', + conversationBeginPage: 'http://localhost:5503/', + }, + }), }, + source: {}, }, ], method: 'POST', @@ -271,7 +311,10 @@ export const data = [ tags: [], items: [ { - body: 'name: test rudderstack\nemail: rudder14@gmail.com\nMessage: veavv', + body: + 'name: test rudderstack\n' + + 'email: rudder14@gmail.com\n' + + 'Message: veavv', kind: 'OfflineMessage', timestamp: '1669288532.567071', }, diff --git a/test/integrations/sources/ortto/data.ts b/test/integrations/sources/ortto/data.ts index 6feed3f43a3..a46351d8103 100644 --- a/test/integrations/sources/ortto/data.ts +++ b/test/integrations/sources/ortto/data.ts @@ -9,33 +9,36 @@ export const data = [ name: 'ortto', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::s-all', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - contact_id: '00651b946baa9be6b2edad00', - email: 'abhi@example.com', + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::s-all', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + contact_id: '00651b946baa9be6b2edad00', + email: 'abhi@example.com', + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -78,65 +81,62 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'ortto', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::s-all', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - external_id: 'user_x', - city: { - name: 'Kolkata', - id: 0, - lat: 37751000, - lng: -97822000, - }, - country: { - name: 'United States', - id: 6252001, - lat: 0, - lng: 0, - }, - email: 'xyz@email.com', - first_name: 'Ujjwal', - last_name: 'Ujjwal', - birthday: { - year: 1980, - month: 12, - day: 11, - timezone: 'Australia/Sydney', - }, - phone_number: { - c: '91', - n: '401234567', - }, + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::s-all', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + external_id: 'user_x', + city: { + name: 'Kolkata', + id: 0, + lat: 37751000, + lng: -97822000, + }, + country: { + name: 'United States', + id: 6252001, + lat: 0, + lng: 0, + }, + email: 'xyz@email.com', + first_name: 'Ujjwal', + last_name: 'Ujjwal', + birthday: { + year: 1980, + month: 12, + day: 11, + timezone: 'Australia/Sydney', + }, + phone_number: { c: '91', n: '401234567' }, + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -158,10 +158,7 @@ export const data = [ firstName: 'Ujjwal', lastName: 'Ujjwal', phone: '91401234567', - address: { - city: 'Kolkata', - country: 'United States', - }, + address: { city: 'Kolkata', country: 'United States' }, }, }, event: 'Resubscribe globally', @@ -190,66 +187,63 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'ortto', description: 'Simple track call with unknown field id', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::s-ccc', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - external_id: 'user_x', - city: { - name: 'Kolkata', - id: 0, - lat: 37751000, - lng: -97822000, - }, - contact_id: '006524f0b8d370050056e400', - country: { - name: 'United States', - id: 6252001, - lat: 0, - lng: 0, - }, - email: 'xyz@email.com', - first_name: 'Ujjwal', - last_name: 'Ujjwal', - birthday: { - year: 1980, - month: 3, - day: 4, - timezone: 'Australia/Sydney', - }, - phone_number: { - c: '91', - n: '401234567', - }, + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::s-ccc', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + external_id: 'user_x', + city: { + name: 'Kolkata', + id: 0, + lat: 37751000, + lng: -97822000, + }, + contact_id: '006524f0b8d370050056e400', + country: { + name: 'United States', + id: 6252001, + lat: 0, + lng: 0, + }, + email: 'xyz@email.com', + first_name: 'Ujjwal', + last_name: 'Ujjwal', + birthday: { + year: 1980, + month: 3, + day: 4, + timezone: 'Australia/Sydney', + }, + phone_number: { c: '91', n: '401234567' }, + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -277,10 +271,7 @@ export const data = [ firstName: 'Ujjwal', lastName: 'Ujjwal', phone: '91401234567', - address: { - city: 'Kolkata', - country: 'United States', - }, + address: { city: 'Kolkata', country: 'United States' }, }, }, event: 'custom event triggered', @@ -309,66 +300,63 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'ortto', description: 'Simple track call with unknown field id', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - activity: { - id: '00651b946bfef7e80478efee', - field_id: 'act::test_webhook', - created: '2023-10-03T04:11:23Z', - attr: { - 'str::is': 'API', - 'str::s-ctx': 'Subscribed via API', - }, - }, - contact: { - external_id: 'user_x', - city: { - name: 'Kolkata', - id: 0, - lat: 37751000, - lng: -97822000, - }, - contact_id: '006524f0b8d370050056e400', - country: { - name: 'United States', - id: 6252001, - lat: 0, - lng: 0, - }, - email: 'xyz@email.com', - first_name: 'Ujjwal', - last_name: 'Ujjwal', - birthday: { - year: 1980, - month: 3, - day: 4, - timezone: 'Australia/Sydney', - }, - phone_number: { - c: '91', - n: '401234567', - }, + request: { + body: JSON.stringify({ + activity: { + id: '00651b946bfef7e80478efee', + field_id: 'act::test_webhook', + created: '2023-10-03T04:11:23Z', + attr: { + 'str::is': 'API', + 'str::s-ctx': 'Subscribed via API', + }, + }, + contact: { + external_id: 'user_x', + city: { + name: 'Kolkata', + id: 0, + lat: 37751000, + lng: -97822000, + }, + contact_id: '006524f0b8d370050056e400', + country: { + name: 'United States', + id: 6252001, + lat: 0, + lng: 0, + }, + email: 'xyz@email.com', + first_name: 'Ujjwal', + last_name: 'Ujjwal', + birthday: { + year: 1980, + month: 3, + day: 4, + timezone: 'Australia/Sydney', + }, + phone_number: { c: '91', n: '401234567' }, + }, + id: '00651b946cef87c7af64f4f3', + time: '2023-10-03T04:11:24.25726779Z', + webhook_id: '651b8aec8002153e16319fd3', + }), }, - id: '00651b946cef87c7af64f4f3', - time: '2023-10-03T04:11:24.25726779Z', - webhook_id: '651b8aec8002153e16319fd3', + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -386,8 +374,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((testCase) => ({ + ...testCase, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/pagerduty/data.ts b/test/integrations/sources/pagerduty/data.ts index fdfee6fc0d4..171dabf45b8 100644 --- a/test/integrations/sources/pagerduty/data.ts +++ b/test/integrations/sources/pagerduty/data.ts @@ -3,70 +3,78 @@ export const data = [ name: 'pagerduty', description: 'Incident Triggered', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - id: '01DEN0V2VIFEN5871PQGX72URP', - event_type: 'incident.triggered', - resource_type: 'incident', - occurred_at: '2022-12-07T10:56:52.337Z', - agent: { - html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', - id: 'PXZZD2E', - self: 'https://api.pagerduty.com/users/user@1', - summary: 'rudder test', - type: 'user_reference', - }, - client: { name: 'Monitoring Service', url: 'https://monitoring.service.com' }, - data: { - id: 'Q3S7IX2U5KTCOY', - type: 'incident', - self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', - html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', - number: 2, - status: 'triggered', - incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', - created_at: '2022-12-07T10:56:52Z', - title: 'Server Crashed', - service: { - html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', - id: 'PAJBUTT', - self: 'https://api.pagerduty.com/services/PAJBUTT', - summary: 'Database', - type: 'service_reference', - }, - assignees: [ - { + request: { + body: JSON.stringify({ + event: { + id: '01DEN0V2VIFEN5871PQGX72URP', + event_type: 'incident.triggered', + resource_type: 'incident', + occurred_at: '2022-12-07T10:56:52.337Z', + agent: { html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', id: 'PXZZD2E', self: 'https://api.pagerduty.com/users/user@1', summary: 'rudder test', type: 'user_reference', }, - ], - escalation_policy: { - html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', - id: 'PB7HKU4', - self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', - summary: 'Default', - type: 'escalation_policy_reference', - }, - teams: [], - priority: { - html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', - id: 'PPMNDVQ', - self: 'https://api.pagerduty.com/priorities/PPMNDVQ', - summary: 'P1', - type: 'priority_reference', + client: { + name: 'Monitoring Service', + url: 'https://monitoring.service.com', + }, + data: { + id: 'Q3S7IX2U5KTCOY', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + number: 2, + status: 'triggered', + incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', + created_at: '2022-12-07T10:56:52Z', + title: 'Server Crashed', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [ + { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + ], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + summary: 'P1', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: null, + resolve_reason: null, + }, }, - urgency: 'high', - conference_bridge: null, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', @@ -145,7 +153,10 @@ export const data = [ 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', }, }, - client: { url: 'https://monitoring.service.com', name: 'Monitoring Service' }, + client: { + url: 'https://monitoring.service.com', + name: 'Monitoring Service', + }, resourceType: 'incident', }, integrations: { PagerDuty: false }, @@ -162,70 +173,75 @@ export const data = [ name: 'pagerduty', description: 'Incident Priority Updated', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - id: '01DFU6P4VDDZCIHVQ5Q0ME99OE', - event_type: 'incident.priority_updated', - resource_type: 'incident', - occurred_at: '2022-12-20T11:43:24.342Z', - agent: { - html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', - id: 'PXZZD2E', - self: 'https://api.pagerduty.com/users/user@1', - summary: 'rudder test', - type: 'user_reference', - }, - client: null, - data: { - id: 'Q1KRTY75EUMGM0', - type: 'incident', - self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', - html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', - number: 7, - status: 'acknowledged', - incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', - created_at: '2022-12-20T11:37:19Z', - title: 'Event Stream Failure', - service: { - html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', - id: 'PAJBUTT', - self: 'https://api.pagerduty.com/services/PAJBUTT', - summary: 'Database', - type: 'service_reference', - }, - assignees: [ - { + request: { + body: JSON.stringify({ + event: { + id: '01DFU6P4VDDZCIHVQ5Q0ME99OE', + event_type: 'incident.priority_updated', + resource_type: 'incident', + occurred_at: '2022-12-20T11:43:24.342Z', + agent: { html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', id: 'PXZZD2E', self: 'https://api.pagerduty.com/users/user@1', summary: 'rudder test', type: 'user_reference', }, - ], - escalation_policy: { - html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', - id: 'PB7HKU4', - self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', - summary: 'Default', - type: 'escalation_policy_reference', - }, - teams: [], - priority: { - html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', - id: 'PPMNDVQ', - self: 'https://api.pagerduty.com/priorities/PPMNDVQ', - summary: 'P1', - type: 'priority_reference', + client: null, + data: { + id: 'Q1KRTY75EUMGM0', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + number: 7, + status: 'acknowledged', + incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', + created_at: '2022-12-20T11:37:19Z', + title: 'Event Stream Failure', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [ + { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + ], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + summary: 'P1', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: null, + resolve_reason: null, + }, }, - urgency: 'high', - conference_bridge: null, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', @@ -320,45 +336,50 @@ export const data = [ name: 'pagerduty', description: 'Incident Responder Added', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - id: '01DFU6Z1ZCLMV9SEK3X5JZ5WLW', - event_type: 'incident.responder.added', - resource_type: 'incident', - occurred_at: '2022-12-20T11:46:44.213Z', - agent: { - html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', - id: 'PXZZD2E', - self: 'https://api.pagerduty.com/users/user@1', - summary: 'rudder test', - type: 'user_reference', - }, - client: null, - data: { - incident: { - html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', - id: 'Q1KRTY75EUMGM0', - self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', - summary: 'Event Stream Failure', - type: 'incident_reference', - }, - user: { - html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', - id: 'PXZZD2E', - self: 'https://api.pagerduty.com/users/user@1', - summary: 'rudder test', - type: 'user_reference', + request: { + body: JSON.stringify({ + event: { + id: '01DFU6Z1ZCLMV9SEK3X5JZ5WLW', + event_type: 'incident.responder.added', + resource_type: 'incident', + occurred_at: '2022-12-20T11:46:44.213Z', + agent: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + client: null, + data: { + incident: { + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + id: 'Q1KRTY75EUMGM0', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + summary: 'Event Stream Failure', + type: 'incident_reference', + }, + user: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + escalation_policy: null, + message: 'Please help with "Event Stream Failure"', + state: 'pending', + type: 'incident_responder', + }, }, - escalation_policy: null, - message: 'Please help with "Event Stream Failure"', - state: 'pending', - type: 'incident_responder', - }, + }), }, + source: {}, }, ], method: 'POST', @@ -426,70 +447,75 @@ export const data = [ name: 'pagerduty', description: 'Incident Escalated', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - id: '01DFU77KTKK9UUYX779UX0N1ZP', - event_type: 'incident.escalated', - resource_type: 'incident', - occurred_at: '2022-12-20T11:49:35.385Z', - agent: { - html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', - id: 'PXZZD2E', - self: 'https://api.pagerduty.com/users/user@1', - summary: 'rudder test', - type: 'user_reference', - }, - client: null, - data: { - id: 'Q1KRTY75EUMGM0', - type: 'incident', - self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', - html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', - number: 7, - status: 'triggered', - incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', - created_at: '2022-12-20T11:37:19Z', - title: 'Event Stream Failure', - service: { - html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', - id: 'PAJBUTT', - self: 'https://api.pagerduty.com/services/PAJBUTT', - summary: 'Database', - type: 'service_reference', - }, - assignees: [ - { + request: { + body: JSON.stringify({ + event: { + id: '01DFU77KTKK9UUYX779UX0N1ZP', + event_type: 'incident.escalated', + resource_type: 'incident', + occurred_at: '2022-12-20T11:49:35.385Z', + agent: { html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', id: 'PXZZD2E', self: 'https://api.pagerduty.com/users/user@1', summary: 'rudder test', type: 'user_reference', }, - ], - escalation_policy: { - html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', - id: 'PB7HKU4', - self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', - summary: 'Default', - type: 'escalation_policy_reference', - }, - teams: [], - priority: { - html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', - id: 'PPMNDVQ', - self: 'https://api.pagerduty.com/priorities/PPMNDVQ', - summary: 'P1', - type: 'priority_reference', + client: null, + data: { + id: 'Q1KRTY75EUMGM0', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q1KRTY75EUMGM0', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q1KRTY75EUMGM0', + number: 7, + status: 'triggered', + incident_key: 'a3e0e442f8b74a8c94298f19de0dcbed', + created_at: '2022-12-20T11:37:19Z', + title: 'Event Stream Failure', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [ + { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + ], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'PPMNDVQ', + self: 'https://api.pagerduty.com/priorities/PPMNDVQ', + summary: 'P1', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: null, + resolve_reason: null, + }, }, - urgency: 'high', - conference_bridge: null, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', @@ -584,62 +610,67 @@ export const data = [ name: 'pagerduty', description: 'Incident Resolved', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - id: '01DEN1HNLBC1VITK192ETJ1MPJ', - event_type: 'incident.resolved', - resource_type: 'incident', - occurred_at: '2022-12-07T11:04:27.459Z', - agent: { - html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', - id: 'PXZZD2E', - self: 'https://api.pagerduty.com/users/user@1', - summary: 'rudder test', - type: 'user_reference', - }, - client: null, - data: { - id: 'Q3S7IX2U5KTCOY', - type: 'incident', - self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', - html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', - number: 2, - status: 'resolved', - incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', - created_at: '2022-12-07T10:56:52Z', - title: 'Server Crashed', - service: { - html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', - id: 'PAJBUTT', - self: 'https://api.pagerduty.com/services/PAJBUTT', - summary: 'Database', - type: 'service_reference', - }, - assignees: [], - escalation_policy: { - html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', - id: 'PB7HKU4', - self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', - summary: 'Default', - type: 'escalation_policy_reference', - }, - teams: [], - priority: { - html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', - id: 'P5DBC3A', - self: 'https://api.pagerduty.com/priorities/P5DBC3A', - summary: 'P3', - type: 'priority_reference', + request: { + body: JSON.stringify({ + event: { + id: '01DEN1HNLBC1VITK192ETJ1MPJ', + event_type: 'incident.resolved', + resource_type: 'incident', + occurred_at: '2022-12-07T11:04:27.459Z', + agent: { + html_url: 'https://rudderlabs-com.pagerduty.com/users/PXZZD2E', + id: 'PXZZD2E', + self: 'https://api.pagerduty.com/users/user@1', + summary: 'rudder test', + type: 'user_reference', + }, + client: null, + data: { + id: 'Q3S7IX2U5KTCOY', + type: 'incident', + self: 'https://api.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + html_url: 'https://rudderlabs-com.pagerduty.com/incidents/Q3S7IX2U5KTCOY', + number: 2, + status: 'resolved', + incident_key: 'faaecfc0aca04b6ea07154188b5d3c6c', + created_at: '2022-12-07T10:56:52Z', + title: 'Server Crashed', + service: { + html_url: 'https://rudderlabs-com.pagerduty.com/services/PAJBUTT', + id: 'PAJBUTT', + self: 'https://api.pagerduty.com/services/PAJBUTT', + summary: 'Database', + type: 'service_reference', + }, + assignees: [], + escalation_policy: { + html_url: 'https://rudderlabs-com.pagerduty.com/escalation_policies/PB7HKU4', + id: 'PB7HKU4', + self: 'https://api.pagerduty.com/escalation_policies/PB7HKU4', + summary: 'Default', + type: 'escalation_policy_reference', + }, + teams: [], + priority: { + html_url: 'https://rudderlabs-com.pagerduty.com/account/incident_priorities', + id: 'P5DBC3A', + self: 'https://api.pagerduty.com/priorities/P5DBC3A', + summary: 'P3', + type: 'priority_reference', + }, + urgency: 'high', + conference_bridge: { conference_number: '', conference_url: '' }, + resolve_reason: null, + }, }, - urgency: 'high', - conference_bridge: { conference_number: '', conference_url: '' }, - resolve_reason: null, - }, + }), }, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/pipedream/data.ts b/test/integrations/sources/pipedream/data.ts index a4b5c33e0d5..a77cdea848b 100644 --- a/test/integrations/sources/pipedream/data.ts +++ b/test/integrations/sources/pipedream/data.ts @@ -3,15 +3,20 @@ export const data = [ name: 'pipedream', description: 'No type or userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - anonymousId: '63767499ca6fb1b7c988d5bb', - artist: 'Gautam', - genre: 'Jazz', - song: 'Take Five', + request: { + body: JSON.stringify({ + anonymousId: '63767499ca6fb1b7c988d5bb', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }), + }, + source: {}, }, ], method: 'POST', @@ -53,10 +58,22 @@ export const data = [ name: 'pipedream', description: 'No type or anonymousId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { - body: [{ userId: '12', artist: 'Gautam', genre: 'Jazz', song: 'Take Five' }], + body: [ + { + request: { + body: JSON.stringify({ + userId: '12', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }), + }, + source: {}, + }, + ], method: 'POST', headers: { 'Content-Type': 'application/json' }, }, @@ -78,7 +95,12 @@ export const data = [ }, integrations: { PIPEDREAM: false }, type: 'track', - properties: { userId: '12', artist: 'Gautam', genre: 'Jazz', song: 'Take Five' }, + properties: { + userId: '12', + artist: 'Gautam', + genre: 'Jazz', + song: 'Take Five', + }, }, ], }, @@ -91,29 +113,39 @@ export const data = [ name: 'pipedream', description: 'Track Call -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: 'Song Played', - userId: 'R1234', - context: { - library: { name: 'unknown', version: 'unknown' }, - traits: { - createdAt: '2022-10-15T05:41:06.016Z', - custom: { key1: 'v1', key2: 'V2' }, - email: 'john@doe.com', - name: 'John Doe', - userDeleted: false, - }, - locale: 'en', - location: { country: 'IN', countryName: 'India', short: 'India', long: 'India' }, - device: { os: 'macOS', type: 'desktop' }, - page: { referrer: 'http://127.0.0.1:5500/testSm.html' }, + request: { + body: JSON.stringify({ + event: 'Song Played', + userId: 'R1234', + context: { + library: { name: 'unknown', version: 'unknown' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + userDeleted: false, + }, + locale: 'en', + location: { + country: 'IN', + countryName: 'India', + short: 'India', + long: 'India', + }, + device: { os: 'macOS', type: 'desktop' }, + page: { referrer: 'http://127.0.0.1:5500/testSm.html' }, + }, + type: 'track', + properties: { artist: 'John', Album: 'ABCD' }, + }), }, - type: 'track', - properties: { artist: 'John', Album: 'ABCD' }, + source: {}, }, ], method: 'POST', @@ -164,24 +196,29 @@ export const data = [ name: 'pipedream', description: 'Identify type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - userId: '1', - originalTimestamp: '2020-09-28T19:53:31.900Z', - traits: { - firstName: 'John', - lastName: 'doe', - email: 'John@r.com', - hasPurchased: 'yes', - address: { Home: { city: 'iudcb' }, Office: { abc: 'jbc' } }, - state: 'Delhi', - title: 'Mr', + request: { + body: JSON.stringify({ + userId: '1', + originalTimestamp: '2020-09-28T19:53:31.900Z', + traits: { + firstName: 'John', + lastName: 'doe', + email: 'John@r.com', + hasPurchased: 'yes', + address: { Home: { city: 'iudcb' }, Office: { abc: 'jbc' } }, + state: 'Delhi', + title: 'Mr', + }, + timestamp: '2020-09-29T14:50:29.907+05:30', + type: 'identify', + }), }, - timestamp: '2020-09-29T14:50:29.907+05:30', - type: 'identify', + source: {}, }, ], method: 'POST', @@ -223,16 +260,21 @@ export const data = [ name: 'pipedream', description: 'Group type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - userId: 'user123', - groupId: '17', - context: {}, - traits: { operation: 'add' }, - type: 'group', + request: { + body: JSON.stringify({ + userId: 'user123', + groupId: '17', + context: {}, + traits: { operation: 'add' }, + type: 'group', + }), + }, + source: {}, }, ], method: 'POST', @@ -265,24 +307,32 @@ export const data = [ name: 'pipedream', description: 'Page type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - anonymousId: '21e13f4bc7ceddad', - channel: 'mobile', - context: { - os: { name: 'Android', version: '9' }, - timezone: 'Asia/Kolkata', - traits: { customProp: 'customValue' }, - userAgent: - 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + request: { + body: JSON.stringify({ + anonymousId: '21e13f4bc7ceddad', + channel: 'mobile', + context: { + os: { name: 'Android', version: '9' }, + timezone: 'Asia/Kolkata', + traits: { customProp: 'customValue' }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + name: 'Home', + properties: { + title: 'Home | RudderStack', + url: 'http://www.rudderstack.com', + }, + receivedAt: '2020-09-29T14:50:43.005+05:30', + type: 'page', + }), }, - name: 'Home', - properties: { title: 'Home | RudderStack', url: 'http://www.rudderstack.com' }, - receivedAt: '2020-09-29T14:50:43.005+05:30', - type: 'page', + source: {}, }, ], method: 'POST', @@ -308,7 +358,10 @@ export const data = [ 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', }, name: 'Home', - properties: { title: 'Home | RudderStack', url: 'http://www.rudderstack.com' }, + properties: { + title: 'Home | RudderStack', + url: 'http://www.rudderstack.com', + }, receivedAt: '2020-09-29T14:50:43.005+05:30', type: 'page', }, @@ -323,10 +376,21 @@ export const data = [ name: 'pipedream', description: 'Alias type -> type and userId is given', module: 'source', - version: 'v0', + version: 'v2', input: { request: { - body: [{ type: 'alias', previousId: 'name@surname.com', userId: '12345' }], + body: [ + { + request: { + body: JSON.stringify({ + type: 'alias', + previousId: 'name@surname.com', + userId: '12345', + }), + }, + source: {}, + }, + ], method: 'POST', headers: { 'Content-Type': 'application/json' }, }, @@ -339,7 +403,12 @@ export const data = [ { output: { batch: [ - { type: 'alias', previousId: 'name@surname.com', userId: '12345', context: {} }, + { + type: 'alias', + previousId: 'name@surname.com', + userId: '12345', + context: {}, + }, ], }, }, diff --git a/test/integrations/sources/refiner/data.ts b/test/integrations/sources/refiner/data.ts index 255004322c3..6986b847d97 100644 --- a/test/integrations/sources/refiner/data.ts +++ b/test/integrations/sources/refiner/data.ts @@ -3,106 +3,114 @@ export const data = [ name: 'refiner', description: 'Refiner webhook response', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - uuid: 'd769e130-49cf-11ed-968d-936a69fadf81', - project_uuid: '0d8759d0-401c-11ed-8ded-9757c4929b55', - remote_id: 'user@17', - email: 'test17@user.com', - display_name: 'test user', - first_seen_at: '2022-10-12T01:47:33.000000Z', - last_seen_at: '2022-10-12T02:00:00.000000Z', - attributes: { - address: null, - address_city: null, - address_state: null, - age: null, - another_attribute: null, - city: null, - country: null, - created_at: null, - email: 'test17@user.com', - event: null, - first_name: null, - first_seen_at: '2022-10-12T01:47:33.000000Z', - form_submissions_count: '1', - form_views_count: '2', - gender: null, - last_form_submission_at: '2022-10-12T02:05:55.000000Z', - last_form_view_at: '2022-10-12T02:03:46.000000Z', - last_name: null, - last_seen_at: '2022-10-12T02:00:00.000000Z', - name: 'test user', - phone: null, - some_attribute: null, - status: null, - student: null, - tag: null, - trait1: null, - trait2: null, - trait3: null, - url: null, - user_address_city: null, - user_address_state: null, - user_country: null, - user_id: null, - username: null, - useroccupation: null, - why_did_you_cancel_your_subscription: 'Pricing', - }, - segments: [ - { - uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', - name: 'All Users', - created_at: '2022-10-12T01:47:34.000000Z', - updated_at: '2022-10-12T01:47:34.000000Z', - }, - { - uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', - name: 'test-segment', - created_at: '2022-10-12T01:47:34.000000Z', - updated_at: '2022-10-12T01:47:34.000000Z', - }, - ], - account: { - uuid: 'd76c9e80-49cf-11ed-a783-6317eca951a6', - remote_id: 'ACCOUNT-ID-ABC-1', - domain: null, - display_name: 'Awesome Inc.', - first_seen_at: '2022-10-12T01:47:33.000000Z', - last_seen_at: '2022-10-12T02:00:00.000000Z', - attributes: { - a_date_at: '2022-10-01T00:00:00.000000Z', - business_email: null, - company: null, - email: null, - isfunded: null, - name: 'Awesome Inc.', - revenue: null, - some_account_data: 'something', - trait1: null, - trait2: null, - trait3: null, - }, - }, - triggered_event: 'Completed Survey', - form: { uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', name: 'Customer Churn Survey' }, - response: { - uuid: 'eb117cb0-49cf-11ed-b050-03a44b32151c', - first_shown_at: '2022-10-12T01:48:06.000000Z', - last_shown_at: '2022-10-12T02:03:46.000000Z', - show_counter: null, - first_data_reception_at: '2022-10-12T02:05:55.000000Z', - last_data_reception_at: '2022-10-12T02:05:55.000000Z', - completed_at: '2022-10-12T02:05:55.000000Z', - dismissed_at: null, - received_at: '2022-10-12T02:05:55.000000Z', - data: { why_did_you_cancel_your_subscription: 'Pricing' }, - tags: [], + request: { + body: JSON.stringify({ + uuid: 'd769e130-49cf-11ed-968d-936a69fadf81', + project_uuid: '0d8759d0-401c-11ed-8ded-9757c4929b55', + remote_id: 'user@17', + email: 'test17@user.com', + display_name: 'test user', + first_seen_at: '2022-10-12T01:47:33.000000Z', + last_seen_at: '2022-10-12T02:00:00.000000Z', + attributes: { + address: null, + address_city: null, + address_state: null, + age: null, + another_attribute: null, + city: null, + country: null, + created_at: null, + email: 'test17@user.com', + event: null, + first_name: null, + first_seen_at: '2022-10-12T01:47:33.000000Z', + form_submissions_count: '1', + form_views_count: '2', + gender: null, + last_form_submission_at: '2022-10-12T02:05:55.000000Z', + last_form_view_at: '2022-10-12T02:03:46.000000Z', + last_name: null, + last_seen_at: '2022-10-12T02:00:00.000000Z', + name: 'test user', + phone: null, + some_attribute: null, + status: null, + student: null, + tag: null, + trait1: null, + trait2: null, + trait3: null, + url: null, + user_address_city: null, + user_address_state: null, + user_country: null, + user_id: null, + username: null, + useroccupation: null, + why_did_you_cancel_your_subscription: 'Pricing', + }, + segments: [ + { + uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', + name: 'All Users', + created_at: '2022-10-12T01:47:34.000000Z', + updated_at: '2022-10-12T01:47:34.000000Z', + }, + { + uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', + name: 'test-segment', + created_at: '2022-10-12T01:47:34.000000Z', + updated_at: '2022-10-12T01:47:34.000000Z', + }, + ], + account: { + uuid: 'd76c9e80-49cf-11ed-a783-6317eca951a6', + remote_id: 'ACCOUNT-ID-ABC-1', + domain: null, + display_name: 'Awesome Inc.', + first_seen_at: '2022-10-12T01:47:33.000000Z', + last_seen_at: '2022-10-12T02:00:00.000000Z', + attributes: { + a_date_at: '2022-10-01T00:00:00.000000Z', + business_email: null, + company: null, + email: null, + isfunded: null, + name: 'Awesome Inc.', + revenue: null, + some_account_data: 'something', + trait1: null, + trait2: null, + trait3: null, + }, + }, + triggered_event: 'Completed Survey', + form: { + uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + name: 'Customer Churn Survey', + }, + response: { + uuid: 'eb117cb0-49cf-11ed-b050-03a44b32151c', + first_shown_at: '2022-10-12T01:48:06.000000Z', + last_shown_at: '2022-10-12T02:03:46.000000Z', + show_counter: null, + first_data_reception_at: '2022-10-12T02:05:55.000000Z', + last_data_reception_at: '2022-10-12T02:05:55.000000Z', + completed_at: '2022-10-12T02:05:55.000000Z', + dismissed_at: null, + received_at: '2022-10-12T02:05:55.000000Z', + data: { why_did_you_cancel_your_subscription: 'Pricing' }, + tags: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -159,7 +167,9 @@ export const data = [ }, properties: { response: { - data: { why_did_you_cancel_your_subscription: 'Pricing' }, + data: { + why_did_you_cancel_your_subscription: 'Pricing', + }, tags: [], uuid: 'eb117cb0-49cf-11ed-b050-03a44b32151c', received_at: '2022-10-12T02:05:55.000000Z', @@ -202,113 +212,123 @@ export const data = [ name: 'refiner', description: 'Refiner webhook response', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - uuid: '69b83e20-4ea2-11ed-941c-e1cb6c7a3870', - cookie_uuid: '2f9b7e6a-9ba8-1c68-d474-48d719d92a60', - project_uuid: '0d8759d0-401c-11ed-8ded-9757c4929b55', - remote_id: 'sdk@30', - email: 'sdk30@gmail.com', - display_name: '', - first_seen_at: '2022-10-18T05:04:58.000000Z', - last_seen_at: '2022-10-18T05:04:58.000000Z', - attributes: { - address: null, - address_city: null, - address_state: null, - age: null, - another_attribute: null, - city: null, - country: null, - created_at: null, - email: 'sdk30@gmail.com', - event: null, - first_name: null, - first_seen_at: '2022-10-18T05:04:58.000000Z', - form_submissions_count: '1', - form_views_count: '1', - gender: null, - last_form_submission_at: '2022-10-18T05:05:45.000000Z', - last_form_view_at: '2022-10-18T05:05:29.000000Z', - last_name: null, - last_seen_at: '2022-10-18T05:04:58.000000Z', - name: null, - phone: null, - some_attribute: null, - status: null, - student: null, - tag: null, - trait1: null, - trait2: null, - trait3: null, - url: null, - user_address_city: null, - user_address_state: null, - user_country: null, - user_id: null, - username: null, - useroccupation: null, - why_did_you_cancel_your_subscription: 'Missing features', - }, - segments: [ - { - uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', - name: 'All Users', - created_at: '2022-10-18T05:04:58.000000Z', - updated_at: '2022-10-18T05:04:58.000000Z', - }, - { - uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', - name: 'test-segment', - created_at: '2022-10-18T05:04:58.000000Z', - updated_at: '2022-10-18T05:04:58.000000Z', - }, - ], - account: { - uuid: '69ba2030-4ea2-11ed-adfc-595e70c7ab07', - remote_id: null, - domain: null, - display_name: '', - first_seen_at: '2022-10-18T05:04:58.000000Z', - last_seen_at: '2022-10-18T05:04:58.000000Z', - attributes: { - '1': null, - '2': null, - '3': null, - '4': null, - a_date_at: null, - business_email: null, - company: null, - email: null, - isfunded: null, - location: null, - name: null, - revenue: null, - some_account_data: null, - trait1: null, - trait2: null, - trait3: null, - user_id: null, - }, - }, - triggered_event: 'Completed Survey', - form: { uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', name: 'Customer Churn Survey' }, - response: { - uuid: '7c508c60-4ea2-11ed-9302-57708fe11d26', - first_shown_at: '2022-10-18T05:05:29.000000Z', - last_shown_at: '2022-10-18T05:05:29.000000Z', - show_counter: null, - first_data_reception_at: '2022-10-18T05:05:45.000000Z', - last_data_reception_at: '2022-10-18T05:05:45.000000Z', - completed_at: '2022-10-18T05:05:45.000000Z', - dismissed_at: null, - received_at: '2022-10-18T05:05:45.000000Z', - data: { why_did_you_cancel_your_subscription: 'Missing features' }, - tags: [], + request: { + body: JSON.stringify({ + uuid: '69b83e20-4ea2-11ed-941c-e1cb6c7a3870', + cookie_uuid: '2f9b7e6a-9ba8-1c68-d474-48d719d92a60', + project_uuid: '0d8759d0-401c-11ed-8ded-9757c4929b55', + remote_id: 'sdk@30', + email: 'sdk30@gmail.com', + display_name: '', + first_seen_at: '2022-10-18T05:04:58.000000Z', + last_seen_at: '2022-10-18T05:04:58.000000Z', + attributes: { + address: null, + address_city: null, + address_state: null, + age: null, + another_attribute: null, + city: null, + country: null, + created_at: null, + email: 'sdk30@gmail.com', + event: null, + first_name: null, + first_seen_at: '2022-10-18T05:04:58.000000Z', + form_submissions_count: '1', + form_views_count: '1', + gender: null, + last_form_submission_at: '2022-10-18T05:05:45.000000Z', + last_form_view_at: '2022-10-18T05:05:29.000000Z', + last_name: null, + last_seen_at: '2022-10-18T05:04:58.000000Z', + name: null, + phone: null, + some_attribute: null, + status: null, + student: null, + tag: null, + trait1: null, + trait2: null, + trait3: null, + url: null, + user_address_city: null, + user_address_state: null, + user_country: null, + user_id: null, + username: null, + useroccupation: null, + why_did_you_cancel_your_subscription: 'Missing features', + }, + segments: [ + { + uuid: '0d91d7a0-401c-11ed-8898-bb1ee0c23ae5', + name: 'All Users', + created_at: '2022-10-18T05:04:58.000000Z', + updated_at: '2022-10-18T05:04:58.000000Z', + }, + { + uuid: 'f71ad940-455c-11ed-85e0-bf25f168b224', + name: 'test-segment', + created_at: '2022-10-18T05:04:58.000000Z', + updated_at: '2022-10-18T05:04:58.000000Z', + }, + ], + account: { + uuid: '69ba2030-4ea2-11ed-adfc-595e70c7ab07', + remote_id: null, + domain: null, + display_name: '', + first_seen_at: '2022-10-18T05:04:58.000000Z', + last_seen_at: '2022-10-18T05:04:58.000000Z', + attributes: { + '1': null, + '2': null, + '3': null, + '4': null, + a_date_at: null, + business_email: null, + company: null, + email: null, + isfunded: null, + location: null, + name: null, + revenue: null, + some_account_data: null, + trait1: null, + trait2: null, + trait3: null, + user_id: null, + }, + }, + triggered_event: 'Completed Survey', + form: { + uuid: '0d94c790-401c-11ed-bb27-e31f6832c5ae', + name: 'Customer Churn Survey', + }, + response: { + uuid: '7c508c60-4ea2-11ed-9302-57708fe11d26', + first_shown_at: '2022-10-18T05:05:29.000000Z', + last_shown_at: '2022-10-18T05:05:29.000000Z', + show_counter: null, + first_data_reception_at: '2022-10-18T05:05:45.000000Z', + last_data_reception_at: '2022-10-18T05:05:45.000000Z', + completed_at: '2022-10-18T05:05:45.000000Z', + dismissed_at: null, + received_at: '2022-10-18T05:05:45.000000Z', + data: { + why_did_you_cancel_your_subscription: 'Missing features', + }, + tags: [], + }, + }), }, + source: {}, }, ], method: 'POST', @@ -325,7 +345,9 @@ export const data = [ batch: [ { type: 'identify', - traits: { why_did_you_cancel_your_subscription: 'Missing features' }, + traits: { + why_did_you_cancel_your_subscription: 'Missing features', + }, userId: 'sdk@30', context: { traits: { @@ -365,7 +387,9 @@ export const data = [ }, properties: { response: { - data: { why_did_you_cancel_your_subscription: 'Missing features' }, + data: { + why_did_you_cancel_your_subscription: 'Missing features', + }, tags: [], uuid: '7c508c60-4ea2-11ed-9302-57708fe11d26', received_at: '2022-10-18T05:05:45.000000Z', diff --git a/test/integrations/sources/revenuecat/data.ts b/test/integrations/sources/revenuecat/data.ts index 2762bac5b27..e61c57fc8a5 100644 --- a/test/integrations/sources/revenuecat/data.ts +++ b/test/integrations/sources/revenuecat/data.ts @@ -9,67 +9,67 @@ export const data = [ name: 'revenuecat', description: 'Simple track call', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - api_version: '1.0', - event: { - aliases: [ - 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', - '389ad6dd-bb40-4c03-9471-1353da2d55ec', - ], - app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', - commission_percentage: null, - country_code: 'US', - currency: null, - entitlement_id: null, - entitlement_ids: null, - environment: 'SANDBOX', - event_timestamp_ms: 1698617217232, - expiration_at_ms: 1698624417232, - id: '8CF0CD6C-CAF3-41FB-968A-661938235AF0', - is_family_share: null, - offer_code: null, - original_app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', - original_transaction_id: null, - period_type: 'NORMAL', - presented_offering_id: null, - price: null, - price_in_purchased_currency: null, - product_id: 'test_product', - purchased_at_ms: 1698617217232, - store: 'APP_STORE', - subscriber_attributes: { - $displayName: { - updated_at_ms: 1698617217232, - value: 'Mister Mistoffelees', - }, - $email: { - updated_at_ms: 1698617217232, - value: 'tuxedo@revenuecat.com', - }, - $phoneNumber: { - updated_at_ms: 1698617217232, - value: '+19795551234', - }, - my_custom_attribute_1: { - updated_at_ms: 1698617217232, - value: 'catnip', + request: { + body: JSON.stringify({ + api_version: '1.0', + event: { + aliases: [ + 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', + '389ad6dd-bb40-4c03-9471-1353da2d55ec', + ], + app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', + commission_percentage: null, + country_code: 'US', + currency: null, + entitlement_id: null, + entitlement_ids: null, + environment: 'SANDBOX', + event_timestamp_ms: 1698617217232, + expiration_at_ms: 1698624417232, + id: '8CF0CD6C-CAF3-41FB-968A-661938235AF0', + is_family_share: null, + offer_code: null, + original_app_user_id: 'f8e14f51-0c76-49ba-8d67-c229f1875dd9', + original_transaction_id: null, + period_type: 'NORMAL', + presented_offering_id: null, + price: null, + price_in_purchased_currency: null, + product_id: 'test_product', + purchased_at_ms: 1698617217232, + store: 'APP_STORE', + subscriber_attributes: { + $displayName: { + updated_at_ms: 1698617217232, + value: 'Mister Mistoffelees', + }, + $email: { + updated_at_ms: 1698617217232, + value: 'tuxedo@revenuecat.com', + }, + $phoneNumber: { + updated_at_ms: 1698617217232, + value: '+19795551234', + }, + my_custom_attribute_1: { updated_at_ms: 1698617217232, value: 'catnip' }, + }, + takehome_percentage: null, + tax_percentage: null, + transaction_id: null, + type: 'TEST', }, - }, - takehome_percentage: null, - tax_percentage: null, - transaction_id: null, - type: 'TEST', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -82,13 +82,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'RevenueCat', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'RevenueCat' }, externalId: [ { type: 'revenuecatAppUserId', @@ -96,9 +91,7 @@ export const data = [ }, ], }, - integrations: { - RevenueCat: false, - }, + integrations: { RevenueCat: false }, type: 'track', properties: { aliases: [ @@ -139,10 +132,7 @@ export const data = [ updated_at_ms: 1698617217232, value: '+19795551234', }, - my_custom_attribute_1: { - updated_at_ms: 1698617217232, - value: 'catnip', - }, + my_custom_attribute_1: { updated_at_ms: 1698617217232, value: 'catnip' }, }, takehomePercentage: null, taxPercentage: null, @@ -161,61 +151,58 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'revenuecat', description: 'Initial purchase event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - api_version: '1.0', - event: { - aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], - app_id: 'yourAppID', - app_user_id: 'yourCustomerAppUserID', - commission_percentage: 0.3, - country_code: 'US', - currency: 'USD', - entitlement_id: 'pro_cat', - entitlement_ids: ['pro_cat'], - environment: 'PRODUCTION', - event_timestamp_ms: 1591121855319, - expiration_at_ms: 1591726653000, - id: 'UniqueIdentifierOfEvent', - is_family_share: false, - offer_code: 'free_month', - original_app_user_id: 'OriginalAppUserID', - original_transaction_id: '1530648507000', - period_type: 'NORMAL', - presented_offering_id: 'OfferingID', - price: 2.49, - price_in_purchased_currency: 2.49, - product_id: 'onemonth_no_trial', - purchased_at_ms: 1591121853000, - store: 'APP_STORE', - subscriber_attributes: { - '$Favorite Cat': { - updated_at_ms: 1581121853000, - value: 'Garfield', + request: { + body: JSON.stringify({ + api_version: '1.0', + event: { + aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], + app_id: 'yourAppID', + app_user_id: 'yourCustomerAppUserID', + commission_percentage: 0.3, + country_code: 'US', + currency: 'USD', + entitlement_id: 'pro_cat', + entitlement_ids: ['pro_cat'], + environment: 'PRODUCTION', + event_timestamp_ms: 1591121855319, + expiration_at_ms: 1591726653000, + id: 'UniqueIdentifierOfEvent', + is_family_share: false, + offer_code: 'free_month', + original_app_user_id: 'OriginalAppUserID', + original_transaction_id: '1530648507000', + period_type: 'NORMAL', + presented_offering_id: 'OfferingID', + price: 2.49, + price_in_purchased_currency: 2.49, + product_id: 'onemonth_no_trial', + purchased_at_ms: 1591121853000, + store: 'APP_STORE', + subscriber_attributes: { + '$Favorite Cat': { updated_at_ms: 1581121853000, value: 'Garfield' }, + }, + takehome_percentage: 0.7, + tax_percentage: 0.3, + transaction_id: '170000869511114', + type: 'INITIAL_PURCHASE', }, - }, - takehome_percentage: 0.7, - tax_percentage: 0.3, - transaction_id: '170000869511114', - type: 'INITIAL_PURCHASE', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -228,13 +215,8 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'RevenueCat', - }, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'RevenueCat' }, externalId: [ { type: 'revenuecatAppUserId', @@ -242,9 +224,7 @@ export const data = [ }, ], }, - integrations: { - RevenueCat: false, - }, + integrations: { RevenueCat: false }, type: 'track', properties: { aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], @@ -293,59 +273,56 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, { name: 'revenuecat', description: 'Purchase event with anonymous user', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - api_version: '1.0', - event: { - aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], - app_id: 'yourAppID', - commission_percentage: 0.3, - country_code: 'US', - currency: 'USD', - entitlement_id: 'pro_cat', - entitlement_ids: ['pro_cat'], - environment: 'PRODUCTION', - event_timestamp_ms: 1591121855319, - expiration_at_ms: 1591726653000, - id: 'UniqueIdentifierOfEvent', - is_family_share: false, - offer_code: 'free_month', - original_transaction_id: '1530648507000', - period_type: 'NORMAL', - presented_offering_id: 'OfferingID', - price: 2.49, - price_in_purchased_currency: 2.49, - product_id: 'onemonth_no_trial', - purchased_at_ms: 1591121853000, - store: 'APP_STORE', - subscriber_attributes: { - '$Favorite Cat': { - updated_at_ms: 1581121853000, - value: 'Garfield', + request: { + body: JSON.stringify({ + api_version: '1.0', + event: { + aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], + app_id: 'yourAppID', + commission_percentage: 0.3, + country_code: 'US', + currency: 'USD', + entitlement_id: 'pro_cat', + entitlement_ids: ['pro_cat'], + environment: 'PRODUCTION', + event_timestamp_ms: 1591121855319, + expiration_at_ms: 1591726653000, + id: 'UniqueIdentifierOfEvent', + is_family_share: false, + offer_code: 'free_month', + original_transaction_id: '1530648507000', + period_type: 'NORMAL', + presented_offering_id: 'OfferingID', + price: 2.49, + price_in_purchased_currency: 2.49, + product_id: 'onemonth_no_trial', + purchased_at_ms: 1591121853000, + store: 'APP_STORE', + subscriber_attributes: { + '$Favorite Cat': { updated_at_ms: 1581121853000, value: 'Garfield' }, + }, + takehome_percentage: 0.7, + tax_percentage: 0.3, + transaction_id: '170000869511114', + type: 'INITIAL_PURCHASE', }, - }, - takehome_percentage: 0.7, - tax_percentage: 0.3, - transaction_id: '170000869511114', - type: 'INITIAL_PURCHASE', + }), }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -358,17 +335,10 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'RevenueCat', - }, - }, - integrations: { - RevenueCat: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'RevenueCat' }, }, + integrations: { RevenueCat: false }, type: 'track', properties: { aliases: ['yourCustomerAliasedID', 'yourCustomerAliasedID'], @@ -416,8 +386,10 @@ export const data = [ ], }, }, - mockFns: () => { - defaultMockFns(); - }, }, -]; +].map((testCase) => ({ + ...testCase, + mockFns: () => { + defaultMockFns(); + }, +})); diff --git a/test/integrations/sources/satismeter/data.ts b/test/integrations/sources/satismeter/data.ts index 713f527f2c9..625284ad027 100644 --- a/test/integrations/sources/satismeter/data.ts +++ b/test/integrations/sources/satismeter/data.ts @@ -3,108 +3,113 @@ export const data = [ name: 'satismeter', description: ' All fields Check with event as completed', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - response: { - id: '63767499ca6fb1b7c988d5bb', - created: '2022-11-17T17:51:21.764Z', - rating: 5, - feedback: 'Many things to imporve\n', - dismissed: false, - pending: false, - answers: [ - { - label: 'How likely are you to recommend us to your friends and colleagues?', - id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', - value: 5, - name: 'SM_rating', - type: 'scale', - metric: 'nps', - }, - { - label: 'What could we do to improve?', - id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', - value: 'Many things to imporve\n', - name: 'SM_comment', - type: 'long-text', - }, - { - label: 'The company made it easy for me to handle my issue.', - id: '1dc53f60-66a0-11ed-856c-6f39711bf041', - value: 4, - name: null, - type: 'scale', - metric: 'ces', - }, - { - label: 'How satisfied were you with the service you received?', - id: '24c5b290-66a0-11ed-856c-6f39711bf041', - value: 4, - name: null, - type: 'smiley', - metric: 'csat', - }, - { - label: 'How you like to rate the surevy?', - id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', - value: 4, - type: 'scale', - }, - { - label: 'Your Name (Single Answer)', - id: '37a8c000-66a0-11ed-856c-6f39711bf041', - value: 'a', - type: 'single-choice', - }, - { - label: 'Your Name (Multiple Answer)', - id: '4b435da0-66a0-11ed-856c-6f39711bf041', - value: ['a1', 'b1'], - type: 'multiple-choice', + request: { + body: JSON.stringify({ + response: { + id: '63767499ca6fb1b7c988d5bb', + created: '2022-11-17T17:51:21.764Z', + rating: 5, + feedback: 'Many things to imporve\n', + dismissed: false, + pending: false, + answers: [ + { + label: 'How likely are you to recommend us to your friends and colleagues?', + id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', + value: 5, + name: 'SM_rating', + type: 'scale', + metric: 'nps', + }, + { + label: 'What could we do to improve?', + id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', + value: 'Many things to imporve\n', + name: 'SM_comment', + type: 'long-text', + }, + { + label: 'The company made it easy for me to handle my issue.', + id: '1dc53f60-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'scale', + metric: 'ces', + }, + { + label: 'How satisfied were you with the service you received?', + id: '24c5b290-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'smiley', + metric: 'csat', + }, + { + label: 'How you like to rate the surevy?', + id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', + value: 4, + type: 'scale', + }, + { + label: 'Your Name (Single Answer)', + id: '37a8c000-66a0-11ed-856c-6f39711bf041', + value: 'a', + type: 'single-choice', + }, + { + label: 'Your Name (Multiple Answer)', + id: '4b435da0-66a0-11ed-856c-6f39711bf041', + value: ['a1', 'b1'], + type: 'multiple-choice', + }, + ], + category: 'detractor', + score: -100, + user: { + id: '63766fbb7ac7b72676145338', + name: 'John Doe', + email: 'john@doe.com', + userId: 'No response', + deleted: false, + groups: { group1: 'grooupId' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + }, + }, + device: { os: 'macOS', type: 'desktop' }, + location: { + country: 'IN', + countryName: 'India', + region: '', + city: '', + short: 'India', + long: 'India', + }, + referrer: 'http://127.0.0.1:5500/testSm.html', + method: 'In-app', + language: 'en', + project: '6372247a764986ebee62bf66', + campaign: '6373271b764986ebee62bfca', }, - ], - category: 'detractor', - score: -100, - user: { - id: '63766fbb7ac7b72676145338', - name: 'John Doe', - email: 'john@doe.com', - userId: 'No response', - deleted: false, - groups: { group1: 'grooupId' }, traits: { createdAt: '2022-10-15T05:41:06.016Z', custom: { key1: 'v1', key2: 'V2' }, email: 'john@doe.com', name: 'John Doe', }, - }, - device: { os: 'macOS', type: 'desktop' }, - location: { - country: 'IN', - countryName: 'India', - region: '', - city: '', - short: 'India', - long: 'India', - }, - referrer: 'http://127.0.0.1:5500/testSm.html', - method: 'In-app', - language: 'en', - project: '6372247a764986ebee62bf66', - campaign: '6373271b764986ebee62bfca', - }, - traits: { - createdAt: '2022-10-15T05:41:06.016Z', - custom: { key1: 'v1', key2: 'V2' }, - email: 'john@doe.com', - name: 'John Doe', + campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + event: 'completed', + }), }, - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, - event: 'completed', + source: {}, }, ], method: 'POST', @@ -132,7 +137,10 @@ export const data = [ userDeleted: false, }, locale: 'en', - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + campaign: { + id: '6373271b764986ebee62bfca', + name: 'NPS Survey', + }, integration: { name: 'SATISMETER' }, location: { country: 'IN', @@ -217,106 +225,111 @@ export const data = [ description: ' Neither reponse.user.id or response.user.userId is provided in payload then mapping response.id to anonymousId', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - response: { - id: '63767499ca6fb1b7c988d5bb', - created: '2022-11-17T17:51:21.764Z', - rating: 5, - feedback: 'Many things to imporve\n', - dismissed: false, - pending: false, - answers: [ - { - label: 'How likely are you to recommend us to your friends and colleagues?', - id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', - value: 5, - name: 'SM_rating', - type: 'scale', - metric: 'nps', - }, - { - label: 'What could we do to improve?', - id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', - value: 'Many things to imporve\n', - name: 'SM_comment', - type: 'long-text', - }, - { - label: 'The company made it easy for me to handle my issue.', - id: '1dc53f60-66a0-11ed-856c-6f39711bf041', - value: 4, - name: null, - type: 'scale', - metric: 'ces', - }, - { - label: 'How satisfied were you with the service you received?', - id: '24c5b290-66a0-11ed-856c-6f39711bf041', - value: 4, - name: null, - type: 'smiley', - metric: 'csat', - }, - { - label: 'How you like to rate the surevy?', - id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', - value: 4, - type: 'scale', - }, - { - label: 'Your Name (Single Answer)', - id: '37a8c000-66a0-11ed-856c-6f39711bf041', - value: 'a', - type: 'single-choice', - }, - { - label: 'Your Name (Multiple Answer)', - id: '4b435da0-66a0-11ed-856c-6f39711bf041', - value: ['a1', 'b1'], - type: 'multiple-choice', + request: { + body: JSON.stringify({ + response: { + id: '63767499ca6fb1b7c988d5bb', + created: '2022-11-17T17:51:21.764Z', + rating: 5, + feedback: 'Many things to imporve\n', + dismissed: false, + pending: false, + answers: [ + { + label: 'How likely are you to recommend us to your friends and colleagues?', + id: '7ddb22b0-64a8-11ed-a4c7-b3bed73771cd', + value: 5, + name: 'SM_rating', + type: 'scale', + metric: 'nps', + }, + { + label: 'What could we do to improve?', + id: '7ddb22b1-64a8-11ed-a4c7-b3bed73771cd', + value: 'Many things to imporve\n', + name: 'SM_comment', + type: 'long-text', + }, + { + label: 'The company made it easy for me to handle my issue.', + id: '1dc53f60-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'scale', + metric: 'ces', + }, + { + label: 'How satisfied were you with the service you received?', + id: '24c5b290-66a0-11ed-856c-6f39711bf041', + value: 4, + name: null, + type: 'smiley', + metric: 'csat', + }, + { + label: 'How you like to rate the surevy?', + id: '27b3d1d0-66a0-11ed-856c-6f39711bf041', + value: 4, + type: 'scale', + }, + { + label: 'Your Name (Single Answer)', + id: '37a8c000-66a0-11ed-856c-6f39711bf041', + value: 'a', + type: 'single-choice', + }, + { + label: 'Your Name (Multiple Answer)', + id: '4b435da0-66a0-11ed-856c-6f39711bf041', + value: ['a1', 'b1'], + type: 'multiple-choice', + }, + ], + category: 'detractor', + score: -100, + user: { + name: 'John Doe', + email: 'john@doe.com', + deleted: false, + groups: { group1: 'grooupId' }, + traits: { + createdAt: '2022-10-15T05:41:06.016Z', + custom: { key1: 'v1', key2: 'V2' }, + email: 'john@doe.com', + name: 'John Doe', + }, + }, + device: { os: 'macOS', type: 'desktop' }, + location: { + country: 'IN', + countryName: 'India', + region: '', + city: '', + short: 'India', + long: 'India', + }, + referrer: 'http://127.0.0.1:5500/testSm.html', + method: 'In-app', + language: 'en', + project: '6372247a764986ebee62bf66', + campaign: '6373271b764986ebee62bfca', }, - ], - category: 'detractor', - score: -100, - user: { - name: 'John Doe', - email: 'john@doe.com', - deleted: false, - groups: { group1: 'grooupId' }, traits: { createdAt: '2022-10-15T05:41:06.016Z', custom: { key1: 'v1', key2: 'V2' }, email: 'john@doe.com', name: 'John Doe', }, - }, - device: { os: 'macOS', type: 'desktop' }, - location: { - country: 'IN', - countryName: 'India', - region: '', - city: '', - short: 'India', - long: 'India', - }, - referrer: 'http://127.0.0.1:5500/testSm.html', - method: 'In-app', - language: 'en', - project: '6372247a764986ebee62bf66', - campaign: '6373271b764986ebee62bfca', - }, - traits: { - createdAt: '2022-10-15T05:41:06.016Z', - custom: { key1: 'v1', key2: 'V2' }, - email: 'john@doe.com', - name: 'John Doe', + campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + event: 'completed', + }), }, - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, - event: 'completed', + source: {}, }, ], method: 'POST', @@ -344,7 +357,10 @@ export const data = [ userDeleted: false, }, locale: 'en', - campaign: { id: '6373271b764986ebee62bfca', name: 'NPS Survey' }, + campaign: { + id: '6373271b764986ebee62bfca', + name: 'NPS Survey', + }, integration: { name: 'SATISMETER' }, location: { country: 'IN', diff --git a/test/integrations/sources/segment/data.ts b/test/integrations/sources/segment/data.ts index 780a65c1195..a7567af3a55 100644 --- a/test/integrations/sources/segment/data.ts +++ b/test/integrations/sources/segment/data.ts @@ -10,92 +10,128 @@ export const data: SrcTestCaseData[] = [ name: 'segment', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', skipGo: 'NoAnonID error', input: { request: { body: [ { - date: '2020-07-10T07:43:07.766Z', - type: 's', - connection_id: '', - client_id: '********************************', - client_name: 'My App', - ip: '47.15.6.58', - user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', - details: { - prompts: [], - completedAt: 1594366987765, - elapsedTime: null, - session_id: '**************_***************', + request: { + body: JSON.stringify({ + date: '2020-07-10T07:43:07.766Z', + type: 's', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }), }, - hostname: '************.us.auth0.com', - user_id: 'auth0|************************', - user_name: 'example@test.com', - auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, - log_id: '********************************************************', - _id: '********************************************************', - isMobile: true, + source: {}, }, { - date: '2020-07-10T07:43:09.620Z', - type: 'seacft', - description: '', - connection_id: '', - client_id: '********************************', - client_name: 'My App', - ip: '47.15.6.58', - user_agent: 'okhttp 2.7.5 / Other 0.0.0', - details: { code: '*************Xst' }, - hostname: '************.us.auth0.com', - user_id: 'auth0|************************', - user_name: 'example@test.com', - auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, - log_id: '********************************************************', - _id: '********************************************************', - isMobile: false, + request: { + body: JSON.stringify({ + date: '2020-07-10T07:43:09.620Z', + type: 'seacft', + description: '', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'okhttp 2.7.5 / Other 0.0.0', + details: { code: '*************Xst' }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: false, + }), + }, + source: {}, }, { - date: '2020-07-10T07:43:07.766Z', - connection_id: '', - client_id: '********************************', - client_name: 'My App', - ip: '47.15.6.58', - user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', - details: { - prompts: [], - completedAt: 1594366987765, - elapsedTime: null, - session_id: '**************_***************', + request: { + body: JSON.stringify({ + date: '2020-07-10T07:43:07.766Z', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }), }, - hostname: '************.us.auth0.com', - user_id: 'auth0|************************', - user_name: 'example@test.com', - auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, - log_id: '********************************************************', - _id: '********************************************************', - isMobile: true, + source: {}, }, { - type: 's', - connection_id: '', - client_id: '********************************', - client_name: 'My App', - ip: '47.15.6.58', - user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', - details: { - prompts: [], - completedAt: 1594366987765, - elapsedTime: null, - session_id: '**************_***************', + request: { + body: JSON.stringify({ + type: 's', + connection_id: '', + client_id: '********************************', + client_name: 'My App', + ip: '47.15.6.58', + user_agent: 'Chrome Mobile 69.0.3497 / Android 0.0.0', + details: { + prompts: [], + completedAt: 1594366987765, + elapsedTime: null, + session_id: '**************_***************', + }, + hostname: '************.us.auth0.com', + user_id: 'auth0|************************', + user_name: 'example@test.com', + auth0_client: { + name: 'Auth0.Android', + env: { android: '28' }, + version: '1.23.0', + }, + log_id: '********************************************************', + _id: '********************************************************', + isMobile: true, + }), }, - hostname: '************.us.auth0.com', - user_id: 'auth0|************************', - user_name: 'example@test.com', - auth0_client: { name: 'Auth0.Android', env: { android: '28' }, version: '1.23.0' }, - log_id: '********************************************************', - _id: '********************************************************', - isMobile: true, + source: {}, }, ], method: 'POST', diff --git a/test/integrations/sources/signl4/data.ts b/test/integrations/sources/signl4/data.ts index b318bfb6df5..a8ca1850972 100644 --- a/test/integrations/sources/signl4/data.ts +++ b/test/integrations/sources/signl4/data.ts @@ -9,21 +9,26 @@ export const data = [ name: 'signl4', description: 'test-0', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 200, - eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', - subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, - alert: { - statusCode: 1, - eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', - externalEventId: 'INC091210', - id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + request: { + body: JSON.stringify({ + eventType: 200, + eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', + subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, + alert: { + statusCode: 1, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'INC091210', + id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + }), }, - id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + source: {}, }, ], method: 'POST', @@ -69,27 +74,32 @@ export const data = [ name: 'signl4', description: 'test-1', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 201, - eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', - subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, - user: { - username: 'Rene', - mailaddress: 'rene@signl4.com', - id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', - }, - alert: { - statusCode: 2, - eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', - externalEventId: 'Content you passed in the X-S4-ExternalID parameter', - acknowledgedUserIds: ['f0bd5063-9588-51cf-b3d9-94e5647dedc5'], - id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + request: { + body: JSON.stringify({ + eventType: 201, + eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', + subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, + user: { + username: 'Rene', + mailaddress: 'rene@signl4.com', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, + alert: { + statusCode: 2, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'Content you passed in the X-S4-ExternalID parameter', + acknowledgedUserIds: ['f0bd5063-9588-51cf-b3d9-94e5647dedc5'], + id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + }), }, - id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + source: {}, }, ], method: 'POST', @@ -109,7 +119,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + { + type: 'signl4UserId', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, ], traits: { email: 'rene@signl4.com', name: 'Rene' }, }, @@ -140,27 +153,32 @@ export const data = [ name: 'signl4', description: 'test-2', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 201, - eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', - subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, - user: { - username: 'Rene', - mailaddress: 'rene@signl4.com', - id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', - }, - alert: { - statusCode: 4, - eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', - externalEventId: 'Content you passed in the X-S4-ExternalID parameter', - acknowledgedUserIds: ['f0bd5063-9588-51cf-b3d9-94e5647dedc5'], - id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + request: { + body: JSON.stringify({ + eventType: 201, + eventRaisedUtc: '2017-09-01T08:11:37.4815663Z', + subscription: { id: '0acf8014-22f2-4503-88d7-f7d05b46744f' }, + user: { + username: 'Rene', + mailaddress: 'rene@signl4.com', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, + alert: { + statusCode: 4, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'Content you passed in the X-S4-ExternalID parameter', + acknowledgedUserIds: ['f0bd5063-9588-51cf-b3d9-94e5647dedc5'], + id: '2518981069381242800_2ab1b5e0-f1b7-4c3e-9adf-6c157eeb4685', + }, + id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + }), }, - id: 'dd209a2d-e037-41ee-b37d-f605cc0a39fb', + source: {}, }, ], method: 'POST', @@ -180,7 +198,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + { + type: 'signl4UserId', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, ], traits: { email: 'rene@signl4.com', name: 'Rene' }, }, @@ -211,23 +232,28 @@ export const data = [ name: 'signl4', description: 'test-3', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 202, - eventRaisedUtc: '2020-01-10T12:27:19Z', - subscription: { id: 'b8fdd850-e2ad-45ff-924d-9c332a063200' }, - team: { id: '0e8979f7-0c6a-472d-8918-ecfd339252f8' }, - alert: { - statusCode: 1, - eventId: '2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9', - externalEventId: 'INC091210', - acknowledgedUserIds: [], - id: '2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2', + request: { + body: JSON.stringify({ + eventType: 202, + eventRaisedUtc: '2020-01-10T12:27:19Z', + subscription: { id: 'b8fdd850-e2ad-45ff-924d-9c332a063200' }, + team: { id: '0e8979f7-0c6a-472d-8918-ecfd339252f8' }, + alert: { + statusCode: 1, + eventId: '2518236416806594587_0e67b746-6c88-4ddf-8872-99690b0457d9', + externalEventId: 'INC091210', + acknowledgedUserIds: [], + id: '2518236416804564453_12ea0f6f-948c-43d0-9034-f9565d7b6bd2', + }, + id: '27283793-47c8-4da2-9767-d37be224338d', + }), }, - id: '27283793-47c8-4da2-9767-d37be224338d', + source: {}, }, ], method: 'POST', @@ -275,30 +301,35 @@ export const data = [ name: 'signl4', description: 'test-4', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 203, - eventRaisedUtc: '2018-04-17T15:00:32Z', - subscription: { id: '1578ebd9-0a27-44ab-bc8e-52cd7d32e81d' }, - user: { - username: 'Rene', - mailaddress: 'rene@signl4.com', - id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', - }, - alert: { - statusCode: 0, - eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', - externalEventId: 'Content you passed in the X-S4-ExternalID parameter', - id: '2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2', - }, - annotation: { - message: "OK, I'll take care about it.", - id: '2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761', + request: { + body: JSON.stringify({ + eventType: 203, + eventRaisedUtc: '2018-04-17T15:00:32Z', + subscription: { id: '1578ebd9-0a27-44ab-bc8e-52cd7d32e81d' }, + user: { + username: 'Rene', + mailaddress: 'rene@signl4.com', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, + alert: { + statusCode: 0, + eventId: '2518783235949759942_fbc7b4a4-badd-47b8-9e1d-702fb6a1a0b2', + externalEventId: 'Content you passed in the X-S4-ExternalID parameter', + id: '2518783235958846071_4e2dfab2-4717-42bc-8d37-8682402309c2', + }, + annotation: { + message: "OK, I'll take care about it.", + id: '2518783235661483318_99ebffe0-1b90-40ef-990a-fbd842484761', + }, + id: '141c0f88-7831-4d5e-b055-f6e83c269770', + }), }, - id: '141c0f88-7831-4d5e-b055-f6e83c269770', + source: {}, }, ], method: 'POST', @@ -318,7 +349,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5' }, + { + type: 'signl4UserId', + id: 'f0bd5063-9588-51cf-b3d9-94e5647dedc5', + }, ], traits: { email: 'rene@signl4.com', name: 'Rene' }, }, @@ -350,15 +384,20 @@ export const data = [ name: 'signl4', description: 'test-5', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 300, - eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', - team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, - id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + request: { + body: JSON.stringify({ + eventType: 300, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }), + }, + source: {}, }, ], method: 'POST', @@ -383,7 +422,10 @@ export const data = [ messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', originalTimestamp: '2017-09-01T09:16:17.000Z', event: 'Duty Period Started', - properties: { eventType: 300, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + properties: { + eventType: 300, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -397,15 +439,20 @@ export const data = [ name: 'signl4', description: 'test-6', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 301, - eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', - team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, - id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + request: { + body: JSON.stringify({ + eventType: 301, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }), + }, + source: {}, }, ], method: 'POST', @@ -430,7 +477,10 @@ export const data = [ messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', originalTimestamp: '2017-09-01T09:16:17.000Z', event: 'Duty Period Ended', - properties: { eventType: 301, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + properties: { + eventType: 301, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -444,16 +494,21 @@ export const data = [ name: 'signl4', description: 'test-7', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 302, - eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', - team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, - user: { id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, - id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + request: { + body: JSON.stringify({ + eventType: 302, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + user: { id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }), + }, + source: {}, }, ], method: 'POST', @@ -473,7 +528,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + { + type: 'signl4UserId', + id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504', + }, ], }, integrations: { Signl4: false }, @@ -481,7 +539,10 @@ export const data = [ messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', originalTimestamp: '2017-09-01T09:16:17.000Z', event: 'Somebody Punched-In', - properties: { eventType: 302, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + properties: { + eventType: 302, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], @@ -495,16 +556,21 @@ export const data = [ name: 'signl4', description: 'test-8', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - eventType: 303, - eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', - team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, - user: { id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, - id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + request: { + body: JSON.stringify({ + eventType: 303, + eventRaisedUtc: '2017-09-01T09:16:17.3717355Z', + team: { id: 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + user: { id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + id: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', + }), + }, + source: {}, }, ], method: 'POST', @@ -524,7 +590,10 @@ export const data = [ library: { name: 'unknown', version: 'unknown' }, integration: { name: 'Signl4' }, externalId: [ - { type: 'signl4UserId', id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504' }, + { + type: 'signl4UserId', + id: 'e31da15f-7e13-43f1-b4a5-1ce3b470a504', + }, ], }, integrations: { Signl4: false }, @@ -532,7 +601,10 @@ export const data = [ messageId: 'f56a6b59-1197-4e7d-8eca-8d21a4b57ec3', originalTimestamp: '2017-09-01T09:16:17.000Z', event: 'Somebody Punched-Out', - properties: { eventType: 303, 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f' }, + properties: { + eventType: 303, + 'team.id': 'f1801955-4724-44de-902a-f6f02ba9e10f', + }, anonymousId: '97fcd7b2-cc24-47d7-b776-057b7b199513', }, ], diff --git a/test/integrations/sources/slack/data.ts b/test/integrations/sources/slack/data.ts index def8a63408b..7a4d29489cb 100644 --- a/test/integrations/sources/slack/data.ts +++ b/test/integrations/sources/slack/data.ts @@ -3,20 +3,23 @@ export const data = [ name: 'slack', description: 'Webhook url verificatin event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - token: 'Jhj5dZrVaK7ZwHHjRyZWjbDl', - challenge: '3eZbrw1aB10FEMAGAZd4FyFQ', - type: 'url_verification', + request: { + body: JSON.stringify({ + token: 'Jhj5dZrVaK7ZwHHjRyZWjbDl', + challenge: '3eZbrw1aB10FEMAGAZd4FyFQ', + type: 'url_verification', + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -39,44 +42,47 @@ export const data = [ name: 'slack', description: 'Team joined event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - type: 'team_join', - user: { - id: 'W012CDE', - name: 'johnd', - real_name: 'John Doe', - }, - }, - type: 'event_callback', - event_id: 'Ev06TJ0NG5', - event_time: 1709441309, - token: 'REm276ggfh72Lq', - team_id: 'T0GFJL5J7', - context_team_id: 'T0GFJL5J7', - context_enterprise_id: null, - api_app_id: 'B02SJMHRR', - authorizations: [ - { - enterprise_id: null, + request: { + body: JSON.stringify({ + event: { + type: 'team_join', + user: { + id: 'W012CDE', + name: 'johnd', + real_name: 'John Doe', + }, + }, + type: 'event_callback', + event_id: 'Ev06TJ0NG5', + event_time: 1709441309, + token: 'REm276ggfh72Lq', team_id: 'T0GFJL5J7', - user_id: 'U04G7H550', - is_bot: true, - is_enterprise_install: false, - }, - ], - is_ext_shared_channel: false, - event_context: 'eJldCI65436EUEpMSFhgfhg76joiQzAxRTRQTEIxMzUifQ', + context_team_id: 'T0GFJL5J7', + context_enterprise_id: null, + api_app_id: 'B02SJMHRR', + authorizations: [ + { + enterprise_id: null, + team_id: 'T0GFJL5J7', + user_id: 'U04G7H550', + is_bot: true, + is_enterprise_install: false, + }, + ], + is_ext_shared_channel: false, + event_context: 'eJldCI65436EUEpMSFhgfhg76joiQzAxRTRQTEIxMzUifQ', + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -89,23 +95,11 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'SLACK', - }, - externalId: [ - { - type: 'slackUserId', - id: 'W012CDE', - }, - ], - }, - integrations: { - SLACK: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'SLACK' }, + externalId: [{ type: 'slackUserId', id: 'W012CDE' }], }, + integrations: { SLACK: false }, type: 'identify', event: 'Team Join', anonymousId: '2bc5ae2825a712d3d154cbdacb86ac16c278', @@ -131,74 +125,74 @@ export const data = [ name: 'slack', description: 'Message event', module: 'source', - version: 'v0', + version: 'v2', input: { request: { body: [ { - event: { - user: 'U04G7H550', - type: 'message', - ts: '1709441309.308399', - client_msg_id: '834r664e-ec75-445d-t5c6-b873a07y9c81', - text: 'What is the pricing of product X', - team: 'T0GFJL5J7', - thread_ts: '1709407304.839329', - parent_user_id: 'U06P6LQTPV', - blocks: [ - { - type: 'rich_text', - block_id: 'xGKJl', - elements: [ + request: { + body: JSON.stringify({ + event: { + user: 'U04G7H550', + type: 'message', + ts: '1709441309.308399', + client_msg_id: '834r664e-ec75-445d-t5c6-b873a07y9c81', + text: 'What is the pricing of product X', + team: 'T0GFJL5J7', + thread_ts: '1709407304.839329', + parent_user_id: 'U06P6LQTPV', + blocks: [ { - type: 'rich_text_section', + type: 'rich_text', + block_id: 'xGKJl', elements: [ { - type: 'text', - text: 'What is the pricing of product X', - }, - { - type: 'channel', - channel_id: 'C03CDQTPI65', - }, - { - type: 'text', - text: ' to do this', + type: 'rich_text_section', + elements: [ + { + type: 'text', + text: 'What is the pricing of product X', + }, + { + type: 'channel', + channel_id: 'C03CDQTPI65', + }, + { type: 'text', text: ' to do this' }, + ], }, ], }, ], + channel: 'C03CDQTPI65', + event_ts: '1709441309.308399', + channel_type: 'channel', }, - ], - channel: 'C03CDQTPI65', - event_ts: '1709441309.308399', - channel_type: 'channel', - }, - type: 'event_callback', - event_id: 'EvY5JTJ0NG5', - event_time: 1709441309, - token: 'REm2987dqtpi72Lq', - team_id: 'T0GFJL5J7', - context_team_id: 'T01gqtPIL5J7', - context_enterprise_id: null, - api_app_id: 'A04QTPIHRR', - authorizations: [ - { - enterprise_id: null, + type: 'event_callback', + event_id: 'EvY5JTJ0NG5', + event_time: 1709441309, + token: 'REm2987dqtpi72Lq', team_id: 'T0GFJL5J7', - user_id: 'W012CDE', - is_bot: true, - is_enterprise_install: false, - }, - ], - is_ext_shared_channel: false, - event_context: '4-wd6joiQfdgTRQTpIzdfifQ', + context_team_id: 'T01gqtPIL5J7', + context_enterprise_id: null, + api_app_id: 'A04QTPIHRR', + authorizations: [ + { + enterprise_id: null, + team_id: 'T0GFJL5J7', + user_id: 'W012CDE', + is_bot: true, + is_enterprise_install: false, + }, + ], + is_ext_shared_channel: false, + event_context: '4-wd6joiQfdgTRQTpIzdfifQ', + }), + }, + source: {}, }, ], method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, + headers: { 'Content-Type': 'application/json' }, }, pathSuffix: '', }, @@ -211,23 +205,11 @@ export const data = [ batch: [ { context: { - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: 'SLACK', - }, - externalId: [ - { - type: 'slackUserId', - id: 'U04G7H550', - }, - ], - }, - integrations: { - SLACK: false, + library: { name: 'unknown', version: 'unknown' }, + integration: { name: 'SLACK' }, + externalId: [{ type: 'slackUserId', id: 'U04G7H550' }], }, + integrations: { SLACK: false }, type: 'track', event: 'Message', anonymousId: '7509c04f547b05afb6838aa742f4910263d6', @@ -258,10 +240,7 @@ export const data = [ type: 'channel', channel_id: 'C03CDQTPI65', }, - { - type: 'text', - text: ' to do this', - }, + { type: 'text', text: ' to do this' }, ], }, ], From 0e83a0a764d4f1276a58fb07fb829d5f8af2961d Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 17 Feb 2025 15:16:33 +0530 Subject: [PATCH 102/160] refactor: few sources migrated to v2 completely --- src/sources/adjust/core.js | 2 +- src/{v0 => }/sources/appcenter/mapping.json | 0 src/{v0 => }/sources/appcenter/transform.js | 11 ++- src/{v0 => }/sources/appsflyer/mapping.json | 0 src/{v0 => }/sources/appsflyer/transform.js | 7 +- src/{v0 => }/sources/auth0/eventMapping.json | 0 src/{v0 => }/sources/auth0/mapping.json | 0 src/{v0 => }/sources/auth0/transform.js | 13 +-- src/{v0 => }/sources/auth0/util.js | 0 src/{v1 => }/sources/braze/ignore.json | 0 src/{v1 => }/sources/braze/mapping.json | 0 src/{v1 => }/sources/braze/transform.js | 10 ++- src/{v0 => }/sources/canny/authorMapping.json | 0 src/{v0 => }/sources/canny/transform.js | 6 +- src/{v0 => }/sources/canny/util.js | 0 src/{v0 => }/sources/canny/voterMapping.json | 0 src/{v1 => }/sources/close_crm/config.js | 0 src/{v1 => }/sources/close_crm/transform.js | 9 +- src/{v1 => }/sources/cordial/config.js | 0 src/{v1 => }/sources/cordial/mapping.json | 0 src/{v1 => }/sources/cordial/transform.js | 10 +-- src/{v0 => }/sources/customerio/config.js | 0 src/{v0 => }/sources/customerio/mapping.json | 0 src/{v0 => }/sources/customerio/transform.js | 5 +- src/sources/message.js | 86 +++++++++++++++++++ src/v0/util/constant.js | 6 ++ src/v0/util/index.js | 16 +++- 27 files changed, 147 insertions(+), 34 deletions(-) rename src/{v0 => }/sources/appcenter/mapping.json (100%) rename src/{v0 => }/sources/appcenter/transform.js (88%) rename src/{v0 => }/sources/appsflyer/mapping.json (100%) rename src/{v0 => }/sources/appsflyer/transform.js (93%) rename src/{v0 => }/sources/auth0/eventMapping.json (100%) rename src/{v0 => }/sources/auth0/mapping.json (100%) rename src/{v0 => }/sources/auth0/transform.js (88%) rename src/{v0 => }/sources/auth0/util.js (100%) rename src/{v1 => }/sources/braze/ignore.json (100%) rename src/{v1 => }/sources/braze/mapping.json (100%) rename src/{v1 => }/sources/braze/transform.js (93%) rename src/{v0 => }/sources/canny/authorMapping.json (100%) rename src/{v0 => }/sources/canny/transform.js (92%) rename src/{v0 => }/sources/canny/util.js (100%) rename src/{v0 => }/sources/canny/voterMapping.json (100%) rename src/{v1 => }/sources/close_crm/config.js (100%) rename src/{v1 => }/sources/close_crm/transform.js (88%) rename src/{v1 => }/sources/cordial/config.js (100%) rename src/{v1 => }/sources/cordial/mapping.json (100%) rename src/{v1 => }/sources/cordial/transform.js (82%) rename src/{v0 => }/sources/customerio/config.js (100%) rename src/{v0 => }/sources/customerio/mapping.json (100%) rename src/{v0 => }/sources/customerio/transform.js (90%) create mode 100644 src/sources/message.js diff --git a/src/sources/adjust/core.js b/src/sources/adjust/core.js index 600c42a81f0..0aaa5459690 100644 --- a/src/sources/adjust/core.js +++ b/src/sources/adjust/core.js @@ -1,6 +1,6 @@ const path = require('path'); const fs = require('fs'); -const Message = require('../../v0/sources/message'); +const Message = require('../message'); const { excludedFieldList } = require('./config'); const { extractCustomFields, generateUUID } = require('../../v0/util'); const { convertToISODate } = require('./utils'); diff --git a/src/v0/sources/appcenter/mapping.json b/src/sources/appcenter/mapping.json similarity index 100% rename from src/v0/sources/appcenter/mapping.json rename to src/sources/appcenter/mapping.json diff --git a/src/v0/sources/appcenter/transform.js b/src/sources/appcenter/transform.js similarity index 88% rename from src/v0/sources/appcenter/transform.js rename to src/sources/appcenter/transform.js index 35d15f697e3..d885abb7ef6 100644 --- a/src/v0/sources/appcenter/transform.js +++ b/src/sources/appcenter/transform.js @@ -1,14 +1,12 @@ const path = require('path'); const fs = require('fs'); const { TransformationError } = require('@rudderstack/integrations-lib'); -const utils = require('../../util'); +const utils = require('../../v0/util'); const Message = require('../message'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -const { removeUndefinedAndNullValues } = require('../../util'); - -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); const processNormalEvent = (event) => { const message = new Message(`APPCENTER`); @@ -56,11 +54,12 @@ const processTestEvent = (event) => ({ statusCode: 200, }); -const process = (event) => { +const process = (payload) => { + const event = utils.getBodyFromV2SpecPayload(payload); const response = isTestEvent(event) ? processTestEvent(event) : processNormalEvent(event); // to bypass the unit testcases ( we may change this) // response.anonymousId = "7e32188a4dab669f"; - return removeUndefinedAndNullValues(response); + return utils.removeUndefinedAndNullValues(response); }; exports.process = process; diff --git a/src/v0/sources/appsflyer/mapping.json b/src/sources/appsflyer/mapping.json similarity index 100% rename from src/v0/sources/appsflyer/mapping.json rename to src/sources/appsflyer/mapping.json diff --git a/src/v0/sources/appsflyer/transform.js b/src/sources/appsflyer/transform.js similarity index 93% rename from src/v0/sources/appsflyer/transform.js rename to src/sources/appsflyer/transform.js index 1f21392b67c..efbf6135de3 100644 --- a/src/v0/sources/appsflyer/transform.js +++ b/src/sources/appsflyer/transform.js @@ -2,11 +2,11 @@ const path = require('path'); const fs = require('fs'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); -const { generateUUID } = require('../../util'); +const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -const { removeUndefinedAndNullValues, isObject, isAppleFamily } = require('../../util'); +const { removeUndefinedAndNullValues, isObject, isAppleFamily } = require('../../v0/util'); function processEvent(event) { const messageType = 'track'; @@ -74,7 +74,8 @@ function processEvent(event) { throw new TransformationError('Unknwon event type from Appsflyer'); } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); const returnValue = removeUndefinedAndNullValues(response); return returnValue; diff --git a/src/v0/sources/auth0/eventMapping.json b/src/sources/auth0/eventMapping.json similarity index 100% rename from src/v0/sources/auth0/eventMapping.json rename to src/sources/auth0/eventMapping.json diff --git a/src/v0/sources/auth0/mapping.json b/src/sources/auth0/mapping.json similarity index 100% rename from src/v0/sources/auth0/mapping.json rename to src/sources/auth0/mapping.json diff --git a/src/v0/sources/auth0/transform.js b/src/sources/auth0/transform.js similarity index 88% rename from src/v0/sources/auth0/transform.js rename to src/sources/auth0/transform.js index 5a1bf42e28a..103847c3d60 100644 --- a/src/v0/sources/auth0/transform.js +++ b/src/sources/auth0/transform.js @@ -1,11 +1,11 @@ const path = require('path'); const fs = require('fs'); -const { removeUndefinedAndNullValues } = require('../../util'); +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); const { getGroupId } = require('./util'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); const Message = require('../message'); -const { generateUUID } = require('../../util'); +const { generateUUID } = require('../../v0/util'); // Ref: https://auth0.com/docs/logs/references/log-event-type-codes const eventNameMap = JSON.parse( @@ -69,10 +69,11 @@ function processEvents(eventList) { return responses; } -function process(events) { - let eventList = events; - if (!Array.isArray(events)) { - eventList = events.logs || [events]; +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); + let eventList = event; + if (!Array.isArray(event)) { + eventList = event.logs || [event]; } return processEvents(eventList); } diff --git a/src/v0/sources/auth0/util.js b/src/sources/auth0/util.js similarity index 100% rename from src/v0/sources/auth0/util.js rename to src/sources/auth0/util.js diff --git a/src/v1/sources/braze/ignore.json b/src/sources/braze/ignore.json similarity index 100% rename from src/v1/sources/braze/ignore.json rename to src/sources/braze/ignore.json diff --git a/src/v1/sources/braze/mapping.json b/src/sources/braze/mapping.json similarity index 100% rename from src/v1/sources/braze/mapping.json rename to src/sources/braze/mapping.json diff --git a/src/v1/sources/braze/transform.js b/src/sources/braze/transform.js similarity index 93% rename from src/v1/sources/braze/transform.js rename to src/sources/braze/transform.js index 771c5887b33..147db0e0493 100644 --- a/src/v1/sources/braze/transform.js +++ b/src/sources/braze/transform.js @@ -7,8 +7,9 @@ const { formatTimeStamp, removeUndefinedAndNullValues, getHashFromArray, -} = require('../../../v0/util'); -const Message = require('../../../v0/sources/message'); + getBodyFromV2SpecPayload, +} = require('../../v0/util'); +const Message = require('../message'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -66,8 +67,9 @@ const processEvent = (event, eventMapping) => { throw new TransformationError('Unknown event type from Braze'); }; -const process = (inputEvent) => { - const { event, source } = inputEvent; +const process = (payload) => { + const event = getBodyFromV2SpecPayload(payload); + const { source } = payload; const { customMapping } = source.Config; const eventMapping = getHashFromArray(customMapping, 'from', 'to', false); const responses = []; diff --git a/src/v0/sources/canny/authorMapping.json b/src/sources/canny/authorMapping.json similarity index 100% rename from src/v0/sources/canny/authorMapping.json rename to src/sources/canny/authorMapping.json diff --git a/src/v0/sources/canny/transform.js b/src/sources/canny/transform.js similarity index 92% rename from src/v0/sources/canny/transform.js rename to src/sources/canny/transform.js index aad5a881c18..634bbf269e7 100644 --- a/src/v0/sources/canny/transform.js +++ b/src/sources/canny/transform.js @@ -2,7 +2,8 @@ const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); const { voterMapping, authorMapping, checkForRequiredFields } = require('./util'); -const logger = require('../../../logger'); +const logger = require('../../logger'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); const CannyOperation = { VOTE_CREATED: 'vote.created', @@ -73,7 +74,8 @@ function createMessage(event, typeOfUser) { return finalMessage; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); let typeOfUser; switch (event.type) { diff --git a/src/v0/sources/canny/util.js b/src/sources/canny/util.js similarity index 100% rename from src/v0/sources/canny/util.js rename to src/sources/canny/util.js diff --git a/src/v0/sources/canny/voterMapping.json b/src/sources/canny/voterMapping.json similarity index 100% rename from src/v0/sources/canny/voterMapping.json rename to src/sources/canny/voterMapping.json diff --git a/src/v1/sources/close_crm/config.js b/src/sources/close_crm/config.js similarity index 100% rename from src/v1/sources/close_crm/config.js rename to src/sources/close_crm/config.js diff --git a/src/v1/sources/close_crm/transform.js b/src/sources/close_crm/transform.js similarity index 88% rename from src/v1/sources/close_crm/transform.js rename to src/sources/close_crm/transform.js index b597285e62a..f16edbb8896 100644 --- a/src/v1/sources/close_crm/transform.js +++ b/src/sources/close_crm/transform.js @@ -4,9 +4,10 @@ const { removeUndefinedAndNullRecurse, generateUUID, formatTimeStamp, -} = require('../../../v0/util'); + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const { excludedFieldList } = require('./config'); -const Message = require('../../../v0/sources/message'); +const Message = require('../message'); function processEvent(inputEvent) { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -48,8 +49,8 @@ function processEvent(inputEvent) { return message; } -function process(inputEvent) { - const { event } = inputEvent; +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); return removeUndefinedAndNullValues(response); } diff --git a/src/v1/sources/cordial/config.js b/src/sources/cordial/config.js similarity index 100% rename from src/v1/sources/cordial/config.js rename to src/sources/cordial/config.js diff --git a/src/v1/sources/cordial/mapping.json b/src/sources/cordial/mapping.json similarity index 100% rename from src/v1/sources/cordial/mapping.json rename to src/sources/cordial/mapping.json diff --git a/src/v1/sources/cordial/transform.js b/src/sources/cordial/transform.js similarity index 82% rename from src/v1/sources/cordial/transform.js rename to src/sources/cordial/transform.js index 5548efee70b..ababd67d296 100644 --- a/src/v1/sources/cordial/transform.js +++ b/src/sources/cordial/transform.js @@ -1,6 +1,6 @@ -const Message = require('../../../v0/sources/message'); -const { CommonUtils } = require('../../../util/common'); -const { generateUUID, isDefinedAndNotNull } = require('../../../v0/util'); +const Message = require('../message'); +const { CommonUtils } = require('../../util/common'); +const { generateUUID, isDefinedAndNotNull, getBodyFromV2SpecPayload } = require('../../v0/util'); const { eventsMapping } = require('./config'); const mapping = require('./mapping.json'); @@ -43,8 +43,8 @@ const processEvent = (inputPaylaod) => { }; const process = (inputEvent) => { - const { event: events } = inputEvent; - const eventsArray = CommonUtils.toArray(events); + const event = getBodyFromV2SpecPayload(inputEvent); + const eventsArray = CommonUtils.toArray(event); return eventsArray.map(processEvent); }; diff --git a/src/v0/sources/customerio/config.js b/src/sources/customerio/config.js similarity index 100% rename from src/v0/sources/customerio/config.js rename to src/sources/customerio/config.js diff --git a/src/v0/sources/customerio/mapping.json b/src/sources/customerio/mapping.json similarity index 100% rename from src/v0/sources/customerio/mapping.json rename to src/sources/customerio/mapping.json diff --git a/src/v0/sources/customerio/transform.js b/src/sources/customerio/transform.js similarity index 90% rename from src/v0/sources/customerio/transform.js rename to src/sources/customerio/transform.js index a2e69388b94..b085c84f42e 100644 --- a/src/v0/sources/customerio/transform.js +++ b/src/sources/customerio/transform.js @@ -7,9 +7,10 @@ const { get } = require('lodash'); const Message = require('../message'); const { mappingConfig } = require('./config'); -const { isDefinedAndNotNull } = require('../../util'); +const { isDefinedAndNotNull, getBodyFromV2SpecPayload } = require('../../v0/util'); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`Customer.io`); // since customer, email, sms, push, slack, webhook diff --git a/src/sources/message.js b/src/sources/message.js new file mode 100644 index 00000000000..05c4c50f559 --- /dev/null +++ b/src/sources/message.js @@ -0,0 +1,86 @@ +const set = require('set-value'); +const get = require('get-value'); + +const { getValueFromMessage } = require('../v0/util'); + +const context = (integration) => ({ + library: { + name: 'unknown', + version: 'unknown', + }, + integration: { + name: integration, + }, +}); + +class Message { + constructor(integration) { + this.context = context(integration); + this.integrations = { + [integration]: false, + }; + } + + setEventName(name) { + this.event = name; + } + + setEventType(type) { + this.type = type; + } + + setProperty(name, value) { + set(this, name, value); + } + + setProperties(event, mapping) { + Object.keys(mapping).forEach((key) => { + const setVal = get(event, key); + let destKeys = mapping[key]; + if (!Array.isArray(destKeys)) { + destKeys = [destKeys]; + } + destKeys.forEach((destKey) => { + const existingVal = get(this, destKey); + // do not set if val setVal nil + // give higher pref to first key in mapping.json in case of same value + if ( + setVal !== null && + setVal !== undefined && + (existingVal === null || existingVal === undefined) + ) { + set(this, destKey, setVal); + } + }); + }); + } + + setPropertiesV2(event, mappingJson) { + mappingJson.forEach((mapping) => { + const { sourceKeys } = mapping; + let { destKeys } = mapping; + const setVal = getValueFromMessage(event, sourceKeys); + if (!Array.isArray(destKeys)) { + destKeys = [destKeys]; + } + destKeys.forEach((destKey) => { + const existingVal = get(this, destKey); + // do not set if val setVal nil + // give higher pref to first key in mapping.json in case of same value + if ( + setVal !== null && + setVal !== undefined && + (existingVal === null || existingVal === undefined) + ) { + set(this, destKey, setVal); + } + }); + }); + } + + setTimestamp(timestamp) { + this.timestamp = timestamp; + } +} + +module.exports = Message; diff --git a/src/v0/util/constant.js b/src/v0/util/constant.js index 8f5d6c97a13..ba350c2f395 100644 --- a/src/v0/util/constant.js +++ b/src/v0/util/constant.js @@ -85,6 +85,11 @@ const HTTP_STATUS_CODES = { NETWORK_AUTHENTICATION_REQUIRED: 511, }; +const ERROR_MESSAGES = { + MALFORMED_JSON_IN_REQUEST_BODY: 'Malformed JSON in request body', + REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD: 'request.body is not present in V2 spec payload', +}; + module.exports = { API_CALL, AUTH_CACHE_TTL, @@ -94,4 +99,5 @@ module.exports = { FEATURE_FILTER_CODE, FEATURE_GZIP_SUPPORT, VDM_V2_SCHEMA_VERSION, + ERROR_MESSAGES, }; diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 36e04e53950..eab69405c3a 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -32,7 +32,7 @@ const logger = require('../../logger'); const stats = require('../../util/stats'); const { DestCanonicalNames, DestHandlerMap } = require('../../constants/destinationCanonicalNames'); const { client: errNotificationClient } = require('../../util/errorNotifier'); -const { HTTP_STATUS_CODES, VDM_V2_SCHEMA_VERSION } = require('./constant'); +const { HTTP_STATUS_CODES, VDM_V2_SCHEMA_VERSION, ERROR_MESSAGES } = require('./constant'); const { REFRESH_TOKEN, AUTH_STATUS_INACTIVE, @@ -2364,6 +2364,19 @@ const convertToUuid = (input) => { throw new InstrumentationError(errorMessage); } }; + +const getBodyFromV2SpecPayload = ({ request }) => { + if (request?.body) { + try { + const parsedBody = JSON.parse(request.body); + return parsedBody; + } catch (error) { + throw new TransformationError(ERROR_MESSAGES.MALFORMED_JSON_IN_REQUEST_BODY); + } + } + throw new TransformationError(ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD); +}; + // ======================================================================== // EXPORTS // ======================================================================== @@ -2397,6 +2410,7 @@ module.exports = { generateErrorObject, generateUUID, getBrowserInfo, + getBodyFromV2SpecPayload, getDateInFormat, getDestinationExternalID, getDestinationExternalIDInfoForRetl, From 3d3230ba1329fad41b2ea01c80d320378a9852b4 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Tue, 18 Feb 2025 12:17:32 +0530 Subject: [PATCH 103/160] chore: fix code smells --- src/sources/appsflyer/transform.js | 106 ++++++++++++++-------------- src/sources/auth0/transform.js | 2 +- src/sources/braze/transform.js | 2 +- src/sources/customerio/transform.js | 8 +-- src/v0/util/index.js | 9 +++ 5 files changed, 66 insertions(+), 61 deletions(-) diff --git a/src/sources/appsflyer/transform.js b/src/sources/appsflyer/transform.js index efbf6135de3..f552c5ad26c 100644 --- a/src/sources/appsflyer/transform.js +++ b/src/sources/appsflyer/transform.js @@ -2,76 +2,78 @@ const path = require('path'); const fs = require('fs'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); -const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); +const { generateUUID, getBodyFromV2SpecPayload, isAndroidFamily } = require('../../v0/util'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); const { removeUndefinedAndNullValues, isObject, isAppleFamily } = require('../../v0/util'); -function processEvent(event) { - const messageType = 'track'; +const TRACK_MESSAGE_TYPE = 'track'; - if (event.event_name) { - const eventName = event.event_name; - const message = new Message(`AF`); +function createBaseMessage(eventName) { + const message = new Message(`AF`); + message.setEventType(TRACK_MESSAGE_TYPE); + message.setEventName(eventName); + return message; +} - message.setEventType(messageType); +function getAdvertisingId(event) { + if (isAppleFamily(event.platform)) { + return event.idfa; + } + if (isAndroidFamily(event.platform)) { + return event.android_id; + } + return null; +} - message.setEventName(eventName); +function processEvent(event) { + if (!event.event_name) { + throw new TransformationError('Unknwon event type from Appsflyer'); + } - const properties = { ...event }; - message.setProperty('properties', properties); + const message = createBaseMessage(event.event_name); - // set fields in payload from mapping json - message.setProperties(event, mappingJson); + const properties = { ...event }; + message.setProperty('properties', properties); - // Remove the fields from properties that are already mapped to other fields. - Object.keys(mappingJson).forEach((key) => { - if (message.properties && message.properties[key] !== undefined) { - delete message.properties[key]; - } - }); + // set fields in payload from mapping json + message.setProperties(event, mappingJson); - if (!isObject(message.context.device)) { - message.context.device = {}; - } + const mappedPropertiesKeys = Object.keys(mappingJson); - if (event.platform) { - if (isAppleFamily(event.platform)) { - message.context.device.advertisingId = event.idfa; - } else if (event.platform.toLowerCase() === 'android') { - message.context.device.advertisingId = event.android_id; - } - // remove idfa from message properties as it is already mapped. - if (message.properties && message.properties.idfa !== undefined) { - delete message.properties.idfa; - } - // remove android_id from message properties as it is already mapped. - if (message.properties && message.properties.android_id !== undefined) { - delete message.properties.android_id; - } - } - if (message.context.device.advertisingId) { + if (!isObject(message.context.device)) { + message.context.device = {}; + } + + if (event.platform) { + const advertisingId = getAdvertisingId(event); + if (advertisingId) { + message.context.device.advertisingId = advertisingId; message.context.device.adTrackingEnabled = true; } + mappedPropertiesKeys.push('idfa', 'android_id'); + } - if (event.appsflyer_id) { - message.context.externalId = [ - { - type: 'appsflyerExternalId', - value: event.appsflyer_id, - }, - ]; - // remove appsflyer_id from message properties as it is already mapped. - if (message.properties && message.properties.appsflyer_id !== undefined) { - delete message.properties.appsflyer_id; - } + if (event.appsflyer_id) { + message.context.externalId = [ + { + type: 'appsflyerExternalId', + value: event.appsflyer_id, + }, + ]; + mappedPropertiesKeys.push('appsflyer_id'); + } + message.setProperty('anonymousId', generateUUID()); + + // Remove the fields from properties that are already mapped to other fields. + mappedPropertiesKeys.forEach((key) => { + if (message.properties && message.properties[key] !== undefined) { + delete message.properties[key]; } - message.setProperty('anonymousId', generateUUID()); + }); - return message; - } - throw new TransformationError('Unknwon event type from Appsflyer'); + return message; } function process(payload) { diff --git a/src/sources/auth0/transform.js b/src/sources/auth0/transform.js index 103847c3d60..22920cb6256 100644 --- a/src/sources/auth0/transform.js +++ b/src/sources/auth0/transform.js @@ -45,7 +45,7 @@ function processEvents(eventList) { // eslint-disable-next-line @typescript-eslint/naming-convention const { data, log_id } = event; // Dropping the event if type is not present - if (data && data.type) { + if (data?.type) { const eventType = data.type; // ss -> successful signup if (eventType === 'ss') { diff --git a/src/sources/braze/transform.js b/src/sources/braze/transform.js index 147db0e0493..47681271d28 100644 --- a/src/sources/braze/transform.js +++ b/src/sources/braze/transform.js @@ -83,7 +83,7 @@ const process = (payload) => { responses.push(removeUndefinedAndNullValues(resp)); } } catch (error) { - // TODO: figure out a way to handle partial failures within batch + // Figure out a way to handle partial failures within batch // responses.push({ // statusCode: 400, // error: error.message || "Unknwon error" diff --git a/src/sources/customerio/transform.js b/src/sources/customerio/transform.js index b085c84f42e..84e8491f41f 100644 --- a/src/sources/customerio/transform.js +++ b/src/sources/customerio/transform.js @@ -21,7 +21,6 @@ function process(payload) { const eventObjectType = event.object_type?.toLowerCase() || ''; let eventName = get(mappingConfig, `${eventObjectType}.${event.metric}`); if (!eventName) { - // throw new TransformationError("Metric not supported"); eventName = 'Unknown Event'; } message.setEventName(eventName); @@ -36,12 +35,7 @@ function process(payload) { } // when customer.io does not pass an associated userId, set the email address as anonymousId - if ( - (message.userId === null || message.userId === undefined) && - message.context && - message.context.traits && - message.context.traits.email - ) { + if ((message.userId === null || message.userId === undefined) && message.context?.traits?.email) { message.anonymousId = message.context.traits.email; } diff --git a/src/v0/util/index.js b/src/v0/util/index.js index eab69405c3a..9b12300e430 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -1663,6 +1663,14 @@ function isAppleFamily(platform) { return false; } +function isAndroidFamily(platform) { + const androidOsNames = ['android']; + if (typeof platform === 'string') { + return androidOsNames.includes(platform?.toLowerCase()); + } + return false; +} + function removeHyphens(str) { if (!isString(str)) { return str; @@ -2441,6 +2449,7 @@ module.exports = { handleSourceKeysOperation, hashToSha256, isAppleFamily, + isAndroidFamily, isBlank, isDefined, isDefinedAndNotNull, From c53594747e40c9cb378c8a56a71d2d34bc14ab56 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Wed, 19 Feb 2025 23:20:55 +0530 Subject: [PATCH 104/160] chore: unit test cases added to improve codecov --- src/v0/util/index.test.js | 90 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/src/v0/util/index.test.js b/src/v0/util/index.test.js index 0b0b585e4cb..052b850a288 100644 --- a/src/v0/util/index.test.js +++ b/src/v0/util/index.test.js @@ -3,6 +3,7 @@ const utilities = require('.'); const { getFuncTestData } = require('../../../test/testHelper'); const { FilteredEventsError } = require('./errorTypes'); const { v5 } = require('uuid'); +const { ERROR_MESSAGES } = require('./constant'); const { hasCircularReference, flattenJson, @@ -1073,3 +1074,92 @@ describe('', () => { expect(res).toBe(1003); }); }); + +describe('isAndroidFamily', () => { + it('should return true for "android" platform', () => { + expect(utilities.isAndroidFamily('android')).toBe(true); + }); + + it('should return true for "ANDROID" platform (case insensitive)', () => { + expect(utilities.isAndroidFamily('ANDROID')).toBe(true); + }); + + it('should return false for non-android platforms', () => { + expect(utilities.isAndroidFamily('ios')).toBe(false); + expect(utilities.isAndroidFamily('web')).toBe(false); + expect(utilities.isAndroidFamily('windows')).toBe(false); + }); + + it('should return false for empty string', () => { + expect(utilities.isAndroidFamily('')).toBe(false); + }); + + it('should return false for non-string inputs', () => { + expect(utilities.isAndroidFamily(null)).toBe(false); + expect(utilities.isAndroidFamily(undefined)).toBe(false); + expect(utilities.isAndroidFamily(123)).toBe(false); + expect(utilities.isAndroidFamily({})).toBe(false); + expect(utilities.isAndroidFamily([])).toBe(false); + expect(utilities.isAndroidFamily(true)).toBe(false); + }); +}); + +describe('getBodyFromV2SpecPayload', () => { + it('should successfully parse valid JSON body', () => { + const input = { + request: { + body: '{"key": "value", "number": 123}', + }, + }; + const expected = { + key: 'value', + number: 123, + }; + expect(utilities.getBodyFromV2SpecPayload(input)).toEqual(expected); + }); + + it('should throw TransformationError for malformed JSON', () => { + const input = { + request: { + body: '{invalid json}', + }, + }; + expect(() => utilities.getBodyFromV2SpecPayload(input)).toThrow( + ERROR_MESSAGES.MALFORMED_JSON_IN_REQUEST_BODY, + ); + }); + + it('should throw TransformationError when request body is missing', () => { + const input = { + request: {}, + }; + expect(() => utilities.getBodyFromV2SpecPayload(input)).toThrow( + ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD, + ); + }); + + it('should throw TransformationError when request is missing', () => { + const input = {}; + expect(() => utilities.getBodyFromV2SpecPayload(input)).toThrow( + ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD, + ); + }); + + it('should parse empty JSON object', () => { + const input = { + request: { + body: '{}', + }, + }; + expect(utilities.getBodyFromV2SpecPayload(input)).toEqual({}); + }); + + it('should parse JSON array', () => { + const input = { + request: { + body: '[1,2,3]', + }, + }; + expect(utilities.getBodyFromV2SpecPayload(input)).toEqual([1, 2, 3]); + }); +}); From e912a987be95e88133c3c69934ac6eef9c883010 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Thu, 20 Feb 2025 10:04:04 +0530 Subject: [PATCH 105/160] chore: appsflyer utility test cases --- src/sources/appsflyer/transform.js | 20 ++++------- src/sources/appsflyer/utils.js | 13 +++++++ src/sources/appsflyer/utils.test.js | 56 +++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 src/sources/appsflyer/utils.js create mode 100644 src/sources/appsflyer/utils.test.js diff --git a/src/sources/appsflyer/transform.js b/src/sources/appsflyer/transform.js index f552c5ad26c..07e60f136e3 100644 --- a/src/sources/appsflyer/transform.js +++ b/src/sources/appsflyer/transform.js @@ -2,12 +2,16 @@ const path = require('path'); const fs = require('fs'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); -const { generateUUID, getBodyFromV2SpecPayload, isAndroidFamily } = require('../../v0/util'); +const { + generateUUID, + getBodyFromV2SpecPayload, + removeUndefinedAndNullValues, + isObject, +} = require('../../v0/util'); +const { getAdvertisingId } = require('./utils'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -const { removeUndefinedAndNullValues, isObject, isAppleFamily } = require('../../v0/util'); - const TRACK_MESSAGE_TYPE = 'track'; function createBaseMessage(eventName) { @@ -17,16 +21,6 @@ function createBaseMessage(eventName) { return message; } -function getAdvertisingId(event) { - if (isAppleFamily(event.platform)) { - return event.idfa; - } - if (isAndroidFamily(event.platform)) { - return event.android_id; - } - return null; -} - function processEvent(event) { if (!event.event_name) { throw new TransformationError('Unknwon event type from Appsflyer'); diff --git a/src/sources/appsflyer/utils.js b/src/sources/appsflyer/utils.js new file mode 100644 index 00000000000..dc02833f67a --- /dev/null +++ b/src/sources/appsflyer/utils.js @@ -0,0 +1,13 @@ +const { isAppleFamily, isAndroidFamily } = require('../../v0/util'); + +function getAdvertisingId(event) { + if (isAppleFamily(event.platform)) { + return event.idfa; + } + if (isAndroidFamily(event.platform)) { + return event.android_id; + } + return null; +} + +module.exports = { getAdvertisingId }; diff --git a/src/sources/appsflyer/utils.test.js b/src/sources/appsflyer/utils.test.js new file mode 100644 index 00000000000..845854cf001 --- /dev/null +++ b/src/sources/appsflyer/utils.test.js @@ -0,0 +1,56 @@ +const { getAdvertisingId } = require('./utils'); + +describe('getAdvertisingId', () => { + const testCases = [ + { + name: 'should return idfa for iOS device', + event: { + platform: 'iOS', + idfa: 'ios-advertising-id-123', + android_id: 'not-this-one', + }, + expected: 'ios-advertising-id-123', + }, + { + name: 'should return idfa for iPadOS device', + event: { + platform: 'iPadOS', + idfa: 'ipad-advertising-id-456', + android_id: 'not-this-one', + }, + expected: 'ipad-advertising-id-456', + }, + { + name: 'should return android_id for Android device', + event: { + platform: 'Android', + idfa: 'not-this-one', + android_id: 'android-advertising-id-789', + }, + expected: 'android-advertising-id-789', + }, + { + name: 'should return null for unknown platform', + event: { + platform: 'Windows', + idfa: 'some-id', + android_id: 'some-other-id', + }, + expected: null, + }, + { + name: 'should return null when platform is missing', + event: { + idfa: 'some-id', + android_id: 'some-other-id', + }, + expected: null, + }, + ]; + + testCases.forEach(({ name, event, expected }) => { + it(name, () => { + expect(getAdvertisingId(event)).toBe(expected); + }); + }); +}); From 54314851048389fb95d5d9755b739445d5413e8c Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 24 Feb 2025 10:16:59 +0530 Subject: [PATCH 106/160] chore: simplify test cases, swagger updates --- swagger/routes/source.yaml | 17 + test/integrations/sources/auth0/data.ts | 562 +----------------------- 2 files changed, 23 insertions(+), 556 deletions(-) diff --git a/swagger/routes/source.yaml b/swagger/routes/source.yaml index 3babdb57e14..f3c5cecf765 100644 --- a/swagger/routes/source.yaml +++ b/swagger/routes/source.yaml @@ -22,6 +22,23 @@ type: array items: type: object + examples: + v2Spec: + summary: V2 Spec Request Structure Example + value: + request: + body: '{"key": "value", "nested": {"data": "example"}}' + url: "https://rudderstack.webhook.endpoint/v1/webhook?paramkey=paramvalue" + method: "POST" + query_parameters: {paramKey: "paramValue"} + headers: {headerkey: "headerValue"} + source: {} + v1Spec: + summary: V1 Spec Request Structure Example + value: + request: + event: {"key": "value", "nested": {"data": "example"}, query_parameters: {paramKey: "paramValue"}} + source: {} responses: 200: description: Success diff --git a/test/integrations/sources/auth0/data.ts b/test/integrations/sources/auth0/data.ts index 7f675116624..0772311d81a 100644 --- a/test/integrations/sources/auth0/data.ts +++ b/test/integrations/sources/auth0/data.ts @@ -71,138 +71,7 @@ export const data = [ strategy: 'jwt', credentials: { jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], + scopes: ['create:actions'], }, }, body: { @@ -332,138 +201,7 @@ export const data = [ strategy: 'jwt', credentials: { jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], + scopes: ['create:actions'], }, }, body: { @@ -665,138 +403,7 @@ export const data = [ strategy: 'jwt', credentials: { jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], + scopes: ['create:actions'], }, }, body: { @@ -856,20 +463,7 @@ export const data = [ request: { ip: '35.160.3.103', auth: { - scopes: [ - 'read:authenticators', - 'remove:authenticators', - 'update:authenticators', - 'create:authenticators', - 'read:enrollments', - 'delete:enrollments', - 'read:factors', - 'update:factors', - 'update:tenant_settings', - 'update:users', - 'create:enrollment_tickets', - 'create:users', - ], + scopes: ['read:authenticators'], subject: 'google-oauth2|123456', strategy: 'jwt_api2_internal_token', }, @@ -939,138 +533,7 @@ export const data = [ strategy: 'jwt', credentials: { jti: '571921bf7833a97efabf08d765a0ec8f', - scopes: [ - 'create:actions', - 'create:actions_log_sessions', - 'create:client_credentials', - 'create:client_grants', - 'create:clients', - 'create:connections', - 'create:custom_domains', - 'create:email_provider', - 'create:email_templates', - 'create:guardian_enrollment_tickets', - 'create:integrations', - 'create:log_streams', - 'create:organization_connections', - 'create:organization_invitations', - 'create:organization_member_roles', - 'create:organization_members', - 'create:organizations', - 'create:requested_scopes', - 'create:resource_servers', - 'create:roles', - 'create:rules', - 'create:shields', - 'create:signing_keys', - 'create:tenant_invitations', - 'create:test_email_dispatch', - 'create:users', - 'delete:actions', - 'delete:anomaly_blocks', - 'delete:branding', - 'delete:client_credentials', - 'delete:client_grants', - 'delete:clients', - 'delete:connections', - 'delete:custom_domains', - 'delete:device_credentials', - 'delete:email_provider', - 'delete:email_templates', - 'delete:grants', - 'delete:guardian_enrollments', - 'delete:integrations', - 'delete:log_streams', - 'delete:organization_connections', - 'delete:organization_invitations', - 'delete:organization_member_roles', - 'delete:organization_members', - 'delete:organizations', - 'delete:owners', - 'delete:requested_scopes', - 'delete:resource_servers', - 'delete:roles', - 'delete:rules', - 'delete:rules_configs', - 'delete:shields', - 'delete:tenant_invitations', - 'delete:tenant_members', - 'delete:tenants', - 'delete:users', - 'read:actions', - 'read:anomaly_blocks', - 'read:attack_protection', - 'read:branding', - 'read:checks', - 'read:client_credentials', - 'read:client_grants', - 'read:client_keys', - 'read:clients', - 'read:connections', - 'read:custom_domains', - 'read:device_credentials', - 'read:email_provider', - 'read:email_templates', - 'read:email_triggers', - 'read:entity_counts', - 'read:grants', - 'read:guardian_factors', - 'read:insights', - 'read:integrations', - 'read:log_streams', - 'read:logs', - 'read:mfa_policies', - 'read:organization_connections', - 'read:organization_invitations', - 'read:organization_member_roles', - 'read:organization_members', - 'read:organizations', - 'read:prompts', - 'read:requested_scopes', - 'read:resource_servers', - 'read:roles', - 'read:rules', - 'read:rules_configs', - 'read:shields', - 'read:signing_keys', - 'read:stats', - 'read:tenant_invitations', - 'read:tenant_members', - 'read:tenant_settings', - 'read:triggers', - 'read:users', - 'run:checks', - 'update:actions', - 'update:attack_protection', - 'update:branding', - 'update:client_credentials', - 'update:client_grants', - 'update:client_keys', - 'update:clients', - 'update:connections', - 'update:custom_domains', - 'update:email_provider', - 'update:email_templates', - 'update:email_triggers', - 'update:guardian_factors', - 'update:integrations', - 'update:log_streams', - 'update:mfa_policies', - 'update:organization_connections', - 'update:organizations', - 'update:prompts', - 'update:requested_scopes', - 'update:resource_servers', - 'update:roles', - 'update:rules', - 'update:rules_configs', - 'update:shields', - 'update:signing_keys', - 'update:tenant_members', - 'update:tenant_settings', - 'update:triggers', - 'update:users', - ], + scopes: ['create:actions'], }, }, body: { @@ -1142,20 +605,7 @@ export const data = [ request: { ip: '35.160.3.103', auth: { - scopes: [ - 'read:authenticators', - 'remove:authenticators', - 'update:authenticators', - 'create:authenticators', - 'read:enrollments', - 'delete:enrollments', - 'read:factors', - 'update:factors', - 'update:tenant_settings', - 'update:users', - 'create:enrollment_tickets', - 'create:users', - ], + scopes: ['read:authenticators'], subject: 'google-oauth2|123456', strategy: 'jwt_api2_internal_token', }, From ff316ee2a912828a6a3139e1c11244cb3115ddee Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 24 Feb 2025 10:23:02 +0530 Subject: [PATCH 107/160] chore: swagger docs example modifications --- swagger/routes/source.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swagger/routes/source.yaml b/swagger/routes/source.yaml index f3c5cecf765..8153cfce22a 100644 --- a/swagger/routes/source.yaml +++ b/swagger/routes/source.yaml @@ -30,8 +30,8 @@ body: '{"key": "value", "nested": {"data": "example"}}' url: "https://rudderstack.webhook.endpoint/v1/webhook?paramkey=paramvalue" method: "POST" - query_parameters: {paramKey: "paramValue"} - headers: {headerkey: "headerValue"} + query_parameters: {paramKey: ["paramValue"]} + headers: {headerkey: ["headerValue"]} source: {} v1Spec: summary: V1 Spec Request Structure Example From 4b6cc234830f1d16940f02df80daae89dc710294 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 24 Feb 2025 10:25:46 +0530 Subject: [PATCH 108/160] chore: swagger docs example modifications --- swagger/routes/source.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/swagger/routes/source.yaml b/swagger/routes/source.yaml index 8153cfce22a..4dc64df540e 100644 --- a/swagger/routes/source.yaml +++ b/swagger/routes/source.yaml @@ -26,19 +26,19 @@ v2Spec: summary: V2 Spec Request Structure Example value: - request: - body: '{"key": "value", "nested": {"data": "example"}}' - url: "https://rudderstack.webhook.endpoint/v1/webhook?paramkey=paramvalue" - method: "POST" - query_parameters: {paramKey: ["paramValue"]} - headers: {headerkey: ["headerValue"]} - source: {} + - request: + body: '{"key": "value", "nested": {"data": "example"}}' + url: "https://rudderstack.webhook.endpoint/v1/webhook?paramkey=paramvalue" + method: "POST" + query_parameters: {paramKey: ["paramValue"]} + headers: {headerKey: ["headerValue"]} + source: {} v1Spec: summary: V1 Spec Request Structure Example value: - request: - event: {"key": "value", "nested": {"data": "example"}, query_parameters: {paramKey: "paramValue"}} - source: {} + - request: + event: {"key": "value", "nested": {"data": "example"}, query_parameters: {paramKey: "paramValue"}} + source: {} responses: 200: description: Success From b11e1807a57fc9d4ff9477fa640a1d06ccb05319 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 24 Feb 2025 08:53:42 +0000 Subject: [PATCH 109/160] chore(release): 1.91.2 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 224ac1ed4a7..32df60d9a99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ 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.91.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.1...v1.91.2) (2025-02-24) + ### [1.91.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.0...v1.91.1) (2025-02-19) diff --git a/package-lock.json b/package-lock.json index 50daad40afd..b10e043b3a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.91.1", + "version": "1.91.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.91.1", + "version": "1.91.2", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 4d78bdc050d..534378e607a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.91.1", + "version": "1.91.2", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 5780fcf2f2096693bbfcac70fdaede3005561be6 Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Mon, 24 Feb 2025 14:54:51 +0530 Subject: [PATCH 110/160] chore: update error function ref (#4105) --- src/v0/destinations/lambda/transform.js | 3 +-- src/v0/destinations/marketo/transform.js | 2 +- src/v0/destinations/marketo_static_list/transform.js | 7 ++----- src/v0/destinations/marketo_static_list/transformV2.js | 7 ++----- src/v0/destinations/salesforce/transform.js | 2 +- src/v0/util/index.js | 10 +++++++++- src/v0/util/recordUtils.js | 4 ++-- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/v0/destinations/lambda/transform.js b/src/v0/destinations/lambda/transform.js index efc68b89d6f..5f6cbfda8b9 100644 --- a/src/v0/destinations/lambda/transform.js +++ b/src/v0/destinations/lambda/transform.js @@ -1,6 +1,5 @@ const _ = require('lodash'); -const { getErrorRespEvents } = require('@rudderstack/integrations-lib'); -const { getSuccessRespEvents } = require('../../util'); +const { getSuccessRespEvents, getErrorRespEvents } = require('../../util'); const { ConfigurationError } = require('@rudderstack/integrations-lib'); const DEFAULT_INVOCATION_TYPE = 'Event'; // asynchronous invocation diff --git a/src/v0/destinations/marketo/transform.js b/src/v0/destinations/marketo/transform.js index accca1d4490..78e23bf0731 100644 --- a/src/v0/destinations/marketo/transform.js +++ b/src/v0/destinations/marketo/transform.js @@ -7,7 +7,6 @@ const { InstrumentationError, ConfigurationError, UnauthorizedError, - getErrorRespEvents, } = require('@rudderstack/integrations-lib'); const stats = require('../../../util/stats'); const { EventType, MappedToDestinationKey } = require('../../../constants'); @@ -32,6 +31,7 @@ const { isDefinedAndNotNull, generateErrorObject, handleRtTfSingleEventError, + getErrorRespEvents, } = require('../../util'); const Cache = require('../../util/cache'); const { USER_LEAD_CACHE_TTL, AUTH_CACHE_TTL, JSON_MIME_TYPE } = require('../../util/constant'); diff --git a/src/v0/destinations/marketo_static_list/transform.js b/src/v0/destinations/marketo_static_list/transform.js index 810b528bbf1..936b528de7b 100644 --- a/src/v0/destinations/marketo_static_list/transform.js +++ b/src/v0/destinations/marketo_static_list/transform.js @@ -1,15 +1,12 @@ const lodash = require('lodash'); const cloneDeep = require('lodash/cloneDeep'); -const { - InstrumentationError, - UnauthorizedError, - getErrorRespEvents, -} = require('@rudderstack/integrations-lib'); +const { InstrumentationError, UnauthorizedError } = require('@rudderstack/integrations-lib'); const { defaultPostRequestConfig, defaultDeleteRequestConfig, generateErrorObject, simpleProcessRouterDest, + getErrorRespEvents, } = require('../../util'); const { AUTH_CACHE_TTL, JSON_MIME_TYPE } = require('../../util/constant'); const { getIds, validateMessageType } = require('./util'); diff --git a/src/v0/destinations/marketo_static_list/transformV2.js b/src/v0/destinations/marketo_static_list/transformV2.js index 73d4bec8f81..912d548d098 100644 --- a/src/v0/destinations/marketo_static_list/transformV2.js +++ b/src/v0/destinations/marketo_static_list/transformV2.js @@ -1,9 +1,5 @@ const lodash = require('lodash'); -const { - InstrumentationError, - UnauthorizedError, - getErrorRespEvents, -} = require('@rudderstack/integrations-lib'); +const { InstrumentationError, UnauthorizedError } = require('@rudderstack/integrations-lib'); const { defaultPostRequestConfig, defaultDeleteRequestConfig, @@ -11,6 +7,7 @@ const { getSuccessRespEvents, isDefinedAndNotNull, generateErrorObject, + getErrorRespEvents, } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); const { MAX_LEAD_IDS_SIZE } = require('./config'); diff --git a/src/v0/destinations/salesforce/transform.js b/src/v0/destinations/salesforce/transform.js index 7e66dd88106..f25659bfa4f 100644 --- a/src/v0/destinations/salesforce/transform.js +++ b/src/v0/destinations/salesforce/transform.js @@ -3,7 +3,6 @@ const cloneDeep = require('lodash/cloneDeep'); const { InstrumentationError, NetworkInstrumentationError, - getErrorRespEvents, } = require('@rudderstack/integrations-lib'); const { EventType, MappedToDestinationKey } = require('../../../constants'); const { @@ -26,6 +25,7 @@ const { handleRtTfSingleEventError, generateErrorObject, isHttpStatusSuccess, + getErrorRespEvents, } = require('../../util'); const { salesforceResponseHandler, collectAuthorizationInfo, getAuthHeader } = require('./utils'); const { handleHttpRequest } = require('../../../adapters/network'); diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 36e04e53950..b4c31d6b903 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -23,7 +23,6 @@ const { PlatformError, TransformationError, OAuthSecretError, - getErrorRespEvents, } = require('@rudderstack/integrations-lib'); const { JsonTemplateEngine, PathType } = require('@rudderstack/json-template-engine'); @@ -1719,6 +1718,14 @@ function getValidDynamicFormConfig( return res; } +const getErrorRespEvents = (metadata, statusCode, error, statTags, batched = false) => ({ + metadata, + batched, + statusCode, + error, + statTags, +}); + /** * This method is used to check if the input events sent to router transformation are valid * It is to be used only for router transform destinations @@ -2402,6 +2409,7 @@ module.exports = { getDestinationExternalIDInfoForRetl, getDestinationExternalIDObjectForRetl, getDeviceModel, + getErrorRespEvents, getEventTime, getFieldValueFromMessage, getFirstAndLastName, diff --git a/src/v0/util/recordUtils.js b/src/v0/util/recordUtils.js index a3dd65ef336..2df8a55ed0b 100644 --- a/src/v0/util/recordUtils.js +++ b/src/v0/util/recordUtils.js @@ -1,5 +1,5 @@ -const { InstrumentationError, getErrorRespEvents } = require('@rudderstack/integrations-lib'); -const { generateErrorObject } = require('./index'); +const { InstrumentationError } = require('@rudderstack/integrations-lib'); +const { generateErrorObject, getErrorRespEvents } = require('./index'); const eventTypes = ['update', 'insert', 'delete']; From cd1dd8e71f37ac4a03e89c6eb5ff810f3466fd56 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Mon, 24 Feb 2025 20:34:45 +0530 Subject: [PATCH 111/160] chore: allow identify calls for either both ids or customer object (#4101) --- .../serverSideTransform.js | 17 +++- .../serverSideUtils.test.js | 87 +++++++++++++++++-- .../webhookTestScenarios/GenericTrackTests.ts | 19 ++++ 3 files changed, 110 insertions(+), 13 deletions(-) diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 08a64bba0f9..7626135a4fd 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -86,8 +86,12 @@ const createIdentifyEvent = (message) => { const { userId, anonymousId, traits } = message; const identifyEvent = new Message(INTEGERATION); identifyEvent.setEventType(EventType.IDENTIFY); - identifyEvent.userId = userId; - identifyEvent.anonymousId = anonymousId; + if (userId) { + identifyEvent.userId = userId; + } + if (anonymousId) { + identifyEvent.anonymousId = anonymousId; + } const mappedTraits = {}; identifyMappingJSON.forEach((mapping) => { if (mapping.destKeys.startsWith('traits.')) { @@ -106,6 +110,7 @@ const createIdentifyEvent = (message) => { const processEvent = async (inputEvent, metricMetadata) => { let message; const event = lodash.cloneDeep(inputEvent); + const { customer } = event; const shopifyTopic = getShopifyTopic(event); delete event.query_parameters; switch (shopifyTopic) { @@ -154,9 +159,13 @@ const processEvent = async (inputEvent, metricMetadata) => { } message = removeUndefinedAndNullValues(message); - // if the message payload contains both anonymousId and userId, hence the user is identified + // if the message payload contains both anonymousId and userId or contains customer object, hence the user is identified // then create an identify event by multiplexing the original event and return both the message and identify event - if (message.anonymousId && message.userId) { + if ( + (message.userId && message.anonymousId) || + (message.userId && customer) || + (message.anonymousId && customer) + ) { const identifyEvent = createIdentifyEvent(message); return [message, identifyEvent]; } diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index 197d10aad34..219b9adbc37 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -183,25 +183,94 @@ describe('Redis cart token tests', () => { .spyOn(RedisDB, 'getVal') .mockResolvedValue({ anonymousId: 'anonymousIdTest1' }); const event = { - cart_token: `cartTokenTest1`, - customer: { - id: 'customer-id-001', - }, - id: 5778367414385, + id: 35550298931313, + token: '84ad78572dae52a8cbea7d55371afe89', + cart_token: 'Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ', + email: null, + gateway: null, + buyer_accepts_marketing: false, + buyer_accepts_sms_marketing: false, + sms_marketing_phone: null, + created_at: '2024-11-06T02:22:00+00:00', + updated_at: '2024-11-05T21:22:02-05:00', + landing_site: '/', + note: '', + note_attributes: [], + referring_site: '', + shipping_lines: [], + shipping_address: [], + taxes_included: false, + total_weight: 0, + currency: 'USD', + completed_at: null, + phone: null, + customer_locale: 'en-US', line_items: [ { - id: 14234727743601, + key: '41327142600817', + fulfillment_service: 'manual', + gift_card: false, + grams: 0, + presentment_title: 'The Collection Snowboard: Hydrogen', + presentment_variant_title: '', + product_id: 7234590408817, + quantity: 1, + requires_shipping: true, + sku: '', + tax_lines: [], + taxable: true, + title: 'The Collection Snowboard: Hydrogen', + variant_id: 41327142600817, + variant_title: '', + variant_price: '600.00', + vendor: 'Hydrogen Vendor', + unit_price_measurement: { + measured_type: null, + quantity_value: null, + quantity_unit: null, + reference_value: null, + reference_unit: null, + }, + compare_at_price: null, + line_price: '600.00', + price: '600.00', + applied_discounts: [], + destination_location_id: null, + user_id: null, + rank: null, + origin_location_id: null, + properties: {}, }, ], + name: '#35550298931313', + abandoned_checkout_url: + 'https://pixel-testing-rs.myshopify.com/59026964593/checkouts/ac/Z2NwLXVzLWVhc3QxOjAxSkJaTUVRSjgzNUJUN1BTNjEzRFdRUFFQ/recover?key=0385163be3875d3a2117e982d9cc3517&locale=en-US', + discount_codes: [], + tax_lines: [], + presentment_currency: 'USD', + source_name: 'web', + total_line_items_price: '600.00', + total_tax: '0.00', + total_discounts: '0.00', + subtotal_price: '600.00', + total_price: '600.00', + total_duties: '0.00', + device_id: null, + user_id: null, + location_id: null, + source_identifier: null, + source_url: null, + source: null, + closed_at: null, query_parameters: { - topic: ['orders_updated'], + topic: ['checkouts_create'], version: ['pixel'], - writeKey: ['dummy-write-key'], + writeKey: ['2mw9SN679HngnXXXHT4oSVVBVmb'], }, }; const message = await processEvent(event); expect(getValSpy).toHaveBeenCalledTimes(2); - expect(getValSpy).toHaveBeenCalledWith('pixel:cartTokenTest1'); + expect(getValSpy).toHaveBeenCalledWith('pixel:anonymousIdTest1'); expect(message.anonymousId).toEqual('anonymousIdTest1'); }); diff --git a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts index e4080d9ac8c..2214b730b7e 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts @@ -560,6 +560,25 @@ export const genericTrackTestScenarios = [ }, anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', }, + { + anonymousId: '50ead33e-d763-4854-b0ab-765859ef05cb', + context: { + integration: { + name: 'SHOPIFY', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + email: 'henry@wfls.com', + }, + }, + integrations: { + SHOPIFY: false, + }, + type: 'identify', + }, ], }, }, From f67fb735c06dffee1410669412338eb6ad1e42c8 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 24 Feb 2025 21:42:11 +0530 Subject: [PATCH 112/160] chore: update linkedin ads api version to 202409 from 202502 --- src/cdk/v2/destinations/linkedin_ads/config.js | 2 +- .../destinations/linkedin_ads/dataDelivery/business.ts | 2 +- .../destinations/linkedin_ads/dataDelivery/oauth.ts | 2 +- test/integrations/destinations/linkedin_ads/network.ts | 2 +- .../linkedin_ads/processor/configLevelFeaturesTestData.ts | 2 +- .../destinations/linkedin_ads/processor/trackTestData.ts | 2 +- .../destinations/linkedin_ads/processor/validationTestData.ts | 2 +- test/integrations/destinations/linkedin_ads/router/data.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cdk/v2/destinations/linkedin_ads/config.js b/src/cdk/v2/destinations/linkedin_ads/config.js index 5fe93c46f8c..4207e8aa8a2 100644 --- a/src/cdk/v2/destinations/linkedin_ads/config.js +++ b/src/cdk/v2/destinations/linkedin_ads/config.js @@ -3,7 +3,7 @@ const { getMappingConfig } = require('../../../../v0/util'); // ref : https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/conversions-api?view=li-lms-2024-02&tabs=http#adding-multiple-conversion-events-in-a-batch const BATCH_ENDPOINT = 'https://api.linkedin.com/rest/conversionEvents'; const API_HEADER_METHOD = 'BATCH_CREATE'; -const API_VERSION = '202502'; // yyyymm format +const API_VERSION = '202409'; // yyyymm format const API_PROTOCOL_VERSION = '2.0.0'; const CONFIG_CATEGORIES = { diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts index 8614eb322ec..64a95e9d8ba 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts @@ -82,7 +82,7 @@ export const metadata = { export const headerBlockWithCorrectAccessToken = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202502', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts index be8d32fbb4e..2e69a6dbd6f 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts @@ -49,7 +49,7 @@ export const metadata = { export const headerBlockWithCorrectAccessToken = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202502', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/network.ts b/test/integrations/destinations/linkedin_ads/network.ts index 65bf69e54f4..cff43996af7 100644 --- a/test/integrations/destinations/linkedin_ads/network.ts +++ b/test/integrations/destinations/linkedin_ads/network.ts @@ -1,7 +1,7 @@ export const headerBlockWithCorrectAccessToken = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202502', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts index be46d95beeb..4ecece27524 100644 --- a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts @@ -57,7 +57,7 @@ const commonTimestamp = new Date('2023-10-14'); const commonHeader = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202502', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts index 06028aaaf9a..adc7a551a24 100644 --- a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts @@ -115,7 +115,7 @@ const commonStatTags = { const commonHeader = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202502', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts index 12a00309b5f..ba8e3b54def 100644 --- a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts @@ -78,7 +78,7 @@ const commonStats = { const commonHeader = { Authorization: 'Bearer default-accessToken', 'Content-Type': 'application/json', - 'LinkedIn-Version': '202502', + 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', }; diff --git a/test/integrations/destinations/linkedin_ads/router/data.ts b/test/integrations/destinations/linkedin_ads/router/data.ts index 6614536d163..a38294a61ce 100644 --- a/test/integrations/destinations/linkedin_ads/router/data.ts +++ b/test/integrations/destinations/linkedin_ads/router/data.ts @@ -419,7 +419,7 @@ export const data = [ 'Content-Type': 'application/json', 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', - 'LinkedIn-Version': '202502', + 'LinkedIn-Version': '202409', Authorization: 'Bearer dummyToken', }, params: {}, From fe23621526ad26803b1c1e2c60d65f2cf116bbb6 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 25 Feb 2025 08:27:04 +0000 Subject: [PATCH 113/160] chore(release): 1.91.3 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32df60d9a99..db3d1889969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ 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.91.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.2...v1.91.3) (2025-02-25) + ### [1.91.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.1...v1.91.2) (2025-02-24) ### [1.91.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.0...v1.91.1) (2025-02-19) diff --git a/package-lock.json b/package-lock.json index b10e043b3a8..d2370dc0373 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.91.2", + "version": "1.91.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.91.2", + "version": "1.91.3", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 534378e607a..acb4fd47274 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.91.2", + "version": "1.91.3", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 2d129a79ce8e8599e4bd5d5718afb25100a689ff Mon Sep 17 00:00:00 2001 From: Alexandros Milaios Date: Tue, 25 Feb 2025 12:43:10 +0200 Subject: [PATCH 114/160] feat: zoho vdmv2 (#4096) * feat: zoho vdmv2 * chore: fix search id function * chore: extra utils unit tests for zoho * chore: small refactor and extra tests * chore: small refactor and extra tests * chore: update mutliselct config schema * chore: extra tests * chore: search with expired access token --- src/cdk/v2/destinations/zoho/rtWorkflow.yaml | 4 +- .../v2/destinations/zoho/transformRecord.js | 16 +- .../v2/destinations/zoho/transformRecordV2.js | 367 +++++++ .../zoho/transformRecordsV2.test.js | 97 ++ src/cdk/v2/destinations/zoho/utils.js | 110 +++ src/cdk/v2/destinations/zoho/utils.test.js | 281 ++++++ test/integrations/destinations/zoho/common.ts | 221 ++++- .../integrations/destinations/zoho/network.ts | 19 + .../destinations/zoho/router/deletion.ts | 330 ++++++- .../destinations/zoho/router/upsert.ts | 916 +++++++++++++++++- 10 files changed, 2326 insertions(+), 35 deletions(-) create mode 100644 src/cdk/v2/destinations/zoho/transformRecordV2.js create mode 100644 src/cdk/v2/destinations/zoho/transformRecordsV2.test.js diff --git a/src/cdk/v2/destinations/zoho/rtWorkflow.yaml b/src/cdk/v2/destinations/zoho/rtWorkflow.yaml index b50b9502e32..fc4aaafd414 100644 --- a/src/cdk/v2/destinations/zoho/rtWorkflow.yaml +++ b/src/cdk/v2/destinations/zoho/rtWorkflow.yaml @@ -1,7 +1,7 @@ bindings: - name: EventType path: ../../../../constants - - name: processRecordInputs + - name: processRecordInputsWrap path: ./transformRecord - name: handleRtTfSingleEventError path: ../../../../v0/util/index @@ -20,7 +20,7 @@ steps: - name: processRecordEvents template: | - await $.processRecordInputs(^.{.message.type === $.EventType.RECORD}[], ^[0].destination) + await $.processRecordInputsWrap(^.{.message.type === $.EventType.RECORD}[], ^[0].destination) - name: failOtherEvents template: | diff --git a/src/cdk/v2/destinations/zoho/transformRecord.js b/src/cdk/v2/destinations/zoho/transformRecord.js index 20f97cf7ab6..c497d2e3063 100644 --- a/src/cdk/v2/destinations/zoho/transformRecord.js +++ b/src/cdk/v2/destinations/zoho/transformRecord.js @@ -13,6 +13,7 @@ const { handleRtTfSingleEventError, isEmptyObject, defaultDeleteRequestConfig, + isEventSentByVDMV2Flow, } = require('../../../../v0/util'); const zohoConfig = require('./config'); const { @@ -24,6 +25,8 @@ const { calculateTrigger, validateConfigurationIssue, } = require('./utils'); + +const { processRecordInputsV2 } = require('./transformRecordV2'); const { REFRESH_TOKEN } = require('../../../../adapters/networkhandler/authConstants'); // Main response builder function @@ -330,4 +333,15 @@ const processRecordInputs = async (inputs, destination) => { return [...response, ...errorResponseList]; }; -module.exports = { processRecordInputs }; +const processRecordInputsWrap = async (inputs, destination) => { + if (!inputs || inputs.length === 0) { + return []; + } + const event = inputs[0]; + if (isEventSentByVDMV2Flow(event)) { + return processRecordInputsV2(inputs, destination); + } + return processRecordInputs(inputs, destination); +}; + +module.exports = { processRecordInputsWrap }; diff --git a/src/cdk/v2/destinations/zoho/transformRecordV2.js b/src/cdk/v2/destinations/zoho/transformRecordV2.js new file mode 100644 index 00000000000..538de09d658 --- /dev/null +++ b/src/cdk/v2/destinations/zoho/transformRecordV2.js @@ -0,0 +1,367 @@ +const { + InstrumentationError, + ConfigurationError, + RetryableError, +} = require('@rudderstack/integrations-lib'); +const { BatchUtils } = require('@rudderstack/workflow-engine'); +const { + defaultPostRequestConfig, + defaultRequestConfig, + getSuccessRespEvents, + removeUndefinedAndNullValues, + handleRtTfSingleEventError, + isEmptyObject, + defaultDeleteRequestConfig, + getHashFromArray, +} = require('../../../../v0/util'); +const zohoConfig = require('./config'); +const { + deduceModuleInfoV2, + validatePresenceOfMandatoryProperties, + formatMultiSelectFieldsV2, + handleDuplicateCheckV2, + searchRecordIdV2, + calculateTrigger, +} = require('./utils'); +const { REFRESH_TOKEN } = require('../../../../adapters/networkhandler/authConstants'); + +// Main response builder function +const responseBuilder = ( + items, + destConfig, + identifierType, + operationModuleType, + commonEndPoint, + isUpsert, + metadata, +) => { + const { trigger, addDefaultDuplicateCheck, multiSelectFieldLevelDecision } = destConfig; + + const response = defaultRequestConfig(); + response.headers = { + Authorization: `Zoho-oauthtoken ${metadata[0].secret.accessToken}`, + }; + + const multiSelectFieldLevelDecisionAcc = getHashFromArray( + multiSelectFieldLevelDecision, + 'from', + 'to', + false, + ); + + if (isUpsert) { + const payload = { + duplicate_check_fields: handleDuplicateCheckV2( + addDefaultDuplicateCheck, + identifierType, + operationModuleType, + ), + data: items, + $append_values: multiSelectFieldLevelDecisionAcc || {}, + trigger: calculateTrigger(trigger), + }; + response.method = defaultPostRequestConfig.requestMethod; + response.body.JSON = removeUndefinedAndNullValues(payload); + response.endpoint = `${commonEndPoint}/upsert`; + } else { + response.endpoint = `${commonEndPoint}?ids=${items.join(',')}&wf_trigger=${trigger !== 'None'}`; + response.method = defaultDeleteRequestConfig.requestMethod; + } + + return response; +}; +const batchResponseBuilder = ( + transformedResponseToBeBatched, + config, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, +) => { + const upsertResponseArray = []; + const deletionResponseArray = []; + const { upsertData, deletionData, upsertSuccessMetadata, deletionSuccessMetadata } = + transformedResponseToBeBatched; + + const upsertDataChunks = BatchUtils.chunkArrayBySizeAndLength(upsertData, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + const deletionDataChunks = BatchUtils.chunkArrayBySizeAndLength(deletionData, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + const upsertmetadataChunks = BatchUtils.chunkArrayBySizeAndLength(upsertSuccessMetadata, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + const deletionmetadataChunks = BatchUtils.chunkArrayBySizeAndLength(deletionSuccessMetadata, { + maxItems: zohoConfig.MAX_BATCH_SIZE, + }); + + upsertDataChunks.items.forEach((chunk) => { + upsertResponseArray.push( + responseBuilder( + chunk, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, + true, + upsertmetadataChunks.items[0], + ), + ); + }); + + deletionDataChunks.items.forEach((chunk) => { + deletionResponseArray.push( + responseBuilder( + chunk, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, + false, + deletionmetadataChunks.items[0], + ), + ); + }); + + return { + upsertResponseArray, + upsertmetadataChunks, + deletionResponseArray, + deletionmetadataChunks, + }; +}; + +/** + * Handles the upsert operation for a specific module type by validating mandatory properties, + * processing the input fields, and updating the response accordingly. + * + * @param {Object} input - The input data for the upsert operation. + * @param {Object} allFields - The fields to be upserted. + * @param {string} operationModuleType - The type of module operation being performed. + * @param {Object} conConfig - The connection configuration object + * @param {Object} transformedResponseToBeBatched - The response object to be batched. + * @param {Array} errorResponseList - The list to store error responses. + * @returns {Promise} - A promise that resolves once the upsert operation is handled. + */ +const handleUpsert = async ( + input, + allFields, + operationModuleType, + destConfig, + transformedResponseToBeBatched, + errorResponseList, +) => { + const eventErroneous = validatePresenceOfMandatoryProperties(operationModuleType, allFields); + + if (eventErroneous?.status) { + const error = new ConfigurationError( + `${operationModuleType} object must have the ${eventErroneous.missingField.join('", "')} property(ies).`, + ); + errorResponseList.push(handleRtTfSingleEventError(input, error, {})); + } else { + const formattedFields = formatMultiSelectFieldsV2(destConfig, allFields); + transformedResponseToBeBatched.upsertSuccessMetadata.push(input.metadata); + transformedResponseToBeBatched.upsertData.push(formattedFields); + } +}; + +/** + * Handles search errors in Zoho record search. + * If the search response message code is 'INVALID_TOKEN', returns a RetryableError with a specific message and status code. + * Otherwise, returns a ConfigurationError with a message indicating failure to fetch Zoho ID for a record. + * + * @param {Object} searchResponse - The response object from the search operation. + * @returns {RetryableError|ConfigurationError} - The error object based on the search response. + */ +const handleSearchError = (searchResponse) => { + if (searchResponse.message.code === 'INVALID_TOKEN') { + return new RetryableError( + `[Zoho]:: ${JSON.stringify(searchResponse.message)} during zoho record search`, + 500, + searchResponse.message, + REFRESH_TOKEN, + ); + } + return new ConfigurationError( + `failed to fetch zoho id for record for ${JSON.stringify(searchResponse.message)}`, + ); +}; + +/** + * Asynchronously handles the deletion operation based on the search response. + * + * @param {Object} input - The input object containing metadata and other details. + * @param {Array} fields - The fields to be used for searching the record. + * @param {Object} Config - The configuration object. + * @param {Object} transformedResponseToBeBatched - The object to store transformed response data to be batched. + * @param {Array} errorResponseList - The list to store error responses. + */ +const handleDeletion = async ( + input, + fields, + Config, + destConfig, + transformedResponseToBeBatched, + errorResponseList, +) => { + const searchResponse = await searchRecordIdV2(fields, input.metadata, Config, destConfig); + + if (searchResponse.erroneous) { + const error = handleSearchError(searchResponse); + errorResponseList.push(handleRtTfSingleEventError(input, error, {})); + } else { + transformedResponseToBeBatched.deletionData.push(...searchResponse.message); + transformedResponseToBeBatched.deletionSuccessMetadata.push(input.metadata); + } +}; + +/** + * Process the input message based on the specified action. + * If the 'fields' in the input message are empty, an error is generated. + * Determines whether to handle an upsert operation or a deletion operation based on the action. + * + * @param {Object} input - The input message containing the fields. + * @param {string} action - The action to be performed ('insert', 'update', or other). + * @param {string} operationModuleType - The type of operation module. + * @param {Object} Config - The configuration object. + * @param {Object} transformedResponseToBeBatched - The object to store transformed responses. + * @param {Array} errorResponseList - The list to store error responses. + * @param {Object} conConfig - The connection configuration object. + */ +const processInput = async ( + input, + operationModuleType, + Config, + transformedResponseToBeBatched, + errorResponseList, + destConfig, +) => { + const { fields, action, identifiers } = input.message; + const allFields = { ...identifiers, ...fields }; + + if (isEmptyObject(allFields)) { + const emptyFieldsError = new InstrumentationError('`fields` cannot be empty'); + errorResponseList.push(handleRtTfSingleEventError(input, emptyFieldsError, {})); + return; + } + + if (action === 'insert' || action === 'update') { + await handleUpsert( + input, + allFields, + operationModuleType, + destConfig, + transformedResponseToBeBatched, + errorResponseList, + ); + } else { + await handleDeletion( + input, + allFields, + Config, + destConfig, + transformedResponseToBeBatched, + errorResponseList, + ); + } +}; + +/** + * Appends success responses to the main response array. + * + * @param {Array} response - The main response array to which success responses will be appended. + * @param {Array} responseArray - An array of batched responses. + * @param {Array} metadataChunks - An array containing metadata chunks. + * @param {string} destination - The destination for the success responses. + */ +const appendSuccessResponses = (response, responseArray, metadataChunks, destination) => { + responseArray.forEach((batchedResponse, index) => { + response.push( + getSuccessRespEvents(batchedResponse, metadataChunks.items[index], destination, true), + ); + }); +}; + +/** + * Process multiple record inputs for a destination. + * + * @param {Array} inputs - The array of record inputs to be processed. + * @param {Object} destination - The destination object containing configuration. + * @returns {Array} - An array of responses after processing the record inputs. + */ +const processRecordInputsV2 = async (inputs, destination) => { + if (!inputs || inputs.length === 0) { + return []; + } + if (!destination) { + return []; + } + + const response = []; + const errorResponseList = []; + const { Config } = destination; + const { destination: destConfig } = inputs[0].connection?.config || {}; + if (!destConfig) { + throw new ConfigurationError('Connection destination config is required'); + } + const { object, identifierMappings } = destConfig; + if (!object || !identifierMappings) { + throw new ConfigurationError( + 'Object and identifierMappings are required in destination config', + ); + } + + const transformedResponseToBeBatched = { + upsertData: [], + upsertSuccessMetadata: [], + deletionSuccessMetadata: [], + deletionData: [], + }; + + const { operationModuleType, identifierType, upsertEndPoint } = deduceModuleInfoV2( + Config, + destConfig, + ); + + await Promise.all( + inputs.map((input) => + processInput( + input, + operationModuleType, + Config, + transformedResponseToBeBatched, + errorResponseList, + destConfig, + ), + ), + ); + + const { + upsertResponseArray, + upsertmetadataChunks, + deletionResponseArray, + deletionmetadataChunks, + } = batchResponseBuilder( + transformedResponseToBeBatched, + Config, + destConfig, + identifierType, + operationModuleType, + upsertEndPoint, + ); + + if (upsertResponseArray.length === 0 && deletionResponseArray.length === 0) { + return errorResponseList; + } + + appendSuccessResponses(response, upsertResponseArray, upsertmetadataChunks, destination); + appendSuccessResponses(response, deletionResponseArray, deletionmetadataChunks, destination); + + return [...response, ...errorResponseList]; +}; + +module.exports = { processRecordInputsV2 }; diff --git a/src/cdk/v2/destinations/zoho/transformRecordsV2.test.js b/src/cdk/v2/destinations/zoho/transformRecordsV2.test.js new file mode 100644 index 00000000000..f878755f001 --- /dev/null +++ b/src/cdk/v2/destinations/zoho/transformRecordsV2.test.js @@ -0,0 +1,97 @@ +const { processRecordInputsV2 } = require('./transformRecordV2'); + +describe('processRecordInputsV2', () => { + it('should return an empty array if no inputs are provided', async () => { + const result = await processRecordInputsV2([]); + expect(result).toEqual([]); + }); + + it('should return an empty array if no destination is provided', async () => { + const result = await processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + }, + ], + null, + ); + expect(result).toEqual([]); + }); + + it('should return an empty array if no destination config is provided', async () => { + const result = await processRecordInputsV2([], { + destination: { + config: {}, + }, + }); + expect(result).toEqual([]); + }); + + it('should return an empty array if no connection is provided', async () => { + await expect( + processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + }, + ], + { + destination: { + Config: { + Region: 'US', + }, + }, + }, + ), + ).rejects.toThrow('Connection destination config is required'); + }); + + it('should return an empty array if no connection destination config is provided', async () => { + await expect( + processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + connection: {}, + }, + ], + { + destination: { + Config: { + Region: 'US', + }, + }, + }, + ), + ).rejects.toThrow('Connection destination config is required'); + }); + + it('should return an empty array if no object and identifierMappings are provided in destination config', async () => { + await expect( + processRecordInputsV2( + [ + { + id: '1', + metadata: {}, + type: 'record', + destination: { + config: { region: 'US' }, + }, + connection: { + config: { + destination: {}, + }, + }, + }, + ], + { destination: { config: { region: 'US' } } }, + ), + ).rejects.toThrow('Object and identifierMappings are required in destination config'); + }); +}); diff --git a/src/cdk/v2/destinations/zoho/utils.js b/src/cdk/v2/destinations/zoho/utils.js index d86ea05e334..8955bf33ad0 100644 --- a/src/cdk/v2/destinations/zoho/utils.js +++ b/src/cdk/v2/destinations/zoho/utils.js @@ -31,6 +31,16 @@ const deduceModuleInfo = (inputs, Config) => { }; }; +const deduceModuleInfoV2 = (Config, destConfig) => { + const { object, identifierMappings } = destConfig; + const identifierType = identifierMappings.map(({ to }) => to); + return { + operationModuleType: object, + upsertEndPoint: zohoConfig.COMMON_RECORD_ENDPOINT(Config.region).replace('moduleType', object), + identifierType, + }; +}; + // Keeping the original function name and return structure function validatePresenceOfMandatoryProperties(objectName, object) { if (!zohoConfig.MODULE_MANDATORY_FIELD_CONFIG.hasOwnProperty(objectName)) { @@ -71,6 +81,26 @@ const formatMultiSelectFields = (config, fields) => { return formattedFields; }; +const formatMultiSelectFieldsV2 = (destConfig, fields) => { + const multiSelectFields = getHashFromArray( + destConfig.multiSelectFieldLevelDecision, + 'from', + 'to', + false, + ); + // Creating a shallow copy to avoid mutations + const formattedFields = { ...fields }; + Object.keys(formattedFields).forEach((eachFieldKey) => { + if ( + multiSelectFields.hasOwnProperty(eachFieldKey) && + isDefinedAndNotNull(formattedFields[eachFieldKey]) + ) { + formattedFields[eachFieldKey] = [formattedFields[eachFieldKey]]; + } + }); + return formattedFields; +}; + const handleDuplicateCheck = (addDefaultDuplicateCheck, identifierType, operationModuleType) => { let additionalFields = []; @@ -85,6 +115,20 @@ const handleDuplicateCheck = (addDefaultDuplicateCheck, identifierType, operatio return Array.from(new Set([identifierType, ...additionalFields])); }; +const handleDuplicateCheckV2 = (addDefaultDuplicateCheck, identifierType, operationModuleType) => { + let additionalFields = []; + + if (addDefaultDuplicateCheck) { + const moduleDuplicateCheckField = + zohoConfig.MODULE_WISE_DUPLICATE_CHECK_FIELD[operationModuleType]; + additionalFields = isDefinedAndNotNull(moduleDuplicateCheckField) + ? moduleDuplicateCheckField + : ['Name']; + } + + return Array.from(new Set([...identifierType, ...additionalFields])); +}; + function escapeAndEncode(value) { return encodeURIComponent(value.replace(/([(),\\])/g, '\\$1')); } @@ -100,6 +144,17 @@ function transformToURLParams(fields, Config) { return `${regionBasedEndPoint}/crm/v6/Leads/search?criteria=${criteria}`; } +function transformToURLParamsV2(fields, Config, object) { + const criteria = Object.entries(fields) + .map(([key, value]) => `(${key}:equals:${escapeAndEncode(value)})`) + .join('and'); + + const dataCenter = Config.region; + const regionBasedEndPoint = zohoConfig.DATA_CENTRE_BASE_ENDPOINTS_MAP[dataCenter]; + + return `${regionBasedEndPoint}/crm/v6/${object}/search?criteria=${criteria}`; +} + const searchRecordId = async (fields, metadata, Config) => { try { const searchURL = transformToURLParams(fields, Config); @@ -149,6 +204,56 @@ const searchRecordId = async (fields, metadata, Config) => { } }; +const searchRecordIdV2 = async (fields, metadata, Config, destConfig) => { + try { + const { object } = destConfig; + const searchURL = transformToURLParamsV2(fields, Config, object); + const searchResult = await handleHttpRequest( + 'get', + searchURL, + { + headers: { + Authorization: `Zoho-oauthtoken ${metadata.secret.accessToken}`, + }, + }, + { + destType: 'zoho', + feature: 'deleteRecords', + requestMethod: 'GET', + endpointPath: `crm/v6/${object}/search?criteria=`, + module: 'router', + }, + ); + + if (!isHttpStatusSuccess(searchResult.processedResponse.status)) { + return { + erroneous: true, + message: searchResult.processedResponse.response, + }; + } + + if ( + searchResult.processedResponse.status === 204 || + !CommonUtils.isNonEmptyArray(searchResult.processedResponse.response?.data) + ) { + return { + erroneous: true, + message: 'No contact is found with record details', + }; + } + + return { + erroneous: false, + message: searchResult.processedResponse.response.data.map((record) => record.id), + }; + } catch (error) { + return { + erroneous: true, + message: error.message, + }; + } +}; + // ref : https://www.zoho.com/crm/developer/docs/api/v6/upsert-records.html#:~:text=The%20trigger%20input%20can%20be%20workflow%2C%20approval%2C%20or%20blueprint.%20If%20the%20trigger%20is%20not%20mentioned%2C%20the%20workflows%2C%20approvals%20and%20blueprints%20related%20to%20the%20API%20will%20get%20executed.%20Enter%20the%20trigger%20value%20as%20%5B%5D%20to%20not%20execute%20the%20workflows. const calculateTrigger = (trigger) => { if (trigger === 'Default') { @@ -177,11 +282,16 @@ const validateConfigurationIssue = (Config, operationModuleType) => { module.exports = { deduceModuleInfo, + deduceModuleInfoV2, validatePresenceOfMandatoryProperties, formatMultiSelectFields, + formatMultiSelectFieldsV2, handleDuplicateCheck, + handleDuplicateCheckV2, searchRecordId, + searchRecordIdV2, transformToURLParams, + transformToURLParamsV2, calculateTrigger, validateConfigurationIssue, }; diff --git a/src/cdk/v2/destinations/zoho/utils.test.js b/src/cdk/v2/destinations/zoho/utils.test.js index e959f6b6c3b..b2e165b77fe 100644 --- a/src/cdk/v2/destinations/zoho/utils.test.js +++ b/src/cdk/v2/destinations/zoho/utils.test.js @@ -4,12 +4,16 @@ const { handleHttpRequest } = require('../../../../adapters/network'); const { handleDuplicateCheck, deduceModuleInfo, + deduceModuleInfoV2, validatePresenceOfMandatoryProperties, validateConfigurationIssue, formatMultiSelectFields, + formatMultiSelectFieldsV2, transformToURLParams, + transformToURLParamsV2, calculateTrigger, searchRecordId, + searchRecordIdV2, } = require('./utils'); describe('handleDuplicateCheck', () => { @@ -108,6 +112,48 @@ describe('formatMultiSelectFields', () => { }); }); +describe('formatMultiSelectFieldsV2', () => { + const testCases = [ + { + name: 'should convert a field value to an array if a mapping exists in multiSelectFieldLevelDecision', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'true' }], + }, + fields: { tags: 'value' }, + }, + expected: { tags: ['value'] }, + }, + { + name: 'should leave fields unchanged if mapping fields exists but null', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'tags', to: 'true' }], + }, + fields: { tags: null, other: 'val' }, + }, + expected: { tags: null, other: 'val' }, + }, + { + name: 'should leave fields unchanged if no mapping exists', + input: { + config: { + multiSelectFieldLevelDecision: [{ from: 'categories', to: 'true' }], + }, + fields: { tags: 'value', other: 'val' }, + }, + expected: { tags: 'value', other: 'val' }, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = formatMultiSelectFieldsV2(input.config, { ...input.fields }); + expect(result).toEqual(expected); + }); + }); +}); + describe('transformToURLParams', () => { const testCases = [ { @@ -128,6 +174,27 @@ describe('transformToURLParams', () => { }); }); +describe('transformToURLParamsV2', () => { + const testCases = [ + { + name: 'should build a proper URL with encoded criteria based on fields and config', + input: { + fields: { First_Name: 'John, Doe', Age: '30' }, + config: { region: 'US' }, + object: 'Leads', + }, + expected: `https://www.zohoapis.com/crm/v6/Leads/search?criteria=(First_Name:equals:John%5C%2C%20Doe)and(Age:equals:30)`, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const url = transformToURLParamsV2(input.fields, input.config, input.object); + expect(url).toEqual(expected); + }); + }); +}); + describe('calculateTrigger', () => { const testCases = [ { @@ -295,6 +362,148 @@ describe('searchRecordId', () => { }); }); +describe('searchRecordIdV2', () => { + const mockFields = { Email: 'test@example.com' }; + const mockMetadata = { secret: { accessToken: 'mock-token' } }; + const mockConfig = { region: 'us' }; + const mockConConfig = { + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + const testCases = [ + { + name: 'should handle non-array response data', + response: { + processedResponse: { + status: 200, + response: { + data: 'not-an-array', + }, + }, + }, + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle missing response data property', + response: { + processedResponse: { + status: 200, + response: {}, + }, + }, + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle null response data', + response: { + processedResponse: { + status: 200, + response: { + data: null, + }, + }, + }, + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle empty array response data', + response: { + processedResponse: { + status: 200, + response: { + data: [], + }, + }, + }, + expected: { + erroneous: true, + message: 'No contact is found with record details', + }, + }, + { + name: 'should handle valid array response data with single record', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], + }, + }, + }, + expected: { + erroneous: false, + message: ['123'], + }, + }, + { + name: 'should handle valid array response data with multiple records', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }, { id: '456' }], + }, + }, + }, + expected: { + erroneous: false, + message: ['123', '456'], + }, + }, + { + name: 'should handle non-success HTTP status code', + response: { + processedResponse: { + status: 400, + response: 'Bad Request Error', + }, + }, + expected: { + erroneous: true, + message: 'Bad Request Error', + }, + }, + { + name: 'should handle HTTP request error', + error: new Error('Network Error'), + expected: { + erroneous: true, + message: 'Network Error', + }, + }, + ]; + + testCases.forEach(({ name, response, error, expected }) => { + it(name, async () => { + if (error) { + handleHttpRequest.mockRejectedValueOnce(error); + } else { + handleHttpRequest.mockResolvedValueOnce(response); + } + + const result = await searchRecordIdV2(mockFields, mockMetadata, mockConfig, mockConConfig); + + expect(result).toEqual(expected); + }); + }); +}); + describe('deduceModuleInfo', () => { const testCases = [ { @@ -431,6 +640,78 @@ describe('deduceModuleInfo', () => { }); }); +describe('deduceModuleInfoV2', () => { + const testCases = [ + { + name: 'should return operationModuleInfo, upsertEndPoint and identifierType when conConfig is present', + input: { + config: { region: 'US' }, + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + { + name: 'should handle different regions in config', + input: { + config: { region: 'EU' }, + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.eu/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + { + name: 'should use default US region when config.region is null', + input: { + config: { region: null }, + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + { + name: 'should use default US region when config.region is undefined', + input: { + config: {}, // region is undefined + destination: { + object: 'Leads', + identifierMappings: [{ to: 'Email', from: 'Email' }], + }, + }, + expected: { + operationModuleType: 'Leads', + upsertEndPoint: 'https://www.zohoapis.com/crm/v6/Leads', + identifierType: ['Email'], + }, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + it(name, () => { + const result = deduceModuleInfoV2(input.config, input.destination); + expect(result).toEqual(expected); + }); + }); +}); + describe('validatePresenceOfMandatoryProperties', () => { const testCases = [ { diff --git a/test/integrations/destinations/zoho/common.ts b/test/integrations/destinations/zoho/common.ts index 1d89dbce6d7..62f6c4eead3 100644 --- a/test/integrations/destinations/zoho/common.ts +++ b/test/integrations/destinations/zoho/common.ts @@ -1,4 +1,4 @@ -import { Destination } from '../../../../src/types'; +import { Destination, Connection } from '../../../../src/types'; const destType = 'zoho'; const destTypeInUpperCase = 'ZOHO'; @@ -34,6 +34,28 @@ const deletionPayload1 = { type: 'record', }; +const deletionPayload1V2 = { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + identifiers: { + Email: 'tobedeleted@gmail.com', + }, + type: 'record', +}; + const commonDeletionDestConfig: Destination = { ID: '345', Name: 'Test', @@ -68,6 +90,31 @@ const commonDeletionDestConfig: Destination = { }, }; +const commonDeletionConnectionConfigV2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'None', + schemaVersion: '1.1', + identifierMappings: [ + { + from: 'email', + to: 'Email', + }, + ], + addDefaultDuplicateCheck: true, + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + const upsertPayload1 = { action: 'insert', context: { @@ -95,6 +142,28 @@ const upsertPayload1 = { type: 'record', }; +const upsertPayload1V2 = { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + type: 'record', +}; + const upsertPayload2 = { action: 'insert', context: { @@ -123,6 +192,29 @@ const upsertPayload2 = { type: 'record', }; +const upsertPayload2V2 = { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': 'Bengali', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + type: 'record', +}; + const upsertPayload3 = { action: 'insert', context: { @@ -150,6 +242,28 @@ const upsertPayload3 = { type: 'record', }; +const upsertPayload3V2 = { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + type: 'record', +}; + const commonUpsertDestConfig: Destination = { ID: '345', Name: 'Test', @@ -289,6 +403,102 @@ const commonOutput1 = { trigger: ['workflow'], }; +const commonConnectionConfigV2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'workflow', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + +const commonConnectionConfigV2_2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'None', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + +const commonConnectionConfigCustomModuleV2: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'CUSTOM', + trigger: 'None', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'Email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + +const commonConnectionConfigV2_3: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Leads', + trigger: 'workflow', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'Email', + }, + ], + }, + }, +}; + export { destType, destTypeInUpperCase, @@ -297,13 +507,22 @@ export { segmentName, leadUpsertEndpoint, deletionPayload1, + deletionPayload1V2, commonDeletionDestConfig, upsertPayload1, + upsertPayload1V2, upsertPayload2, + upsertPayload2V2, upsertPayload3, + upsertPayload3V2, commonUpsertDestConfig, commonUpsertDestConfig2, commonOutput1, commonUpsertDestConfig3, commonUpsertDestConfig2CustomModule, + commonConnectionConfigV2, + commonConnectionConfigV2_2, + commonConnectionConfigV2_3, + commonConnectionConfigCustomModuleV2, + commonDeletionConnectionConfigV2, }; diff --git a/test/integrations/destinations/zoho/network.ts b/test/integrations/destinations/zoho/network.ts index b37a56d1239..5614726fc08 100644 --- a/test/integrations/destinations/zoho/network.ts +++ b/test/integrations/destinations/zoho/network.ts @@ -418,4 +418,23 @@ export const networkCallsData = [ statusText: 'OK', }, }, + { + httpReq: { + url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted3%40gmail.com)and(First_Name:equals:subcribed3)and(Last_Name:equals:User3)', + headers: { + Authorization: 'Zoho-oauthtoken expired-access-token', + }, + method: 'GET', + }, + httpRes: { + data: { + code: 'INVALID_TOKEN', + details: {}, + message: 'invalid oauth token', + status: 'error', + }, + status: 401, + statusText: 'Bad Request', + }, + }, ]; diff --git a/test/integrations/destinations/zoho/router/deletion.ts b/test/integrations/destinations/zoho/router/deletion.ts index 5e922bc7944..aae91084f9f 100644 --- a/test/integrations/destinations/zoho/router/deletion.ts +++ b/test/integrations/destinations/zoho/router/deletion.ts @@ -1,5 +1,11 @@ import { defaultMockFns } from '../mocks'; -import { commonDeletionDestConfig, deletionPayload1, destType } from '../common'; +import { + commonDeletionDestConfig, + deletionPayload1, + deletionPayload1V2, + commonDeletionConnectionConfigV2, + destType, +} from '../common'; export const deleteData = [ { @@ -116,6 +122,117 @@ export const deleteData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + id: 'zoho_deletion_1_v2', + description: 'Happy flow record deletion with Leads module V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: deletionPayload1V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + identifiers: { + Email: 'tobedeleted2@gmail.com', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: + 'https://www.zohoapis.in/crm/v6/Leads?ids=,&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, { name: destType, id: 'zoho_deletion_2', @@ -246,4 +363,215 @@ export const deleteData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + id: 'zoho_deletion_2_v2', + description: 'Batch containing already existing and non existing records for deletion V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: deletionPayload1V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed3', + Last_Name: ' User3', + }, + identifiers: { + Email: 'tobedeleted3@gmail.com', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: 'https://www.zohoapis.in/crm/v6/Leads?ids=&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig, + }, + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: + 'failed to fetch zoho id for record for "No contact is found with record details"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_2_v2', + description: 'Delete with invalid access token V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed3', + Last_Name: 'User3', + }, + identifiers: { + Email: 'tobedeleted3@gmail.com', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'expired-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + authErrorCategory: 'REFRESH_TOKEN', + statusCode: 500, + error: `{\"message\":\"[Zoho]:: {\\\"code\\\":\\\"INVALID_TOKEN\\\",\\\"details\\\":{},\\\"message\\\":\\\"invalid oauth token\\\",\\\"status\\\":\\\"error\\\"} during zoho record search\",\"destinationResponse\":{\"code\":\"INVALID_TOKEN\",\"details\":{},\"message\":\"invalid oauth token\",\"status\":\"error\"}}`, + destination: commonDeletionDestConfig, + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'expired-access-token', + }, + }, + ], + statTags: { + errorType: 'retryable', + errorCategory: 'network', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, ]; diff --git a/test/integrations/destinations/zoho/router/upsert.ts b/test/integrations/destinations/zoho/router/upsert.ts index a2b898970d4..8c19ef06e40 100644 --- a/test/integrations/destinations/zoho/router/upsert.ts +++ b/test/integrations/destinations/zoho/router/upsert.ts @@ -2,13 +2,20 @@ import { defaultMockFns } from '../mocks'; import { commonOutput1, commonUpsertDestConfig, + commonConnectionConfigV2, + commonConnectionConfigV2_2, + commonConnectionConfigV2_3, + commonConnectionConfigCustomModuleV2, commonUpsertDestConfig2, commonUpsertDestConfig2CustomModule, commonUpsertDestConfig3, destType, upsertPayload1, + upsertPayload1V2, upsertPayload2, + upsertPayload2V2, upsertPayload3, + upsertPayload3V2, } from '../common'; export const upsertData = [ @@ -119,6 +126,115 @@ export const upsertData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + description: 'Happy flow with Leads module V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload1V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + { + message: upsertPayload2V2, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['email', 'Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': ['Bengali'], + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, { name: destType, description: 'Happy flow with Trigger None', @@ -226,6 +342,115 @@ export const upsertData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + description: 'Happy flow with Trigger None V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload1V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig2, + connection: commonConnectionConfigV2_2, + }, + { + message: upsertPayload2V2, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig2, + connection: commonConnectionConfigV2_2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['email', 'Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': ['Bengali'], + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: [], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig2, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, { name: destType, description: 'Happy flow with custom Module', @@ -390,7 +615,7 @@ export const upsertData = [ }, { name: destType, - description: 'If module specific mandatory field is absent, event will fail', + description: 'Happy flow with custom Module V2', feature: 'router', module: 'destination', version: 'v0', @@ -402,12 +627,6 @@ export const upsertData = [ message: { action: 'insert', context: { - externalId: [ - { - type: 'ZOHO-Leads', - identifierType: 'Email', - }, - ], mappedToDestination: 'true', sources: { job_run_id: 'cgiiurt8um7k7n5dq480', @@ -419,9 +638,12 @@ export const upsertData = [ recordId: '2', rudderId: '2', fields: { - Email: 'subscribed@eewrfrd.com', First_Name: 'subcribed', Last_Name: ' User', + Name: 'ABC', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', }, type: 'record', }, @@ -432,18 +654,13 @@ export const upsertData = [ accessToken: 'correct-access-token', }, }, - destination: commonUpsertDestConfig, + destination: commonUpsertDestConfig2CustomModule, + connection: commonConnectionConfigCustomModuleV2, }, { message: { action: 'insert', context: { - externalId: [ - { - type: 'ZOHO-Leads', - identifierType: 'Email', - }, - ], mappedToDestination: 'true', sources: { job_run_id: 'cgiiurt8um7k7n5dq480', @@ -455,7 +672,13 @@ export const upsertData = [ recordId: '2', rudderId: '2', fields: { + First_Name: 'subcribed', + Last_Name: ' User', 'multi-language': 'Bengali', + Name: 'ABC', + }, + identifiers: { + Email: 'subscribed@eewrfrd.com', }, type: 'record', }, @@ -466,7 +689,8 @@ export const upsertData = [ accessToken: 'correct-access-token', }, }, - destination: commonUpsertDestConfig, + destination: commonUpsertDestConfig2, + connection: commonConnectionConfigCustomModuleV2, }, ], destType, @@ -484,26 +708,34 @@ export const upsertData = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + endpoint: 'https://www.zohoapis.com/crm/v6/CUSTOM/upsert', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, params: {}, body: { JSON: { - duplicate_check_fields: ['Email'], + duplicate_check_fields: ['Email', 'Name'], data: [ { Email: 'subscribed@eewrfrd.com', First_Name: 'subcribed', Last_Name: ' User', + Name: 'ABC', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + 'multi-language': ['Bengali'], + Name: 'ABC', }, ], $append_values: { 'multi-language': 'true', 'multi class': 'false', }, - trigger: ['workflow'], + trigger: [], }, JSON_ARRAY: {}, XML: {}, @@ -511,7 +743,6 @@ export const upsertData = [ }, files: {}, }, - metadata: [ { jobId: 1, @@ -520,13 +751,163 @@ export const upsertData = [ accessToken: 'correct-access-token', }, }, - ], - batched: true, - statusCode: 200, - destination: commonUpsertDestConfig, - }, - { - metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig2CustomModule, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + description: 'If module specific mandatory field is absent, event will fail', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'insert', + context: { + externalId: [ + { + type: 'ZOHO-Leads', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + type: 'record', + }, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + }, + { + message: { + action: 'insert', + context: { + externalId: [ + { + type: 'ZOHO-Leads', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + 'multi-language': 'Bengali', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig, + }, + { + metadata: [ { jobId: 2, userId: 'u1', @@ -546,17 +927,246 @@ export const upsertData = [ implementation: 'cdkV2', feature: 'router', }, - destination: commonUpsertDestConfig, + destination: commonUpsertDestConfig, + }, + ], + }, + }, + }, + }, + { + name: destType, + description: 'If module specific mandatory field is absent, event will fail V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'insert', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed', + Last_Name: ' User', + }, + type: 'record', + identifiers: { + Email: 'subscribed@eewrfrd.com', + }, + }, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + { + message: { + action: 'insert', + context: { + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + 'multi-language': 'Bengali', + }, + identifiers: { + email: 'subscribed@eewrfrd.com', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['email', 'Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + ], + $append_values: { + 'multi-language': 'true', + 'multi class': 'false', + }, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig, + }, + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: 'Leads object must have the Last_Name property(ies).', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonUpsertDestConfig, + }, + ], + }, + }, + }, + }, + { + name: destType, + description: + 'If multiselect key decision is not set from UI, Rudderstack will consider those as normal fields', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload3, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: commonOutput1, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, }, ], }, }, }, + mockFns: defaultMockFns, }, { name: destType, description: - 'If multiselect key decision is not set from UI, Rudderstack will consider those as normal fields', + 'If multiselect key decision is not set from UI, Rudderstack will consider those as normal fields V2', feature: 'router', module: 'destination', version: 'v0', @@ -565,7 +1175,7 @@ export const upsertData = [ body: { input: [ { - message: upsertPayload3, + message: upsertPayload3V2, metadata: { jobId: 1, userId: 'u1', @@ -574,6 +1184,7 @@ export const upsertData = [ }, }, destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, }, ], destType, @@ -768,4 +1379,249 @@ export const upsertData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + description: 'Test Batching V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload3V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + { + message: upsertPayload3V2, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + { + message: upsertPayload3V2, + metadata: { + jobId: 3, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: { + duplicate_check_fields: ['Email'], + data: [ + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + { + Email: 'subscribed@eewrfrd.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + ], + $append_values: {}, + trigger: ['workflow'], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: commonOutput1, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 3, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + description: 'Test fields can be empty V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: upsertPayload3V2, + metadata: { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonUpsertDestConfig3, + connection: commonConnectionConfigV2_3, + }, + { + message: { + action: 'insert', + context: {}, + fields: {}, + identifiers: {}, + type: 'record', + }, + metadata: {}, + destination: commonUpsertDestConfig, + connection: commonConnectionConfigV2_3, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://www.zohoapis.com/crm/v6/Leads/upsert', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: commonOutput1, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonUpsertDestConfig3, + }, + { + batched: false, + destination: commonUpsertDestConfig, + error: '`fields` cannot be empty', + metadata: [{}], + statTags: { + destType: 'ZOHO', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'cdkV2', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, ]; From 3ccb9f9d987a2735e6f5b41020435d291eba639d Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Tue, 25 Feb 2025 16:46:54 +0530 Subject: [PATCH 115/160] chore: upgrade node version to 20 (#4076) * chore: upgrade node version to 20 * chore: update npm start command * chore: upgrade isolated vm * fix: custom dns lookup for user transformations --- .gitignore | 1 + .nvmrc | 2 +- Dockerfile | 6 +- Dockerfile-ut-func | 2 +- package-lock.json | 230 +++++++++++++++++- package.json | 12 +- src/util/utils.js | 10 +- src/util/utils.test.js | 102 ++++---- .../user_transformation_fetch.test.js | 4 +- 9 files changed, 283 insertions(+), 86 deletions(-) diff --git a/.gitignore b/.gitignore index e52af90cc6c..f9d3f0a9aab 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ bower_components # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release +build/ # Dependency directories node_modules/ diff --git a/.nvmrc b/.nvmrc index 99c98cdd6a8..87bc4c77fe1 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.20.1 +20.18.3 diff --git a/Dockerfile b/Dockerfile index f7f7a125502..21bc095bc5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.4 -FROM node:18.20.6-alpine3.21 AS base +FROM node:20.18.3-alpine3.21 AS base ENV HUSKY 0 RUN apk update @@ -33,7 +33,7 @@ RUN npm run setup:swagger ENTRYPOINT ["/sbin/tini", "--"] HEALTHCHECK --interval=1s --timeout=30s --retries=30 \ -CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 + CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 CMD [ "npm", "start" ] @@ -72,7 +72,7 @@ COPY --chown=node:node --from=development /home/node/app/dist/ ./dist ENTRYPOINT ["/sbin/tini", "--"] HEALTHCHECK --interval=1s --timeout=30s --retries=30 \ -CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 + CMD wget --no-verbose --tries=5 --spider http://localhost:9090/health || exit 1 CMD [ "npm", "start" ] diff --git a/Dockerfile-ut-func b/Dockerfile-ut-func index e6bd28857bb..a331a0c3a64 100644 --- a/Dockerfile-ut-func +++ b/Dockerfile-ut-func @@ -5,7 +5,7 @@ ENV HUSKY 0 RUN apt-get update \ && apt-get install -y curl make g++ \ && apt-get install -y cpio \ - && curl -sL https://deb.nodesource.com/setup_18.x | bash \ + && curl -sL https://deb.nodesource.com/setup_20.x | bash \ && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists.d/* \ diff --git a/package-lock.json b/package-lock.json index b10e043b3a8..aca794cfa2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@aws-sdk/credential-providers": "^3.391.0", "@aws-sdk/lib-storage": "^3.637.0", "@bugsnag/js": "^7.20.2", - "@datadog/pprof": "^3.1.0", + "@datadog/pprof": "^5.5.1", "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", @@ -42,7 +42,7 @@ "ioredis": "^5.3.2", "is": "^3.3.0", "is-ip": "^3.1.0", - "isolated-vm": "4.5.0", + "isolated-vm": "5.0.3", "js-sha1": "^0.6.0", "json-diff": "^1.0.3", "json-size": "^1.0.0", @@ -5559,18 +5559,20 @@ } }, "node_modules/@datadog/pprof": { - "version": "3.2.0", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@datadog/pprof/-/pprof-5.5.1.tgz", + "integrity": "sha512-3pZVYqc5YkZJOj9Rc8kQ/wG4qlygcnnwFU/w0QKX6dEdJh+1+dWniuUu+GSEjy/H0jc14yhdT2eJJf/F2AnHNw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { "delay": "^5.0.0", "node-gyp-build": "<4.0", "p-limit": "^3.1.0", - "pprof-format": "^2.0.7", + "pprof-format": "^2.1.0", "source-map": "^0.7.4" }, "engines": { - "node": ">=12" + "node": ">=16" } }, "node_modules/@dependents/detective-less": { @@ -8939,7 +8941,6 @@ }, "node_modules/bl": { "version": "4.1.0", - "dev": true, "license": "MIT", "dependencies": { "buffer": "^5.5.0", @@ -8949,7 +8950,6 @@ }, "node_modules/bl/node_modules/readable-stream": { "version": "3.6.2", - "dev": true, "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -10989,7 +10989,6 @@ }, "node_modules/deep-extend": { "version": "0.6.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4.0.0" @@ -12365,6 +12364,15 @@ "node": ">= 0.8.0" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, "node_modules/expand-tilde": { "version": "2.0.2", "dev": true, @@ -12796,6 +12804,12 @@ "readable-stream": "^2.0.0" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, "node_modules/fs-extra": { "version": "9.1.0", "dev": true, @@ -13388,6 +13402,12 @@ "ini": "^1.3.2" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, "node_modules/glob": { "version": "10.3.10", "dev": true, @@ -14044,7 +14064,6 @@ }, "node_modules/ini": { "version": "1.3.8", - "dev": true, "license": "ISC" }, "node_modules/inquirer": { @@ -14675,11 +14694,16 @@ } }, "node_modules/isolated-vm": { - "version": "4.5.0", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/isolated-vm/-/isolated-vm-5.0.3.tgz", + "integrity": "sha512-GNqX0j7dkwdaNQfFogLLb/tSuPZbXtKlk5ldaJ084ngjaW9/bn34x9FQFL856p20KSZoubIIummmiJf+2hzhCw==", "hasInstallScript": true, "license": "ISC", + "dependencies": { + "prebuild-install": "^7.1.2" + }, "engines": { - "node": ">=10.4.0" + "node": ">=18.0.0" } }, "node_modules/istanbul-lib-coverage": { @@ -18034,6 +18058,12 @@ "node": ">=10" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, "node_modules/mocked-env": { "version": "1.3.5", "dev": true, @@ -18345,6 +18375,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" + }, "node_modules/natural-compare": { "version": "1.4.0", "license": "MIT" @@ -18364,6 +18400,18 @@ "version": "2.6.2", "license": "MIT" }, + "node_modules/node-abi": { + "version": "3.74.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", + "integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/node-cache": { "version": "5.1.2", "license": "MIT", @@ -19296,6 +19344,32 @@ "webidl-conversions": "^4.0.2" } }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/precinct": { "version": "8.3.1", "dev": true, @@ -19820,7 +19894,6 @@ }, "node_modules/rc": { "version": "1.2.8", - "dev": true, "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", @@ -19834,7 +19907,6 @@ }, "node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -20537,6 +20609,78 @@ "version": "3.0.7", "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-get/node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/simple-get/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/simple-swizzle": { "version": "0.2.2", "license": "MIT", @@ -21513,6 +21657,54 @@ "node": ">=10" } }, + "node_modules/tar-fs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz", + "integrity": "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/tar/node_modules/minipass": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", @@ -21853,6 +22045,18 @@ "version": "1.14.1", "license": "0BSD" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "license": "MIT", diff --git a/package.json b/package.json index 534378e607a..69cf299e5e6 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "lint:fix:json": "eslint --ext .json --fix .", "lint": "npm run format && npm run lint:fix", "check:merge": "npm run verify || exit 1; codecov", - "start": "cd dist;exec node ./src/index.js;cd ..", + "start": "cd dist && NODE_OPTIONS='--no-node-snapshot' node ./src/index.js && cd ..", "build:start": "npm run build && npm run start", "build:ci": "tsc -p tsconfig.json", "build:swagger": "npm run build && npm run setup:swagger", @@ -33,12 +33,12 @@ "verify": "eslint . || exit 1; npm run test:js || exit 1", "test:testRouter": "jest testRouter --detectOpenHandles --coverage --notify --watchAll=false", "test:benchmark": "node benchmark/index.js", - "test": "jest -c jest.config.js --detectOpenHandles", + "test": "NODE_OPTIONS='--no-node-snapshot' jest -c jest.config.js --detectOpenHandles", "test:ci": "npm run test -- --coverage --expand --maxWorkers=50%", - "test:js": "jest -c jest.default.config.js --detectOpenHandles", + "test:js": "NODE_OPTIONS='--no-node-snapshot' jest -c jest.default.config.js --detectOpenHandles", "test:js:silent": "export LOG_LEVEL=silent && npm run test:js -- --silent", "test:js:ci": "npm run test:js -- --coverage --expand --maxWorkers=50%", - "test:ts": "jest -c jest.config.typescript.js --detectOpenHandles", + "test:ts": "NODE_OPTIONS='--no-node-snapshot' jest -c jest.config.typescript.js --detectOpenHandles", "test:ts:component:generateNwMocks": "npm run test:ts -- component --generate=true", "test:ts:silent": "export LOG_LEVEL=silent && npm run test:ts -- --silent", "test:ts:ci": "npm run test:ts -- --coverage --expand --maxWorkers=50%", @@ -60,7 +60,7 @@ "@aws-sdk/credential-providers": "^3.391.0", "@aws-sdk/lib-storage": "^3.637.0", "@bugsnag/js": "^7.20.2", - "@datadog/pprof": "^3.1.0", + "@datadog/pprof": "^5.5.1", "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", @@ -87,7 +87,7 @@ "ioredis": "^5.3.2", "is": "^3.3.0", "is-ip": "^3.1.0", - "isolated-vm": "4.5.0", + "isolated-vm": "5.0.3", "js-sha1": "^0.6.0", "json-diff": "^1.0.3", "json-size": "^1.0.0", diff --git a/src/util/utils.js b/src/util/utils.js index 36554ff5d0a..7f714a8b04b 100644 --- a/src/util/utils.js +++ b/src/util/utils.js @@ -46,7 +46,7 @@ const fetchAddressFromHostName = async (hostname) => { const staticLookup = (transformationTags, fetchAddress = fetchAddressFromHostName) => - (hostname, _, cb) => { + (hostname, options, cb) => { const resolveStartTime = new Date(); fetchAddress(hostname) @@ -57,9 +57,11 @@ const staticLookup = }); if (!address) { - cb(null, `resolved empty list of IP address for ${hostname}`, RECORD_TYPE_A); + cb(new Error(`resolved empty list of IP address for ${hostname}`), null); } else if (address.startsWith(LOCALHOST_OCTET)) { - cb(null, `cannot use ${address} as IP address`, RECORD_TYPE_A); + cb(new Error(`cannot use ${address} as IP address`), null); + } else if (options?.all) { + cb(null, [{ address, family: RECORD_TYPE_A }]); } else { cb(null, address, RECORD_TYPE_A); } @@ -70,7 +72,7 @@ const staticLookup = ...transformationTags, error: 'true', }); - cb(null, `unable to resolve IP address for ${hostname}`, RECORD_TYPE_A); + cb(new Error(`unable to resolve IP address for ${hostname}`), null); }); }; diff --git a/src/util/utils.test.js b/src/util/utils.test.js index d7974e3ff61..ead605aab89 100644 --- a/src/util/utils.test.js +++ b/src/util/utils.test.js @@ -10,62 +10,52 @@ describe('staticLookup', () => { jest.clearAllMocks(); }); - it('should resolve the hostname and return the IP address', async () => { - const mockAddress = '192.168.1.1'; - fetchAddressFromHostName.mockResolvedValueOnce({ address: mockAddress, cacheHit: true }); - - const resolve = staticLookup(transformationTags, fetchAddressFromHostName); - const callback = (args) => { - expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); - expect(args).toEqual(null, mockAddress, RECORD_TYPE_A); - }; - resolve(HOST_NAME, null, callback); - }); - - it('should handle errors from fetchAddressFromHostName', async () => { - const error = new Error('DNS error'); - error.code = 'ENOTFOUND'; - fetchAddressFromHostName.mockRejectedValueOnce(error); - - const resolve = staticLookup(transformationTags, fetchAddressFromHostName); - const callback = (args) => { - expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); - expect(args).toEqual(null, `unable to resolve IP address for ${HOST_NAME}`, RECORD_TYPE_A); - }; - resolve(HOST_NAME, null, callback); - }); - - it('should handle empty address', async () => { - fetchAddressFromHostName.mockResolvedValueOnce({ address: '', cacheHit: true }); - - const resolve = staticLookup(transformationTags, fetchAddressFromHostName); - const callback = (args) => { - expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); - expect(args).toEqual( - null, - `resolved empty list of IP address for ${HOST_NAME}`, - RECORD_TYPE_A, - ); - }; - resolve(HOST_NAME, null, callback); - }); - - it('should handle localhost address', async () => { - const LOCALHOST_OCTET = '127'; - fetchAddressFromHostName.mockResolvedValueOnce({ - address: `${LOCALHOST_OCTET}.0.0.1`, - cacheHit: true, + const testCases = [ + { + name: 'should resolve the hostname and return the IP address', + mockResponse: { address: '192.168.1.1', cacheHit: true }, + expectedArgs: [null, '192.168.1.1', RECORD_TYPE_A], + }, + { + name: 'should resolve the hostname and return the IP address with all option', + options: { all: true }, + mockResponse: { address: '192.168.1.1', cacheHit: true }, + expectedArgs: [null, [{ address: '192.168.1.1', family: RECORD_TYPE_A }]], + }, + { + name: 'should handle errors from fetchAddressFromHostName', + mockResponse: { error: 'DNS error', errorCode: 'ENOTFOUND' }, + expectedArgs: [new Error(`unable to resolve IP address for ${HOST_NAME}`), null], + }, + { + name: 'should handle empty address', + mockResponse: { address: '', cacheHit: true }, + expectedArgs: [new Error(`resolved empty list of IP address for ${HOST_NAME}`), null], + }, + { + name: 'should handle localhost address', + mockResponse: { address: '127.0.0.1', cacheHit: true }, + expectedArgs: [new Error(`cannot use 127.0.0.1 as IP address`), null], + }, + ]; + + testCases.forEach(({ name, options, mockResponse, expectedArgs }) => { + it(name, async () => { + if (mockResponse.error) { + const error = new Error(mockResponse.error); + error.code = mockResponse.errorCode; + fetchAddressFromHostName.mockRejectedValueOnce(error); + } else { + fetchAddressFromHostName.mockResolvedValueOnce(mockResponse); + } + + const resolve = staticLookup(transformationTags, fetchAddressFromHostName); + const callback = (...args) => { + expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); + expect(args).toEqual(expectedArgs); + }; + + resolve(HOST_NAME, options, callback); }); - - const resolve = staticLookup(transformationTags, fetchAddressFromHostName); - const callback = (args) => { - expect(fetchAddressFromHostName).toHaveBeenCalledWith(HOST_NAME); - expect(args).toEqual( - null, - `cannot use ${LOCALHOST_OCTET}.0.0.1 as IP address`, - RECORD_TYPE_A, - ); - }; - resolve(HOST_NAME, null, callback); }); }); diff --git a/test/__tests__/user_transformation_fetch.test.js b/test/__tests__/user_transformation_fetch.test.js index 3f0b0606898..635f7d16e70 100644 --- a/test/__tests__/user_transformation_fetch.test.js +++ b/test/__tests__/user_transformation_fetch.test.js @@ -149,7 +149,7 @@ describe("User transformation fetch tests", () => { } ` }; - const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: Invalid IP address: unable to resolve IP address for abc.xyz.com"; + const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: unable to resolve IP address for abc.xyz.com"; mockResolver.mockRejectedValue('invalid host'); const output = await userTransformHandler(inputData, versionId, [], trRevCode, true); @@ -305,7 +305,7 @@ describe("User transformation fetch tests", () => { } ` }; - const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: Invalid IP address: cannot use 127.0.0.1 as IP address"; + const errMsg = "request to https://abc.xyz.com/dummyUrl failed, reason: cannot use 127.0.0.1 as IP address"; mockResolver.mockResolvedValue([{ address: '127.0.0.1', ttl: 100 }, { address: '3.122.122.122', ttl: 600 }]); const output = await userTransformHandler(inputData, versionId, [], trRevCode, true); From 09e9cb7dee8b9f6b79a8bf00b674695599481e4a Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Tue, 25 Feb 2025 20:04:00 +0530 Subject: [PATCH 116/160] chore: add missing library and integration label to checkout identify payloads (#4114) --- .../serverSideTransform.js | 6 ++++++ .../CheckoutEventsTests.ts | 21 +++++++++++-------- .../webhookTestScenarios/GenericTrackTests.ts | 7 ++++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 7626135a4fd..c6ae3e2082f 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -104,6 +104,12 @@ const createIdentifyEvent = (message) => { }); // Set the mapped traits identifyEvent.context.traits = removeUndefinedAndNullValues(mappedTraits); + identifyEvent.setProperty(`integrations.${INTEGERATION}`, true); + identifyEvent.setProperty('context.library', { + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', + }); return identifyEvent; }; diff --git a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts index 76b3fb76141..66d5e7815d3 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/CheckoutEventsTests.ts @@ -613,8 +613,9 @@ export const checkoutEventsTestScenarios = [ name: 'SHOPIFY', }, library: { - name: 'unknown', - version: 'unknown', + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', }, traits: { acceptsMarketing: false, @@ -668,7 +669,7 @@ export const checkoutEventsTestScenarios = [ }, }, integrations: { - SHOPIFY: false, + SHOPIFY: true, }, type: 'identify', userId: '7188389789809', @@ -1376,8 +1377,9 @@ export const checkoutEventsTestScenarios = [ name: 'SHOPIFY', }, library: { - name: 'unknown', - version: 'unknown', + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', }, traits: { address: { @@ -1446,7 +1448,7 @@ export const checkoutEventsTestScenarios = [ }, }, integrations: { - SHOPIFY: false, + SHOPIFY: true, }, type: 'identify', userId: '7358220173425', @@ -1852,8 +1854,9 @@ export const checkoutEventsTestScenarios = [ name: 'SHOPIFY', }, library: { - name: 'unknown', - version: 'unknown', + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', }, traits: { address: { @@ -1919,7 +1922,7 @@ export const checkoutEventsTestScenarios = [ }, }, integrations: { - SHOPIFY: false, + SHOPIFY: true, }, type: 'identify', userId: '7358220173425', diff --git a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts index 2214b730b7e..25ce93aa8ce 100644 --- a/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts +++ b/test/integrations/sources/shopify/webhookTestScenarios/GenericTrackTests.ts @@ -567,15 +567,16 @@ export const genericTrackTestScenarios = [ name: 'SHOPIFY', }, library: { - name: 'unknown', - version: 'unknown', + eventOrigin: 'server', + name: 'RudderStack Shopify Cloud', + version: '2.0.0', }, traits: { email: 'henry@wfls.com', }, }, integrations: { - SHOPIFY: false, + SHOPIFY: true, }, type: 'identify', }, From dab07f076349248ffd2555c22cd3040d8e27851c Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:10:47 +0530 Subject: [PATCH 117/160] chore: add test case filter support (#4115) --- package-lock.json | 19 +++++++++++++++---- package.json | 2 +- test/integrations/component.test.ts | 7 +------ test/integrations/testTypes.ts | 4 +++- test/integrations/testUtils.ts | 7 ++++--- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b24a674698..fbb49bdc6b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.16", + "@rudderstack/integrations-lib": "^0.2.18", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", @@ -6748,9 +6748,10 @@ } }, "node_modules/@rudderstack/integrations-lib": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.16.tgz", - "integrity": "sha512-wckZxn1EMu8nTV/sPmrWOTbKyC5WCM574q5q//B+AHhy68+c0pwvGq1nuSf2m+c6WaXgwUwxn28TcLc5w5Ga+g==", + "version": "0.2.18", + "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.18.tgz", + "integrity": "sha512-cDL4t9nzt0O87jcC4htiz2HdAiibfaHx+AgBju1wKZXGTfvduZ6HmIQcyYQtfkv1uXuH2YCUdnI6l7sWowCv2w==", + "license": "MIT", "dependencies": { "axios": "^1.4.0", "crypto": "^1.0.1", @@ -6759,6 +6760,7 @@ "fast-xml-parser": "^4.5.0", "get-value": "^3.0.1", "handlebars": "^4.7.8", + "jsonschema": "^1.5.0", "lodash": "^4.17.21", "moment": "^2.29.4", "moment-timezone": "^0.5.43", @@ -16529,6 +16531,15 @@ ], "license": "MIT" }, + "node_modules/jsonschema": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", + "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/JSONStream": { "version": "1.3.5", "dev": true, diff --git a/package.json b/package.json index 9012e602cf6..547459cd19c 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.16", + "@rudderstack/integrations-lib": "^0.2.18", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 7ca4062038a..cfcd1d56f2d 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -226,12 +226,7 @@ describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { testData = [testData[parseInt(opts.index)]]; } if (opts.id) { - testData = testData.filter((data) => { - if (data['id'] === opts.id) { - return true; - } - return false; - }); + testData = testData.filter((data) => data.id === opts.id); } const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => { diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index e170119cb79..0b83db51899 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -1,5 +1,7 @@ import { AxiosResponse } from 'axios'; import MockAdapter from 'axios-mock-adapter'; +import { BaseTestCase } from '@rudderstack/integrations-lib'; + import { DeliveryV1Response, ProcessorTransformationRequest, @@ -38,7 +40,7 @@ export interface mockType { response: responseType; } -export interface TestCaseData { +export interface TestCaseData extends BaseTestCase { id?: string; name: string; description: string; diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts index 73d08e452c2..e70c4da008f 100644 --- a/test/integrations/testUtils.ts +++ b/test/integrations/testUtils.ts @@ -4,7 +4,7 @@ import { MockHttpCallsData, TestCaseData } from './testTypes'; import MockAdapter from 'axios-mock-adapter'; import isMatch from 'lodash/isMatch'; import { OptionValues } from 'commander'; -import { removeUndefinedAndNullValues } from '@rudderstack/integrations-lib'; +import { filter, removeUndefinedAndNullValues } from '@rudderstack/integrations-lib'; import tags from '../../src/v0/util/tags'; import { existsSync, mkdirSync, writeFileSync } from 'fs'; import { Destination, ProxyMetdata, ProxyV0Request, ProxyV1Request } from '../../src/types'; @@ -21,6 +21,7 @@ import { const generateAlphanumericId = (size = 36) => [...Array(size)].map(() => ((Math.random() * size) | 0).toString(size)).join(''); + export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): string[] => { const globPattern = join(dirPath, '**', 'data.ts'); let testFilePaths = globSync(globPattern); @@ -29,7 +30,7 @@ export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): strin const destinationOrSource = opts.destination || opts.source; if (destinationOrSource) { filteredTestFilePaths = testFilePaths.filter( - (testFile) => destinationOrSource && testFile.includes(`${destinationOrSource}/`), + (testFile) => destinationOrSource && testFile.includes(`/${destinationOrSource}/`), ); } if (opts.feature) { @@ -41,7 +42,7 @@ export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): strin }; export const getTestData = (filePath): TestCaseData[] => { - return require(filePath).data as TestCaseData[]; + return filter(require(filePath).data as TestCaseData[]); }; export const getMockHttpCallsData = (filePath): MockHttpCallsData[] => { From 070d120998d32ce6adde041c7edcbb30b9127be1 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Thu, 27 Feb 2025 13:29:56 +0530 Subject: [PATCH 118/160] chore: cherry pick files, sources v2 migration completely --- src/controllers/util/index.test.ts | 61 ++++++++++--- src/{v0 => }/sources/extole/mapping.json | 0 src/{v0 => }/sources/extole/transform.js | 10 +-- src/{v0 => }/sources/formsort/mapping.json | 0 src/{v0 => }/sources/formsort/transform.js | 5 +- .../sources/formsort/transform.test.js | 26 +++--- src/{v0 => }/sources/gainsightpx/config.js | 0 .../gainsightpx/data/customMapping.json | 0 .../gainsightpx/data/engagementMapping.json | 0 .../gainsightpx/data/featureMatchMapping.json | 0 .../gainsightpx/data/feedbackMapping.json | 0 .../gainsightpx/data/identifyMapping.json | 0 .../gainsightpx/data/segmentIOMapping.json | 0 .../gainsightpx/data/segmentMapping.json | 0 .../gainsightpx/data/surveyMapping.json | 0 src/{v0 => }/sources/gainsightpx/transform.js | 4 +- src/{v0 => }/sources/gainsightpx/utils.js | 2 +- src/{v0 => }/sources/iterable/mapping.json | 0 src/{v0 => }/sources/iterable/transform.js | 4 +- src/{v0 => }/sources/mailjet/mapping.json | 0 src/{v0 => }/sources/mailjet/transform.js | 6 +- src/{v0 => }/sources/mailmodo/mapping.json | 0 src/{v0 => }/sources/mailmodo/transform.js | 9 +- src/sources/moengage/transform.js | 11 +++ src/{v0 => }/sources/monday/mapping.json | 0 src/{v0 => }/sources/monday/transform.js | 11 ++- src/{v0 => }/sources/monday/util.js | 0 src/{v0 => }/sources/olark/groupMapping.json | 0 src/{v0 => }/sources/olark/trackMapping.json | 0 src/{v0 => }/sources/olark/transform.js | 5 +- src/{v0 => }/sources/olark/util.js | 0 src/{v0 => }/sources/ortto/event_mapping.json | 0 src/{v0 => }/sources/ortto/mapping.json | 0 src/{v0 => }/sources/ortto/transform.js | 12 ++- .../sources/pagerduty/data/eventMapping.json | 0 .../sources/pagerduty/data/trackMapping.json | 0 src/{v0 => }/sources/pagerduty/transform.js | 6 +- src/{v0 => }/sources/pipedream/config.js | 0 src/{v0 => }/sources/pipedream/transform.js | 5 +- src/{v0 => }/sources/pipedream/util.js | 0 .../sources/refiner/groupMapping.json | 0 .../sources/refiner/identifyMapping.json | 0 .../sources/refiner/trackMapping.json | 0 src/{v0 => }/sources/refiner/transform.js | 13 +-- src/{v0 => }/sources/revenuecat/mapping.json | 0 src/{v0 => }/sources/revenuecat/transform.js | 10 ++- .../sources/satismeter/data/trackMapping.json | 0 src/{v0 => }/sources/satismeter/transform.js | 5 +- src/sources/segment/transform.js | 8 ++ src/{v0 => }/sources/signl4/mapping.json | 0 src/{v0 => }/sources/signl4/transform.js | 12 ++- src/{v0 => }/sources/slack/mapping.json | 0 src/{v0 => }/sources/slack/transform.js | 13 ++- src/{v0 => }/sources/slack/util.js | 0 src/{v0 => }/sources/slack/util.test.js | 0 src/{v1 => }/sources/webhook/transform.js | 10 ++- src/v0/sources/message.js | 86 ------------------- src/v0/sources/moengage/transform.js | 8 -- src/v0/sources/segment/transform.js | 5 -- src/v0/sources/shopify/transform.js | 2 +- src/v0/util/index.test.js | 2 +- .../serverSideTransform.js | 2 +- .../serverSideUtils.test.js | 4 +- .../webpixelTransformations/pixelUtils.js | 2 +- .../pixelUtils.test.js | 4 +- .../source/v2/response_to_caller.json | 18 ++++ test/apitests/service.api.test.ts | 4 +- 67 files changed, 208 insertions(+), 177 deletions(-) rename src/{v0 => }/sources/extole/mapping.json (100%) rename src/{v0 => }/sources/extole/transform.js (80%) rename src/{v0 => }/sources/formsort/mapping.json (100%) rename src/{v0 => }/sources/formsort/transform.js (81%) rename src/{v0 => }/sources/formsort/transform.test.js (64%) rename src/{v0 => }/sources/gainsightpx/config.js (100%) rename src/{v0 => }/sources/gainsightpx/data/customMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/data/engagementMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/data/featureMatchMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/data/feedbackMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/data/identifyMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/data/segmentIOMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/data/segmentMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/data/surveyMapping.json (100%) rename src/{v0 => }/sources/gainsightpx/transform.js (95%) rename src/{v0 => }/sources/gainsightpx/utils.js (95%) rename src/{v0 => }/sources/iterable/mapping.json (100%) rename src/{v0 => }/sources/iterable/transform.js (90%) rename src/{v0 => }/sources/mailjet/mapping.json (100%) rename src/{v0 => }/sources/mailjet/transform.js (88%) rename src/{v0 => }/sources/mailmodo/mapping.json (100%) rename src/{v0 => }/sources/mailmodo/transform.js (93%) create mode 100644 src/sources/moengage/transform.js rename src/{v0 => }/sources/monday/mapping.json (100%) rename src/{v0 => }/sources/monday/transform.js (89%) rename src/{v0 => }/sources/monday/util.js (100%) rename src/{v0 => }/sources/olark/groupMapping.json (100%) rename src/{v0 => }/sources/olark/trackMapping.json (100%) rename src/{v0 => }/sources/olark/transform.js (91%) rename src/{v0 => }/sources/olark/util.js (100%) rename src/{v0 => }/sources/ortto/event_mapping.json (100%) rename src/{v0 => }/sources/ortto/mapping.json (100%) rename src/{v0 => }/sources/ortto/transform.js (91%) rename src/{v0 => }/sources/pagerduty/data/eventMapping.json (100%) rename src/{v0 => }/sources/pagerduty/data/trackMapping.json (100%) rename src/{v0 => }/sources/pagerduty/transform.js (84%) rename src/{v0 => }/sources/pipedream/config.js (100%) rename src/{v0 => }/sources/pipedream/transform.js (80%) rename src/{v0 => }/sources/pipedream/util.js (100%) rename src/{v0 => }/sources/refiner/groupMapping.json (100%) rename src/{v0 => }/sources/refiner/identifyMapping.json (100%) rename src/{v0 => }/sources/refiner/trackMapping.json (100%) rename src/{v0 => }/sources/refiner/transform.js (83%) rename src/{v0 => }/sources/revenuecat/mapping.json (100%) rename src/{v0 => }/sources/revenuecat/transform.js (88%) rename src/{v0 => }/sources/satismeter/data/trackMapping.json (100%) rename src/{v0 => }/sources/satismeter/transform.js (83%) create mode 100644 src/sources/segment/transform.js rename src/{v0 => }/sources/signl4/mapping.json (100%) rename src/{v0 => }/sources/signl4/transform.js (90%) rename src/{v0 => }/sources/slack/mapping.json (100%) rename src/{v0 => }/sources/slack/transform.js (93%) rename src/{v0 => }/sources/slack/util.js (100%) rename src/{v0 => }/sources/slack/util.test.js (100%) rename src/{v1 => }/sources/webhook/transform.js (61%) delete mode 100644 src/v0/sources/message.js delete mode 100644 src/v0/sources/moengage/transform.js delete mode 100644 src/v0/sources/segment/transform.js create mode 100644 test/apitests/data_scenarios/source/v2/response_to_caller.json diff --git a/src/controllers/util/index.test.ts b/src/controllers/util/index.test.ts index 1f53ba3c1b3..3edfbef970f 100644 --- a/src/controllers/util/index.test.ts +++ b/src/controllers/util/index.test.ts @@ -32,13 +32,20 @@ describe('adaptInputToVersion', () => { expect(result).toEqual(expected); }); it('should return the input unchanged when the implementation version and request version are the same i.e. v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v0'; const input = [ { key1: 'val1', key2: 'val2' }, { key1: 'val1', key2: 'val2' }, { key1: 'val1', key2: 'val2' }, ]; + + // Mock return value for getSourceVersionsMap + const expected = { implementationVersion: 'v0', input: [ @@ -52,8 +59,13 @@ describe('adaptInputToVersion', () => { expect(result).toEqual(expected); }); + it('should return the input unchanged when the implementation version and request version are the same i.e. v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v1'; const input = [ { @@ -69,6 +81,7 @@ describe('adaptInputToVersion', () => { source: { id: 'source_id', config: { configField1: 'configVal1' } }, }, ]; + const expected = { implementationVersion: 'v1', input: [ @@ -97,8 +110,13 @@ describe('adaptInputToVersion', () => { expect(result).toEqual(expected); }); + it('should convert input from v0 to v1 when the request version is v0 and the implementation version is v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v0'; const input = [ { key1: 'val1', key2: 'val2' }, @@ -120,7 +138,11 @@ describe('adaptInputToVersion', () => { }); it('should convert input from v1 to v0 format when the request version is v1 and the implementation version is v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v1'; const input = [ { @@ -151,7 +173,11 @@ describe('adaptInputToVersion', () => { }); it('should convert input from v2 to v0 format when the request version is v2 and the implementation version is v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -204,7 +230,11 @@ describe('adaptInputToVersion', () => { }); it('should fail trying to convert input from v2 to v0 format when the request version is v2 and the implementation version is v0', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -235,7 +265,11 @@ describe('adaptInputToVersion', () => { }); it('should convert input from v2 to v1 format when the request version is v2 and the implementation version is v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -303,7 +337,11 @@ describe('adaptInputToVersion', () => { }); it('should fail trying to convert input from v2 to v1 format when the request version is v2 and the implementation version is v1', () => { - const sourceType = 'webhook'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v1']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v2'; const input = [ @@ -335,7 +373,11 @@ describe('adaptInputToVersion', () => { // Should return an empty array when the input is an empty array it('should return an empty array when the input is an empty array', () => { - const sourceType = 'pipedream'; + jest + .spyOn(ControllerUtility as any, 'getSourceVersionsMap') + .mockReturnValue(new Map([['someSourceType', 'v0']])); + + const sourceType = 'someSourceType'; const requestVersion = 'v1'; const input = []; const expected = { implementationVersion: 'v0', input: [] }; @@ -349,7 +391,6 @@ describe('adaptInputToVersion', () => { const sourceType = 'someSourceType'; const requestVersion = 'v1'; - // Mock return value for getSourceVersionsMap jest .spyOn(ControllerUtility as any, 'getSourceVersionsMap') .mockReturnValue(new Map([['someSourceType', 'v2']])); diff --git a/src/v0/sources/extole/mapping.json b/src/sources/extole/mapping.json similarity index 100% rename from src/v0/sources/extole/mapping.json rename to src/sources/extole/mapping.json diff --git a/src/v0/sources/extole/transform.js b/src/sources/extole/transform.js similarity index 80% rename from src/v0/sources/extole/transform.js rename to src/sources/extole/transform.js index a5fa99adcea..022762aa0eb 100644 --- a/src/v0/sources/extole/transform.js +++ b/src/sources/extole/transform.js @@ -1,9 +1,9 @@ /* eslint-disable no-case-declarations */ const path = require('path'); const fs = require('fs'); -const { generateUUID } = require('../../util'); +const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); const Message = require('../message'); -const { removeUndefinedAndNullValues, extractCustomFields } = require('../../util'); +const { removeUndefinedAndNullValues, extractCustomFields } = require('../../v0/util'); const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -21,8 +21,7 @@ function processEvent(event) { break; default: message.setEventName(event.type); - let messageProperties = {}; - messageProperties = extractCustomFields(event, messageProperties, 'root', ['type']); + const messageProperties = extractCustomFields(event, {}, 'root', ['type']); message.setProperty('properties', messageProperties); } @@ -31,7 +30,8 @@ function processEvent(event) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); const returnValue = removeUndefinedAndNullValues(response); return returnValue; diff --git a/src/v0/sources/formsort/mapping.json b/src/sources/formsort/mapping.json similarity index 100% rename from src/v0/sources/formsort/mapping.json rename to src/sources/formsort/mapping.json diff --git a/src/v0/sources/formsort/transform.js b/src/sources/formsort/transform.js similarity index 81% rename from src/v0/sources/formsort/transform.js rename to src/sources/formsort/transform.js index dd37482bc49..234c9573bf8 100644 --- a/src/v0/sources/formsort/transform.js +++ b/src/sources/formsort/transform.js @@ -1,12 +1,13 @@ const path = require('path'); const fs = require('fs'); -const { generateUUID, isDefinedAndNotNull } = require('../../util'); +const { generateUUID, isDefinedAndNotNull, getBodyFromV2SpecPayload } = require('../../v0/util'); const Message = require('../message'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`Formsort`); // we are setting event type as track always diff --git a/src/v0/sources/formsort/transform.test.js b/src/sources/formsort/transform.test.js similarity index 64% rename from src/v0/sources/formsort/transform.test.js rename to src/sources/formsort/transform.test.js index e3d686fcefb..a7462899404 100644 --- a/src/v0/sources/formsort/transform.test.js +++ b/src/sources/formsort/transform.test.js @@ -3,18 +3,22 @@ const { process } = require('./transform'); it(`Transform.js Tests`, () => { const data = { input: { - answers: { - yes: true, - enter_email: 'test@user.com', - enter_name: '2022-11-17', - yes_or_no: false, + request: { + body: JSON.stringify({ + answers: { + yes: true, + enter_email: 'test@user.com', + enter_name: '2022-11-17', + yes_or_no: false, + }, + responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', + flow_label: 'new-flow-2022-11-25', + variant_label: 'main', + variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', + finalized: false, + created_at: '2022-11-25T14:41:22+00:00', + }), }, - responder_uuid: '66a8e5bb-67e1-47ec-b55f-a26fd4be2dc7', - flow_label: 'new-flow-2022-11-25', - variant_label: 'main', - variant_uuid: '0828efa7-7215-4e7d-a7ab-6c1079010cea', - finalized: false, - created_at: '2022-11-25T14:41:22+00:00', }, output: { context: { diff --git a/src/v0/sources/gainsightpx/config.js b/src/sources/gainsightpx/config.js similarity index 100% rename from src/v0/sources/gainsightpx/config.js rename to src/sources/gainsightpx/config.js diff --git a/src/v0/sources/gainsightpx/data/customMapping.json b/src/sources/gainsightpx/data/customMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/customMapping.json rename to src/sources/gainsightpx/data/customMapping.json diff --git a/src/v0/sources/gainsightpx/data/engagementMapping.json b/src/sources/gainsightpx/data/engagementMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/engagementMapping.json rename to src/sources/gainsightpx/data/engagementMapping.json diff --git a/src/v0/sources/gainsightpx/data/featureMatchMapping.json b/src/sources/gainsightpx/data/featureMatchMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/featureMatchMapping.json rename to src/sources/gainsightpx/data/featureMatchMapping.json diff --git a/src/v0/sources/gainsightpx/data/feedbackMapping.json b/src/sources/gainsightpx/data/feedbackMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/feedbackMapping.json rename to src/sources/gainsightpx/data/feedbackMapping.json diff --git a/src/v0/sources/gainsightpx/data/identifyMapping.json b/src/sources/gainsightpx/data/identifyMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/identifyMapping.json rename to src/sources/gainsightpx/data/identifyMapping.json diff --git a/src/v0/sources/gainsightpx/data/segmentIOMapping.json b/src/sources/gainsightpx/data/segmentIOMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/segmentIOMapping.json rename to src/sources/gainsightpx/data/segmentIOMapping.json diff --git a/src/v0/sources/gainsightpx/data/segmentMapping.json b/src/sources/gainsightpx/data/segmentMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/segmentMapping.json rename to src/sources/gainsightpx/data/segmentMapping.json diff --git a/src/v0/sources/gainsightpx/data/surveyMapping.json b/src/sources/gainsightpx/data/surveyMapping.json similarity index 100% rename from src/v0/sources/gainsightpx/data/surveyMapping.json rename to src/sources/gainsightpx/data/surveyMapping.json diff --git a/src/v0/sources/gainsightpx/transform.js b/src/sources/gainsightpx/transform.js similarity index 95% rename from src/v0/sources/gainsightpx/transform.js rename to src/sources/gainsightpx/transform.js index 92f0a074562..62bc73e6152 100644 --- a/src/v0/sources/gainsightpx/transform.js +++ b/src/sources/gainsightpx/transform.js @@ -10,6 +10,7 @@ const surveyMapping = require('./data/surveyMapping.json'); const featureMatchMapping = require('./data/featureMatchMapping.json'); const segmentIoMapping = require('./data/segmentIOMapping.json'); const { refinePayload, refineTraitPayload } = require('./utils'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); const buildIdentifyPayload = (event) => { let message = new Message(`GAINSIGHTPX`); @@ -84,7 +85,8 @@ function processEvent(event) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); const returnValue = refinePayload(response); return returnValue; diff --git a/src/v0/sources/gainsightpx/utils.js b/src/sources/gainsightpx/utils.js similarity index 95% rename from src/v0/sources/gainsightpx/utils.js rename to src/sources/gainsightpx/utils.js index aed0f5fab8d..f93caaada91 100644 --- a/src/v0/sources/gainsightpx/utils.js +++ b/src/sources/gainsightpx/utils.js @@ -1,5 +1,5 @@ /* eslint-disable no-param-reassign */ -const { isDefinedAndNotNullAndNotEmpty } = require('../../util'); +const { isDefinedAndNotNullAndNotEmpty } = require('../../v0/util'); const { traitsToDelete, accountTraitsToDelete } = require('./config'); /** diff --git a/src/v0/sources/iterable/mapping.json b/src/sources/iterable/mapping.json similarity index 100% rename from src/v0/sources/iterable/mapping.json rename to src/sources/iterable/mapping.json diff --git a/src/v0/sources/iterable/transform.js b/src/sources/iterable/transform.js similarity index 90% rename from src/v0/sources/iterable/transform.js rename to src/sources/iterable/transform.js index dc3fc72c3c8..ffb96c26b30 100644 --- a/src/v0/sources/iterable/transform.js +++ b/src/sources/iterable/transform.js @@ -3,11 +3,13 @@ const fs = require('fs'); const md5 = require('md5'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); // throw an error if (email, eventName) are not present if (!(event.email && event.eventName)) { throw new TransformationError('Unknwon event type from Iterable'); diff --git a/src/v0/sources/mailjet/mapping.json b/src/sources/mailjet/mapping.json similarity index 100% rename from src/v0/sources/mailjet/mapping.json rename to src/sources/mailjet/mapping.json diff --git a/src/v0/sources/mailjet/transform.js b/src/sources/mailjet/transform.js similarity index 88% rename from src/v0/sources/mailjet/transform.js rename to src/sources/mailjet/transform.js index 91f90b6ed0f..1c18efdb4a0 100644 --- a/src/v0/sources/mailjet/transform.js +++ b/src/sources/mailjet/transform.js @@ -2,13 +2,15 @@ const path = require('path'); const fs = require('fs'); const md5 = require('md5'); const Message = require('../message'); -const { CommonUtils } = require('../../../util/common'); +const { CommonUtils } = require('../../util/common'); +const { getBodyFromV2SpecPayload } = require('../../v0/util'); // ref : https://dev.mailjet.com/email/guides/webhooks/ // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -const processEvent = (event) => { +const processEvent = (payload) => { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`MailJet`); // event type is always track const eventType = 'track'; diff --git a/src/v0/sources/mailmodo/mapping.json b/src/sources/mailmodo/mapping.json similarity index 100% rename from src/v0/sources/mailmodo/mapping.json rename to src/sources/mailmodo/mapping.json diff --git a/src/v0/sources/mailmodo/transform.js b/src/sources/mailmodo/transform.js similarity index 93% rename from src/v0/sources/mailmodo/transform.js rename to src/sources/mailmodo/transform.js index a4383fb4409..0ec483f5936 100644 --- a/src/v0/sources/mailmodo/transform.js +++ b/src/sources/mailmodo/transform.js @@ -2,7 +2,11 @@ const path = require('path'); const fs = require('fs'); const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); -const { flattenJson, removeUndefinedAndNullAndEmptyValues } = require('../../util'); +const { + flattenJson, + removeUndefinedAndNullAndEmptyValues, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); // import mapping json using JSON.parse to preserve object key order @@ -39,7 +43,8 @@ function settingProperties(event, message) { return cloneMessage; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`Mailmodo`); // event type is always track diff --git a/src/sources/moengage/transform.js b/src/sources/moengage/transform.js new file mode 100644 index 00000000000..e64de556ad1 --- /dev/null +++ b/src/sources/moengage/transform.js @@ -0,0 +1,11 @@ +const { getBodyFromV2SpecPayload } = require('../../v0/util'); + +function process(payload) { + const events = getBodyFromV2SpecPayload(payload); + if (events.batch) { + return events.batch; + } + return events; +} + +exports.process = process; diff --git a/src/v0/sources/monday/mapping.json b/src/sources/monday/mapping.json similarity index 100% rename from src/v0/sources/monday/mapping.json rename to src/sources/monday/mapping.json diff --git a/src/v0/sources/monday/transform.js b/src/sources/monday/transform.js similarity index 89% rename from src/v0/sources/monday/transform.js rename to src/sources/monday/transform.js index d63323605b3..adf3d564a75 100644 --- a/src/v0/sources/monday/transform.js +++ b/src/sources/monday/transform.js @@ -2,8 +2,12 @@ const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); const { mapping, formEventName } = require('./util'); -const { generateUUID, removeUndefinedAndNullValues } = require('../../util'); -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { + generateUUID, + removeUndefinedAndNullValues, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); function processNormalEvent(mondayPayload) { const message = new Message(`MONDAY`); @@ -61,7 +65,8 @@ function processChallengeEvent(event) { // For challenge event the recieved challenge object is sent back // to Monday to verify the webhook url. // Ref: https://developer.monday.com/api-reference/docs/webhooks-1#how-to-verify-a-webhook-url -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = isChallengeEvent(event) ? processChallengeEvent(event) : processNormalEvent(event); diff --git a/src/v0/sources/monday/util.js b/src/sources/monday/util.js similarity index 100% rename from src/v0/sources/monday/util.js rename to src/sources/monday/util.js diff --git a/src/v0/sources/olark/groupMapping.json b/src/sources/olark/groupMapping.json similarity index 100% rename from src/v0/sources/olark/groupMapping.json rename to src/sources/olark/groupMapping.json diff --git a/src/v0/sources/olark/trackMapping.json b/src/sources/olark/trackMapping.json similarity index 100% rename from src/v0/sources/olark/trackMapping.json rename to src/sources/olark/trackMapping.json diff --git a/src/v0/sources/olark/transform.js b/src/sources/olark/transform.js similarity index 91% rename from src/v0/sources/olark/transform.js rename to src/sources/olark/transform.js index 50b5e5bfc49..377b78532d4 100644 --- a/src/v0/sources/olark/transform.js +++ b/src/sources/olark/transform.js @@ -2,7 +2,7 @@ const path = require('path'); const fs = require('fs'); const set = require('set-value'); const Message = require('../message'); -const { removeUndefinedAndNullValues } = require('../../util'); +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); const { getBrowserInfo } = require('./util'); // ref : https://www.olark.com/help/webhooks/ @@ -49,7 +49,8 @@ const prepareGroupPayload = (event) => { return groupEvents; }; -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = []; response.push(prepareTrackPayload(event)); diff --git a/src/v0/sources/olark/util.js b/src/sources/olark/util.js similarity index 100% rename from src/v0/sources/olark/util.js rename to src/sources/olark/util.js diff --git a/src/v0/sources/ortto/event_mapping.json b/src/sources/ortto/event_mapping.json similarity index 100% rename from src/v0/sources/ortto/event_mapping.json rename to src/sources/ortto/event_mapping.json diff --git a/src/v0/sources/ortto/mapping.json b/src/sources/ortto/mapping.json similarity index 100% rename from src/v0/sources/ortto/mapping.json rename to src/sources/ortto/mapping.json diff --git a/src/v0/sources/ortto/transform.js b/src/sources/ortto/transform.js similarity index 91% rename from src/v0/sources/ortto/transform.js rename to src/sources/ortto/transform.js index b40163f567b..bb719cf6e5e 100644 --- a/src/v0/sources/ortto/transform.js +++ b/src/sources/ortto/transform.js @@ -1,9 +1,14 @@ const path = require('path'); const fs = require('fs'); -const { flattenJson, removeUndefinedAndNullValues, generateUUID } = require('../../util'); +const { + flattenJson, + removeUndefinedAndNullValues, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); const eventMapping = require('./event_mapping.json'); -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -43,7 +48,8 @@ function settingProperties(event, message) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); let message = new Message(`ortto`); // Here, we are checking for the test event to discard them diff --git a/src/v0/sources/pagerduty/data/eventMapping.json b/src/sources/pagerduty/data/eventMapping.json similarity index 100% rename from src/v0/sources/pagerduty/data/eventMapping.json rename to src/sources/pagerduty/data/eventMapping.json diff --git a/src/v0/sources/pagerduty/data/trackMapping.json b/src/sources/pagerduty/data/trackMapping.json similarity index 100% rename from src/v0/sources/pagerduty/data/trackMapping.json rename to src/sources/pagerduty/data/trackMapping.json diff --git a/src/v0/sources/pagerduty/transform.js b/src/sources/pagerduty/transform.js similarity index 84% rename from src/v0/sources/pagerduty/transform.js rename to src/sources/pagerduty/transform.js index 19c52b21ba3..51b64b31440 100644 --- a/src/v0/sources/pagerduty/transform.js +++ b/src/sources/pagerduty/transform.js @@ -1,5 +1,5 @@ const Message = require('../message'); -const { generateUUID } = require('../../util'); +const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); const trackMapping = require('./data/trackMapping.json'); const eventNameMap = require('./data/eventMapping.json'); @@ -25,8 +25,8 @@ const prepareTrackPayload = (event) => { return message; }; -function process(event) { - const { event: processEvent } = event; +function process(payload) { + const { event: processEvent } = getBodyFromV2SpecPayload(payload); return prepareTrackPayload(processEvent); } diff --git a/src/v0/sources/pipedream/config.js b/src/sources/pipedream/config.js similarity index 100% rename from src/v0/sources/pipedream/config.js rename to src/sources/pipedream/config.js diff --git a/src/v0/sources/pipedream/transform.js b/src/sources/pipedream/transform.js similarity index 80% rename from src/v0/sources/pipedream/transform.js rename to src/sources/pipedream/transform.js index 744ffd4649c..3ef788abc26 100644 --- a/src/v0/sources/pipedream/transform.js +++ b/src/sources/pipedream/transform.js @@ -1,5 +1,5 @@ const Message = require('../message'); -const { generateUUID } = require('../../util'); +const { generateUUID, getBodyFromV2SpecPayload } = require('../../v0/util'); const { callTypes } = require('./config'); const { findUserIdOrAnonymousId } = require('./util'); @@ -11,7 +11,8 @@ const buildTrackPayload = (event) => { return message; }; -const process = (event) => { +const process = (payload) => { + const event = getBodyFromV2SpecPayload(payload); const id = findUserIdOrAnonymousId(event); if (event?.type && callTypes.includes(event.type.toLowerCase()) && id) { return event; diff --git a/src/v0/sources/pipedream/util.js b/src/sources/pipedream/util.js similarity index 100% rename from src/v0/sources/pipedream/util.js rename to src/sources/pipedream/util.js diff --git a/src/v0/sources/refiner/groupMapping.json b/src/sources/refiner/groupMapping.json similarity index 100% rename from src/v0/sources/refiner/groupMapping.json rename to src/sources/refiner/groupMapping.json diff --git a/src/v0/sources/refiner/identifyMapping.json b/src/sources/refiner/identifyMapping.json similarity index 100% rename from src/v0/sources/refiner/identifyMapping.json rename to src/sources/refiner/identifyMapping.json diff --git a/src/v0/sources/refiner/trackMapping.json b/src/sources/refiner/trackMapping.json similarity index 100% rename from src/v0/sources/refiner/trackMapping.json rename to src/sources/refiner/trackMapping.json diff --git a/src/v0/sources/refiner/transform.js b/src/sources/refiner/transform.js similarity index 83% rename from src/v0/sources/refiner/transform.js rename to src/sources/refiner/transform.js index b9982ef1d83..447ff14217f 100644 --- a/src/v0/sources/refiner/transform.js +++ b/src/sources/refiner/transform.js @@ -1,7 +1,7 @@ const path = require('path'); const fs = require('fs'); const Message = require('../message'); -const { removeUndefinedAndNullValues } = require('../../util'); +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); // import mapping json using JSON.parse to preserve object key order const identifyMapping = JSON.parse( @@ -40,18 +40,19 @@ const prepareGroupPayload = (event) => { return message; }; -function process(event) { - const payload = []; +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); + const resultPayload = []; const identifyPayload = prepareIdentifyaPayload(event); const trackPayload = prepareTrackPayload(event); const groupPayload = prepareGroupPayload(event); - payload.push(identifyPayload, trackPayload); + resultPayload.push(identifyPayload, trackPayload); if (groupPayload.groupId) { - payload.push(groupPayload); + resultPayload.push(groupPayload); } - return payload; + return resultPayload; } module.exports = { process }; diff --git a/src/v0/sources/revenuecat/mapping.json b/src/sources/revenuecat/mapping.json similarity index 100% rename from src/v0/sources/revenuecat/mapping.json rename to src/sources/revenuecat/mapping.json diff --git a/src/v0/sources/revenuecat/transform.js b/src/sources/revenuecat/transform.js similarity index 88% rename from src/v0/sources/revenuecat/transform.js rename to src/sources/revenuecat/transform.js index c746f13b1a8..e9967ae4992 100644 --- a/src/v0/sources/revenuecat/transform.js +++ b/src/sources/revenuecat/transform.js @@ -1,11 +1,17 @@ const { camelCase } = require('lodash'); const moment = require('moment'); const { isDefinedAndNotNullAndNotEmpty } = require('@rudderstack/integrations-lib'); -const { removeUndefinedAndNullValues, isDefinedAndNotNull, generateUUID } = require('../../util'); +const { + removeUndefinedAndNullValues, + isDefinedAndNotNull, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const message = new Message(`RevenueCat`); // we are setting event type as track always diff --git a/src/v0/sources/satismeter/data/trackMapping.json b/src/sources/satismeter/data/trackMapping.json similarity index 100% rename from src/v0/sources/satismeter/data/trackMapping.json rename to src/sources/satismeter/data/trackMapping.json diff --git a/src/v0/sources/satismeter/transform.js b/src/sources/satismeter/transform.js similarity index 83% rename from src/v0/sources/satismeter/transform.js rename to src/sources/satismeter/transform.js index 162b4f461c4..b8c08529195 100644 --- a/src/v0/sources/satismeter/transform.js +++ b/src/sources/satismeter/transform.js @@ -1,5 +1,5 @@ const Message = require('../message'); -const { refinePayload } = require('../../util'); +const { refinePayload, getBodyFromV2SpecPayload } = require('../../v0/util'); const trackMapping = require('./data/trackMapping.json'); const buildTrackPayload = (event) => { @@ -19,7 +19,8 @@ const processEvent = (event) => { return message; }; -const process = (event) => { +const process = (payload) => { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); const refinedResponse = refinePayload(response); return refinedResponse; diff --git a/src/sources/segment/transform.js b/src/sources/segment/transform.js new file mode 100644 index 00000000000..8db0e0921c0 --- /dev/null +++ b/src/sources/segment/transform.js @@ -0,0 +1,8 @@ +const { getBodyFromV2SpecPayload } = require('../../v0/util'); + +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); + return event; +} + +exports.process = process; diff --git a/src/v0/sources/signl4/mapping.json b/src/sources/signl4/mapping.json similarity index 100% rename from src/v0/sources/signl4/mapping.json rename to src/sources/signl4/mapping.json diff --git a/src/v0/sources/signl4/transform.js b/src/sources/signl4/transform.js similarity index 90% rename from src/v0/sources/signl4/transform.js rename to src/sources/signl4/transform.js index f569786099a..3c34859db7e 100644 --- a/src/v0/sources/signl4/transform.js +++ b/src/sources/signl4/transform.js @@ -1,8 +1,13 @@ const path = require('path'); const fs = require('fs'); -const { flattenJson, removeUndefinedAndNullValues, generateUUID } = require('../../util'); +const { + flattenJson, + removeUndefinedAndNullValues, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); const Message = require('../message'); -const { JSON_MIME_TYPE } = require('../../util/constant'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); @@ -24,7 +29,8 @@ function settingProperties(event, message) { return message; } -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); let message = new Message(`Signl4`); // Here, we are checking for the test event to discard them diff --git a/src/v0/sources/slack/mapping.json b/src/sources/slack/mapping.json similarity index 100% rename from src/v0/sources/slack/mapping.json rename to src/sources/slack/mapping.json diff --git a/src/v0/sources/slack/transform.js b/src/sources/slack/transform.js similarity index 93% rename from src/v0/sources/slack/transform.js rename to src/sources/slack/transform.js index 98324a7b650..e51e897078a 100644 --- a/src/v0/sources/slack/transform.js +++ b/src/sources/slack/transform.js @@ -2,9 +2,13 @@ const sha256 = require('sha256'); const { TransformationError } = require('@rudderstack/integrations-lib'); const Message = require('../message'); const { mapping, tsToISODate, normalizeEventName } = require('./util'); -const { generateUUID, removeUndefinedAndNullValues } = require('../../util'); -const { JSON_MIME_TYPE } = require('../../util/constant'); -const { EventType } = require('../../../constants'); +const { + generateUUID, + removeUndefinedAndNullValues, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); +const { JSON_MIME_TYPE } = require('../../v0/util/constant'); +const { EventType } = require('../../constants'); /** * Transform event data to RudderStack supported standard event schema @@ -100,7 +104,8 @@ function isWebhookUrlVerificationEvent(event) { * Reference - https://api.slack.com/apis/connections/events-api * @param {Object} event */ -function process(event) { +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = isWebhookUrlVerificationEvent(event) ? processUrlVerificationEvent(event) : processNormalEvent(event); diff --git a/src/v0/sources/slack/util.js b/src/sources/slack/util.js similarity index 100% rename from src/v0/sources/slack/util.js rename to src/sources/slack/util.js diff --git a/src/v0/sources/slack/util.test.js b/src/sources/slack/util.test.js similarity index 100% rename from src/v0/sources/slack/util.test.js rename to src/sources/slack/util.test.js diff --git a/src/v1/sources/webhook/transform.js b/src/sources/webhook/transform.js similarity index 61% rename from src/v1/sources/webhook/transform.js rename to src/sources/webhook/transform.js index fc13424b8a4..7d237bf24e6 100644 --- a/src/v1/sources/webhook/transform.js +++ b/src/sources/webhook/transform.js @@ -1,4 +1,8 @@ -const { removeUndefinedAndNullValues, generateUUID } = require('../../../v0/util'); +const { + removeUndefinedAndNullValues, + generateUUID, + getBodyFromV2SpecPayload, +} = require('../../v0/util'); function processEvent(event) { const payload = { @@ -10,8 +14,8 @@ function processEvent(event) { return payload; } -function process(inputEvent) { - const { event } = inputEvent; +function process(payload) { + const event = getBodyFromV2SpecPayload(payload); const response = processEvent(event); return removeUndefinedAndNullValues(response); } diff --git a/src/v0/sources/message.js b/src/v0/sources/message.js deleted file mode 100644 index aa7fd48dd4a..00000000000 --- a/src/v0/sources/message.js +++ /dev/null @@ -1,86 +0,0 @@ -const set = require('set-value'); -const get = require('get-value'); - -const { getValueFromMessage } = require('../util'); - -const context = (integration) => ({ - library: { - name: 'unknown', - version: 'unknown', - }, - integration: { - name: integration, - }, -}); - -class Message { - constructor(integration) { - this.context = context(integration); - this.integrations = { - [integration]: false, - }; - } - - setEventName(name) { - this.event = name; - } - - setEventType(type) { - this.type = type; - } - - setProperty(name, value) { - set(this, name, value); - } - - setProperties(event, mapping) { - Object.keys(mapping).forEach((key) => { - const setVal = get(event, key); - let destKeys = mapping[key]; - if (!Array.isArray(destKeys)) { - destKeys = [destKeys]; - } - destKeys.forEach((destKey) => { - const existingVal = get(this, destKey); - // do not set if val setVal nil - // give higher pref to first key in mapping.json in case of same value - if ( - setVal !== null && - setVal !== undefined && - (existingVal === null || existingVal === undefined) - ) { - set(this, destKey, setVal); - } - }); - }); - } - - setPropertiesV2(event, mappingJson) { - mappingJson.forEach((mapping) => { - const { sourceKeys } = mapping; - let { destKeys } = mapping; - const setVal = getValueFromMessage(event, sourceKeys); - if (!Array.isArray(destKeys)) { - destKeys = [destKeys]; - } - destKeys.forEach((destKey) => { - const existingVal = get(this, destKey); - // do not set if val setVal nil - // give higher pref to first key in mapping.json in case of same value - if ( - setVal !== null && - setVal !== undefined && - (existingVal === null || existingVal === undefined) - ) { - set(this, destKey, setVal); - } - }); - }); - } - - setTimestamp(timestamp) { - this.timestamp = timestamp; - } -} - -module.exports = Message; diff --git a/src/v0/sources/moengage/transform.js b/src/v0/sources/moengage/transform.js deleted file mode 100644 index e5b3c92bfea..00000000000 --- a/src/v0/sources/moengage/transform.js +++ /dev/null @@ -1,8 +0,0 @@ -function process(events) { - if (events.batch) { - return events.batch; - } - return events; -} - -exports.process = process; diff --git a/src/v0/sources/segment/transform.js b/src/v0/sources/segment/transform.js deleted file mode 100644 index 4fd35f6821c..00000000000 --- a/src/v0/sources/segment/transform.js +++ /dev/null @@ -1,5 +0,0 @@ -function process(events) { - return events; -} - -exports.process = process; diff --git a/src/v0/sources/shopify/transform.js b/src/v0/sources/shopify/transform.js index 8cf39dfa5c2..f1cb0aaecbf 100644 --- a/src/v0/sources/shopify/transform.js +++ b/src/v0/sources/shopify/transform.js @@ -16,7 +16,7 @@ const { const logger = require('../../../logger'); const { RedisDB } = require('../../../util/redis/redisConnector'); const { removeUndefinedAndNullValues, isDefinedAndNotNull } = require('../../util'); -const Message = require('../message'); +const Message = require('../../../sources/message'); const { EventType } = require('../../../constants'); const { INTEGERATION, diff --git a/src/v0/util/index.test.js b/src/v0/util/index.test.js index 052b850a288..ba27ee1f703 100644 --- a/src/v0/util/index.test.js +++ b/src/v0/util/index.test.js @@ -3,7 +3,6 @@ const utilities = require('.'); const { getFuncTestData } = require('../../../test/testHelper'); const { FilteredEventsError } = require('./errorTypes'); const { v5 } = require('uuid'); -const { ERROR_MESSAGES } = require('./constant'); const { hasCircularReference, flattenJson, @@ -16,6 +15,7 @@ const { convertToUuid, } = require('./index'); const exp = require('constants'); +const { ERROR_MESSAGES } = require('./constant'); // Names of the utility functions to test const functionNames = [ diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js index 6d893a0c040..f38ce1a96e0 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideTransform.js @@ -3,7 +3,7 @@ const get = require('get-value'); const stats = require('../../../../util/stats'); const { getShopifyTopic } = require('../../../../v0/sources/shopify/util'); const { removeUndefinedAndNullValues } = require('../../../../v0/util'); -const Message = require('../../../../v0/sources/message'); +const Message = require('../../../../sources/message'); const { EventType } = require('../../../../constants'); const { INTEGERATION, diff --git a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js index ad0902bbee5..eb36e8d2803 100644 --- a/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js +++ b/src/v1/sources/shopify/webhookTransformations/serverSideUtils.test.js @@ -11,9 +11,9 @@ const { RedisDB } = require('../../../../util/redis/redisConnector'); const stats = require('../../../../util/stats'); const { lineItemsMappingJSON } = require('../../../../v0/sources/shopify/config'); -const Message = require('../../../../v0/sources/message'); +const Message = require('../../../../sources/message'); const { property } = require('lodash'); -jest.mock('../../../../v0/sources/message'); +jest.mock('../../../../sources/message'); jest.mock('../../../../util/stats', () => ({ increment: jest.fn(), })); diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js index 388be2a16e8..40f81a93b9c 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.js @@ -1,6 +1,6 @@ /* eslint-disable no-param-reassign */ const { isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); -const Message = require('../../../../v0/sources/message'); +const Message = require('../../../../sources/message'); const { EventType } = require('../../../../constants'); const { INTEGERATION, diff --git a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js index fc82404ee73..fcd8888d834 100644 --- a/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js +++ b/src/v1/sources/shopify/webpixelTransformations/pixelUtils.test.js @@ -10,9 +10,9 @@ const { extractCampaignParams, } = require('./pixelUtils'); const campaignObjectMappings = require('../pixelEventsMappings/campaignObjectMappings.json'); -const Message = require('../../../../v0/sources/message'); +const Message = require('../../../../sources/message'); jest.mock('ioredis', () => require('../../../../test/__mocks__/redis')); -jest.mock('../../../../v0/sources/message'); +jest.mock('../../../../sources/message'); describe('utilV2.js', () => { beforeEach(() => { diff --git a/test/apitests/data_scenarios/source/v2/response_to_caller.json b/test/apitests/data_scenarios/source/v2/response_to_caller.json new file mode 100644 index 00000000000..c2f992e524e --- /dev/null +++ b/test/apitests/data_scenarios/source/v2/response_to_caller.json @@ -0,0 +1,18 @@ +{ + "input": [ + { + "request": { + "body": "{\"challenge\": \"some_key\"}" + } + } + ], + "output": [ + { + "outputToSource": { + "body": "eyJjaGFsbGVuZ2UiOiJzb21lX2tleSJ9", + "contentType": "application/json" + }, + "statusCode": 200 + } + ] +} diff --git a/test/apitests/service.api.test.ts b/test/apitests/service.api.test.ts index d69d568355d..082bc3fbefc 100644 --- a/test/apitests/service.api.test.ts +++ b/test/apitests/service.api.test.ts @@ -544,9 +544,9 @@ describe('Destination api tests', () => { describe('Source api tests', () => { test('(shopify) success source transform (monday)', async () => { - const data = getDataFromPath('./data_scenarios/source/v0/response_to_caller.json'); + const data = getDataFromPath('./data_scenarios/source/v2/response_to_caller.json'); const response = await request(server) - .post('/v0/sources/monday') + .post('/v2/sources/monday') .set('Accept', 'application/json') .send(data.input); expect(response.status).toEqual(200); From 65a4707072802fae3e7613f2f99690a472c99644 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 27 Feb 2025 08:22:31 +0000 Subject: [PATCH 119/160] chore(release): 1.91.4 --- CHANGELOG.md | 2 ++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db3d1889969..0d9fb96f6cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ 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.91.4](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.3...v1.91.4) (2025-02-27) + ### [1.91.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.2...v1.91.3) (2025-02-25) ### [1.91.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.1...v1.91.2) (2025-02-24) diff --git a/package-lock.json b/package-lock.json index d2370dc0373..77f98827643 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.91.3", + "version": "1.91.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.91.3", + "version": "1.91.4", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index acb4fd47274..12b82771c57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.91.3", + "version": "1.91.4", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From b991017faffed3479d805a276d53f58469f16699 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Fri, 28 Feb 2025 15:15:20 +0530 Subject: [PATCH 120/160] fix: added missing email check during primary email id filtering in zendesk destination (#4124) --- src/v0/destinations/zendesk/transform.js | 5 +- .../destinations/zendesk/network.ts | 347 ++++++++++++++++++ .../destinations/zendesk/processor/data.ts | 332 +++++++++++++++++ 3 files changed, 683 insertions(+), 1 deletion(-) diff --git a/src/v0/destinations/zendesk/transform.js b/src/v0/destinations/zendesk/transform.js index 792e8df3506..32abb2b8c97 100644 --- a/src/v0/destinations/zendesk/transform.js +++ b/src/v0/destinations/zendesk/transform.js @@ -118,7 +118,10 @@ const payloadBuilderforUpdatingEmail = async ( const { identities } = res.response.data; if (identities && Array.isArray(identities)) { const identitiesDetails = identities.find( - (identitieslist) => identitieslist.primary === true && identitieslist.value !== userEmail, + (identitieslist) => + identitieslist.primary === true && + identitieslist.type === 'email' && + identitieslist.value !== userEmail, ); if (identitiesDetails?.id && userEmail) { return responseBuilderToUpdatePrimaryAccount( diff --git a/test/integrations/destinations/zendesk/network.ts b/test/integrations/destinations/zendesk/network.ts index bc80f0cd0a7..578fddfa8f8 100644 --- a/test/integrations/destinations/zendesk/network.ts +++ b/test/integrations/destinations/zendesk/network.ts @@ -1822,4 +1822,351 @@ export const networkCallsData = [ }, httpRes: { data: { user: {} }, status: 200 }, }, + // network call to get id for userId = test-user-id + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=test-user-id', + }, + httpRes: { + data: { + count: 1, + facets: null, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + created_at: '2022-11-24T09:03:54Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'test1000@email.com', + external_id: 'test-user-id', + iana_time_zone: 'Asia/Kolkata', + id: 911113780483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'name-1000 user', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + result_type: 'user', + role: 'end-user', + role_type: null, + shared: false, + shared_agent: false, + shared_phone_number: null, + signature: null, + suspended: false, + tags: [], + ticket_restriction: 'requested', + time_zone: 'Asia/Kolkata', + two_factor_auth_enabled: false, + updated_at: '2022-11-24T09:03:54Z', + url: 'https://rudderstack6787.zendesk.com/api/v2/users/10865192864273.json', + user_fields: {}, + verified: true, + }, + ], + }, + status: 200, + }, + }, + // network call to get identities for user test-user-id + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/911113780483/identities', + }, + httpRes: { + data: { + count: 2, + identities: [ + { + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/25465855449501.json', + id: 25465855449501, + user_id: 25465855448733, + type: 'phone_number', + value: '+910123456789', + verified: true, + primary: true, + created_at: '2025-02-27T14:14:58Z', + updated_at: '2025-02-27T14:14:58Z', + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: false, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example119@email.com', + verified: false, + }, + { + created_at: '2022-11-02T04:23:46Z', + deliverable_state: 'deliverable', + id: 7534173321117, + primary: true, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7534173321117.json', + user_id: 900113780483, + value: 'example115@email.com', + verified: true, + }, + ], + next_page: null, + previous_page: null, + }, + status: 200, + }, + }, + // network call to get id for user-id = test-user-id-no-primary-email + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=test-user-id-no-primary-email', + }, + httpRes: { + data: { + count: 1, + facets: null, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + created_at: '2022-11-24T09:03:54Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'test1000@email.com', + external_id: 'test-user-id', + iana_time_zone: 'Asia/Kolkata', + id: 911113781483, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'name-1000 user', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + result_type: 'user', + role: 'end-user', + role_type: null, + shared: false, + shared_agent: false, + shared_phone_number: null, + signature: null, + suspended: false, + tags: [], + ticket_restriction: 'requested', + time_zone: 'Asia/Kolkata', + two_factor_auth_enabled: false, + updated_at: '2022-11-24T09:03:54Z', + url: 'https://rudderstack6787.zendesk.com/api/v2/users/10865192864273.json', + user_fields: {}, + verified: true, + }, + ], + }, + status: 200, + }, + }, + // network call to get identities for user test-user-id-no-primary-email + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/911113781483/identities', + }, + httpRes: { + data: { + count: 2, + identities: [ + { + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/25465855449501.json', + id: 25465855449501, + user_id: 25465855448733, + type: 'phone_number', + value: '+910123456789', + verified: true, + primary: true, + created_at: '2025-02-27T14:14:58Z', + updated_at: '2025-02-27T14:14:58Z', + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: false, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example119@email.com', + verified: false, + }, + ], + next_page: null, + previous_page: null, + }, + status: 200, + }, + }, + // network call to get id for user-id = test-user-id-with-same-primary-email + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/search.json?query=test-user-id-with-same-primary-email', + }, + httpRes: { + data: { + count: 1, + facets: null, + next_page: null, + previous_page: null, + users: [ + { + active: true, + alias: null, + created_at: '2022-11-24T09:03:54Z', + custom_role_id: null, + default_group_id: null, + details: null, + email: 'test1000@email.com', + external_id: 'test-user-id', + iana_time_zone: 'Asia/Kolkata', + id: 911113781481, + last_login_at: null, + locale: 'en-US', + locale_id: 1, + moderator: false, + name: 'name-1000 user', + notes: null, + only_private_comments: false, + organization_id: null, + phone: null, + photo: null, + report_csv: false, + restricted_agent: true, + result_type: 'user', + role: 'end-user', + role_type: null, + shared: false, + shared_agent: false, + shared_phone_number: null, + signature: null, + suspended: false, + tags: [], + ticket_restriction: 'requested', + time_zone: 'Asia/Kolkata', + two_factor_auth_enabled: false, + updated_at: '2022-11-24T09:03:54Z', + url: 'https://rudderstack6787.zendesk.com/api/v2/users/10865192864273.json', + user_fields: {}, + verified: true, + }, + ], + }, + status: 200, + }, + }, + // network call to get identities for user test-user-id-with-same-primary-email + { + httpReq: { + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + }, + method: 'GET', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/911113781481/identities', + }, + httpRes: { + data: { + count: 2, + identities: [ + { + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/25465855449501.json', + id: 25465855449501, + user_id: 25465855448733, + type: 'phone_number', + value: '+910123456789', + verified: true, + primary: true, + created_at: '2025-02-27T14:14:58Z', + updated_at: '2025-02-27T14:14:58Z', + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: true, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example@email.com', + verified: false, + }, + { + created_at: '2022-11-02T08:03:28Z', + deliverable_state: 'deliverable', + id: 7535981118877, + primary: false, + type: 'email', + undeliverable_count: 0, + updated_at: '2022-11-02T10:23:28Z', + url: 'https://rudderlabshelp.zendesk.com/api/v2/users/7533979645597/identities/7535981118877.json', + user_id: 900113780483, + value: 'example119@email.com', + verified: false, + }, + ], + next_page: null, + previous_page: null, + }, + status: 200, + }, + }, ]; diff --git a/test/integrations/destinations/zendesk/processor/data.ts b/test/integrations/destinations/zendesk/processor/data.ts index d84cdba15a7..da84f643dc8 100644 --- a/test/integrations/destinations/zendesk/processor/data.ts +++ b/test/integrations/destinations/zendesk/processor/data.ts @@ -2455,4 +2455,336 @@ export const data = [ }, }, }, + { + name: 'zendesk', + description: + 'scenario when searchByExternalId (Update user’s primary email) is true and there are different primary key i.e. phone, email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: 'myDummyApiToken4', + createUsersAsVerified: true, + domain: 'rudderlabshelp', + email: 'myDummyUserName1', + password: 'myDummyPwd1', + removeUsersFromOrganization: true, + sendGroupCallsWithoutUserId: true, + searchByExternalId: true, + }, + DestinationDefinition: { + DisplayName: 'Zendesk', + ID: '1YknZ1ENqB8UurJQJE2VrEA61tr', + Name: 'ZENDESK', + }, + Enabled: true, + ID: 'xxxxxxxxxxxxxxxxxxxxxxxO51P', + Name: 'zendesk', + Transformations: [], + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' }, + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + integrations: { All: true }, + messageId: '0bab70e8-bf2f-449a-a19b-ca6e3bfed9b7', + request_ip: '[::1]:51573', + type: 'identify', + userId: 'test-user-id', + traits: { email: 'example@email.com', name: 'test-user-name' }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + FORM: {}, + JSON: { identity: { type: 'email', value: 'example@email.com' } }, + JSON_ARRAY: {}, + }, + type: 'REST', + files: {}, + method: 'PUT', + params: {}, + headers: { + 'Content-Type': 'application/json', + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-App-Id': '263241', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + }, + version: '1', + endpoint: + 'https://rudderlabshelp.zendesk.com/api/v2/users/911113780483/identities/7534173321117', + userId: '', + }, + statusCode: 200, + }, + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + 'X-Zendesk-Marketplace-App-Id': '263241', + }, + params: {}, + body: { + JSON: { + user: { + email: 'example@email.com', + name: 'test-user-name', + external_id: 'test-user-id', + user_fields: { id: 'test-user-id' }, + verified: true, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'zendesk', + description: + 'scenario when searchByExternalId (Update user’s primary email) is true and there are no primary email', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: 'myDummyApiToken4', + createUsersAsVerified: true, + domain: 'rudderlabshelp', + email: 'myDummyUserName1', + password: 'myDummyPwd1', + removeUsersFromOrganization: true, + sendGroupCallsWithoutUserId: true, + searchByExternalId: true, + }, + DestinationDefinition: { + DisplayName: 'Zendesk', + ID: '1YknZ1ENqB8UurJQJE2VrEA61tr', + Name: 'ZENDESK', + }, + Enabled: true, + ID: 'xxxxxxxxxxxxxxxxxxxxxxxO51P', + Name: 'zendesk', + Transformations: [], + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' }, + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + integrations: { All: true }, + messageId: '0bab70e8-bf2f-449a-a19b-ca6e3bfed9b7', + request_ip: '[::1]:51573', + type: 'identify', + userId: 'test-user-id-no-primary-email', + traits: { email: 'example@email.com', name: 'test-user-name' }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + 'X-Zendesk-Marketplace-App-Id': '263241', + }, + params: {}, + body: { + JSON: { + user: { + email: 'example@email.com', + name: 'test-user-name', + external_id: 'test-user-id-no-primary-email', + user_fields: { id: 'test-user-id-no-primary-email' }, + verified: true, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'zendesk', + description: + 'scenario when searchByExternalId (Update user’s primary email) is true and primary email is same', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + destination: { + Config: { + apiToken: 'myDummyApiToken4', + createUsersAsVerified: true, + domain: 'rudderlabshelp', + email: 'myDummyUserName1', + password: 'myDummyPwd1', + removeUsersFromOrganization: true, + sendGroupCallsWithoutUserId: true, + searchByExternalId: true, + }, + DestinationDefinition: { + DisplayName: 'Zendesk', + ID: '1YknZ1ENqB8UurJQJE2VrEA61tr', + Name: 'ZENDESK', + }, + Enabled: true, + ID: 'xxxxxxxxxxxxxxxxxxxxxxxO51P', + Name: 'zendesk', + Transformations: [], + }, + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.0-beta.2', + }, + ip: '0.0.0.0', + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' }, + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36', + }, + integrations: { All: true }, + messageId: '0bab70e8-bf2f-449a-a19b-ca6e3bfed9b7', + request_ip: '[::1]:51573', + type: 'identify', + userId: 'test-user-id-with-same-primary-email', + traits: { email: 'example@email.com', name: 'test-user-name' }, + }, + }, + ], + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', + headers: { + Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + 'Content-Type': 'application/json', + 'X-Zendesk-Marketplace-Name': 'RudderStack', + 'X-Zendesk-Marketplace-Organization-Id': '3339', + 'X-Zendesk-Marketplace-App-Id': '263241', + }, + params: {}, + body: { + JSON: { + user: { + email: 'example@email.com', + name: 'test-user-name', + external_id: 'test-user-id-with-same-primary-email', + user_fields: { id: 'test-user-id-with-same-primary-email' }, + verified: true, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, ]; From f7ed9a434299b750095642b0030323bc72f1341c Mon Sep 17 00:00:00 2001 From: Alexandros Milaios Date: Fri, 28 Feb 2025 12:46:50 +0200 Subject: [PATCH 121/160] fix: add module in the search url path for zoho (#4126) --- .../v2/destinations/zoho/transformRecord.js | 12 +- src/cdk/v2/destinations/zoho/utils.js | 10 +- src/cdk/v2/destinations/zoho/utils.test.js | 14 +- test/integrations/destinations/zoho/common.ts | 89 ++++++++ .../integrations/destinations/zoho/network.ts | 96 +++++++++ .../destinations/zoho/router/deletion.ts | 190 ++++++++++++++++++ 6 files changed, 402 insertions(+), 9 deletions(-) diff --git a/src/cdk/v2/destinations/zoho/transformRecord.js b/src/cdk/v2/destinations/zoho/transformRecord.js index c497d2e3063..952c38d6113 100644 --- a/src/cdk/v2/destinations/zoho/transformRecord.js +++ b/src/cdk/v2/destinations/zoho/transformRecord.js @@ -200,10 +200,11 @@ const handleDeletion = async ( input, fields, Config, + operationModuleType, transformedResponseToBeBatched, errorResponseList, ) => { - const searchResponse = await searchRecordId(fields, input.metadata, Config); + const searchResponse = await searchRecordId(fields, input.metadata, Config, operationModuleType); if (searchResponse.erroneous) { const error = handleSearchError(searchResponse); @@ -251,7 +252,14 @@ const processInput = async ( errorResponseList, ); } else { - await handleDeletion(input, fields, Config, transformedResponseToBeBatched, errorResponseList); + await handleDeletion( + input, + fields, + Config, + operationModuleType, + transformedResponseToBeBatched, + errorResponseList, + ); } }; diff --git a/src/cdk/v2/destinations/zoho/utils.js b/src/cdk/v2/destinations/zoho/utils.js index 8955bf33ad0..e6623f0abe4 100644 --- a/src/cdk/v2/destinations/zoho/utils.js +++ b/src/cdk/v2/destinations/zoho/utils.js @@ -133,7 +133,7 @@ function escapeAndEncode(value) { return encodeURIComponent(value.replace(/([(),\\])/g, '\\$1')); } -function transformToURLParams(fields, Config) { +function transformToURLParams(fields, Config, operationModuleType) { const criteria = Object.entries(fields) .map(([key, value]) => `(${key}:equals:${escapeAndEncode(value)})`) .join('and'); @@ -141,7 +141,7 @@ function transformToURLParams(fields, Config) { const dataCenter = Config.region; const regionBasedEndPoint = zohoConfig.DATA_CENTRE_BASE_ENDPOINTS_MAP[dataCenter]; - return `${regionBasedEndPoint}/crm/v6/Leads/search?criteria=${criteria}`; + return `${regionBasedEndPoint}/crm/v6/${operationModuleType}/search?criteria=${criteria}`; } function transformToURLParamsV2(fields, Config, object) { @@ -155,9 +155,9 @@ function transformToURLParamsV2(fields, Config, object) { return `${regionBasedEndPoint}/crm/v6/${object}/search?criteria=${criteria}`; } -const searchRecordId = async (fields, metadata, Config) => { +const searchRecordId = async (fields, metadata, Config, operationModuleType) => { try { - const searchURL = transformToURLParams(fields, Config); + const searchURL = transformToURLParams(fields, Config, operationModuleType); const searchResult = await handleHttpRequest( 'get', searchURL, @@ -170,7 +170,7 @@ const searchRecordId = async (fields, metadata, Config) => { destType: 'zoho', feature: 'deleteRecords', requestMethod: 'GET', - endpointPath: 'crm/v6/Leads/search?criteria=', + endpointPath: `crm/v6/${operationModuleType}/search?criteria=`, module: 'router', }, ); diff --git a/src/cdk/v2/destinations/zoho/utils.test.js b/src/cdk/v2/destinations/zoho/utils.test.js index b2e165b77fe..edc45c6426a 100644 --- a/src/cdk/v2/destinations/zoho/utils.test.js +++ b/src/cdk/v2/destinations/zoho/utils.test.js @@ -157,18 +157,28 @@ describe('formatMultiSelectFieldsV2', () => { describe('transformToURLParams', () => { const testCases = [ { - name: 'should build a proper URL with encoded criteria based on fields and config', + name: 'should build a proper URL with encoded criteria based on fields and config for Leads module', input: { fields: { First_Name: 'John, Doe', Age: '30' }, config: { region: 'US' }, + object: 'Leads', }, expected: `https://www.zohoapis.com/crm/v6/Leads/search?criteria=(First_Name:equals:John%5C%2C%20Doe)and(Age:equals:30)`, }, + { + name: 'should build a proper URL with encoded criteria based on fields and config for Contacts module', + input: { + fields: { First_Name: 'John, Doe', Age: '30' }, + config: { region: 'US' }, + object: 'Contacts', + }, + expected: `https://www.zohoapis.com/crm/v6/Contacts/search?criteria=(First_Name:equals:John%5C%2C%20Doe)and(Age:equals:30)`, + }, ]; testCases.forEach(({ name, input, expected }) => { it(name, () => { - const url = transformToURLParams(input.fields, input.config); + const url = transformToURLParams(input.fields, input.config, input.object); expect(url).toEqual(expected); }); }); diff --git a/test/integrations/destinations/zoho/common.ts b/test/integrations/destinations/zoho/common.ts index 62f6c4eead3..17c8e1b442c 100644 --- a/test/integrations/destinations/zoho/common.ts +++ b/test/integrations/destinations/zoho/common.ts @@ -34,6 +34,33 @@ const deletionPayload1 = { type: 'record', }; +const deletionPayload2 = { + action: 'delete', + context: { + externalId: [ + { + type: 'ZOHO-Contacts', + identifierType: 'email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: 'tobedeleted@gmail.com', + First_Name: 'subcribed', + Last_Name: ' User', + }, + type: 'record', +}; + const deletionPayload1V2 = { action: 'delete', context: { @@ -90,6 +117,40 @@ const commonDeletionDestConfig: Destination = { }, }; +const commonDeletionDestConfig2: Destination = { + ID: '345', + Name: 'Test', + Enabled: true, + WorkspaceID: '', + Transformations: [], + DestinationDefinition: { + ID: '345', + Name: 'Test', + DisplayName: 'ZOHO', + Config: { + cdkV2Enabled: true, + excludeKeys: [], + includeKeys: [], + }, + }, + Config: { + region: 'IN', + module: 'Contacts', + trigger: 'None', + addDefaultDuplicateCheck: true, + multiSelectFieldLevelDecision: [ + { + from: 'multi-language', + to: 'true', + }, + { + from: 'multi class', + to: 'false', + }, + ], + }, +}; + const commonDeletionConnectionConfigV2: Connection = { sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', @@ -499,6 +560,31 @@ const commonConnectionConfigV2_3: Connection = { }, }; +const commonConnectionConfigV2_4: Connection = { + sourceId: '2t1wMHLftBHKN1XzcfU4v7JTQTg', + destinationId: '2tCmPNvYHqCUgcRva2XN52ZaYHk', + enabled: true, + processorEnabled: true, + config: { + destination: { + object: 'Contacts', + trigger: 'None', + schemaVersion: '1.1', + addDefaultDuplicateCheck: true, + identifierMappings: [ + { + from: 'email', + to: 'email', + }, + ], + multiSelectFieldLevelDecision: [ + { from: 'multi-language', to: 'true' }, + { from: 'multi class', to: 'false' }, + ], + }, + }, +}; + export { destType, destTypeInUpperCase, @@ -507,8 +593,10 @@ export { segmentName, leadUpsertEndpoint, deletionPayload1, + deletionPayload2, deletionPayload1V2, commonDeletionDestConfig, + commonDeletionDestConfig2, upsertPayload1, upsertPayload1V2, upsertPayload2, @@ -523,6 +611,7 @@ export { commonConnectionConfigV2, commonConnectionConfigV2_2, commonConnectionConfigV2_3, + commonConnectionConfigV2_4, commonConnectionConfigCustomModuleV2, commonDeletionConnectionConfigV2, }; diff --git a/test/integrations/destinations/zoho/network.ts b/test/integrations/destinations/zoho/network.ts index 5614726fc08..dc4adc8b9f3 100644 --- a/test/integrations/destinations/zoho/network.ts +++ b/test/integrations/destinations/zoho/network.ts @@ -418,6 +418,102 @@ export const networkCallsData = [ statusText: 'OK', }, }, + { + httpReq: { + url: 'https://www.zohoapis.in/crm/v6/Contacts/search?criteria=(Email:equals:tobedeleted2%40gmail.com)and(First_Name:equals:subcribed2)and(Last_Name:equals:%20User2)', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + method: 'GET', + }, + httpRes: { + data: { + data: [ + { + Owner: { + name: 'dummy-user', + id: '724445000000323001', + email: 'dummy@gmail.com', + }, + Company: null, + Email: 'tobedeleted2@gmail.com', + $currency_symbol: '$', + $field_states: null, + $sharing_permission: 'full_access', + Last_Activity_Time: '2024-07-18T23:55:42+05:30', + Industry: null, + Unsubscribed_Mode: null, + $process_flow: false, + Street: null, + Zip_Code: null, + id: '', + $approval: { + delegate: false, + approve: false, + reject: false, + resubmit: false, + }, + Created_Time: '2024-07-18T19:34:50+05:30', + $editable: true, + City: null, + No_of_Employees: null, + Converted_Account: null, + State: null, + Country: null, + Created_By: { + name: 'dummy-user', + id: '724445000000323001', + email: 'dummy@gmail.com', + }, + $zia_owner_assignment: 'owner_recommendation_unavailable', + Annual_Revenue: null, + Secondary_Email: null, + Description: null, + Rating: null, + $review_process: { + approve: false, + reject: false, + resubmit: false, + }, + Website: null, + Twitter: null, + Salutation: null, + First_Name: 'subcribed2', + Full_Name: 'subcribed2 User', + Lead_Status: null, + Record_Image: null, + Modified_By: { + name: 'dummy-user', + id: '724445000000323001', + email: 'dummy@gmail.com', + }, + Converted_Deal: null, + $review: null, + Lead_Conversion_Time: null, + Skype_ID: null, + Phone: null, + Email_Opt_Out: false, + $zia_visions: null, + Designation: null, + Modified_Time: '2024-07-18T23:55:42+05:30', + $converted_detail: {}, + Unsubscribed_Time: null, + Converted_Contact: null, + Mobile: null, + $orchestration: null, + Last_Name: 'User2', + $in_merge: false, + Lead_Source: null, + Fax: null, + $approval_state: 'approved', + $pathfinder: null, + }, + ], + }, + status: 200, + statusText: 'OK', + }, + }, { httpReq: { url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted3%40gmail.com)and(First_Name:equals:subcribed3)and(Last_Name:equals:User3)', diff --git a/test/integrations/destinations/zoho/router/deletion.ts b/test/integrations/destinations/zoho/router/deletion.ts index aae91084f9f..549fcb3db7f 100644 --- a/test/integrations/destinations/zoho/router/deletion.ts +++ b/test/integrations/destinations/zoho/router/deletion.ts @@ -1,9 +1,11 @@ import { defaultMockFns } from '../mocks'; import { commonDeletionDestConfig, + commonDeletionDestConfig2, deletionPayload1, deletionPayload1V2, commonDeletionConnectionConfigV2, + commonConnectionConfigV2_4, destType, } from '../common'; @@ -122,6 +124,194 @@ export const deleteData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + id: 'zoho_deletion_1', + description: 'Happy flow record deletion with Contacts module', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + externalId: [ + { + type: 'ZOHO-Contacts', + identifierType: 'email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: 'tobedeleted2@gmail.com', + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: + 'https://www.zohoapis.in/crm/v6/Contacts?ids=&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig2, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_1', + description: 'Happy flow record deletion with Contacts module V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + identifiers: { + Email: 'tobedeleted2@gmail.com', + }, + fields: { + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig2, + connection: commonConnectionConfigV2_4, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: + 'https://www.zohoapis.in/crm/v6/Contacts?ids=&wf_trigger=false', + headers: { + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + params: {}, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: true, + statusCode: 200, + destination: commonDeletionDestConfig2, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, { name: destType, id: 'zoho_deletion_1_v2', From 94611c942afca4b17f4dd60024172ce4bc599563 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 28 Feb 2025 19:14:22 +0530 Subject: [PATCH 122/160] fix: mailjet handling of v2 spec --- src/sources/mailjet/transform.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sources/mailjet/transform.js b/src/sources/mailjet/transform.js index 1c18efdb4a0..e115b8a0253 100644 --- a/src/sources/mailjet/transform.js +++ b/src/sources/mailjet/transform.js @@ -9,8 +9,7 @@ const { getBodyFromV2SpecPayload } = require('../../v0/util'); // import mapping json using JSON.parse to preserve object key order const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8')); -const processEvent = (payload) => { - const event = getBodyFromV2SpecPayload(payload); +const processEvent = (event) => { const message = new Message(`MailJet`); // event type is always track const eventType = 'track'; @@ -48,7 +47,8 @@ const processEvent = (payload) => { }; // This fucntion just converts the incoming payload to array of already not and sends it to processEvent -const process = (events) => { +const process = (payload) => { + const events = getBodyFromV2SpecPayload(payload); const eventsArray = CommonUtils.toArray(events); return eventsArray.map(processEvent); }; From b19a6afd1a81bedf432088dbdd5f7b799fea5277 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 28 Feb 2025 13:50:38 +0000 Subject: [PATCH 123/160] chore(release): 1.91.5 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d9fb96f6cd..22290db9416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.91.5](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.4...v1.91.5) (2025-02-28) + + +### Bug Fixes + +* mailjet handling of v2 spec ([94611c9](https://github.com/rudderlabs/rudder-transformer/commit/94611c942afca4b17f4dd60024172ce4bc599563)) + ### [1.91.4](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.3...v1.91.4) (2025-02-27) ### [1.91.3](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.2...v1.91.3) (2025-02-25) diff --git a/package-lock.json b/package-lock.json index 77f98827643..180acaa10bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.91.4", + "version": "1.91.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.91.4", + "version": "1.91.5", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 12b82771c57..7c21d81c9a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.91.4", + "version": "1.91.5", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 4cc1223231562d8eac1c4bb9243bd9c0bd764b87 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Fri, 28 Feb 2025 19:31:06 +0530 Subject: [PATCH 124/160] fix: mailjet test case modifications --- test/integrations/sources/mailjet/data.ts | 69 ++++++++++------------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/test/integrations/sources/mailjet/data.ts b/test/integrations/sources/mailjet/data.ts index cc66aedbd94..2654edb8055 100644 --- a/test/integrations/sources/mailjet/data.ts +++ b/test/integrations/sources/mailjet/data.ts @@ -332,39 +332,36 @@ export const data = [ body: [ { request: { - body: JSON.stringify({ - event: 'open', - time: 1704458040, - MessageID: 987654, - Message_GUID: '876r-oihugyf-7tfygh', - email: 'abc@r.com', - mj_campaign_id: 321, - mj_contact_id: 123, - customcampaign: 'test_campaign', - url: 'https://www.example.com/', - ip: 'ip_info', - geo: 'some geo info', - agent: 'mailjet api test', - }), - }, - source: {}, - }, - { - request: { - body: JSON.stringify({ - event: 'click', - time: 1704458041, - MessageID: 12345234567, - Message_GUID: '12345-kjhgfd-2efv', - email: 'abc@r.com', - mj_campaign_id: 12, - mj_contact_id: 32532, - customcampaign: 'test_campaign', - url: 'https://www.example.com/', - ip: 'ip_info', - geo: 'some geo info', - agent: 'mailjet api test', - }), + body: JSON.stringify([ + { + event: 'open', + time: 1704458040, + MessageID: 987654, + Message_GUID: '876r-oihugyf-7tfygh', + email: 'abc@r.com', + mj_campaign_id: 321, + mj_contact_id: 123, + customcampaign: 'test_campaign', + url: 'https://www.example.com/', + ip: 'ip_info', + geo: 'some geo info', + agent: 'mailjet api test', + }, + { + event: 'click', + time: 1704458041, + MessageID: 12345234567, + Message_GUID: '12345-kjhgfd-2efv', + email: 'abc@r.com', + mj_campaign_id: 12, + mj_contact_id: 32532, + customcampaign: 'test_campaign', + url: 'https://www.example.com/', + ip: 'ip_info', + geo: 'some geo info', + agent: 'mailjet api test', + }, + ]), }, source: {}, }, @@ -403,12 +400,6 @@ export const data = [ userId: '593a5aff0b445b3b77a6d9676b7ec86e', originalTimestamp: '2024-01-05T12:34:00.000Z', }, - ], - }, - }, - { - output: { - batch: [ { context: { library: { name: 'unknown', version: 'unknown' }, From 2943b3d77f177d6b93fb5231eead81f9f05accb9 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Mon, 3 Mar 2025 10:33:39 +0530 Subject: [PATCH 125/160] feat: remove consent from db-config and add store sales to integrations object (#4091) --- .../transform.js | 9 +- .../utils.js | 18 +- .../utils.test.js | 30 +-- .../processor/data.ts | 201 ++++-------------- 4 files changed, 62 insertions(+), 196 deletions(-) diff --git a/src/v0/destinations/google_adwords_offline_conversions/transform.js b/src/v0/destinations/google_adwords_offline_conversions/transform.js index 76b12587cdc..bef7af00017 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/transform.js +++ b/src/v0/destinations/google_adwords_offline_conversions/transform.js @@ -51,11 +51,16 @@ const getConversions = (message, metadata, { Config }, event, conversionType) => payload = convertedPayload.payload; endpoint = convertedPayload.endpoint; } else if (conversionType === 'store') { - payload = getStoreConversionPayload(message, Config, filteredCustomerId); + payload = getStoreConversionPayload( + message, + Config, + filteredCustomerId, + eventLevelConsentsData, + ); endpoint = STORE_CONVERSION_CONFIG.replace(':customerId', filteredCustomerId); } else { // call conversions - payload = getCallConversionPayload(message, Config, eventLevelConsentsData); + payload = getCallConversionPayload(message, eventLevelConsentsData); endpoint = CALL_CONVERSION.replace(':customerId', filteredCustomerId); } diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index eeb4d2c3a45..24a2e471c60 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -227,14 +227,10 @@ function getExisitingUserIdentifier(userIdentifierInfo, defaultUserIdentifier) { return result; } -const getCallConversionPayload = (message, Config, eventLevelConsentsData) => { +const getCallConversionPayload = (message, eventLevelConsentsData) => { const payload = constructPayload(message, trackCallConversionsMapping); // here conversions[0] should be present because there are some mandatory properties mapped in the mapping json. - payload.conversions[0].consent = finaliseConsent( - consentConfigMap, - eventLevelConsentsData, - Config, - ); + payload.conversions[0].consent = finaliseConsent(consentConfigMap, eventLevelConsentsData); return payload; }; @@ -242,7 +238,7 @@ const getCallConversionPayload = (message, Config, eventLevelConsentsData) => { * This Function create the add conversion payload * and returns the payload */ -const getAddConversionPayload = (message, Config) => { +const getAddConversionPayload = (message, Config, eventLevelConsentsData) => { const { properties } = message; const { validateOnly, hashUserIdentifier, defaultUserIdentifier } = Config; const payload = constructPayload(message, trackAddStoreConversionsMapping); @@ -299,19 +295,19 @@ const getAddConversionPayload = (message, Config) => { } } // add consent support for store conversions. Note: No event level consent supported. - const consentObject = finaliseConsent(consentConfigMap, {}, Config); + const consentObject = finaliseConsent(consentConfigMap, eventLevelConsentsData); // create property should be present because there are some mandatory properties mapped in the mapping json. set(payload, 'operations.create.consent', consentObject); return payload; }; -const getStoreConversionPayload = (message, Config, event) => { +const getStoreConversionPayload = (message, Config, event, eventLevelConsentsData) => { const { validateOnly } = Config; const payload = { event, isStoreConversion: true, createJobPayload: getCreateJobPayload(message), - addConversionPayload: getAddConversionPayload(message, Config), + addConversionPayload: getAddConversionPayload(message, Config, eventLevelConsentsData), executeJobPayload: { validate_only: validateOnly }, }; return payload; @@ -438,7 +434,7 @@ const getClickConversionPayloadAndEndpoint = ( } // add consent support for click conversions - const consentObject = finaliseConsent(consentConfigMap, eventLevelConsent, Config); + const consentObject = finaliseConsent(consentConfigMap, eventLevelConsent); // here conversions[0] is expected to be present there are some mandatory properties mapped in the mapping json. set(payload, 'conversions[0].consent', consentObject); payload.conversions[0] = updateConversion(payload.conversions[0]); diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js index f05fd291822..bdcbc881310 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.test.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.test.js @@ -319,7 +319,7 @@ describe('getConsentsDataFromIntegrationObj', () => { }); describe('getCallConversionPayload', () => { - it('should call conversion payload with consent object', () => { + it('should call conversion payload with consent object and set default consent for adUserData', () => { const message = { properties: { callerId: '1234', @@ -327,17 +327,9 @@ describe('getCallConversionPayload', () => { conversionDateTime: '2022-01-01 12:32:45-08:00', }, }; - const result = getCallConversionPayload( - message, - { - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', - }, - { - adUserData: 'GRANTED', - adPersonalization: 'GRANTED', - }, - ); + const result = getCallConversionPayload(message, { + adPersonalization: 'GRANTED', + }); expect(result).toEqual({ conversions: [ { @@ -345,7 +337,7 @@ describe('getCallConversionPayload', () => { callerId: '1234', consent: { adPersonalization: 'GRANTED', - adUserData: 'GRANTED', + adUserData: 'UNSPECIFIED', }, conversionDateTime: '2022-01-01 12:32:45-08:00', }, @@ -360,14 +352,10 @@ describe('getCallConversionPayload', () => { conversionDateTime: '2022-01-01 12:32:45-08:00', }, }; - const result = getCallConversionPayload( - message, - { - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', - }, - {}, - ); + const result = getCallConversionPayload(message, { + adUserData: 'GRANTED', + adPersonalization: 'DENIED', + }); expect(result).toEqual({ conversions: [ { diff --git a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts index 08906c46d7b..dec57c7f5fb 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts @@ -5405,7 +5405,7 @@ export const data = [ }, { name: 'google_adwords_offline_conversions', - description: 'Test 26 : store conversion consent mapped from UI config', + description: 'Test 27 : store conversion consent mapped through integrations object', feature: 'processor', module: 'destination', version: 'v0', @@ -5435,170 +5435,49 @@ export const data = [ quantity: 123, }, integrations: { - All: true, - }, - name: 'ApplicationLoaded', - sentAt: '2019-10-14T11:15:53.296Z', - }, - metadata: { - secret: { - access_token: 'abcd1234', - refresh_token: 'efgh5678', - developer_token: 'ijkl91011', - }, - }, - destination: { - Config: { - isCustomerAllowed: false, - customerId: '111-222-3333', - subAccount: true, - loginCustomerId: 'login-customer-id', - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', - eventsToOfflineConversionsTypeMapping: [ - { - from: 'Product Clicked', - to: 'store', - }, - ], - eventsToConversionsNamesMapping: [ - { - from: 'Product Clicked', - to: 'Sign-up - click', - }, - ], - hashUserIdentifier: true, - defaultUserIdentifier: 'phone', - validateOnly: false, - rudderAccountId: '2EOknn1JNH7WK1MfNkgr4t3u4fGYKkRK', - }, - }, - }, - ], - }, - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, - headers: { - Authorization: 'Bearer abcd1234', - 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', - 'login-customer-id': 'logincustomerid', - }, - params: { - event: 'Sign-up - click', - customerId: '1112223333', - }, - body: { - JSON: { - event: '1112223333', - isStoreConversion: true, - createJobPayload: { - job: { - type: 'STORE_SALES_UPLOAD_FIRST_PARTY', - storeSalesMetadata: { - loyaltyFraction: '1', - transaction_upload_fraction: '1', + GOOGLE_ADWORDS_OFFLINE_CONVERSIONS: { + consents: { + adUserData: 'GRANTED', + adPersonalization: 'DENIED', + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + secret: { + access_token: 'abcd1234', + refresh_token: 'efgh5678', + developer_token: 'ijkl91011', + }, + }, + destination: { + Config: { + isCustomerAllowed: false, + customerId: '111-222-3333', + subAccount: true, + loginCustomerId: 'login-customer-id', + userDataConsent: 'GRANTED', + personalizationConsent: 'DENIED', + eventsToOfflineConversionsTypeMapping: [ + { + from: 'Product Clicked', + to: 'store', }, - }, - }, - addConversionPayload: { - operations: { - create: { - consent: { - adPersonalization: 'DENIED', - adUserData: 'GRANTED', - }, - transaction_attribute: { - store_attribute: { - store_code: 'store code', - }, - transaction_amount_micros: '100000000', - currency_code: 'INR', - transaction_date_time: '2019-10-14 16:45:18+05:30', - }, - userIdentifiers: [{}], + ], + eventsToConversionsNamesMapping: [ + { + from: 'Product Clicked', + to: 'Sign-up - click', }, - }, - enable_partial_failure: false, - enable_warnings: false, - validate_only: false, - }, - executeJobPayload: { - validate_only: false, + ], + hashUserIdentifier: true, + defaultUserIdentifier: 'phone', + validateOnly: false, + rudderAccountId: '2EOknn1JNH7WK1MfNkgr4t3u4fGYKkRK', }, }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, }, - files: {}, - userId: '', - }, - metadata: { - secret: { - access_token: 'abcd1234', - refresh_token: 'efgh5678', - developer_token: 'ijkl91011', - }, - }, - statusCode: 200, - }, - ], - }, - }, - mockFns: timestampMock, - }, - { - name: 'google_adwords_offline_conversions', - description: - 'Test 27 : store conversion consent mapped from UI config even though integration object is present', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - message: { - channel: 'web', - context: { - traits: {}, - }, - event: 'Product Clicked', - type: 'track', - messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71', - anonymousId: '00000000000000000000000000', - userId: '12345', - properties: { - item_id: 'item id', - merchant_id: 'merchant id', - currency: 'INR', - revenue: '100', - store_code: 'store code', - gclid: 'gclid', - conversionDateTime: '2019-10-14T11:15:18.299Z', - product_id: '123445', - quantity: 123, - }, - integrations: { - google_adwords_offline_conversion: { - consent: { - adUserdata: 'UNSPECIFIED', - adPersonalization: 'GRANTED', - }, - }, - }, - name: 'ApplicationLoaded', - sentAt: '2019-10-14T11:15:53.296Z', }, metadata: { secret: { @@ -5613,8 +5492,6 @@ export const data = [ customerId: '111-222-3333', subAccount: true, loginCustomerId: 'login-customer-id', - userDataConsent: 'GRANTED', - personalizationConsent: 'DENIED', eventsToOfflineConversionsTypeMapping: [ { from: 'Product Clicked', From bbb969b90c3e82f73d2bbd99f5ec62bb8dd67a8c Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Mon, 3 Mar 2025 12:00:57 +0530 Subject: [PATCH 126/160] fix: vs code debugger config (#4130) * fix: vs code debugger config * fix: vs code debugger config * fix: vs code debugger config --- .vscode/launch.json | 68 +++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index d6feaf356ee..0eecb3e2626 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,38 +1,19 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "transformer", - "type": "node", - "request": "launch", - "program": "${workspaceRoot}/index.js", - "runtimeArgs": ["--nolazy"], - "sourceMaps": true, - "runtimeExecutable": "/usr/local/bin/node" - }, { "type": "node", "request": "launch", - "name": "Launch TS", - "program": "${workspaceFolder}/dist/src/index.js", + "name": "transformer", + "program": "${workspaceFolder}/src/index.ts", "outFiles": ["${workspaceFolder}/dist/src/**/*.js"], - "runtimeExecutable": "/usr/local/bin/node" - }, - { - "name": "benchmark", - "type": "node", - "request": "launch", - "program": "${workspaceRoot}/benchmark", - "args": ["--destinations=${input:destinations}", "--feature=${input:feature}"], - "runtimeArgs": ["--nolazy"], - "sourceMaps": true, - "runtimeExecutable": "/usr/local/bin/node" + "runtimeArgs": ["--require", "${workspaceFolder}/node_modules/ts-node/register"], + "resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"], + "env": { + "NODE_ENV": "development" + } }, { - "runtimeExecutable": "/usr/local/bin/node", "type": "node", "request": "launch", "name": "Jest Current File", @@ -40,24 +21,33 @@ "args": ["${fileBasenameNoExtension}", "--config", "jest.config.js"], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", - "disableOptimisticBPs": true, + "runtimeArgs": ["--require", "${workspaceFolder}/node_modules/ts-node/register"], "windows": { "program": "${workspaceFolder}/node_modules/jest/bin/jest" + }, + "env": { + "NODE_ENV": "test" } - } - ], - "inputs": [ - { - "id": "destinations", - "type": "promptString", - "description": "Enter destinations", - "default": "algolia" }, { - "id": "feature", - "type": "promptString", - "description": "Enter Feature", - "default": "proc" + "type": "node", + "request": "launch", + "name": "Test Single Component", + "program": "${workspaceFolder}/node_modules/.bin/jest", + "args": [ + "-c", + "jest.config.typescript.js", + "component", + "--destination=adobe_analytics", + "--feature=processor" + ], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "runtimeArgs": ["--require", "${workspaceFolder}/node_modules/ts-node/register"], + "env": { + "NODE_ENV": "test", + "NODE_OPTIONS": "--no-node-snapshot" + } } ] } From 32bc390f71655cacd0a0b8fa1c0edccf011f73a8 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 3 Mar 2025 12:13:16 +0530 Subject: [PATCH 127/160] chore: logging payload schema during source transformation error (#4127) --- src/services/source/nativeIntegration.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/services/source/nativeIntegration.ts b/src/services/source/nativeIntegration.ts index 6b590a62e4f..e5f4ec0a46a 100644 --- a/src/services/source/nativeIntegration.ts +++ b/src/services/source/nativeIntegration.ts @@ -1,3 +1,4 @@ +import { JsonSchemaGenerator } from '@rudderstack/integrations-lib'; import { FetchHandler } from '../../helpers/fetchHandlers'; import { SourceService } from '../../interfaces/SourceService'; import { @@ -14,6 +15,7 @@ import { FixMe } from '../../util/types'; import tags from '../../v0/util/tags'; import { SourcePostTransformationService } from './postTransformation'; import logger from '../../logger'; +import { getBodyFromV2SpecPayload } from '../../v0/util'; export class NativeIntegrationSourceService implements SourceService { public getTags(extraErrorDetails: ErrorDetailerOptions = {}): MetaTransferObject { @@ -82,6 +84,19 @@ export class NativeIntegrationSourceService implements SourceService { logger.debug(`Error during source Transform: ${error}`, { ...logger.getLogMetadata(metaTO.errorDetails), }); + // log the payload schema here + const duplicateSourceEvent: any = sourceEvent; + try { + duplicateSourceEvent.output.request.body = getBodyFromV2SpecPayload( + duplicateSourceEvent?.output, + ); + } catch (e) { + /* empty */ + } + logger.error( + `Sample Payload Schema for source ${sourceType} : ${JSON.stringify(JsonSchemaGenerator.generate(duplicateSourceEvent))}`, + ); + return SourcePostTransformationService.handleFailureEventsSource(error, metaTO); } }), From bcb98e13509b734d68d20fbc42277cc94398eeba Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 3 Mar 2025 12:13:52 +0530 Subject: [PATCH 128/160] feat: added event validation in braze source (#4104) * feat: added event validation in braze source * fix: addressing comments * feat: added more test cases * feat: added tests covering more scenarios * fix: addressing comments --- src/sources/braze/transform.js | 5 +- test/integrations/sources/braze/data.ts | 350 ++++++++++++++++++++++++ 2 files changed, 354 insertions(+), 1 deletion(-) diff --git a/src/sources/braze/transform.js b/src/sources/braze/transform.js index 47681271d28..5d19e26fb3c 100644 --- a/src/sources/braze/transform.js +++ b/src/sources/braze/transform.js @@ -75,7 +75,10 @@ const process = (payload) => { const responses = []; // Ref: Custom Currents Connector Partner Dev Documentation.pdf - const eventList = Array.isArray(event) && event.length > 0 ? event[0].events : event.events; + const eventList = Array.isArray(event) && event.length > 0 ? event[0]?.events : event?.events; + if (!Array.isArray(eventList)) { + throw new TransformationError('eventList should be an array'); + } eventList.forEach((singleEvent) => { try { const resp = processEvent(singleEvent, eventMapping); diff --git a/test/integrations/sources/braze/data.ts b/test/integrations/sources/braze/data.ts index 516355daad3..d3642099aaa 100644 --- a/test/integrations/sources/braze/data.ts +++ b/test/integrations/sources/braze/data.ts @@ -1173,6 +1173,356 @@ export const data = [ }, }, }, + { + name: 'braze', + description: 'event.events is not available in required format', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({}), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event is null in request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify(null), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event is empty array in request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([]), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event[0] is null/undefined in request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([null]), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'event[0].events is undefined or null', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([{}]), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [ + { + from: 'randomEvent', + to: 'In-App Message Clicked', + }, + ], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'eventList should be an array', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'braze', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'braze', + description: 'success scenario when event[0].events is valid request', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify([ + { + events: [ + { + event_type: 'users.messages.inappmessage.Click', + properties: { device_model: 'samsung' }, + user: { + user_id: 'user_id', + external_user_id: 'externalUserId', + }, + }, + ], + }, + ]), + }, + source: { + ID: '2hgvYyU5TYaFvVzBge6tF2UKoeG', + OriginalID: '', + Name: 'Braze source', + SourceDefinition: commonSourceDefinition, + Config: { + customMapping: [], + }, + ...commonSourceConfigProperties, + }, + }, + ], + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + anonymousId: 'user_id', + context: { + device: { model: 'samsung' }, + integration: { name: 'Braze' }, + library: { name: 'unknown', version: 'unknown' }, + }, + event: 'users.messages.inappmessage.Click', + integrations: { Braze: false }, + type: 'track', + userId: 'externalUserId', + }, + ], + }, + }, + ], + }, + }, + }, ].map((tc) => ({ ...tc, mockFns: () => { From ed717f5bdc72b8a4b7e591c8815cf94b9da2f752 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 3 Mar 2025 07:11:28 +0000 Subject: [PATCH 129/160] chore(release): 1.92.0 --- CHANGELOG.md | 18 ++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22290db9416..5aaebf57add 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ 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.92.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.5...v1.92.0) (2025-03-03) + + +### Features + +* added event validation in braze source ([#4104](https://github.com/rudderlabs/rudder-transformer/issues/4104)) ([bcb98e1](https://github.com/rudderlabs/rudder-transformer/commit/bcb98e13509b734d68d20fbc42277cc94398eeba)) +* id stitching improvement in shopify pixel transformations ([#4060](https://github.com/rudderlabs/rudder-transformer/issues/4060)) ([558eab6](https://github.com/rudderlabs/rudder-transformer/commit/558eab64652da9f75ca9bc4a5484460e3a95b8e9)), closes [#4074](https://github.com/rudderlabs/rudder-transformer/issues/4074) [#4092](https://github.com/rudderlabs/rudder-transformer/issues/4092) +* remove consent from db-config and add store sales to integrations object ([#4091](https://github.com/rudderlabs/rudder-transformer/issues/4091)) ([2943b3d](https://github.com/rudderlabs/rudder-transformer/commit/2943b3d77f177d6b93fb5231eead81f9f05accb9)) +* zoho vdmv2 ([#4096](https://github.com/rudderlabs/rudder-transformer/issues/4096)) ([2d129a7](https://github.com/rudderlabs/rudder-transformer/commit/2d129a79ce8e8599e4bd5d5718afb25100a689ff)) + + +### Bug Fixes + +* add module in the search url path for zoho ([#4126](https://github.com/rudderlabs/rudder-transformer/issues/4126)) ([f7ed9a4](https://github.com/rudderlabs/rudder-transformer/commit/f7ed9a434299b750095642b0030323bc72f1341c)) +* added missing email check during primary email id filtering in zendesk destination ([#4124](https://github.com/rudderlabs/rudder-transformer/issues/4124)) ([b991017](https://github.com/rudderlabs/rudder-transformer/commit/b991017faffed3479d805a276d53f58469f16699)) +* mixpanel ios property mapping ios_app_release and ios_app_version ([#4072](https://github.com/rudderlabs/rudder-transformer/issues/4072)) ([d9eb0c5](https://github.com/rudderlabs/rudder-transformer/commit/d9eb0c5da16eccedac8d1b9bf524ef8bd6569fa4)) +* vs code debugger config ([#4130](https://github.com/rudderlabs/rudder-transformer/issues/4130)) ([bbb969b](https://github.com/rudderlabs/rudder-transformer/commit/bbb969b90c3e82f73d2bbd99f5ec62bb8dd67a8c)) + ### [1.91.5](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.4...v1.91.5) (2025-02-28) diff --git a/package-lock.json b/package-lock.json index f46fee4a533..28e2d1ed4b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.91.5", + "version": "1.92.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.91.5", + "version": "1.92.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 5d3f7c5d025..6ce2948b4fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.91.5", + "version": "1.92.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From fb59ae2df82380067ee03e07ace9a99d769299c1 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Tue, 4 Mar 2025 18:50:04 +0530 Subject: [PATCH 130/160] chore: add request details in context --- src/services/source/nativeIntegration.ts | 9 +- src/sources/webhook/transform.js | 17 ++- test/integrations/component.test.ts | 4 +- test/integrations/sources/webhook/data.ts | 139 ++++++++++++++++++++++ 4 files changed, 154 insertions(+), 15 deletions(-) create mode 100644 test/integrations/sources/webhook/data.ts diff --git a/src/services/source/nativeIntegration.ts b/src/services/source/nativeIntegration.ts index e5f4ec0a46a..7a4df6fc6d5 100644 --- a/src/services/source/nativeIntegration.ts +++ b/src/services/source/nativeIntegration.ts @@ -61,16 +61,9 @@ export class NativeIntegrationSourceService implements SourceService { if (sourceEvent.output) { const newSourceEvent = sourceEvent.output; - const { headers } = newSourceEvent; - if (headers) { - delete newSourceEvent.headers; - } - const respEvents: RudderMessage | RudderMessage[] | SourceTransformationResponse = await sourceHandler.process(newSourceEvent); - return SourcePostTransformationService.handleSuccessEventsSource(respEvents, { - headers, - }); + return SourcePostTransformationService.handleSuccessEventsSource(respEvents, {}); } return SourcePostTransformationService.handleFailureEventsSource( new Error('Error post version converstion, converstion output is undefined'), diff --git a/src/sources/webhook/transform.js b/src/sources/webhook/transform.js index 7d237bf24e6..d0499ced1c6 100644 --- a/src/sources/webhook/transform.js +++ b/src/sources/webhook/transform.js @@ -4,19 +4,26 @@ const { getBodyFromV2SpecPayload, } = require('../../v0/util'); -function processEvent(event) { - const payload = { +function processEvent(payload) { + const event = getBodyFromV2SpecPayload(payload); + + const request = { ...payload.request }; + delete request.body; + + const response = { type: 'track', event: 'webhook_source_event', properties: event, anonymousId: generateUUID(), + context: { + ...request, + }, }; - return payload; + return response; } function process(payload) { - const event = getBodyFromV2SpecPayload(payload); - const response = processEvent(event); + const response = processEvent(payload); return removeUndefinedAndNullValues(response); } diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index cfcd1d56f2d..d8a97b98d4d 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -204,12 +204,12 @@ const destinationTestHandler = async (tcData: TestCaseData) => { await testRoute(route, tcData); }; -const sourceTestHandler = async (tcData) => { +const sourceTestHandler = async (tcData: TestCaseData) => { const route = `/${join( tcData.version || DEFAULT_VERSION, 'sources', tcData.name, - tcData.input.pathSuffix, + tcData.input.pathSuffix || '', )}`; await testRoute(route, tcData); }; diff --git a/test/integrations/sources/webhook/data.ts b/test/integrations/sources/webhook/data.ts new file mode 100644 index 00000000000..eb339bb5d64 --- /dev/null +++ b/test/integrations/sources/webhook/data.ts @@ -0,0 +1,139 @@ +import utils from '../../../../src/v0/util'; + +const ANONYMOUS_ID = '97fcd7b2-cc24-47d7-b776-057b7b199513'; +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue(ANONYMOUS_ID); +}; + +export const data = [ + { + name: 'webhook', + description: 'successful webhook request with query params and headers', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + }), + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: {}, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + type: 'track', + event: 'webhook_source_event', + properties: { + prop1: 'value1', + prop2: 'value2', + }, + anonymousId: ANONYMOUS_ID, + context: { + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'webhook', + description: 'failed webhook request with malformed JSON body', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: '{"prop1": "value1", "prop2": "value2"', + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Accept: ['*/*'], + 'Accept-Encoding': ['gzip, deflate, br'], + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + 'Postman-Token': ['1d06ebe8-086f-44dd-916a-ad5ab26959f6'], + 'User-Agent': ['PostmanRuntime/7.43.0'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: {}, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Malformed JSON in request body', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'webhook', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); From 3392ed0c912d7e4962b25fd025115309dfa66214 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Wed, 5 Mar 2025 17:45:38 +0530 Subject: [PATCH 131/160] chore: remove statsd (#4139) --- .gitignore | 5 ++++- package-lock.json | 5 ----- package.json | 1 - src/util/stats.js | 40 ++++-------------------------------- src/util/statsd.js | 51 ---------------------------------------------- 5 files changed, 8 insertions(+), 94 deletions(-) delete mode 100644 src/util/statsd.js diff --git a/.gitignore b/.gitignore index f9d3f0a9aab..48658b27ffb 100644 --- a/.gitignore +++ b/.gitignore @@ -144,4 +144,7 @@ temp/ # Allure allure-results/ -allure-report/ \ No newline at end of file +allure-report/ + +# local scripts +*/scripts/local/ \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 28e2d1ed4b9..a91352b4735 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,7 +69,6 @@ "sha256": "^0.2.0", "sqlstring": "^2.3.3", "stacktrace-parser": "^0.1.10", - "statsd-client": "^0.4.7", "truncate-utf8-bytes": "^1.0.2", "ua-parser-js": "^1.0.37", "unset-value": "^2.0.1", @@ -21296,10 +21295,6 @@ "node": ">=0.8" } }, - "node_modules/statsd-client": { - "version": "0.4.7", - "license": "MIT" - }, "node_modules/statuses": { "version": "2.0.1", "license": "MIT", diff --git a/package.json b/package.json index 6ce2948b4fe..d46660752f4 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,6 @@ "sha256": "^0.2.0", "sqlstring": "^2.3.3", "stacktrace-parser": "^0.1.10", - "statsd-client": "^0.4.7", "truncate-utf8-bytes": "^1.0.2", "ua-parser-js": "^1.0.37", "unset-value": "^2.0.1", diff --git a/src/util/stats.js b/src/util/stats.js index 6c42fc4b4d8..da937d5761b 100644 --- a/src/util/stats.js +++ b/src/util/stats.js @@ -1,9 +1,6 @@ -const statsd = require('./statsd'); const prometheus = require('./prometheus'); -const logger = require('../logger'); const enableStats = process.env.ENABLE_STATS !== 'false'; -const statsClientType = process.env.STATS_CLIENT || 'statsd'; // summary metrics are enabled by default. To disable set ENABLE_SUMMARY_METRICS='false'. const enableSummaryMetrics = process.env.ENABLE_SUMMARY_METRICS !== 'false'; @@ -13,22 +10,7 @@ function init() { return; } - switch (statsClientType) { - case 'statsd': - logger.info('setting up statsd client'); - statsClient = new statsd.Statsd(); - break; - - case 'prometheus': - logger.info('setting up prometheus client'); - statsClient = new prometheus.Prometheus(enableSummaryMetrics); - break; - - default: - logger.error( - `invalid stats client type: ${statsClientType}, supported values are 'statsd' and 'prometheues'`, - ); - } + statsClient = new prometheus.Prometheus(enableSummaryMetrics); } // Sends the diff between current time and start as the stat @@ -96,13 +78,7 @@ async function metricsController(ctx) { return; } - if (statsClientType === 'prometheus') { - await statsClient.metricsController(ctx); - return; - } - - ctx.status = 404; - ctx.body = `Not supported`; + await statsClient.metricsController(ctx); } async function resetMetricsController(ctx) { @@ -112,13 +88,7 @@ async function resetMetricsController(ctx) { return; } - if (statsClientType === 'prometheus') { - await statsClient.resetMetricsController(ctx); - return; - } - - ctx.status = 501; - ctx.body = `Not supported`; + await statsClient.resetMetricsController(ctx); } async function shutdownMetricsClient() { @@ -126,9 +96,7 @@ async function shutdownMetricsClient() { return; } - if (statsClientType === 'prometheus') { - await statsClient.shutdown(); - } + await statsClient.shutdown(); } init(); diff --git a/src/util/statsd.js b/src/util/statsd.js deleted file mode 100644 index 497b091f709..00000000000 --- a/src/util/statsd.js +++ /dev/null @@ -1,51 +0,0 @@ -const SDC = require('statsd-client'); - -const statsServerHost = process.env.STATSD_SERVER_HOST || 'localhost'; -const statsServerPort = parseInt(process.env.STATSD_SERVER_PORT || '8125', 10); -const instanceID = process.env.INSTANCE_ID || 'localhost'; - -class Statsd { - constructor() { - this.statsdClient = new SDC({ - host: statsServerHost, - port: statsServerPort, - prefix: 'transformer', - tags: { - instanceName: instanceID, - }, - }); - } - - // Sends the diff between current time and start as the stat - timing(name, start, tags = {}) { - this.statsdClient.timing(name, start, tags); - } - - // timingSummary is just a wrapper around timing for statsd.For prometheus, we will have to implement a different function. - timingSummary(name, start, tags = {}) { - this.statsdClient.timing(name, start, tags); - } - - // summary is just a wrapper around timing for statsd.For prometheus, we will have to implement a different function. - summary(name, value, tags = {}) { - this.statsdClient.timing(name, value, tags); - } - - increment(name, tags = {}) { - this.statsdClient.increment(name, 1, tags); - } - - counter(name, delta, tags = {}) { - this.statsdClient.counter(name, delta, tags); - } - - gauge(name, value, tags = {}) { - this.statsdClient.gauge(name, value, tags); - } - - histogram(name, value, tags = {}) { - this.statsdClient.histogram(name, value, tags); - } -} - -module.exports = { Statsd }; From 8f9463ac8a55fbb80f8606b29875ef916a70555b Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Thu, 6 Mar 2025 09:05:05 +0530 Subject: [PATCH 132/160] chore: update api version in facebook destinations --- .../facebook_conversions/config.js | 2 +- src/v0/destinations/facebook_pixel/config.js | 2 +- src/v0/destinations/fb/config.js | 2 +- .../destinations/fb_custom_audience/config.js | 2 +- .../fb_custom_audience/util.test.js | 2 +- .../facebook_conversions/processor/data.ts | 26 +++++++++---------- .../facebook_conversions/router/data.ts | 4 +-- .../facebook_pixel/processor/ecommTestData.ts | 6 ++--- .../processor/validationTestData.ts | 2 +- .../facebook_pixel/router/data.ts | 4 +-- .../fb_custom_audience/processor/data.ts | 4 +-- .../fb_custom_audience/router/data.ts | 22 ++++++++-------- 12 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/v0/destinations/facebook_conversions/config.js b/src/v0/destinations/facebook_conversions/config.js index 2bbe9ab0170..d88e9d698c3 100644 --- a/src/v0/destinations/facebook_conversions/config.js +++ b/src/v0/destinations/facebook_conversions/config.js @@ -1,7 +1,7 @@ const { getMappingConfig } = require('../../util'); const ENDPOINT = (datasetId, accessToken) => - `https://graph.facebook.com/v20.0/${datasetId}/events?access_token=${accessToken}`; + `https://graph.facebook.com/v22.0/${datasetId}/events?access_token=${accessToken}`; const CONFIG_CATEGORIES = { USERDATA: { diff --git a/src/v0/destinations/facebook_pixel/config.js b/src/v0/destinations/facebook_pixel/config.js index f2598921652..b8411af1e00 100644 --- a/src/v0/destinations/facebook_pixel/config.js +++ b/src/v0/destinations/facebook_pixel/config.js @@ -1,6 +1,6 @@ const { getMappingConfig } = require('../../util'); -const VERSION = 'v20.0'; +const VERSION = 'v22.0'; const CONFIG_CATEGORIES = { USERDATA: { diff --git a/src/v0/destinations/fb/config.js b/src/v0/destinations/fb/config.js index d84fa7d6727..80d0749bb1d 100644 --- a/src/v0/destinations/fb/config.js +++ b/src/v0/destinations/fb/config.js @@ -1,7 +1,7 @@ const fs = require('fs'); const path = require('path'); -const VERSION = 'v20.0'; +const VERSION = 'v22.0'; const getPath = (file) => path.resolve(__dirname, file); diff --git a/src/v0/destinations/fb_custom_audience/config.js b/src/v0/destinations/fb_custom_audience/config.js index 5a3f0742e12..dfce02acd72 100644 --- a/src/v0/destinations/fb_custom_audience/config.js +++ b/src/v0/destinations/fb_custom_audience/config.js @@ -1,4 +1,4 @@ -const BASE_URL = 'https://graph.facebook.com/v20.0'; +const BASE_URL = 'https://graph.facebook.com/v22.0'; function getEndPoint(audienceId) { return `${BASE_URL}/${audienceId}/users`; diff --git a/src/v0/destinations/fb_custom_audience/util.test.js b/src/v0/destinations/fb_custom_audience/util.test.js index 5c8eb15b71a..6e966887ad8 100644 --- a/src/v0/destinations/fb_custom_audience/util.test.js +++ b/src/v0/destinations/fb_custom_audience/util.test.js @@ -18,7 +18,7 @@ const basePayload = { const baseResponse = { version: '1', type: 'REST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', diff --git a/test/integrations/destinations/facebook_conversions/processor/data.ts b/test/integrations/destinations/facebook_conversions/processor/data.ts index 49d2416726c..8f14a08bf66 100644 --- a/test/integrations/destinations/facebook_conversions/processor/data.ts +++ b/test/integrations/destinations/facebook_conversions/processor/data.ts @@ -314,7 +314,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -433,7 +433,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -552,7 +552,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -671,7 +671,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -797,7 +797,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -917,7 +917,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1036,7 +1036,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1165,7 +1165,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1290,7 +1290,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1418,7 +1418,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1546,7 +1546,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1646,7 +1646,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -1767,7 +1767,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/facebook_conversions/router/data.ts b/test/integrations/destinations/facebook_conversions/router/data.ts index 5a9c0c513fe..2c51fcc062c 100644 --- a/test/integrations/destinations/facebook_conversions/router/data.ts +++ b/test/integrations/destinations/facebook_conversions/router/data.ts @@ -112,7 +112,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { @@ -150,7 +150,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyID/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyID/events?access_token=09876', headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts index 3daf22d5c2d..a08469f5531 100644 --- a/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/ecommTestData.ts @@ -220,7 +220,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { @@ -578,7 +578,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { @@ -900,7 +900,7 @@ export const ecommTestData: ProcessorTestData[] = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, FORM: { diff --git a/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts b/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts index d242ac990d1..eca683e2bbe 100644 --- a/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/validationTestData.ts @@ -444,7 +444,7 @@ export const validationTestData = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', files: {}, headers: {}, method: 'POST', diff --git a/test/integrations/destinations/facebook_pixel/router/data.ts b/test/integrations/destinations/facebook_pixel/router/data.ts index f3df4506a5a..449da7e3be0 100644 --- a/test/integrations/destinations/facebook_pixel/router/data.ts +++ b/test/integrations/destinations/facebook_pixel/router/data.ts @@ -126,7 +126,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, body: { @@ -165,7 +165,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/dummyPixelId/events?access_token=09876', + endpoint: 'https://graph.facebook.com/v22.0/dummyPixelId/events?access_token=09876', headers: {}, params: {}, body: { diff --git a/test/integrations/destinations/fb_custom_audience/processor/data.ts b/test/integrations/destinations/fb_custom_audience/processor/data.ts index 44d4ecaa71e..b5592394319 100644 --- a/test/integrations/destinations/fb_custom_audience/processor/data.ts +++ b/test/integrations/destinations/fb_custom_audience/processor/data.ts @@ -2327,7 +2327,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -2395,7 +2395,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', diff --git a/test/integrations/destinations/fb_custom_audience/router/data.ts b/test/integrations/destinations/fb_custom_audience/router/data.ts index 5946c7d6b8c..807a604b793 100644 --- a/test/integrations/destinations/fb_custom_audience/router/data.ts +++ b/test/integrations/destinations/fb_custom_audience/router/data.ts @@ -36,7 +36,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -87,7 +87,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -159,7 +159,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -210,7 +210,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/aud1/users', + endpoint: 'https://graph.facebook.com/v22.0/aud1/users', headers: {}, params: { access_token: 'ABC', @@ -305,7 +305,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -368,7 +368,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -415,7 +415,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -546,7 +546,7 @@ export const data = [ version: '1', type: 'REST', method: 'DELETE', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -637,7 +637,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -712,7 +712,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', @@ -872,7 +872,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://graph.facebook.com/v20.0/23848494844100489/users', + endpoint: 'https://graph.facebook.com/v22.0/23848494844100489/users', headers: {}, params: { access_token: 'ABC', From 216335730a2906e58879f151dfd5c33e9d0a483a Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Thu, 6 Mar 2025 11:43:14 +0530 Subject: [PATCH 133/160] chore: replace secrets in test cases with constants (#4133) * chore: replace secrets in test cases with functions * fix: masked secret files * fix: remove hard code secrets and use dynamic values * fix: json stringified values * chore: remove scripts * chore: remove hardcode secrets * chore: remove hardcode secrets --------- Co-authored-by: Dilip Kola Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --- .vscode/launch.json | 5 +- package-lock.json | 11483 ++++++++-------- package.json | 2 +- src/cdk/v2/destinations/emarsys/utils.test.js | 10 +- src/cdk/v2/destinations/gladly/utils.test.js | 6 +- src/cdk/v2/destinations/http/utils.test.js | 8 +- .../v2/destinations/intercom/utils.test.js | 5 +- .../destinations/linkedin_ads/utils.test.js | 10 +- src/controllers/__tests__/regulation.test.ts | 4 +- src/controllers/__tests__/source.test.ts | 4 +- src/controllers/util/index.test.ts | 16 +- src/v0/destinations/braze/braze.util.test.js | 7 +- src/v0/destinations/ga4_v2/transform.ts | 8 +- .../util.test.js | 6 +- .../marketo_static_list/testData/constants.js | 28 +- .../marketo_static_list/testData/testData.js | 57 +- .../marketo_static_list/transform.test.js | 138 - src/v0/destinations/mp/util.test.js | 50 +- src/v0/destinations/sfmc/transform.test.js | 8 +- .../snapchat_conversion/util.test.js | 10 +- .../marketo_static_list/proxy_response.json | 10 +- .../data/marketo_static_list_proxy_input.json | 10 +- .../warehouse/flatten_event_properties.js | 36 +- .../warehouse/integration_options_events.js | 22 +- test/__tests__/shopify_warehouse.test.js | 4 +- test/integrations/common/criteo/network.ts | 3 +- test/integrations/common/secrets.ts | 4 + test/integrations/component.test.ts | 30 +- .../destinations/adj/processor/data.ts | 80 +- .../destinations/adj/router/data.ts | 20 +- .../destinations/af/deleteUsers/data.ts | 15 +- .../destinations/af/maskedSecrets.ts | 4 + test/integrations/destinations/af/network.ts | 5 +- .../destinations/af/processor/data.ts | 269 +- .../destinations/af/processor/validation.ts | 306 +- .../destinations/af/router/data.ts | 24 +- .../destinations/airship/maskedSecrets.ts | 4 + .../airship/processor/business.ts | 7 +- .../destinations/airship/processor/data.ts | 97 +- .../destinations/airship/router/data.ts | 23 +- .../algolia/dataDelivery/business.ts | 28 +- .../algolia/dataDelivery/other.ts | 21 +- .../destinations/am/batch/data.ts | 144 +- .../destinations/am/deleteUsers/data.ts | 10 +- .../destinations/am/maskedSecrets.ts | 5 + test/integrations/destinations/am/network.ts | 12 +- .../destinations/am/processor/data.ts | 428 +- .../destinations/am/router/data.ts | 14 +- .../destinations/amazon_audience/common.ts | 5 +- .../amazon_audience/dataDelivery/data.ts | 7 +- .../amazon_audience/maskedSecrets.ts | 6 + .../destinations/amazon_audience/network.ts | 15 +- .../amazon_audience/processor/data.ts | 5 +- .../amazon_audience/router/data.ts | 5 +- .../attentive_tag/maskedSecrets.ts | 4 + .../attentive_tag/processor/data.ts | 47 +- .../destinations/attentive_tag/router/data.ts | 7 +- .../destinations/attribution/data.ts | 21 +- .../destinations/attribution/maskedSecrets.ts | 5 + .../destinations/bloomreach/common.ts | 7 +- .../bloomreach/dataDelivery/other.ts | 9 +- .../destinations/bloomreach/maskedSecrets.ts | 6 + .../destinations/bloomreach_catalog/common.ts | 7 +- .../bloomreach_catalog/dataDelivery/data.ts | 16 +- .../bloomreach_catalog/maskedSecrets.ts | 6 + .../bloomreach_catalog/router/data.ts | 47 +- .../destinations/blueshift/maskedSecrets.ts | 7 + .../destinations/blueshift/processor/data.ts | 55 +- .../destinations/blueshift/router/data.ts | 19 +- .../braze/dataDelivery/business.ts | 11 +- .../destinations/braze/dataDelivery/data.ts | 27 +- .../destinations/braze/dataDelivery/other.ts | 9 +- .../destinations/braze/deleteUsers/data.ts | 8 +- .../destinations/braze/maskedSecrets.ts | 6 + .../destinations/braze/network.ts | 29 +- .../destinations/braze/processor/data.ts | 115 +- .../destinations/braze/router/data.ts | 39 +- .../campaign_manager/dataDelivery/business.ts | 3 +- .../campaign_manager/dataDelivery/oauth.ts | 80 +- .../campaign_manager/dataDelivery/other.ts | 21 +- .../campaign_manager/maskedSecrets.ts | 4 + .../destinations/campaign_manager/network.ts | 4 +- .../campaign_manager/processor/data.ts | 51 +- .../campaign_manager/router/data.ts | 59 +- .../destinations/candu/maskedSecrets.ts | 5 + .../destinations/candu/processor/data.ts | 27 +- .../destinations/candu/router/data.ts | 7 +- .../destinations/canny/maskedSecrets.ts | 7 + .../destinations/canny/network.ts | 4 +- .../canny/{ => processor}/data.ts | 51 +- .../clevertap/dataDelivery/business.ts | 38 +- .../clevertap/dataDelivery/data.ts | 13 +- .../destinations/clevertap/network.ts | 13 +- .../destinations/clevertap/processor/data.ts | 104 +- .../destinations/clevertap/router/data.ts | 20 +- .../destinations/clicksend/commonConfig.ts | 11 +- .../clicksend/dataDelivery/data.ts | 44 +- .../destinations/clicksend/maskedSecrets.ts | 5 + .../destinations/clicksend/router/data.ts | 27 +- .../destinations/cordial/common.ts | 5 +- .../destinations/cordial/maskedSecrets.ts | 5 + .../destinations/cordial/network.ts | 5 +- .../destinations/courier/maskedSecrets.ts | 4 + .../destinations/courier/processor/data.ts | 15 +- .../destinations/courier/router/data.ts | 7 +- .../criteo_audience/dataDelivery/business.ts | 15 +- .../criteo_audience/dataDelivery/data.ts | 15 +- .../criteo_audience/dataDelivery/other.ts | 2 +- .../criteo_audience/maskedSecrets.ts | 3 + .../destinations/criteo_audience/network.ts | 4 +- .../criteo_audience/processor/data.ts | 115 +- .../criteo_audience/router/data.ts | 49 +- .../destinations/custify/deleteUsers/data.ts | 13 +- .../destinations/custify/maskedSecrets.ts | 10 + .../destinations/custify/network.ts | 7 +- .../destinations/custify/processor/data.ts | 25 +- .../destinations/custify/router/data.ts | 13 +- .../destinations/customerio/maskedSecrets.ts | 15 + .../destinations/customerio/processor/data.ts | 404 +- .../destinations/customerio/router/data.ts | 35 +- .../customerio_audience/common.ts | 7 +- .../customerio_audience/maskedSecrets.ts | 6 + .../destinations/delighted/maskedSecrets.ts | 5 + .../destinations/delighted/network.ts | 10 +- .../destinations/delighted/processor/data.ts | 39 +- .../destinations/delighted/router/data.ts | 13 +- .../destinations/drip/maskedSecrets.ts | 5 + .../destinations/drip/processor/data.ts | 47 +- .../destinations/drip/router/data.ts | 13 +- .../destinations/emarsys/dataDelivery/data.ts | 34 +- .../destinations/engage/deleteUsers/data.ts | 24 +- .../destinations/engage/maskedSecrets.ts | 6 + .../destinations/engage/network.ts | 10 +- .../destinations/engage/processor/data.ts | 66 +- .../destinations/engage/router/data.ts | 32 +- .../destinations/eventbridge/data.ts | 185 +- .../facebook_conversions/processor/data.ts | 285 +- .../facebook_conversions/router/data.ts | 35 +- .../facebook_pixel/dataDelivery/business.ts | 16 +- .../facebook_pixel/dataDelivery/data.ts | 9 +- .../facebook_pixel/dataDelivery/other.ts | 18 +- .../facebook_pixel/router/data.ts | 29 +- .../destinations/factorsai/data.ts | 35 +- .../destinations/factorsai/maskedSecrets.ts | 5 + .../destinations/fb/dataDelivery/business.ts | 93 +- .../destinations/fb/dataDelivery/data.ts | 259 +- .../destinations/fb/processor/data.ts | 508 +- .../dataDelivery/business.ts | 9 +- .../fb_custom_audience/router/data.ts | 44 +- .../freshmarketer/maskedSecrets.ts | 4 + .../freshmarketer/processor/data.ts | 90 +- .../destinations/freshmarketer/router/data.ts | 20 +- .../destinations/freshsales/maskedSecrets.ts | 4 + .../destinations/freshsales/processor/data.ts | 72 +- .../destinations/freshsales/router/data.ts | 8 +- .../destinations/fullstory/maskedSecrets.ts | 7 + .../destinations/fullstory/processor/data.ts | 15 +- .../destinations/ga/deleteUsers/data.ts | 9 +- .../destinations/ga/maskedSecrets.ts | 8 + test/integrations/destinations/ga/network.ts | 22 +- .../destinations/ga4/dataDelivery/business.ts | 2 +- .../gainsight_px/processor/data.ts | 4 +- .../destinations/gainsight_px/router/data.ts | 15 +- .../destinations/gladly/maskedSecrets.ts | 6 + .../destinations/gladly/network.ts | 11 +- .../destinations/gladly/processor/data.ts | 51 +- .../destinations/gladly/router/data.ts | 61 +- .../dataDelivery/business.ts | 90 +- .../dataDelivery/oauth.ts | 3 +- .../maskedSecrets.ts | 4 + .../network.ts | 19 +- .../processor/data.ts | 49 +- .../router/data.ts | 29 +- .../dataDelivery/business.ts | 39 +- .../dataDelivery/oauth.ts | 18 +- .../maskedSecrets.ts | 7 + .../network.ts | 69 +- .../processor/data.ts | 317 +- .../router/data.ts | 69 +- .../dataDelivery/business.ts | 5 +- .../dataDelivery/oauth.ts | 13 +- .../maskedSecrets.ts | 10 + .../network.ts | 21 +- .../processor/data.ts | 141 +- .../router/data.ts | 39 +- .../destinations/hs/dataDelivery/business.ts | 63 +- .../destinations/hs/dataDelivery/other.ts | 5 +- .../destinations/hs/maskedSecrets.ts | 10 + test/integrations/destinations/hs/network.ts | 23 +- .../destinations/hs/processor/data.ts | 63 +- .../destinations/hs/router/config.ts | 3 +- .../destinations/hs/router/data.ts | 153 +- test/integrations/destinations/http/common.ts | 17 +- .../destinations/http/maskedSecrets.ts | 7 + .../http/processor/configuration.ts | 22 +- .../destinations/http/router/data.ts | 42 +- .../destinations/impact/maskedSecrets.ts | 6 + .../destinations/impact/processor/data.ts | 101 +- .../destinations/impact/router/data.ts | 27 +- .../intercom/dataDelivery/business.ts | 54 +- .../intercom/dataDelivery/other.ts | 43 +- .../destinations/intercom/deleteUsers/data.ts | 5 +- .../destinations/intercom/maskedSecrets.ts | 10 + .../destinations/intercom/network.ts | 13 +- .../intercom/processor/groupTestData.ts | 9 +- .../intercom/processor/identifyTestData.ts | 15 +- .../intercom/processor/trackTestData.ts | 9 +- .../intercom/processor/validationTestData.ts | 43 +- .../destinations/intercom/router/data.ts | 35 +- .../destinations/intercom_v2/common.ts | 6 +- .../intercom_v2/dataDelivery/business.ts | 47 +- .../intercom_v2/dataDelivery/oauth.ts | 14 +- .../destinations/intercom_v2/maskedSecrets.ts | 4 + .../destinations/intercom_v2/router/data.ts | 20 +- .../iterable/dataDelivery/business.ts | 77 +- .../destinations/june/maskedSecrets.ts | 5 + .../destinations/june/processor/data.ts | 37 +- .../destinations/june/router/data.ts | 11 +- .../destinations/klaviyo/maskedSecrets.ts | 7 + .../destinations/klaviyo/network.ts | 4 +- .../klaviyo/processor/ecomTestData.ts | 5 +- .../klaviyo/processor/groupTestData.ts | 6 +- .../klaviyo/processor/groupTestDataV2.ts | 5 +- .../klaviyo/processor/identifyTestData.ts | 13 +- .../klaviyo/processor/identifyTestDataV2.ts | 5 +- .../klaviyo/processor/screenTestData.ts | 5 +- .../klaviyo/processor/screenTestDataV2.ts | 6 +- .../klaviyo/processor/trackTestData.ts | 5 +- .../klaviyo/processor/trackTestDataV2.ts | 6 +- .../klaviyo/processor/validationTestData.ts | 3 +- .../klaviyo/processor/validationTestDataV2.ts | 4 +- .../klaviyo/router/commonConfig.ts | 6 +- .../destinations/klaviyo/router/data.ts | 11 +- .../destinations/klaviyo/router/dataV2.ts | 35 +- .../destinations/kustomer/maskedSecrets.ts | 4 + .../destinations/kustomer/processor/data.ts | 57 +- .../destinations/kustomer/router/data.ts | 19 +- .../destinations/lambda/processor/data.ts | 18 +- .../destinations/lambda/router/data.ts | 58 +- .../linkedin_ads/dataDelivery/business.ts | 5 +- .../linkedin_ads/dataDelivery/oauth.ts | 39 +- .../linkedin_ads/maskedSecrets.ts | 6 + .../destinations/linkedin_ads/network.ts | 15 +- .../processor/configLevelFeaturesTestData.ts | 4 +- .../linkedin_ads/processor/trackTestData.ts | 3 +- .../processor/validationTestData.ts | 3 +- .../destinations/linkedin_ads/router/data.ts | 16 +- .../linkedin_audience/processor/business.ts | 7 +- .../linkedin_audience/processor/validation.ts | 5 +- .../linkedin_audience/router/data.ts | 9 +- .../destinations/mailchimp/maskedSecrets.ts | 9 + .../destinations/mailchimp/network.ts | 5 +- .../destinations/mailchimp/processor/data.ts | 77 +- .../destinations/mailchimp/router/data.ts | 49 +- .../destinations/mailjet/maskedSecrets.ts | 6 + .../destinations/mailjet/processor/data.ts | 11 +- .../destinations/mailjet/router/data.ts | 85 +- .../marketo/dataDelivery/business.ts | 46 +- .../destinations/marketo/dataDelivery/data.ts | 15 +- .../marketo/dataDelivery/other.ts | 12 +- .../destinations/marketo/maskedSecrets.ts | 7 + .../destinations/marketo/network.ts | 89 +- .../destinations/marketo/processor/data.ts | 68 +- .../destinations/marketo/router/data.ts | 71 +- .../dataDelivery/business.ts | 48 +- .../marketo_static_list/dataDelivery/data.ts | 21 +- .../marketo_static_list/dataDelivery/other.ts | 11 +- .../marketo_static_list/maskedSecrets.ts | 9 + .../marketo_static_list/network.ts | 29 +- .../marketo_static_list/processor/data.ts | 77 +- .../marketo_static_list/router/data.ts | 237 +- .../destinations/mautic/maskedSecrets.ts | 10 + .../destinations/mautic/network.ts | 13 +- .../destinations/mautic/processor/data.ts | 143 +- .../destinations/mautic/router/data.ts | 27 +- .../destinations/moengage/maskedSecrets.ts | 6 + .../destinations/moengage/processor/data.ts | 158 +- .../destinations/moengage/router/data.ts | 29 +- .../destinations/monday/dataDelivery/data.ts | 4 +- .../destinations/monday/maskedSecrets.ts | 4 + .../destinations/monday/network.ts | 157 +- .../destinations/monday/processor/data.ts | 56 +- .../destinations/monday/router/data.ts | 20 +- .../destinations/movable_ink/common.ts | 7 +- .../destinations/movable_ink/maskedSecrets.ts | 6 + test/integrations/destinations/mp/common.ts | 10 +- .../destinations/mp/deleteUsers/data.ts | 10 +- .../destinations/mp/maskedSecrets.ts | 9 + test/integrations/destinations/mp/network.ts | 14 +- .../destinations/mp/processor/data.ts | 1733 ++- .../destinations/mp/router/data.ts | 446 +- .../destinations/ometria/processor/data.ts | 227 +- .../destinations/ometria/router/data.ts | 26 +- .../optimizely_fullstack/network.ts | 11 +- .../optimizely_fullstack/processor/data.ts | 13 +- .../pardot/dataDelivery/constant.ts | 3 +- .../destinations/pardot/maskedSecrets.ts | 6 + .../destinations/pardot/network.ts | 3 +- .../destinations/pardot/router/data.ts | 33 +- .../pinterest_tag/maskedSecrets.ts | 4 + .../pinterest_tag/processor/data.ts | 23 +- .../destinations/pinterest_tag/router/data.ts | 11 +- .../destinations/pinterest_tag/step/data.ts | 19 +- .../reddit/dataDelivery/business.ts | 75 +- .../destinations/reddit/dataDelivery/oauth.ts | 13 +- .../destinations/reddit/maskedSecrets.ts | 4 + .../destinations/reddit/network.ts | 11 +- .../destinations/reddit/processor/data.ts | 65 +- .../destinations/reddit/router/data.ts | 31 +- .../destinations/redis/processor/data.ts | 17 +- .../destinations/refiner/maskedSecrets.ts | 4 + .../refiner/processor/groupTestData.ts | 5 +- .../refiner/processor/identifyTestData.ts | 5 +- .../refiner/processor/pageTestData.ts | 5 +- .../refiner/processor/trackTestData.ts | 5 +- .../refiner/processor/validationTestData.ts | 3 +- .../destinations/refiner/router/data.ts | 19 +- .../destinations/revenue_cat/maskedSecrets.ts | 11 + .../revenue_cat/processor/data.ts | 50 +- .../salesforce/dataDelivery/business.ts | 50 +- .../salesforce/dataDelivery/data.ts | 25 +- .../salesforce/dataDelivery/other.ts | 12 +- .../destinations/salesforce/maskedSecrets.ts | 6 + .../destinations/salesforce/network.ts | 35 +- .../destinations/salesforce/processor/data.ts | 27 +- .../destinations/salesforce/router/data.ts | 17 +- .../salesforce_oauth/dataDelivery/oauth.ts | 14 +- .../salesforce_oauth/maskedSecrets.ts | 4 + .../destinations/salesforce_oauth/network.ts | 5 +- .../dataDelivery/oauth.ts | 14 +- .../salesforce_oauth_sandbox/maskedSecrets.ts | 4 + .../salesforce_oauth_sandbox/network.ts | 5 +- .../destinations/segment/maskedSecrets.ts | 5 + .../destinations/segment/processor/data.ts | 21 +- .../destinations/sendgrid/deleteUsers/data.ts | 8 +- .../destinations/sendgrid/maskedSecrets.ts | 4 + .../destinations/sendgrid/network.ts | 15 +- .../destinations/sendgrid/processor/data.ts | 41 +- .../destinations/sendgrid/router/data.ts | 43 +- .../destinations/sfmc/maskedSecrets.ts | 4 + .../integrations/destinations/sfmc/network.ts | 3 +- .../destinations/sfmc/processor/data.ts | 48 +- .../destinations/sfmc/router/data.ts | 5 +- .../destinations/slack/processor/data.ts | 55 +- .../destinations/slack/router/data.ts | 7 +- .../snapchat_conversion/maskedSecrets.ts | 4 + .../snapchat_conversion/processor/data.ts | 127 +- .../snapchat_conversion/router/data.ts | 70 +- .../dataDelivery/business.ts | 3 +- .../dataDelivery/oauth.ts | 16 +- .../dataDelivery/other.ts | 9 +- .../snapchat_custom_audience/maskedSecrets.ts | 4 + .../snapchat_custom_audience/network.ts | 10 +- .../processor/data.ts | 77 +- .../snapchat_custom_audience/router/data.ts | 7 +- .../destinations/splitio/maskedSecrets.ts | 4 + .../destinations/splitio/processor/data.ts | 39 +- .../destinations/splitio/router/data.ts | 13 +- .../destinations/stormly/maskedSecrets.ts | 5 + .../destinations/stormly/processor/data.ts | 29 +- .../destinations/stormly/router/data.ts | 11 +- .../the_trade_desk/delivery/business.ts | 5 +- .../the_trade_desk/delivery/other.ts | 9 +- .../tiktok_ads/dataDelivery/business.ts | 15 +- .../tiktok_ads/dataDelivery/other.ts | 14 +- .../processor/data.ts | 42 +- .../destinations/topsort/maskedSecrets.ts | 4 + .../topsort/processor/trackClicksTestData.ts | 9 +- .../processor/trackImpressionsTestData.ts | 7 +- .../processor/trackPurchasesTestData.ts | 11 +- .../destinations/topsort/router/data.ts | 9 +- .../destinations/trengo/maskedSecrets.ts | 6 + .../destinations/trengo/network.ts | 33 +- .../destinations/trengo/processor/data.ts | 66 +- .../destinations/trengo/router/data.ts | 13 +- .../destinations/user/maskedSecrets.ts | 4 + .../integrations/destinations/user/network.ts | 23 +- .../destinations/user/processor/data.ts | 29 +- .../destinations/user/router/data.ts | 13 +- .../destinations/variance/maskedSecrets.ts | 5 + .../destinations/variance/processor/data.ts | 6 +- .../destinations/vitally/maskedSecrets.ts | 5 + .../destinations/vitally/processor/data.ts | 15 +- .../destinations/webengage/maskedSecrets.ts | 4 + .../destinations/webengage/processor/data.ts | 73 +- .../destinations/webhook/processor/data.ts | 11 +- .../destinations/wootric/maskedSecrets.ts | 10 + .../destinations/wootric/network.ts | 15 +- .../destinations/wootric/processor/data.ts | 106 +- .../destinations/wootric/router/data.ts | 146 +- .../destinations/wunderkind/router/data.ts | 123 +- .../destinations/x_audience/common.ts | 2 +- .../destinations/zendesk/maskedSecrets.ts | 13 + .../destinations/zendesk/network.ts | 98 +- .../destinations/zendesk/processor/data.ts | 99 +- .../destinations/zendesk/router/data.ts | 17 +- .../zoho/dataDelivery/business.ts | 25 +- test/integrations/testTypes.ts | 2 +- test/integrations/testUtils.ts | 60 +- .../removeRedundentFunctionsFromSecrets.ts | 73 + 400 files changed, 16332 insertions(+), 10344 deletions(-) delete mode 100644 src/v0/destinations/marketo_static_list/transform.test.js create mode 100644 test/integrations/common/secrets.ts create mode 100644 test/integrations/destinations/af/maskedSecrets.ts create mode 100644 test/integrations/destinations/airship/maskedSecrets.ts create mode 100644 test/integrations/destinations/am/maskedSecrets.ts create mode 100644 test/integrations/destinations/amazon_audience/maskedSecrets.ts create mode 100644 test/integrations/destinations/attentive_tag/maskedSecrets.ts create mode 100644 test/integrations/destinations/attribution/maskedSecrets.ts create mode 100644 test/integrations/destinations/bloomreach/maskedSecrets.ts create mode 100644 test/integrations/destinations/bloomreach_catalog/maskedSecrets.ts create mode 100644 test/integrations/destinations/blueshift/maskedSecrets.ts create mode 100644 test/integrations/destinations/braze/maskedSecrets.ts create mode 100644 test/integrations/destinations/campaign_manager/maskedSecrets.ts create mode 100644 test/integrations/destinations/candu/maskedSecrets.ts create mode 100644 test/integrations/destinations/canny/maskedSecrets.ts rename test/integrations/destinations/canny/{ => processor}/data.ts (98%) create mode 100644 test/integrations/destinations/clicksend/maskedSecrets.ts create mode 100644 test/integrations/destinations/cordial/maskedSecrets.ts create mode 100644 test/integrations/destinations/courier/maskedSecrets.ts create mode 100644 test/integrations/destinations/criteo_audience/maskedSecrets.ts create mode 100644 test/integrations/destinations/custify/maskedSecrets.ts create mode 100644 test/integrations/destinations/customerio/maskedSecrets.ts create mode 100644 test/integrations/destinations/customerio_audience/maskedSecrets.ts create mode 100644 test/integrations/destinations/delighted/maskedSecrets.ts create mode 100644 test/integrations/destinations/drip/maskedSecrets.ts create mode 100644 test/integrations/destinations/engage/maskedSecrets.ts create mode 100644 test/integrations/destinations/factorsai/maskedSecrets.ts create mode 100644 test/integrations/destinations/freshmarketer/maskedSecrets.ts create mode 100644 test/integrations/destinations/freshsales/maskedSecrets.ts create mode 100644 test/integrations/destinations/fullstory/maskedSecrets.ts create mode 100644 test/integrations/destinations/ga/maskedSecrets.ts create mode 100644 test/integrations/destinations/gladly/maskedSecrets.ts create mode 100644 test/integrations/destinations/google_adwords_enhanced_conversions/maskedSecrets.ts create mode 100644 test/integrations/destinations/google_adwords_offline_conversions/maskedSecrets.ts create mode 100644 test/integrations/destinations/google_adwords_remarketing_lists/maskedSecrets.ts create mode 100644 test/integrations/destinations/hs/maskedSecrets.ts create mode 100644 test/integrations/destinations/http/maskedSecrets.ts create mode 100644 test/integrations/destinations/impact/maskedSecrets.ts create mode 100644 test/integrations/destinations/intercom/maskedSecrets.ts create mode 100644 test/integrations/destinations/intercom_v2/maskedSecrets.ts create mode 100644 test/integrations/destinations/june/maskedSecrets.ts create mode 100644 test/integrations/destinations/klaviyo/maskedSecrets.ts create mode 100644 test/integrations/destinations/kustomer/maskedSecrets.ts create mode 100644 test/integrations/destinations/linkedin_ads/maskedSecrets.ts create mode 100644 test/integrations/destinations/mailchimp/maskedSecrets.ts create mode 100644 test/integrations/destinations/mailjet/maskedSecrets.ts create mode 100644 test/integrations/destinations/marketo/maskedSecrets.ts create mode 100644 test/integrations/destinations/marketo_static_list/maskedSecrets.ts create mode 100644 test/integrations/destinations/mautic/maskedSecrets.ts create mode 100644 test/integrations/destinations/moengage/maskedSecrets.ts create mode 100644 test/integrations/destinations/monday/maskedSecrets.ts create mode 100644 test/integrations/destinations/movable_ink/maskedSecrets.ts create mode 100644 test/integrations/destinations/mp/maskedSecrets.ts create mode 100644 test/integrations/destinations/pardot/maskedSecrets.ts create mode 100644 test/integrations/destinations/pinterest_tag/maskedSecrets.ts create mode 100644 test/integrations/destinations/reddit/maskedSecrets.ts create mode 100644 test/integrations/destinations/refiner/maskedSecrets.ts create mode 100644 test/integrations/destinations/revenue_cat/maskedSecrets.ts create mode 100644 test/integrations/destinations/salesforce/maskedSecrets.ts create mode 100644 test/integrations/destinations/salesforce_oauth/maskedSecrets.ts create mode 100644 test/integrations/destinations/salesforce_oauth_sandbox/maskedSecrets.ts create mode 100644 test/integrations/destinations/segment/maskedSecrets.ts create mode 100644 test/integrations/destinations/sendgrid/maskedSecrets.ts create mode 100644 test/integrations/destinations/sfmc/maskedSecrets.ts create mode 100644 test/integrations/destinations/snapchat_conversion/maskedSecrets.ts create mode 100644 test/integrations/destinations/snapchat_custom_audience/maskedSecrets.ts create mode 100644 test/integrations/destinations/splitio/maskedSecrets.ts create mode 100644 test/integrations/destinations/stormly/maskedSecrets.ts create mode 100644 test/integrations/destinations/topsort/maskedSecrets.ts create mode 100644 test/integrations/destinations/trengo/maskedSecrets.ts create mode 100644 test/integrations/destinations/user/maskedSecrets.ts create mode 100644 test/integrations/destinations/variance/maskedSecrets.ts create mode 100644 test/integrations/destinations/vitally/maskedSecrets.ts create mode 100644 test/integrations/destinations/webengage/maskedSecrets.ts create mode 100644 test/integrations/destinations/wootric/maskedSecrets.ts create mode 100644 test/integrations/destinations/zendesk/maskedSecrets.ts create mode 100644 test/scripts/removeRedundentFunctionsFromSecrets.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index 0eecb3e2626..4834a273d9b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -38,7 +38,7 @@ "-c", "jest.config.typescript.js", "component", - "--destination=adobe_analytics", + "--destination=monday", "--feature=processor" ], "console": "integratedTerminal", @@ -46,7 +46,8 @@ "runtimeArgs": ["--require", "${workspaceFolder}/node_modules/ts-node/register"], "env": { "NODE_ENV": "test", - "NODE_OPTIONS": "--no-node-snapshot" + "NODE_OPTIONS": "--no-node-snapshot", + "LOG_LEVEL": "silent" } } ] diff --git a/package-lock.json b/package-lock.json index a91352b4735..96651afbb80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.18", + "@rudderstack/integrations-lib": "^0.2.19", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", @@ -127,64 +127,51 @@ "typescript": "^5.0.4" } }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@amplitude/ua-parser-js": { "version": "0.7.24", + "resolved": "https://registry.npmjs.org/@amplitude/ua-parser-js/-/ua-parser-js-0.7.24.tgz", + "integrity": "sha512-VbQuJymJ20WEw0HtI2np7EdC3NJGUWi8+Xdbc7uk8WfMIF308T0howpzkQ3JFMN7ejnrcSM/OyNGveeE3TP3TA==", "license": "MIT", "engines": { "node": "*" } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "9.0.6", + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.7.2.tgz", + "integrity": "sha512-4gY54eEGEstClvEkGnwVkTkrx0sqwemEFG5OSRRn3tD91XH0+Q8XIkYIfo7IwEWPpJZwILb9GUXeShtplRc/eA==", "dev": true, "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.13.1" - } - }, - "node_modules/@apidevtools/json-schema-ref-parser/node_modules/argparse": { - "version": "1.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": { - "version": "3.14.1", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "@types/json-schema": "^7.0.15", + "js-yaml": "^4.1.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/philsturgeon" } }, "node_modules/@apidevtools/openapi-schemas": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", + "integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==", "dev": true, "license": "MIT", "engines": { @@ -193,6 +180,9 @@ }, "node_modules/@apidevtools/swagger-cli": { "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-hdDT3B6GLVovCsRZYDi3+wMcB1HfetTU20l2DC8zD3iFRNMC6QNAZG5fo/6PYeHWBEv7ri4MvnlKodhNB0nt7g==", + "deprecated": "This package has been abandoned. Please switch to using the actively maintained @redocly/cli", "dev": true, "license": "MIT", "dependencies": { @@ -210,6 +200,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -224,6 +216,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/argparse": { "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", "dependencies": { @@ -232,6 +226,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -240,6 +236,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -255,6 +253,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/cliui": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "license": "ISC", "dependencies": { @@ -265,6 +265,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -276,11 +278,15 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@apidevtools/swagger-cli/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -293,6 +299,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -301,6 +309,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/js-yaml": { "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "license": "MIT", "dependencies": { @@ -313,6 +323,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -324,6 +336,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -338,6 +352,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -349,6 +365,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -360,6 +378,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/wrap-ansi": { "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "license": "MIT", "dependencies": { @@ -373,11 +393,15 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/y18n": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true, "license": "ISC" }, "node_modules/@apidevtools/swagger-cli/node_modules/yargs": { "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "license": "MIT", "dependencies": { @@ -399,6 +423,8 @@ }, "node_modules/@apidevtools/swagger-cli/node_modules/yargs-parser": { "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "license": "ISC", "dependencies": { @@ -411,21 +437,25 @@ }, "node_modules/@apidevtools/swagger-methods": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz", + "integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==", "dev": true, "license": "MIT" }, "node_modules/@apidevtools/swagger-parser": { - "version": "10.1.0", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.1.1.tgz", + "integrity": "sha512-u/kozRnsPO/x8QtKYJOqoGtC4kH6yg1lfYkB9Au0WhYB0FNLpyFusttQtvhlwjtG3rOwiRz4D8DnnXa8iEpIKA==", "dev": true, "license": "MIT", "dependencies": { - "@apidevtools/json-schema-ref-parser": "9.0.6", + "@apidevtools/json-schema-ref-parser": "11.7.2", "@apidevtools/openapi-schemas": "^2.1.0", "@apidevtools/swagger-methods": "^3.0.2", "@jsdevtools/ono": "^7.1.3", - "ajv": "^8.6.3", + "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", - "call-me-maybe": "^1.0.1" + "call-me-maybe": "^1.0.2" }, "peerDependencies": { "openapi-types": ">=7" @@ -433,20 +463,22 @@ }, "node_modules/@aws-crypto/crc32": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz", + "integrity": "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", - "tslib": "^1.11.1" + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" } }, - "node_modules/@aws-crypto/crc32/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "node_modules/@aws-crypto/crc32c": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32c/-/crc32c-5.2.0.tgz", + "integrity": "sha512-+iWb8qaHLYKrNvGRbiYRHSdKRWhto5XlZUEBwDjYNf+ly5SVYG6zEoYIdxvf5R3zyeP16w4PLBn3rH1xc74Rag==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/util": "^5.2.0", @@ -456,6 +488,8 @@ }, "node_modules/@aws-crypto/sha1-browser": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha1-browser/-/sha1-browser-5.2.0.tgz", + "integrity": "sha512-OH6lveCFfcDjX4dbAvCFSYUjJZjDr/3XJ3xHtjn3Oj5b9RjojQo8npoLeA/bNwkOkrSQ0wgrHzXk4tDRxGKJeg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/supports-web-crypto": "^5.2.0", @@ -466,4695 +500,1683 @@ "tslib": "^2.6.2" } }, - "node_modules/@aws-crypto/sha256-browser": { - "version": "5.2.0", + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-js": "^5.2.0", - "@aws-crypto/supports-web-crypto": "^5.2.0", - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", - "@aws-sdk/util-locate-window": "^3.0.0", - "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/sha256-js": { - "version": "5.2.0", + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", + "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/supports-web-crypto": { - "version": "5.2.0", + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", "license": "Apache-2.0", "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-crypto/util": { + "node_modules/@aws-crypto/sha256-browser": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", + "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", "license": "Apache-2.0", "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-cognito-identity": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.650.0.tgz", - "integrity": "sha512-ng9Ta7emTgIAnUW52wi2KcNbAudGQPiXuPKJwtw67WQei3gHMpxvgCCRXP7AiB+LyB/fBURxraDkO5N+sPZp0w==", + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/client-sts": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", + "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", + "node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", + "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" }, "engines": { "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", + "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", "tslib": "^2.6.2" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", + "node_modules/@aws-crypto/util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", + "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-cognito-identity/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=14.0.0" } }, - "node_modules/@aws-sdk/client-personalize": { - "version": "3.642.0", + "node_modules/@aws-sdk/client-cognito-identity": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.758.0.tgz", + "integrity": "sha512-8bOXVYtf/0OUN0jXTIHLv3V0TAS6kvvCRAy7nmiL/fDde0O+ChW1WZU7CVPAOtFEpFCdKskDcxFspM7m1k6qyg==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/client-sts": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", + "node_modules/@aws-sdk/client-personalize": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-personalize/-/client-personalize-3.758.0.tgz", + "integrity": "sha512-DHySS2YZD3NK6dd1lA6L0y/3Ktkygls3Lk6htCI0MvjZo3BsNmL8iS2lfj5kn1CP53QkN+6658hqvTsjSbywSg==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", + "node_modules/@aws-sdk/client-s3": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.758.0.tgz", + "integrity": "sha512-f8SlhU9/93OC/WEI6xVJf/x/GoQFj9a/xXK6QCtr5fvCjfSLgMVFmKTiIl/tgtDRzxUDc8YS6EGtbHjJ3Y/atg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", + "@aws-crypto/sha1-browser": "5.2.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/middleware-bucket-endpoint": "3.734.0", + "@aws-sdk/middleware-expect-continue": "3.734.0", + "@aws-sdk/middleware-flexible-checksums": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-location-constraint": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-sdk-s3": "3.758.0", + "@aws-sdk/middleware-ssec": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/signature-v4-multi-region": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@aws-sdk/xml-builder": "3.734.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/eventstream-serde-browser": "^4.0.1", + "@smithy/eventstream-serde-config-resolver": "^4.0.1", + "@smithy/eventstream-serde-node": "^4.0.1", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-blob-browser": "^4.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/hash-stream-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/md5-js": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", + "@smithy/util-waiter": "^4.0.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", + "node_modules/@aws-sdk/client-sso": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.758.0.tgz", + "integrity": "sha512-BoGO6IIWrLyLxQG6txJw6RT2urmbtlwfggapNCrNPyYjlXpzTSJhBYjndg7TpDATFd0SXL0zm8y/tXsUXNkdYQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", + "node_modules/@aws-sdk/core": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.758.0.tgz", + "integrity": "sha512-0RswbdR9jt/XKemaLNuxi2gGr4xGlHyGxkTdhSQzCyUe9A9OPCoLl3rIESRguQEech+oJnbHk/wuiwHqTuP9sg==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "fast-xml-parser": "4.4.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" + "node_modules/@aws-sdk/core/node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^1.0.5" }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" - } - }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/@aws-sdk/credential-provider-cognito-identity": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.758.0.tgz", + "integrity": "sha512-y/rHZqyChlEkNRr59gn4hv0gjhJwGmdCdW0JI1K9p3P9p7EurWGjr2M6+goTn3ilOlcAwrl5oFKR5jLt27TkOA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.758.0.tgz", + "integrity": "sha512-N27eFoRrO6MeUNumtNHDW9WOiwfd59LPXPqDrIa3kWL/s+fOKFHb9xIcF++bAwtcZnAxKkgpDCUP+INNZskE+w==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.758.0.tgz", + "integrity": "sha512-Xt9/U8qUCiw1hihztWkNeIR+arg6P+yda10OuCHX6kFVx3auTlU7+hCqs3UxqniGU4dguHuftf3mRpi5/GJ33Q==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/property-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.758.0.tgz", + "integrity": "sha512-cymSKMcP5d+OsgetoIZ5QCe1wnp2Q/tq+uIxVdh9MbfdBBEnl9Ecq6dH6VlYS89sp4QKuxHxkWXVnbXU3Q19Aw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.758.0.tgz", + "integrity": "sha512-+DaMv63wiq7pJrhIQzZYMn4hSarKiizDoJRvyR7WGhnn0oQ/getX9Z0VNCV3i7lIFoLNTb7WMmQ9k7+z/uD5EQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-ini": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.758.0.tgz", + "integrity": "sha512-AzcY74QTPqcbXWVgjpPZ3HOmxQZYPROIBz2YINF0OQk0MhezDWV/O7Xec+K1+MPGQO3qS6EDrUUlnPLjsqieHA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.758.0.tgz", + "integrity": "sha512-x0FYJqcOLUCv8GLLFDYMXRAQKGjoM+L0BG4BiHYZRDf24yQWFCAZsCQAYKo6XZYh2qznbsW6f//qpyJ5b0QVKQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/client-sso": "3.758.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/token-providers": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.758.0.tgz", + "integrity": "sha512-XGguXhBqiCXMXRxcfCAVPlMbm3VyJTou79r/3mxWddHWF0XbhaQiBIbUz6vobVTD25YQRbWSmSch7VA8kI5Lrw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", + "node_modules/@aws-sdk/credential-providers": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.758.0.tgz", + "integrity": "sha512-BaGVBdm9ynsErIc/mLuUwJ1OQcL/pkhCuAm24jpsif3evZ5wgyZnEAZB2yRin+mQnQaQT3L+KvTbdKGfjL8+fQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", + "@aws-sdk/client-cognito-identity": "3.758.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/credential-provider-cognito-identity": "3.758.0", + "@aws-sdk/credential-provider-env": "3.758.0", + "@aws-sdk/credential-provider-http": "3.758.0", + "@aws-sdk/credential-provider-ini": "3.758.0", + "@aws-sdk/credential-provider-node": "3.758.0", + "@aws-sdk/credential-provider-process": "3.758.0", + "@aws-sdk/credential-provider-sso": "3.758.0", + "@aws-sdk/credential-provider-web-identity": "3.758.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/core": "^3.1.5", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", + "node_modules/@aws-sdk/lib-storage": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/lib-storage/-/lib-storage-3.758.0.tgz", + "integrity": "sha512-g07y7rA505zaTJNPTmvW4zYJA3gThFDE1be7kBUKhTKAdwv8jVSbOiAy2AhClXs2evSUoQiFFtD1xWxLRXPPRQ==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/smithy-client": "^4.1.6", + "buffer": "5.6.0", + "events": "3.3.0", + "stream-browserify": "3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" + "@aws-sdk/client-s3": "^3.758.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", + "node_modules/@aws-sdk/middleware-bucket-endpoint": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.734.0.tgz", + "integrity": "sha512-etC7G18aF7KdZguW27GE/wpbrNmYLVT755EsFc8kXpZj8D6AFKxc7OuveinJmiy0bYXAMspJUWsF6CrGpOw6CQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-arn-parser": "3.723.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-personalize/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "node_modules/@aws-sdk/middleware-expect-continue": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.734.0.tgz", + "integrity": "sha512-P38/v1l6HjuB2aFUewt7ueAW5IvKkFcv5dalPtbMGRhLeyivBOHwbCyuRKgVs7z7ClTpu9EaViEGki2jEQqEsQ==", + "license": "Apache-2.0", "dependencies": { + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "node_modules/@aws-sdk/middleware-flexible-checksums": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.758.0.tgz", + "integrity": "sha512-o8Rk71S08YTKLoSobucjnbj97OCGaXgpEDNKXpXaavUM5xLNoHCLSUPRCiEN86Ivqxg1n17Y2nSRhfbsveOXXA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@aws-crypto/crc32": "5.2.0", + "@aws-crypto/crc32c": "5.2.0", + "@aws-crypto/util": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-personalize/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.734.0.tgz", + "integrity": "sha512-LW7RRgSOHHBzWZnigNsDIzu3AiwtjeI2X66v+Wn1P1u+eXssy1+up4ZY/h+t2sU4LU36UvEf+jrZti9c6vRnFw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-personalize/node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], - "dependencies": { - "strnum": "^1.0.5" - }, - "bin": { - "fxparser": "src/cli/cli.js" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.637.0.tgz", - "integrity": "sha512-y6UC94fsMvhKbf0dzfnjVP1HePeGjplfcYfilZU1COIJLyTkMcUv4XcT4I407CGIrvgEafONHkiC09ygqUauNA==", + "node_modules/@aws-sdk/middleware-location-constraint": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.734.0.tgz", + "integrity": "sha512-EJEIXwCQhto/cBfHdm3ZOeLxd2NlJD+X2F+ZTOxzokuhBtY0IONfC/91hOo5tWQweerojwshSMHRCKzRv1tlwg==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha1-browser": "5.2.0", - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/client-sts": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-bucket-endpoint": "3.620.0", - "@aws-sdk/middleware-expect-continue": "3.620.0", - "@aws-sdk/middleware-flexible-checksums": "3.620.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-location-constraint": "3.609.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-sdk-s3": "3.635.0", - "@aws-sdk/middleware-ssec": "3.609.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/signature-v4-multi-region": "3.635.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@aws-sdk/xml-builder": "3.609.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/eventstream-serde-browser": "^3.0.6", - "@smithy/eventstream-serde-config-resolver": "^3.0.3", - "@smithy/eventstream-serde-node": "^3.0.5", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-blob-browser": "^3.1.2", - "@smithy/hash-node": "^3.0.3", - "@smithy/hash-stream-node": "^3.1.2", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/md5-js": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-stream": "^3.1.3", - "@smithy/util-utf8": "^3.0.0", - "@smithy/util-waiter": "^3.1.2", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.734.0.tgz", + "integrity": "sha512-mUMFITpJUW3LcKvFok176eI5zXAUomVtahb9IQBwLzkqFYOrMJvWAvoV4yuxrJ8TlQBG8gyEnkb9SnhZvjg67w==", "license": "Apache-2.0", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.734.0.tgz", + "integrity": "sha512-CUat2d9ITsFc2XsmeiRQO96iWpxSKYFjxvj27Hc7vo87YUHRnfMfnc8jw1EpxEwMcvBD7LsRa6vDNky6AjcrFA==", "license": "Apache-2.0", "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", + "node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.758.0.tgz", + "integrity": "sha512-6mJ2zyyHPYSV6bAcaFpsdoXZJeQlR1QgBnZZ6juY/+dcYiuyWCdyLUbGzSZSE7GTfx6i+9+QWFeoIMlWKgU63A==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-arn-parser": "3.723.0", + "@smithy/core": "^3.1.5", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", + "node_modules/@aws-sdk/middleware-ssec": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.734.0.tgz", + "integrity": "sha512-d4yd1RrPW/sspEXizq2NSOUivnheac6LPeLSLnaeTbBG9g1KqIqvCzP1TfXEqv2CrWfHEsWtJpX7oyjySSPvDQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.758.0.tgz", + "integrity": "sha512-iNyehQXtQlj69JCgfaOssgZD4HeYGOwxcaKeG6F+40cwBjTAi0+Ph1yfDwqk2qiBPIRWJ/9l2LodZbxiBqgrwg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@smithy/core": "^3.1.5", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", + "node_modules/@aws-sdk/nested-clients": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.758.0.tgz", + "integrity": "sha512-YZ5s7PSvyF3Mt2h1EQulCG93uybprNGbBkPmVuy/HMMfbFTt4iL3SbKjxqvOZelm86epFfj7pvK7FliI2WOEcg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.758.0", + "@aws-sdk/middleware-host-header": "3.734.0", + "@aws-sdk/middleware-logger": "3.734.0", + "@aws-sdk/middleware-recursion-detection": "3.734.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/region-config-resolver": "3.734.0", + "@aws-sdk/types": "3.734.0", + "@aws-sdk/util-endpoints": "3.743.0", + "@aws-sdk/util-user-agent-browser": "3.734.0", + "@aws-sdk/util-user-agent-node": "3.758.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/core": "^3.1.5", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/hash-node": "^4.0.1", + "@smithy/invalid-dependency": "^4.0.1", + "@smithy/middleware-content-length": "^4.0.1", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-retry": "^4.0.7", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/protocol-http": "^5.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.7", + "@smithy/util-defaults-mode-node": "^4.0.7", + "@smithy/util-endpoints": "^3.0.1", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.734.0.tgz", + "integrity": "sha512-Lvj1kPRC5IuJBr9DyJ9T9/plkh+EfKLy+12s/mykOy1JaKHDpvj+XGy2YO6YgYVOb8JFtaqloid+5COtje4JTQ==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", + "node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.758.0.tgz", + "integrity": "sha512-0RPCo8fYJcrenJ6bRtiUbFOSgQ1CX/GpvwtLU2Fam1tS9h2klKK8d74caeV6A1mIUvBU7bhyQ0wMGlwMtn3EYw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/middleware-sdk-s3": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/signature-v4": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", + "node_modules/@aws-sdk/token-providers": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.758.0.tgz", + "integrity": "sha512-ckptN1tNrIfQUaGWm/ayW1ddG+imbKN7HHhjFdS4VfItsP0QQOB0+Ov+tpgb4MoNR4JaUghMIVStjIeHN2ks1w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", + "@aws-sdk/nested-clients": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", + "node_modules/@aws-sdk/types": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.734.0.tgz", + "integrity": "sha512-o11tSPTT70nAkGV1fN9wm/hAIiLPyWX6SuGf+9JyTp7S/rC2cFWhR26MvA69nplcjNaXVzB0f+QFrLXXjOqCrg==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", + "node_modules/@aws-sdk/util-arn-parser": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.723.0.tgz", + "integrity": "sha512-ZhEfvUwNliOQROcAk34WJWVYTlTa4694kSVhDSjW6lE1bMataPnIN8A0ycukEzBXmd8ZSoBcQLn6lKGl7XIJ5w==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.743.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.743.0.tgz", + "integrity": "sha512-sN1l559zrixeh5x+pttrnd0A3+r34r0tmPkJ/eaaMaAzXqsmKU/xYre9K3FNnsSS1J1k4PEfk/nHDTVUgFYjnw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "@smithy/util-endpoints": "^3.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.723.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.723.0.tgz", + "integrity": "sha512-Yf2CS10BqK688DRsrKI/EO6B8ff5J86NXe4C+VCysK7UOgN0l1zOTeTukZ3H8Q9tYYX3oaF1961o8vRkFm7Nmw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.734.0.tgz", + "integrity": "sha512-xQTCus6Q9LwUuALW+S76OL0jcWtMOVu14q+GoLnWPUM7QeUw963oQcLhF7oq0CtaLLKyl4GOUfcwc773Zmwwng==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", + "@aws-sdk/types": "3.734.0", + "@smithy/types": "^4.1.0", + "bowser": "^2.11.0", "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.758.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.758.0.tgz", + "integrity": "sha512-A5EZw85V6WhoKMV2hbuFRvb9NPlxEErb4HPO6/SPXYY4QrjprIzScHxikqcWv1w4J3apB1wto9LPU3IMsYtfrw==", "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@aws-sdk/middleware-user-agent": "3.758.0", + "@aws-sdk/types": "3.734.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", + "node_modules/@aws-sdk/xml-builder": { + "version": "3.734.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.734.0.tgz", + "integrity": "sha512-Zrjxi5qwGEcUsJ0ru7fRtW74WcTS0rbLcehoFB+rN1GRi2hbLcFaYs4PwVA5diLeAJH0gszv3x4Hr/S87MfbKQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", - "license": "Apache-2.0", + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "license": "MIT", "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", + "node_modules/@babel/core": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.9.tgz", + "integrity": "sha512-lWBYIrF7qK5+GjY5Uy+/hEgp8OJWOD/rpy74GplYRhEauvbHDeFB8t5hPOZxCZ0Oxf4Cc36tK51/l3ymJysrKw==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.9", + "@babel/types": "^7.26.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.9.tgz", + "integrity": "sha512-kEWdzjOAUMW4hAyrzJ0ZaTOu9OmpyDIQicIh0zg0EEcEkYXZb2TjtBhnHi2ViX7PKwZqF4xwqfAm299/QMP3lg==", + "dev": true, + "license": "MIT", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-s3/node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", "bin": { - "fxparser": "src/cli/cli.js" + "semver": "bin/semver.js" } }, - "node_modules/@aws-sdk/client-sso": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.650.0.tgz", - "integrity": "sha512-YKm14gCMChD/jlCisFlsVqB8HJujR41bl4Fup2crHwNJxhD/9LTnzwMiVVlBqlXr41Sfa6fSxczX2AMP8NM14A==", - "license": "Apache-2.0", + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.637.0", - "license": "Apache-2.0", + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" + "@babel/core": "^7.0.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", - "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", - "tslib": "^2.6.2" - }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16.0.0" + "node": ">=6.9.0" } }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", - "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso-oidc/node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], - "dependencies": { - "strnum": "^1.0.5" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sso/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.637.0.tgz", - "integrity": "sha512-xUi7x4qDubtA8QREtlblPuAcn91GS/09YVEY/RwU7xCY0aqGuFwgszAANlha4OUIqva8oVj2WO4gJuG+iaSnhw==", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.637.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/credential-provider-node": "3.637.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/client-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.637.0.tgz", - "integrity": "sha512-+KjLvgX5yJYROWo3TQuwBJlHCY0zz9PsLuEolmXQn0BVK1L/m9GteZHtd+rEdAoDGBpE0Xqjy1oz5+SmtsaRUw==", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.635.0", - "@aws-sdk/middleware-host-header": "3.620.0", - "@aws-sdk/middleware-logger": "3.609.0", - "@aws-sdk/middleware-recursion-detection": "3.620.0", - "@aws-sdk/middleware-user-agent": "3.637.0", - "@aws-sdk/region-config-resolver": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@aws-sdk/util-user-agent-browser": "3.609.0", - "@aws-sdk/util-user-agent-node": "3.614.0", - "@smithy/config-resolver": "^3.0.5", - "@smithy/core": "^2.4.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/hash-node": "^3.0.3", - "@smithy/invalid-dependency": "^3.0.3", - "@smithy/middleware-content-length": "^3.0.5", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.15", - "@smithy/util-defaults-mode-node": "^3.0.15", - "@smithy/util-endpoints": "^2.0.5", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", - "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-env": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.620.1.tgz", - "integrity": "sha512-ExuILJ2qLW5ZO+rgkNRj0xiAipKT16Rk77buvPP8csR7kkCflT/gXTyzRe/uzIiETTxM7tr8xuO9MP/DQXqkfg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-http": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.635.0.tgz", - "integrity": "sha512-iJyRgEjOCQlBMXqtwPLIKYc7Bsc6nqjrZybdMDenPDa+kmLg7xh8LxHsu9088e+2/wtLicE34FsJJIfzu3L82g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.637.0.tgz", - "integrity": "sha512-h+PFCWfZ0Q3Dx84SppET/TFpcQHmxFW8/oV9ArEvMilw4EBN+IlxgbL0CnHwjHW64szcmrM0mbebjEfHf4FXmw==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.637.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-node": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.637.0.tgz", - "integrity": "sha512-yoEhoxJJfs7sPVQ6Is939BDQJZpZCoUgKr/ySse4YKOZ24t4VqgHA6+wV7rYh+7IW24Rd91UTvEzSuHYTlxlNA==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.620.1", - "@aws-sdk/credential-provider-http": "3.635.0", - "@aws-sdk/credential-provider-ini": "3.637.0", - "@aws-sdk/credential-provider-process": "3.620.1", - "@aws-sdk/credential-provider-sso": "3.637.0", - "@aws-sdk/credential-provider-web-identity": "3.621.0", - "@aws-sdk/types": "3.609.0", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-process": { - "version": "3.620.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.620.1.tgz", - "integrity": "sha512-hWqFMidqLAkaV9G460+1at6qa9vySbjQKKc04p59OT7lZ5cO5VH5S4aI05e+m4j364MBROjjk2ugNvfNf/8ILg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.637.0.tgz", - "integrity": "sha512-Mvz+h+e62/tl+dVikLafhv+qkZJ9RUb8l2YN/LeKMWkxQylPT83CPk9aimVhCV89zth1zpREArl97+3xsfgQvA==", - "dependencies": { - "@aws-sdk/client-sso": "3.637.0", - "@aws-sdk/token-providers": "3.614.0", - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.621.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.621.0.tgz", - "integrity": "sha512-w7ASSyfNvcx7+bYGep3VBgC3K6vEdLmlpjT7nSIHxxQf+WSdvy+HynwJosrpZax0sK5q0D1Jpn/5q+r5lwwW6w==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.621.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-host-header": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.620.0.tgz", - "integrity": "sha512-VMtPEZwqYrII/oUkffYsNWY9PZ9xpNJpMgmyU0rlDQ25O1c0Hk3fJmZRe6pEkAJ0omD7kLrqGl1DUjQVxpd/Rg==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-logger": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.609.0.tgz", - "integrity": "sha512-S62U2dy4jMDhDFDK5gZ4VxFdWzCtLzwbYyFZx2uvPYTECkepLUfzLic2BHg2Qvtu4QjX+oGE3P/7fwaGIsGNuQ==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.620.0.tgz", - "integrity": "sha512-nh91S7aGK3e/o1ck64sA/CyoFw+gAYj2BDOnoNa6ouyCrVJED96ZXWbhye/fz9SgmNUZR2g7GdVpiLpMKZoI5w==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.637.0.tgz", - "integrity": "sha512-EYo0NE9/da/OY8STDsK2LvM4kNa79DBsf4YVtaG4P5pZ615IeFsD8xOHZeuJmUrSMlVQ8ywPRX7WMucUybsKug==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-endpoints": "3.637.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/region-config-resolver": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.614.0.tgz", - "integrity": "sha512-vDCeMXvic/LU0KFIUjpC3RiSTIkkvESsEfbVHiHH0YINfl8HnEqR5rj+L8+phsCeVg2+LmYwYxd5NRz4PHxt5g==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/token-providers": { - "version": "3.614.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.614.0.tgz", - "integrity": "sha512-okItqyY6L9IHdxqs+Z116y5/nda7rHxLvROxtAJdLavWTYDydxrZstImNgGWTeVdmc0xX2gJCI77UYUTQWnhRw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.614.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@aws-sdk/util-endpoints": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.637.0.tgz", - "integrity": "sha512-pAqOKUHeVWHEXXDIp/qoMk/6jyxIb6GGjnK1/f8dKHtKIEs4tKsnnL563gceEvdad53OPXIt86uoevCcCzmBnw==", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "@smithy/util-endpoints": "^2.0.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/client-sts/node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], - "dependencies": { - "strnum": "^1.0.5" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, - "node_modules/@aws-sdk/core": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.649.0.tgz", - "integrity": "sha512-dheG/X2y25RHE7K+TlS32kcy7TgDg1OpWV44BQRoE0OBPAWmFR1D1qjjTZ7WWrdqRPKzcnDj1qED8ncyncOX8g==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/core": "^2.4.1", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/property-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/signature-v4": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-middleware": "^3.0.4", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/core/node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], - "dependencies": { - "strnum": "^1.0.5" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, - "node_modules/@aws-sdk/credential-provider-cognito-identity": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.650.0.tgz", - "integrity": "sha512-QwtRKWKE6vv78Be3Lm5GmFkSl2DGWSOXPZYgkbo8GsD6SP0ParUvJvUE8wsPS5c4tUXC9KuvJAwYAYNFN10Fnw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-cognito-identity": "3.650.0", - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.649.0.tgz", - "integrity": "sha512-tViwzM1dauksA3fdRjsg0T8mcHklDa8EfveyiQKK6pUJopkqV6FQx+X5QNda0t/LrdEVlFZvwHNdXqOEfc83TA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.649.0.tgz", - "integrity": "sha512-ODAJ+AJJq6ozbns6ejGbicpsQ0dyMOpnGlg0J9J0jITQ05DKQZ581hdB8APDOZ9N8FstShP6dLZflSj8jb5fNA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-stream": "^3.1.4", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.650.0.tgz", - "integrity": "sha512-uBra5YjzS/gWSekAogfqJfY6c+oKQkkou7Cjc4d/cpMNvQtF1IBdekJ7NaE1RfsDEz3uH1+Myd07YWZAJo/2Qw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-ini": "3.650.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.650.0.tgz", - "integrity": "sha512-x2M9buZxIsKuUbuDgkGHhAKYBpn0/rYdKlwuFuOhXyyAcnhvPj0lgNF2KE4ld/GF1mKr7FF/uV3G9lM6PFaYmA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.649.0.tgz", - "integrity": "sha512-XVk3WsDa0g3kQFPmnCH/LaCtGY/0R2NDv7gscYZSXiBZcG/fixasglTprgWSp8zcA0t7tEIGu9suyjz8ZwhymQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.649.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.649.0.tgz", - "integrity": "sha512-6VYPQpEVpU+6DDS/gLoI40ppuNM5RPIEprK30qZZxnhTr5wyrGOeJ7J7wbbwPOZ5dKwta290BiJDU2ipV8Y9BQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.650.0.tgz", - "integrity": "sha512-069nkhcwximbvyGiAC6Fr2G+yrG/p1S3NQ5BZ2cMzB1hgUKo6TvgFK7nriYI4ljMQ+UWxqPwIdTqiUmn2iJmhg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-sso": "3.650.0", - "@aws-sdk/token-providers": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.649.0.tgz", - "integrity": "sha512-ZBqr+JuXI9RiN+4DSZykMx5gxpL8Dr3exIfFhxMiwAP3DQojwl0ub8ONjMuAjq9OvmX6n+jHZL6fBnNgnNFC8w==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sso-oidc": "^3.649.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.650.0.tgz", - "integrity": "sha512-e99xHtzfL3fwS5j2gzMXRikoux/vNO3JKlxYSTnz/yfcReYRtRIz4iNrbqOzYFIQFlPS11ToXXXcwl6FOzNM7Q==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-cognito-identity": "3.650.0", - "@aws-sdk/client-sso": "3.650.0", - "@aws-sdk/client-sts": "3.650.0", - "@aws-sdk/credential-provider-cognito-identity": "3.650.0", - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-ini": "3.650.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/client-sso-oidc": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.650.0.tgz", - "integrity": "sha512-6J7IS0f8ovhvbIAZaynOYP+jPX8344UlTjwHxjaXHgFvI8axu3+NslKtEEV5oHLhgzDvrKbinsu5lgE2n4Sqng==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/client-sts": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.650.0.tgz", - "integrity": "sha512-ISK0ZQYA7O5/WYgslpWy956lUBudGC9d7eL0FFbiL0j50N80Gx3RUv22ezvZgxJWE0W3DqNr4CE19sPYn4Lw8g==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/client-sso-oidc": "3.650.0", - "@aws-sdk/core": "3.649.0", - "@aws-sdk/credential-provider-node": "3.650.0", - "@aws-sdk/middleware-host-header": "3.649.0", - "@aws-sdk/middleware-logger": "3.649.0", - "@aws-sdk/middleware-recursion-detection": "3.649.0", - "@aws-sdk/middleware-user-agent": "3.649.0", - "@aws-sdk/region-config-resolver": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@aws-sdk/util-user-agent-browser": "3.649.0", - "@aws-sdk/util-user-agent-node": "3.649.0", - "@smithy/config-resolver": "^3.0.6", - "@smithy/core": "^2.4.1", - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/hash-node": "^3.0.4", - "@smithy/invalid-dependency": "^3.0.4", - "@smithy/middleware-content-length": "^3.0.6", - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-body-length-node": "^3.0.0", - "@smithy/util-defaults-mode-browser": "^3.0.16", - "@smithy/util-defaults-mode-node": "^3.0.16", - "@smithy/util-endpoints": "^2.1.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.650.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.650.0.tgz", - "integrity": "sha512-x2M9buZxIsKuUbuDgkGHhAKYBpn0/rYdKlwuFuOhXyyAcnhvPj0lgNF2KE4ld/GF1mKr7FF/uV3G9lM6PFaYmA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.649.0", - "@aws-sdk/credential-provider-http": "3.649.0", - "@aws-sdk/credential-provider-process": "3.649.0", - "@aws-sdk/credential-provider-sso": "3.650.0", - "@aws-sdk/credential-provider-web-identity": "3.649.0", - "@aws-sdk/types": "3.649.0", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.650.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.649.0.tgz", - "integrity": "sha512-XVk3WsDa0g3kQFPmnCH/LaCtGY/0R2NDv7gscYZSXiBZcG/fixasglTprgWSp8zcA0t7tEIGu9suyjz8ZwhymQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-sts": "^3.649.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.649.0.tgz", - "integrity": "sha512-IY43r256LhKAvdEVQO/FPdUyVpcZS5EVxh/WHVdNzuN1bNLoUK2rIzuZqVA0EGguvCxoXVmQv9m50GvG7cGktg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.649.0.tgz", - "integrity": "sha512-x5DiLpZDG/AJmCIBnE3Xhpwy35QIo3WqNiOpw6ExVs1NydbM/e90zFPSfhME0FM66D/WorigvluBxxwjxDm/GA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/lib-storage": { - "version": "3.637.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/lib-storage/-/lib-storage-3.637.0.tgz", - "integrity": "sha512-HiNGOP4a1QrCWwO1joKw4mCp19nLXoF9K52PislBaYDI35IlHC3DP6MeOg5zmElwtL1GtEHFBy5olfPWPsLyLg==", - "dependencies": { - "@smithy/abort-controller": "^3.1.1", - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/smithy-client": "^3.2.0", - "buffer": "5.6.0", - "events": "3.3.0", - "stream-browserify": "3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@aws-sdk/client-s3": "^3.637.0" - } - }, - "node_modules/@aws-sdk/middleware-bucket-endpoint": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.620.0.tgz", - "integrity": "sha512-eGLL0W6L3HDb3OACyetZYOWpHJ+gLo0TehQKeQyy2G8vTYXqNTeqYhuI6up9HVjBzU9eQiULVQETmgQs7TFaRg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-arn-parser": "3.568.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-bucket-endpoint/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-expect-continue": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.620.0.tgz", - "integrity": "sha512-QXeRFMLfyQ31nAHLbiTLtk0oHzG9QLMaof5jIfqcUwnOkO8YnQdeqzakrg1Alpy/VQ7aqzIi8qypkBe2KXZz0A==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-expect-continue/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums": { - "version": "3.620.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.620.0.tgz", - "integrity": "sha512-ftz+NW7qka2sVuwnnO1IzBku5ccP+s5qZGeRTPgrKB7OzRW85gthvIo1vQR2w+OwHFk7WJbbhhWwbCbktnP4UA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/crc32": "5.2.0", - "@aws-crypto/crc32c": "5.2.0", - "@aws-sdk/types": "3.609.0", - "@smithy/is-array-buffer": "^3.0.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-flexible-checksums/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.649.0.tgz", - "integrity": "sha512-PjAe2FocbicHVgNNwdSZ05upxIO7AgTPFtQLpnIAmoyzMcgv/zNB5fBn3uAnQSAeEPPCD+4SYVEUD1hw1ZBvEg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-location-constraint": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.609.0.tgz", - "integrity": "sha512-xzsdoTkszGVqGVPjUmgoP7TORiByLueMHieI1fhQL888WPdqctwAx3ES6d/bA9Q/i8jnc6hs+Fjhy8UvBTkE9A==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-location-constraint/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-logger": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.649.0.tgz", - "integrity": "sha512-qdqRx6q7lYC6KL/NT9x3ShTL0TBuxdkCczGzHzY3AnOoYUjnCDH7Vlq867O6MAvb4EnGNECFzIgtkZkQ4FhY5w==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.649.0.tgz", - "integrity": "sha512-IPnO4wlmaLRf6IYmJW2i8gJ2+UPXX0hDRv1it7Qf8DpBW+lGyF2rnoN7NrFX0WIxdGOlJF1RcOr/HjXb2QeXfQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.635.0.tgz", - "integrity": "sha512-RLdYJPEV4JL/7NBoFUs7VlP90X++5FlJdxHz0DzCjmiD3qCviKy+Cym3qg1gBgHwucs5XisuClxDrGokhAdTQw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.635.0", - "@aws-sdk/types": "3.609.0", - "@aws-sdk/util-arn-parser": "3.568.0", - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-stream": "^3.1.3", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@aws-sdk/core": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.635.0.tgz", - "integrity": "sha512-i1x/E/sgA+liUE1XJ7rj1dhyXpAKO1UKFUcTTHXok2ARjWTvszHnSXMOsB77aPbmn0fUp1JTx2kHUAZ1LVt5Bg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/core": "^2.4.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "fast-xml-parser": "4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-sdk-s3/node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], - "dependencies": { - "strnum": "^1.0.5" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, - "node_modules/@aws-sdk/middleware-ssec": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.609.0.tgz", - "integrity": "sha512-GZSD1s7+JswWOTamVap79QiDaIV7byJFssBW68GYjyRS5EBjNfwA/8s+6uE6g39R3ojyTbYOmvcANoZEhSULXg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-ssec/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.649.0.tgz", - "integrity": "sha512-q6sO10dnCXoxe9thobMJxekhJumzd1j6dxcE1+qJdYKHJr6yYgWbogJqrLCpWd30w0lEvnuAHK8lN2kWLdJxJw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@aws-sdk/util-endpoints": "3.649.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.649.0.tgz", - "integrity": "sha512-xURBvdQXvRvca5Du8IlC5FyCj3pkw8Z75+373J3Wb+vyg8GjD14HfKk1Je1HCCQDyIE9VB/scYDcm9ri0ppePw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.635.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.635.0.tgz", - "integrity": "sha512-J6QY4/invOkpogCHjSaDON1hF03viPpOnsrzVuCvJMmclS/iG62R4EY0wq1alYll0YmSdmKlpJwHMWwGtqK63Q==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-sdk-s3": "3.635.0", - "@aws-sdk/types": "3.609.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/signature-v4": "^4.1.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/signature-v4-multi-region/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/types": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.649.0.tgz", - "integrity": "sha512-PuPw8RysbhJNlaD2d/PzOTf8sbf4Dsn2b7hwyGh7YVG3S75yTpxSAZxrnhKsz9fStgqFmnw/jUfV/G+uQAeTVw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-arn-parser": { - "version": "3.568.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.568.0.tgz", - "integrity": "sha512-XUKJWWo+KOB7fbnPP0+g/o5Ulku/X53t7i/h+sPHr5xxYTJJ9CYnbToo95mzxe7xWvkLrsNtJ8L+MnNn9INs2w==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-endpoints": { - "version": "3.649.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.649.0.tgz", - "integrity": "sha512-bZI1Wc3R/KibdDVWFxX/N4AoJFG4VJ92Dp4WYmOrVD6VPkb8jPz7ZeiYc7YwPl8NoDjYyPneBV0lEoK/V8OKAA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.649.0", - "@smithy/types": "^3.4.0", - "@smithy/util-endpoints": "^2.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-locate-window": { - "version": "3.568.0", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.609.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/types": "^3.3.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/util-user-agent-browser/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.614.0", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.609.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/util-user-agent-node/node_modules/@aws-sdk/types": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", - "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-sdk/xml-builder": { - "version": "3.609.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.609.0.tgz", - "integrity": "sha512-l9XxNcA4HX98rwCC2/KoiWcmEiRfZe4G+mYwDbCFT87JIMj6GBhLDkAzr/W8KAaA2IDr8Vc6J8fZPgVulxxfMA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.23.5", - "license": "MIT", - "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.23.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.23.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.7", - "@babel/parser": "^7.23.6", - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.7", - "@babel/types": "^7.23.6", - "convert-source-map": "^2.0.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.3", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/generator": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/generator/node_modules/jsesc": { - "version": "2.5.2", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", - "lru-cache": "^5.1.1", - "semver": "^6.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.15" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.23.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.22.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.23.8", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.7", - "@babel/types": "^7.23.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.23.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/template": { - "version": "7.22.15", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.23.7", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.6", - "@babel/types": "^7.23.6", - "debug": "^4.3.1", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/types": { - "version": "7.23.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "dev": true, - "license": "MIT" - }, - "node_modules/@bugsnag/browser": { - "version": "7.22.3", - "license": "MIT", - "dependencies": { - "@bugsnag/core": "^7.19.0" - } - }, - "node_modules/@bugsnag/core": { - "version": "7.19.0", - "license": "MIT", - "dependencies": { - "@bugsnag/cuid": "^3.0.0", - "@bugsnag/safe-json-stringify": "^6.0.0", - "error-stack-parser": "^2.0.3", - "iserror": "0.0.2", - "stack-generator": "^2.0.3" - } - }, - "node_modules/@bugsnag/cuid": { - "version": "3.0.2", - "license": "MIT" - }, - "node_modules/@bugsnag/js": { - "version": "7.22.3", - "license": "MIT", - "dependencies": { - "@bugsnag/browser": "^7.22.3", - "@bugsnag/node": "^7.22.3" - } - }, - "node_modules/@bugsnag/node": { - "version": "7.22.3", - "license": "MIT", - "dependencies": { - "@bugsnag/core": "^7.19.0", - "byline": "^5.0.0", - "error-stack-parser": "^2.0.2", - "iserror": "^0.0.2", - "pump": "^3.0.0", - "stack-generator": "^2.0.3" - } - }, - "node_modules/@bugsnag/safe-json-stringify": { - "version": "6.0.0", - "license": "MIT" - }, - "node_modules/@colors/colors": { - "version": "1.6.0", - "license": "MIT", - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@commitlint/cli": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/format": "^17.8.1", - "@commitlint/lint": "^17.8.1", - "@commitlint/load": "^17.8.1", - "@commitlint/read": "^17.8.1", - "@commitlint/types": "^17.8.1", - "execa": "^5.0.0", - "lodash.isfunction": "^3.0.9", - "resolve-from": "5.0.0", - "resolve-global": "1.0.0", - "yargs": "^17.0.0" - }, - "bin": { - "commitlint": "cli.js" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/config-validator": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/types": "^17.8.1", - "ajv": "^8.11.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/execute-rule": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/load": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/config-validator": "^17.8.1", - "@commitlint/execute-rule": "^17.8.1", - "@commitlint/resolve-extends": "^17.8.1", - "@commitlint/types": "^17.8.1", - "@types/node": "20.5.1", - "chalk": "^4.1.0", - "cosmiconfig": "^8.0.0", - "cosmiconfig-typescript-loader": "^4.0.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "lodash.uniq": "^4.5.0", - "resolve-from": "^5.0.0", - "ts-node": "^10.8.1", - "typescript": "^4.6.4 || ^5.2.2" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/resolve-extends": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/config-validator": "^17.8.1", - "@commitlint/types": "^17.8.1", - "import-fresh": "^3.0.0", - "lodash.mergewith": "^4.6.2", - "resolve-from": "^5.0.0", - "resolve-global": "^1.0.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@commitlint/types": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/cli/node_modules/@types/node": { - "version": "20.5.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/cli/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@commitlint/cli/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@commitlint/cli/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/cli/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/cli/node_modules/cosmiconfig-typescript-loader": { - "version": "4.4.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=v14.21.3" - }, - "peerDependencies": { - "@types/node": "*", - "cosmiconfig": ">=7", - "ts-node": ">=10", - "typescript": ">=4" - } - }, - "node_modules/@commitlint/cli/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/cli/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/config-conventional": { - "version": "17.8.1", + "node_modules/@babel/helpers": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.9.tgz", + "integrity": "sha512-Mz/4+y8udxBKdmzt/UjPACs4G3j5SshJJEFFKxlCGPydG4JAHXxjWjAwjd09tf6oINvl1VfMJo+nB7H2YKQ0dA==", "dev": true, "license": "MIT", "dependencies": { - "conventional-changelog-conventionalcommits": "^6.1.0" + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9" }, "engines": { - "node": ">=v14" + "node": ">=6.9.0" } }, - "node_modules/@commitlint/config-validator": { - "version": "18.4.4", + "node_modules/@babel/parser": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.9.tgz", + "integrity": "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "@commitlint/types": "^18.4.4", - "ajv": "^8.11.0" + "@babel/types": "^7.26.9" }, - "engines": { - "node": ">=v18" - } - }, - "node_modules/@commitlint/ensure": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@commitlint/types": "^17.8.1", - "lodash.camelcase": "^4.3.0", - "lodash.kebabcase": "^4.1.1", - "lodash.snakecase": "^4.1.1", - "lodash.startcase": "^4.4.0", - "lodash.upperfirst": "^4.3.1" + "bin": { + "parser": "bin/babel-parser.js" }, "engines": { - "node": ">=v14" + "node": ">=6.0.0" } }, - "node_modules/@commitlint/ensure/node_modules/@commitlint/types": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=v14" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/ensure/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "@babel/helper-plugin-utils": "^7.8.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/ensure/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" + "@babel/helper-plugin-utils": "^7.12.13" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/ensure/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/ensure/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/ensure/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/ensure/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" + "node": ">=6.9.0" }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/execute-rule": { - "version": "18.4.4", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=v18" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/format": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/types": "^17.8.1", - "chalk": "^4.1.0" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { - "node": ">=v14" - } - }, - "node_modules/@commitlint/format/node_modules/@commitlint/types": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0" + "node": ">=6.9.0" }, - "engines": { - "node": ">=v14" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/format/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "@babel/helper-plugin-utils": "^7.10.4" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/format/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" + "@babel/helper-plugin-utils": "^7.8.0" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/format/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/format/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/format/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@commitlint/format/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" + "node": ">=6.9.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/types": "^17.8.1", - "semver": "7.5.4" + "@babel/helper-plugin-utils": "^7.10.4" }, - "engines": { - "node": ">=v14" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/@commitlint/types": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=v14" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "@babel/helper-plugin-utils": "^7.10.4" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" + "@babel/helper-plugin-utils": "^7.8.0" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/is-ignored/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/is-ignored/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/is-ignored/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/is-ignored": "^17.8.1", - "@commitlint/parse": "^17.8.1", - "@commitlint/rules": "^17.8.1", - "@commitlint/types": "^17.8.1" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": ">=v14" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint/node_modules/@commitlint/types": { - "version": "17.8.1", + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": ">=v14" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", + "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@commitlint/lint/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@babel/template": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=6.9.0" } }, - "node_modules/@commitlint/lint/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@babel/traverse": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.9.tgz", + "integrity": "sha512-ZYW7L+pL8ahU5fXmNbPF+iZFHCv5scFak7MZ9bwaRPLUhHh7QQEMjZUg0HevihoqCM5iSYHN61EyCoZvqC+bxg==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.9", + "@babel/parser": "^7.26.9", + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.9", + "debug": "^4.3.1", + "globals": "^11.1.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=6.9.0" } }, - "node_modules/@commitlint/lint/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/lint/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/@commitlint/lint/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@babel/types": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.9.tgz", + "integrity": "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@commitlint/load": { - "version": "18.4.4", + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true, + "license": "MIT" + }, + "node_modules/@bugsnag/browser": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.25.0.tgz", + "integrity": "sha512-PzzWy5d9Ly1CU1KkxTB6ZaOw/dO+CYSfVtqxVJccy832e6+7rW/dvSw5Jy7rsNhgcKSKjZq86LtNkPSvritOLA==", "license": "MIT", - "optional": true, "dependencies": { - "@commitlint/config-validator": "^18.4.4", - "@commitlint/execute-rule": "^18.4.4", - "@commitlint/resolve-extends": "^18.4.4", - "@commitlint/types": "^18.4.4", - "chalk": "^4.1.0", - "cosmiconfig": "^8.3.6", - "cosmiconfig-typescript-loader": "^5.0.0", - "lodash.isplainobject": "^4.0.6", - "lodash.merge": "^4.6.2", - "lodash.uniq": "^4.5.0", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=v18" + "@bugsnag/core": "^7.25.0" } }, - "node_modules/@commitlint/load/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, + "node_modules/@bugsnag/core": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/core/-/core-7.25.0.tgz", + "integrity": "sha512-JZLak1b5BVzy77CPcklViZrppac/pE07L3uSDmfSvFYSCGReXkik2txOgV05VlF9EDe36dtUAIIV7iAPDfFpQQ==", "license": "MIT", - "optional": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "@bugsnag/cuid": "^3.0.0", + "@bugsnag/safe-json-stringify": "^6.0.0", + "error-stack-parser": "^2.0.3", + "iserror": "0.0.2", + "stack-generator": "^2.0.3" } }, - "node_modules/@commitlint/load/node_modules/chalk": { - "version": "4.1.2", - "dev": true, + "node_modules/@bugsnag/cuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.2.1.tgz", + "integrity": "sha512-zpvN8xQ5rdRWakMd/BcVkdn2F8HKlDSbM3l7duueK590WmI1T0ObTLc1V/1e55r14WNjPd5AJTYX4yPEAFVi+Q==", + "license": "MIT" + }, + "node_modules/@bugsnag/js": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/js/-/js-7.25.0.tgz", + "integrity": "sha512-d8n8SyKdRUz8jMacRW1j/Sj/ckhKbIEp49+Dacp3CS8afRgfMZ//NXhUFFXITsDP5cXouaejR9fx4XVapYXNgg==", "license": "MIT", - "optional": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "@bugsnag/browser": "^7.25.0", + "@bugsnag/node": "^7.25.0" } }, - "node_modules/@commitlint/load/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, + "node_modules/@bugsnag/node": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@bugsnag/node/-/node-7.25.0.tgz", + "integrity": "sha512-KlxBaJ8EREEsfKInybAjTO9LmdDXV3cUH5+XNXyqUZrcRVuPOu4j4xvljh+n24ifok/wbFZTKVXUzrN4iKIeIA==", "license": "MIT", - "optional": true, "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "@bugsnag/core": "^7.25.0", + "byline": "^5.0.0", + "error-stack-parser": "^2.0.2", + "iserror": "^0.0.2", + "pump": "^3.0.0", + "stack-generator": "^2.0.3" } }, - "node_modules/@commitlint/load/node_modules/color-name": { - "version": "1.1.4", - "dev": true, + "node_modules/@bugsnag/safe-json-stringify": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz", + "integrity": "sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==", + "license": "MIT" + }, + "node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", "license": "MIT", - "optional": true + "engines": { + "node": ">=0.1.90" + } }, - "node_modules/@commitlint/load/node_modules/has-flag": { - "version": "4.0.0", + "node_modules/@commitlint/cli": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-17.8.1.tgz", + "integrity": "sha512-ay+WbzQesE0Rv4EQKfNbSMiJJ12KdKTDzIt0tcK4k11FdsWmtwP0Kp1NWMOUswfIWo6Eb7p7Ln721Nx9FLNBjg==", "dev": true, "license": "MIT", - "optional": true, + "dependencies": { + "@commitlint/format": "^17.8.1", + "@commitlint/lint": "^17.8.1", + "@commitlint/load": "^17.8.1", + "@commitlint/read": "^17.8.1", + "@commitlint/types": "^17.8.1", + "execa": "^5.0.0", + "lodash.isfunction": "^3.0.9", + "resolve-from": "5.0.0", + "resolve-global": "1.0.0", + "yargs": "^17.0.0" + }, + "bin": { + "commitlint": "cli.js" + }, "engines": { - "node": ">=8" + "node": ">=v14" } }, - "node_modules/@commitlint/load/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@commitlint/config-conventional": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-17.8.1.tgz", + "integrity": "sha512-NxCOHx1kgneig3VLauWJcDWS40DVjg7nKOpBEEK9E5fjJpQqLCilcnKkIIjdBH98kEO1q3NpE5NSrZ2kl/QGJg==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "has-flag": "^4.0.0" + "conventional-changelog-conventionalcommits": "^6.1.0" }, "engines": { - "node": ">=8" + "node": ">=v14" } }, - "node_modules/@commitlint/message": { + "node_modules/@commitlint/config-validator": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-17.8.1.tgz", + "integrity": "sha512-UUgUC+sNiiMwkyiuIFR7JG2cfd9t/7MV8VB4TZ+q02ZFkHoduUS4tJGsCBWvBOGD9Btev6IecPMvlWUfJorkEA==", "dev": true, "license": "MIT", + "dependencies": { + "@commitlint/types": "^17.8.1", + "ajv": "^8.11.0" + }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/parse": { + "node_modules/@commitlint/ensure": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-17.8.1.tgz", + "integrity": "sha512-xjafwKxid8s1K23NFpL8JNo6JnY/ysetKo8kegVM7c8vs+kWLP8VrQq+NbhgVlmCojhEDbzQKp4eRXSjVOGsow==", "dev": true, "license": "MIT", "dependencies": { "@commitlint/types": "^17.8.1", - "conventional-changelog-angular": "^6.0.0", - "conventional-commits-parser": "^4.0.0" + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "lodash.startcase": "^4.4.0", + "lodash.upperfirst": "^4.3.1" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/parse/node_modules/@commitlint/types": { + "node_modules/@commitlint/execute-rule": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-17.8.1.tgz", + "integrity": "sha512-JHVupQeSdNI6xzA9SqMF+p/JjrHTcrJdI02PwesQIDCIGUrv04hicJgCcws5nzaoZbROapPs0s6zeVHoxpMwFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/format": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-17.8.1.tgz", + "integrity": "sha512-f3oMTyZ84M9ht7fb93wbCKmWxO5/kKSbwuYvS867duVomoOsgrgljkGGIztmT/srZnaiGbaK8+Wf8Ik2tSr5eg==", "dev": true, "license": "MIT", "dependencies": { + "@commitlint/types": "^17.8.1", "chalk": "^4.1.0" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/parse/node_modules/ansi-styles": { + "node_modules/@commitlint/format/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -5167,8 +2189,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@commitlint/parse/node_modules/chalk": { + "node_modules/@commitlint/format/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -5182,8 +2206,10 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@commitlint/parse/node_modules/color-convert": { + "node_modules/@commitlint/format/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5193,21 +2219,27 @@ "node": ">=7.0.0" } }, - "node_modules/@commitlint/parse/node_modules/color-name": { + "node_modules/@commitlint/format/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, - "node_modules/@commitlint/parse/node_modules/has-flag": { + "node_modules/@commitlint/format/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/@commitlint/parse/node_modules/supports-color": { + "node_modules/@commitlint/format/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -5217,34 +2249,102 @@ "node": ">=8" } }, - "node_modules/@commitlint/read": { + "node_modules/@commitlint/is-ignored": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-17.8.1.tgz", + "integrity": "sha512-UshMi4Ltb4ZlNn4F7WtSEugFDZmctzFpmbqvpyxD3la510J+PLcnyhf9chs7EryaRFJMdAKwsEKfNK0jL/QM4g==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/top-level": "^17.8.1", "@commitlint/types": "^17.8.1", - "fs-extra": "^11.0.0", - "git-raw-commits": "^2.0.11", - "minimist": "^1.2.6" + "semver": "7.5.4" + }, + "engines": { + "node": ">=v14" + } + }, + "node_modules/@commitlint/is-ignored/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@commitlint/is-ignored/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@commitlint/is-ignored/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/@commitlint/lint": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-17.8.1.tgz", + "integrity": "sha512-aQUlwIR1/VMv2D4GXSk7PfL5hIaFSfy6hSHV94O8Y27T5q+DlDEgd/cZ4KmVI+MWKzFfCTiTuWqjfRSfdRllCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/is-ignored": "^17.8.1", + "@commitlint/parse": "^17.8.1", + "@commitlint/rules": "^17.8.1", + "@commitlint/types": "^17.8.1" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/read/node_modules/@commitlint/types": { + "node_modules/@commitlint/load": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-17.8.1.tgz", + "integrity": "sha512-iF4CL7KDFstP1kpVUkT8K2Wl17h2yx9VaR1ztTc8vzByWWcbO/WaKwxsnCOqow9tVAlzPfo1ywk9m2oJ9ucMqA==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@commitlint/config-validator": "^17.8.1", + "@commitlint/execute-rule": "^17.8.1", + "@commitlint/resolve-extends": "^17.8.1", + "@commitlint/types": "^17.8.1", + "@types/node": "20.5.1", + "chalk": "^4.1.0", + "cosmiconfig": "^8.0.0", + "cosmiconfig-typescript-loader": "^4.0.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "lodash.uniq": "^4.5.0", + "resolve-from": "^5.0.0", + "ts-node": "^10.8.1", + "typescript": "^4.6.4 || ^5.2.2" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/read/node_modules/ansi-styles": { + "node_modules/@commitlint/load/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -5257,8 +2357,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@commitlint/read/node_modules/chalk": { + "node_modules/@commitlint/load/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -5272,8 +2374,10 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@commitlint/read/node_modules/color-convert": { + "node_modules/@commitlint/load/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5283,34 +2387,27 @@ "node": ">=7.0.0" } }, - "node_modules/@commitlint/read/node_modules/color-name": { + "node_modules/@commitlint/load/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, - "node_modules/@commitlint/read/node_modules/fs-extra": { - "version": "11.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/@commitlint/read/node_modules/has-flag": { + "node_modules/@commitlint/load/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/@commitlint/read/node_modules/supports-color": { + "node_modules/@commitlint/load/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -5320,115 +2417,102 @@ "node": ">=8" } }, - "node_modules/@commitlint/resolve-extends": { - "version": "18.4.4", + "node_modules/@commitlint/message": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.8.1.tgz", + "integrity": "sha512-6bYL1GUQsD6bLhTH3QQty8pVFoETfFQlMn2Nzmz3AOLqRVfNNtXBaSY0dhZ0dM6A2MEq4+2d7L/2LP8TjqGRkA==", "dev": true, "license": "MIT", - "optional": true, - "dependencies": { - "@commitlint/config-validator": "^18.4.4", - "@commitlint/types": "^18.4.4", - "import-fresh": "^3.0.0", - "lodash.mergewith": "^4.6.2", - "resolve-from": "^5.0.0", - "resolve-global": "^1.0.0" - }, "engines": { - "node": ">=v18" + "node": ">=v14" } }, - "node_modules/@commitlint/rules": { + "node_modules/@commitlint/parse": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-17.8.1.tgz", + "integrity": "sha512-/wLUickTo0rNpQgWwLPavTm7WbwkZoBy3X8PpkUmlSmQJyWQTj0m6bDjiykMaDt41qcUbfeFfaCvXfiR4EGnfw==", "dev": true, "license": "MIT", "dependencies": { - "@commitlint/ensure": "^17.8.1", - "@commitlint/message": "^17.8.1", - "@commitlint/to-lines": "^17.8.1", "@commitlint/types": "^17.8.1", - "execa": "^5.0.0" + "conventional-changelog-angular": "^6.0.0", + "conventional-commits-parser": "^4.0.0" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/rules/node_modules/@commitlint/types": { + "node_modules/@commitlint/read": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-17.8.1.tgz", + "integrity": "sha512-Fd55Oaz9irzBESPCdMd8vWWgxsW3OWR99wOntBDHgf9h7Y6OOHjWEdS9Xzen1GFndqgyoaFplQS5y7KZe0kO2w==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.1.0" + "@commitlint/top-level": "^17.8.1", + "@commitlint/types": "^17.8.1", + "fs-extra": "^11.0.0", + "git-raw-commits": "^2.0.11", + "minimist": "^1.2.6" }, "engines": { "node": ">=v14" } }, - "node_modules/@commitlint/rules/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@commitlint/rules/node_modules/chalk": { - "version": "4.1.2", + "node_modules/@commitlint/read/node_modules/fs-extra": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", + "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", "dev": true, "license": "MIT", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=14.14" } }, - "node_modules/@commitlint/rules/node_modules/color-convert": { - "version": "2.0.1", + "node_modules/@commitlint/resolve-extends": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-17.8.1.tgz", + "integrity": "sha512-W/ryRoQ0TSVXqJrx5SGkaYuAaE/BUontL1j1HsKckvM6e5ZaG0M9126zcwL6peKSuIetJi7E87PRQF8O86EW0Q==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "@commitlint/config-validator": "^17.8.1", + "@commitlint/types": "^17.8.1", + "import-fresh": "^3.0.0", + "lodash.mergewith": "^4.6.2", + "resolve-from": "^5.0.0", + "resolve-global": "^1.0.0" }, "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@commitlint/rules/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@commitlint/rules/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "node": ">=v14" } }, - "node_modules/@commitlint/rules/node_modules/supports-color": { - "version": "7.2.0", + "node_modules/@commitlint/rules": { + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-17.8.1.tgz", + "integrity": "sha512-2b7OdVbN7MTAt9U0vKOYKCDsOvESVXxQmrvuVUZ0rGFMCrCPJWWP1GJ7f0lAypbDAhaGb8zqtdOr47192LBrIA==", "dev": true, "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@commitlint/ensure": "^17.8.1", + "@commitlint/message": "^17.8.1", + "@commitlint/to-lines": "^17.8.1", + "@commitlint/types": "^17.8.1", + "execa": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=v14" } }, "node_modules/@commitlint/to-lines": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-17.8.1.tgz", + "integrity": "sha512-LE0jb8CuR/mj6xJyrIk8VLz03OEzXFgLdivBytoooKO5xLt5yalc8Ma5guTWobw998sbR3ogDd+2jed03CFmJA==", "dev": true, "license": "MIT", "engines": { @@ -5437,6 +2521,8 @@ }, "node_modules/@commitlint/top-level": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-17.8.1.tgz", + "integrity": "sha512-l6+Z6rrNf5p333SHfEte6r+WkOxGlWK4bLuZKbtf/2TXRN+qhrvn1XE63VhD8Oe9oIHQ7F7W1nG2k/TJFhx2yA==", "dev": true, "license": "MIT", "dependencies": { @@ -5447,22 +2533,24 @@ } }, "node_modules/@commitlint/types": { - "version": "18.4.4", + "version": "17.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-17.8.1.tgz", + "integrity": "sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "chalk": "^4.1.0" }, "engines": { - "node": ">=v18" + "node": ">=v14" } }, "node_modules/@commitlint/types/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -5475,9 +2563,10 @@ }, "node_modules/@commitlint/types/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5491,9 +2580,10 @@ }, "node_modules/@commitlint/types/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "color-name": "~1.1.4" }, @@ -5503,24 +2593,27 @@ }, "node_modules/@commitlint/types/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@commitlint/types/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", - "optional": true, "engines": { "node": ">=8" } }, "node_modules/@commitlint/types/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -5530,6 +2623,8 @@ }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "license": "MIT", "dependencies": { @@ -5541,6 +2636,8 @@ }, "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5550,6 +2647,8 @@ }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", "license": "MIT", "dependencies": { "colorspace": "1.1.x", @@ -5576,6 +2675,8 @@ }, "node_modules/@dependents/detective-less": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@dependents/detective-less/-/detective-less-3.0.2.tgz", + "integrity": "sha512-1YUvQ+e0eeTWAHoN8Uz2x2U37jZs6IGutiIE5LXId7cxfUGhtZjzxE06FdUiuiRrW+UE0vNCdSNPH2lY4dQCOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5588,6 +2689,8 @@ }, "node_modules/@digitalroute/cz-conventional-changelog-for-jira": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@digitalroute/cz-conventional-changelog-for-jira/-/cz-conventional-changelog-for-jira-8.0.1.tgz", + "integrity": "sha512-I7uNQ2R5LnDYVhQ01sfNvaxqe1PutXyDl8Kltj4L8uDa1LTYqQgWWp3yEj3XYDNjhUjsAheHW0lsmF1oiAjWVg==", "dev": true, "license": "MIT", "dependencies": { @@ -5609,20 +2712,27 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -5630,6 +2740,8 @@ }, "node_modules/@eslint/eslintrc": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "license": "MIT", "dependencies": { "ajv": "^6.12.4", @@ -5651,6 +2763,8 @@ }, "node_modules/@eslint/eslintrc/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -5665,10 +2779,14 @@ }, "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "license": "MIT" }, "node_modules/@eslint/js": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -5676,16 +2794,27 @@ }, "node_modules/@ewoudenberg/difflib": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@ewoudenberg/difflib/-/difflib-0.1.0.tgz", + "integrity": "sha512-OU5P5mJyD3OoWYMWY+yIgwvgNS9cFAU10f+DDuvtogcWQOoJIsQ4Hy2McSfUfhKjq8L0FuWVb4Rt7kgA+XK86A==", "dependencies": { "heap": ">= 0.2.0" } }, + "node_modules/@hapi/bourne": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-3.0.0.tgz", + "integrity": "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==", + "license": "BSD-3-Clause" + }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -5694,6 +2823,8 @@ }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "license": "Apache-2.0", "engines": { "node": ">=12.22" @@ -5704,11 +2835,16 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", "license": "BSD-3-Clause" }, "node_modules/@hutson/parse-repository-url": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz", + "integrity": "sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==", "dev": true, "license": "Apache-2.0", "engines": { @@ -5717,10 +2853,14 @@ }, "node_modules/@ioredis/commands": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", "license": "MIT" }, "node_modules/@isaacs/cliui": { "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, "license": "ISC", "dependencies": { @@ -5736,7 +2876,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -5748,6 +2890,8 @@ }, "node_modules/@isaacs/cliui/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -5759,11 +2903,15 @@ }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -5780,6 +2928,8 @@ }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5794,6 +2944,8 @@ }, "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5810,6 +2962,8 @@ }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "license": "ISC", "dependencies": { @@ -5825,6 +2979,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", "dependencies": { @@ -5833,6 +2989,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -5841,6 +2999,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -5853,6 +3013,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "license": "MIT", "dependencies": { @@ -5865,6 +3027,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -5876,6 +3040,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -5890,6 +3056,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -5901,6 +3069,8 @@ }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, "license": "MIT", "engines": { @@ -5909,6 +3079,8 @@ }, "node_modules/@jest/console": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "license": "MIT", "dependencies": { @@ -5925,6 +3097,8 @@ }, "node_modules/@jest/console/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -5939,6 +3113,8 @@ }, "node_modules/@jest/console/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -5954,6 +3130,8 @@ }, "node_modules/@jest/console/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5965,11 +3143,15 @@ }, "node_modules/@jest/console/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/console/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -5978,6 +3160,8 @@ }, "node_modules/@jest/console/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -5989,6 +3173,8 @@ }, "node_modules/@jest/core": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "license": "MIT", "dependencies": { @@ -6035,6 +3221,8 @@ }, "node_modules/@jest/core/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -6049,6 +3237,8 @@ }, "node_modules/@jest/core/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -6064,6 +3254,8 @@ }, "node_modules/@jest/core/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6075,11 +3267,15 @@ }, "node_modules/@jest/core/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/core/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -6088,6 +3284,8 @@ }, "node_modules/@jest/core/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -6099,6 +3297,8 @@ }, "node_modules/@jest/environment": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "license": "MIT", "dependencies": { @@ -6113,6 +3313,8 @@ }, "node_modules/@jest/expect": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6125,6 +3327,8 @@ }, "node_modules/@jest/expect-utils": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "license": "MIT", "dependencies": { @@ -6136,6 +3340,8 @@ }, "node_modules/@jest/fake-timers": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6152,6 +3358,8 @@ }, "node_modules/@jest/globals": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6166,6 +3374,8 @@ }, "node_modules/@jest/reporters": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "license": "MIT", "dependencies": { @@ -6208,6 +3418,8 @@ }, "node_modules/@jest/reporters/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -6222,6 +3434,8 @@ }, "node_modules/@jest/reporters/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -6237,6 +3451,8 @@ }, "node_modules/@jest/reporters/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6248,11 +3464,16 @@ }, "node_modules/@jest/reporters/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/reporters/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -6272,6 +3493,8 @@ }, "node_modules/@jest/reporters/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -6280,6 +3503,8 @@ }, "node_modules/@jest/reporters/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -6291,6 +3516,8 @@ }, "node_modules/@jest/schemas": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "license": "MIT", "dependencies": { @@ -6302,6 +3529,8 @@ }, "node_modules/@jest/source-map": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "license": "MIT", "dependencies": { @@ -6315,6 +3544,8 @@ }, "node_modules/@jest/test-result": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "license": "MIT", "dependencies": { @@ -6329,6 +3560,8 @@ }, "node_modules/@jest/test-sequencer": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "license": "MIT", "dependencies": { @@ -6343,6 +3576,8 @@ }, "node_modules/@jest/transform": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "license": "MIT", "dependencies": { @@ -6368,6 +3603,8 @@ }, "node_modules/@jest/transform/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -6382,6 +3619,8 @@ }, "node_modules/@jest/transform/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -6397,6 +3636,8 @@ }, "node_modules/@jest/transform/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6408,11 +3649,15 @@ }, "node_modules/@jest/transform/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/transform/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -6421,6 +3666,8 @@ }, "node_modules/@jest/transform/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -6432,6 +3679,8 @@ }, "node_modules/@jest/types": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "license": "MIT", "dependencies": { @@ -6448,6 +3697,8 @@ }, "node_modules/@jest/types/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -6462,6 +3713,8 @@ }, "node_modules/@jest/types/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -6477,6 +3730,8 @@ }, "node_modules/@jest/types/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6488,11 +3743,15 @@ }, "node_modules/@jest/types/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/@jest/types/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -6501,6 +3760,8 @@ }, "node_modules/@jest/types/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -6511,20 +3772,24 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", "engines": { @@ -6532,7 +3797,9 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "license": "MIT", "engines": { @@ -6540,12 +3807,16 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6555,18 +3826,22 @@ }, "node_modules/@jsdevtools/ono": { "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true, "license": "MIT" }, "node_modules/@koa/router": { - "version": "12.0.1", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@koa/router/-/router-12.0.2.tgz", + "integrity": "sha512-sYcHglGKTxGF+hQ6x67xDfkE9o+NhVlRHBqq6gLywaMc6CojK/5vFZByphdonKinYlMLkEkacm+HEse9HzwgTA==", "license": "MIT", "dependencies": { "debug": "^4.3.4", "http-errors": "^2.0.0", "koa-compose": "^4.1.0", "methods": "^1.1.2", - "path-to-regexp": "^6.2.1" + "path-to-regexp": "^6.3.0" }, "engines": { "node": ">= 12" @@ -6576,6 +3851,7 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -6595,6 +3871,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", "dependencies": { "semver": "^6.0.0" }, @@ -6609,16 +3886,21 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/@ndhoule/extend": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@ndhoule/extend/-/extend-2.0.0.tgz", + "integrity": "sha512-xb77tVVGDGwjy25a6RmBiiBQ9uvxhkG0OEpVkQ74oNFsy9u+4PGp5BIIblmJZmJBMgXiKxZtkr4GcmHCNVubBQ==", "license": "MIT" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -6630,6 +3912,8 @@ }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "license": "MIT", "engines": { "node": ">= 8" @@ -6637,6 +3921,8 @@ }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -6648,6 +3934,8 @@ }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "license": "MIT", "optional": true, @@ -6660,6 +3948,7 @@ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -6670,27 +3959,32 @@ "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -6699,32 +3993,38 @@ "node_modules/@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" }, "node_modules/@pyroscope/nodejs": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/@pyroscope/nodejs/-/nodejs-0.2.9.tgz", "integrity": "sha512-pIw4pIqcNZTZxTUuV0OUI18UZEmx9lT2GaT75ny6FKVe2L1gxAwTCf5TKk8VsnUGY66buUkyaTHcTm7fy0BP/Q==", + "license": "Apache-2.0", "dependencies": { "axios": "^0.28.0", "debug": "^4.3.3", @@ -6739,6 +4039,8 @@ }, "node_modules/@pyroscope/nodejs/node_modules/axios": { "version": "0.28.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.1.tgz", + "integrity": "sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.0", @@ -6746,14 +4048,19 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "license": "MIT" + }, "node_modules/@rudderstack/integrations-lib": { - "version": "0.2.18", - "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.18.tgz", - "integrity": "sha512-cDL4t9nzt0O87jcC4htiz2HdAiibfaHx+AgBju1wKZXGTfvduZ6HmIQcyYQtfkv1uXuH2YCUdnI6l7sWowCv2w==", + "version": "0.2.20", + "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.20.tgz", + "integrity": "sha512-upXlQI+TiyZimQroBkDnSmo27z6WJYuSbtektR00vLNfSrc483ThIbfZiCLsa/UnWN5tR4vW9Kg1Xg5+hJi8oA==", "license": "MIT", "dependencies": { "axios": "^1.4.0", - "crypto": "^1.0.1", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.1.0", "fast-xml-parser": "^4.5.0", @@ -6771,13 +4078,14 @@ } }, "node_modules/@rudderstack/integrations-lib/node_modules/uuid": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz", - "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], + "license": "MIT", "bin": { "uuid": "dist/esm/bin/uuid" } @@ -6785,42 +4093,48 @@ "node_modules/@rudderstack/json-template-engine": { "version": "0.19.5", "resolved": "https://registry.npmjs.org/@rudderstack/json-template-engine/-/json-template-engine-0.19.5.tgz", - "integrity": "sha512-lA45cp8caboMECfNk/CXuP45hCx+W09mclEDiqqTQXilY1hdWp+r/zpcOBzFGZWSxIdrAp5cfhIYnUENx3XX5g==" + "integrity": "sha512-lA45cp8caboMECfNk/CXuP45hCx+W09mclEDiqqTQXilY1hdWp+r/zpcOBzFGZWSxIdrAp5cfhIYnUENx3XX5g==", + "license": "MIT" }, "node_modules/@rudderstack/workflow-engine": { - "version": "0.8.13", + "version": "0.8.19", + "resolved": "https://registry.npmjs.org/@rudderstack/workflow-engine/-/workflow-engine-0.8.19.tgz", + "integrity": "sha512-w/AoIVlOvFahWBN6wtnwbQjAMGi15m8Lyw/2LuRaH7QO9Vl7yQhkNiyRiDq0MF6dQ9aiSzaxkoz0fowdrjMvPg==", "license": "MIT", "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", - "@rudderstack/json-template-engine": "^0.17.1", + "@rudderstack/json-template-engine": "^0.19.5", "jsonata": "^2.0.5", "lodash": "^4.17.21", - "object-sizeof": "^2.6.4", - "yaml": "^2.4.3" + "object-sizeof": "^2.6.5", + "yaml": "^2.6.0" } }, - "node_modules/@rudderstack/workflow-engine/node_modules/@rudderstack/json-template-engine": { - "version": "0.17.1", - "license": "MIT" - }, "node_modules/@shopify/jest-koa-mocks": { - "version": "5.1.1", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.3.1.tgz", + "integrity": "sha512-BRxgfXmV1jMYXGhiGJamta22YoEJxL94qrxyZ/aXg2gWHjDjF6zpNapTfCUNbHJwOW7/tzylkHs53ac8xTZBBw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "license": "MIT", "dependencies": { "koa": "^2.13.4", "node-mocks-http": "^1.11.0" }, "engines": { - "node": "^14.17.0 || >=16.0.0" + "node": ">=18.12.0" } }, "node_modules/@sinclair/typebox": { "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true, "license": "MIT" }, "node_modules/@sindresorhus/is": { "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz", + "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", "dev": true, "license": "MIT", "engines": { @@ -6828,7 +4142,9 @@ } }, "node_modules/@sinonjs/commons": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -6837,6 +4153,8 @@ }, "node_modules/@sinonjs/fake-timers": { "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -6844,945 +4162,754 @@ } }, "node_modules/@smithy/abort-controller": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.2.tgz", - "integrity": "sha512-b5g+PNujlfqIib9BjkNB108NyO5aZM/RXjfOCXRCqXQ1oPnIkfvdORrztbGgCZdPe/BN/MKDlrGA7PafKPM2jw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.1.tgz", + "integrity": "sha512-fiUIYgIgRjMWznk6iLJz35K2YxSLHzLBA/RC6lBrKfQ8fHbPfvk7Pk9UvpKoHgJjI18MnbPuEju53zcVy6KF1g==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/chunked-blob-reader": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-3.0.0.tgz", - "integrity": "sha512-sbnURCwjF0gSToGlsBiAmd1lRCmSn72nu9axfJu5lIx6RUEgHu6GwTMbqCdhQSi0Pumcm5vFxsi9XWXb2mTaoA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/chunked-blob-reader-native": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-3.0.0.tgz", - "integrity": "sha512-VDkpCYW+peSuM4zJip5WDfqvg2Mo/e8yxOv3VF1m11y7B8KKMKVFtmZWDe36Fvk8rGuWrPZHHXZ7rR7uM5yWyg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-base64": "^3.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/config-resolver": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.6.tgz", - "integrity": "sha512-j7HuVNoRd8EhcFp0MzcUb4fG40C7BcyshH+fAd3Jhd8bINNFvEQYBrZoS/SK6Pun9WPlfoI8uuU2SMz8DsEGlA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", - "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/core": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.4.1.tgz", - "integrity": "sha512-7cts7/Oni7aCHebHGiBeWoz5z+vmH+Vx2Z/UW3XtXMslcxI3PEwBZxNinepwZjixS3n12fPc247PHWmjU7ndsQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.0.0.tgz", + "integrity": "sha512-+sKqDBQqb036hh4NPaUiEkYFkTUGYzRsn3EuFhyfQfMy6oGHEUJDurLP9Ufb5dasr/XiAmPNMr6wa9afjQB+Gw==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-retry": "^3.0.16", - "@smithy/middleware-serde": "^3.0.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/core/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@smithy/chunked-blob-reader-native": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.0.0.tgz", + "integrity": "sha512-R9wM2yPmfEMsUmlMlIgSzOyICs0x9uu7UTHoccMyt7BWw8shcGM8HqB355+BZCPBcySvbTYMs62EgEQkNxz2ig==", "license": "Apache-2.0", "dependencies": { + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/core/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@smithy/config-resolver": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.0.1.tgz", + "integrity": "sha512-Igfg8lKu3dRVkTSEm98QpZUvKEOa71jDX4vKRcvJVyRc3UgN3j7vFMf0s7xLQhYmKa8kyJGQgUJDOV5V3neVlQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/core/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@smithy/core": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.1.5.tgz", + "integrity": "sha512-HLclGWPkCsekQgsyzxLhCQLa8THWXtB5PxyYN+2O6nkyLt550KQKTlbV2D1/j5dNIQapAZM1+qFnpBFxZQkgCA==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-stream": "^4.1.2", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/credential-provider-imds": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.1.tgz", - "integrity": "sha512-4z/oTWpRF2TqQI3aCM89/PWu3kim58XU4kOCTtuTJnoaS4KT95cPWMxbQfTN2vzcOe96SOKO8QouQW/+ESB1fQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.1.tgz", + "integrity": "sha512-l/qdInaDq1Zpznpmev/+52QomsJNZ3JkTl5yrTl02V6NBgJOQ4LY0SFw/8zsMwj3tLe8vqiIuwF6nxaEwgf6mg==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/property-provider": "^3.1.4", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-codec": { - "version": "3.1.2", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.0.1.tgz", + "integrity": "sha512-Q2bCAAR6zXNVtJgifsU16ZjKGqdw/DyecKNgIgi7dlqw04fqDu0mnq+JmGphqheypVc64CYq3azSuCpAdFk2+A==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/crc32": "5.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-hex-encoding": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-browser": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-3.0.6.tgz", - "integrity": "sha512-2hM54UWQUOrki4BtsUI1WzmD13/SeaqT/AB3EUJKbcver/WgKNaiJ5y5F5XXuVe6UekffVzuUDrBZVAA3AWRpQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.0.1.tgz", + "integrity": "sha512-HbIybmz5rhNg+zxKiyVAnvdM3vkzjE6ccrJ620iPL8IXcJEntd3hnBl+ktMwIy12Te/kyrSbUb8UCdnUT4QEdA==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-serde-universal": "^3.0.5", - "@smithy/types": "^3.3.0", + "@smithy/eventstream-serde-universal": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-config-resolver": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-3.0.3.tgz", - "integrity": "sha512-NVTYjOuYpGfrN/VbRQgn31x73KDLfCXCsFdad8DiIc3IcdxL+dYA9zEQPyOP7Fy2QL8CPy2WE4WCUD+ZsLNfaQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.0.1.tgz", + "integrity": "sha512-lSipaiq3rmHguHa3QFF4YcCM3VJOrY9oq2sow3qlhFY+nBSTF/nrO82MUQRPrxHQXA58J5G1UnU2WuJfi465BA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-node": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-3.0.5.tgz", - "integrity": "sha512-+upXvnHNyZP095s11jF5dhGw/Ihzqwl5G+/KtMnoQOpdfC3B5HYCcDVG9EmgkhJMXJlM64PyN5gjJl0uXFQehQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.0.1.tgz", + "integrity": "sha512-o4CoOI6oYGYJ4zXo34U8X9szDe3oGjmHgsMGiZM0j4vtNoT+h80TLnkUcrLZR3+E6HIxqW+G+9WHAVfl0GXK0Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-serde-universal": "^3.0.5", - "@smithy/types": "^3.3.0", + "@smithy/eventstream-serde-universal": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/eventstream-serde-universal": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-3.0.5.tgz", - "integrity": "sha512-5u/nXbyoh1s4QxrvNre9V6vfyoLWuiVvvd5TlZjGThIikc3G+uNiG9uOTCWweSRjv1asdDIWK7nOmN7le4RYHQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.0.1.tgz", + "integrity": "sha512-Z94uZp0tGJuxds3iEAZBqGU2QiaBHP4YytLUjwZWx+oUeohCsLyUm33yp4MMBmhkuPqSbQCXq5hDet6JGUgHWA==", "license": "Apache-2.0", "dependencies": { - "@smithy/eventstream-codec": "^3.1.2", - "@smithy/types": "^3.3.0", + "@smithy/eventstream-codec": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/fetch-http-handler": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-3.2.5.tgz", - "integrity": "sha512-DjRtGmK8pKQMIo9+JlAKUt14Z448bg8nAN04yKIvlrrpmpRSG57s5d2Y83npks1r4gPtTRNbAFdQCoj9l3P2KQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/protocol-http": "^4.1.1", - "@smithy/querystring-builder": "^3.0.4", - "@smithy/types": "^3.4.0", - "@smithy/util-base64": "^3.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/hash-blob-browser": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-3.1.2.tgz", - "integrity": "sha512-hAbfqN2UbISltakCC2TP0kx4LqXBttEv2MqSPE98gVuDFMf05lU+TpC41QtqGP3Ff5A3GwZMPfKnEy0VmEUpmg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/chunked-blob-reader": "^3.0.0", - "@smithy/chunked-blob-reader-native": "^3.0.0", - "@smithy/types": "^3.3.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/hash-node": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.4.tgz", - "integrity": "sha512-6FgTVqEfCr9z/7+Em8BwSkJKA2y3krf1em134x3yr2NHWVCo2KYI8tcA53cjeO47y41jwF84ntsEE0Pe6pNKlg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "@smithy/util-buffer-from": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-node/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.0.1.tgz", + "integrity": "sha512-3aS+fP28urrMW2KTjb6z9iFow6jO8n3MFfineGbndvzGZit3taZhKWtTorf+Gp5RpFDDafeHlhfsGlDCXvUnJA==", "license": "Apache-2.0", "dependencies": { + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/hash-node/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@smithy/hash-blob-browser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.0.1.tgz", + "integrity": "sha512-rkFIrQOKZGS6i1D3gKJ8skJ0RlXqDvb1IyAphksaFOMzkn3v3I1eJ8m7OkLj0jf1McP63rcCEoLlkAn/HjcTRw==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/chunked-blob-reader": "^5.0.0", + "@smithy/chunked-blob-reader-native": "^4.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/hash-node/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@smithy/hash-node": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.1.tgz", + "integrity": "sha512-TJ6oZS+3r2Xu4emVse1YPB3Dq3d8RkZDKcPr71Nj/lJsdAP1c7oFzYqEn1IBc915TsgLl2xIJNuxCz+gLbLE0w==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/hash-stream-node": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-3.1.2.tgz", - "integrity": "sha512-PBgDMeEdDzi6JxKwbfBtwQG9eT9cVwsf0dZzLXoJF4sHKHs5HEo/3lJWpn6jibfJwT34I1EBXpBnZE8AxAft6g==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-stream-node/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-stream-node/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/hash-stream-node/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.0.1.tgz", + "integrity": "sha512-U1rAE1fxmReCIr6D2o/4ROqAQX+GffZpyMt3d7njtGDr2pUNmAKRWa49gsNVhCh2vVAuf3wXzWwNr2YN8PAXIw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/invalid-dependency": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.4.tgz", - "integrity": "sha512-MJBUrojC4SEXi9aJcnNOE3oNAuYNphgCGFXscaCj2TA/59BTcXhzHACP8jnnEU3n4yir/NSLKzxqez0T4x4tjA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/is-array-buffer": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", - "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@smithy/md5-js": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-3.0.3.tgz", - "integrity": "sha512-O/SAkGVwpWmelpj/8yDtsaVe6sINHLB1q8YE/+ZQbDxIw3SRLbTZuRaI10K12sVoENdnHqzPp5i3/H+BcZ3m3Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.3.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@smithy/md5-js/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.1.tgz", + "integrity": "sha512-gdudFPf4QRQ5pzj7HEnu6FhKRi61BfH/Gk5Yf6O0KiSbr1LlVhgjThcvjdu658VE6Nve8vaIWB8/fodmS1rBPQ==", "license": "Apache-2.0", "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/md5-js/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", + "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/md5-js/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "node_modules/@smithy/md5-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.0.1.tgz", + "integrity": "sha512-HLZ647L27APi6zXkZlzSFZIjpo8po45YiyjMGJZM3gyDY8n7dPGdmxIIljLm4gPt/7rRvutLTTkYJpZVfG5r+A==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-content-length": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.6.tgz", - "integrity": "sha512-AFyHCfe8rumkJkz+hCOVJmBagNBj05KypyDwDElA4TgMSA4eYDZRjVePFZuyABrJZFDc7uVj3dpFIDCEhf59SA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.1.tgz", + "integrity": "sha512-OGXo7w5EkB5pPiac7KNzVtfCW2vKBTZNuCctn++TTSOMpe6RZO/n6WEC1AxJINn3+vWLKW49uad3lo/u0WJ9oQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-endpoint": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.1.1.tgz", - "integrity": "sha512-Irv+soW8NKluAtFSEsF8O3iGyLxa5oOevJb/e1yNacV9H7JP/yHyJuKST5YY2ORS1+W34VR8EuUrOF+K29Pl4g==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.6.tgz", + "integrity": "sha512-ftpmkTHIFqgaFugcjzLZv3kzPEFsBFSnq1JsIkr2mwFzCraZVhQk2gqN51OOeRxqhbPTkRFj39Qd2V91E/mQxg==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-serde": "^3.0.4", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "@smithy/url-parser": "^3.0.4", - "@smithy/util-middleware": "^3.0.4", + "@smithy/core": "^3.1.5", + "@smithy/middleware-serde": "^4.0.2", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "@smithy/url-parser": "^4.0.1", + "@smithy/util-middleware": "^4.0.1", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-retry": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.16.tgz", - "integrity": "sha512-08kI36p1yB4CWO3Qi+UQxjzobt8iQJpnruF0K5BkbZmA/N/sJ51A1JJGJ36GgcbFyPfWw2FU48S5ZoqXt0h0jw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/protocol-http": "^4.1.1", - "@smithy/service-error-classification": "^3.0.4", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-retry": "^3.0.4", - "tslib": "^2.6.2", - "uuid": "^9.0.1" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/middleware-serde": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.4.tgz", - "integrity": "sha512-1lPDB2O6IJ50Ucxgn7XrvZXbbuI48HmPCcMTuSoXT1lDzuTUfIuBjgAjpD8YLVMfnrjdepi/q45556LA51Pubw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/middleware-stack": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.4.tgz", - "integrity": "sha512-sLMRjtMCqtVcrOqaOZ10SUnlFE25BSlmLsi4bRSGFD7dgR54eqBjfqkVkPBQyrKBortfGM0+2DJoUPcGECR+nQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/node-config-provider": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.5.tgz", - "integrity": "sha512-dq/oR3/LxgCgizVk7in7FGTm0w9a3qM4mg3IIXLTCHeW3fV+ipssSvBZ2bvEx1+asfQJTyCnVLeYf7JKfd9v3Q==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/property-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.5", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/node-http-handler": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.2.0.tgz", - "integrity": "sha512-5TFqaABbiY7uJMKbqR4OARjwI/l4TRoysDJ75pLpVQyO3EcmeloKYwDGyCtgB9WJniFx3BMkmGCB9+j+QiB+Ww==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/abort-controller": "^3.1.2", - "@smithy/protocol-http": "^4.1.1", - "@smithy/querystring-builder": "^3.0.4", - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/property-provider": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.4.tgz", - "integrity": "sha512-BmhefQbfkSl9DeU0/e6k9N4sT5bya5etv2epvqLUz3eGyfRBhtQq60nDkc1WPp4c+KWrzK721cUc/3y0f2psPQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/protocol-http": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.1.tgz", - "integrity": "sha512-Fm5+8LkeIus83Y8jTL1XHsBGP8sPvE1rEVyKf/87kbOPTbzEDMcgOlzcmYXat2h+nC3wwPtRy8hFqtJS71+Wow==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.0.7.tgz", + "integrity": "sha512-58j9XbUPLkqAcV1kHzVX/kAR16GT+j7DUZJqwzsxh1jtz7G82caZiGyyFgUvogVfNTg3TeAOIJepGc8TXF4AVQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", - "tslib": "^2.6.2" + "@smithy/node-config-provider": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-retry": "^4.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/querystring-builder": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.4.tgz", - "integrity": "sha512-NEoPAsZPdpfVbF98qm8i5k1XMaRKeEnO47CaL5ja6Y1Z2DgJdwIJuJkTJypKm/IKfp8gc0uimIFLwhml8+/pAw==", + "node_modules/@smithy/middleware-serde": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.2.tgz", + "integrity": "sha512-Sdr5lOagCn5tt+zKsaW+U2/iwr6bI9p08wOkCp6/eL6iMbgdtc2R5Ety66rf87PeohR0ExI84Txz9GYv5ou3iQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", - "@smithy/util-uri-escape": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/querystring-parser": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.4.tgz", - "integrity": "sha512-7CHPXffFcakFzhO0OZs/rn6fXlTHrSDdLhIT6/JIk1u2bvwguTL3fMCc1+CfcbXA7TOhjWXu3TcB1EGMqJQwHg==", + "node_modules/@smithy/middleware-stack": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.1.tgz", + "integrity": "sha512-dHwDmrtR/ln8UTHpaIavRSzeIk5+YZTBtLnKwDW3G2t6nAupCiQUvNzNoHBpik63fwUaJPtlnMzXbQrNFWssIA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/service-error-classification": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.4.tgz", - "integrity": "sha512-KciDHHKFVTb9A1KlJHBt2F26PBaDtoE23uTZy5qRvPzHPqrooXFi6fmx98lJb3Jl38PuUTqIuCUmmY3pacuMBQ==", + "node_modules/@smithy/node-config-provider": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.0.1.tgz", + "integrity": "sha512-8mRTjvCtVET8+rxvmzRNRR0hH2JjV0DFOmwXPrISmTIJEfnCBugpYYGAsCj8t41qd+RB5gbheSQ/6aKZCQvFLQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0" + "@smithy/property-provider": "^4.0.1", + "@smithy/shared-ini-file-loader": "^4.0.1", + "@smithy/types": "^4.1.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/shared-ini-file-loader": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.5.tgz", - "integrity": "sha512-6jxsJ4NOmY5Du4FD0enYegNJl4zTSuKLiChIMqIkh+LapxiP7lmz5lYUNLE9/4cvA65mbBmtdzZ8yxmcqM5igg==", + "node_modules/@smithy/node-http-handler": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.0.3.tgz", + "integrity": "sha512-dYCLeINNbYdvmMLtW0VdhW1biXt+PPCGazzT5ZjKw46mOtdgToQEwjqZSS9/EN8+tNs/RO0cEWG044+YZs97aA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/querystring-builder": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/signature-v4": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.1.1.tgz", - "integrity": "sha512-SH9J9be81TMBNGCmjhrgMWu4YSpQ3uP1L06u/K9SDrE2YibUix1qxedPCxEQu02At0P0SrYDjvz+y91vLG0KRQ==", + "node_modules/@smithy/property-provider": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.1.tgz", + "integrity": "sha512-o+VRiwC2cgmk/WFV0jaETGOtX16VNPp2bSQEzu0whbReqE1BMqsP2ami2Vi3cbGVdKu1kq9gQkDAGKbt0WOHAQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "@smithy/util-hex-encoding": "^3.0.0", - "@smithy/util-middleware": "^3.0.4", - "@smithy/util-uri-escape": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/signature-v4/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", + "node_modules/@smithy/protocol-http": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.0.1.tgz", + "integrity": "sha512-TE4cpj49jJNB/oHyh/cRVEgNZaoPaxd4vteJNB0yGidOCVR0jCw/hjPVsT8Q8FRmj8Bd3bFZt8Dh7xGCT+xMBQ==", "license": "Apache-2.0", "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/signature-v4/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", + "node_modules/@smithy/querystring-builder": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.1.tgz", + "integrity": "sha512-wU87iWZoCbcqrwszsOewEIuq+SU2mSoBE2CcsLwE0I19m0B2gOJr1MVjxWcDQYOzHbR1xCk7AcOBbGFUYOKvdg==", "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/types": "^4.1.0", + "@smithy/util-uri-escape": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/signature-v4/node_modules/@smithy/util-utf8": { - "version": "3.0.0", + "node_modules/@smithy/querystring-parser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.1.tgz", + "integrity": "sha512-Ma2XC7VS9aV77+clSFylVUnPZRindhB7BbmYiNOdr+CHt/kZNJoPP0cd3QxCnCFyPXC4eybmyE98phEHkqZ5Jw==", "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/smithy-client": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.3.0.tgz", - "integrity": "sha512-H32nVo8tIX82kB0xI2LBrIcj8jx/3/ITotNLbeG1UL0b3b440YPR/hUvqjFJiaB24pQrMjRbU8CugqH5sV0hkw==", + "node_modules/@smithy/service-error-classification": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.1.tgz", + "integrity": "sha512-3JNjBfOWpj/mYfjXJHB4Txc/7E4LVq32bwzE7m28GN79+M1f76XHflUaSUkhOriprPDzev9cX/M+dEB80DNDKA==", "license": "Apache-2.0", "dependencies": { - "@smithy/middleware-endpoint": "^3.1.1", - "@smithy/middleware-stack": "^3.0.4", - "@smithy/protocol-http": "^4.1.1", - "@smithy/types": "^3.4.0", - "@smithy/util-stream": "^3.1.4", - "tslib": "^2.6.2" + "@smithy/types": "^4.1.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/types": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.4.0.tgz", - "integrity": "sha512-0shOWSg/pnFXPcsSU8ZbaJ4JBHZJPPzLCJxafJvbMVFo9l1w81CqpgUqjlKGNHVrVB7fhIs+WS82JDTyzaLyLA==", + "node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.1.tgz", + "integrity": "sha512-hC8F6qTBbuHRI/uqDgqqi6J0R4GtEZcgrZPhFQnMhfJs3MnUTGSnR1NSJCJs5VWlMydu0kJz15M640fJlRsIOw==", "license": "Apache-2.0", "dependencies": { + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/url-parser": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.4.tgz", - "integrity": "sha512-XdXfObA8WrloavJYtDuzoDhJAYc5rOt+FirFmKBRKaihu7QtU/METAxJgSo7uMK6hUkx0vFnqxV75urtRaLkLg==", + "node_modules/@smithy/signature-v4": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.0.1.tgz", + "integrity": "sha512-nCe6fQ+ppm1bQuw5iKoeJ0MJfz2os7Ic3GBjOkLOPtavbD1ONoyE3ygjBfz2ythFWm4YnRm6OxW+8p/m9uCoIA==", "license": "Apache-2.0", "dependencies": { - "@smithy/querystring-parser": "^3.0.4", - "@smithy/types": "^3.4.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.1", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@smithy/util-base64": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-3.0.0.tgz", - "integrity": "sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==", + "node_modules/@smithy/smithy-client": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.1.6.tgz", + "integrity": "sha512-UYDolNg6h2O0L+cJjtgSyKKvEKCOa/8FHYJnBobyeoeWDmNpXjwOAtw16ezyeu1ETuuLEOZbrynK0ZY1Lx9Jbw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", + "@smithy/core": "^3.1.5", + "@smithy/middleware-endpoint": "^4.0.6", + "@smithy/middleware-stack": "^4.0.1", + "@smithy/protocol-http": "^5.0.1", + "@smithy/types": "^4.1.0", + "@smithy/util-stream": "^4.1.2", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/util-base64/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", + "node_modules/@smithy/types": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.1.0.tgz", + "integrity": "sha512-enhjdwp4D7CXmwLtD6zbcDMbo6/T6WtuuKCY49Xxc6OMOmUWlBEBDREsxxgV2LIdeQPW756+f97GzcgAwp3iLw==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/util-base64/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", + "node_modules/@smithy/url-parser": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.1.tgz", + "integrity": "sha512-gPXcIEUtw7VlK8f/QcruNXm7q+T5hhvGu9tl63LsJPZ27exB6dtNwvh2HIi0v7JcXJ5emBxB+CJxwaLEdJfA+g==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", + "@smithy/querystring-parser": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@smithy/util-base64/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", + "node_modules/@smithy/util-base64": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", + "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-body-length-browser": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", + "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@smithy/util-body-length-node": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-buffer-from": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", - "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", + "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^2.2.0", + "@smithy/is-array-buffer": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-config-provider": { - "version": "3.0.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", + "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.16.tgz", - "integrity": "sha512-Os8ddfNBe7hmc5UMWZxygIHCyAqY0aWR8Wnp/aKbti3f8Df/r0J9ttMZIxeMjsFgtVjEryB0q7SGcwBsHk8WEw==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.7.tgz", + "integrity": "sha512-CZgDDrYHLv0RUElOsmZtAnp1pIjwDVCSuZWOPhIOBvG36RDfX1Q9+6lS61xBf+qqvHoqRjHxgINeQz47cYFC2Q==", "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^3.1.4", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", "bowser": "^2.11.0", "tslib": "^2.6.2" }, "engines": { - "node": ">= 10.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.16.tgz", - "integrity": "sha512-rNhFIYRtrOrrhRlj6RL8jWA6/dcwrbGYAmy8+OAHjjzQ6zdzUBB1P+3IuJAgwWN6Y5GxI+mVXlM/pOjaoIgHow==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.7.tgz", + "integrity": "sha512-79fQW3hnfCdrfIi1soPbK3zmooRFnLpSx3Vxi6nUlqaaQeC5dm8plt4OTNDNqEEEDkvKghZSaoti684dQFVrGQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/config-resolver": "^3.0.6", - "@smithy/credential-provider-imds": "^3.2.1", - "@smithy/node-config-provider": "^3.1.5", - "@smithy/property-provider": "^3.1.4", - "@smithy/smithy-client": "^3.3.0", - "@smithy/types": "^3.4.0", + "@smithy/config-resolver": "^4.0.1", + "@smithy/credential-provider-imds": "^4.0.1", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/property-provider": "^4.0.1", + "@smithy/smithy-client": "^4.1.6", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">= 10.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-endpoints": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.1.0.tgz", - "integrity": "sha512-ilS7/0jcbS2ELdg0fM/4GVvOiuk8/U3bIFXUW25xE1Vh1Ol4DP6vVHQKqM40rCMizCLmJ9UxK+NeJrKlhI3HVA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.1.tgz", + "integrity": "sha512-zVdUENQpdtn9jbpD9SCFK4+aSiavRb9BxEtw9ZGUR1TYo6bBHbIoi7VkrFQ0/RwZlzx0wRBaRmPclj8iAoJCLA==", "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^3.1.5", - "@smithy/types": "^3.4.0", + "@smithy/node-config-provider": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-hex-encoding": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-3.0.0.tgz", - "integrity": "sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", + "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-middleware": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.4.tgz", - "integrity": "sha512-uSXHTBhstb1c4nHdmQEdkNMv9LiRNaJ/lWV2U/GO+5F236YFpdPw+hyWI9Zc0Rp9XKzwD9kVZvhZmEgp0UCVnA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.1.tgz", + "integrity": "sha512-HiLAvlcqhbzhuiOa0Lyct5IIlyIz0PQO5dnMlmQ/ubYM46dPInB+3yQGkfxsk6Q24Y0n3/JmcA1v5iEhmOF5mA==", "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^3.4.0", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-retry": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.4.tgz", - "integrity": "sha512-JJr6g0tO1qO2tCQyK+n3J18r34ZpvatlFN5ULcLranFIBZPxqoivb77EPyNTVwTGMEvvq2qMnyjm4jMIxjdLFg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.1.tgz", + "integrity": "sha512-WmRHqNVwn3kI3rKk1LsKcVgPBG6iLTBGC1iYOV3GQegwJ3E8yjzHytPt26VNzOWr1qu0xE03nK0Ug8S7T7oufw==", "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^3.0.4", - "@smithy/types": "^3.4.0", + "@smithy/service-error-classification": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-stream": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.1.4.tgz", - "integrity": "sha512-txU3EIDLhrBZdGfon6E9V6sZz/irYnKFMblz4TLVjyq8hObNHNS2n9a2t7GIrl7d85zgEPhwLE0gANpZsvpsKg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.1.2.tgz", + "integrity": "sha512-44PKEqQ303d3rlQuiDpcCcu//hV8sn+u2JBo84dWCE0rvgeiVl0IlLMagbU++o0jCWhYCsHaAt9wZuZqNe05Hw==", "license": "Apache-2.0", "dependencies": { - "@smithy/fetch-http-handler": "^3.2.5", - "@smithy/node-http-handler": "^3.2.0", - "@smithy/types": "^3.4.0", - "@smithy/util-base64": "^3.0.0", - "@smithy/util-buffer-from": "^3.0.0", - "@smithy/util-hex-encoding": "^3.0.0", - "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-stream/node_modules/@smithy/is-array-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", - "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-stream/node_modules/@smithy/util-buffer-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", - "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "dependencies": { - "@smithy/is-array-buffer": "^3.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@smithy/util-stream/node_modules/@smithy/util-utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", - "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "dependencies": { - "@smithy/util-buffer-from": "^3.0.0", + "@smithy/fetch-http-handler": "^5.0.1", + "@smithy/node-http-handler": "^4.0.3", + "@smithy/types": "^4.1.0", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-uri-escape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz", - "integrity": "sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", + "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-utf8": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", - "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", + "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^2.2.0", + "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, "node_modules/@smithy/util-waiter": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-3.1.2.tgz", - "integrity": "sha512-4pP0EV3iTsexDx+8PPGAKCQpd/6hsQBaQhqWzU4hqKPHN5epPsxKbvUTIiYIHTxaKt6/kEaqPBpu/ufvfbrRzw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.0.2.tgz", + "integrity": "sha512-piUTHyp2Axx3p/kc2CIJkYSv0BAaheBQmbACZgQSSfWUumWNW+R1lL+H9PDBxKJkvOeEX+hKYEFiwO8xagL8AQ==", "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^3.1.1", - "@smithy/types": "^3.3.0", + "@smithy/abort-controller": "^4.0.1", + "@smithy/types": "^4.1.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@tsconfig/node10": { - "version": "1.0.9", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", "dev": true, "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true, "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true, "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true, "license": "MIT" }, "node_modules/@types/accepts": { "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -7790,6 +4917,8 @@ }, "node_modules/@types/babel__core": { "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "license": "MIT", "dependencies": { @@ -7802,6 +4931,8 @@ }, "node_modules/@types/babel__generator": { "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "license": "MIT", "dependencies": { @@ -7810,6 +4941,8 @@ }, "node_modules/@types/babel__template": { "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "license": "MIT", "dependencies": { @@ -7818,7 +4951,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.5", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, "license": "MIT", "dependencies": { @@ -7827,6 +4962,8 @@ }, "node_modules/@types/body-parser": { "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "license": "MIT", "dependencies": { "@types/connect": "*", @@ -7835,6 +4972,8 @@ }, "node_modules/@types/connect": { "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -7842,6 +4981,8 @@ }, "node_modules/@types/content-disposition": { "version": "0.5.8", + "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.8.tgz", + "integrity": "sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg==", "license": "MIT" }, "node_modules/@types/cookiejar": { @@ -7852,7 +4993,9 @@ "license": "MIT" }, "node_modules/@types/cookies": { - "version": "0.7.10", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.9.0.tgz", + "integrity": "sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q==", "license": "MIT", "dependencies": { "@types/connect": "*", @@ -7862,17 +5005,21 @@ } }, "node_modules/@types/express": { - "version": "4.17.21", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", + "integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==", "license": "MIT", "dependencies": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.33", + "@types/express-serve-static-core": "^5.0.0", "@types/qs": "*", "@types/serve-static": "*" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.41", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", + "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -7882,7 +5029,10 @@ } }, "node_modules/@types/fast-json-stable-stringify": { - "version": "2.1.0", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.2.tgz", + "integrity": "sha512-vsxcbfLDdjytnCnHXtinE40Xl46Wr7l/VGRGt7ewJwCPMKEHOdEsTxXX8xwgoR7cbc+6dE8SB4jlMrOV2zAg7g==", + "deprecated": "This is a stub types definition. fast-json-stable-stringify provides its own type definitions, so you do not need this installed.", "dev": true, "license": "MIT", "dependencies": { @@ -7891,6 +5041,8 @@ }, "node_modules/@types/graceful-fs": { "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7898,20 +5050,28 @@ } }, "node_modules/@types/http-assert": { - "version": "1.5.5", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.6.tgz", + "integrity": "sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw==", "license": "MIT" }, "node_modules/@types/http-errors": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", "license": "MIT" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true, "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "license": "MIT", "dependencies": { @@ -7920,6 +5080,8 @@ }, "node_modules/@types/istanbul-reports": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7927,7 +5089,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.11", + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7937,25 +5101,34 @@ }, "node_modules/@types/json-schema": { "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "license": "MIT" }, "node_modules/@types/jsonpath": { "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz", + "integrity": "sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==", "dev": true, "license": "MIT" }, "node_modules/@types/keygrip": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.6.tgz", + "integrity": "sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==", "license": "MIT" }, "node_modules/@types/koa": { "version": "2.15.0", "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.15.0.tgz", "integrity": "sha512-7QFsywoE5URbuVnG3loe03QXuGajrnotr3gQkXcEBShORai23MePfFYdhz90FEtBBpkyIYQbVD+evKtloCgX3g==", + "license": "MIT", "dependencies": { "@types/accepts": "*", "@types/content-disposition": "*", @@ -7969,6 +5142,8 @@ }, "node_modules/@types/koa-bodyparser": { "version": "4.3.12", + "resolved": "https://registry.npmjs.org/@types/koa-bodyparser/-/koa-bodyparser-4.3.12.tgz", + "integrity": "sha512-hKMmRMVP889gPIdLZmmtou/BijaU1tHPyMNmcK7FAHAdATnRcGQQy78EqTTxLH1D4FTsrxIzklAQCso9oGoebQ==", "dev": true, "license": "MIT", "dependencies": { @@ -7977,13 +5152,17 @@ }, "node_modules/@types/koa-compose": { "version": "3.2.8", + "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.8.tgz", + "integrity": "sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==", "license": "MIT", "dependencies": { "@types/koa": "*" } }, "node_modules/@types/lodash": { - "version": "4.14.202", + "version": "4.17.16", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.16.tgz", + "integrity": "sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==", "dev": true, "license": "MIT" }, @@ -7996,38 +5175,51 @@ }, "node_modules/@types/mime": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "license": "MIT" }, "node_modules/@types/minimist": { "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { - "version": "20.10.7", - "license": "MIT", - "dependencies": { - "undici-types": "~5.26.4" - } + "version": "20.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.1.tgz", + "integrity": "sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==", + "license": "MIT" }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "license": "MIT" }, "node_modules/@types/qs": { - "version": "6.9.11", + "version": "6.9.18", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", + "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "license": "MIT" }, "node_modules/@types/semver": { - "version": "7.5.6", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "license": "MIT" }, "node_modules/@types/send": { "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", "license": "MIT", "dependencies": { "@types/mime": "^1", @@ -8035,16 +5227,20 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.5", + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", "license": "MIT", "dependencies": { "@types/http-errors": "*", - "@types/mime": "*", - "@types/node": "*" + "@types/node": "*", + "@types/send": "*" } }, "node_modules/@types/stack-utils": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true, "license": "MIT" }, @@ -8074,10 +5270,14 @@ }, "node_modules/@types/triple-beam": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", "license": "MIT" }, "node_modules/@types/yargs": { - "version": "17.0.32", + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, "license": "MIT", "dependencies": { @@ -8086,11 +5286,15 @@ }, "node_modules/@types/yargs-parser": { "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.4.0", @@ -8123,6 +5327,8 @@ }, "node_modules/@typescript-eslint/parser": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", @@ -8148,6 +5354,8 @@ }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "license": "MIT", "dependencies": { "@typescript-eslint/types": "5.62.0", @@ -8163,6 +5371,8 @@ }, "node_modules/@typescript-eslint/type-utils": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "5.62.0", @@ -8188,6 +5398,8 @@ }, "node_modules/@typescript-eslint/types": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -8199,6 +5411,8 @@ }, "node_modules/@typescript-eslint/typescript-estree": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "5.62.0", @@ -8224,6 +5438,8 @@ }, "node_modules/@typescript-eslint/utils": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -8248,6 +5464,8 @@ }, "node_modules/@typescript-eslint/visitor-keys": { "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "license": "MIT", "dependencies": { "@typescript-eslint/types": "5.62.0", @@ -8262,16 +5480,21 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.2.0", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "license": "ISC" }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC" }, "node_modules/accepts": { "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "license": "MIT", "dependencies": { "mime-types": "~2.1.34", @@ -8282,7 +5505,9 @@ } }, "node_modules/acorn": { - "version": "8.11.3", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -8293,26 +5518,37 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/acorn-walk": { - "version": "8.3.1", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } }, "node_modules/add-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", + "integrity": "sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==", "dev": true, "license": "MIT" }, "node_modules/agent-base": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "license": "MIT", "dependencies": { "debug": "4" @@ -8322,13 +5558,15 @@ } }, "node_modules/ajv": { - "version": "8.12.0", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -8337,6 +5575,8 @@ }, "node_modules/ajv-draft-04": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", + "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==", "license": "MIT", "peerDependencies": { "ajv": "^8.5.0" @@ -8349,6 +5589,8 @@ }, "node_modules/ajv-formats": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "license": "MIT", "dependencies": { "ajv": "^8.0.0" @@ -8363,12 +5605,13 @@ } }, "node_modules/allure-jest": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/allure-jest/-/allure-jest-3.0.7.tgz", - "integrity": "sha512-vOFLkjreMI0br1PoSNP8AyPY3ieTLdHcBz1c5kXSyWNIxx23EPJ/TxKgg1cYyQrkpm3z3TMCj3XS3iYhVwz0/g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/allure-jest/-/allure-jest-3.2.0.tgz", + "integrity": "sha512-j6Ymctv9gvp2JRrUU6pIuFu+2hKxu4Qa+xxzw29i0IHUUZTeOszTS+9DHtk+ejnvuUBFsNlV7LwjPMSj1w8Igw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "allure-js-commons": "3.0.7" + "allure-js-commons": "3.2.0" }, "peerDependencies": { "jest": ">=24.8.0", @@ -8396,15 +5639,16 @@ } }, "node_modules/allure-js-commons": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.0.7.tgz", - "integrity": "sha512-keHlPAtmzdtEK8FT5W0mOMYh9ZrdlhbrDyaaAKMNHipF/EsFak18XdbLiAKhnHbHiicE+n3BrmBU4rfQEoFHzA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-3.2.0.tgz", + "integrity": "sha512-UXRo3D6/XEIMosro+OldWj8phJ65eSOYaAUlThOpl6nJJ0sGngMpJYog+Z9FmZDo1BZn4edwLs4aAUaTgkz4Cg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "md5": "^2.3.0" }, "peerDependencies": { - "allure-playwright": "3.0.7" + "allure-playwright": "3.2.0" }, "peerDependenciesMeta": { "allure-playwright": { @@ -8415,10 +5659,13 @@ "node_modules/amazon-dsp-formatter": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/amazon-dsp-formatter/-/amazon-dsp-formatter-1.0.2.tgz", - "integrity": "sha512-CfsssMzLFh0IK6oz3j38ENGgp5LZ/q21YX4yXSavfI50CU2cJbupKOk+Bgg0sY67V0lWsYsmYrpkEI2aFG/duA==" + "integrity": "sha512-CfsssMzLFh0IK6oz3j38ENGgp5LZ/q21YX4yXSavfI50CU2cJbupKOk+Bgg0sY67V0lWsYsmYrpkEI2aFG/duA==", + "license": "MIT" }, "node_modules/ansi-align": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "license": "ISC", "dependencies": { @@ -8427,6 +5674,8 @@ }, "node_modules/ansi-escapes": { "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8441,6 +5690,8 @@ }, "node_modules/ansi-escapes/node_modules/type-fest": { "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -8452,6 +5703,8 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", "engines": { "node": ">=8" @@ -8459,6 +5712,8 @@ }, "node_modules/ansi-styles": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -8469,11 +5724,15 @@ }, "node_modules/any-promise": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "dev": true, "license": "MIT" }, "node_modules/anymatch": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "license": "ISC", "dependencies": { @@ -8486,19 +5745,23 @@ }, "node_modules/app-module-path": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", + "integrity": "sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ==", "dev": true, "license": "BSD-2-Clause" }, "node_modules/aproba": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC" }, "node_modules/are-we-there-yet": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "deprecated": "This package is no longer supported.", + "license": "ISC", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -8511,6 +5774,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -8522,19 +5786,28 @@ }, "node_modules/arg": { "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true, "license": "MIT" }, "node_modules/argparse": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8542,6 +5815,8 @@ }, "node_modules/array-find-index": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", "dev": true, "license": "MIT", "engines": { @@ -8550,17 +5825,22 @@ }, "node_modules/array-ify": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", "dev": true, "license": "MIT" }, "node_modules/array-includes": { - "version": "3.1.7", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", "is-string": "^1.0.7" }, "engines": { @@ -8572,20 +5852,25 @@ }, "node_modules/array-union": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/array.prototype.findlastindex": { - "version": "1.2.3", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -8595,13 +5880,15 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.3.2", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -8611,13 +5898,15 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.2", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -8627,16 +5916,18 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.2", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", - "is-array-buffer": "^3.0.2", - "is-shared-array-buffer": "^1.0.2" + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" }, "engines": { "node": ">= 0.4" @@ -8647,6 +5938,8 @@ }, "node_modules/arrify": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true, "license": "MIT", "engines": { @@ -8655,11 +5948,15 @@ }, "node_modules/asap": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true, "license": "MIT" }, "node_modules/ast-module-types": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-4.0.0.tgz", + "integrity": "sha512-Kd0o8r6CDazJGCRzs8Ivpn0xj19oNKrULhoJFzhGjRsLpekF2zyZs9Ukz+JvZhWD6smszfepakTFhAaYpsI12g==", "dev": true, "license": "MIT", "engines": { @@ -8667,15 +5964,30 @@ } }, "node_modules/async": { - "version": "3.2.5", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "license": "MIT" }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/asynckit": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, "license": "ISC", "engines": { @@ -8683,8 +5995,13 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.5", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -8694,12 +6011,15 @@ }, "node_modules/await-handler": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/await-handler/-/await-handler-1.1.2.tgz", + "integrity": "sha512-dihteGhwbJpT89kVbacWiyKeAZr+En0YGK6pAKQJLR0En9ZxSH2H4TTvfG4bBjzFq9gDAma4y9BrpDns6j5UiQ==", "license": "MIT" }, "node_modules/axios": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", + "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -8708,6 +6028,8 @@ }, "node_modules/axios-mock-adapter": { "version": "1.22.0", + "resolved": "https://registry.npmjs.org/axios-mock-adapter/-/axios-mock-adapter-1.22.0.tgz", + "integrity": "sha512-dmI0KbkyAhntUR05YY96qg2H6gg0XMl2+qTW0xmYg6Up+BFBAJYRLROMXRdDEL06/Wqwa0TJThAYvFtSFdRCZw==", "dev": true, "license": "MIT", "dependencies": { @@ -8720,6 +6042,8 @@ }, "node_modules/babel-jest": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "license": "MIT", "dependencies": { @@ -8740,6 +6064,8 @@ }, "node_modules/babel-jest/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -8754,6 +6080,8 @@ }, "node_modules/babel-jest/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -8769,6 +6097,8 @@ }, "node_modules/babel-jest/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8780,11 +6110,15 @@ }, "node_modules/babel-jest/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/babel-jest/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -8793,6 +6127,8 @@ }, "node_modules/babel-jest/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -8804,6 +6140,8 @@ }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -8819,6 +6157,8 @@ }, "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -8834,6 +6174,8 @@ }, "node_modules/babel-plugin-istanbul/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -8842,6 +6184,8 @@ }, "node_modules/babel-plugin-jest-hoist": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "license": "MIT", "dependencies": { @@ -8855,22 +6199,27 @@ } }, "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", + "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", "dev": true, "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" }, "peerDependencies": { "@babel/core": "^7.0.0" @@ -8878,6 +6227,8 @@ }, "node_modules/babel-preset-jest": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "license": "MIT", "dependencies": { @@ -8893,10 +6244,14 @@ }, "node_modules/balanced-match": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -8915,6 +6270,8 @@ }, "node_modules/benchmark-suite": { "version": "0.1.8", + "resolved": "https://registry.npmjs.org/benchmark-suite/-/benchmark-suite-0.1.8.tgz", + "integrity": "sha512-UDfWBQfeq/lXcsjuGAanOrX6AhP6HQSsutGS7CfStcbE1loLge7aQr5DT6n8r/4bUoiK+5RYwnogNu5UuTBMNg==", "dev": true, "license": "MIT", "dependencies": { @@ -8932,16 +6289,21 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } }, "node_modules/bintrees": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", + "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==", "license": "MIT" }, "node_modules/bl": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "license": "MIT", "dependencies": { "buffer": "^5.5.0", @@ -8951,6 +6313,8 @@ }, "node_modules/bl/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -8961,17 +6325,16 @@ "node": ">= 6" } }, - "node_modules/boolean": { - "version": "3.2.0", - "dev": true, - "license": "MIT" - }, "node_modules/bowser": { "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", "license": "MIT" }, "node_modules/boxen": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -8993,6 +6356,8 @@ }, "node_modules/boxen/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -9007,6 +6372,8 @@ }, "node_modules/boxen/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -9022,6 +6389,8 @@ }, "node_modules/boxen/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9033,11 +6402,15 @@ }, "node_modules/boxen/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/boxen/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -9046,6 +6419,8 @@ }, "node_modules/boxen/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -9057,6 +6432,8 @@ }, "node_modules/brace-expansion": { "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -9065,6 +6442,8 @@ }, "node_modules/braces": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -9074,7 +6453,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.2", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "dev": true, "funding": [ { @@ -9092,10 +6473,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001565", - "electron-to-chromium": "^1.4.601", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -9106,6 +6487,8 @@ }, "node_modules/bs-logger": { "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, "license": "MIT", "dependencies": { @@ -9117,6 +6500,8 @@ }, "node_modules/bser": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -9125,6 +6510,8 @@ }, "node_modules/btoa": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", "license": "(MIT OR Apache-2.0)", "bin": { "btoa": "bin/btoa.js" @@ -9135,6 +6522,8 @@ }, "node_modules/buffer": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", "license": "MIT", "dependencies": { "base64-js": "^1.0.2", @@ -9143,11 +6532,15 @@ }, "node_modules/buffer-from": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, "license": "MIT" }, "node_modules/builtin-modules": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", "dev": true, "license": "MIT", "engines": { @@ -9159,6 +6552,8 @@ }, "node_modules/byline": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -9166,6 +6561,8 @@ }, "node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -9173,6 +6570,8 @@ }, "node_modules/cache-content-type": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", "license": "MIT", "dependencies": { "mime-types": "^2.1.18", @@ -9184,6 +6583,8 @@ }, "node_modules/cacheable-request": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz", + "integrity": "sha512-vag0O2LKZ/najSoUwDbVlnlCFvhBE/7mGTY2B5FgCBDcRD+oVV1HYTOwM6JZfMg/hIcM6IwnTZ1uQQL5/X3xIQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9198,6 +6599,8 @@ }, "node_modules/cacheable-request/node_modules/get-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", "dev": true, "license": "MIT", "engines": { @@ -9206,27 +6609,25 @@ }, "node_modules/cacheable-request/node_modules/json-buffer": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ==", "dev": true, "license": "MIT" }, "node_modules/cacheable-request/node_modules/keyv": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", + "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==", "dev": true, "license": "MIT", "dependencies": { "json-buffer": "3.0.0" } }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/cachedir": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", + "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", "dev": true, "license": "MIT", "engines": { @@ -9234,12 +6635,47 @@ } }, "node_modules/call-bind": { - "version": "1.0.5", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "license": "MIT", "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9247,11 +6683,15 @@ }, "node_modules/call-me-maybe": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", "dev": true, "license": "MIT" }, "node_modules/callsites": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "license": "MIT", "engines": { "node": ">=6" @@ -9259,6 +6699,8 @@ }, "node_modules/camelcase": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "license": "MIT", "engines": { @@ -9270,6 +6712,8 @@ }, "node_modules/camelcase-keys": { "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "dev": true, "license": "MIT", "dependencies": { @@ -9286,6 +6730,8 @@ }, "node_modules/camelcase-keys/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -9293,7 +6739,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001576", + "version": "1.0.30001702", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz", + "integrity": "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==", "dev": true, "funding": [ { @@ -9313,6 +6761,8 @@ }, "node_modules/chalk": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -9325,6 +6775,8 @@ }, "node_modules/char-regex": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, "license": "MIT", "engines": { @@ -9333,11 +6785,15 @@ }, "node_modules/chardet": { "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true, "license": "MIT" }, "node_modules/charenc": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", "license": "BSD-3-Clause", "engines": { "node": "*" @@ -9345,6 +6801,8 @@ }, "node_modules/check-more-types": { "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", "dev": true, "license": "MIT", "engines": { @@ -9355,12 +6813,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/ci-info": { "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -9374,12 +6835,16 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.2.3", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", "dev": true, "license": "MIT" }, "node_modules/clean-regexp": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", + "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", "dev": true, "license": "MIT", "dependencies": { @@ -9391,6 +6856,8 @@ }, "node_modules/cli-boxes": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", "dev": true, "license": "MIT", "engines": { @@ -9402,6 +6869,8 @@ }, "node_modules/cli-cursor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "license": "MIT", "dependencies": { @@ -9413,6 +6882,8 @@ }, "node_modules/cli-spinners": { "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "dev": true, "license": "MIT", "engines": { @@ -9424,6 +6895,8 @@ }, "node_modules/cli-truncate": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", "dev": true, "license": "MIT", "dependencies": { @@ -9438,7 +6911,9 @@ } }, "node_modules/cli-truncate/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -9450,11 +6925,15 @@ }, "node_modules/cli-truncate/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/cli-truncate/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -9471,6 +6950,8 @@ }, "node_modules/cli-truncate/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9485,6 +6966,8 @@ }, "node_modules/cli-width": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, "license": "ISC", "engines": { @@ -9493,6 +6976,8 @@ }, "node_modules/cliui": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "license": "ISC", "dependencies": { @@ -9506,6 +6991,8 @@ }, "node_modules/clone": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", "license": "MIT", "engines": { "node": ">=0.8" @@ -9513,6 +7000,8 @@ }, "node_modules/clone-response": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==", "dev": true, "license": "MIT", "dependencies": { @@ -9521,6 +7010,8 @@ }, "node_modules/cluster-key-slot": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", "license": "Apache-2.0", "engines": { "node": ">=0.10.0" @@ -9528,6 +7019,8 @@ }, "node_modules/co": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "license": "MIT", "engines": { "iojs": ">= 1.0.0", @@ -9535,22 +7028,32 @@ } }, "node_modules/co-body": { - "version": "6.1.0", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.2.0.tgz", + "integrity": "sha512-Kbpv2Yd1NdL1V/V4cwLVxraHDV6K8ayohr2rmH0J87Er8+zJjcTa6dAn9QMPC9CRgU8+aNajKbSf1TzDB1yKPA==", "license": "MIT", "dependencies": { + "@hapi/bourne": "^3.0.0", "inflation": "^2.0.0", "qs": "^6.5.2", "raw-body": "^2.3.3", "type-is": "^1.6.16" + }, + "engines": { + "node": ">=8.0.0" } }, "node_modules/collect-v8-coverage": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true, "license": "MIT" }, "node_modules/color": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", "license": "MIT", "dependencies": { "color-convert": "^1.9.3", @@ -9559,6 +7062,8 @@ }, "node_modules/color-convert": { "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -9566,10 +7071,14 @@ }, "node_modules/color-name": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "license": "MIT" }, "node_modules/color-string": { "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", "license": "MIT", "dependencies": { "color-name": "^1.0.0", @@ -9580,17 +7089,22 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", "bin": { "color-support": "bin.js" } }, "node_modules/colorette": { "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true, "license": "MIT" }, "node_modules/colors": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "license": "MIT", "engines": { "node": ">=0.1.90" @@ -9598,6 +7112,8 @@ }, "node_modules/colorspace": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", "license": "MIT", "dependencies": { "color": "^3.1.3", @@ -9606,6 +7122,8 @@ }, "node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" @@ -9616,6 +7134,8 @@ }, "node_modules/commander": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "license": "MIT", "engines": { @@ -9623,7 +7143,9 @@ } }, "node_modules/commitizen": { - "version": "4.3.0", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.1.tgz", + "integrity": "sha512-gwAPAVTy/j5YcOOebcCRIijn+mSjWJC+IYKivTu6aG8Ei/scoXgfsMRnuAk6b0GRste2J4NGxVdMN3ZpfNaVaw==", "dev": true, "license": "MIT", "dependencies": { @@ -9651,53 +7173,11 @@ "node": ">= 12" } }, - "node_modules/commitizen/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/commitizen/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/commitizen/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/commitizen/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, "node_modules/commitizen/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -9715,52 +7195,10 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/commitizen/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/commitizen/node_modules/inquirer": { - "version": "8.2.5", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/commitizen/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/commitlint": { "version": "17.8.1", + "resolved": "https://registry.npmjs.org/commitlint/-/commitlint-17.8.1.tgz", + "integrity": "sha512-X+VPJwZsQDeGj/DG1NsxhZEl+oMHKNC+1myZ/zauNDoo+7OuLHfTOUU1C1a4CjKW4b6T7NuoFcYfK0kRCjCtbA==", "dev": true, "license": "MIT", "dependencies": { @@ -9774,88 +7212,17 @@ "node": ">=v14" } }, - "node_modules/commitlint/node_modules/@commitlint/types": { - "version": "17.8.1", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">=v14" - } - }, - "node_modules/commitlint/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/commitlint/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/commitlint/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/commitlint/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/commitlint/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/commitlint/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/commondir": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true, "license": "MIT" }, "node_modules/compare-func": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, "license": "MIT", "dependencies": { @@ -9865,6 +7232,8 @@ }, "node_modules/component-each": { "version": "0.2.6", + "resolved": "https://registry.npmjs.org/component-each/-/component-each-0.2.6.tgz", + "integrity": "sha512-IOXG+HZmbgaBS8Rqy+tAMrwsPdEY1BWcPcp0xI2ZOzKQhHvSVGrL7iCnoDU37TEKOCfaf4ywsR6GwAr0JivPjg==", "dependencies": { "component-type": "1.0.0", "to-function": "2.0.6" @@ -9872,6 +7241,8 @@ }, "node_modules/component-emitter": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", "dev": true, "license": "MIT", "funding": { @@ -9879,17 +7250,25 @@ } }, "node_modules/component-props": { - "version": "1.1.1" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/component-props/-/component-props-1.1.1.tgz", + "integrity": "sha512-69pIRJs9fCCHRqCz3390YF2LV1Lu6iEMZ5zuVqqUn+G20V9BNXlMs0cWawWeW9g4Ynmg29JmkG6R7/lUJoGd1Q==" }, "node_modules/component-type": { - "version": "1.0.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-type/-/component-type-1.0.0.tgz", + "integrity": "sha512-qzUg4SGDH6KFYlcklmeZwucbtosh/XGwuIffqXAhC1dZyjO7Xu1UuaxwKRY29EncuBj/DH+h6Zot3AdZS6xdFw==" }, "node_modules/concat-map": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, "node_modules/concat-stream": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "dev": true, "engines": [ "node >= 6.0" @@ -9904,6 +7283,8 @@ }, "node_modules/concat-stream/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -9917,15 +7298,20 @@ }, "node_modules/confusing-browser-globals": { "version": "1.0.11", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", "license": "MIT" }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC" }, "node_modules/content-disposition": { "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" @@ -9936,6 +7322,8 @@ }, "node_modules/content-type": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -9943,6 +7331,8 @@ }, "node_modules/conventional-changelog": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-2.0.3.tgz", + "integrity": "sha512-4bcII9cJHSKb2qi9e8qGF6aJHLf/AB0dokhyR+X6QILTMl77s4l163vK+reXhajvfOYbbHQvsrWybr5+PKZwNA==", "dev": true, "license": "MIT", "dependencies": { @@ -9964,6 +7354,8 @@ }, "node_modules/conventional-changelog-angular": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz", + "integrity": "sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==", "dev": true, "license": "ISC", "dependencies": { @@ -9975,6 +7367,8 @@ }, "node_modules/conventional-changelog-atom": { "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz", + "integrity": "sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==", "dev": true, "license": "ISC", "dependencies": { @@ -9986,6 +7380,8 @@ }, "node_modules/conventional-changelog-codemirror": { "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz", + "integrity": "sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==", "dev": true, "license": "ISC", "dependencies": { @@ -9997,11 +7393,15 @@ }, "node_modules/conventional-changelog-config-spec": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.0.tgz", + "integrity": "sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ==", "dev": true, "license": "MIT" }, "node_modules/conventional-changelog-conventionalcommits": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-6.1.0.tgz", + "integrity": "sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==", "dev": true, "license": "ISC", "dependencies": { @@ -10013,6 +7413,8 @@ }, "node_modules/conventional-changelog-core": { "version": "3.2.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz", + "integrity": "sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10036,6 +7438,8 @@ }, "node_modules/conventional-changelog-core/node_modules/camelcase": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==", "dev": true, "license": "MIT", "engines": { @@ -10044,6 +7448,8 @@ }, "node_modules/conventional-changelog-core/node_modules/camelcase-keys": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha512-Ej37YKYbFUI8QiYlvj9YHb6/Z60dZyPJW0Cs8sFilMbd2lP0bw3ylAq9yJkK4lcTA2dID5fG8LjmJYbO7kWb7Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10057,6 +7463,8 @@ }, "node_modules/conventional-changelog-core/node_modules/conventional-commits-parser": { "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10076,6 +7484,8 @@ }, "node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -10089,6 +7499,8 @@ }, "node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -10097,6 +7509,8 @@ }, "node_modules/conventional-changelog-core/node_modules/dargs": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha512-jyweV/k0rbv2WK4r9KLayuBrSh2Py0tNmV7LBoSMH4hMQyrG8OPyIOWB2VEx4DJKXWmK4lopYMVvORlDt2S8Aw==", "dev": true, "license": "MIT", "dependencies": { @@ -10108,6 +7522,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", + "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", "dev": true, "license": "MIT", "dependencies": { @@ -10126,6 +7542,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits/node_modules/meow": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", "dev": true, "license": "MIT", "dependencies": { @@ -10145,6 +7563,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits/node_modules/split2": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, "license": "ISC", "dependencies": { @@ -10153,6 +7573,8 @@ }, "node_modules/conventional-changelog-core/node_modules/git-raw-commits/node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10162,6 +7584,8 @@ }, "node_modules/conventional-changelog-core/node_modules/indent-string": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==", "dev": true, "license": "MIT", "engines": { @@ -10170,6 +7594,8 @@ }, "node_modules/conventional-changelog-core/node_modules/map-obj": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha512-TzQSV2DiMYgoF5RycneKVUzIa9bQsj/B3tTgsE3dOGqlzHnGIDaC7XBE7grnA+8kZPnfqSGFe95VHc2oc0VFUQ==", "dev": true, "license": "MIT", "engines": { @@ -10178,6 +7604,8 @@ }, "node_modules/conventional-changelog-core/node_modules/minimist-options": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10190,6 +7618,8 @@ }, "node_modules/conventional-changelog-core/node_modules/quick-lru": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha512-tRS7sTgyxMXtLum8L65daJnHUhfDUgboRdcWW2bR9vBfrj2+O5HSMbQOJfJJjIVSPFqbBCF37FpwWXGitDc5tA==", "dev": true, "license": "MIT", "engines": { @@ -10198,6 +7628,8 @@ }, "node_modules/conventional-changelog-core/node_modules/redent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha512-XNwrTx77JQCEMXTeb8movBKuK75MgH0RZkujNuDKCezemx/voapl9i2gCSi8WWm8+ox5ycJi1gxF22fR7c0Ciw==", "dev": true, "license": "MIT", "dependencies": { @@ -10210,6 +7642,8 @@ }, "node_modules/conventional-changelog-core/node_modules/strip-indent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==", "dev": true, "license": "MIT", "engines": { @@ -10218,6 +7652,8 @@ }, "node_modules/conventional-changelog-core/node_modules/through2": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10227,6 +7663,8 @@ }, "node_modules/conventional-changelog-ember": { "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz", + "integrity": "sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==", "dev": true, "license": "ISC", "dependencies": { @@ -10238,6 +7676,8 @@ }, "node_modules/conventional-changelog-eslint": { "version": "3.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz", + "integrity": "sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==", "dev": true, "license": "ISC", "dependencies": { @@ -10249,6 +7689,8 @@ }, "node_modules/conventional-changelog-express": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz", + "integrity": "sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==", "dev": true, "license": "ISC", "dependencies": { @@ -10260,6 +7702,8 @@ }, "node_modules/conventional-changelog-jquery": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz", + "integrity": "sha512-wbz5vVcvu/SPZTDFB21fF/xo5zFq6NQR42jhtUfOrrP1N/ZjNshhGb3expCGqHYdnUHzPevHeUafsVrdxVD5Og==", "dev": true, "license": "ISC", "dependencies": { @@ -10268,6 +7712,8 @@ }, "node_modules/conventional-changelog-jscs": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz", + "integrity": "sha512-V8sey4tE0nJUlWGi2PZKDMfawYLf/+F165xhhDjcIoTEJDxssVV5PMVzTQzjS6U/dEX85fWkur+bs6imOqkIng==", "dev": true, "license": "ISC", "dependencies": { @@ -10276,6 +7722,8 @@ }, "node_modules/conventional-changelog-jshint": { "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz", + "integrity": "sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==", "dev": true, "license": "ISC", "dependencies": { @@ -10288,6 +7736,8 @@ }, "node_modules/conventional-changelog-preset-loader": { "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", "dev": true, "license": "MIT", "engines": { @@ -10296,6 +7746,8 @@ }, "node_modules/conventional-changelog-writer": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.1.0.tgz", + "integrity": "sha512-WwKcUp7WyXYGQmkLsX4QmU42AZ1lqlvRW9mqoyiQzdD+rJWbTepdWoKJuwXTS+yq79XKnQNa93/roViPQrAQgw==", "dev": true, "license": "MIT", "dependencies": { @@ -10319,6 +7771,8 @@ }, "node_modules/conventional-changelog-writer/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -10332,6 +7786,8 @@ }, "node_modules/conventional-changelog-writer/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -10340,6 +7796,8 @@ }, "node_modules/conventional-changelog-writer/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -10348,6 +7806,8 @@ }, "node_modules/conventional-changelog/node_modules/compare-func": { "version": "1.3.4", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", + "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10357,6 +7817,8 @@ }, "node_modules/conventional-changelog/node_modules/conventional-changelog-angular": { "version": "1.6.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz", + "integrity": "sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==", "dev": true, "license": "ISC", "dependencies": { @@ -10366,11 +7828,15 @@ }, "node_modules/conventional-commit-types": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz", + "integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==", "dev": true, "license": "ISC" }, "node_modules/conventional-commits-filter": { "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", "dev": true, "license": "MIT", "dependencies": { @@ -10383,6 +7849,8 @@ }, "node_modules/conventional-commits-parser": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz", + "integrity": "sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==", "dev": true, "license": "MIT", "dependencies": { @@ -10400,6 +7868,8 @@ }, "node_modules/conventional-github-releaser": { "version": "3.1.5", + "resolved": "https://registry.npmjs.org/conventional-github-releaser/-/conventional-github-releaser-3.1.5.tgz", + "integrity": "sha512-VhPKbdN92b2ygnQLkuwHIfUaPAVrVfJVuQdxbmmVPkN927LDP98HthLWFVShh4pxqLK0nE66v78RERGJVeCzbg==", "dev": true, "license": "MIT", "dependencies": { @@ -10425,6 +7895,8 @@ }, "node_modules/conventional-github-releaser/node_modules/camelcase": { "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "license": "MIT", "engines": { @@ -10433,6 +7905,8 @@ }, "node_modules/conventional-github-releaser/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10441,6 +7915,8 @@ }, "node_modules/conventional-github-releaser/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -10453,6 +7929,8 @@ }, "node_modules/conventional-github-releaser/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -10464,6 +7942,8 @@ }, "node_modules/conventional-github-releaser/node_modules/meow": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", "dev": true, "license": "MIT", "dependencies": { @@ -10488,6 +7968,8 @@ }, "node_modules/conventional-github-releaser/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -10502,6 +7984,8 @@ }, "node_modules/conventional-github-releaser/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -10513,6 +7997,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "license": "MIT", "dependencies": { @@ -10527,6 +8013,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "license": "MIT", "dependencies": { @@ -10543,6 +8031,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg-up/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -10551,6 +8041,8 @@ }, "node_modules/conventional-github-releaser/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -10559,6 +8051,8 @@ }, "node_modules/conventional-github-releaser/node_modules/semver": { "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "license": "ISC", "bin": { @@ -10567,6 +8061,8 @@ }, "node_modules/conventional-github-releaser/node_modules/type-fest": { "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -10578,6 +8074,8 @@ }, "node_modules/conventional-github-releaser/node_modules/yargs-parser": { "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "license": "ISC", "dependencies": { @@ -10590,6 +8088,8 @@ }, "node_modules/conventional-recommended-bump": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw==", "dev": true, "license": "MIT", "dependencies": { @@ -10611,6 +8111,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/conventional-commits-parser": { "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10630,6 +8132,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/git-semver-tags": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "license": "MIT", "dependencies": { @@ -10645,6 +8149,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -10658,6 +8164,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -10666,6 +8174,8 @@ }, "node_modules/conventional-recommended-bump/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -10673,23 +8183,33 @@ } }, "node_modules/convert-hex": { - "version": "0.1.0" + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/convert-hex/-/convert-hex-0.1.0.tgz", + "integrity": "sha512-w20BOb1PiR/sEJdS6wNrUjF5CSfscZFUp7R9NSlXH8h2wynzXVEPFPJECAnkNylZ+cvf3p7TyRUHggDmrwXT9A==" }, "node_modules/convert-source-map": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, "license": "MIT" }, "node_modules/convert-string": { - "version": "0.1.0" + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/convert-string/-/convert-string-0.1.0.tgz", + "integrity": "sha512-1KX9ESmtl8xpT2LN2tFnKSbV4NiarbVi8DVb39ZriijvtTklyrT+4dT1wsGMHKD3CJUjXgvJzstm9qL9ICojGA==" }, "node_modules/cookiejar": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", "dev": true, "license": "MIT" }, "node_modules/cookies": { "version": "0.9.1", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.9.1.tgz", + "integrity": "sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==", "license": "MIT", "dependencies": { "depd": "~2.0.0", @@ -10701,15 +8221,21 @@ }, "node_modules/copy-to": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==", "license": "MIT" }, "node_modules/core-util-is": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true, "license": "MIT" }, "node_modules/cosmiconfig": { "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", "dev": true, "license": "MIT", "dependencies": { @@ -10734,24 +8260,25 @@ } }, "node_modules/cosmiconfig-typescript-loader": { - "version": "5.0.0", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.4.0.tgz", + "integrity": "sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==", "dev": true, "license": "MIT", - "optional": true, - "dependencies": { - "jiti": "^1.19.1" - }, "engines": { - "node": ">=v16" + "node": ">=v14.21.3" }, "peerDependencies": { "@types/node": "*", - "cosmiconfig": ">=8.2", + "cosmiconfig": ">=7", + "ts-node": ">=10", "typescript": ">=4" } }, "node_modules/create-jest": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", "dev": true, "license": "MIT", "dependencies": { @@ -10772,6 +8299,8 @@ }, "node_modules/create-jest/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -10786,6 +8315,8 @@ }, "node_modules/create-jest/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -10801,6 +8332,8 @@ }, "node_modules/create-jest/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10812,11 +8345,15 @@ }, "node_modules/create-jest/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/create-jest/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -10825,6 +8362,8 @@ }, "node_modules/create-jest/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -10836,6 +8375,8 @@ }, "node_modules/create-require": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true, "license": "MIT" }, @@ -10855,21 +8396,23 @@ }, "node_modules/crypt": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", "license": "BSD-3-Clause", "engines": { "node": "*" } }, - "node_modules/crypto": { - "version": "1.0.1", - "license": "ISC" - }, "node_modules/crypto-js": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", "license": "MIT" }, "node_modules/currently-unhandled": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==", "dev": true, "license": "MIT", "dependencies": { @@ -10881,6 +8424,8 @@ }, "node_modules/cz-conventional-changelog": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz", + "integrity": "sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==", "dev": true, "license": "MIT", "dependencies": { @@ -10900,14 +8445,69 @@ }, "node_modules/dargs": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", + "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/dateformat": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", "dev": true, "license": "MIT", "engines": { @@ -10915,10 +8515,12 @@ } }, "node_modules/debug": { - "version": "4.3.4", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -10931,6 +8533,8 @@ }, "node_modules/decamelize": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, "license": "MIT", "engines": { @@ -10939,6 +8543,8 @@ }, "node_modules/decamelize-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", "dev": true, "license": "MIT", "dependencies": { @@ -10954,6 +8560,8 @@ }, "node_modules/decamelize-keys/node_modules/map-obj": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true, "license": "MIT", "engines": { @@ -10962,6 +8570,8 @@ }, "node_modules/decode-uri-component": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true, "license": "MIT", "engines": { @@ -10970,6 +8580,8 @@ }, "node_modules/decompress-response": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA==", "dev": true, "license": "MIT", "dependencies": { @@ -10981,15 +8593,21 @@ }, "node_modules/dedent": { "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true, "license": "MIT" }, "node_modules/deep-equal": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==", "license": "MIT" }, "node_modules/deep-extend": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "license": "MIT", "engines": { "node": ">=4.0.0" @@ -10997,10 +8615,14 @@ }, "node_modules/deep-is": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "license": "MIT" }, "node_modules/deepmerge": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "license": "MIT", "engines": { @@ -11009,6 +8631,8 @@ }, "node_modules/defaults": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "license": "MIT", "dependencies": { "clone": "^1.0.2" @@ -11019,25 +8643,34 @@ }, "node_modules/defaults/node_modules/clone": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "license": "MIT", "engines": { "node": ">=0.8" } }, "node_modules/define-data-property": { - "version": "1.1.1", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-properties": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -11053,6 +8686,8 @@ }, "node_modules/delay": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", "license": "MIT", "engines": { "node": ">=10" @@ -11063,6 +8698,8 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "license": "MIT", "engines": { "node": ">=0.4.0" @@ -11070,10 +8707,14 @@ }, "node_modules/delegates": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "license": "MIT" }, "node_modules/denque": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", "license": "Apache-2.0", "engines": { "node": ">=0.10" @@ -11081,6 +8722,8 @@ }, "node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -11088,6 +8731,8 @@ }, "node_modules/dependency-tree": { "version": "9.0.0", + "resolved": "https://registry.npmjs.org/dependency-tree/-/dependency-tree-9.0.0.tgz", + "integrity": "sha512-osYHZJ1fBSon3lNLw70amAXsQ+RGzXsPvk9HbBgTLbp/bQBmpH5mOmsUvqXU+YEWVU0ZLewsmzOET/8jWswjDQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11106,11 +8751,15 @@ }, "node_modules/dependency-tree/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/dependency-tree/node_modules/detective-stylus": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-3.0.0.tgz", + "integrity": "sha512-1xYTzbrduExqMYmte7Qk99IRA3Aa6oV7PYzd+3yDcQXkmENvyGF/arripri6lxRDdNYEb4fZFuHtNRAXbz3iAA==", "dev": true, "license": "MIT", "engines": { @@ -11119,6 +8768,8 @@ }, "node_modules/dependency-tree/node_modules/module-definition": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-4.1.0.tgz", + "integrity": "sha512-rHXi/DpMcD2qcKbPCTklDbX9lBKJrUSl971TW5l6nMpqKCIlzJqmQ8cfEF5M923h2OOLHPDVlh5pJxNyV+AJlw==", "dev": true, "license": "MIT", "dependencies": { @@ -11134,6 +8785,8 @@ }, "node_modules/dependency-tree/node_modules/precinct": { "version": "9.2.1", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-9.2.1.tgz", + "integrity": "sha512-uzKHaTyiVejWW7VJtHInb9KBUq9yl9ojxXGujhjhDmPon2wgZPBKQIKR+6csGqSlUeGXAA4MEFnU6DesxZib+A==", "dev": true, "license": "MIT", "dependencies": { @@ -11159,6 +8812,8 @@ }, "node_modules/dependency-tree/node_modules/precinct/node_modules/commander": { "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", "dev": true, "license": "MIT", "engines": { @@ -11167,6 +8822,8 @@ }, "node_modules/dependency-tree/node_modules/typescript": { "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -11179,6 +8836,8 @@ }, "node_modules/destroy": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "license": "MIT", "engines": { "node": ">= 0.8", @@ -11187,6 +8846,8 @@ }, "node_modules/detect-file": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", "dev": true, "license": "MIT", "engines": { @@ -11195,6 +8856,8 @@ }, "node_modules/detect-indent": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", "dev": true, "license": "MIT", "engines": { @@ -11205,12 +8868,15 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", "engines": { "node": ">=8" } }, "node_modules/detect-newline": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, "license": "MIT", "engines": { @@ -11219,6 +8885,8 @@ }, "node_modules/detective-amd": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-4.2.0.tgz", + "integrity": "sha512-RbuEJHz78A8nW7CklkqTzd8lDCN42En53dgEIsya0DilpkwslamSZDasLg8dJyxbw46OxhSQeY+C2btdSkCvQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11236,6 +8904,8 @@ }, "node_modules/detective-cjs": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-4.1.0.tgz", + "integrity": "sha512-QxzMwt5MfPLwS7mG30zvnmOvHLx5vyVvjsAV6gQOyuMoBR5G1DhS1eJZ4P10AlH+HSnk93mTcrg3l39+24XCtg==", "dev": true, "license": "MIT", "dependencies": { @@ -11248,6 +8918,8 @@ }, "node_modules/detective-es6": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-3.0.1.tgz", + "integrity": "sha512-evPeYIEdK1jK3Oji5p0hX4sPV/1vK+o4ihcWZkMQE6voypSW/cIBiynOLxQk5KOOQbdP8oOAsYqouMTYO5l1sw==", "dev": true, "license": "MIT", "dependencies": { @@ -11259,6 +8931,8 @@ }, "node_modules/detective-less": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/detective-less/-/detective-less-1.0.2.tgz", + "integrity": "sha512-Rps1xDkEEBSq3kLdsdnHZL1x2S4NGDcbrjmd4q+PykK5aJwDdP5MBgrJw1Xo+kyUHuv3JEzPqxr+Dj9ryeDRTA==", "dev": true, "license": "MIT", "dependencies": { @@ -11272,6 +8946,8 @@ }, "node_modules/detective-less/node_modules/node-source-walk": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.3.0.tgz", + "integrity": "sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==", "dev": true, "license": "MIT", "dependencies": { @@ -11283,6 +8959,8 @@ }, "node_modules/detective-postcss": { "version": "6.1.3", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-6.1.3.tgz", + "integrity": "sha512-7BRVvE5pPEvk2ukUWNQ+H2XOq43xENWbH0LcdCE14mwgTBEAMoAx+Fc1rdp76SmyZ4Sp48HlV7VedUnP6GA1Tw==", "dev": true, "license": "MIT", "dependencies": { @@ -11296,6 +8974,8 @@ }, "node_modules/detective-sass": { "version": "4.1.3", + "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-4.1.3.tgz", + "integrity": "sha512-xGRbwGaGte57gvEqM8B9GDiURY3El/H49vA6g9wFkxq9zalmTlTAuqWu+BsH0iwonGPruLt55tZZDEZqPc6lag==", "dev": true, "license": "MIT", "dependencies": { @@ -11308,6 +8988,8 @@ }, "node_modules/detective-scss": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-3.1.1.tgz", + "integrity": "sha512-FWkfru1jZBhUeuBsOeGKXKAVDrzYFSQFK2o2tuG/nCCFQ0U/EcXC157MNAcR5mmj+mCeneZzlkBOFJTesDjrww==", "dev": true, "license": "MIT", "dependencies": { @@ -11320,6 +9002,8 @@ }, "node_modules/detective-stylus": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-2.0.1.tgz", + "integrity": "sha512-/Tvs1pWLg8eYwwV6kZQY5IslGaYqc/GACxjcaGudiNtN5nKCH6o2WnJK3j0gA3huCnoQcbv8X7oz/c1lnvE3zQ==", "dev": true, "license": "MIT", "engines": { @@ -11328,6 +9012,8 @@ }, "node_modules/detective-typescript": { "version": "9.1.1", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-9.1.1.tgz", + "integrity": "sha512-Uc1yVutTF0RRm1YJ3g//i1Cn2vx1kwHj15cnzQP6ff5koNzQ0idc1zAC73ryaWEulA0ElRXFTq6wOqe8vUQ3MA==", "dev": true, "license": "MIT", "dependencies": { @@ -11342,6 +9028,8 @@ }, "node_modules/detective-typescript/node_modules/typescript": { "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -11354,6 +9042,8 @@ }, "node_modules/dezalgo": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", "dev": true, "license": "ISC", "dependencies": { @@ -11363,6 +9053,8 @@ }, "node_modules/diff": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -11371,6 +9063,8 @@ }, "node_modules/diff-sequences": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "license": "MIT", "engines": { @@ -11379,6 +9073,8 @@ }, "node_modules/dir-glob": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "license": "MIT", "dependencies": { "path-type": "^4.0.0" @@ -11389,6 +9085,8 @@ }, "node_modules/doctrine": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -11399,6 +9097,8 @@ }, "node_modules/dot-prop": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11409,17 +9109,21 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", "license": "BSD-2-Clause", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/dotgitignore": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/dotgitignore/-/dotgitignore-2.1.0.tgz", + "integrity": "sha512-sCm11ak2oY6DglEPpCB8TixLjWAxd3kJTs6UIcSasNYxXdFPV+YKlye92c8H4kKFqV5qYMIh7d+cYecEg0dIkA==", "dev": true, "license": "ISC", "dependencies": { @@ -11432,6 +9136,8 @@ }, "node_modules/dotgitignore/node_modules/find-up": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "license": "MIT", "dependencies": { @@ -11443,6 +9149,8 @@ }, "node_modules/dotgitignore/node_modules/locate-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "license": "MIT", "dependencies": { @@ -11455,6 +9163,8 @@ }, "node_modules/dotgitignore/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -11469,6 +9179,8 @@ }, "node_modules/dotgitignore/node_modules/p-locate": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11480,6 +9192,8 @@ }, "node_modules/dotgitignore/node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, "license": "MIT", "engines": { @@ -11488,6 +9202,8 @@ }, "node_modules/dreamopt": { "version": "0.8.0", + "resolved": "https://registry.npmjs.org/dreamopt/-/dreamopt-0.8.0.tgz", + "integrity": "sha512-vyJTp8+mC+G+5dfgsY+r3ckxlz+QMX40VjPQsZc5gxVAxLmi64TBoVkP54A/pRAXMXsbu2GMMBrZPxNv23waMg==", "dependencies": { "wordwrap": ">=0.0.2" }, @@ -11495,18 +9211,38 @@ "node": ">=0.4.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer3": { "version": "0.1.5", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", + "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/eastasianwidth": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true, "license": "MIT" }, "node_modules/ee-first": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, "node_modules/ejs": { @@ -11514,6 +9250,7 @@ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" }, @@ -11525,12 +9262,16 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.625", + "version": "1.5.112", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.112.tgz", + "integrity": "sha512-oen93kVyqSb3l+ziUgzIOlWt/oOuy4zRmpwestMn4rhFWAoFJeFuCVte9F2fASjeZZo7l/Cif9TiyrdW4CwEMA==", "dev": true, "license": "ISC" }, "node_modules/emittery": { "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, "license": "MIT", "engines": { @@ -11542,10 +9283,14 @@ }, "node_modules/emoji-regex": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, "node_modules/empty-dir": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/empty-dir/-/empty-dir-1.0.0.tgz", + "integrity": "sha512-97qcDM6mUA1jAeX6cktw7akc5awIGA+VIkA5MygKOKA+c2Vseo/xwKN0JNJTUhZUtPwZboKVD2p1xu+sV/F4xA==", "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -11553,10 +9298,14 @@ }, "node_modules/enabled": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", "license": "MIT" }, "node_modules/encodeurl": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -11564,13 +9313,17 @@ }, "node_modules/end-of-stream": { "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/enhanced-resolve": { - "version": "5.15.0", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", "dev": true, "license": "MIT", "dependencies": { @@ -11583,6 +9336,8 @@ }, "node_modules/entities": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -11594,6 +9349,8 @@ }, "node_modules/error-ex": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" @@ -11601,54 +9358,70 @@ }, "node_modules/error-stack-parser": { "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", "license": "MIT", "dependencies": { "stackframe": "^1.3.4" } }, "node_modules/es-abstract": { - "version": "1.22.3", - "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "arraybuffer.prototype.slice": "^1.0.2", - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.5", - "es-set-tostringtag": "^2.0.1", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.2", - "get-symbol-description": "^1.0.0", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0", - "internal-slot": "^1.0.5", - "is-array-buffer": "^3.0.2", + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.12", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "safe-array-concat": "^1.0.1", - "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.0", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.13" + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" }, "engines": { "node": ">= 0.4" @@ -11657,32 +9430,72 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { - "version": "2.0.2", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2", - "has-tostringtag": "^1.0.0", - "hasown": "^2.0.0" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-to-primitive": { - "version": "1.2.1", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "license": "MIT", "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { "node": ">= 0.4" @@ -11693,10 +9506,14 @@ }, "node_modules/es6-promise": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==", "license": "MIT" }, "node_modules/escalade": { - "version": "3.1.1", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { @@ -11705,10 +9522,14 @@ }, "node_modules/escape-html": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "license": "MIT", "engines": { "node": ">=0.8.0" @@ -11716,6 +9537,8 @@ }, "node_modules/escodegen": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -11736,6 +9559,8 @@ }, "node_modules/escodegen/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -11744,6 +9569,8 @@ }, "node_modules/escodegen/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", "optional": true, @@ -11752,14 +9579,17 @@ } }, "node_modules/eslint": { - "version": "8.56.0", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -11806,6 +9636,8 @@ }, "node_modules/eslint-config-airbnb-base": { "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", "license": "MIT", "dependencies": { "confusing-browser-globals": "^1.0.10", @@ -11823,6 +9655,8 @@ }, "node_modules/eslint-config-airbnb-base/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -11830,6 +9664,8 @@ }, "node_modules/eslint-config-airbnb-typescript": { "version": "17.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.1.0.tgz", + "integrity": "sha512-GPxI5URre6dDpJ0CtcthSZVBAfI+Uw7un5OYNVxP2EYi3H81Jw701yFP7AU+/vCE7xBtFmjge7kfhhk4+RAiig==", "license": "MIT", "dependencies": { "eslint-config-airbnb-base": "^15.0.0" @@ -11843,6 +9679,8 @@ }, "node_modules/eslint-config-prettier": { "version": "8.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", + "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", "dev": true, "license": "MIT", "bin": { @@ -11854,6 +9692,8 @@ }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "license": "MIT", "dependencies": { "debug": "^3.2.7", @@ -11863,13 +9703,17 @@ }, "node_modules/eslint-import-resolver-node/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils": { - "version": "2.8.0", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", "license": "MIT", "dependencies": { "debug": "^3.2.7" @@ -11885,42 +9729,50 @@ }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import": { - "version": "2.29.1", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "license": "MIT", "dependencies": { - "array-includes": "^3.1.7", - "array.prototype.findlastindex": "^1.2.3", + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", "array.prototype.flat": "^1.3.2", "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.8.0", - "hasown": "^2.0.0", - "is-core-module": "^2.13.1", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.fromentries": "^2.0.7", - "object.groupby": "^1.0.1", - "object.values": "^1.1.7", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", "dependencies": { "ms": "^2.1.1" @@ -11928,6 +9780,8 @@ }, "node_modules/eslint-plugin-import/node_modules/doctrine": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" @@ -11938,6 +9792,8 @@ }, "node_modules/eslint-plugin-import/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -11945,6 +9801,8 @@ }, "node_modules/eslint-plugin-json": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-3.1.0.tgz", + "integrity": "sha512-MrlG2ynFEHe7wDGwbUuFPsaT2b1uhuEFhJ+W1f1u+1C2EkXmTYJp4B1aAdQQ8M+CC3t//N/oRKiIVw14L2HR1g==", "dev": true, "license": "MIT", "dependencies": { @@ -11956,10 +9814,11 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", - "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", + "integrity": "sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==", "dev": true, + "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.9.1" @@ -11987,6 +9846,8 @@ }, "node_modules/eslint-plugin-sonarjs": { "version": "0.19.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.19.0.tgz", + "integrity": "sha512-6+s5oNk5TFtVlbRxqZN7FIGmjdPCYQKaTzFPmqieCmsU1kBYDzndTeQav0xtQNwZJWu5awWfTGe8Srq9xFOGnw==", "dev": true, "license": "LGPL-3.0", "engines": { @@ -11998,6 +9859,8 @@ }, "node_modules/eslint-plugin-unicorn": { "version": "46.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-46.0.1.tgz", + "integrity": "sha512-setGhMTiLAddg1asdwjZ3hekIN5zLznNa5zll7pBPwFOka6greCKDQydfqy4fqyUhndi74wpDzClSQMEcmOaew==", "dev": true, "license": "MIT", "dependencies": { @@ -12030,6 +9893,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -12042,6 +9907,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -12053,6 +9920,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -12067,6 +9936,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -12078,6 +9949,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "license": "MIT", "dependencies": { @@ -12092,6 +9965,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "license": "MIT", "dependencies": { @@ -12108,6 +9983,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -12116,6 +9993,8 @@ }, "node_modules/eslint-plugin-unicorn/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -12124,6 +10003,8 @@ }, "node_modules/eslint-scope": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -12135,6 +10016,8 @@ }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -12145,6 +10028,8 @@ }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -12159,6 +10044,8 @@ }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -12172,6 +10059,8 @@ }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -12186,6 +10075,8 @@ }, "node_modules/eslint/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -12196,10 +10087,14 @@ }, "node_modules/eslint/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "license": "MIT", "engines": { "node": ">=10" @@ -12210,6 +10105,8 @@ }, "node_modules/eslint/node_modules/eslint-scope": { "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -12224,6 +10121,8 @@ }, "node_modules/eslint/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12231,6 +10130,8 @@ }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "license": "MIT", "engines": { "node": ">=8" @@ -12238,10 +10139,14 @@ }, "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "license": "MIT" }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -12252,6 +10157,8 @@ }, "node_modules/espree": { "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", @@ -12267,6 +10174,8 @@ }, "node_modules/esprima": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -12277,7 +10186,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" @@ -12288,6 +10199,8 @@ }, "node_modules/esquery/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12295,6 +10208,8 @@ }, "node_modules/esrecurse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" @@ -12305,6 +10220,8 @@ }, "node_modules/esrecurse/node_modules/estraverse": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12312,6 +10229,8 @@ }, "node_modules/estraverse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -12319,6 +10238,8 @@ }, "node_modules/esutils": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" @@ -12326,11 +10247,15 @@ }, "node_modules/eventemitter3": { "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "dev": true, "license": "MIT" }, "node_modules/events": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "license": "MIT", "engines": { "node": ">=0.8.x" @@ -12338,6 +10263,8 @@ }, "node_modules/execa": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "license": "MIT", "dependencies": { @@ -12360,6 +10287,8 @@ }, "node_modules/exit": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "dev": true, "engines": { "node": ">= 0.8.0" @@ -12376,6 +10305,8 @@ }, "node_modules/expand-tilde": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", "dev": true, "license": "MIT", "dependencies": { @@ -12387,6 +10318,8 @@ }, "node_modules/expect": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "license": "MIT", "dependencies": { @@ -12402,6 +10335,8 @@ }, "node_modules/expose-gc": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/expose-gc/-/expose-gc-1.0.0.tgz", + "integrity": "sha512-ecOHrdm+zyOCGIwX18/1RHkUWgxDqGGRiGhaNC+42jReTtudbm2ID/DMa/wpaHwqy5YQHPZvsDqRM2F2iZ0uVA==", "dev": true, "license": "MIT", "engines": { @@ -12410,6 +10345,8 @@ }, "node_modules/external-editor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "license": "MIT", "dependencies": { @@ -12423,22 +10360,28 @@ }, "node_modules/fast-deep-equal": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "license": "MIT" }, "node_modules/fast-diff": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true, "license": "Apache-2.0" }, "node_modules/fast-glob": { - "version": "3.3.2", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -12446,6 +10389,8 @@ }, "node_modules/fast-glob/node_modules/glob-parent": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -12456,51 +10401,71 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "license": "MIT" }, "node_modules/fast-printf": { - "version": "1.6.9", + "version": "1.6.10", + "resolved": "https://registry.npmjs.org/fast-printf/-/fast-printf-1.6.10.tgz", + "integrity": "sha512-GwTgG9O4FVIdShhbVF3JxOgSBY2+ePGsu2V/UONgoCPzF9VY6ZdBMKsHKCYQHZwNk3qNouUolRDsgVxcVA5G1w==", "dev": true, "license": "BSD-3-Clause", - "dependencies": { - "boolean": "^3.1.4" - }, "engines": { "node": ">=10.0" } }, "node_modules/fast-safe-stringify": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true, "license": "MIT" }, - "node_modules/fast-xml-parser": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz", - "integrity": "sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==", + "node_modules/fast-uri": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", + "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" + "url": "https://github.com/sponsors/fastify" }, { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fast-xml-parser": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz", + "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" } ], + "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "strnum": "^1.1.1" }, "bin": { "fxparser": "src/cli/cli.js" } }, "node_modules/fastq": { - "version": "1.16.0", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -12508,6 +10473,8 @@ }, "node_modules/fb-watchman": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -12516,10 +10483,14 @@ }, "node_modules/fecha": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", "license": "MIT" }, "node_modules/figures": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "license": "MIT", "dependencies": { @@ -12534,6 +10505,8 @@ }, "node_modules/file-entry-cache": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" @@ -12545,13 +10518,15 @@ "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" }, "node_modules/filelist": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", "dev": true, + "license": "Apache-2.0", "dependencies": { "minimatch": "^5.0.1" } @@ -12561,6 +10536,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -12570,6 +10546,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -12579,6 +10556,8 @@ }, "node_modules/filing-cabinet": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/filing-cabinet/-/filing-cabinet-3.3.1.tgz", + "integrity": "sha512-renEK4Hh6DUl9Vl22Y3cxBq1yh8oNvbAdXnhih0wVpmea+uyKjC9K4QeRjUaybIiIewdzfum+Fg15ZqJ/GyCaA==", "dev": true, "license": "MIT", "dependencies": { @@ -12605,11 +10584,15 @@ }, "node_modules/filing-cabinet/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/filing-cabinet/node_modules/typescript": { "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true, "license": "Apache-2.0", "bin": { @@ -12622,6 +10605,8 @@ }, "node_modules/fill-range": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -12632,6 +10617,8 @@ }, "node_modules/find-node-modules": { "version": "2.1.3", + "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-2.1.3.tgz", + "integrity": "sha512-UC2I2+nx1ZuOBclWVNdcnbDR5dlrOdVb7xNjmT/lHE+LsgztWks3dG7boJ37yTS/venXw84B/mAW9uHVoC5QRg==", "dev": true, "license": "MIT", "dependencies": { @@ -12641,11 +10628,15 @@ }, "node_modules/find-root": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true, "license": "MIT" }, "node_modules/find-up": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "license": "MIT", "dependencies": { "locate-path": "^6.0.0", @@ -12662,12 +10653,15 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/findit2/-/findit2-2.2.3.tgz", "integrity": "sha512-lg/Moejf4qXovVutL0Lz4IsaPoNYMuxt4PA0nGqFxnJ1CTTGGlEO2wKgoDpwknhvZ8k4Q2F+eesgkLbG2Mxfog==", + "license": "MIT", "engines": { "node": ">=0.8.22" } }, "node_modules/findup-sync": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12682,6 +10676,8 @@ }, "node_modules/flat": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "license": "BSD-3-Clause", "bin": { "flat": "cli.js" @@ -12689,6 +10685,8 @@ }, "node_modules/flat-cache": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "license": "MIT", "dependencies": { "flatted": "^3.2.9", @@ -12700,20 +10698,29 @@ } }, "node_modules/flatted": { - "version": "3.2.9", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "license": "ISC" }, "node_modules/flatten": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz", + "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==", + "deprecated": "flatten is deprecated in favor of utility frameworks such as lodash.", "dev": true, "license": "MIT" }, "node_modules/fn.name": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", "license": "MIT" }, "node_modules/follow-redirects": { - "version": "1.15.6", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", @@ -12731,18 +10738,28 @@ } }, "node_modules/for-each": { - "version": "0.3.3", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "license": "MIT", "dependencies": { - "is-callable": "^1.1.3" + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/foreground-child": { - "version": "3.1.1", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, "license": "ISC", "dependencies": { - "cross-spawn": "^7.0.0", + "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" }, "engines": { @@ -12754,6 +10771,8 @@ }, "node_modules/foreground-child/node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, "license": "ISC", "engines": { @@ -12764,11 +10783,14 @@ } }, "node_modules/form-data": { - "version": "4.0.0", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -12777,6 +10799,8 @@ }, "node_modules/formidable": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", + "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", "dev": true, "license": "MIT", "dependencies": { @@ -12791,6 +10815,8 @@ }, "node_modules/fresh": { "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -12798,6 +10824,8 @@ }, "node_modules/from2": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", "dev": true, "license": "MIT", "dependencies": { @@ -12813,6 +10841,8 @@ }, "node_modules/fs-extra": { "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12829,6 +10859,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", "dependencies": { "minipass": "^3.0.0" }, @@ -12840,6 +10871,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -12850,39 +10882,36 @@ "node_modules/fs-minipass/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" }, "node_modules/fs.realpath": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/function.prototype.name": { - "version": "1.1.6", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" @@ -12893,6 +10922,8 @@ }, "node_modules/functions-have-names": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12903,6 +10934,7 @@ "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", "deprecated": "This package is no longer supported.", + "license": "ISC", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -12920,6 +10952,8 @@ }, "node_modules/gensync": { "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "license": "MIT", "engines": { @@ -12928,6 +10962,8 @@ }, "node_modules/get-amd-module-type": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-4.1.0.tgz", + "integrity": "sha512-0e/eK6vTGCnSfQ6eYs3wtH05KotJYIP7ZIZEueP/KlA+0dIAEs8bYFvOd/U56w1vfjhJqBagUxVMyy9Tr/cViQ==", "dev": true, "license": "MIT", "dependencies": { @@ -12940,6 +10976,8 @@ }, "node_modules/get-caller-file": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "license": "ISC", "engines": { @@ -12947,13 +10985,24 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.2", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12961,11 +11010,15 @@ }, "node_modules/get-own-enumerable-property-symbols": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", "dev": true, "license": "ISC" }, "node_modules/get-package-type": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, "license": "MIT", "engines": { @@ -12974,6 +11027,8 @@ }, "node_modules/get-pkg-repo": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha512-xPCyvcEOxCJDxhBfXDNH+zA7mIRGb2aY1gIUJWsZkpJbp1BLHl+/Sycg26Dv+ZbZAJkO61tzbBtqHUi30NGBvg==", "dev": true, "license": "MIT", "dependencies": { @@ -12989,6 +11044,8 @@ }, "node_modules/get-pkg-repo/node_modules/camelcase": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha512-DLIsRzJVBQu72meAKPkWQOLcujdXT32hwdfnkI1frSiSRMK1MofjKHf+MEx0SB6fjEFXL8fBDv1dKymBlOp4Qw==", "dev": true, "license": "MIT", "engines": { @@ -12997,6 +11054,8 @@ }, "node_modules/get-pkg-repo/node_modules/camelcase-keys": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha512-bA/Z/DERHKqoEOrp+qeGKw1QlvEQkGZSc0XaY6VnTxZr+Kv1G5zFwttpjv8qxZ/sBPT4nthwZaAcsAZTJlSKXQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13009,6 +11068,8 @@ }, "node_modules/get-pkg-repo/node_modules/find-up": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", "dev": true, "license": "MIT", "dependencies": { @@ -13021,6 +11082,8 @@ }, "node_modules/get-pkg-repo/node_modules/indent-string": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha512-aqwDFWSgSgfRaEwao5lg5KEcVd/2a+D1rvoG7NdilmYz0NwRk6StWpWdz/Hpk34MKPpx7s8XxUqimfcQK6gGlg==", "dev": true, "license": "MIT", "dependencies": { @@ -13032,6 +11095,8 @@ }, "node_modules/get-pkg-repo/node_modules/load-json-file": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "dev": true, "license": "MIT", "dependencies": { @@ -13047,6 +11112,8 @@ }, "node_modules/get-pkg-repo/node_modules/map-obj": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true, "license": "MIT", "engines": { @@ -13055,6 +11122,8 @@ }, "node_modules/get-pkg-repo/node_modules/meow": { "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha512-TNdwZs0skRlpPpCUK25StC4VH+tP5GgeY1HQOOGP+lQ2xtdkN2VtT/5tiX9k3IWpkBPV9b3LsAWXn4GGi/PrSA==", "dev": true, "license": "MIT", "dependencies": { @@ -13075,6 +11144,8 @@ }, "node_modules/get-pkg-repo/node_modules/parse-json": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13086,6 +11157,8 @@ }, "node_modules/get-pkg-repo/node_modules/path-exists": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13097,6 +11170,8 @@ }, "node_modules/get-pkg-repo/node_modules/path-type": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", "dev": true, "license": "MIT", "dependencies": { @@ -13110,6 +11185,8 @@ }, "node_modules/get-pkg-repo/node_modules/read-pkg": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13123,6 +11200,8 @@ }, "node_modules/get-pkg-repo/node_modules/read-pkg-up": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "dev": true, "license": "MIT", "dependencies": { @@ -13135,6 +11214,8 @@ }, "node_modules/get-pkg-repo/node_modules/redent": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha512-qtW5hKzGQZqKoh6JNSD+4lfitfPKGz42e6QwiRmPM5mmKtR0N41AbJRYu0xJi7nhOJ4WDgRkKvAk6tw4WIwR4g==", "dev": true, "license": "MIT", "dependencies": { @@ -13147,6 +11228,8 @@ }, "node_modules/get-pkg-repo/node_modules/strip-bom": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "dev": true, "license": "MIT", "dependencies": { @@ -13158,6 +11241,8 @@ }, "node_modules/get-pkg-repo/node_modules/strip-indent": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha512-I5iQq6aFMM62fBEAIB/hXzwJD6EEZ0xEGCX2t7oXqaKPIRgt4WruAQ285BISgdkP+HLGWyeGmNJcpIwFeRYRUA==", "dev": true, "license": "MIT", "dependencies": { @@ -13170,8 +11255,23 @@ "node": ">=0.10.0" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stdin": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==", "dev": true, "license": "MIT", "engines": { @@ -13180,6 +11280,8 @@ }, "node_modules/get-stream": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "license": "MIT", "engines": { @@ -13190,11 +11292,14 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.0", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -13205,6 +11310,8 @@ }, "node_modules/get-value": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-3.0.1.tgz", + "integrity": "sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA==", "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -13215,6 +11322,8 @@ }, "node_modules/gh-got": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gh-got/-/gh-got-7.1.0.tgz", + "integrity": "sha512-KeWkkhresa7sbpzQLYzITMgez5rMigUsijhmSAHcLDORIMUbdlkdoZyaN1wQvIjmUZnyb/wkAPaXb4MQKX0mdQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13227,6 +11336,8 @@ }, "node_modules/git-raw-commits": { "version": "2.0.11", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.11.tgz", + "integrity": "sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==", "dev": true, "license": "MIT", "dependencies": { @@ -13245,6 +11356,8 @@ }, "node_modules/git-raw-commits/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -13258,6 +11371,8 @@ }, "node_modules/git-raw-commits/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -13266,6 +11381,8 @@ }, "node_modules/git-remote-origin-url": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==", "dev": true, "license": "MIT", "dependencies": { @@ -13278,6 +11395,8 @@ }, "node_modules/git-semver-tags": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz", + "integrity": "sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==", "dev": true, "license": "MIT", "dependencies": { @@ -13293,6 +11412,8 @@ }, "node_modules/git-semver-tags/node_modules/camelcase": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==", "dev": true, "license": "MIT", "engines": { @@ -13301,6 +11422,8 @@ }, "node_modules/git-semver-tags/node_modules/camelcase-keys": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha512-Ej37YKYbFUI8QiYlvj9YHb6/Z60dZyPJW0Cs8sFilMbd2lP0bw3ylAq9yJkK4lcTA2dID5fG8LjmJYbO7kWb7Q==", "dev": true, "license": "MIT", "dependencies": { @@ -13314,6 +11437,8 @@ }, "node_modules/git-semver-tags/node_modules/indent-string": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==", "dev": true, "license": "MIT", "engines": { @@ -13322,6 +11447,8 @@ }, "node_modules/git-semver-tags/node_modules/map-obj": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha512-TzQSV2DiMYgoF5RycneKVUzIa9bQsj/B3tTgsE3dOGqlzHnGIDaC7XBE7grnA+8kZPnfqSGFe95VHc2oc0VFUQ==", "dev": true, "license": "MIT", "engines": { @@ -13330,6 +11457,8 @@ }, "node_modules/git-semver-tags/node_modules/meow": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", "dev": true, "license": "MIT", "dependencies": { @@ -13349,6 +11478,8 @@ }, "node_modules/git-semver-tags/node_modules/minimist-options": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13361,6 +11492,8 @@ }, "node_modules/git-semver-tags/node_modules/quick-lru": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha512-tRS7sTgyxMXtLum8L65daJnHUhfDUgboRdcWW2bR9vBfrj2+O5HSMbQOJfJJjIVSPFqbBCF37FpwWXGitDc5tA==", "dev": true, "license": "MIT", "engines": { @@ -13369,6 +11502,8 @@ }, "node_modules/git-semver-tags/node_modules/redent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha512-XNwrTx77JQCEMXTeb8movBKuK75MgH0RZkujNuDKCezemx/voapl9i2gCSi8WWm8+ox5ycJi1gxF22fR7c0Ciw==", "dev": true, "license": "MIT", "dependencies": { @@ -13381,6 +11516,8 @@ }, "node_modules/git-semver-tags/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -13389,6 +11526,8 @@ }, "node_modules/git-semver-tags/node_modules/strip-indent": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==", "dev": true, "license": "MIT", "engines": { @@ -13397,6 +11536,8 @@ }, "node_modules/gitconfiglocal": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==", "dev": true, "license": "BSD", "dependencies": { @@ -13410,28 +11551,30 @@ "license": "MIT" }, "node_modules/glob": { - "version": "10.3.10", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "license": "ISC", "dependencies": { "is-glob": "^4.0.3" @@ -13442,6 +11585,8 @@ }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { @@ -13449,7 +11594,9 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "9.0.3", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "license": "ISC", "dependencies": { @@ -13464,6 +11611,8 @@ }, "node_modules/global-dirs": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==", "dev": true, "license": "MIT", "dependencies": { @@ -13475,6 +11624,8 @@ }, "node_modules/global-modules": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "license": "MIT", "dependencies": { @@ -13488,6 +11639,8 @@ }, "node_modules/global-prefix": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", "dev": true, "license": "MIT", "dependencies": { @@ -13503,6 +11656,8 @@ }, "node_modules/global-prefix/node_modules/which": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "license": "ISC", "dependencies": { @@ -13514,6 +11669,8 @@ }, "node_modules/globals": { "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "license": "MIT", "dependencies": { "type-fest": "^0.20.2" @@ -13526,10 +11683,13 @@ } }, "node_modules/globalthis": { - "version": "1.0.3", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "license": "MIT", "dependencies": { - "define-properties": "^1.1.3" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -13540,6 +11700,8 @@ }, "node_modules/globby": { "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "license": "MIT", "dependencies": { "array-union": "^2.1.0", @@ -13558,6 +11720,8 @@ }, "node_modules/gonzales-pe": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", + "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13571,10 +11735,12 @@ } }, "node_modules/gopd": { - "version": "1.0.1", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.1.3" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13582,6 +11748,8 @@ }, "node_modules/got": { "version": "8.3.2", + "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz", + "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==", "dev": true, "license": "MIT", "dependencies": { @@ -13609,6 +11777,8 @@ }, "node_modules/got/node_modules/get-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", "dev": true, "license": "MIT", "engines": { @@ -13617,6 +11787,8 @@ }, "node_modules/got/node_modules/pify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "license": "MIT", "engines": { @@ -13625,20 +11797,28 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true, "license": "ISC" }, "node_modules/graphemer": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "license": "MIT" }, "node_modules/growly": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==", "dev": true, "license": "MIT" }, "node_modules/handlebars": { "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "license": "MIT", "dependencies": { "minimist": "^1.2.5", @@ -13658,6 +11838,8 @@ }, "node_modules/handlebars/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -13665,6 +11847,8 @@ }, "node_modules/hard-rejection": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true, "license": "MIT", "engines": { @@ -13672,32 +11856,46 @@ } }, "node_modules/has-bigints": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/has-property-descriptors": { - "version": "1.0.1", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { - "version": "1.0.1", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -13707,6 +11905,8 @@ }, "node_modules/has-symbol-support-x": { "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", "dev": true, "license": "MIT", "engines": { @@ -13714,7 +11914,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -13725,6 +11927,8 @@ }, "node_modules/has-to-string-tag-x": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", "dev": true, "license": "MIT", "dependencies": { @@ -13735,10 +11939,12 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -13750,10 +11956,13 @@ "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC" }, "node_modules/has-value": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-2.0.2.tgz", + "integrity": "sha512-ybKOlcRsK2MqrM3Hmz/lQxXHZ6ejzSPzpNabKB45jb5qDgJvKPa3SdapTsTLwEb9WltgWpOmNax7i+DzNOk4TA==", "license": "MIT", "dependencies": { "get-value": "^3.0.0", @@ -13765,6 +11974,8 @@ }, "node_modules/has-values": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-2.0.1.tgz", + "integrity": "sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w==", "license": "MIT", "dependencies": { "kind-of": "^6.0.2" @@ -13774,7 +11985,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -13785,10 +11998,14 @@ }, "node_modules/heap": { "version": "0.2.7", + "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", + "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", "license": "MIT" }, "node_modules/hexoid": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", + "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", "dev": true, "license": "MIT", "engines": { @@ -13797,6 +12014,8 @@ }, "node_modules/homedir-polyfill": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, "license": "MIT", "dependencies": { @@ -13808,15 +12027,21 @@ }, "node_modules/hosted-git-info": { "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "license": "ISC" }, "node_modules/html-escaper": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true, "license": "MIT" }, "node_modules/http-assert": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz", + "integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==", "license": "MIT", "dependencies": { "deep-equal": "~1.0.1", @@ -13828,6 +12053,8 @@ }, "node_modules/http-assert/node_modules/depd": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -13835,6 +12062,8 @@ }, "node_modules/http-assert/node_modules/http-errors": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "license": "MIT", "dependencies": { "depd": "~1.1.2", @@ -13849,6 +12078,8 @@ }, "node_modules/http-assert/node_modules/statuses": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -13856,11 +12087,15 @@ }, "node_modules/http-cache-semantics": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true, "license": "BSD-2-Clause" }, "node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "license": "MIT", "dependencies": { "depd": "2.0.0", @@ -13874,7 +12109,9 @@ } }, "node_modules/http-graceful-shutdown": { - "version": "3.1.13", + "version": "3.1.14", + "resolved": "https://registry.npmjs.org/http-graceful-shutdown/-/http-graceful-shutdown-3.1.14.tgz", + "integrity": "sha512-aTbGAZDUtRt7gRmU+li7rt5WbJeemULZHLNrycJ1dRBU80Giut6NvzG8h5u1TW1zGHXkPGpEtoEKhPKogIRKdA==", "license": "MIT", "dependencies": { "debug": "^4.3.4" @@ -13885,6 +12122,8 @@ }, "node_modules/http-terminator": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/http-terminator/-/http-terminator-3.2.0.tgz", + "integrity": "sha512-JLjck1EzPaWjsmIf8bziM3p9fgR1Y3JoUKAkyYEbZmFrIvJM6I8vVJfBGWlEtV9IWOvzNnaTtjuwZeBY2kwB4g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -13899,6 +12138,8 @@ }, "node_modules/http-terminator/node_modules/type-fest": { "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -13910,6 +12151,8 @@ }, "node_modules/https-proxy-agent": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "license": "MIT", "dependencies": { "agent-base": "6", @@ -13920,7 +12163,9 @@ } }, "node_modules/human-format": { - "version": "1.2.0", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/human-format/-/human-format-1.2.1.tgz", + "integrity": "sha512-o5Ldz62VWR5lYUZ8aVQaLKiN37NsHnmk3xjMoUjza3mGkk8MvMofgZT0T6HKSCKSJIir+AWk9Dx8KhxvZAUgCg==", "dev": true, "license": "ISC", "engines": { @@ -13929,6 +12174,8 @@ }, "node_modules/human-signals": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -13936,10 +12183,11 @@ } }, "node_modules/husky": { - "version": "9.1.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", - "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, + "license": "MIT", "bin": { "husky": "bin.js" }, @@ -13952,6 +12200,8 @@ }, "node_modules/iconv-lite": { "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" @@ -13962,6 +12212,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -13979,14 +12231,18 @@ "license": "BSD-3-Clause" }, "node_modules/ignore": { - "version": "5.3.0", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { - "version": "3.3.0", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -14001,13 +12257,17 @@ }, "node_modules/import-fresh/node_modules/resolve-from": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/import-local": { - "version": "3.1.0", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, "license": "MIT", "dependencies": { @@ -14026,6 +12286,8 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "license": "MIT", "engines": { "node": ">=0.8.19" @@ -14033,6 +12295,8 @@ }, "node_modules/indent-string": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, "license": "MIT", "engines": { @@ -14041,11 +12305,15 @@ }, "node_modules/indexes-of": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA==", "dev": true, "license": "MIT" }, "node_modules/inflation": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.1.0.tgz", + "integrity": "sha512-t54PPJHG1Pp7VQvxyVCJ9mBbjG3Hqryges9bXoOO6GExCPa+//i/d5GSuFtpx3ALLd7lgIAur6zrIlBQyJuMlQ==", "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -14053,6 +12321,9 @@ }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -14061,14 +12332,20 @@ }, "node_modules/inherits": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/ini": { "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "license": "ISC" }, "node_modules/inquirer": { - "version": "8.2.6", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14086,7 +12363,7 @@ "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6", - "wrap-ansi": "^6.0.1" + "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12.0.0" @@ -14094,6 +12371,8 @@ }, "node_modules/inquirer/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -14108,6 +12387,8 @@ }, "node_modules/inquirer/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -14123,6 +12404,8 @@ }, "node_modules/inquirer/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14134,11 +12417,15 @@ }, "node_modules/inquirer/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/inquirer/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -14147,6 +12434,8 @@ }, "node_modules/inquirer/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -14156,26 +12445,15 @@ "node": ">=8" } }, - "node_modules/inquirer/node_modules/wrap-ansi": { - "version": "6.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/internal-slot": { - "version": "1.0.6", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.2", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -14183,6 +12461,8 @@ }, "node_modules/into-stream": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", + "integrity": "sha512-TcdjPibTksa1NQximqep2r17ISRiNE9fwlfbg3F8ANdvP5/yrFTew86VcO//jk4QTaMlbjypPBq76HN2zaKfZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -14194,7 +12474,9 @@ } }, "node_modules/ioredis": { - "version": "5.3.2", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.5.0.tgz", + "integrity": "sha512-7CutT89g23FfSa8MDoIFs2GYYa0PaNiW/OrT+nRyjRXHDZd17HmIgy+reOQ/yhh72NznNjGuS8kbCAcA4Ro4mw==", "license": "MIT", "dependencies": { "@ioredis/commands": "^1.1.1", @@ -14217,6 +12499,8 @@ }, "node_modules/ip-regex": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", + "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", "license": "MIT", "engines": { "node": ">=8" @@ -14224,18 +12508,25 @@ }, "node_modules/is": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", + "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==", "license": "MIT", "engines": { "node": "*" } }, "node_modules/is-array-buffer": { - "version": "3.0.2", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -14243,24 +12534,52 @@ }, "node_modules/is-arrayish": { "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "license": "MIT" }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { - "version": "1.0.4", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "license": "MIT", "dependencies": { - "has-bigints": "^1.0.1" + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-boolean-object": { - "version": "1.1.2", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14271,6 +12590,8 @@ }, "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": [ { @@ -14293,6 +12614,8 @@ }, "node_modules/is-builtin-module": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", "dev": true, "license": "MIT", "dependencies": { @@ -14307,6 +12630,8 @@ }, "node_modules/is-callable": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -14316,20 +12641,45 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-date-object": { - "version": "1.0.5", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14340,6 +12690,8 @@ }, "node_modules/is-docker": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, "license": "MIT", "bin": { @@ -14354,13 +12706,32 @@ }, "node_modules/is-extglob": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-finite": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", "dev": true, "license": "MIT", "engines": { @@ -14372,6 +12743,8 @@ }, "node_modules/is-fullwidth-code-point": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", "dev": true, "license": "MIT", "engines": { @@ -14383,6 +12756,8 @@ }, "node_modules/is-generator-fn": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, "license": "MIT", "engines": { @@ -14390,10 +12765,15 @@ } }, "node_modules/is-generator-function": { - "version": "1.0.10", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -14404,6 +12784,8 @@ }, "node_modules/is-glob": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -14414,6 +12796,8 @@ }, "node_modules/is-interactive": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, "license": "MIT", "engines": { @@ -14422,6 +12806,8 @@ }, "node_modules/is-ip": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz", + "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==", "license": "MIT", "dependencies": { "ip-regex": "^4.0.0" @@ -14430,8 +12816,10 @@ "node": ">=8" } }, - "node_modules/is-negative-zero": { - "version": "2.0.2", + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -14442,16 +12830,21 @@ }, "node_modules/is-number": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { - "version": "1.0.7", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14462,6 +12855,8 @@ }, "node_modules/is-obj": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", "dev": true, "license": "MIT", "engines": { @@ -14470,6 +12865,8 @@ }, "node_modules/is-object": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", + "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==", "dev": true, "license": "MIT", "funding": { @@ -14478,6 +12875,8 @@ }, "node_modules/is-path-inside": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "license": "MIT", "engines": { "node": ">=8" @@ -14485,6 +12884,8 @@ }, "node_modules/is-plain-obj": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true, "license": "MIT", "engines": { @@ -14493,6 +12894,8 @@ }, "node_modules/is-plain-object": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -14503,17 +12906,23 @@ }, "node_modules/is-primitive": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-3.0.1.tgz", + "integrity": "sha512-GljRxhWvlCNRfZyORiH77FwdFwGcMO620o37EOYC0ORWdq+WYNVqW0w2Juzew4M+L81l6/QS3t5gkkihyRqv9w==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-regex": { - "version": "1.1.4", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -14524,6 +12933,8 @@ }, "node_modules/is-regexp": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", "dev": true, "license": "MIT", "engines": { @@ -14532,22 +12943,43 @@ }, "node_modules/is-relative-path": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-relative-path/-/is-relative-path-1.0.2.tgz", + "integrity": "sha512-i1h+y50g+0hRbBD+dbnInl3JlJ702aar58snAeX+MxBAPvzXGej7sYoPMhlnykabt0ZzCJNBEyzMlekuQZN7fA==", "dev": true, "license": "MIT" }, "node_modules/is-retry-allowed": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-shared-array-buffer": { - "version": "1.0.2", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -14555,6 +12987,8 @@ }, "node_modules/is-stream": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "license": "MIT", "engines": { "node": ">=8" @@ -14564,10 +12998,13 @@ } }, "node_modules/is-string": { - "version": "1.0.7", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -14577,10 +13014,14 @@ } }, "node_modules/is-symbol": { - "version": "1.0.4", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -14591,6 +13032,8 @@ }, "node_modules/is-text-path": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==", "dev": true, "license": "MIT", "dependencies": { @@ -14601,10 +13044,12 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.12", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -14615,6 +13060,8 @@ }, "node_modules/is-unicode-supported": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "license": "MIT", "engines": { @@ -14626,11 +13073,15 @@ }, "node_modules/is-url": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", "dev": true, "license": "MIT" }, "node_modules/is-url-superb": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-url-superb/-/is-url-superb-4.0.0.tgz", + "integrity": "sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA==", "dev": true, "license": "MIT", "engines": { @@ -14642,14 +13093,49 @@ }, "node_modules/is-utf8": { "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", "dev": true, "license": "MIT" }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakref": { - "version": "1.0.2", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -14657,6 +13143,8 @@ }, "node_modules/is-windows": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, "license": "MIT", "engines": { @@ -14665,6 +13153,8 @@ }, "node_modules/is-wsl": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, "license": "MIT", "dependencies": { @@ -14676,19 +13166,27 @@ }, "node_modules/isarray": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true, "license": "MIT" }, "node_modules/iserror": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/iserror/-/iserror-0.0.2.tgz", + "integrity": "sha512-oKGGrFVaWwETimP3SiWwjDeY27ovZoyZPHtxblC4hCq9fXxed/jasx+ATWFFjCVSRZng8VTMsN1nDnGo6zMBSw==", "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, "node_modules/isobject": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -14709,6 +13207,8 @@ }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -14716,13 +13216,15 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "6.0.1", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", "istanbul-lib-coverage": "^3.2.0", "semver": "^7.5.4" }, @@ -14732,6 +13234,8 @@ }, "node_modules/istanbul-lib-report": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -14745,6 +13249,8 @@ }, "node_modules/istanbul-lib-report/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -14753,6 +13259,8 @@ }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -14764,6 +13272,8 @@ }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -14777,6 +13287,8 @@ }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -14784,7 +13296,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.6", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -14797,6 +13311,8 @@ }, "node_modules/isurl": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", "dev": true, "license": "MIT", "dependencies": { @@ -14808,15 +13324,14 @@ } }, "node_modules/jackspeak": { - "version": "2.3.6", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -14829,6 +13344,7 @@ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", @@ -14847,6 +13363,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -14862,6 +13379,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -14878,6 +13396,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -14889,13 +13408,15 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jake/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -14905,6 +13426,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -14914,6 +13436,8 @@ }, "node_modules/jest": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "license": "MIT", "dependencies": { @@ -14939,6 +13463,8 @@ }, "node_modules/jest-changed-files": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "license": "MIT", "dependencies": { @@ -14952,6 +13478,8 @@ }, "node_modules/jest-circus": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "license": "MIT", "dependencies": { @@ -14982,6 +13510,8 @@ }, "node_modules/jest-circus/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -14996,6 +13526,8 @@ }, "node_modules/jest-circus/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15011,6 +13543,8 @@ }, "node_modules/jest-circus/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15022,11 +13556,15 @@ }, "node_modules/jest-circus/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-circus/node_modules/dedent": { - "version": "1.5.1", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", + "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -15040,6 +13578,8 @@ }, "node_modules/jest-circus/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15048,6 +13588,8 @@ }, "node_modules/jest-circus/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15059,6 +13601,8 @@ }, "node_modules/jest-cli": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "license": "MIT", "dependencies": { @@ -15091,6 +13635,8 @@ }, "node_modules/jest-cli/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15105,6 +13651,8 @@ }, "node_modules/jest-cli/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15120,6 +13668,8 @@ }, "node_modules/jest-cli/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15131,11 +13681,15 @@ }, "node_modules/jest-cli/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-cli/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15144,6 +13698,8 @@ }, "node_modules/jest-cli/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15155,6 +13711,8 @@ }, "node_modules/jest-config": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15199,6 +13757,8 @@ }, "node_modules/jest-config/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15213,6 +13773,8 @@ }, "node_modules/jest-config/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15228,6 +13790,8 @@ }, "node_modules/jest-config/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15239,11 +13803,16 @@ }, "node_modules/jest-config/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-config/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -15263,6 +13832,8 @@ }, "node_modules/jest-config/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15271,6 +13842,8 @@ }, "node_modules/jest-config/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15285,6 +13858,7 @@ "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", @@ -15297,6 +13871,8 @@ }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15311,6 +13887,8 @@ }, "node_modules/jest-diff/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15326,6 +13904,8 @@ }, "node_modules/jest-diff/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15337,11 +13917,15 @@ }, "node_modules/jest-diff/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-diff/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15350,6 +13934,8 @@ }, "node_modules/jest-diff/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15361,6 +13947,8 @@ }, "node_modules/jest-docblock": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "license": "MIT", "dependencies": { @@ -15372,6 +13960,8 @@ }, "node_modules/jest-each": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15387,6 +13977,8 @@ }, "node_modules/jest-each/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15401,6 +13993,8 @@ }, "node_modules/jest-each/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15416,6 +14010,8 @@ }, "node_modules/jest-each/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15427,11 +14023,15 @@ }, "node_modules/jest-each/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-each/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15440,6 +14040,8 @@ }, "node_modules/jest-each/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15454,6 +14056,7 @@ "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, + "license": "MIT", "dependencies": { "@jest/environment": "^29.7.0", "@jest/fake-timers": "^29.7.0", @@ -15468,6 +14071,8 @@ }, "node_modules/jest-get-type": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "license": "MIT", "engines": { @@ -15476,6 +14081,8 @@ }, "node_modules/jest-haste-map": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "license": "MIT", "dependencies": { @@ -15500,6 +14107,8 @@ }, "node_modules/jest-leak-detector": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "license": "MIT", "dependencies": { @@ -15512,6 +14121,8 @@ }, "node_modules/jest-matcher-utils": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "license": "MIT", "dependencies": { @@ -15526,6 +14137,8 @@ }, "node_modules/jest-matcher-utils/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15540,6 +14153,8 @@ }, "node_modules/jest-matcher-utils/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15555,6 +14170,8 @@ }, "node_modules/jest-matcher-utils/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15566,11 +14183,15 @@ }, "node_modules/jest-matcher-utils/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-matcher-utils/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15579,6 +14200,8 @@ }, "node_modules/jest-matcher-utils/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15590,6 +14213,8 @@ }, "node_modules/jest-message-util": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "license": "MIT", "dependencies": { @@ -15609,6 +14234,8 @@ }, "node_modules/jest-message-util/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15623,6 +14250,8 @@ }, "node_modules/jest-message-util/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15638,6 +14267,8 @@ }, "node_modules/jest-message-util/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15649,11 +14280,15 @@ }, "node_modules/jest-message-util/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-message-util/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15662,6 +14297,8 @@ }, "node_modules/jest-message-util/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15673,6 +14310,8 @@ }, "node_modules/jest-mock": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "license": "MIT", "dependencies": { @@ -15686,6 +14325,8 @@ }, "node_modules/jest-pnp-resolver": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "license": "MIT", "engines": { @@ -15702,6 +14343,8 @@ }, "node_modules/jest-regex-util": { "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "license": "MIT", "engines": { @@ -15710,6 +14353,8 @@ }, "node_modules/jest-resolve": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "license": "MIT", "dependencies": { @@ -15729,6 +14374,8 @@ }, "node_modules/jest-resolve-dependencies": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "license": "MIT", "dependencies": { @@ -15741,6 +14388,8 @@ }, "node_modules/jest-resolve/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15755,6 +14404,8 @@ }, "node_modules/jest-resolve/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15770,6 +14421,8 @@ }, "node_modules/jest-resolve/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15781,11 +14434,15 @@ }, "node_modules/jest-resolve/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-resolve/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15794,6 +14451,8 @@ }, "node_modules/jest-resolve/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15805,6 +14464,8 @@ }, "node_modules/jest-runner": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15836,6 +14497,8 @@ }, "node_modules/jest-runner/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15850,6 +14513,8 @@ }, "node_modules/jest-runner/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15865,6 +14530,8 @@ }, "node_modules/jest-runner/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15876,11 +14543,15 @@ }, "node_modules/jest-runner/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-runner/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -15889,6 +14560,8 @@ }, "node_modules/jest-runner/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -15900,6 +14573,8 @@ }, "node_modules/jest-runtime": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15932,6 +14607,8 @@ }, "node_modules/jest-runtime/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -15946,6 +14623,8 @@ }, "node_modules/jest-runtime/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -15961,6 +14640,8 @@ }, "node_modules/jest-runtime/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -15972,11 +14653,16 @@ }, "node_modules/jest-runtime/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-runtime/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -15996,6 +14682,8 @@ }, "node_modules/jest-runtime/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16004,6 +14692,8 @@ }, "node_modules/jest-runtime/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -16015,6 +14705,8 @@ }, "node_modules/jest-snapshot": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "license": "MIT", "dependencies": { @@ -16045,6 +14737,8 @@ }, "node_modules/jest-snapshot/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -16059,6 +14753,8 @@ }, "node_modules/jest-snapshot/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -16074,6 +14770,8 @@ }, "node_modules/jest-snapshot/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16085,11 +14783,15 @@ }, "node_modules/jest-snapshot/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-snapshot/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16098,6 +14800,8 @@ }, "node_modules/jest-snapshot/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -16109,6 +14813,8 @@ }, "node_modules/jest-sonar": { "version": "0.2.16", + "resolved": "https://registry.npmjs.org/jest-sonar/-/jest-sonar-0.2.16.tgz", + "integrity": "sha512-ES6Z9BbIVDELtbz+/b6pv41B2qOfp38cQpoCLqei21FtlkG/GzhyQ0M3egEIM+erpJOkpRKM8Tc8/YQtHdiTXA==", "dev": true, "license": "MIT", "dependencies": { @@ -16118,6 +14824,8 @@ }, "node_modules/jest-util": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "license": "MIT", "dependencies": { @@ -16134,6 +14842,8 @@ }, "node_modules/jest-util/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -16148,6 +14858,8 @@ }, "node_modules/jest-util/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -16163,6 +14875,8 @@ }, "node_modules/jest-util/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16174,11 +14888,15 @@ }, "node_modules/jest-util/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-util/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16187,6 +14905,8 @@ }, "node_modules/jest-util/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -16198,6 +14918,8 @@ }, "node_modules/jest-validate": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "license": "MIT", "dependencies": { @@ -16214,6 +14936,8 @@ }, "node_modules/jest-validate/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -16228,6 +14952,8 @@ }, "node_modules/jest-validate/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -16243,6 +14969,8 @@ }, "node_modules/jest-validate/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16254,11 +14982,15 @@ }, "node_modules/jest-validate/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-validate/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16267,6 +14999,8 @@ }, "node_modules/jest-validate/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -16278,6 +15012,8 @@ }, "node_modules/jest-watcher": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "license": "MIT", "dependencies": { @@ -16296,6 +15032,8 @@ }, "node_modules/jest-watcher/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -16310,6 +15048,8 @@ }, "node_modules/jest-watcher/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -16325,6 +15065,8 @@ }, "node_modules/jest-watcher/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16336,11 +15078,15 @@ }, "node_modules/jest-watcher/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/jest-watcher/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16349,6 +15095,8 @@ }, "node_modules/jest-watcher/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -16359,7 +15107,9 @@ } }, "node_modules/jest-when": { - "version": "3.6.0", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jest-when/-/jest-when-3.7.0.tgz", + "integrity": "sha512-aLbiyxmtksijcrKFir7n+t+XPbqSLV01eDkRyX28WM4VgA/iSc3mG8R8O2evDtOAa6SefrJiTIt/rTqqyrwVZg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -16368,6 +15118,8 @@ }, "node_modules/jest-worker": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "license": "MIT", "dependencies": { @@ -16382,6 +15134,8 @@ }, "node_modules/jest-worker/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -16390,6 +15144,8 @@ }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -16402,25 +15158,22 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jiti": { - "version": "1.21.0", - "dev": true, - "license": "MIT", - "optional": true, - "bin": { - "jiti": "bin/jiti.js" - } - }, "node_modules/js-sha1": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz", + "integrity": "sha512-01gwBFreYydzmU9BmZxpVk6svJJHrVxEN3IOiGl6VO93bVKYETJ0sIth6DASI6mIFdt7NmfX9UiByRzsYHGU9w==", "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -16430,7 +15183,9 @@ } }, "node_modules/jsesc": { - "version": "3.0.2", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { @@ -16442,10 +15197,14 @@ }, "node_modules/json-buffer": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "license": "MIT" }, "node_modules/json-diff": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/json-diff/-/json-diff-1.0.6.tgz", + "integrity": "sha512-tcFIPRdlc35YkYdGxcamJjllUhXWv4n2rK9oJ2RsAzV4FBkuV4ojKEDgcZ+kpKxDmJKv+PFK65+1tVVOnSeEqA==", "license": "MIT", "dependencies": { "@ewoudenberg/difflib": "0.1.0", @@ -16461,19 +15220,27 @@ }, "node_modules/json-parse-better-errors": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true, "license": "MIT" }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, "node_modules/json-size": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-size/-/json-size-1.0.0.tgz", + "integrity": "sha512-sh8Ff4sNVI3FU1LjFXiNpcG9Er9bsn8WbeR79mGj4Ljd+/NBmxqYCV1sPzndUTGsWXa3LVUx3aLlZxpq1DzCBA==", "license": "MIT", "dependencies": { "utf8-length": "0.0.1" @@ -16481,15 +15248,21 @@ }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "license": "MIT" }, "node_modules/json-stringify-safe": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true, "license": "ISC" }, "node_modules/json5": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "license": "MIT", "bin": { @@ -16500,19 +15273,25 @@ } }, "node_modules/jsonata": { - "version": "2.0.5", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.0.6.tgz", + "integrity": "sha512-WhQB5tXQ32qjkx2GYHFw2XbL90u+LLzjofAYwi+86g6SyZeXHz9F1Q0amy3dWRYczshOC3Haok9J4pOCgHtwyQ==", "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/jsonc-parser": { - "version": "3.2.0", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", "dev": true, "license": "MIT" }, "node_modules/jsonfile": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16524,6 +15303,8 @@ }, "node_modules/jsonparse": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true, "engines": [ "node >= 0.2.0" @@ -16541,6 +15322,8 @@ }, "node_modules/JSONStream": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "license": "(MIT OR Apache-2.0)", "dependencies": { @@ -16556,6 +15339,8 @@ }, "node_modules/jsontoxml": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/jsontoxml/-/jsontoxml-1.0.1.tgz", + "integrity": "sha512-dtKGq0K8EWQBRqcAaePSgKR4Hyjfsz/LkurHSV3Cxk4H+h2fWDeaN2jzABz+ZmOJylgXS7FGeWmbZ6jgYUMdJQ==", "license": "MIT", "engines": { "node": ">=0.2.0" @@ -16563,6 +15348,8 @@ }, "node_modules/keygrip": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", "license": "MIT", "dependencies": { "tsscmp": "1.0.6" @@ -16573,6 +15360,8 @@ }, "node_modules/keyv": { "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "license": "MIT", "dependencies": { "json-buffer": "3.0.1" @@ -16580,6 +15369,8 @@ }, "node_modules/kind-of": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -16587,6 +15378,8 @@ }, "node_modules/kleur": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, "license": "MIT", "engines": { @@ -16594,9 +15387,9 @@ } }, "node_modules/koa": { - "version": "2.15.4", - "resolved": "https://registry.npmjs.org/koa/-/koa-2.15.4.tgz", - "integrity": "sha512-7fNBIdrU2PEgLljXoPWoyY4r1e+ToWCmzS/wwMPbUNs7X+5MMET1ObhJBlUkF5uZG9B6QhM2zS1TsH6adegkiQ==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.16.0.tgz", + "integrity": "sha512-Afhqq0Vq3W7C+/rW6IqHVBDLzqObwZ07JaUNUEF8yCQ6afiyFE3RAy+i7V0E46XOWlH7vPWn/x0vsZwNy6PWxw==", "license": "MIT", "dependencies": { "accepts": "^1.3.5", @@ -16629,6 +15422,8 @@ }, "node_modules/koa-bodyparser": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/koa-bodyparser/-/koa-bodyparser-4.4.1.tgz", + "integrity": "sha512-kBH3IYPMb+iAXnrxIhXnW+gXV8OTzCu8VPDqvcDHW9SQrbkHmqPQtiZwrltNmSq6/lpipHnT7k7PsjlVD7kK0w==", "license": "MIT", "dependencies": { "co-body": "^6.0.0", @@ -16641,10 +15436,14 @@ }, "node_modules/koa-compose": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", "license": "MIT" }, "node_modules/koa-convert": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz", + "integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==", "license": "MIT", "dependencies": { "co": "^4.6.0", @@ -16656,6 +15455,8 @@ }, "node_modules/koa/node_modules/http-errors": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "license": "MIT", "dependencies": { "depd": "~1.1.2", @@ -16670,6 +15471,8 @@ }, "node_modules/koa/node_modules/http-errors/node_modules/depd": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -16677,13 +15480,17 @@ }, "node_modules/koa/node_modules/statuses": { "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/koa2-swagger-ui": { - "version": "5.10.0", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/koa2-swagger-ui/-/koa2-swagger-ui-5.11.0.tgz", + "integrity": "sha512-EjmeK07RHjb+xje1fLVhQa66NWPrba9gZN/DDHo3Nc98raJ+dVxqrQADIHkZb3GAkdNdrrczb8x7n9euevxuJw==", "license": "MIT", "dependencies": { "handlebars": "^4.7.8", @@ -16696,6 +15503,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -16707,6 +15516,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -16717,6 +15528,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -16730,6 +15543,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -16740,6 +15555,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "license": "MIT", "dependencies": { "@types/normalize-package-data": "^2.4.0", @@ -16753,6 +15570,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "license": "MIT", "dependencies": { "find-up": "^4.1.0", @@ -16768,6 +15587,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" @@ -16775,6 +15596,8 @@ }, "node_modules/koa2-swagger-ui/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" @@ -16782,10 +15605,14 @@ }, "node_modules/kuler": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", "license": "MIT" }, "node_modules/lazy-ass": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", "dev": true, "license": "MIT", "engines": { @@ -16794,6 +15621,8 @@ }, "node_modules/leven": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, "license": "MIT", "engines": { @@ -16802,6 +15631,8 @@ }, "node_modules/levn": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", @@ -16812,12 +15643,15 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.11.18", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.11.18.tgz", - "integrity": "sha512-okMm/MCoFrm1vByeVFLBdkFIXLSHy/AIK2AEGgY3eoicfWZeOZqv3GfhtQgICkzs/tqorAMm3a4GBg5qNCrqzg==" + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.4.tgz", + "integrity": "sha512-vLmhg7Gan7idyAKfc6pvCtNzvar4/eIzrVVk3hjNFH5+fGqyjD0gQRovdTrDl20wsmZhBtmZpcsR0tOfquwb8g==", + "license": "MIT" }, "node_modules/lilconfig": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", "dev": true, "license": "MIT", "engines": { @@ -16826,10 +15660,14 @@ }, "node_modules/lines-and-columns": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "license": "MIT" }, "node_modules/lint-staged": { "version": "13.3.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-13.3.0.tgz", + "integrity": "sha512-mPRtrYnipYYv1FEE134ufbWpeggNTo+O/UPzngoaKzbzHAthvR55am+8GfHTnqNRQVRRrYQLGW9ZyUoD7DsBHQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16856,6 +15694,8 @@ }, "node_modules/lint-staged/node_modules/chalk": { "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "license": "MIT", "engines": { @@ -16867,14 +15707,36 @@ }, "node_modules/lint-staged/node_modules/commander": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", "dev": true, "license": "MIT", "engines": { "node": ">=16" } }, + "node_modules/lint-staged/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/lint-staged/node_modules/execa": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", "dev": true, "license": "MIT", "dependencies": { @@ -16897,6 +15759,8 @@ }, "node_modules/lint-staged/node_modules/human-signals": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -16905,6 +15769,8 @@ }, "node_modules/lint-staged/node_modules/is-stream": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "license": "MIT", "engines": { @@ -16914,8 +15780,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lint-staged/node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/lint-staged/node_modules/mimic-fn": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, "license": "MIT", "engines": { @@ -16925,8 +15807,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lint-staged/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, "node_modules/lint-staged/node_modules/npm-run-path": { - "version": "5.2.0", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16941,6 +15832,8 @@ }, "node_modules/lint-staged/node_modules/onetime": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, "license": "MIT", "dependencies": { @@ -16955,6 +15848,8 @@ }, "node_modules/lint-staged/node_modules/path-key": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true, "license": "MIT", "engines": { @@ -16966,6 +15861,8 @@ }, "node_modules/lint-staged/node_modules/strip-final-newline": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, "license": "MIT", "engines": { @@ -16977,6 +15874,8 @@ }, "node_modules/lint-staged/node_modules/yaml": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", "dev": true, "license": "ISC", "engines": { @@ -16985,6 +15884,8 @@ }, "node_modules/listr2": { "version": "6.6.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", + "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", "dev": true, "license": "MIT", "dependencies": { @@ -17008,7 +15909,9 @@ } }, "node_modules/listr2/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -17020,6 +15923,8 @@ }, "node_modules/listr2/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -17031,16 +15936,22 @@ }, "node_modules/listr2/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/listr2/node_modules/eventemitter3": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", "dev": true, "license": "MIT" }, "node_modules/listr2/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -17057,6 +15968,8 @@ }, "node_modules/listr2/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17071,6 +15984,8 @@ }, "node_modules/listr2/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17087,6 +16002,8 @@ }, "node_modules/load-json-file": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, "license": "MIT", "dependencies": { @@ -17101,6 +16018,8 @@ }, "node_modules/load-json-file/node_modules/parse-json": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, "license": "MIT", "dependencies": { @@ -17113,6 +16032,8 @@ }, "node_modules/load-json-file/node_modules/pify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "license": "MIT", "engines": { @@ -17121,6 +16042,8 @@ }, "node_modules/load-json-file/node_modules/strip-bom": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "license": "MIT", "engines": { @@ -17129,6 +16052,8 @@ }, "node_modules/locate-path": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "license": "MIT", "dependencies": { "p-locate": "^5.0.0" @@ -17142,82 +16067,116 @@ }, "node_modules/lodash": { "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, "node_modules/lodash._reinterpolate": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==", "dev": true, "license": "MIT" }, "node_modules/lodash.camelcase": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", "dev": true, "license": "MIT" }, "node_modules/lodash.defaults": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", "license": "MIT" }, "node_modules/lodash.isarguments": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", "license": "MIT" }, "node_modules/lodash.isfunction": { "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", + "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==", "dev": true, "license": "MIT" }, "node_modules/lodash.ismatch": { "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", "dev": true, "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", "dev": true, "license": "MIT" }, "node_modules/lodash.kebabcase": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", "dev": true, "license": "MIT" }, "node_modules/lodash.map": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", "dev": true, "license": "MIT" }, "node_modules/lodash.memoize": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true, "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "license": "MIT" }, "node_modules/lodash.mergewith": { "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", "dev": true, "license": "MIT" }, "node_modules/lodash.snakecase": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", "dev": true, "license": "MIT" }, "node_modules/lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "license": "MIT" }, "node_modules/lodash.startcase": { "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", "dev": true, "license": "MIT" }, "node_modules/lodash.template": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "deprecated": "This package is deprecated. Use https://socket.dev/npm/package/eta instead.", "dev": true, "license": "MIT", "dependencies": { @@ -17227,6 +16186,8 @@ }, "node_modules/lodash.templatesettings": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17235,15 +16196,21 @@ }, "node_modules/lodash.uniq": { "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", "license": "MIT" }, "node_modules/lodash.upperfirst": { "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", "dev": true, "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "license": "MIT", "dependencies": { @@ -17259,6 +16226,8 @@ }, "node_modules/log-symbols/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -17273,6 +16242,8 @@ }, "node_modules/log-symbols/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -17288,6 +16259,8 @@ }, "node_modules/log-symbols/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17299,11 +16272,15 @@ }, "node_modules/log-symbols/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/log-symbols/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -17312,6 +16289,8 @@ }, "node_modules/log-symbols/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -17323,6 +16302,8 @@ }, "node_modules/log-update": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", "dev": true, "license": "MIT", "dependencies": { @@ -17341,6 +16322,8 @@ }, "node_modules/log-update/node_modules/ansi-escapes": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, "license": "MIT", "dependencies": { @@ -17354,7 +16337,9 @@ } }, "node_modules/log-update/node_modules/ansi-regex": { - "version": "6.0.1", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { @@ -17366,6 +16351,8 @@ }, "node_modules/log-update/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -17377,6 +16364,8 @@ }, "node_modules/log-update/node_modules/cli-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, "license": "MIT", "dependencies": { @@ -17391,11 +16380,15 @@ }, "node_modules/log-update/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, "node_modules/log-update/node_modules/restore-cursor": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "license": "MIT", "dependencies": { @@ -17411,6 +16404,8 @@ }, "node_modules/log-update/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { @@ -17427,6 +16422,8 @@ }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17441,6 +16438,8 @@ }, "node_modules/log-update/node_modules/type-fest": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17452,6 +16451,8 @@ }, "node_modules/log-update/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17467,7 +16468,9 @@ } }, "node_modules/logform": { - "version": "2.6.0", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", "license": "MIT", "dependencies": { "@colors/colors": "1.6.0", @@ -17482,12 +16485,15 @@ } }, "node_modules/long": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.4.tgz", - "integrity": "sha512-qtzLbJE8hq7VabR3mISmVGtoXP8KGc2Z/AT8OuqlYD7JTR3oqrgwdjnk07wpj1twXxYmgDXgoKVWUG/fReSzHg==" + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.1.tgz", + "integrity": "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng==", + "license": "Apache-2.0" }, "node_modules/longest": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", + "integrity": "sha512-Ajzxb8CM6WAnFjgiloPsI3bF+WCxcvhdIG3KNA2KN962+tdBsHcuQ4k4qX/EcS/2CRkcc0iAkR956Nib6aXU/Q==", "dev": true, "license": "MIT", "engines": { @@ -17496,6 +16502,8 @@ }, "node_modules/loud-rejection": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha512-RPNliZOFkqFumDhvYqOaNY4Uz9oJM2K9tC6JWsJJsNdhuONW4LQHRBpb0qf4pJApVffI5N39SwzWZJuEhfd7eQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17507,7 +16515,9 @@ } }, "node_modules/lowercase-keys": { - "version": "1.0.1", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", + "integrity": "sha512-RPlX0+PHuvxVDZ7xX+EBVAp4RsVxP/TdDSN2mJYdiq1Lc4Hz7EUSjUI7RZrKKlmrIzVhf6Jo2stj7++gVarS0A==", "dev": true, "license": "MIT", "engines": { @@ -17516,6 +16526,8 @@ }, "node_modules/lru-cache": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "license": "ISC", "dependencies": { @@ -17524,6 +16536,8 @@ }, "node_modules/madge": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/madge/-/madge-6.1.0.tgz", + "integrity": "sha512-irWhT5RpFOc6lkzGHKLihonCVgM0YtfNUh4IrFeW3EqHpnt/JHUG3z26j8PeJEktCGB4tmGOOOJi1Rl/ACWucQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17571,6 +16585,8 @@ }, "node_modules/madge/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -17585,6 +16601,8 @@ }, "node_modules/madge/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -17600,6 +16618,8 @@ }, "node_modules/madge/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -17611,11 +16631,15 @@ }, "node_modules/madge/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/madge/node_modules/commander": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, "license": "MIT", "engines": { @@ -17624,6 +16648,8 @@ }, "node_modules/madge/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -17632,6 +16658,8 @@ }, "node_modules/madge/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -17643,6 +16671,8 @@ }, "node_modules/make-dir": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "license": "MIT", "dependencies": { @@ -17657,11 +16687,15 @@ }, "node_modules/make-error": { "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true, "license": "ISC" }, "node_modules/makeerror": { "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -17670,6 +16704,8 @@ }, "node_modules/map-obj": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", "dev": true, "license": "MIT", "engines": { @@ -17681,10 +16717,23 @@ }, "node_modules/match-json": { "version": "1.3.7", + "resolved": "https://registry.npmjs.org/match-json/-/match-json-1.3.7.tgz", + "integrity": "sha512-2/GIaio/oVWVHGdKOIbqfgqT5vH91K3c91l6EAsVydMAjB0iGy5PVABicKzNT1VAgHskZHbaZK9q96AmgTEqkw==", "license": "MIT" }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/md5": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", "license": "BSD-3-Clause", "dependencies": { "charenc": "0.0.2", @@ -17694,10 +16743,14 @@ }, "node_modules/md5/node_modules/is-buffer": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "license": "MIT" }, "node_modules/media-typer": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -17705,6 +16758,8 @@ }, "node_modules/meow": { "version": "8.1.2", + "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", + "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", "dev": true, "license": "MIT", "dependencies": { @@ -17729,6 +16784,8 @@ }, "node_modules/meow/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -17741,6 +16798,8 @@ }, "node_modules/meow/node_modules/hosted-git-info": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, "license": "ISC", "dependencies": { @@ -17752,6 +16811,8 @@ }, "node_modules/meow/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -17763,6 +16824,8 @@ }, "node_modules/meow/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "license": "ISC", "dependencies": { @@ -17774,6 +16837,8 @@ }, "node_modules/meow/node_modules/normalize-package-data": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -17788,6 +16853,8 @@ }, "node_modules/meow/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -17802,6 +16869,8 @@ }, "node_modules/meow/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -17813,6 +16882,8 @@ }, "node_modules/meow/node_modules/read-pkg": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "license": "MIT", "dependencies": { @@ -17827,6 +16898,8 @@ }, "node_modules/meow/node_modules/read-pkg-up": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "license": "MIT", "dependencies": { @@ -17843,6 +16916,8 @@ }, "node_modules/meow/node_modules/read-pkg-up/node_modules/type-fest": { "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17851,11 +16926,15 @@ }, "node_modules/meow/node_modules/read-pkg/node_modules/hosted-git-info": { "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true, "license": "ISC" }, "node_modules/meow/node_modules/read-pkg/node_modules/normalize-package-data": { "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -17867,6 +16946,8 @@ }, "node_modules/meow/node_modules/read-pkg/node_modules/semver": { "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "license": "ISC", "bin": { @@ -17875,6 +16956,8 @@ }, "node_modules/meow/node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17883,6 +16966,8 @@ }, "node_modules/meow/node_modules/type-fest": { "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -17894,16 +16979,22 @@ }, "node_modules/meow/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true, "license": "ISC" }, "node_modules/merge": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz", + "integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==", "dev": true, "license": "MIT" }, "node_modules/merge-descriptors": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -17911,11 +17002,15 @@ }, "node_modules/merge-stream": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true, "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "license": "MIT", "engines": { "node": ">= 8" @@ -17923,16 +17018,20 @@ }, "node_modules/methods": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/micromatch": { - "version": "4.0.5", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -17940,18 +17039,21 @@ } }, "node_modules/mime": { - "version": "2.6.0", - "dev": true, + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "license": "MIT", "bin": { "mime": "cli.js" }, "engines": { - "node": ">=4.0.0" + "node": ">=4" } }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -17959,6 +17061,8 @@ }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -17969,6 +17073,8 @@ }, "node_modules/mimic-fn": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "license": "MIT", "engines": { @@ -17977,6 +17083,8 @@ }, "node_modules/mimic-response": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", "dev": true, "license": "MIT", "engines": { @@ -17985,6 +17093,8 @@ }, "node_modules/min-indent": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true, "license": "MIT", "engines": { @@ -17993,6 +17103,8 @@ }, "node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -18003,6 +17115,8 @@ }, "node_modules/minimist": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -18010,6 +17124,8 @@ }, "node_modules/minimist-options": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, "license": "MIT", "dependencies": { @@ -18022,7 +17138,9 @@ } }, "node_modules/minipass": { - "version": "7.0.4", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, "license": "ISC", "engines": { @@ -18033,6 +17151,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -18045,6 +17164,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -18055,12 +17175,14 @@ "node_modules/minizlib/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" }, @@ -18076,6 +17198,8 @@ }, "node_modules/mocked-env": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/mocked-env/-/mocked-env-1.3.5.tgz", + "integrity": "sha512-GyYY6ynVOdEoRlaGpaq8UYwdWkvrsU2xRme9B+WPSuJcNjh17+3QIxSYU6zwee0SbehhV6f06VZ4ahjG+9zdrA==", "dev": true, "license": "MIT", "dependencies": { @@ -18090,6 +17214,8 @@ }, "node_modules/mocked-env/node_modules/debug": { "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "license": "MIT", "dependencies": { @@ -18104,8 +17230,17 @@ } } }, + "node_modules/mocked-env/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, "node_modules/modclean": { "version": "3.0.0-beta.1", + "resolved": "https://registry.npmjs.org/modclean/-/modclean-3.0.0-beta.1.tgz", + "integrity": "sha512-NyJpuqXMUI190sZePU+dBcwlGaqhfFC+UL5WyNSxmNLOHATg9cVSgRpbY+mUbwUj7t5trb4vYscgXArKevYsdA==", "license": "MIT", "dependencies": { "await-handler": "^1.1.0", @@ -18130,10 +17265,13 @@ "node_modules/modclean-patterns-default": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/modclean-patterns-default/-/modclean-patterns-default-1.1.2.tgz", - "integrity": "sha512-h2+ES3SKl+JOtfptJjwJz5fdogFI0byYssw3lXoESNkOcXCnjCvvW6IbMagAKFmfWOx+n9esyomxWP1w4edZjg==" + "integrity": "sha512-h2+ES3SKl+JOtfptJjwJz5fdogFI0byYssw3lXoESNkOcXCnjCvvW6IbMagAKFmfWOx+n9esyomxWP1w4edZjg==", + "license": "MIT" }, "node_modules/modclean/node_modules/ansi-regex": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "license": "MIT", "engines": { "node": ">=4" @@ -18141,6 +17279,8 @@ }, "node_modules/modclean/node_modules/cli-cursor": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", "license": "MIT", "dependencies": { "restore-cursor": "^2.0.0" @@ -18151,6 +17291,8 @@ }, "node_modules/modclean/node_modules/cli-spinners": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", + "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", "license": "MIT", "engines": { "node": ">=4" @@ -18158,10 +17300,15 @@ }, "node_modules/modclean/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "license": "MIT" }, "node_modules/modclean/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -18180,6 +17327,8 @@ }, "node_modules/modclean/node_modules/log-symbols": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "license": "MIT", "dependencies": { "chalk": "^2.0.1" @@ -18190,6 +17339,8 @@ }, "node_modules/modclean/node_modules/mimic-fn": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "license": "MIT", "engines": { "node": ">=4" @@ -18197,6 +17348,8 @@ }, "node_modules/modclean/node_modules/onetime": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", "license": "MIT", "dependencies": { "mimic-fn": "^1.0.0" @@ -18207,6 +17360,8 @@ }, "node_modules/modclean/node_modules/ora": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-2.1.0.tgz", + "integrity": "sha512-hNNlAd3gfv/iPmsNxYoAPLvxg7HuPozww7fFonMZvL84tP6Ox5igfk5j/+a9rtJJwqMgKK+JgWsAQik5o0HTLA==", "license": "MIT", "dependencies": { "chalk": "^2.3.1", @@ -18222,6 +17377,8 @@ }, "node_modules/modclean/node_modules/restore-cursor": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", "license": "MIT", "dependencies": { "onetime": "^2.0.0", @@ -18233,6 +17390,9 @@ }, "node_modules/modclean/node_modules/rimraf": { "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -18243,6 +17403,8 @@ }, "node_modules/modclean/node_modules/strip-ansi": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", "license": "MIT", "dependencies": { "ansi-regex": "^3.0.0" @@ -18253,6 +17415,8 @@ }, "node_modules/modify-values": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", "dev": true, "license": "MIT", "engines": { @@ -18261,6 +17425,8 @@ }, "node_modules/module-definition": { "version": "3.4.0", + "resolved": "https://registry.npmjs.org/module-definition/-/module-definition-3.4.0.tgz", + "integrity": "sha512-XxJ88R1v458pifaSkPNLUTdSPNVGMP2SXVncVmApGO+gAfrLANiYe6JofymCzVceGOMwQE2xogxBSc8uB7XegA==", "dev": true, "license": "MIT", "dependencies": { @@ -18276,6 +17442,8 @@ }, "node_modules/module-definition/node_modules/ast-module-types": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-3.0.0.tgz", + "integrity": "sha512-CMxMCOCS+4D+DkOQfuZf+vLrSEmY/7xtORwdxs4wtcC1wVgvk2MqFFTwQCFhvWsI4KPU9lcWXPI8DgRiz+xetQ==", "dev": true, "license": "MIT", "engines": { @@ -18284,6 +17452,8 @@ }, "node_modules/module-definition/node_modules/node-source-walk": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.3.0.tgz", + "integrity": "sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==", "dev": true, "license": "MIT", "dependencies": { @@ -18295,6 +17465,8 @@ }, "node_modules/module-lookup-amd": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/module-lookup-amd/-/module-lookup-amd-7.0.1.tgz", + "integrity": "sha512-w9mCNlj0S8qviuHzpakaLVc+/7q50jl9a/kmJ/n8bmXQZgDPkQHnPBb8MUOYh3WpAYkXuNc2c+khsozhIp/amQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18313,11 +17485,16 @@ }, "node_modules/module-lookup-amd/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/module-lookup-amd/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -18337,13 +17514,17 @@ }, "node_modules/moment": { "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", "license": "MIT", "engines": { "node": "*" } }, "node_modules/moment-timezone": { - "version": "0.5.44", + "version": "0.5.47", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.47.tgz", + "integrity": "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA==", "license": "MIT", "dependencies": { "moment": "^2.29.4" @@ -18353,18 +17534,23 @@ } }, "node_modules/ms": { - "version": "2.1.2", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/mute-stream": { "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true, "license": "ISC" }, "node_modules/nan": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz", - "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==" + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.2.tgz", + "integrity": "sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==", + "license": "MIT" }, "node_modules/nanoid": { "version": "3.3.8", @@ -18393,14 +17579,20 @@ }, "node_modules/natural-compare": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "license": "MIT" }, "node_modules/natural-compare-lite": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -18408,6 +17600,8 @@ }, "node_modules/neo-async": { "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "license": "MIT" }, "node_modules/node-abi": { @@ -18424,6 +17618,8 @@ }, "node_modules/node-cache": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz", + "integrity": "sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==", "license": "MIT", "dependencies": { "clone": "2.x" @@ -18434,6 +17630,8 @@ }, "node_modules/node-fetch": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" @@ -18452,6 +17650,8 @@ }, "node_modules/node-gyp-build": { "version": "3.9.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.9.0.tgz", + "integrity": "sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A==", "license": "MIT", "bin": { "node-gyp-build": "bin.js", @@ -18461,15 +17661,17 @@ }, "node_modules/node-int64": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true, "license": "MIT" }, "node_modules/node-mocks-http": { - "version": "1.14.1", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/node-mocks-http/-/node-mocks-http-1.16.2.tgz", + "integrity": "sha512-2Sh6YItRp1oqewZNlck3LaFp5vbyW2u51HX2p1VLxQ9U/bG90XV8JY9O7Nk+HDd6OOn/oV3nA5Tx5k4Rki0qlg==", "license": "MIT", "dependencies": { - "@types/express": "^4.17.21", - "@types/node": "^20.10.6", "accepts": "^1.3.7", "content-disposition": "^0.5.3", "depd": "^1.1.0", @@ -18483,27 +17685,33 @@ }, "engines": { "node": ">=14" + }, + "peerDependencies": { + "@types/express": "^4.17.21 || ^5.0.0", + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + }, + "@types/node": { + "optional": true + } } }, "node_modules/node-mocks-http/node_modules/depd": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "license": "MIT", "engines": { "node": ">= 0.6" } }, - "node_modules/node-mocks-http/node_modules/mime": { - "version": "1.6.0", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/node-notifier": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-10.0.1.tgz", + "integrity": "sha512-YX7TSyDukOZ0g+gmzjB6abKu+hTGvO8+8+gIFDsRCU2t8fLV/P2unmt+LGFaIa4y64aX98Qksa97rgz4vMNeLQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18517,6 +17725,8 @@ }, "node_modules/node-notifier/node_modules/uuid": { "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, "license": "MIT", "bin": { @@ -18524,12 +17734,16 @@ } }, "node_modules/node-releases": { - "version": "2.0.14", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT" }, "node_modules/node-source-walk": { "version": "5.0.2", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-5.0.2.tgz", + "integrity": "sha512-Y4jr/8SRS5hzEdZ7SGuvZGwfORvNsSsNRwDXx5WisiqzsVfeftDvRgfeqWNgZvWSJbgubTRVRYBzK6UO+ErqjA==", "dev": true, "license": "MIT", "dependencies": { @@ -18543,6 +17757,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", "dependencies": { "abbrev": "1" }, @@ -18555,6 +17770,8 @@ }, "node_modules/normalize-package-data": { "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^2.1.4", @@ -18565,6 +17782,8 @@ }, "node_modules/normalize-package-data/node_modules/semver": { "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "license": "ISC", "bin": { "semver": "bin/semver" @@ -18572,6 +17791,8 @@ }, "node_modules/normalize-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "license": "MIT", "engines": { @@ -18580,6 +17801,8 @@ }, "node_modules/normalize-url": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz", + "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==", "dev": true, "license": "MIT", "dependencies": { @@ -18593,6 +17816,8 @@ }, "node_modules/npm-run-path": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "license": "MIT", "dependencies": { @@ -18607,6 +17832,7 @@ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", "deprecated": "This package is no longer supported.", + "license": "ISC", "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -18616,6 +17842,8 @@ }, "node_modules/number-is-nan": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "dev": true, "license": "MIT", "engines": { @@ -18624,10 +17852,14 @@ }, "node_modules/oauth-1.0a": { "version": "2.2.6", + "resolved": "https://registry.npmjs.org/oauth-1.0a/-/oauth-1.0a-2.2.6.tgz", + "integrity": "sha512-6bkxv3N4Gu5lty4viIcIAnq5GbxECviMBeKR3WX/q87SPQ8E8aursPZUtsXDnxCs787af09WPRBLqYrf/lwoYQ==", "license": "MIT" }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -18635,27 +17867,38 @@ }, "node_modules/object-hash": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", "license": "MIT", "engines": { "node": ">= 6" } }, "node_modules/object-inspect": { - "version": "1.13.1", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object-sizeof": { - "version": "2.6.4", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/object-sizeof/-/object-sizeof-2.6.5.tgz", + "integrity": "sha512-Mu3udRqIsKpneKjIEJ2U/s1KmEgpl+N6cEX1o+dDl2aZ+VW5piHqNgomqAk5YMsDoSkpcA8HnIKx1eqGTKzdfw==", "license": "MIT", "dependencies": { "buffer": "^6.0.3" @@ -18663,6 +17906,8 @@ }, "node_modules/object-sizeof/node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -18684,12 +17929,16 @@ } }, "node_modules/object.assign": { - "version": "4.1.5", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -18700,24 +17949,29 @@ } }, "node_modules/object.entries": { - "version": "1.1.7", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.7", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -18727,22 +17981,29 @@ } }, "node_modules/object.groupby": { - "version": "1.0.1", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/object.values": { - "version": "1.1.7", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -18753,6 +18014,8 @@ }, "node_modules/on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "license": "MIT", "dependencies": { "ee-first": "1.1.1" @@ -18763,6 +18026,8 @@ }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" @@ -18770,6 +18035,8 @@ }, "node_modules/one-time": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", "license": "MIT", "dependencies": { "fn.name": "1.x.x" @@ -18777,6 +18044,8 @@ }, "node_modules/onetime": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "license": "MIT", "dependencies": { @@ -18790,24 +18059,30 @@ } }, "node_modules/only": { - "version": "0.0.2" + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==" }, "node_modules/openapi-types": { "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==", "dev": true, "license": "MIT", "peer": true }, "node_modules/optionator": { - "version": "0.9.3", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "license": "MIT", "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -18815,6 +18090,8 @@ }, "node_modules/ora": { "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18837,6 +18114,8 @@ }, "node_modules/ora/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -18851,6 +18130,8 @@ }, "node_modules/ora/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { @@ -18866,6 +18147,8 @@ }, "node_modules/ora/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -18877,11 +18160,15 @@ }, "node_modules/ora/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/ora/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { @@ -18890,6 +18177,8 @@ }, "node_modules/ora/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { @@ -18901,14 +18190,35 @@ }, "node_modules/os-tmpdir": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/p-cancelable": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", + "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ==", "dev": true, "license": "MIT", "engines": { @@ -18917,6 +18227,8 @@ }, "node_modules/p-finally": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", "dev": true, "license": "MIT", "engines": { @@ -18925,6 +18237,8 @@ }, "node_modules/p-is-promise": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha512-zL7VE4JVS2IFSkR2GQKDSPEVxkoH43/p7oEnwpdCndKYJO0HVeRB7fA8TJwuLOTBREtK0ea8eHaxdwcpob5dmg==", "dev": true, "license": "MIT", "engines": { @@ -18933,6 +18247,8 @@ }, "node_modules/p-limit": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -18946,6 +18262,8 @@ }, "node_modules/p-locate": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "license": "MIT", "dependencies": { "p-limit": "^3.0.2" @@ -18959,6 +18277,8 @@ }, "node_modules/p-timeout": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", "dev": true, "license": "MIT", "dependencies": { @@ -18970,6 +18290,8 @@ }, "node_modules/p-try": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "license": "MIT", "engines": { "node": ">=6" @@ -18977,6 +18299,8 @@ }, "node_modules/p-wait-for": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-3.2.0.tgz", + "integrity": "sha512-wpgERjNkLrBiFmkMEjuZJEWKKDrNfHCKA1OhyN1wg1FrLkULbviEy6py1AyJUgZ72YWFbZ38FIpnqvVqAlDUwA==", "dev": true, "license": "MIT", "dependencies": { @@ -18991,6 +18315,8 @@ }, "node_modules/p-wait-for/node_modules/p-timeout": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "dev": true, "license": "MIT", "dependencies": { @@ -19000,8 +18326,17 @@ "node": ">=8" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parent-module": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -19012,11 +18347,15 @@ }, "node_modules/parse-github-repo-url": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha512-bSWyzBKqcSL4RrncTpGsEKoJ7H8a4L3++ifTAbTFeMHyq2wRV+42DGmQcHIrJIvdcacjIOxEuKH/w4tthF17gg==", "dev": true, "license": "MIT" }, "node_modules/parse-json": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", @@ -19033,6 +18372,8 @@ }, "node_modules/parse-ms": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", + "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", "dev": true, "license": "MIT", "engines": { @@ -19041,6 +18382,8 @@ }, "node_modules/parse-passwd": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", "dev": true, "license": "MIT", "engines": { @@ -19049,10 +18392,14 @@ }, "node_modules/parse-static-imports": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parse-static-imports/-/parse-static-imports-1.1.0.tgz", + "integrity": "sha512-HlxrZcISCblEV0lzXmAHheH/8qEkKgmqkdxyHTPbSqsTUV8GzqmN1L+SSti+VbNPfbBO3bYLPHDiUs2avbAdbA==", "license": "MIT" }, "node_modules/parseurl": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -19060,6 +18407,8 @@ }, "node_modules/path-exists": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "license": "MIT", "engines": { "node": ">=8" @@ -19067,6 +18416,8 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -19074,6 +18425,8 @@ }, "node_modules/path-key": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "license": "MIT", "engines": { "node": ">=8" @@ -19081,30 +18434,33 @@ }, "node_modules/path-parse": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "license": "MIT" }, "node_modules/path-scurry": { - "version": "1.10.1", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.1.0", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } + "license": "ISC" }, "node_modules/path-to-regexp": { "version": "6.3.0", @@ -19114,18 +18470,23 @@ }, "node_modules/path-type": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/picocolors": { - "version": "1.0.0", - "dev": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -19136,6 +18497,8 @@ }, "node_modules/pidtree": { "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", "dev": true, "license": "MIT", "bin": { @@ -19147,6 +18510,8 @@ }, "node_modules/pify": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, "license": "MIT", "engines": { @@ -19155,6 +18520,8 @@ }, "node_modules/pinkie": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "dev": true, "license": "MIT", "engines": { @@ -19163,6 +18530,8 @@ }, "node_modules/pinkie-promise": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dev": true, "license": "MIT", "dependencies": { @@ -19174,6 +18543,8 @@ }, "node_modules/pirates": { "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "license": "MIT", "engines": { @@ -19182,6 +18553,8 @@ }, "node_modules/pkg-dir": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19193,6 +18566,8 @@ }, "node_modules/pkg-dir/node_modules/find-up": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { @@ -19205,6 +18580,8 @@ }, "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { @@ -19216,6 +18593,8 @@ }, "node_modules/pkg-dir/node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { @@ -19230,6 +18609,8 @@ }, "node_modules/pkg-dir/node_modules/p-locate": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { @@ -19241,14 +18622,27 @@ }, "node_modules/pluralize": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, "license": "MIT", "engines": { "node": ">=4" } }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { - "version": "8.4.33", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "dev": true, "funding": [ { @@ -19266,9 +18660,9 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -19276,6 +18670,8 @@ }, "node_modules/postcss-values-parser": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-6.0.2.tgz", + "integrity": "sha512-YLJpK0N1brcNJrs9WatuJFtHaV9q5aAOj+S4DI5S7jgHlRfm0PIbDCAFRYMQD5SHq7Fy6xsDhyutgS0QOAs0qw==", "dev": true, "license": "MPL-2.0", "dependencies": { @@ -19292,6 +18688,8 @@ }, "node_modules/postcss-values-parser/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, @@ -19300,6 +18698,7 @@ "resolved": "https://registry.npmjs.org/pprof/-/pprof-4.0.0.tgz", "integrity": "sha512-Yhfk7Y0G1MYsy97oXxmSG5nvbM1sCz9EALiNhW/isAv5Xf7svzP+1RfGeBlS6mLSgRJvgSLh6Mi5DaisQuPttw==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { "@mapbox/node-pre-gyp": "^1.0.9", "bindings": "^1.2.1", @@ -19318,12 +18717,14 @@ "node_modules/pprof-format": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pprof-format/-/pprof-format-2.1.0.tgz", - "integrity": "sha512-0+G5bHH0RNr8E5hoZo/zJYsL92MhkZjwrHp3O2IxmY8RJL9ooKeuZ8Tm0ZNBw5sGZ9TiM71sthTjWoR2Vf5/xw==" + "integrity": "sha512-0+G5bHH0RNr8E5hoZo/zJYsL92MhkZjwrHp3O2IxmY8RJL9ooKeuZ8Tm0ZNBw5sGZ9TiM71sthTjWoR2Vf5/xw==", + "license": "MIT" }, "node_modules/pprof/node_modules/source-map": { "version": "0.8.0-beta.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "license": "BSD-3-Clause", "dependencies": { "whatwg-url": "^7.0.0" }, @@ -19335,6 +18736,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", + "license": "MIT", "dependencies": { "punycode": "^2.1.0" } @@ -19342,12 +18744,14 @@ "node_modules/pprof/node_modules/webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "license": "BSD-2-Clause" }, "node_modules/pprof/node_modules/whatwg-url": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "license": "MIT", "dependencies": { "lodash.sortby": "^4.7.0", "tr46": "^1.0.1", @@ -19382,6 +18786,8 @@ }, "node_modules/precinct": { "version": "8.3.1", + "resolved": "https://registry.npmjs.org/precinct/-/precinct-8.3.1.tgz", + "integrity": "sha512-pVppfMWLp2wF68rwHqBIpPBYY8Kd12lDhk8LVQzOwqllifVR15qNFyod43YLyFpurKRZQKnE7E4pofAagDOm2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19408,6 +18814,8 @@ }, "node_modules/precinct/node_modules/@typescript-eslint/types": { "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", "dev": true, "license": "MIT", "engines": { @@ -19420,6 +18828,8 @@ }, "node_modules/precinct/node_modules/@typescript-eslint/typescript-estree": { "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -19446,6 +18856,8 @@ }, "node_modules/precinct/node_modules/@typescript-eslint/visitor-keys": { "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", "dev": true, "license": "MIT", "dependencies": { @@ -19462,6 +18874,8 @@ }, "node_modules/precinct/node_modules/ast-module-types": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-3.0.0.tgz", + "integrity": "sha512-CMxMCOCS+4D+DkOQfuZf+vLrSEmY/7xtORwdxs4wtcC1wVgvk2MqFFTwQCFhvWsI4KPU9lcWXPI8DgRiz+xetQ==", "dev": true, "license": "MIT", "engines": { @@ -19470,11 +18884,15 @@ }, "node_modules/precinct/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/precinct/node_modules/detective-amd": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/detective-amd/-/detective-amd-3.1.2.tgz", + "integrity": "sha512-jffU26dyqJ37JHR/o44La6CxtrDf3Rt9tvd2IbImJYxWKTMdBjctp37qoZ6ZcY80RHg+kzWz4bXn39e4P7cctQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19492,6 +18910,8 @@ }, "node_modules/precinct/node_modules/detective-cjs": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/detective-cjs/-/detective-cjs-3.1.3.tgz", + "integrity": "sha512-ljs7P0Yj9MK64B7G0eNl0ThWSYjhAaSYy+fQcpzaKalYl/UoQBOzOeLCSFEY1qEBhziZ3w7l46KG/nH+s+L7BQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19504,6 +18924,8 @@ }, "node_modules/precinct/node_modules/detective-es6": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/detective-es6/-/detective-es6-2.2.2.tgz", + "integrity": "sha512-eZUKCUsbHm8xoeoCM0z6JFwvDfJ5Ww5HANo+jPR7AzkFpW9Mun3t/TqIF2jjeWa2TFbAiGaWESykf2OQp3oeMw==", "dev": true, "license": "MIT", "dependencies": { @@ -19515,6 +18937,8 @@ }, "node_modules/precinct/node_modules/detective-postcss": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detective-postcss/-/detective-postcss-4.0.0.tgz", + "integrity": "sha512-Fwc/g9VcrowODIAeKRWZfVA/EufxYL7XfuqJQFroBKGikKX83d2G7NFw6kDlSYGG3LNQIyVa+eWv1mqre+v4+A==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -19529,6 +18953,8 @@ }, "node_modules/precinct/node_modules/detective-sass": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/detective-sass/-/detective-sass-3.0.2.tgz", + "integrity": "sha512-DNVYbaSlmti/eztFGSfBw4nZvwsTaVXEQ4NsT/uFckxhJrNRFUh24d76KzoCC3aarvpZP9m8sC2L1XbLej4F7g==", "dev": true, "license": "MIT", "dependencies": { @@ -19541,6 +18967,8 @@ }, "node_modules/precinct/node_modules/detective-scss": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detective-scss/-/detective-scss-2.0.2.tgz", + "integrity": "sha512-hDWnWh/l0tht/7JQltumpVea/inmkBaanJUcXRB9kEEXVwVUMuZd6z7eusQ6GcBFrfifu3pX/XPyD7StjbAiBg==", "dev": true, "license": "MIT", "dependencies": { @@ -19553,11 +18981,15 @@ }, "node_modules/precinct/node_modules/detective-stylus": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detective-stylus/-/detective-stylus-1.0.3.tgz", + "integrity": "sha512-4/bfIU5kqjwugymoxLXXLltzQNeQfxGoLm2eIaqtnkWxqbhap9puDVpJPVDx96hnptdERzS5Cy6p9N8/08A69Q==", "dev": true, "license": "MIT" }, "node_modules/precinct/node_modules/detective-typescript": { "version": "7.0.2", + "resolved": "https://registry.npmjs.org/detective-typescript/-/detective-typescript-7.0.2.tgz", + "integrity": "sha512-unqovnhxzvkCz3m1/W4QW4qGsvXCU06aU2BAm8tkza+xLnp9SOFnob2QsTxUv5PdnQKfDvWcv9YeOeFckWejwA==", "dev": true, "license": "MIT", "dependencies": { @@ -19572,11 +19004,15 @@ }, "node_modules/precinct/node_modules/detective-typescript/node_modules/ast-module-types": { "version": "2.7.1", + "resolved": "https://registry.npmjs.org/ast-module-types/-/ast-module-types-2.7.1.tgz", + "integrity": "sha512-Rnnx/4Dus6fn7fTqdeLEAn5vUll5w7/vts0RN608yFa6si/rDOUonlIIiwugHBFWjylHjxm9owoSZn71KwG4gw==", "dev": true, "license": "MIT" }, "node_modules/precinct/node_modules/eslint-visitor-keys": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -19585,6 +19021,8 @@ }, "node_modules/precinct/node_modules/get-amd-module-type": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-amd-module-type/-/get-amd-module-type-3.0.2.tgz", + "integrity": "sha512-PcuKwB8ouJnKuAPn6Hk3UtdfKoUV3zXRqVEvj8XGIXqjWfgd1j7QGdXy5Z9OdQfzVt1Sk29HVe/P+X74ccOuqw==", "dev": true, "license": "MIT", "dependencies": { @@ -19597,6 +19035,8 @@ }, "node_modules/precinct/node_modules/node-source-walk": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.3.0.tgz", + "integrity": "sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA==", "dev": true, "license": "MIT", "dependencies": { @@ -19608,6 +19048,8 @@ }, "node_modules/precinct/node_modules/postcss-values-parser": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz", + "integrity": "sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg==", "dev": true, "license": "MIT", "dependencies": { @@ -19621,6 +19063,8 @@ }, "node_modules/precinct/node_modules/typescript": { "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", "dev": true, "license": "Apache-2.0", "bin": { @@ -19633,6 +19077,8 @@ }, "node_modules/prelude-ls": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "license": "MIT", "engines": { "node": ">= 0.8.0" @@ -19640,6 +19086,8 @@ }, "node_modules/prepend-http": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", "dev": true, "license": "MIT", "engines": { @@ -19647,7 +19095,9 @@ } }, "node_modules/prettier": { - "version": "3.2.4", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "license": "MIT", "bin": { @@ -19662,6 +19112,8 @@ }, "node_modules/prettier-linter-helpers": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "license": "MIT", "dependencies": { @@ -19673,6 +19125,8 @@ }, "node_modules/pretty-bytes": { "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, "license": "MIT", "engines": { @@ -19684,6 +19138,8 @@ }, "node_modules/pretty-format": { "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19697,6 +19153,8 @@ }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, "license": "MIT", "engines": { @@ -19708,6 +19166,8 @@ }, "node_modules/pretty-ms": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", + "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19722,11 +19182,15 @@ }, "node_modules/process-nextick-args": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true, "license": "MIT" }, "node_modules/progress": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "license": "MIT", "engines": { "node": ">=0.4.0" @@ -19734,6 +19198,8 @@ }, "node_modules/prom-client": { "version": "14.2.0", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.2.0.tgz", + "integrity": "sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==", "license": "Apache-2.0", "dependencies": { "tdigest": "^0.1.1" @@ -19744,6 +19210,8 @@ }, "node_modules/prompts": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19759,6 +19227,7 @@ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.6.tgz", "integrity": "sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -19779,10 +19248,14 @@ }, "node_modules/proxy-from-env": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "license": "MIT" }, "node_modules/pump": { - "version": "3.0.0", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", @@ -19791,13 +19264,17 @@ }, "node_modules/punycode": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/pure-rand": { - "version": "6.0.4", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", "dev": true, "funding": [ { @@ -19813,6 +19290,9 @@ }, "node_modules/q": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", "dev": true, "license": "MIT", "engines": { @@ -19821,10 +19301,12 @@ } }, "node_modules/qs": { - "version": "6.11.2", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.1.0" }, "engines": { "node": ">=0.6" @@ -19835,6 +19317,8 @@ }, "node_modules/query-string": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", "dev": true, "license": "MIT", "dependencies": { @@ -19848,6 +19332,8 @@ }, "node_modules/queue-microtask": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "funding": [ { "type": "github", @@ -19866,6 +19352,8 @@ }, "node_modules/quick-lru": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true, "license": "MIT", "engines": { @@ -19874,16 +19362,22 @@ }, "node_modules/quote-unquote": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/quote-unquote/-/quote-unquote-1.0.0.tgz", + "integrity": "sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg==", "dev": true, "license": "MIT" }, "node_modules/ramda": { "version": "0.27.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz", + "integrity": "sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==", "dev": true, "license": "MIT" }, "node_modules/range-parser": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -19891,6 +19385,8 @@ }, "node_modules/raw-body": { "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -19904,6 +19400,8 @@ }, "node_modules/rc": { "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", @@ -19917,18 +19415,24 @@ }, "node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-is": { - "version": "18.2.0", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true, "license": "MIT" }, "node_modules/read-pkg": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", "dev": true, "license": "MIT", "dependencies": { @@ -19942,6 +19446,8 @@ }, "node_modules/read-pkg-up": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==", "dev": true, "license": "MIT", "dependencies": { @@ -19954,6 +19460,8 @@ }, "node_modules/read-pkg-up/node_modules/find-up": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -19965,6 +19473,8 @@ }, "node_modules/read-pkg-up/node_modules/locate-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "license": "MIT", "dependencies": { @@ -19977,6 +19487,8 @@ }, "node_modules/read-pkg-up/node_modules/p-limit": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "license": "MIT", "dependencies": { @@ -19988,6 +19500,8 @@ }, "node_modules/read-pkg-up/node_modules/p-locate": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, "license": "MIT", "dependencies": { @@ -19999,6 +19513,8 @@ }, "node_modules/read-pkg-up/node_modules/p-try": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true, "license": "MIT", "engines": { @@ -20007,6 +19523,8 @@ }, "node_modules/read-pkg-up/node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, "license": "MIT", "engines": { @@ -20015,6 +19533,8 @@ }, "node_modules/read-pkg/node_modules/path-type": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "license": "MIT", "dependencies": { @@ -20026,6 +19546,8 @@ }, "node_modules/read-pkg/node_modules/pify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "license": "MIT", "engines": { @@ -20034,6 +19556,8 @@ }, "node_modules/readable-stream": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "license": "MIT", "dependencies": { @@ -20048,11 +19572,15 @@ }, "node_modules/readable-stream/node_modules/safe-buffer": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "license": "MIT" }, "node_modules/redent": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dev": true, "license": "MIT", "dependencies": { @@ -20065,6 +19593,8 @@ }, "node_modules/redis-errors": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", "license": "MIT", "engines": { "node": ">=4" @@ -20072,6 +19602,8 @@ }, "node_modules/redis-parser": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", "license": "MIT", "dependencies": { "redis-errors": "^1.0.0" @@ -20080,12 +19612,38 @@ "node": ">=4" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerator-runtime": { "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", "license": "MIT" }, "node_modules/regexp-tree": { "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", "dev": true, "license": "MIT", "bin": { @@ -20093,12 +19651,17 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.1", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "set-function-name": "^2.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -20109,6 +19672,8 @@ }, "node_modules/regjsparser": { "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -20120,6 +19685,8 @@ }, "node_modules/regjsparser/node_modules/jsesc": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, "bin": { "jsesc": "bin/jsesc" @@ -20127,6 +19694,8 @@ }, "node_modules/repeating": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==", "dev": true, "license": "MIT", "dependencies": { @@ -20138,6 +19707,8 @@ }, "node_modules/require-directory": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "license": "MIT", "engines": { @@ -20146,6 +19717,8 @@ }, "node_modules/require-from-string": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -20153,11 +19726,15 @@ }, "node_modules/require-main-filename": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true, "license": "ISC" }, "node_modules/requirejs": { "version": "2.3.7", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.7.tgz", + "integrity": "sha512-DouTG8T1WanGok6Qjg2SXuCMzszOo0eHeH9hDZ5Y4x8Je+9JB38HdTLT4/VA8OaUhBa0JPVHJ0pyBkM1z+pDsw==", "dev": true, "license": "MIT", "bin": { @@ -20170,6 +19747,8 @@ }, "node_modules/requirejs-config-file": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz", + "integrity": "sha512-jnIre8cbWOyvr8a5F2KuqBnY+SDA4NXr/hzEZJG79Mxm2WiFQz2dzhC8ibtPJS7zkmBEl1mxSwp5HhC1W4qpxw==", "dev": true, "license": "MIT", "dependencies": { @@ -20181,22 +19760,29 @@ } }, "node_modules/resolve": { - "version": "1.22.8", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-cwd": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "license": "MIT", "dependencies": { @@ -20208,6 +19794,8 @@ }, "node_modules/resolve-dependency-path": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-dependency-path/-/resolve-dependency-path-2.0.0.tgz", + "integrity": "sha512-DIgu+0Dv+6v2XwRaNWnumKu7GPufBBOr5I1gRPJHkvghrfCGOooJODFvgFimX/KRxk9j0whD2MnKHzM1jYvk9w==", "dev": true, "license": "MIT", "engines": { @@ -20216,6 +19804,8 @@ }, "node_modules/resolve-dir": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", "dev": true, "license": "MIT", "dependencies": { @@ -20228,6 +19818,8 @@ }, "node_modules/resolve-from": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "license": "MIT", "engines": { @@ -20236,6 +19828,8 @@ }, "node_modules/resolve-global": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz", + "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==", "dev": true, "license": "MIT", "dependencies": { @@ -20246,7 +19840,9 @@ } }, "node_modules/resolve.exports": { - "version": "2.0.2", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", "dev": true, "license": "MIT", "engines": { @@ -20255,6 +19851,8 @@ }, "node_modules/responselike": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20263,6 +19861,8 @@ }, "node_modules/restore-cursor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "license": "MIT", "dependencies": { @@ -20274,7 +19874,9 @@ } }, "node_modules/reusify": { - "version": "1.0.4", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -20282,12 +19884,17 @@ } }, "node_modules/rfdc": { - "version": "1.3.0", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true, "license": "MIT" }, "node_modules/right-pad": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/right-pad/-/right-pad-1.0.1.tgz", + "integrity": "sha512-bYBjgxmkvTAfgIYy328fmkwhp39v8lwVgWhhrzxPV3yHtcSqyYKe9/XOhvW48UFjATg3VuJbpsp5822ACNvkmw==", + "deprecated": "Please use String.prototype.padEnd() over this package.", "dev": true, "license": "MIT", "engines": { @@ -20296,6 +19903,9 @@ }, "node_modules/rimraf": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -20309,6 +19919,9 @@ }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -20326,7 +19939,9 @@ } }, "node_modules/roarr": { - "version": "7.21.0", + "version": "7.21.1", + "resolved": "https://registry.npmjs.org/roarr/-/roarr-7.21.1.tgz", + "integrity": "sha512-3niqt5bXFY1InKU8HKWqqYTYjtrBaxBMnXELXCXUYgtNYGUtZM5rB46HIC430AyacL95iEniGf7RgqsesykLmQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -20340,6 +19955,8 @@ }, "node_modules/rs-jsonpath": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/rs-jsonpath/-/rs-jsonpath-1.1.2.tgz", + "integrity": "sha512-IQzlqtVyZniK7aOtpKGrv7BvkamSvLJkIhRGoKKDQLppNJe94BVHqpxNRjw/2042nGjtC3vyfCWyHe+3DlWgWA==", "license": "MIT", "dependencies": { "esprima": "1.2.2", @@ -20349,6 +19966,8 @@ }, "node_modules/rs-jsonpath/node_modules/esprima": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -20359,6 +19978,8 @@ }, "node_modules/run-async": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, "license": "MIT", "engines": { @@ -20367,6 +19988,8 @@ }, "node_modules/run-parallel": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "funding": [ { "type": "github", @@ -20387,7 +20010,9 @@ } }, "node_modules/rxjs": { - "version": "7.8.1", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -20395,12 +20020,15 @@ } }, "node_modules/safe-array-concat": { - "version": "1.0.1", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "has-symbols": "^1.0.3", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", "isarray": "^2.0.5" }, "engines": { @@ -20412,10 +20040,14 @@ }, "node_modules/safe-array-concat/node_modules/isarray": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "license": "MIT" }, "node_modules/safe-buffer": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -20432,8 +20064,32 @@ ], "license": "MIT" }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, "node_modules/safe-regex": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", "dev": true, "license": "MIT", "dependencies": { @@ -20441,19 +20097,26 @@ } }, "node_modules/safe-regex-test": { - "version": "1.0.0", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "is-regex": "^1.1.4" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safe-stable-stringify": { - "version": "2.4.3", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", "license": "MIT", "engines": { "node": ">=10" @@ -20461,10 +20124,14 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, "node_modules/sass-lookup": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/sass-lookup/-/sass-lookup-3.0.0.tgz", + "integrity": "sha512-TTsus8CfFRn1N44bvdEai1no6PqdmDiQUiqW5DlpmtT+tYnIt1tXtDIph5KA1efC+LmioJXSnCtUVpcK9gaKIg==", "dev": true, "license": "MIT", "dependencies": { @@ -20479,15 +20146,16 @@ }, "node_modules/sass-lookup/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/semver": { - "version": "7.5.4", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -20497,11 +20165,15 @@ }, "node_modules/semver-compare": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true, "license": "MIT" }, "node_modules/semver-regex": { "version": "3.1.4", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz", + "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", "dev": true, "license": "MIT", "engines": { @@ -20511,44 +20183,53 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC" - }, "node_modules/set-blocking": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "license": "ISC" }, "node_modules/set-function-length": { - "version": "1.1.1", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "license": "MIT", "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/set-function-name": { - "version": "2.0.1", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "license": "MIT", "dependencies": { - "define-data-property": "^1.0.1", + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.0" + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -20556,6 +20237,8 @@ }, "node_modules/set-value": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-4.1.0.tgz", + "integrity": "sha512-zTEg4HL0RwVrqcWs3ztF+x1vkxfm0lP+MQQFPiMJTKVceBwEV0A569Ou8l9IYQG8jOZdMVI1hGsc0tmeD2o/Lw==", "funding": [ "https://github.com/sponsors/jonschlinkert", "https://paypal.me/jonathanschlinkert", @@ -20572,10 +20255,14 @@ }, "node_modules/setprototypeof": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, "node_modules/sha256": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sha256/-/sha256-0.2.0.tgz", + "integrity": "sha512-kTWMJUaez5iiT9CcMv8jSq6kMhw3ST0uRdcIWl3D77s6AsLXNXRp3heeqqfu5+Dyfu4hwpQnMzhqHh8iNQxw0w==", "dependencies": { "convert-hex": "~0.1.0", "convert-string": "~0.1.0" @@ -20583,6 +20270,8 @@ }, "node_modules/shebang-command": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -20593,6 +20282,8 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "license": "MIT", "engines": { "node": ">=8" @@ -20600,16 +20291,78 @@ }, "node_modules/shellwords": { "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true, "license": "MIT" }, "node_modules/side-channel": { - "version": "1.0.4", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -20617,6 +20370,8 @@ }, "node_modules/signal-exit": { "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "license": "ISC" }, "node_modules/simple-concat": { @@ -20693,6 +20448,8 @@ }, "node_modules/simple-swizzle": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", "license": "MIT", "dependencies": { "is-arrayish": "^0.3.1" @@ -20700,15 +20457,21 @@ }, "node_modules/simple-swizzle/node_modules/is-arrayish": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", "license": "MIT" }, "node_modules/sisteransi": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "dev": true, "license": "MIT" }, "node_modules/slash": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "license": "MIT", "engines": { "node": ">=8" @@ -20716,6 +20479,8 @@ }, "node_modules/slice-ansi": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20731,6 +20496,8 @@ }, "node_modules/slice-ansi/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", "engines": { @@ -20742,6 +20509,8 @@ }, "node_modules/sort-keys": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==", "dev": true, "license": "MIT", "dependencies": { @@ -20753,13 +20522,17 @@ }, "node_modules/source-map": { "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "license": "BSD-3-Clause", "engines": { "node": ">= 8" } }, "node_modules/source-map-js": { - "version": "1.0.2", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -20768,6 +20541,8 @@ }, "node_modules/source-map-support": { "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "license": "MIT", "dependencies": { @@ -20777,6 +20552,8 @@ }, "node_modules/source-map-support/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -20785,6 +20562,8 @@ }, "node_modules/spdx-correct": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "license": "Apache-2.0", "dependencies": { "spdx-expression-parse": "^3.0.0", @@ -20792,11 +20571,15 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "license": "CC-BY-3.0" }, "node_modules/spdx-expression-parse": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", @@ -20804,11 +20587,15 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.16", + "version": "3.0.21", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", + "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", "license": "CC0-1.0" }, "node_modules/split": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", "license": "MIT", "dependencies": { "through": "2" @@ -20819,6 +20606,8 @@ }, "node_modules/split2": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", "dev": true, "license": "ISC", "dependencies": { @@ -20827,6 +20616,8 @@ }, "node_modules/split2/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -20840,11 +20631,15 @@ }, "node_modules/sprintf-js": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/sqlstring": { "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -20852,6 +20647,8 @@ }, "node_modules/stack-generator": { "version": "2.0.10", + "resolved": "https://registry.npmjs.org/stack-generator/-/stack-generator-2.0.10.tgz", + "integrity": "sha512-mwnua/hkqM6pF4k8SnmZ2zfETsRUpWXREfA/goT8SLCV4iOFa4bzOX2nDipWAZFPTjLvQB82f5yaodMVhK0yJQ==", "license": "MIT", "dependencies": { "stackframe": "^1.3.4" @@ -20859,6 +20656,8 @@ }, "node_modules/stack-trace": { "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", "license": "MIT", "engines": { "node": "*" @@ -20866,6 +20665,8 @@ }, "node_modules/stack-utils": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20877,6 +20678,8 @@ }, "node_modules/stack-utils/node_modules/escape-string-regexp": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, "license": "MIT", "engines": { @@ -20885,10 +20688,14 @@ }, "node_modules/stackframe": { "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", "license": "MIT" }, "node_modules/stacktrace-parser": { - "version": "0.1.10", + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", + "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", "license": "MIT", "dependencies": { "type-fest": "^0.7.1" @@ -20899,6 +20706,8 @@ }, "node_modules/stacktrace-parser/node_modules/type-fest": { "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" @@ -20906,10 +20715,14 @@ }, "node_modules/standard-as-callback": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", "license": "MIT" }, "node_modules/standard-version": { "version": "9.5.0", + "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-9.5.0.tgz", + "integrity": "sha512-3zWJ/mmZQsOaO+fOlsa0+QK90pwhNd042qEcw6hKFNoLFs7peGyvPffpEBbK/DSGPbyOvli0mUIFv5A4qTjh2Q==", "dev": true, "license": "ISC", "dependencies": { @@ -20937,6 +20750,8 @@ }, "node_modules/standard-version/node_modules/cliui": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "license": "ISC", "dependencies": { @@ -20947,6 +20762,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog": { "version": "3.1.25", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.25.tgz", + "integrity": "sha512-ryhi3fd1mKf3fSjbLXOfK2D06YwKNic1nC9mWqybBHdObPd8KJ2vjaXZfYj1U23t+V8T8n0d7gwnc9XbIdFbyQ==", "dev": true, "license": "MIT", "dependencies": { @@ -20968,6 +20785,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-angular": { "version": "5.0.13", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz", + "integrity": "sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==", "dev": true, "license": "ISC", "dependencies": { @@ -20980,6 +20799,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-conventionalcommits": { "version": "4.6.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz", + "integrity": "sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==", "dev": true, "license": "ISC", "dependencies": { @@ -20993,6 +20814,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-core": { "version": "4.2.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz", + "integrity": "sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg==", "dev": true, "license": "MIT", "dependencies": { @@ -21017,6 +20840,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-core/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -21025,6 +20850,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-jquery": { "version": "3.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz", + "integrity": "sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==", "dev": true, "license": "ISC", "dependencies": { @@ -21036,6 +20863,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-writer": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz", + "integrity": "sha512-5WsuKUfxW7suLblAbFnxAcrvf6r+0b7GvNaWUwUIk0bXMnENP/PEieGKVUQrjPqwPT4o3EPAASBXiY6iHooLOQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21058,6 +20887,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-writer/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -21066,6 +20897,8 @@ }, "node_modules/standard-version/node_modules/conventional-changelog-writer/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -21074,6 +20907,8 @@ }, "node_modules/standard-version/node_modules/conventional-commits-parser": { "version": "3.2.4", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.4.tgz", + "integrity": "sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==", "dev": true, "license": "MIT", "dependencies": { @@ -21093,6 +20928,8 @@ }, "node_modules/standard-version/node_modules/conventional-commits-parser/node_modules/through2": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", "dependencies": { @@ -21101,6 +20938,8 @@ }, "node_modules/standard-version/node_modules/get-pkg-repo": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz", + "integrity": "sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==", "dev": true, "license": "MIT", "dependencies": { @@ -21118,6 +20957,8 @@ }, "node_modules/standard-version/node_modules/git-semver-tags": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "license": "MIT", "dependencies": { @@ -21133,6 +20974,8 @@ }, "node_modules/standard-version/node_modules/git-semver-tags/node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { @@ -21141,6 +20984,8 @@ }, "node_modules/standard-version/node_modules/hosted-git-info": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, "license": "ISC", "dependencies": { @@ -21152,6 +20997,8 @@ }, "node_modules/standard-version/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "license": "ISC", "dependencies": { @@ -21163,6 +21010,8 @@ }, "node_modules/standard-version/node_modules/normalize-package-data": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -21177,6 +21026,8 @@ }, "node_modules/standard-version/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "license": "MIT", "dependencies": { @@ -21190,11 +21041,15 @@ }, "node_modules/standard-version/node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true, "license": "ISC" }, "node_modules/standard-version/node_modules/yargs": { "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "license": "MIT", "dependencies": { @@ -21212,6 +21067,8 @@ }, "node_modules/static-eval": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", "license": "MIT", "dependencies": { "escodegen": "^1.8.1" @@ -21219,6 +21076,8 @@ }, "node_modules/static-eval/node_modules/escodegen": { "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "license": "BSD-2-Clause", "dependencies": { "esprima": "^4.0.1", @@ -21239,6 +21098,8 @@ }, "node_modules/static-eval/node_modules/levn": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2", @@ -21250,6 +21111,8 @@ }, "node_modules/static-eval/node_modules/optionator": { "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "license": "MIT", "dependencies": { "deep-is": "~0.1.3", @@ -21265,12 +21128,16 @@ }, "node_modules/static-eval/node_modules/prelude-ls": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "engines": { "node": ">= 0.8.0" } }, "node_modules/static-eval/node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "license": "BSD-3-Clause", "optional": true, "engines": { @@ -21279,6 +21146,8 @@ }, "node_modules/static-eval/node_modules/type-check": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", "license": "MIT", "dependencies": { "prelude-ls": "~1.1.2" @@ -21288,7 +21157,9 @@ } }, "node_modules/stats-accumulator": { - "version": "1.1.3", + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/stats-accumulator/-/stats-accumulator-1.2.15.tgz", + "integrity": "sha512-9joMhuHyojZEJrZi7mn1zgCQiQSwmAxLrwpwBgKEGlY6zSbDGrikd2sSSpt1KmzqhHSFL8i48iV7O36a1wfEzg==", "dev": true, "license": "MIT", "engines": { @@ -21297,6 +21168,8 @@ }, "node_modules/statuses": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -21304,6 +21177,8 @@ }, "node_modules/stream-browserify": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", "license": "MIT", "dependencies": { "inherits": "~2.0.4", @@ -21312,6 +21187,8 @@ }, "node_modules/stream-browserify/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -21324,6 +21201,8 @@ }, "node_modules/stream-to-array": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz", + "integrity": "sha512-UsZtOYEn4tWU2RGLOXr/o/xjRBftZRlG3dEWoaHr8j4GuypJ3isitGbVyjQKAuMu+xbiop8q224TjiZWc4XTZA==", "dev": true, "license": "MIT", "dependencies": { @@ -21332,6 +21211,8 @@ }, "node_modules/strict-uri-encode": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==", "dev": true, "license": "MIT", "engines": { @@ -21340,6 +21221,8 @@ }, "node_modules/string_decoder": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "license": "MIT", "dependencies": { "safe-buffer": "~5.1.0" @@ -21347,10 +21230,14 @@ }, "node_modules/string_decoder/node_modules/safe-buffer": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, "node_modules/string-argv": { "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", "dev": true, "license": "MIT", "engines": { @@ -21359,6 +21246,8 @@ }, "node_modules/string-length": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21371,6 +21260,8 @@ }, "node_modules/string-width": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -21384,6 +21275,8 @@ "node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { @@ -21397,6 +21290,8 @@ }, "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "license": "MIT", "engines": { @@ -21405,18 +21300,26 @@ }, "node_modules/string-width/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -21426,24 +21329,35 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -21451,6 +21365,8 @@ }, "node_modules/stringify-object": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -21464,11 +21380,16 @@ }, "node_modules/stringify-package": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz", + "integrity": "sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==", + "deprecated": "This module is not used anymore, and has been replaced by @npmcli/package-json", "dev": true, "license": "ISC" }, "node_modules/strip-ansi": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -21480,6 +21401,8 @@ "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", "dependencies": { @@ -21491,6 +21414,8 @@ }, "node_modules/strip-bom": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "license": "MIT", "engines": { @@ -21499,6 +21424,8 @@ }, "node_modules/strip-final-newline": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "license": "MIT", "engines": { @@ -21507,6 +21434,8 @@ }, "node_modules/strip-indent": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21518,6 +21447,8 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "license": "MIT", "engines": { "node": ">=8" @@ -21527,11 +21458,21 @@ } }, "node_modules/strnum": { - "version": "1.0.5", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], "license": "MIT" }, "node_modules/stylus-lookup": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/stylus-lookup/-/stylus-lookup-3.0.2.tgz", + "integrity": "sha512-oEQGHSjg/AMaWlKe7gqsnYzan8DLcGIHe0dUaFkucZZ14z4zjENRlQMCHT4FNsiWnJf17YN9OvrCfCoi7VvOyg==", "dev": true, "license": "MIT", "dependencies": { @@ -21547,11 +21488,15 @@ }, "node_modules/stylus-lookup/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/subdirs": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/subdirs/-/subdirs-1.0.1.tgz", + "integrity": "sha512-KSbUKpwQIRcb5Th+l4EzxEZYpCwV/g0pQ348EV7CIM5YEEgzz2L1KJD8FCeTckTiE/TKn2u09DCxpdAL6/iFbg==", "license": "MIT", "dependencies": { "es6-promise": "^3.0.2" @@ -21559,6 +21504,9 @@ }, "node_modules/superagent": { "version": "8.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", + "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "deprecated": "Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net", "dev": true, "license": "MIT", "dependencies": { @@ -21577,13 +21525,28 @@ "node": ">=6.4.0 <13 || >=14" } }, + "node_modules/superagent/node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/supertest": { - "version": "6.3.3", + "version": "6.3.4", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.4.tgz", + "integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==", "dev": true, "license": "MIT", "dependencies": { "methods": "^1.1.2", - "superagent": "^8.0.5" + "superagent": "^8.1.2" }, "engines": { "node": ">=6.4.0" @@ -21591,6 +21554,8 @@ }, "node_modules/supports-color": { "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -21601,6 +21566,8 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -21611,6 +21578,8 @@ }, "node_modules/swagger-cli": { "version": "4.0.4", + "resolved": "https://registry.npmjs.org/swagger-cli/-/swagger-cli-4.0.4.tgz", + "integrity": "sha512-Cp8YYuLny3RJFQ4CvOBTaqmOOgYsem52dPx1xM5S4EUWFblIh2Q8atppMZvXKUr1e9xH5RwipYpmdUzdPcxWcA==", "dev": true, "license": "MIT", "dependencies": { @@ -21624,10 +21593,11 @@ } }, "node_modules/synckit": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", - "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", "dev": true, + "license": "MIT", "dependencies": { "@pkgr/core": "^0.1.0", "tslib": "^2.6.2" @@ -21641,6 +21611,8 @@ }, "node_modules/tapable": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, "license": "MIT", "engines": { @@ -21651,6 +21623,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -21715,6 +21688,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", "engines": { "node": ">=8" } @@ -21722,10 +21696,13 @@ "node_modules/tar/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" }, "node_modules/tdigest": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", + "integrity": "sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==", "license": "MIT", "dependencies": { "bintrees": "1.0.2" @@ -21733,6 +21710,8 @@ }, "node_modules/test-exclude": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "license": "ISC", "dependencies": { @@ -21746,6 +21725,9 @@ }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", "dependencies": { @@ -21765,6 +21747,8 @@ }, "node_modules/text-extensions": { "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", "dev": true, "license": "MIT", "engines": { @@ -21773,18 +21757,26 @@ }, "node_modules/text-hex": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", "license": "MIT" }, "node_modules/text-table": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "license": "MIT" }, "node_modules/through": { "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", "license": "MIT" }, "node_modules/through2": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21794,6 +21786,8 @@ }, "node_modules/timed-out": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==", "dev": true, "license": "MIT", "engines": { @@ -21802,6 +21796,8 @@ }, "node_modules/tmp": { "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "license": "MIT", "dependencies": { @@ -21813,25 +21809,23 @@ }, "node_modules/tmpl": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-function": { "version": "2.0.6", + "resolved": "https://registry.npmjs.org/to-function/-/to-function-2.0.6.tgz", + "integrity": "sha512-LWfUmW851x5T8+78Nl82CA2j6w0trhoFj4rpS6pFUMgfUMUySDAKPgTvQkUqlWuH3Lihlk5sPyDHSVwmKDSc5Q==", "dependencies": { "component-props": "*" } }, "node_modules/to-regex-range": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -21842,6 +21836,8 @@ }, "node_modules/toidentifier": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "license": "MIT", "engines": { "node": ">=0.6" @@ -21849,10 +21845,14 @@ }, "node_modules/tr46": { "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, "node_modules/trim-newlines": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true, "license": "MIT", "engines": { @@ -21861,6 +21861,8 @@ }, "node_modules/triple-beam": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", "license": "MIT", "engines": { "node": ">= 14.0.0" @@ -21868,13 +21870,17 @@ }, "node_modules/truncate-utf8-bytes": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", + "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", "license": "WTFPL", "dependencies": { "utf8-byte-length": "^1.0.1" } }, "node_modules/ts-graphviz": { - "version": "1.8.1", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/ts-graphviz/-/ts-graphviz-1.8.2.tgz", + "integrity": "sha512-5YhbFoHmjxa7pgQLkB07MtGnGJ/yhvjmc9uhsnDBEICME6gkPf83SBwLDQqGDoCa3XzUMWLk1AU2Wn1u1naDtA==", "dev": true, "license": "MIT", "engines": { @@ -21886,10 +21892,11 @@ } }, "node_modules/ts-jest": { - "version": "29.2.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", - "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", + "version": "29.2.6", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.6.tgz", + "integrity": "sha512-yTNZVZqc8lSixm+QGVFcPe6+yj7+TWZwIesuOWvfcn4B9bz5x4NDzVCQQjOs7Hfouu36aEqfEbo9Qpo+gq8dDg==", "dev": true, + "license": "MIT", "dependencies": { "bs-logger": "^0.2.6", "ejs": "^3.1.10", @@ -21898,7 +21905,7 @@ "json5": "^2.2.3", "lodash.memoize": "^4.1.2", "make-error": "^1.3.6", - "semver": "^7.6.3", + "semver": "^7.7.1", "yargs-parser": "^21.1.1" }, "bin": { @@ -21933,20 +21940,10 @@ } } }, - "node_modules/ts-jest/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ts-jest/node_modules/yargs-parser": { "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { @@ -21955,6 +21952,8 @@ }, "node_modules/ts-node": { "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21997,6 +21996,8 @@ }, "node_modules/tsconfig-paths": { "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", @@ -22007,6 +22008,8 @@ }, "node_modules/tsconfig-paths/node_modules/json5": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "license": "MIT", "dependencies": { "minimist": "^1.2.0" @@ -22017,18 +22020,23 @@ }, "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, "node_modules/tsscmp": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", "license": "MIT", "engines": { "node": ">=0.6.x" @@ -22036,6 +22044,8 @@ }, "node_modules/tsutils": { "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "license": "MIT", "dependencies": { "tslib": "^1.8.1" @@ -22049,6 +22059,8 @@ }, "node_modules/tsutils/node_modules/tslib": { "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "license": "0BSD" }, "node_modules/tunnel-agent": { @@ -22065,6 +22077,8 @@ }, "node_modules/type-check": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" @@ -22075,6 +22089,8 @@ }, "node_modules/type-detect": { "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, "license": "MIT", "engines": { @@ -22083,6 +22099,8 @@ }, "node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -22093,6 +22111,8 @@ }, "node_modules/type-is": { "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "license": "MIT", "dependencies": { "media-typer": "0.3.0", @@ -22103,25 +22123,30 @@ } }, "node_modules/typed-array-buffer": { - "version": "1.0.0", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1", - "is-typed-array": "^1.1.10" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.0", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -22131,14 +22156,18 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.0", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" }, "engines": { "node": ">= 0.4" @@ -22148,12 +22177,20 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.4", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bind": "^1.0.7", "for-each": "^0.3.3", - "is-typed-array": "^1.1.9" + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -22161,11 +22198,15 @@ }, "node_modules/typedarray": { "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true, "license": "MIT" }, "node_modules/typescript": { - "version": "5.3.3", + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -22176,7 +22217,9 @@ } }, "node_modules/ua-parser-js": { - "version": "1.0.37", + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.40.tgz", + "integrity": "sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew==", "funding": [ { "type": "opencollective", @@ -22192,12 +22235,17 @@ } ], "license": "MIT", + "bin": { + "ua-parser-js": "script/cli.js" + }, "engines": { "node": "*" } }, "node_modules/uglify-js": { - "version": "3.17.4", + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "license": "BSD-2-Clause", "optional": true, "bin": { @@ -22208,13 +22256,18 @@ } }, "node_modules/unbox-primitive": { - "version": "1.0.2", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bound": "^1.0.3", "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -22222,19 +22275,21 @@ }, "node_modules/underscore": { "version": "1.12.1", - "license": "MIT" - }, - "node_modules/undici-types": { - "version": "5.26.5", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", "license": "MIT" }, "node_modules/uniq": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", "dev": true, "license": "MIT" }, "node_modules/universalify": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "license": "MIT", "engines": { @@ -22243,6 +22298,8 @@ }, "node_modules/unpipe": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -22250,6 +22307,8 @@ }, "node_modules/unset-value": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-2.0.1.tgz", + "integrity": "sha512-2hvrBfjUE00PkqN+q0XP6yRAOGrR06uSiUoIQGZkc7GxvQ9H7v8quUPNtZjMg4uux69i8HWpIjLPUKwCuRGyNg==", "license": "MIT", "dependencies": { "has-value": "^2.0.2", @@ -22261,13 +22320,17 @@ }, "node_modules/unset-value/node_modules/isobject": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", "dev": true, "funding": [ { @@ -22285,8 +22348,8 @@ ], "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -22297,6 +22360,8 @@ }, "node_modules/uri-js": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -22304,6 +22369,8 @@ }, "node_modules/url-parse-lax": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", "dev": true, "license": "MIT", "dependencies": { @@ -22315,6 +22382,8 @@ }, "node_modules/url-to-options": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A==", "dev": true, "license": "MIT", "engines": { @@ -22322,15 +22391,21 @@ } }, "node_modules/utf8-byte-length": { - "version": "1.0.4", - "license": "WTFPL" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", + "license": "(WTFPL OR MIT)" }, "node_modules/utf8-length": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/utf8-length/-/utf8-length-0.0.1.tgz", + "integrity": "sha512-j/XH2ftofBiobnyApxlN/J6j/ixwT89WEjDcjT66d2i0+GIn9RZfzt8lpEXXE4jUe4NsjBSUq70kS2euQ4nnMw==", "license": "MIT" }, "node_modules/util-deprecate": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, "node_modules/uuid": { @@ -22341,17 +22416,22 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true, "license": "MIT" }, "node_modules/v8-to-istanbul": { - "version": "9.2.0", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, "license": "ISC", "dependencies": { @@ -22364,10 +22444,14 @@ } }, "node_modules/valid-url": { - "version": "1.0.9" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", + "integrity": "sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==" }, "node_modules/validate-npm-package-license": { "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "license": "Apache-2.0", "dependencies": { "spdx-correct": "^3.0.0", @@ -22378,12 +22462,15 @@ "version": "13.12.0", "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/vary": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -22391,6 +22478,8 @@ }, "node_modules/vscode-json-languageservice": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-4.2.1.tgz", + "integrity": "sha512-xGmv9QIWs2H8obGbWg+sIPI/3/pFgj/5OWBhNzs00BkYQ9UaB2F6JJaGB/2/YOZJ3BvLXQTC4Q7muqU25QgAhA==", "dev": true, "license": "MIT", "dependencies": { @@ -22402,27 +22491,37 @@ } }, "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.11", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", "dev": true, "license": "MIT" }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", "dev": true, "license": "MIT" }, "node_modules/vscode-nls": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", + "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==", "dev": true, "license": "MIT" }, "node_modules/vscode-uri": { - "version": "3.0.8", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", + "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", "dev": true, "license": "MIT" }, "node_modules/walkdir": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz", + "integrity": "sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ==", "dev": true, "license": "MIT", "engines": { @@ -22431,6 +22530,8 @@ }, "node_modules/walker": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -22439,6 +22540,8 @@ }, "node_modules/wcwidth": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "license": "MIT", "dependencies": { "defaults": "^1.0.3" @@ -22446,10 +22549,14 @@ }, "node_modules/webidl-conversions": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "dependencies": { "tr46": "~0.0.3", @@ -22458,6 +22565,8 @@ }, "node_modules/which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -22470,14 +22579,70 @@ } }, "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/which-collection": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "license": "MIT", "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -22485,18 +22650,23 @@ }, "node_modules/which-module": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true, "license": "ISC" }, "node_modules/which-typed-array": { - "version": "1.1.13", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -22509,12 +22679,15 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } }, "node_modules/widest-line": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", "dev": true, "license": "MIT", "dependencies": { @@ -22525,31 +22698,35 @@ } }, "node_modules/winston": { - "version": "3.11.0", + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", + "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", "license": "MIT", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", "is-stream": "^2.0.0", - "logform": "^2.4.0", + "logform": "^2.7.0", "one-time": "^1.0.0", "readable-stream": "^3.4.0", "safe-stable-stringify": "^2.3.1", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", - "winston-transport": "^4.5.0" + "winston-transport": "^4.9.0" }, "engines": { "node": ">= 12.0.0" } }, "node_modules/winston-transport": { - "version": "4.6.0", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", "license": "MIT", "dependencies": { - "logform": "^2.3.2", - "readable-stream": "^3.6.0", + "logform": "^2.7.0", + "readable-stream": "^3.6.2", "triple-beam": "^1.3.0" }, "engines": { @@ -22558,6 +22735,8 @@ }, "node_modules/winston-transport/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -22570,6 +22749,8 @@ }, "node_modules/winston/node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -22582,6 +22763,8 @@ }, "node_modules/word-wrap": { "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -22589,10 +22772,14 @@ }, "node_modules/wordwrap": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "license": "MIT" }, "node_modules/wrap-ansi": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", "dependencies": { @@ -22610,6 +22797,8 @@ "node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", "dependencies": { @@ -22626,6 +22815,8 @@ }, "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -22640,6 +22831,8 @@ }, "node_modules/wrap-ansi-cjs/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -22651,11 +22844,15 @@ }, "node_modules/wrap-ansi-cjs/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { @@ -22670,6 +22867,8 @@ }, "node_modules/wrap-ansi/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { @@ -22681,15 +22880,21 @@ }, "node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/wrappy": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, "node_modules/write-file-atomic": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "license": "ISC", "dependencies": { @@ -22702,6 +22907,8 @@ }, "node_modules/xtend": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, "license": "MIT", "engines": { @@ -22710,6 +22917,8 @@ }, "node_modules/y18n": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "license": "ISC", "engines": { @@ -22718,11 +22927,15 @@ }, "node_modules/yallist": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, "license": "ISC" }, "node_modules/yaml": { - "version": "2.4.3", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -22733,6 +22946,8 @@ }, "node_modules/yargs": { "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "license": "MIT", "dependencies": { @@ -22750,6 +22965,8 @@ }, "node_modules/yargs-parser": { "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, "license": "ISC", "engines": { @@ -22758,6 +22975,8 @@ }, "node_modules/yargs/node_modules/yargs-parser": { "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "license": "ISC", "engines": { @@ -22765,7 +22984,9 @@ } }, "node_modules/ylru": { - "version": "1.3.2", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.4.0.tgz", + "integrity": "sha512-2OQsPNEmBCvXuFlIni/a+Rn+R2pHW9INm0BxXJ4hVDA8TirqMj+J/Rp9ItLatT/5pZqWwefVrTQcHpixsxnVlA==", "license": "MIT", "engines": { "node": ">= 4.0.0" @@ -22773,6 +22994,8 @@ }, "node_modules/yn": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, "license": "MIT", "engines": { @@ -22781,6 +23004,8 @@ }, "node_modules/yocto-queue": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "license": "MIT", "engines": { "node": ">=10" @@ -22790,7 +23015,9 @@ } }, "node_modules/zod": { - "version": "3.22.4", + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index d46660752f4..257573c4028 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.18", + "@rudderstack/integrations-lib": "^0.2.19", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", diff --git a/src/cdk/v2/destinations/emarsys/utils.test.js b/src/cdk/v2/destinations/emarsys/utils.test.js index 72a86a15294..7709466f1c7 100644 --- a/src/cdk/v2/destinations/emarsys/utils.test.js +++ b/src/cdk/v2/destinations/emarsys/utils.test.js @@ -476,7 +476,10 @@ describe('Emarsys utils', () => { keyId, ); - expect(result).toEqual({ isAbortable: true, errorMsg: '{"errorCode":"errorMessage"}' }); + expect(result).toEqual({ + isAbortable: true, + errorMsg: JSON.stringify({ errorCode: 'errorMessage' }), + }); }); // Returns {isAbortable: true, errorMsg} if event is an object with keyId and has a corresponding error in the errors object. @@ -503,7 +506,10 @@ describe('Emarsys utils', () => { keyId, ); - expect(result).toEqual({ isAbortable: true, errorMsg: '{"errorCode":"errorMessage"}' }); + expect(result).toEqual({ + isAbortable: true, + errorMsg: JSON.stringify({ errorCode: 'errorMessage' }), + }); }); }); diff --git a/src/cdk/v2/destinations/gladly/utils.test.js b/src/cdk/v2/destinations/gladly/utils.test.js index 116f150448f..5663d29d1ec 100644 --- a/src/cdk/v2/destinations/gladly/utils.test.js +++ b/src/cdk/v2/destinations/gladly/utils.test.js @@ -12,18 +12,20 @@ const { formatFieldForEventStream, } = require('./utils'); const { base64Convertor } = require('../../../../v0/util'); +const { generateRandomString } = require('@rudderstack/integrations-lib'); describe('Unit test cases for getHeaders function', () => { it('Should return headers', () => { const destination = { Config: { - apiToken: 'token', + apiToken: generateRandomString(), userName: 'user', }, }; + const authInfo = `${destination.Config.userName}:${destination.Config.apiToken}`; const expectedHeaders = { 'Content-Type': 'application/json', - Authorization: `Basic ${base64Convertor('user:token')}`, + Authorization: `Basic ${base64Convertor(authInfo)}`, }; const result = getHeaders(destination); diff --git a/src/cdk/v2/destinations/http/utils.test.js b/src/cdk/v2/destinations/http/utils.test.js index 5b6eca90a4c..c5562336351 100644 --- a/src/cdk/v2/destinations/http/utils.test.js +++ b/src/cdk/v2/destinations/http/utils.test.js @@ -91,7 +91,11 @@ describe('Utils Functions', () => { key2: 'value2', key3: { subKey: 'value3', subkey2: undefined }, }; - const expectedFORM = { key1: 'value1', key2: 'value2', key3: '{"subKey":"value3"}' }; + const expectedFORM = { + key1: 'value1', + key2: 'value2', + key3: JSON.stringify({ subKey: 'value3' }), + }; const result = prepareBody(payload, 'FORM'); expect(result).toEqual(expectedFORM); }); @@ -113,7 +117,7 @@ describe('Utils Functions', () => { describe('stringifyFirstLevelValues', () => { test('converts non-string first-level values to strings', () => { const input = { a: 1, b: true, c: { d: 42 } }; - const expected = { a: '1', b: 'true', c: '{"d":42}' }; + const expected = { a: '1', b: 'true', c: JSON.stringify({ d: 42 }) }; expect(stringifyFirstLevelValues(input)).toEqual(expected); }); diff --git a/src/cdk/v2/destinations/intercom/utils.test.js b/src/cdk/v2/destinations/intercom/utils.test.js index e2c1fb9a072..7436f426f22 100644 --- a/src/cdk/v2/destinations/intercom/utils.test.js +++ b/src/cdk/v2/destinations/intercom/utils.test.js @@ -1,5 +1,6 @@ const md5 = require('md5'); const axios = require('axios'); +const { generateRandomString } = require('@rudderstack/integrations-lib'); const { getName, getHeaders, @@ -743,7 +744,7 @@ describe('attachUserAndCompany utility test', () => { }; const Config = { sendAnonymousId: false, - apiKey: 'testApiKey', + apiKey: generateRandomString(), }; const expectedResponse = { @@ -755,7 +756,7 @@ describe('attachUserAndCompany utility test', () => { files: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: `Bearer ${Config.apiKey}`, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', diff --git a/src/cdk/v2/destinations/linkedin_ads/utils.test.js b/src/cdk/v2/destinations/linkedin_ads/utils.test.js index d66bda47dc1..822a5f479b7 100644 --- a/src/cdk/v2/destinations/linkedin_ads/utils.test.js +++ b/src/cdk/v2/destinations/linkedin_ads/utils.test.js @@ -10,7 +10,11 @@ const { createResponseArray, checkIfPricePresent, } = require('./utils'); -const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); +const { + InstrumentationError, + ConfigurationError, + generateRandomString, +} = require('@rudderstack/integrations-lib'); const { API_HEADER_METHOD, API_PROTOCOL_VERSION, API_VERSION } = require('./config'); describe('formatEmail', () => { @@ -180,7 +184,7 @@ describe('generateHeader', () => { // Returns a headers object with Content-Type, X-RestLi-Method, X-Restli-Protocol-Version, LinkedIn-Version, and Authorization keys when passed a valid access token. it('should return a headers object with all keys when passed a valid access token', () => { // Arrange - const accessToken = 'validAccessToken'; + const accessToken = generateRandomString(); // Act const result = generateHeader(accessToken); @@ -198,7 +202,7 @@ describe('generateHeader', () => { // Returns a headers object with default values for all keys when passed an invalid access token. it('should return a headers object with default values for all keys when passed an invalid access token', () => { // Arrange - const accessToken = 'invalidAccessToken'; + const accessToken = generateRandomString(); // Act const result = generateHeader(accessToken); diff --git a/src/controllers/__tests__/regulation.test.ts b/src/controllers/__tests__/regulation.test.ts index 55cd8f2d376..cfde691c8a1 100644 --- a/src/controllers/__tests__/regulation.test.ts +++ b/src/controllers/__tests__/regulation.test.ts @@ -64,7 +64,7 @@ describe('Regulation controller tests', () => { const response = await request(server) .post('/deleteUsers') .set('Accept', 'application/json') - .set('x-rudder-dest-info', '{"a": "test"}') + .set('x-rudder-dest-info', JSON.stringify({ a: 'test' })) .send(getDeletionData()); expect(response.status).toEqual(400); @@ -94,7 +94,7 @@ describe('Regulation controller tests', () => { const response = await request(server) .post('/deleteUsers') .set('Accept', 'application/json') - .set('x-rudder-dest-info', '{"a": "test"}') + .set('x-rudder-dest-info', JSON.stringify({ a: 'test' })) .send(getDeletionData()); expect(response.status).toEqual(500); diff --git a/src/controllers/__tests__/source.test.ts b/src/controllers/__tests__/source.test.ts index 72bee83282e..e0ff9e7a4b9 100644 --- a/src/controllers/__tests__/source.test.ts +++ b/src/controllers/__tests__/source.test.ts @@ -41,8 +41,8 @@ const getData = () => { const getV2Data = () => { return [ - { request: { body: '{"a": "b"}' }, source: { id: 1 } }, - { request: { body: '{"a": "b"}' }, source: { id: 1 } }, + { request: { body: JSON.stringify({ a: 'b' }) }, source: { id: 1 } }, + { request: { body: JSON.stringify({ a: 'b' }) }, source: { id: 1 } }, ]; }; diff --git a/src/controllers/util/index.test.ts b/src/controllers/util/index.test.ts index 3edfbef970f..e1a383148a2 100644 --- a/src/controllers/util/index.test.ts +++ b/src/controllers/util/index.test.ts @@ -187,7 +187,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -198,7 +198,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -209,7 +209,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -279,7 +279,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -290,7 +290,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -301,7 +301,7 @@ describe('adaptInputToVersion', () => { url: 'http://example.com', proto: 'HTTP/2', headers: { headerkey: ['headervalue'] }, - body: '{"key": "value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -416,7 +416,7 @@ describe('adaptInputToVersion', () => { { output: { request: { - body: '{"key":"value"}', + body: JSON.stringify({ key: 'value' }), query_parameters: { paramkey: ['paramvalue'] }, }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, @@ -425,7 +425,7 @@ describe('adaptInputToVersion', () => { { output: { request: { - body: '{"key":"value"}', + body: JSON.stringify({ key: 'value' }), }, source: { id: 'source_id', config: { configField1: 'configVal1' } }, }, diff --git a/src/v0/destinations/braze/braze.util.test.js b/src/v0/destinations/braze/braze.util.test.js index 6fe4dbbb44e..c68f1e046be 100644 --- a/src/v0/destinations/braze/braze.util.test.js +++ b/src/v0/destinations/braze/braze.util.test.js @@ -13,6 +13,7 @@ const { removeUndefinedAndNullValues, removeUndefinedAndNullAndEmptyValues, } = require('../../util'); +const { generateRandomString } = require('@rudderstack/integrations-lib'); // Mock the handleHttpRequest function jest.mock('../../../adapters/network'); @@ -255,7 +256,7 @@ describe('dedup utility tests', () => { enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'test-rest-api-key', + restApiKey: generateRandomString(), supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -321,7 +322,7 @@ describe('dedup utility tests', () => { }, { headers: { - Authorization: 'Bearer test-rest-api-key', + Authorization: `Bearer ${destination.Config.restApiKey}`, }, timeout: 10000, }, @@ -341,7 +342,7 @@ describe('dedup utility tests', () => { ID: 'some-destination-id', Name: 'Test Destination', Config: { - restApiKey: 'test-rest-api-key', + restApiKey: generateRandomString(), }, }; diff --git a/src/v0/destinations/ga4_v2/transform.ts b/src/v0/destinations/ga4_v2/transform.ts index 06d4bd90236..883cb420a1f 100644 --- a/src/v0/destinations/ga4_v2/transform.ts +++ b/src/v0/destinations/ga4_v2/transform.ts @@ -1,8 +1,4 @@ -import { - InstrumentationError, - isDefinedAndNotNull, - RudderStackEvent, -} from '@rudderstack/integrations-lib'; +import { InstrumentationError, isDefinedAndNotNull } from '@rudderstack/integrations-lib'; import { ProcessorTransformationRequest } from '../../../types'; import { handleCustomMappings } from './customMappingsHandler'; import { processEvents as ga4Process } from '../ga4/transform'; @@ -23,7 +19,7 @@ export function process(event: ProcessorTransformationRequest) { Config.apiSecret = configDetails.MEASUREMENT_PROTOCOL_SECRET; } - const eventPayload = message as RudderStackEvent; + const eventPayload = message as any; if (!eventPayload.type) { throw new InstrumentationError('Message Type is not present. Aborting message.'); diff --git a/src/v0/destinations/google_adwords_remarketing_lists/util.test.js b/src/v0/destinations/google_adwords_remarketing_lists/util.test.js index a41c00f12f4..2ba4948566b 100644 --- a/src/v0/destinations/google_adwords_remarketing_lists/util.test.js +++ b/src/v0/destinations/google_adwords_remarketing_lists/util.test.js @@ -1,6 +1,8 @@ const { populateIdentifiers, responseBuilder, getOperationAudienceId } = require('./util'); const { API_VERSION } = require('./config'); -const accessToken = 'abcd1234'; +const { generateRandomString } = require('@rudderstack/integrations-lib'); + +const accessToken = generateRandomString(); const developerToken = 'ijkl9101'; const body = { operations: [ @@ -68,7 +70,7 @@ const expectedResponse = { method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: `Bearer ${accessToken}`, 'Content-Type': 'application/json', 'developer-token': 'ijkl9101', }, diff --git a/src/v0/destinations/marketo_static_list/testData/constants.js b/src/v0/destinations/marketo_static_list/testData/constants.js index 2c420c6bc2a..673db80ac6e 100644 --- a/src/v0/destinations/marketo_static_list/testData/constants.js +++ b/src/v0/destinations/marketo_static_list/testData/constants.js @@ -1,16 +1,20 @@ +const { generateRandomString } = require('@rudderstack/integrations-lib'); + +const clientSecret = generateRandomString(); +const ACCESS_TOKEN = generateRandomString(); const EXTERNAL_ID = 'marketoStaticListId'; -const TOKEN = 'Bearer access_token_success'; +const AUTH_HEADER_TOKEN = `Bearer ${ACCESS_TOKEN}`; const CONTENT_TYPE = 'application/json'; const DEST_CONFIG = { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', - staticListId: 1234, + clientId: 'marketo_static_list_client_id_success', + clientSecret, + accountId: 'marketo_static_list_unit_test_success', + staticListId: 1122, }; const DEST_DEFINITION = { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', - Name: 'MARKETO', - DisplayName: 'Marketo', + Name: 'MARKETO_STATIC_LIST', + DisplayName: 'Marketo Static List', transformAt: 'processor', transformAtV1: 'processor', }; @@ -18,12 +22,7 @@ const DEST_OBJECT = { ID: '1zwa1wKshSt81YksKmUdJnr4IOK', Name: 'test_marketo_rc', DestinationDefinition: DEST_DEFINITION, - Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', - staticListId: 1122, - }, + Config: DEST_CONFIG, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -36,7 +35,8 @@ const MESSAGE_SOURCES_CONTEXT = { module.exports = { EXTERNAL_ID, - TOKEN, + ACCESS_TOKEN, + AUTH_HEADER_TOKEN, CONTENT_TYPE, DEST_OBJECT, DEST_DEFINITION, diff --git a/src/v0/destinations/marketo_static_list/testData/testData.js b/src/v0/destinations/marketo_static_list/testData/testData.js index 45328436ce7..a94a97f4d9c 100644 --- a/src/v0/destinations/marketo_static_list/testData/testData.js +++ b/src/v0/destinations/marketo_static_list/testData/testData.js @@ -1,6 +1,6 @@ const { EXTERNAL_ID, - TOKEN, + AUTH_HEADER_TOKEN, CONTENT_TYPE, DEST_OBJECT, DEST_DEFINITION, @@ -128,9 +128,9 @@ const recordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -162,9 +162,9 @@ const recordOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -193,9 +193,9 @@ const recordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -1375,9 +1375,9 @@ const largeRecordOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=351&id=352&id=353&id=354&id=355&id=356&id=357&id=358&id=359&id=360&id=361&id=362&id=363&id=364&id=365&id=366&id=367&id=368&id=369&id=370&id=371&id=372&id=373&id=374&id=375&id=376&id=377&id=378&id=379&id=380&id=381&id=382&id=383&id=384&id=385&id=386&id=387&id=388&id=389&id=390&id=391&id=392&id=393&id=394&id=395&id=396&id=397&id=398&id=399&id=400&id=401&id=402&id=403&id=404&id=405&id=406&id=407&id=408&id=409&id=410&id=411&id=412&id=413&id=414&id=415&id=416&id=417&id=418&id=419&id=420&id=421&id=422&id=423&id=424&id=425&id=426&id=427&id=428&id=429&id=430&id=431&id=432&id=433&id=434&id=435&id=436&id=437&id=438&id=439&id=440&id=441&id=442&id=443&id=444&id=445&id=446&id=447&id=448&id=449&id=450', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=351&id=352&id=353&id=354&id=355&id=356&id=357&id=358&id=359&id=360&id=361&id=362&id=363&id=364&id=365&id=366&id=367&id=368&id=369&id=370&id=371&id=372&id=373&id=374&id=375&id=376&id=377&id=378&id=379&id=380&id=381&id=382&id=383&id=384&id=385&id=386&id=387&id=388&id=389&id=390&id=391&id=392&id=393&id=394&id=395&id=396&id=397&id=398&id=399&id=400&id=401&id=402&id=403&id=404&id=405&id=406&id=407&id=408&id=409&id=410&id=411&id=412&id=413&id=414&id=415&id=416&id=417&id=418&id=419&id=420&id=421&id=422&id=423&id=424&id=425&id=426&id=427&id=428&id=429&id=430&id=431&id=432&id=433&id=434&id=435&id=436&id=437&id=438&id=439&id=440&id=441&id=442&id=443&id=444&id=445&id=446&id=447&id=448&id=449&id=450', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -1703,9 +1703,9 @@ const largeRecordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299&id=300', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299&id=300', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -1722,9 +1722,9 @@ const largeRecordOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2803,9 +2803,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=911&id=912&id=913&id=914&id=915&id=916&id=917&id=918&id=919&id=920', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=911&id=912&id=913&id=914&id=915&id=916&id=917&id=918&id=919&id=920', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2861,9 +2861,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=901&id=902&id=903&id=904&id=905&id=906&id=907&id=908&id=909&id=910', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=901&id=902&id=903&id=904&id=905&id=906&id=907&id=908&id=909&id=910', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2919,9 +2919,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=704&id=705&id=706', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=704&id=705&id=706', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2938,9 +2938,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=501&id=502&id=503', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=501&id=502&id=503', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2977,9 +2977,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -2996,9 +2996,9 @@ const mixedBatchOutput = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: TOKEN, + Authorization: AUTH_HEADER_TOKEN, 'Content-Type': CONTENT_TYPE, }, params: {}, @@ -3037,12 +3037,7 @@ const recordEventGenerator = (id, action, externalId) => { ID: '1zwa1wKshSt81YksKmUdJnr4IOK', Name: 'test_marketo_rc', DestinationDefinition: DEST_DEFINITION, - Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', - staticListId: 1122, - }, + Config: DEST_CONFIG, Enabled: true, Transformations: [], IsProcessorEnabled: true, diff --git a/src/v0/destinations/marketo_static_list/transform.test.js b/src/v0/destinations/marketo_static_list/transform.test.js deleted file mode 100644 index 3c387c42957..00000000000 --- a/src/v0/destinations/marketo_static_list/transform.test.js +++ /dev/null @@ -1,138 +0,0 @@ -const { processRouterDest } = require('./transform'); -const axios = require('axios'); -const MockAxiosAdapter = require('axios-mock-adapter'); -const { - recordInputs, - audiencelistInputs, - reqMetadata, - recordOutput, - largeRecordOutput, - mixedBatchOutput, - recordEventGenerator, -} = require('./testData/testData'); - -const mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); -beforeAll(() => { - mockAdapter - .onGet('https://marketo_acct_id_success.mktorest.com/identity/oauth/token') - .reply(200, { access_token: 'access_token_success' }); -}); -describe('Unit cases covering the router flow for both record and audiencelist event types', () => { - it('Sending a small batch of only record events (4 events)', async () => { - const inputs = recordInputs; - const result = await processRouterDest(inputs, reqMetadata); - - // assert that the result is as expected - expect(result.length).toEqual(3); - expect(result[0].batchedRequest.length).toEqual(1); // 1 batched request for 2 record events - expect(result[1].batchedRequest.length).toEqual(1); // 1 batched request for 1 record events - expect(result[2].batchedRequest.length).toEqual(1); // 1 batched request for 1 record events - expect(result[0].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', - ); // 1 api call for 2 leadIds - expect(result[1].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001', - ); // 1 api call for 1 leadId - expect(result[2].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', - ); // 1 api call for 1 leadId - expect(result[1].batchedRequest[0].method).toEqual('DELETE'); // DELETE requests are sent first - expect(result[0].metadata.length).toEqual(2); // 2 metadata objects for 2 record events - expect(result[1].metadata.length).toEqual(1); // 1 metadata object for 1 record event - expect(result[2].metadata.length).toEqual(1); // 1 metadata object for 1 record event - expect(result).toEqual(recordOutput); // overall result should be equal to the expected output - }); - - it('Sending a large batch of only record events (450 events: 350 inserts | 100 deletes )', async () => { - const largeRecordInputs = []; - for (let index = 0; index < 350; index++) { - largeRecordInputs.push(recordEventGenerator(index + 1, 'insert', 1122)); - } - for (let index = 350; index < 450; index++) { - largeRecordInputs.push(recordEventGenerator(index + 1, 'delete', 1122)); - } - const result = await processRouterDest(largeRecordInputs, reqMetadata); - - // assert that the result is as expected - /* - Total 3 API calls - 1. 1 API call for 100 DELETE requests - 2. 1 API call for 100 POST requests = limit reached for Marketo, leads split to next API call - 3. 1 API call for 50 POST requests - */ - expect(result.length).toEqual(2); - expect(result[0].batchedRequest.length).toEqual(1); // 1 batched request for 1 record event - expect(result[1].batchedRequest.length).toEqual(2); // 1 batched request for 2 record events - expect(result[0].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=351&id=352&id=353&id=354&id=355&id=356&id=357&id=358&id=359&id=360&id=361&id=362&id=363&id=364&id=365&id=366&id=367&id=368&id=369&id=370&id=371&id=372&id=373&id=374&id=375&id=376&id=377&id=378&id=379&id=380&id=381&id=382&id=383&id=384&id=385&id=386&id=387&id=388&id=389&id=390&id=391&id=392&id=393&id=394&id=395&id=396&id=397&id=398&id=399&id=400&id=401&id=402&id=403&id=404&id=405&id=406&id=407&id=408&id=409&id=410&id=411&id=412&id=413&id=414&id=415&id=416&id=417&id=418&id=419&id=420&id=421&id=422&id=423&id=424&id=425&id=426&id=427&id=428&id=429&id=430&id=431&id=432&id=433&id=434&id=435&id=436&id=437&id=438&id=439&id=440&id=441&id=442&id=443&id=444&id=445&id=446&id=447&id=448&id=449&id=450', - ); - expect(result[1].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299&id=300', - ); - expect(result[1].batchedRequest[1].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', - ); - expect(result[0].batchedRequest[0].method).toEqual('DELETE'); // DELETE requests are sent first - expect(result[1].batchedRequest[0].method).toEqual('POST'); - expect(result[1].batchedRequest[1].method).toEqual('POST'); - expect(result[0].metadata.length).toEqual(100); // 100 metadata objects for 100 record events - expect(result[1].metadata.length).toEqual(350); // 350 metadata objects for 350 record events - expect(result).toEqual(largeRecordOutput); // overall result should be equal to the expected output - }); - - it('Sending a mixed batch of record and audiencelist events (22 events: 10 inserts | 10 deletes | 2 audiencelist (⌐■_■) )', async () => { - const mixedBatchInputs = []; - for (let index = 900; index < 910; index++) { - mixedBatchInputs.push(recordEventGenerator(index + 1, 'insert', 1122)); - } - for (let index = 910; index < 920; index++) { - mixedBatchInputs.push(recordEventGenerator(index + 1, 'delete', 1122)); - } - mixedBatchInputs.push(...audiencelistInputs); - const result = await processRouterDest(mixedBatchInputs, reqMetadata); - - // assert that the result is as expected - /* - Total 4 API calls - 1. 1 API call for 10 DELETE requests - 2. 1 API call for 10 POST requests = limit reached for Marketo, leads split to next API call - 3. 1 API call for 2 POST requests - 4. 1 API call for 2 POST requests - */ - expect(result.length).toEqual(4); - expect(result[0].batchedRequest.length).toEqual(1); // 1 batched request for 1 record event - expect(result[1].batchedRequest.length).toEqual(1); // 1 batched request for 1 record event - expect(result[2].batchedRequest.length).toEqual(2); // 1 batched request for 2 audiencelist events - expect(result[3].batchedRequest.length).toEqual(2); // 1 batched request for 2 audiencelist events - expect(result[0].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=911&id=912&id=913&id=914&id=915&id=916&id=917&id=918&id=919&id=920', - ); - expect(result[1].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=901&id=902&id=903&id=904&id=905&id=906&id=907&id=908&id=909&id=910', - ); - expect(result[2].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=704&id=705&id=706', - ); - expect(result[2].batchedRequest[1].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=501&id=502&id=503', - ); - expect(result[3].batchedRequest[0].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', - ); - expect(result[2].batchedRequest[1].endpoint).toEqual( - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=501&id=502&id=503', - ); - expect(result[0].batchedRequest[0].method).toEqual('DELETE'); // DELETE requests are sent first - expect(result[1].batchedRequest[0].method).toEqual('POST'); - expect(result[1].batchedRequest[0].method).toEqual('POST'); - expect(result[2].batchedRequest[0].method).toEqual('DELETE'); - expect(result[0].metadata.length).toEqual(10); - expect(result[1].metadata.length).toEqual(10); - expect(result[2].metadata.length).toEqual(1); - expect(result[3].metadata.length).toEqual(1); - expect(result).toEqual(mixedBatchOutput); // overall result should be equal to the expected output - }); -}); -afterAll(() => { - mockAdapter.restore(); -}); diff --git a/src/v0/destinations/mp/util.test.js b/src/v0/destinations/mp/util.test.js index f749e0fc177..98c9b88201d 100644 --- a/src/v0/destinations/mp/util.test.js +++ b/src/v0/destinations/mp/util.test.js @@ -32,7 +32,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:1}]', + batch: JSON.stringify([{ prop: 1 }]), }, }, userId: 'user1', @@ -43,7 +43,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:2}]', + batch: JSON.stringify([{ prop: 2 }]), }, }, userId: 'user2', @@ -54,7 +54,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/groups', body: { JSON_ARRAY: { - batch: '[{prop:3}]', + batch: JSON.stringify([{ prop: 3 }]), }, }, userId: 'user1', @@ -65,7 +65,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/track', body: { JSON_ARRAY: { - batch: '[{prop:4}]', + batch: JSON.stringify([{ prop: 4 }]), }, }, userId: 'user1', @@ -76,7 +76,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/import', body: { JSON_ARRAY: { - batch: '[{prop:5}]', + batch: JSON.stringify([{ prop: 5 }]), }, }, userId: 'user2', @@ -92,7 +92,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:1}]', + batch: JSON.stringify([{ prop: 1 }]), }, }, userId: 'user1', @@ -103,7 +103,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{prop:2}]', + batch: JSON.stringify([{ prop: 2 }]), }, }, userId: 'user2', @@ -116,7 +116,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/groups', body: { JSON_ARRAY: { - batch: '[{prop:3}]', + batch: JSON.stringify([{ prop: 3 }]), }, }, userId: 'user1', @@ -129,7 +129,7 @@ describe('Unit test cases for groupEventsByEndpoint', () => { endpoint: '/import', body: { JSON_ARRAY: { - batch: '[{prop:5}]', + batch: JSON.stringify([{ prop: 5 }]), }, }, userId: 'user2', @@ -149,7 +149,7 @@ describe('Unit test cases for batchEvents', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{"prop":1}]', + batch: JSON.stringify([{ prop: 1 }]), }, }, headers: {}, @@ -163,7 +163,7 @@ describe('Unit test cases for batchEvents', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{"prop":2}]', + batch: JSON.stringify([{ prop: 2 }]), }, }, headers: {}, @@ -177,7 +177,7 @@ describe('Unit test cases for batchEvents', () => { endpoint: '/engage', body: { JSON_ARRAY: { - batch: '[{"prop":3}]', + batch: JSON.stringify([{ prop: 3 }]), }, }, headers: {}, @@ -194,7 +194,12 @@ describe('Unit test cases for batchEvents', () => { { batched: true, batchedRequest: { - body: { FORM: {}, JSON: {}, JSON_ARRAY: { batch: '[{"prop":1},{"prop":2}]' }, XML: {} }, + body: { + FORM: {}, + JSON: {}, + JSON_ARRAY: { batch: JSON.stringify([{ prop: 1 }, { prop: 2 }]) }, + XML: {}, + }, endpoint: '/engage', files: {}, headers: {}, @@ -210,7 +215,12 @@ describe('Unit test cases for batchEvents', () => { { batched: true, batchedRequest: { - body: { FORM: {}, JSON: {}, JSON_ARRAY: { batch: '[{"prop":3}]' }, XML: {} }, + body: { + FORM: {}, + JSON: {}, + JSON_ARRAY: { batch: JSON.stringify([{ prop: 3 }]) }, + XML: {}, + }, endpoint: '/engage', files: {}, headers: {}, @@ -237,13 +247,13 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { it('should generate a batched payload with GZIP payload for /import endpoint when given an array of events', () => { const events = [ { - body: { JSON_ARRAY: { batch: '[{"event": "event1"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event1' }]) } }, endpoint: '/import', headers: { 'Content-Type': 'application/json' }, params: {}, }, { - body: { JSON_ARRAY: { batch: '[{"event": "event2"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event2' }]) } }, endpoint: '/import', headers: { 'Content-Type': 'application/json' }, params: {}, @@ -256,7 +266,7 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { JSON_ARRAY: {}, XML: {}, GZIP: { - payload: '[{"event":"event1"},{"event":"event2"}]', + payload: JSON.stringify([{ event: 'event1' }, { event: 'event2' }]), }, }, endpoint: '/import', @@ -278,13 +288,13 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { it('should generate a batched payload with JSON_ARRAY body when given an array of events', () => { const events = [ { - body: { JSON_ARRAY: { batch: '[{"event": "event1"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event1' }]) } }, endpoint: '/endpoint', headers: { 'Content-Type': 'application/json' }, params: {}, }, { - body: { JSON_ARRAY: { batch: '[{"event": "event2"}]' } }, + body: { JSON_ARRAY: { batch: JSON.stringify([{ event: 'event2' }]) } }, endpoint: '/endpoint', headers: { 'Content-Type': 'application/json' }, params: {}, @@ -294,7 +304,7 @@ describe('Unit test cases for generateBatchedPayloadForArray', () => { body: { FORM: {}, JSON: {}, - JSON_ARRAY: { batch: '[{"event":"event1"},{"event":"event2"}]' }, + JSON_ARRAY: { batch: JSON.stringify([{ event: 'event1' }, { event: 'event2' }]) }, XML: {}, }, endpoint: '/endpoint', diff --git a/src/v0/destinations/sfmc/transform.test.js b/src/v0/destinations/sfmc/transform.test.js index e182fb0d78a..12bcce4579e 100644 --- a/src/v0/destinations/sfmc/transform.test.js +++ b/src/v0/destinations/sfmc/transform.test.js @@ -1,4 +1,4 @@ -const { ConfigurationError } = require('@rudderstack/integrations-lib'); +const { ConfigurationError, generateRandomString } = require('@rudderstack/integrations-lib'); const axios = require('axios'); const MockAxiosAdapter = require('axios-mock-adapter'); const { responseBuilderSimple, responseBuilderForMessageEvent } = require('./transform'); @@ -6,7 +6,7 @@ beforeAll(() => { const mock = new MockAxiosAdapter(axios); mock .onPost('https://yourSubDomain.auth.marketingcloudapis.com/v2/token') - .reply(200, '{"access_token":"yourAuthToken"}'); + .reply(200, JSON.stringify({ access_token: 'yourAuthToken' })); }); describe('responseBuilderSimple', () => { @@ -134,7 +134,7 @@ describe('responseBuilderSimple', () => { }, }; const subDomain = 'subdomain'; - const authToken = 'token'; + const authToken = generateRandomString(); const hashMapEventDefinition = { testevent: 'eventDefinitionKey', }; @@ -151,7 +151,7 @@ describe('responseBuilderSimple', () => { ); expect(response.headers).toEqual({ 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: `Bearer ${authToken}`, }); expect(response.body.JSON).toEqual({ ContactKey: '12345', diff --git a/src/v0/destinations/snapchat_conversion/util.test.js b/src/v0/destinations/snapchat_conversion/util.test.js index d886b8f981e..05bd0cdbef0 100644 --- a/src/v0/destinations/snapchat_conversion/util.test.js +++ b/src/v0/destinations/snapchat_conversion/util.test.js @@ -1,3 +1,4 @@ +const { generateRandomString } = require('@rudderstack/integrations-lib'); const { msUnixTimestamp, getItemIds, @@ -283,6 +284,7 @@ describe('getDataUseValue', () => { }); describe('generateBatchedPayloadForArray', () => { + const apiKey = generateRandomString(); const testCases = [ { name: 'should generate batched payload with correct structure', @@ -290,14 +292,14 @@ describe('generateBatchedPayloadForArray', () => { events: [{ body: { JSON: { event: 1 } } }, { body: { JSON: { event: 2 } } }], destination: { Config: { - apiKey: 'test-api-key', + apiKey, }, }, }, expected: { headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer test-api-key', + Authorization: `Bearer ${apiKey}`, }, endpoint: 'https://tr.snapchat.com/v2/conversion', body: { @@ -313,14 +315,14 @@ describe('generateBatchedPayloadForArray', () => { events: [], destination: { Config: { - apiKey: 'test-api-key', + apiKey, }, }, }, expected: { headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer test-api-key', + Authorization: `Bearer ${apiKey}`, }, endpoint: 'https://tr.snapchat.com/v2/conversion', body: { diff --git a/test/__mocks__/data/marketo_static_list/proxy_response.json b/test/__mocks__/data/marketo_static_list/proxy_response.json index 290a4f5fbf6..c80777db68a 100644 --- a/test/__mocks__/data/marketo_static_list/proxy_response.json +++ b/test/__mocks__/data/marketo_static_list/proxy_response.json @@ -1,5 +1,5 @@ { - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=110&id=111&id=112": { "data": { "requestId": "b6d1#18a8d2c10e7", "result": [ @@ -26,7 +26,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3": { "data": { "requestId": "68d8#1846058ee27", "success": false, @@ -39,7 +39,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2": { "data": { "requestId": "12d3c#1846057dce2", "result": [ @@ -56,7 +56,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=3&id=4": { "data": { "requestId": "12d3c#1846057dce2", "result": [ @@ -79,7 +79,7 @@ }, "status": 200 }, - "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6": { + "https://marketo_static_list_unit_test_success.mktorest.com/rest/v1/lists/1122/leads.json?id=5&id=6": { "data": { "requestId": "12d3c#1846057dce2", "result": { diff --git a/test/__tests__/data/marketo_static_list_proxy_input.json b/test/__tests__/data/marketo_static_list_proxy_input.json index 6f84e7416dc..86c458c0806 100644 --- a/test/__tests__/data/marketo_static_list_proxy_input.json +++ b/test/__tests__/data/marketo_static_list_proxy_input.json @@ -1,7 +1,7 @@ [ { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=110&id=111&id=112", "method": "POST", "userId": "", "headers": { @@ -21,7 +21,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2&id=3", "method": "POST", "userId": "", "headers": { @@ -41,7 +41,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1&id=2", "method": "POST", "userId": "", "headers": { @@ -75,7 +75,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=3&id=4", "method": "POST", "userId": "", "headers": { @@ -116,7 +116,7 @@ }, { "type": "REST", - "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6", + "endpoint": "https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=5&id=6", "method": "POST", "userId": "", "headers": { diff --git a/test/__tests__/data/warehouse/flatten_event_properties.js b/test/__tests__/data/warehouse/flatten_event_properties.js index 844d01744ec..0c34349180a 100644 --- a/test/__tests__/data/warehouse/flatten_event_properties.js +++ b/test/__tests__/data/warehouse/flatten_event_properties.js @@ -86,7 +86,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -106,12 +106,12 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_bool: true, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map: - '{"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}' + JSON.stringify({"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}) }, columnTypes: { int_prop: "int", @@ -136,7 +136,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -156,13 +156,13 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}' + JSON.stringify({"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}) }, columnTypes: { int_prop: "int", @@ -280,7 +280,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -300,12 +300,12 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_bool: true, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map: - '{"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}' + JSON.stringify({"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}) }, columnTypes: { int_prop: "int", @@ -330,7 +330,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -350,13 +350,13 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}' + JSON.stringify({"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}) }, columnTypes: { int_prop: "int", @@ -476,7 +476,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -496,12 +496,12 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_bool: true, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map: - '{"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}' + JSON.stringify({"thirdLevelString":"third level","thirdLevelMap":{"fourthLevelInt":4}}) }, columnTypes: { int_prop: "int", @@ -526,7 +526,7 @@ const sampleEvents = { object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4}' + JSON.stringify({"fourthLevelInt":4}) }, columnTypes: { int_prop: "int", @@ -546,13 +546,13 @@ const sampleEvents = { int_prop: 0, float_prop: 2.2, string_prop: "zero", - array_prop: '["zero","level"]', + array_prop: JSON.stringify(["zero","level"]), object_prop_first_level_int: 1, object_prop_first_level_map_second_level_array: ["second", "level"], object_prop_first_level_map_second_level_map_third_level_string: "third level", object_prop_first_level_map_second_level_map_third_level_map: - '{"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}' + JSON.stringify({"fourthLevelInt":4,"fourthLevelMap":{"fifthLevelString":"fifth level"}}) }, columnTypes: { int_prop: "int", diff --git a/test/__tests__/data/warehouse/integration_options_events.js b/test/__tests__/data/warehouse/integration_options_events.js index b3f076851b9..aacf9abd5c2 100644 --- a/test/__tests__/data/warehouse/integration_options_events.js +++ b/test/__tests__/data/warehouse/integration_options_events.js @@ -323,10 +323,10 @@ const sampleEvents = { path_to_$1_000_000: "None", _9omega: true, camelcase123key: "camel case", - testmap_nestedmap: '{"n1":"nested prop 1"}', + testmap_nestedmap: JSON.stringify({"n1":"nested prop 1"}), tmap_t1: 10, tmap_t2: 20, - testarray: '["This is","an","array"]', + testarray: JSON.stringify(["This is","an","array"]), context_app_build: "1.0.0", context_app_name: "RudderLabs JavaScript SDK", context_app_namespace: "com.rudderlabs.javascript", @@ -406,9 +406,9 @@ const sampleEvents = { PATH_TO_$1_000_000: "None", _9OMEGA: true, CAMELCASE123KEY: "camel case", - TESTMAP_NESTEDMAP: '{"n1":"nested prop 1"}', - TMAP: '{"t1":10,"t2":20}', - TESTARRAY: '["This is","an","array"]', + TESTMAP_NESTEDMAP: JSON.stringify({"n1":"nested prop 1"}), + TMAP: JSON.stringify({"t1":10,"t2":20}), + TESTARRAY: JSON.stringify(["This is","an","array"]), CONTEXT_APP_BUILD: "1.0.0", CONTEXT_APP_NAME: "RudderLabs JavaScript SDK", CONTEXT_APP_NAMESPACE: "com.rudderlabs.javascript", @@ -488,9 +488,9 @@ const sampleEvents = { PATH_TO_$1_000_000: "None", _9OMEGA: true, CAMELCASE123KEY: "camel case", - TESTMAP_NESTEDMAP: '{"n1":"nested prop 1"}', - TMAP: '{"t1":10,"t2":20}', - TESTARRAY: '["This is","an","array"]', + TESTMAP_NESTEDMAP: JSON.stringify({"n1":"nested prop 1"}), + TMAP: JSON.stringify({"t1":10,"t2":20}), + TESTARRAY: JSON.stringify(["This is","an","array"]), CONTEXT_APP_BUILD: "1.0.0", CONTEXT_APP_NAME: "RudderLabs JavaScript SDK", CONTEXT_APP_NAMESPACE: "com.rudderlabs.javascript", @@ -784,9 +784,9 @@ const sampleEvents = { path_to_1_000_000: "None", _9_omega: true, camel_case_123_key: "camel case", - test_map_nested_map: '{"n1":"nested prop 1"}', - t_map: '{"t1":10,"t2":20}', - test_array: '["This is","an","array"]', + test_map_nested_map: JSON.stringify({"n1":"nested prop 1"}), + t_map: JSON.stringify({"t1":10,"t2":20}), + test_array: JSON.stringify(["This is","an","array"]), context_app_build: "1.0.0", context_app_name: "RudderLabs JavaScript SDK", context_app_namespace: "com.rudderlabs.javascript", diff --git a/test/__tests__/shopify_warehouse.test.js b/test/__tests__/shopify_warehouse.test.js index 080022680bb..b7c1fbf59fb 100644 --- a/test/__tests__/shopify_warehouse.test.js +++ b/test/__tests__/shopify_warehouse.test.js @@ -62,10 +62,10 @@ describe('DATA_WAREHOUSE integrations', () => { expect(responses[1].metadata.table).toBe('ORDER_UPDATED'); expect(responses[0].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); - expect(responses[0].data.CONTEXT_SHOPIFY_DETAILS).toBe('{"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null}'); + expect(responses[0].data.CONTEXT_SHOPIFY_DETAILS).toBe(JSON.stringify({"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null})); expect(responses[1].metadata.columns.CONTEXT_SHOPIFY_DETAILS).toBe('json'); - expect(responses[1].data.CONTEXT_SHOPIFY_DETAILS).toBe('{"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null}'); + expect(responses[1].data.CONTEXT_SHOPIFY_DETAILS).toBe(JSON.stringify({"id":5778367414385,"current_total_tax":"10.00","current_total_tax_set":{"shop_money":{"amount":"10.00","currency_code":"USD"}},"name":"#1017","phone":null})); }); it('should process event and return response for other providers like mssql', () => { diff --git a/test/integrations/common/criteo/network.ts b/test/integrations/common/criteo/network.ts index cd5e1ca1e81..b1ce915c86f 100644 --- a/test/integrations/common/criteo/network.ts +++ b/test/integrations/common/criteo/network.ts @@ -1,5 +1,6 @@ +import { defaultAccessTokenAuthHeader } from '../secrets'; const headers = { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/common/secrets.ts b/test/integrations/common/secrets.ts new file mode 100644 index 00000000000..a8fcb84b9aa --- /dev/null +++ b/test/integrations/common/secrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const defaultAccessToken = path.basename(__dirname) + 'AccessToken'; +export const defaultAccessTokenAuthHeader = `Bearer ${defaultAccessToken}`; diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index cfcd1d56f2d..7c9ecfc0f98 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -7,16 +7,15 @@ import axios from 'axios'; import bodyParser from 'koa-bodyparser'; import { Command } from 'commander'; import { createHttpTerminator } from 'http-terminator'; -import { ExtendedTestCaseData, MockHttpCallsData, TestCaseData } from './testTypes'; +import { ExtendedTestCaseData, TestCaseData } from './testTypes'; import { applicationRoutes } from '../../src/routes/index'; import MockAxiosAdapter from 'axios-mock-adapter'; import { getTestDataFilePaths, getTestData, - getMockHttpCallsData, - getAllTestMockDataFilePaths, - addMock, + registerAxiosMocks, validateTestWithZOD, + getTestMockData, } from './testUtils'; import tags from '../../src/v0/util/tags'; import { Server } from 'http'; @@ -91,24 +90,6 @@ afterAll(async () => { appendFileSync(join(__dirname, 'destinations', opts.destination, 'network.ts'), calls); } }); -let mockAdapter; -if (!opts.generate || opts.generate === 'false') { - // unmock already existing axios-mocking - mockAdapter = new MockAxiosAdapter(axios, { onNoMatch: 'throwException' }); - const registerAxiosMocks = (axiosMocks: MockHttpCallsData[]) => { - axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); - }; - - // // all the axios requests will be stored in this map - const allTestMockDataFilePaths = getAllTestMockDataFilePaths(__dirname, opts.destination); - const allAxiosRequests = allTestMockDataFilePaths - .map((currPath) => { - const mockNetworkCallsData: MockHttpCallsData[] = getMockHttpCallsData(currPath); - return mockNetworkCallsData; - }) - .flat(); - registerAxiosMocks(allAxiosRequests); -} // END const rootDir = __dirname; @@ -214,13 +195,14 @@ const sourceTestHandler = async (tcData) => { await testRoute(route, tcData); }; -// Trigger the test suites +const mockAdapter = new MockAxiosAdapter(axios as any, { onNoMatch: 'throwException' }); +registerAxiosMocks(mockAdapter, getTestMockData(opts.destination || opts.source)); + describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { beforeEach(() => { jest.resetAllMocks(); jest.clearAllMocks(); }); - // add special mocks for specific destinations let testData: TestCaseData[] = getTestData(testDataPath); if (opts.index !== undefined) { testData = [testData[parseInt(opts.index)]]; diff --git a/test/integrations/destinations/adj/processor/data.ts b/test/integrations/destinations/adj/processor/data.ts index e28a25cf59d..310a644fa73 100644 --- a/test/integrations/destinations/adj/processor/data.ts +++ b/test/integrations/destinations/adj/processor/data.ts @@ -105,8 +105,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -462,8 +468,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -933,8 +945,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1062,8 +1080,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1191,8 +1215,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.37, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1433,8 +1463,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.37, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -1681,8 +1717,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -2053,8 +2095,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), partner_params: { 'partnerParamKey-1': 'value1', 'partnerParamKey-2': 'value2', diff --git a/test/integrations/destinations/adj/router/data.ts b/test/integrations/destinations/adj/router/data.ts index 22c4e899d2f..c4d3670c8a8 100644 --- a/test/integrations/destinations/adj/router/data.ts +++ b/test/integrations/destinations/adj/router/data.ts @@ -110,8 +110,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, android_id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', gps_adid: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', @@ -279,8 +285,14 @@ export const data = [ endpoint: 'https://s2s.adjust.com/event', headers: { Accept: '*/*' }, params: { - callback_params: - '{"key1":"value1","key2":"value2","key3.k4":"v4","key3.k5.k6":"v6","key5[0].k":"v1","key5[1].k":"v2"}', + callback_params: JSON.stringify({ + key1: 'value1', + key2: 'value2', + 'key3.k4': 'v4', + 'key3.k5.k6': 'v6', + 'key5[0].k': 'v1', + 'key5[1].k': 'v2', + }), revenue: 20.38, idfv: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', idfa: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', diff --git a/test/integrations/destinations/af/deleteUsers/data.ts b/test/integrations/destinations/af/deleteUsers/data.ts index 608e7e55869..3309d0505e1 100644 --- a/test/integrations/destinations/af/deleteUsers/data.ts +++ b/test/integrations/destinations/af/deleteUsers/data.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; import { cloneDeep } from 'lodash'; import { FEATURES } from '../../../../../src/v0/util/tags'; import { networkCallsData } from '../network'; @@ -28,7 +29,7 @@ const requests = [ ], config: { devKey: 'ef1d42390426e3f7c90ac78272e74344', - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -54,7 +55,7 @@ const requests = [ appleAppId: '123456789', statusCallbackUrls: 'https://examplecontroller.com/opengdpr_callbacks,https://examplecontroller.com/opengdpr_callbacks,https://examplecontroller.com/opengdpr_callbacks,https://examplecontroller.com/opengdpr_callbacks', - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -82,7 +83,7 @@ const requests = [ groupValueTrait: 'age', trackProductsOnce: false, trackRevenuePerProduct: false, - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -110,7 +111,7 @@ const requests = [ groupValueTrait: 'age', trackProductsOnce: false, trackRevenuePerProduct: false, - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -138,7 +139,7 @@ const requests = [ groupValueTrait: 'age', trackProductsOnce: false, trackRevenuePerProduct: false, - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -230,7 +231,7 @@ export const data = [ devKey: 'ef1d42390426e3f7c90ac78272e74344', appleAppId: '123456789', androidAppId: 'AnAID', - apiToken: 'dummyApiToken', + apiToken: secret1, }, }, ], @@ -274,7 +275,7 @@ export const data = [ devKey: 'ef1d42390426e3f7c90ac78272e74344', appleAppId: '123456789', androidAppId: 'AnAID', - apiToken: 'dummyApiToken', + apiToken: secret1, statusCallbackUrls: 'https://examplecontroller.com/opengdpr_callbacks', }, }, diff --git a/test/integrations/destinations/af/maskedSecrets.ts b/test/integrations/destinations/af/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/af/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/af/network.ts b/test/integrations/destinations/af/network.ts index 2e9557539e1..027887a5d5d 100644 --- a/test/integrations/destinations/af/network.ts +++ b/test/integrations/destinations/af/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; import { JSON_MIME_TYPE } from '../../../../src/v0/util/constant'; export const networkCallsData = [ @@ -8,7 +9,7 @@ export const networkCallsData = [ headers: { 'Content-Type': JSON_MIME_TYPE, - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, }, data: { subject_request_type: 'erasure', @@ -56,7 +57,7 @@ export const networkCallsData = [ headers: { 'Content-Type': JSON_MIME_TYPE, - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/af/processor/data.ts b/test/integrations/destinations/af/processor/data.ts index dacef389431..16f28cbcb67 100644 --- a/test/integrations/destinations/af/processor/data.ts +++ b/test/integrations/destinations/af/processor/data.ts @@ -197,7 +197,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -281,8 +287,12 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"user_actual_role":"system_admin, system_user","user_actual_id":12345}}', + eventValue: JSON.stringify({ + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -546,7 +556,13 @@ export const existingTestCases = [ JSON: { bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'some_other2345_sample_external_id', os: '', @@ -638,7 +654,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -726,7 +748,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -796,8 +824,48 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -881,8 +949,27 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":25,"af_quantity":2,"af_order_id":"50314b8e9bcf000000000000"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: 25, + af_quantity: 2, + af_order_id: '50314b8e9bcf000000000000', + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1020,8 +1107,47 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_quantity":2,"af_price":25,"af_currency":"ZAR"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_quantity: 2, + af_price: 25, + af_currency: 'ZAR', + }), eventName: 'normal track event', eventTime: '2020-08-14T05:30:30.118Z', eventCurrency: 'ZAR', @@ -1272,7 +1398,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1365,7 +1497,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1535,7 +1673,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1621,8 +1765,10 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"user_actual_role":"system_admin, system_user","user_actual_id":12345}', + eventValue: JSON.stringify({ + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -1696,8 +1842,46 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1788,8 +1972,51 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"prop1":"value1","prop2":"value2","properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","Prop3":"value3"},"af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + Prop3: 'value3', + }, + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', diff --git a/test/integrations/destinations/af/processor/validation.ts b/test/integrations/destinations/af/processor/validation.ts index b36cd7d15da..ed34cae6925 100644 --- a/test/integrations/destinations/af/processor/validation.ts +++ b/test/integrations/destinations/af/processor/validation.ts @@ -235,7 +235,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -319,8 +325,12 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"user_actual_role":"system_admin, system_user","user_actual_id":12345}}', + eventValue: JSON.stringify({ + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -584,7 +594,13 @@ export const existingTestCases = [ JSON: { bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'some_other2345_sample_external_id', os: '', @@ -676,7 +692,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -764,7 +786,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -834,8 +862,48 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -919,8 +987,27 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_price":25,"af_quantity":2,"af_order_id":"50314b8e9bcf000000000000"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_price: 25, + af_quantity: 2, + af_order_id: '50314b8e9bcf000000000000', + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1058,8 +1145,47 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"properties":{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f"},"af_revenue":48,"af_quantity":2,"af_price":25,"af_currency":"ZAR"}', + eventValue: JSON.stringify({ + properties: { + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + }, + af_revenue: 48, + af_quantity: 2, + af_price: 25, + af_currency: 'ZAR', + }), eventName: 'normal track event', eventTime: '2020-08-14T05:30:30.118Z', eventCurrency: 'ZAR', @@ -1310,7 +1436,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1403,7 +1535,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1573,7 +1711,13 @@ export const existingTestCases = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -1659,8 +1803,10 @@ export const existingTestCases = [ params: {}, body: { JSON: { - eventValue: - '{"user_actual_role":"system_admin, system_user","user_actual_id":12345}', + eventValue: JSON.stringify({ + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }), eventName: 'test track event HS', customer_user_id: '12345', ip: '0.0.0.0', @@ -1734,8 +1880,46 @@ export const existingTestCases = [ body: { JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', eventTime: '2020-08-14T05:30:30.118Z', @@ -1974,8 +2158,46 @@ export const newConfigValidationTests: ProcessorTestData[] = [ JSON: { customer_user_id: 'default-user-id', bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', appsflyer_id: 'afUid', @@ -2034,8 +2256,46 @@ export const newConfigValidationTests: ProcessorTestData[] = [ headers: { ...commonHeader, authentication: 'dummy' }, JSON: { bundleIdentifier: 'com.rudderlabs.javascript', - eventValue: - '{"tax":2,"total":27.5,"coupon":"hasbros","revenue":48,"price":25,"quantity":2,"currency":"ZAR","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"sku":"45790-32","url":"https://www.example.com/product/path","name":"Monopoly: 3rd Edition","price":19,"category":"Games","quantity":1,"image_url":"https:///www.example.com/product/path.jpg","product_id":"507f1f77bcf86cd799439011"},{"sku":"46493-32","name":"Uno Card Game","price":3,"category":"Games","quantity":2,"product_id":"505bd76785ebb509fc183733"}],"shipping":3,"subtotal":22.5,"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","af_revenue":48,"af_price":[19,3],"af_quantity":[1,2],"af_order_id":"50314b8e9bcf000000000000","af_content_id":["507f1f77bcf86cd799439011","505bd76785ebb509fc183733"]}', + eventValue: JSON.stringify({ + tax: 2, + total: 27.5, + coupon: 'hasbros', + revenue: 48, + price: 25, + quantity: 2, + currency: 'ZAR', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + sku: '45790-32', + url: 'https://www.example.com/product/path', + name: 'Monopoly: 3rd Edition', + price: 19, + category: 'Games', + quantity: 1, + image_url: 'https:///www.example.com/product/path.jpg', + product_id: '507f1f77bcf86cd799439011', + }, + { + sku: '46493-32', + name: 'Uno Card Game', + price: 3, + category: 'Games', + quantity: 2, + product_id: '505bd76785ebb509fc183733', + }, + ], + shipping: 3, + subtotal: 22.5, + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + af_revenue: 48, + af_price: [19, 3], + af_quantity: [1, 2], + af_order_id: '50314b8e9bcf000000000000', + af_content_id: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'], + }), eventName: 'Order Completed', eventCurrency: 'ZAR', customer_user_id: 'default-user-id', diff --git a/test/integrations/destinations/af/router/data.ts b/test/integrations/destinations/af/router/data.ts index b6dca3a75ec..4e67d1953f3 100644 --- a/test/integrations/destinations/af/router/data.ts +++ b/test/integrations/destinations/af/router/data.ts @@ -165,7 +165,13 @@ export const data = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', @@ -204,8 +210,12 @@ export const data = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: - '{"properties":{"user_actual_role":"system_admin, system_user","user_actual_id":12345}}', + eventValue: JSON.stringify({ + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + }), eventName: 'test track event HS', appsflyer_id: 'afUid', os: '', @@ -244,7 +254,13 @@ export const data = [ app_version_name: '1.0.0', bundleIdentifier: 'com.rudderlabs.javascript', customer_user_id: '12345', - eventValue: '{"path":"","referrer":"","search":"","title":"","url":""}', + eventValue: JSON.stringify({ + path: '', + referrer: '', + search: '', + title: '', + url: '', + }), eventName: 'page', appsflyer_id: 'afUid', os: '', diff --git a/test/integrations/destinations/airship/maskedSecrets.ts b/test/integrations/destinations/airship/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/airship/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/airship/processor/business.ts b/test/integrations/destinations/airship/processor/business.ts index 0fbf140720c..0ee0beb8f24 100644 --- a/test/integrations/destinations/airship/processor/business.ts +++ b/test/integrations/destinations/airship/processor/business.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; const arrayHandlingCases = [ { description: @@ -55,7 +56,7 @@ const arrayHandlingCases = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -144,7 +145,7 @@ const arrayHandlingCases = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -213,7 +214,7 @@ const getIdentifyTestCase = ({ description, inputEvent, expectedOutputResponse } message: inputEvent, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, diff --git a/test/integrations/destinations/airship/processor/data.ts b/test/integrations/destinations/airship/processor/data.ts index cd1a7fac9b7..20e07f57596 100644 --- a/test/integrations/destinations/airship/processor/data.ts +++ b/test/integrations/destinations/airship/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { identifyTestCases } from './business'; export const data = [ @@ -54,7 +55,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -78,7 +79,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'O2YARRI15I', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -165,7 +166,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -246,7 +247,7 @@ export const data = [ sentAt: '2019-10-14T09:03:22.563Z', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -325,7 +326,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: true, }, @@ -349,7 +350,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'O2YARRI15I', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -428,7 +429,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -451,7 +452,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -552,7 +553,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -575,7 +576,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -643,7 +644,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false, }, @@ -666,7 +667,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -693,7 +694,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -809,7 +810,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: true }, + Config: { apiKey: secret1, dataCenter: true }, }, }, ], @@ -829,7 +830,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -856,7 +857,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -957,7 +958,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', appSecret: 'fhf', dataCenter: true, @@ -1030,7 +1031,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1050,7 +1051,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1150,7 +1151,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1170,7 +1171,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1237,7 +1238,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1257,7 +1258,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1284,7 +1285,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1400,7 +1401,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: true }, + Config: { apiKey: secret1, dataCenter: true }, }, }, ], @@ -1420,7 +1421,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1447,7 +1448,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1548,7 +1549,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'O2YARRI15I', appSecret: 'fhf', dataCenter: true, @@ -1624,7 +1625,7 @@ export const data = [ version: '1', }, destination: { - Config: { apiKey: 'dummyApiKey', dataCenter: false }, + Config: { apiKey: secret1, dataCenter: false }, }, }, ], @@ -1644,7 +1645,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1671,7 +1672,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1890,7 +1891,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', appSecret: 'fhf', dataCenter: false, @@ -1915,7 +1916,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1961,7 +1962,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', appSecret: 'fhf', dataCenter: false, @@ -1986,7 +1987,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2049,7 +2050,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2073,7 +2074,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2136,7 +2137,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2160,7 +2161,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2341,7 +2342,7 @@ export const data = [ sentAt: '2019-10-14T09:03:22.563Z', }, destination: { - Config: { appKey: 'dummyApiKey', dataCenter: false }, + Config: { appKey: secret1, dataCenter: false }, }, }, ], @@ -2407,7 +2408,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2431,7 +2432,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2494,7 +2495,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2518,7 +2519,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2582,7 +2583,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2606,7 +2607,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2669,7 +2670,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appKey: 'ffdf', dataCenter: false, }, @@ -2693,7 +2694,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'ffdf', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/airship/router/data.ts b/test/integrations/destinations/airship/router/data.ts index df500d7413c..ea63b789e71 100644 --- a/test/integrations/destinations/airship/router/data.ts +++ b/test/integrations/destinations/airship/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'airship', @@ -11,7 +12,7 @@ export const data = [ input: [ { destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, metadata: { jobId: 1, userId: 'u1' }, message: { @@ -76,7 +77,7 @@ export const data = [ 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', 'X-UA-Appkey': 'O2YARRI15I', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -109,7 +110,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, }, ], @@ -129,7 +130,7 @@ export const data = [ input: [ { destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, metadata: { jobId: 2, userId: 'u1' }, message: { @@ -188,7 +189,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -211,7 +212,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -285,7 +286,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', appKey: 'O2YARRI15I', dataCenter: false }, + Config: { apiKey: secret1, appKey: 'O2YARRI15I', dataCenter: false }, }, }, ], @@ -304,7 +305,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: 'dummyApiKey', dataCenter: false } }, + destination: { Config: { apiKey: secret1, dataCenter: false } }, metadata: { jobId: 3, userId: 'u1' }, message: { anonymousId: '507f191e810c19729de860ea', @@ -362,7 +363,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -385,7 +386,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/vnd.urbanairship+json; version=3', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -458,7 +459,7 @@ export const data = [ metadata: [{ jobId: 3, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', dataCenter: false } }, + destination: { Config: { apiKey: secret1, dataCenter: false } }, }, ], }, diff --git a/test/integrations/destinations/algolia/dataDelivery/business.ts b/test/integrations/destinations/algolia/dataDelivery/business.ts index 8ba964e2ddb..1f09d5854b8 100644 --- a/test/integrations/destinations/algolia/dataDelivery/business.ts +++ b/test/integrations/destinations/algolia/dataDelivery/business.ts @@ -1,6 +1,8 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; import { abortStatTags, commonRequestProperties, metadataArray, retryStatTags } from './constant'; +import { defaultAccessToken } from '../../../common/secrets'; + const proxyMetdata3 = { jobId: 3, attemptNum: 1, @@ -214,8 +216,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'ALGOLIA: Error transformer proxy v1 during ALGOLIA response transformation', response: [ { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 1, attemptNum: 1, @@ -224,7 +228,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -277,8 +281,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'ALGOLIA: Error transformer proxy v1 during ALGOLIA response transformation', response: [ { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 1, attemptNum: 1, @@ -292,8 +298,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ statusCode: 500, }, { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 2, attemptNum: 1, @@ -307,8 +315,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ statusCode: 500, }, { - error: - '{"status":422,"message":"EventType must be one of \\"click\\", \\"conversion\\" or \\"view\\""}', + error: JSON.stringify({ + status: 422, + message: `EventType must be one of "click", "conversion" or "view"`, + }), metadata: { jobId: 3, attemptNum: 1, diff --git a/test/integrations/destinations/algolia/dataDelivery/other.ts b/test/integrations/destinations/algolia/dataDelivery/other.ts index f5ccc703378..27f927fae58 100644 --- a/test/integrations/destinations/algolia/dataDelivery/other.ts +++ b/test/integrations/destinations/algolia/dataDelivery/other.ts @@ -1,6 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; - +import { defaultAccessToken } from '../../../common/secrets'; export const otherScenariosV0 = [ { id: 'algolia_v0_other_scenario_1', @@ -258,8 +258,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: { jobId: 1, @@ -269,7 +274,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -326,7 +331,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -383,7 +388,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -440,7 +445,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, @@ -498,7 +503,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: true, }, diff --git a/test/integrations/destinations/am/batch/data.ts b/test/integrations/destinations/am/batch/data.ts index 91a17606a90..c7217956c27 100644 --- a/test/integrations/destinations/am/batch/data.ts +++ b/test/integrations/destinations/am/batch/data.ts @@ -416,7 +416,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -449,7 +458,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -557,7 +571,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -592,7 +615,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -1046,7 +1074,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -1079,7 +1116,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -1185,7 +1227,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -1220,7 +1271,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -2370,7 +2426,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -2403,7 +2468,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -2511,7 +2581,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -2546,7 +2625,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -3009,7 +3093,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -3042,7 +3135,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, @@ -3149,7 +3247,16 @@ export const data = [ FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', identification: [ - '{"group_type":"Company","group_value":"Comapny-ABC","group_properties":{"KEY_2":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"KEY_3":{"CHILD_KEY_102":"value_103","CHILD_KEY_92":"value_95"},"name_trait":"Company","value_trait":"Comapny-ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'Comapny-ABC', + group_properties: { + KEY_2: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + KEY_3: { CHILD_KEY_102: 'value_103', CHILD_KEY_92: 'value_95' }, + name_trait: 'Company', + value_trait: 'Comapny-ABC', + }, + }), ], }, JSON: {}, @@ -3184,7 +3291,12 @@ export const data = [ JSON_ARRAY: {}, FORM: { api_key: '4c7ed7573eb73517ee4c26ed4bde9a85', - mapping: ['{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3"}'], + mapping: [ + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + }), + ], }, JSON: {}, }, diff --git a/test/integrations/destinations/am/deleteUsers/data.ts b/test/integrations/destinations/am/deleteUsers/data.ts index 3431df980e5..7092cc13ab9 100644 --- a/test/integrations/destinations/am/deleteUsers/data.ts +++ b/test/integrations/destinations/am/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'am', @@ -374,8 +376,8 @@ export const data = [ }, ], config: { - apiKey: '1234', - apiSecret: 'abcd', + apiKey: secret1, + apiSecret: secret2, }, }, ], @@ -414,8 +416,8 @@ export const data = [ }, ], config: { - apiKey: '1234', - apiSecret: 'abcd', + apiKey: secret1, + apiSecret: secret2, residencyServer: 'EU', }, }, diff --git a/test/integrations/destinations/am/maskedSecrets.ts b/test/integrations/destinations/am/maskedSecrets.ts new file mode 100644 index 00000000000..9ff6062bfd4 --- /dev/null +++ b/test/integrations/destinations/am/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/am/network.ts b/test/integrations/destinations/am/network.ts index 19181e50662..5fe8e4ebfd7 100644 --- a/test/integrations/destinations/am/network.ts +++ b/test/integrations/destinations/am/network.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -111,7 +113,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -154,7 +156,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -174,7 +176,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -194,7 +196,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { @@ -216,7 +218,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic MTIzNDphYmNk', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/am/processor/data.ts b/test/integrations/destinations/am/processor/data.ts index 01f9feb44a3..eda651b9517 100644 --- a/test/integrations/destinations/am/processor/data.ts +++ b/test/integrations/destinations/am/processor/data.ts @@ -1,3 +1,5 @@ +import { secret2 } from '../maskedSecrets'; + export const data = [ { name: 'am', @@ -47,7 +49,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -105,7 +107,7 @@ export const data = [ destination: { Config: { groupTypeTrait: 'email', - apiKey: 'abcde', + apiKey: secret2, groupValueTrait: 'age', trackProductsOnce: true, trackRevenuePerProduct: false, @@ -239,7 +241,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -266,7 +268,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -382,7 +384,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -409,7 +411,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -573,7 +575,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -603,7 +605,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -757,7 +759,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -782,7 +784,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -910,7 +912,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -935,7 +937,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1058,7 +1060,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1081,7 +1083,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1213,7 +1215,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1236,7 +1238,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1361,7 +1363,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1384,7 +1386,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1512,7 +1514,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1535,7 +1537,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -1615,7 +1617,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1638,7 +1640,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -1703,7 +1705,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1726,7 +1728,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -1791,7 +1793,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1814,7 +1816,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -1878,7 +1880,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -1901,7 +1903,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '123456', @@ -2027,7 +2029,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2050,7 +2052,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -2108,8 +2110,8 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', - identification: ['{"group_type":"Company","group_value":"ABC"}'], + api_key: secret2, + identification: [JSON.stringify({ group_type: 'Company', group_value: 'ABC' })], }, }, files: {}, @@ -2206,7 +2208,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -2231,7 +2233,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -2289,9 +2291,18 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, identification: [ - '{"group_type":"Company","group_value":"ABC","group_properties":{"KEY_3":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"KEY_2":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"name_trait":"Company","value_trait":"ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'ABC', + group_properties: { + KEY_3: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + KEY_2: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + name_trait: 'Company', + value_trait: 'ABC', + }, + }), ], }, }, @@ -2389,7 +2400,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -2491,7 +2502,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2515,9 +2526,22 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3","user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"}}', + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + }), ], }, }, @@ -2606,7 +2630,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2630,9 +2654,22 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"user_id":"sampleusrRudder3","user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"},"unmap":true}', + JSON.stringify({ + user_id: 'sampleusrRudder3', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + unmap: true, + }), ], }, }, @@ -2718,7 +2755,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2741,7 +2778,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -2856,7 +2893,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -2879,7 +2916,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -2997,7 +3034,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3020,7 +3057,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -3138,7 +3175,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3161,7 +3198,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'iOS', @@ -3280,7 +3317,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3303,7 +3340,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'iOS', @@ -3379,7 +3416,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -3402,7 +3439,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -3505,7 +3542,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -3532,7 +3569,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3587,7 +3624,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3636,7 +3673,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3744,7 +3781,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -3771,7 +3808,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3907,7 +3944,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -3934,7 +3971,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -3988,7 +4025,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4038,7 +4075,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4147,7 +4184,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -4174,7 +4211,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4248,7 +4285,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4298,7 +4335,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4387,7 +4424,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -4414,7 +4451,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4510,7 +4547,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: true, @@ -4537,7 +4574,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4633,7 +4670,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -4660,7 +4697,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4756,7 +4793,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', trackProductsOnce: false, @@ -4783,7 +4820,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: '50be5c78-6c3f-4b60-be84-97805a316fb1', @@ -4897,7 +4934,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -4930,7 +4967,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5042,7 +5079,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToSetOnce: [ @@ -5075,7 +5112,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5185,7 +5222,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToAppend: [ @@ -5218,7 +5255,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5328,7 +5365,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToPrepend: [ @@ -5361,7 +5398,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5471,7 +5508,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -5528,7 +5565,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -5681,7 +5718,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: false, trackRevenuePerProduct: true, }, @@ -5706,7 +5743,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -5780,7 +5817,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -5850,7 +5887,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6008,7 +6045,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -6033,7 +6070,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6187,7 +6224,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -6212,7 +6249,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6323,7 +6360,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', traitsToIncrement: [ @@ -6356,7 +6393,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -6494,7 +6531,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: true, }, @@ -6519,7 +6556,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6612,7 +6649,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6681,7 +6718,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6814,7 +6851,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -6837,7 +6874,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -6960,7 +6997,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -6985,7 +7022,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -7104,7 +7141,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7127,7 +7164,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'Apple', @@ -7238,7 +7275,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7261,7 +7298,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'Apple', @@ -7372,7 +7409,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7395,7 +7432,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'Apple', @@ -7516,7 +7553,7 @@ export const data = [ destination: { Config: { mapDeviceBrand: true, - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -7541,7 +7578,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -7671,7 +7708,7 @@ export const data = [ destination: { Config: { mapDeviceBrand: true, - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -7694,7 +7731,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -7773,7 +7810,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, mapDeviceBrand: true, }, }, @@ -7797,7 +7834,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_manufacturer: 'testManufacturer', @@ -7929,7 +7966,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', residencyServer: 'EU', @@ -7955,7 +7992,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -8094,7 +8131,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', residencyServer: 'EU', @@ -8120,7 +8157,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -8178,9 +8215,18 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, identification: [ - '{"group_type":"Company","group_value":"ABC","group_properties":{"KEY_3":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"KEY_2":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"name_trait":"Company","value_trait":"ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'ABC', + group_properties: { + KEY_3: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + KEY_2: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + name_trait: 'Company', + value_trait: 'ABC', + }, + }), ], }, }, @@ -8266,7 +8312,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, residencyServer: 'EU', }, }, @@ -8291,9 +8337,22 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3","user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"}}', + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + }), ], }, }, @@ -8377,7 +8436,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -8402,7 +8461,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -8527,7 +8586,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -8552,7 +8611,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -8677,7 +8736,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, trackProductsOnce: true, trackRevenuePerProduct: false, }, @@ -8702,7 +8761,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -8853,7 +8912,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -8878,7 +8937,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9031,7 +9090,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age', }, @@ -9056,7 +9115,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9199,7 +9258,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -9224,7 +9283,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9283,9 +9342,18 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, identification: [ - '{"group_type":"Company","group_value":"ABC","group_properties":{"KEY_3":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"KEY_2":{"CHILD_KEY_92":"value_95","CHILD_KEY_102":"value_103"},"name_trait":"Company","value_trait":"ABC"}}', + JSON.stringify({ + group_type: 'Company', + group_value: 'ABC', + group_properties: { + KEY_3: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + KEY_2: { CHILD_KEY_92: 'value_95', CHILD_KEY_102: 'value_103' }, + name_trait: 'Company', + value_trait: 'ABC', + }, + }), ], }, }, @@ -9333,7 +9401,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9356,7 +9424,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { event_id: 7, @@ -9468,7 +9536,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9491,7 +9559,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -9622,7 +9690,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9646,9 +9714,23 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - api_key: 'abcde', + api_key: secret2, mapping: [ - '{"global_user_id":"newUserIdAlias","user_id":"sampleusrRudder3","event_id":67,"user_properties":{"initial_referrer":"https://docs.rudderstack.com","initial_referring_domain":"docs.rudderstack.com","utm_source":"google","utm_medium":"medium","utm_term":"keyword","utm_content":"some content","utm_name":"some campaign","utm_test":"other value"}}', + JSON.stringify({ + global_user_id: 'newUserIdAlias', + user_id: 'sampleusrRudder3', + event_id: 67, + user_properties: { + initial_referrer: 'https://docs.rudderstack.com', + initial_referring_domain: 'docs.rudderstack.com', + utm_source: 'google', + utm_medium: 'medium', + utm_term: 'keyword', + utm_content: 'some content', + utm_name: 'some campaign', + utm_test: 'other value', + }, + }), ], }, }, @@ -9732,7 +9814,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9755,7 +9837,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -9870,7 +9952,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -9893,7 +9975,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -10032,7 +10114,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -10055,7 +10137,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10177,7 +10259,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, }, }, }, @@ -10200,7 +10282,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Android', @@ -10330,7 +10412,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, groupTypeTrait: 'name_trait', groupValueTrait: 'value_trait', }, @@ -10435,7 +10517,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: 'My custom Page Name is {{ name }} . Custom Name.', }, @@ -10460,7 +10542,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10591,7 +10673,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: '{{name}}', }, @@ -10616,7 +10698,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10748,7 +10830,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: '', }, @@ -10773,7 +10855,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -10903,7 +10985,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: false, userProvidedPageEventString: 'Viewed {{context.page.title}} event.', }, @@ -10928,7 +11010,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -11010,7 +11092,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: true, userProvidedScreenEventString: 'My {{ event }} event.', }, @@ -11035,7 +11117,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11097,7 +11179,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: false, userProvidedScreenEventString: 'My {{ event }} event.', }, @@ -11122,7 +11204,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11184,7 +11266,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: true, userProvidedScreenEventString: '{{ event }}', }, @@ -11209,7 +11291,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11271,7 +11353,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedScreenEventName: true, userProvidedScreenEventString: '', }, @@ -11296,7 +11378,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { device_id: 'anon-id-new', @@ -11353,7 +11435,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret2, useUserDefinedPageEventName: true, userProvidedPageEventString: '', }, diff --git a/test/integrations/destinations/am/router/data.ts b/test/integrations/destinations/am/router/data.ts index 1b4026c85e0..b1f028c7303 100644 --- a/test/integrations/destinations/am/router/data.ts +++ b/test/integrations/destinations/am/router/data.ts @@ -1,3 +1,5 @@ +import { secret2 } from '../maskedSecrets'; + export const data = [ { name: 'am', @@ -61,7 +63,7 @@ export const data = [ }, metadata: { jobId: 1, userId: 'u1' }, destination: { - Config: { apiKey: 'abcde', groupTypeTrait: 'email', groupValueTrait: 'age' }, + Config: { apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age' }, }, }, { @@ -114,7 +116,7 @@ export const data = [ sentAt: '2019-10-14T11:15:53.296Z', }, metadata: { jobId: 2, userId: 'u1' }, - destination: { Config: { apiKey: 'abcde' } }, + destination: { Config: { apiKey: secret2 } }, }, ], destType: 'am', @@ -138,7 +140,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -185,7 +187,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'abcde', groupTypeTrait: 'email', groupValueTrait: 'age' }, + Config: { apiKey: secret2, groupTypeTrait: 'email', groupValueTrait: 'age' }, }, }, { @@ -199,7 +201,7 @@ export const data = [ params: {}, body: { JSON: { - api_key: 'abcde', + api_key: secret2, events: [ { os_name: 'Chrome', @@ -249,7 +251,7 @@ export const data = [ metadata: [{ jobId: 2, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'abcde' } }, + destination: { Config: { apiKey: secret2 } }, }, ], }, diff --git a/test/integrations/destinations/amazon_audience/common.ts b/test/integrations/destinations/amazon_audience/common.ts index 728bdf1d257..1aed2084319 100644 --- a/test/integrations/destinations/amazon_audience/common.ts +++ b/test/integrations/destinations/amazon_audience/common.ts @@ -1,3 +1,4 @@ +import { secret1 } from './maskedSecrets'; export const destination = { DestinationDefinition: { Config: { @@ -6,7 +7,7 @@ export const destination = { }, }, Config: { - advertiserId: '{"Dummy Name":"1234"}', + advertiserId: JSON.stringify({ 'Dummy Name': '1234' }), audienceId: 'dummyId', }, ID: 'amazonAud-1234', @@ -22,7 +23,7 @@ export const generateMetadata = (jobId: number, userId?: string): any => { workspaceId: 'default-workspaceId', dontBatch: false, secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, refreshToken: 'dummyRefreshToken', clientId: 'dummyClientId', }, diff --git a/test/integrations/destinations/amazon_audience/dataDelivery/data.ts b/test/integrations/destinations/amazon_audience/dataDelivery/data.ts index c78a53c8994..fa3496bc7f5 100644 --- a/test/integrations/destinations/amazon_audience/dataDelivery/data.ts +++ b/test/integrations/destinations/amazon_audience/dataDelivery/data.ts @@ -1,4 +1,5 @@ import { generateMetadata, generateProxyV0Payload } from '../../../testUtils'; +import { authHeader1, authHeader2 } from '../maskedSecrets'; const commonStatTags = { destType: 'AMAZON_AUDIENCE', @@ -23,7 +24,7 @@ export const data = [ request: { body: generateProxyV0Payload({ headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -86,7 +87,7 @@ export const data = [ request: { body: generateProxyV0Payload({ headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -158,7 +159,7 @@ export const data = [ request: { body: generateProxyV0Payload({ headers: { - Authorization: 'Bearer fail_token', + Authorization: authHeader2, 'Content-Type': 'application/json', Accept: 'application/json', }, diff --git a/test/integrations/destinations/amazon_audience/maskedSecrets.ts b/test/integrations/destinations/amazon_audience/maskedSecrets.ts new file mode 100644 index 00000000000..4141fcbebe4 --- /dev/null +++ b/test/integrations/destinations/amazon_audience/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/amazon_audience/network.ts b/test/integrations/destinations/amazon_audience/network.ts index b0941712c6a..ec63974d83b 100644 --- a/test/integrations/destinations/amazon_audience/network.ts +++ b/test/integrations/destinations/amazon_audience/network.ts @@ -1,8 +1,5 @@ -const headers = { - 'Amazon-Advertising-API-ClientId': 'dummyClientId', - 'Content-Type': 'application/json', - Authorization: 'Bearer success_access_token', -}; +import { authHeader1, authHeader2 } from './maskedSecrets'; + export const networkCallsData = [ { description: 'successful step 1', @@ -23,7 +20,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -51,7 +48,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -80,7 +77,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer success_access_token', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -107,7 +104,7 @@ export const networkCallsData = [ }, params: {}, headers: { - Authorization: 'Bearer fail_token', + Authorization: authHeader2, 'Content-Type': 'application/json', Accept: 'application/json', }, diff --git a/test/integrations/destinations/amazon_audience/processor/data.ts b/test/integrations/destinations/amazon_audience/processor/data.ts index 49931ed92bc..7a4a25ca53b 100644 --- a/test/integrations/destinations/amazon_audience/processor/data.ts +++ b/test/integrations/destinations/amazon_audience/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { destination, generateMetadata } from '../common'; const sha256 = require('sha256'); @@ -97,7 +98,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, method: 'POST', params: {}, @@ -151,7 +152,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/amazon_audience/router/data.ts b/test/integrations/destinations/amazon_audience/router/data.ts index 6787e03160e..f663e25b8ec 100644 --- a/test/integrations/destinations/amazon_audience/router/data.ts +++ b/test/integrations/destinations/amazon_audience/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { destination, generateMetadata } from '../common'; export const data = [ @@ -106,7 +107,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { @@ -157,7 +158,7 @@ export const data = [ headers: { 'Amazon-Advertising-API-ClientId': 'dummyClientId', 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/attentive_tag/maskedSecrets.ts b/test/integrations/destinations/attentive_tag/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/attentive_tag/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/attentive_tag/processor/data.ts b/test/integrations/destinations/attentive_tag/processor/data.ts index 137a9aee9af..80aced02023 100644 --- a/test/integrations/destinations/attentive_tag/processor/data.ts +++ b/test/integrations/destinations/attentive_tag/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const mockFns = (_) => { jest.spyOn(Date, 'now').mockReturnValue(new Date('2023-10-14T00:00:00.000Z').valueOf()); }; @@ -40,7 +41,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -60,7 +61,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -168,7 +169,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -238,7 +239,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -258,7 +259,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions/unsubscribe', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -364,7 +365,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -476,7 +477,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -589,7 +590,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -702,7 +703,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -805,7 +806,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -917,7 +918,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -988,7 +989,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -1008,7 +1009,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1114,7 +1115,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1223,7 +1224,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1333,7 +1334,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1444,7 +1445,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1514,7 +1515,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '241654', }, }, @@ -1534,7 +1535,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1624,7 +1625,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1644,7 +1645,7 @@ export const data = [ userId: '', endpoint: 'https://api.attentivemobile.com/v1/events/ecommerce/product-view', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1728,7 +1729,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, signUpSourceId: '240654', }, }, @@ -1748,7 +1749,7 @@ export const data = [ userId: '', endpoint: 'https://api.attentivemobile.com/v1/events/custom', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/attentive_tag/router/data.ts b/test/integrations/destinations/attentive_tag/router/data.ts index 63bd477f0cf..2bbd91c3c05 100644 --- a/test/integrations/destinations/attentive_tag/router/data.ts +++ b/test/integrations/destinations/attentive_tag/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'attentive_tag', @@ -10,7 +11,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: 'dummyApiKey', signUpSourceId: '241654' } }, + destination: { Config: { apiKey: secret1, signUpSourceId: '241654' } }, metadata: { jobId: 1, userId: 'u1' }, message: { anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', @@ -59,7 +60,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.attentivemobile.com/v1/subscriptions/unsubscribe', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -74,7 +75,7 @@ export const data = [ metadata: [{ jobId: 1, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', signUpSourceId: '241654' } }, + destination: { Config: { apiKey: secret1, signUpSourceId: '241654' } }, }, ], }, diff --git a/test/integrations/destinations/attribution/data.ts b/test/integrations/destinations/attribution/data.ts index db8d7cb393b..3ed7f3da5a3 100644 --- a/test/integrations/destinations/attribution/data.ts +++ b/test/integrations/destinations/attribution/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; export const data = [ { name: 'attribution', @@ -22,7 +23,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -80,7 +81,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -165,7 +166,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -215,7 +216,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -287,7 +288,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -337,7 +338,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -406,7 +407,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -458,7 +459,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -532,7 +533,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -582,7 +583,7 @@ export const data = [ endpoint: 'https://track.attributionapp.com/v1/import', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/attribution/maskedSecrets.ts b/test/integrations/destinations/attribution/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/attribution/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/bloomreach/common.ts b/test/integrations/destinations/bloomreach/common.ts index 798e744cbcb..a9acceff6e0 100644 --- a/test/integrations/destinations/bloomreach/common.ts +++ b/test/integrations/destinations/bloomreach/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'bloomreach'; @@ -7,8 +8,8 @@ const channel = 'web'; const destination: Destination = { Config: { apiBaseUrl: 'https://demoapp-api.bloomreach.com', - apiKey: 'test-api-key', - apiSecret: 'test-api-secret', + apiKey: secret1, + apiSecret: secret2, projectToken: 'test-project-token', hardID: 'registered', softID: 'cookie', @@ -82,7 +83,7 @@ const proxyV1RetryableErrorStatTags = { const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hcGkta2V5OnRlc3QtYXBpLXNlY3JldA==', + Authorization: authHeader1, }; export { diff --git a/test/integrations/destinations/bloomreach/dataDelivery/other.ts b/test/integrations/destinations/bloomreach/dataDelivery/other.ts index f0dd9cc09a4..9a46448aedb 100644 --- a/test/integrations/destinations/bloomreach/dataDelivery/other.ts +++ b/test/integrations/destinations/bloomreach/dataDelivery/other.ts @@ -34,8 +34,13 @@ export const otherProxyV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/bloomreach/maskedSecrets.ts b/test/integrations/destinations/bloomreach/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/bloomreach/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/bloomreach_catalog/common.ts b/test/integrations/destinations/bloomreach_catalog/common.ts index 2b4266837b5..49853d17d2f 100644 --- a/test/integrations/destinations/bloomreach_catalog/common.ts +++ b/test/integrations/destinations/bloomreach_catalog/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'bloomreach_catalog'; @@ -7,8 +8,8 @@ const channel = 'web'; const destination: Destination = { Config: { apiBaseUrl: 'https://demoapp-api.bloomreach.com', - apiKey: 'test-api-key', - apiSecret: 'test-api-secret', + apiKey: secret1, + apiSecret: secret2, projectToken: 'test-project-token', catalogID: 'test-catalog-id', }, @@ -58,7 +59,7 @@ const proxyV1RetryableErrorStatTags = { const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hcGkta2V5OnRlc3QtYXBpLXNlY3JldA==', + Authorization: authHeader1, }; const sampleContext = { diff --git a/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts b/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts index f8cccd04ed2..83d861e76c7 100644 --- a/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts +++ b/test/integrations/destinations/bloomreach_catalog/dataDelivery/data.ts @@ -21,8 +21,10 @@ export const data: ProxyV1TestData[] = [ params: {}, JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id","properties":{"unprinted":"1"}},{"item_id":"test-item-id-faulty","properties":{"unprinted1":"1"}}]', + batch: JSON.stringify([ + { item_id: 'test-item-id', properties: { unprinted: '1' } }, + { item_id: 'test-item-id-faulty', properties: { unprinted1: '1' } }, + ]), }, endpoint: updateEndpoint, }, @@ -89,8 +91,10 @@ export const data: ProxyV1TestData[] = [ params: {}, JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id-1","properties":{"unprinted":"1"}},{"item_id":"test-item-id-2","properties":{"unprinted":"2"}}]', + batch: JSON.stringify([ + { item_id: 'test-item-id-1', properties: { unprinted: '1' } }, + { item_id: 'test-item-id-2', properties: { unprinted: '2' } }, + ]), }, endpoint: updateEndpoint, }, @@ -154,7 +158,9 @@ export const data: ProxyV1TestData[] = [ params: {}, JSON: {}, JSON_ARRAY: { - batch: '[{"item_id":"test-item-id-faulty","properties":{"unprinted1":"1"}}]', + batch: JSON.stringify([ + { item_id: 'test-item-id-faulty', properties: { unprinted1: '1' } }, + ]), }, endpoint: updateEndpoint, }, diff --git a/test/integrations/destinations/bloomreach_catalog/maskedSecrets.ts b/test/integrations/destinations/bloomreach_catalog/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/bloomreach_catalog/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/bloomreach_catalog/router/data.ts b/test/integrations/destinations/bloomreach_catalog/router/data.ts index 68ab4224444..2bba2849773 100644 --- a/test/integrations/destinations/bloomreach_catalog/router/data.ts +++ b/test/integrations/destinations/bloomreach_catalog/router/data.ts @@ -211,8 +211,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":1}},{"item_id":"test-item-id-7","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":1,"test_empty":"","test_null":null,"test_empty_array":[]}}]', + batch: JSON.stringify([ + { + item_id: 'test-item-id', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 1, + }, + }, + { + item_id: 'test-item-id-7', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 1, + test_empty: '', + test_null: null, + test_empty_array: [], + }, + }, + ]), }, XML: {}, FORM: {}, @@ -235,8 +254,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"item_id":"test-item-id","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":3}},{"item_id":"test-item-id","properties":{"title":"Hardcover Monthbooks","status":"up to date","unprinted":2}}]', + batch: JSON.stringify([ + { + item_id: 'test-item-id', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 3, + }, + }, + { + item_id: 'test-item-id', + properties: { + title: 'Hardcover Monthbooks', + status: 'up to date', + unprinted: 2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -259,7 +294,7 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: '["test-item-id-1","test-item-id-2"]', + batch: JSON.stringify(['test-item-id-1', 'test-item-id-2']), }, XML: {}, FORM: {}, @@ -282,7 +317,7 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: '["test-item-id-3"]', + batch: JSON.stringify(['test-item-id-3']), }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/blueshift/maskedSecrets.ts b/test/integrations/destinations/blueshift/maskedSecrets.ts new file mode 100644 index 00000000000..5c76d3abeb9 --- /dev/null +++ b/test/integrations/destinations/blueshift/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; +export const authHeader2 = `Basic ${base64Convertor(secret2)}`; diff --git a/test/integrations/destinations/blueshift/processor/data.ts b/test/integrations/destinations/blueshift/processor/data.ts index be235216217..803da039896 100644 --- a/test/integrations/destinations/blueshift/processor/data.ts +++ b/test/integrations/destinations/blueshift/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'blueshift', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, dataCenter: 'standard', }, }, @@ -91,7 +92,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'standard', }, @@ -133,7 +134,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -169,8 +170,8 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + eventApiKey: secret1, + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -230,7 +231,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -276,7 +277,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'standard', }, @@ -378,7 +379,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -443,7 +444,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -541,7 +542,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -602,7 +603,7 @@ export const data = [ { destination: { Config: { - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -684,7 +685,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -766,7 +767,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'standard', }, }, @@ -852,7 +853,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/customers', headers: { - Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -1023,7 +1024,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1070,7 +1071,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/customers', headers: { - Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -1112,7 +1113,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1180,7 +1181,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1248,7 +1249,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -1347,7 +1348,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1411,8 +1412,8 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + eventApiKey: secret1, + usersApiKey: secret2, dataCenter: 'eu', }, }, @@ -1472,7 +1473,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.eu.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1518,7 +1519,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -1639,7 +1640,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'eu', }, @@ -1760,7 +1761,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', dataCenter: 'standard', }, @@ -1845,7 +1846,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/blueshift/router/data.ts b/test/integrations/destinations/blueshift/router/data.ts index 7104beb873f..7f9b1645223 100644 --- a/test/integrations/destinations/blueshift/router/data.ts +++ b/test/integrations/destinations/blueshift/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'blueshift', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -44,7 +45,7 @@ export const data = [ { destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -86,7 +87,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, datacenterEU: false, }, }, @@ -164,7 +165,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/event', headers: { - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -186,7 +187,7 @@ export const data = [ statusCode: 200, destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -221,7 +222,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZWZlYjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q2MjBlYzE=', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.getblueshift.com/api/v1/event', @@ -231,7 +232,7 @@ export const data = [ statusCode: 200, destination: { Config: { - eventApiKey: 'efeb4a29aba5e75d99c8a18acd620ec1', + eventApiKey: secret1, usersApiKey: 'b4a29aba5e75duic8a18acd920ec1e2e', datacenterEU: false, }, @@ -244,7 +245,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getblueshift.com/api/v1/customers', headers: { - Authorization: 'Basic YjRhMjlhYmE1ZTc1ZDk5YzhhMThhY2Q5MjBlYzFlMmU=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -291,7 +292,7 @@ export const data = [ destination: { Config: { eventApiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', - usersApiKey: 'b4a29aba5e75d99c8a18acd920ec1e2e', + usersApiKey: secret2, datacenterEU: false, }, }, diff --git a/test/integrations/destinations/braze/dataDelivery/business.ts b/test/integrations/destinations/braze/dataDelivery/business.ts index 4997c5ffaeb..a69a8fc20c8 100644 --- a/test/integrations/destinations/braze/dataDelivery/business.ts +++ b/test/integrations/destinations/braze/dataDelivery/business.ts @@ -1,6 +1,7 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const BRAZE_USERS_TRACK_ENDPOINT = 'https://rest.iad-03.braze.com/users/track'; @@ -8,7 +9,7 @@ const partner = 'RudderStack'; const headers = { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; @@ -128,7 +129,7 @@ const BrazePurchaseEvent = { const metadataArray = [generateMetadata(1), generateMetadata(2), generateMetadata(3)]; const errorMessages = { - message_1: '{"events_processed":2,"purchases_processed":1,"message":"success"}', + message_1: JSON.stringify({ events_processed: 2, purchases_processed: 1, message: 'success' }), message_2: '{"events_processed":1,"message":"success","errors":[{"type":"\'external_id\', \'braze_id\', \'user_alias\', \'email\' or \'phone\' is required","input_array":"events","index":1},{"type":"\'quantity\' is not valid","input_array":"purchases","index":0}]}', message_3: @@ -351,17 +352,17 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: '{"message":"Invalid API Key"}', + error: JSON.stringify({ message: 'Invalid API Key' }), statusCode: 401, metadata: generateMetadata(1), }, { - error: '{"message":"Invalid API Key"}', + error: JSON.stringify({ message: 'Invalid API Key' }), statusCode: 401, metadata: generateMetadata(2), }, { - error: '{"message":"Invalid API Key"}', + error: JSON.stringify({ message: 'Invalid API Key' }), statusCode: 401, metadata: generateMetadata(3), }, diff --git a/test/integrations/destinations/braze/dataDelivery/data.ts b/test/integrations/destinations/braze/dataDelivery/data.ts index 2596a4b9592..1d46883b975 100644 --- a/test/integrations/destinations/braze/dataDelivery/data.ts +++ b/test/integrations/destinations/braze/dataDelivery/data.ts @@ -1,6 +1,7 @@ import MockAdapter from 'axios-mock-adapter'; import { testScenariosForV1API } from './business'; import { otherScenariosV1 } from './other'; +import { authHeader1 } from '../maskedSecrets'; export const existingTestData = [ { @@ -18,7 +19,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -79,7 +80,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -140,7 +141,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -211,7 +212,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -269,7 +270,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -337,7 +338,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -404,7 +405,7 @@ export const existingTestData = [ }, { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -431,7 +432,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -499,7 +500,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -549,7 +550,7 @@ export const existingTestData = [ message: 'Request for braze Processed Successfully', response: [ { - error: '{"aliases_processed":1,"message":"success"}', + error: JSON.stringify({ aliases_processed: 1, message: 'success' }), statusCode: 201, metadata: { jobId: 2, @@ -587,7 +588,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -637,7 +638,7 @@ export const existingTestData = [ status: 401, response: [ { - error: '{"code":400,"message":"Bad Req","status":"Fail Case"}', + error: JSON.stringify({ code: 400, message: 'Bad Req', status: 'Fail Case' }), statusCode: 401, metadata: { jobId: 2, @@ -686,7 +687,7 @@ export const existingTestData = [ userId: 'gabi_userId_45', headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { diff --git a/test/integrations/destinations/braze/dataDelivery/other.ts b/test/integrations/destinations/braze/dataDelivery/other.ts index 9353899a654..61e1a65da2f 100644 --- a/test/integrations/destinations/braze/dataDelivery/other.ts +++ b/test/integrations/destinations/braze/dataDelivery/other.ts @@ -38,8 +38,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/braze/deleteUsers/data.ts b/test/integrations/destinations/braze/deleteUsers/data.ts index cad61fd12d8..ae2d65a8fab 100644 --- a/test/integrations/destinations/braze/deleteUsers/data.ts +++ b/test/integrations/destinations/braze/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'braze', @@ -167,7 +169,7 @@ export const data = [ ], config: { dataCenter: 'US-03', - restApiKey: '1234', + restApiKey: secret2, }, }, ], @@ -353,7 +355,7 @@ export const data = [ ], config: { dataCenter: 'US-03', - restApiKey: '1234', + restApiKey: secret2, }, }, ], @@ -461,7 +463,7 @@ export const data = [ }, ], config: { - restApiKey: 'b1bd90e2-d203-480a-962c-f7bb03ea0afe', + restApiKey: secret1, dataCenter: 'US-03', }, }, diff --git a/test/integrations/destinations/braze/maskedSecrets.ts b/test/integrations/destinations/braze/maskedSecrets.ts new file mode 100644 index 00000000000..c598977b6a1 --- /dev/null +++ b/test/integrations/destinations/braze/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; +export const secret2 = path.basename(__dirname) + 1; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/braze/network.ts b/test/integrations/destinations/braze/network.ts index bcfa78de5de..a2c4f9dff88 100644 --- a/test/integrations/destinations/braze/network.ts +++ b/test/integrations/destinations/braze/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2 } from './maskedSecrets'; const dataDeliveryMocksData = [ { httpReq: { @@ -13,7 +14,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -35,7 +36,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -57,7 +58,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -82,7 +83,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -104,7 +105,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -126,7 +127,7 @@ const dataDeliveryMocksData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -197,7 +198,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -269,7 +270,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -288,7 +289,7 @@ const deleteNwData = [ data: { external_ids: ['test_user_id51'] }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -311,7 +312,7 @@ const deleteNwData = [ }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer 1234', + Authorization: authHeader2, }, }, httpRes: { @@ -339,7 +340,7 @@ const deleteNwData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -386,7 +387,7 @@ const deleteNwData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -421,7 +422,7 @@ const deleteNwData = [ 'user_aliases', ], }, - headers: { Authorization: 'Bearer dummyApiKey' }, + headers: { Authorization: authHeader1 }, url: 'https://rest.iad-03.braze.com/users/export/ids', }, httpRes: { @@ -511,7 +512,7 @@ const deleteNwData = [ params: { destination: 'braze' }, headers: { Accept: 'application/json', - Authorization: 'Bearer api_key', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/braze/processor/data.ts b/test/integrations/destinations/braze/processor/data.ts index 9b6f6dac65b..7fa6f3d0195 100644 --- a/test/integrations/destinations/braze/processor/data.ts +++ b/test/integrations/destinations/braze/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'braze', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -90,7 +91,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -135,7 +136,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -224,7 +225,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -298,7 +299,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -341,7 +342,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -419,7 +420,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -469,7 +470,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'eu-01', @@ -547,7 +548,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -597,7 +598,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -674,7 +675,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -717,7 +718,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: false, @@ -800,7 +801,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -861,7 +862,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -970,7 +971,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1132,7 +1133,7 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -1231,7 +1232,7 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -1262,7 +1263,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1300,7 +1301,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -1383,7 +1384,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1421,7 +1422,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -1530,7 +1531,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1601,7 +1602,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -1710,7 +1711,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1781,7 +1782,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: true, @@ -1908,7 +1909,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2012,7 +2013,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: true, @@ -2133,7 +2134,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2229,7 +2230,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -2310,7 +2311,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2360,7 +2361,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -2441,7 +2442,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2491,7 +2492,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'US-03', @@ -2556,7 +2557,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2597,7 +2598,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'US-03', @@ -2680,7 +2681,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'US-03', @@ -2763,7 +2764,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -2845,7 +2846,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -2898,7 +2899,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -3005,7 +3006,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3119,7 +3120,7 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableSubscriptionGroupInGroupCall: true, @@ -3151,7 +3152,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3240,7 +3241,7 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, enableSubscriptionGroupInGroupCall: true, @@ -3272,7 +3273,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3311,7 +3312,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -3393,7 +3394,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3442,7 +3443,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, sendPurchaseEventWithExtraProperties: true, @@ -3552,7 +3553,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -3633,7 +3634,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -3711,7 +3712,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, sendPurchaseEventWithExtraProperties: true, @@ -3856,7 +3857,7 @@ export const data = [ files: {}, headers: { Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -3883,7 +3884,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -3959,7 +3960,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -4029,7 +4030,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -4091,7 +4092,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -4196,7 +4197,7 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, @@ -4295,7 +4296,7 @@ export const data = [ }, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, }, diff --git a/test/integrations/destinations/braze/router/data.ts b/test/integrations/destinations/braze/router/data.ts index 8ab04c5d04c..02b6506b7f3 100644 --- a/test/integrations/destinations/braze/router/data.ts +++ b/test/integrations/destinations/braze/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'braze', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'eu-01', @@ -68,7 +69,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -122,7 +123,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -150,7 +151,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -178,7 +179,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -200,7 +201,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -222,7 +223,7 @@ export const data = [ { destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'us-01', @@ -268,7 +269,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -320,7 +321,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -354,7 +355,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -390,7 +391,7 @@ export const data = [ statusCode: 200, destination: { Config: { - restApiKey: 'dummyApiKey', + restApiKey: secret1, prefixProperties: true, useNativeSDK: false, dataCenter: 'eu-01', @@ -432,7 +433,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -501,7 +502,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -570,7 +571,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -623,7 +624,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -676,7 +677,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -738,7 +739,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -828,7 +829,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], @@ -863,7 +864,7 @@ export const data = [ enableNestedArrayOperations: false, enableSubscriptionGroupInGroupCall: false, eventFilteringOption: 'disable', - restApiKey: 'dummyApiKey', + restApiKey: secret1, supportDedup: true, trackAnonymousUser: true, whitelistedEvents: [], diff --git a/test/integrations/destinations/campaign_manager/dataDelivery/business.ts b/test/integrations/destinations/campaign_manager/dataDelivery/business.ts index e663f3212a8..040d2392adb 100644 --- a/test/integrations/destinations/campaign_manager/dataDelivery/business.ts +++ b/test/integrations/destinations/campaign_manager/dataDelivery/business.ts @@ -1,12 +1,13 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../../am/maskedSecrets'; // Boilerplate data for the test cases // ====================================== const commonHeaders = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts b/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts index 288a06bfe6f..44f5aeb7638 100644 --- a/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts +++ b/test/integrations/destinations/campaign_manager/dataDelivery/oauth.ts @@ -1,10 +1,12 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload, generateProxyV0Payload } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; +import { authHeader1 } from '../../am/maskedSecrets'; // Boilerplat data for the test cases // ====================================== const commonHeaders = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -331,8 +333,34 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","errors":[{"message":"Login Required.","domain":"global","reason":"required","location":"Authorization","locationType":"header"}],"status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"method":"google.ads.xfa.op.v4.DfareportingConversions.Batchinsert","service":"googleapis.com"}}]}}', + error: JSON.stringify({ + error: { + code: 401, + message: + 'Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.', + errors: [ + { + message: 'Login Required.', + domain: 'global', + reason: 'required', + location: 'Authorization', + locationType: 'header', + }, + ], + status: 'UNAUTHENTICATED', + details: [ + { + '@type': 'type.googleapis.com/google.rpc.ErrorInfo', + reason: 'CREDENTIALS_MISSING', + domain: 'googleapis.com', + metadata: { + method: 'google.ads.xfa.op.v4.DfareportingConversions.Batchinsert', + service: 'googleapis.com', + }, + }, + ], + }, + }), statusCode: 401, metadata: { jobId: 1, @@ -342,7 +370,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -394,8 +422,31 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"code":403,"message":"Request had insufficient authentication scopes.","errors":[{"message":"Insufficient Permission","domain":"global","reason":"insufficientPermissions"}],"status":"PERMISSION_DENIED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"ACCESS_TOKEN_SCOPE_INSUFFICIENT","domain":"googleapis.com","metadata":{"service":"gmail.googleapis.com","method":"caribou.api.proto.MailboxService.GetProfile"}}]}}', + error: JSON.stringify({ + error: { + code: 403, + message: 'Request had insufficient authentication scopes.', + errors: [ + { + message: 'Insufficient Permission', + domain: 'global', + reason: 'insufficientPermissions', + }, + ], + status: 'PERMISSION_DENIED', + details: [ + { + '@type': 'type.googleapis.com/google.rpc.ErrorInfo', + reason: 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', + domain: 'googleapis.com', + metadata: { + service: 'gmail.googleapis.com', + method: 'caribou.api.proto.MailboxService.GetProfile', + }, + }, + ], + }, + }), statusCode: 403, metadata: { jobId: 1, @@ -405,7 +456,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -457,8 +508,9 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"code":403,"message":"invalid_grant","error_description":"Bad accesss"}}', + error: JSON.stringify({ + error: { code: 403, message: 'invalid_grant', error_description: 'Bad accesss' }, + }), statusCode: 403, metadata: { jobId: 1, @@ -468,7 +520,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -519,8 +571,10 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":"unauthorized","error_description":"Access token expired: 2020-10-20T12:00:00.000Z"}', + error: JSON.stringify({ + error: 'unauthorized', + error_description: 'Access token expired: 2020-10-20T12:00:00.000Z', + }), statusCode: 401, metadata: { jobId: 1, @@ -530,7 +584,7 @@ export const v1oauthScenarios: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, diff --git a/test/integrations/destinations/campaign_manager/dataDelivery/other.ts b/test/integrations/destinations/campaign_manager/dataDelivery/other.ts index 1c0c45728c0..fe006755762 100644 --- a/test/integrations/destinations/campaign_manager/dataDelivery/other.ts +++ b/test/integrations/destinations/campaign_manager/dataDelivery/other.ts @@ -1,6 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV0Payload, generateProxyV1Payload } from '../../../testUtils'; - +import { defaultAccessToken } from '../../../common/secrets'; export const otherScenariosV0 = [ { id: 'cm360_v0_other_scenario_1', @@ -258,8 +258,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: { jobId: 1, @@ -269,7 +274,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -327,7 +332,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -385,7 +390,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -443,7 +448,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -502,7 +507,7 @@ export const otherScenariosV1: ProxyV1TestData[] = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, diff --git a/test/integrations/destinations/campaign_manager/maskedSecrets.ts b/test/integrations/destinations/campaign_manager/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/campaign_manager/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/campaign_manager/network.ts b/test/integrations/destinations/campaign_manager/network.ts index b7c23012481..11121559317 100644 --- a/test/integrations/destinations/campaign_manager/network.ts +++ b/test/integrations/destinations/campaign_manager/network.ts @@ -1,5 +1,7 @@ +import { authHeader1 } from '../am/maskedSecrets'; + const commonHeaders = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/campaign_manager/processor/data.ts b/test/integrations/destinations/campaign_manager/processor/data.ts index 9aa41691c68..8f4351815fe 100644 --- a/test/integrations/destinations/campaign_manager/processor/data.ts +++ b/test/integrations/destinations/campaign_manager/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'campaign_manager', @@ -79,7 +80,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -110,7 +111,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -148,7 +149,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -239,7 +240,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -270,7 +271,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -300,7 +301,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -393,7 +394,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -419,7 +420,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -472,7 +473,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -498,7 +499,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -599,7 +600,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -630,7 +631,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -662,7 +663,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -753,7 +754,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -784,7 +785,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -816,7 +817,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -907,7 +908,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -940,7 +941,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1000,7 +1001,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1091,7 +1092,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1124,7 +1125,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1180,7 +1181,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1260,7 +1261,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1293,7 +1294,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/34245/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1329,7 +1330,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/campaign_manager/router/data.ts b/test/integrations/destinations/campaign_manager/router/data.ts index 5b4e5bcce4c..3b237887aec 100644 --- a/test/integrations/destinations/campaign_manager/router/data.ts +++ b/test/integrations/destinations/campaign_manager/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'campaign_manager', @@ -12,7 +13,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -92,7 +93,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -172,7 +173,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -271,7 +272,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -309,7 +310,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -337,7 +338,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -373,7 +374,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -409,7 +410,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -445,7 +446,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -487,7 +488,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -529,7 +530,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -587,7 +588,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -645,7 +646,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -654,7 +655,7 @@ export const data = [ }, { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -663,7 +664,7 @@ export const data = [ }, { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -701,7 +702,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -743,7 +744,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -785,7 +786,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -843,7 +844,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchupdate', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -884,7 +885,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -893,7 +894,7 @@ export const data = [ }, { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -921,7 +922,7 @@ export const data = [ endpoint: 'https://dfareporting.googleapis.com/dfareporting/v4/userprofiles/437689/conversions/batchinsert', headers: { - Authorization: 'Bearer dummyApiToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -953,7 +954,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -991,7 +992,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1032,7 +1033,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1073,7 +1074,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1126,7 +1127,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1160,7 +1161,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1194,7 +1195,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyApiToken', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/candu/maskedSecrets.ts b/test/integrations/destinations/candu/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/candu/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/candu/processor/data.ts b/test/integrations/destinations/candu/processor/data.ts index 22bd0b35672..a81317afb4f 100644 --- a/test/integrations/destinations/candu/processor/data.ts +++ b/test/integrations/destinations/candu/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'candu', @@ -42,7 +43,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -122,7 +123,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -198,7 +199,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -280,7 +281,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -358,7 +359,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -484,7 +485,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -753,7 +754,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -885,7 +886,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -965,7 +966,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1042,7 +1043,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -1124,7 +1125,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1202,7 +1203,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -1284,7 +1285,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/candu/router/data.ts b/test/integrations/destinations/candu/router/data.ts index 02e1caa3e93..2498286c4c7 100644 --- a/test/integrations/destinations/candu/router/data.ts +++ b/test/integrations/destinations/candu/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'candu', @@ -40,7 +41,7 @@ export const data = [ }, ResponseRules: {}, }, - Config: { apiKey: 'FXLkLUEhGJyvmY4' }, + Config: { apiKey: secret1 }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -109,7 +110,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.candu.ai/api/eventWebhook', headers: { - Authorization: 'Basic RlhMa0xVRWhHSnl2bVk0', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -167,7 +168,7 @@ export const data = [ }, ResponseRules: {}, }, - Config: { apiKey: 'FXLkLUEhGJyvmY4' }, + Config: { apiKey: secret1 }, Enabled: true, Transformations: [], IsProcessorEnabled: true, diff --git a/test/integrations/destinations/canny/maskedSecrets.ts b/test/integrations/destinations/canny/maskedSecrets.ts new file mode 100644 index 00000000000..aaf5a0cbb37 --- /dev/null +++ b/test/integrations/destinations/canny/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${secret1}`; +export const authHeader2 = `Basic ${secret2}`; diff --git a/test/integrations/destinations/canny/network.ts b/test/integrations/destinations/canny/network.ts index db1b6396327..68ff8b638dd 100644 --- a/test/integrations/destinations/canny/network.ts +++ b/test/integrations/destinations/canny/network.ts @@ -1,3 +1,5 @@ +import { secret2 } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -5,7 +7,7 @@ export const networkCallsData = [ Accept: 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', }, - data: 'apiKey=apikey123&email=test%40rudderstack.com', + data: `apiKey=${secret2}&email=test%40rudderstack.com`, method: 'POST', url: 'https://canny.io/api/v1/users/retrieve', }, diff --git a/test/integrations/destinations/canny/data.ts b/test/integrations/destinations/canny/processor/data.ts similarity index 98% rename from test/integrations/destinations/canny/data.ts rename to test/integrations/destinations/canny/processor/data.ts index 3c6823ca1b5..ad28652d5f5 100644 --- a/test/integrations/destinations/canny/data.ts +++ b/test/integrations/destinations/canny/processor/data.ts @@ -1,5 +1,4 @@ -import { enhanceRequestOptions } from '../../../../src/adapters/network'; -import qs from 'qs'; +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { @@ -14,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -93,7 +92,7 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/users/create_or_update', headers: { - Authorization: 'Basic FXLkLUEhGJyvmY4', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -104,7 +103,7 @@ export const data = [ title: 'VP', gender: 'female', }, - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, userID: 'user123456001', email: 'firstUser@testmail.com', name: 'First User', @@ -135,7 +134,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -232,7 +231,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -329,7 +328,7 @@ export const data = [ { destination: { Config: { - apiKey: 'FXLkLUEhGJyvmY4', + apiKey: secret1, }, }, message: { @@ -619,7 +618,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc', @@ -719,7 +718,7 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/votes/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/x-www-form-urlencoded', }, params: {}, @@ -729,7 +728,7 @@ export const data = [ XML: {}, FORM: { postID: 'postid', - apiKey: 'apikey123', + apiKey: secret2, voterID: '52d14c90fff7c80abcd12345', }, }, @@ -745,13 +744,13 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/posts/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, body: { JSON: { - apiKey: 'apikey123', + apiKey: secret2, boardID: 'boardid', details: 'details', title: 'title', @@ -781,7 +780,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', @@ -872,7 +871,7 @@ export const data = [ userId: '', endpoint: 'https://canny.io/api/v1/posts/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -881,7 +880,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, JSON: { - apiKey: 'apikey123', + apiKey: secret2, authorID: '52d14c90fff7c80abcd12345', boardID: 'boardid', details: 'details', @@ -908,7 +907,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'sample', @@ -1001,7 +1000,7 @@ export const data = [ method: 'POST', endpoint: 'https://canny.io/api/v1/posts/create', headers: { - Authorization: 'Basic apikey123', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -1010,7 +1009,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, JSON: { - apiKey: 'apikey123', + apiKey: secret2, authorID: '62d1', boardID: '62de8', details: 'Array of images', @@ -1042,7 +1041,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'sample', @@ -1151,7 +1150,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'sample', @@ -1263,7 +1262,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [], }, }, @@ -1363,7 +1362,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc', @@ -1474,7 +1473,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', @@ -1585,7 +1584,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', @@ -1695,7 +1694,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey123', + apiKey: secret2, eventsToEvents: [ { from: 'abc def', diff --git a/test/integrations/destinations/clevertap/dataDelivery/business.ts b/test/integrations/destinations/clevertap/dataDelivery/business.ts index d9f83f52f35..cd5bcd1e6fd 100644 --- a/test/integrations/destinations/clevertap/dataDelivery/business.ts +++ b/test/integrations/destinations/clevertap/dataDelivery/business.ts @@ -57,10 +57,15 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -83,7 +88,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: '{"status":"success","processed":1,"unprocessed":[]}', + error: JSON.stringify({ status: 'success', processed: 1, unprocessed: [] }), statusCode: 200, }, ], @@ -141,7 +146,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: '{"status":"fail","error":"Invalid Credentials","code":401}', + error: JSON.stringify({ status: 'fail', error: 'Invalid Credentials', code: 401 }), statusCode: 401, }, ], @@ -200,7 +205,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: '{"status":"fail","processed":0,"unprocessed":[]}', + error: JSON.stringify({ status: 'fail', processed: 0, unprocessed: [] }), statusCode: 400, }, ], @@ -271,8 +276,23 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { metadata: generateMetadata(123), - error: - '{"status":"partial","processed":2,"unprocessed":[{"status":"fail","code":509,"error":"Event Name is incorrect. ErrorCode: 509 - Event name is mandatory. Skipped record number : 2","record":{"evtData":{"name":1234,"revenue":4.99},"type":"event","identity":"user123"}}]}', + error: JSON.stringify({ + status: 'partial', + processed: 2, + unprocessed: [ + { + status: 'fail', + code: 509, + error: + 'Event Name is incorrect. ErrorCode: 509 - Event name is mandatory. Skipped record number : 2', + record: { + evtData: { name: 1234, revenue: 4.99 }, + type: 'event', + identity: 'user123', + }, + }, + ], + }), statusCode: 400, }, ], diff --git a/test/integrations/destinations/clevertap/dataDelivery/data.ts b/test/integrations/destinations/clevertap/dataDelivery/data.ts index 57e0d0ceea1..f83c0bc9f6b 100644 --- a/test/integrations/destinations/clevertap/dataDelivery/data.ts +++ b/test/integrations/destinations/clevertap/dataDelivery/data.ts @@ -39,10 +39,15 @@ const oldV0TestCases = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, diff --git a/test/integrations/destinations/clevertap/network.ts b/test/integrations/destinations/clevertap/network.ts index 9122ba11293..103fcfb1c5b 100644 --- a/test/integrations/destinations/clevertap/network.ts +++ b/test/integrations/destinations/clevertap/network.ts @@ -21,10 +21,15 @@ const dataDeliveryMocksData = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, diff --git a/test/integrations/destinations/clevertap/processor/data.ts b/test/integrations/destinations/clevertap/processor/data.ts index f15fc409fba..de84242d231 100644 --- a/test/integrations/destinations/clevertap/processor/data.ts +++ b/test/integrations/destinations/clevertap/processor/data.ts @@ -99,10 +99,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), 'category-unsubscribe': { email: ['Marketing', 'Transactional'] }, }, identity: 'anon_id', @@ -223,10 +228,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), 'category-unsubscribe': { email: ['Marketing', 'Transactional'] }, }, identity: 'anon_id', @@ -368,10 +378,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -1094,10 +1109,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -1237,10 +1257,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, identity: 'anon_id', }, @@ -1818,10 +1843,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), }, ts: 1615377562, identity: 'anon_id', @@ -2203,10 +2233,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), first_name: 'John', last_name: 'Doe', }, @@ -2356,10 +2391,15 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', + custom_mappings: JSON.stringify({ Office: 'Trastkiv', Country: 'Russia' }), + custom_tags: JSON.stringify(['Test_User', 'Interested_User', 'DIY_Hobby']), + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), first_name: 'John', last_name: 'Doe', }, diff --git a/test/integrations/destinations/clevertap/router/data.ts b/test/integrations/destinations/clevertap/router/data.ts index 5f25bbe83e7..dea46f52e0d 100644 --- a/test/integrations/destinations/clevertap/router/data.ts +++ b/test/integrations/destinations/clevertap/router/data.ts @@ -162,10 +162,22 @@ export const data = [ msgSms: true, msgemail: true, msgwhatsapp: false, - address: - '{"city":"kolkata","country":"India","postalCode":789223,"state":"WB","street":""}', - custom_mappings: '{"Office":"Trastkiv","Country":"Russia"}', - custom_tags: '["Test_User","Interested_User","DIY_Hobby"]', + address: JSON.stringify({ + city: 'kolkata', + country: 'India', + postalCode: 789223, + state: 'WB', + street: '', + }), + custom_mappings: JSON.stringify({ + Office: 'Trastkiv', + Country: 'Russia', + }), + custom_tags: JSON.stringify([ + 'Test_User', + 'Interested_User', + 'DIY_Hobby', + ]), }, objectId: 'anon_id', }, diff --git a/test/integrations/destinations/clicksend/commonConfig.ts b/test/integrations/destinations/clicksend/commonConfig.ts index c5c49e2b926..d68c466ce7d 100644 --- a/test/integrations/destinations/clicksend/commonConfig.ts +++ b/test/integrations/destinations/clicksend/commonConfig.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; export const destination = { ID: 'random_id', Name: 'clicksend', @@ -7,8 +8,8 @@ export const destination = { }, }, Config: { - clicksendUsername: 'dummy', - clicksendPassword: 'dummy', + clicksendUsername: secret1, + clicksendPassword: secret1, defaultCampaignScheduleUnit: 'day', defaultCampaignSchedule: '2', defaultSource: 'php', @@ -74,8 +75,8 @@ export const routerInstrumentationErrorStatTags = { module: 'destination', }; export const commonIdentifyOutput = { - address_line_1: '{"city":"New York","country":"USA","pinCode":"123456"}', - address_line_2: '{"city":"New York","country":"USA","pinCode":"123456"}', + address_line_1: JSON.stringify({ city: 'New York', country: 'USA', pinCode: '123456' }), + address_line_2: JSON.stringify({ city: 'New York', country: 'USA', pinCode: '123456' }), city: 'New York', email: 'abc@gmail.com', first_name: 'John', @@ -93,6 +94,6 @@ export const processInstrumentationErrorStatTags = { }; export const commonHeader = { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/clicksend/dataDelivery/data.ts b/test/integrations/destinations/clicksend/dataDelivery/data.ts index f376e757ea9..cb3430af1d7 100644 --- a/test/integrations/destinations/clicksend/dataDelivery/data.ts +++ b/test/integrations/destinations/clicksend/dataDelivery/data.ts @@ -1,5 +1,6 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessToken } from '../../../common/secrets'; export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', @@ -32,7 +33,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -44,7 +45,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -56,7 +57,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -68,7 +69,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -83,7 +84,7 @@ export const singleMetadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -224,8 +225,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 404, metadata: generateMetadata(1), - error: - '{"http_code":404,"response_code":"NOT_FOUND","response_msg":"Contact record not found.","data":null}', + error: JSON.stringify({ + http_code: 404, + response_code: 'NOT_FOUND', + response_msg: 'Contact record not found.', + data: null, + }), }, ], }, @@ -267,8 +272,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 404, metadata: generateMetadata(1), - error: - '{"http_code":404,"response_code":"NOT_FOUND","response_msg":"Contact record not found.","data":null}', + error: JSON.stringify({ + http_code: 404, + response_code: 'NOT_FOUND', + response_msg: 'Contact record not found.', + data: null, + }), }, ], }, @@ -310,8 +319,13 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"http_code":400,"response_code":400,"response_msg":"preg_replace(): Parameter mismatch, pattern is a string while replacement is an array","data":null}', + error: JSON.stringify({ + http_code: 400, + response_code: 400, + response_msg: + 'preg_replace(): Parameter mismatch, pattern is a string while replacement is an array', + data: null, + }), }, ], }, @@ -353,8 +367,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 404, metadata: generateMetadata(1), - error: - '{"http_code":404,"response_code":"NOT_FOUND","response_msg":"Your list is not found.","data":null}', + error: JSON.stringify({ + http_code: 404, + response_code: 'NOT_FOUND', + response_msg: 'Your list is not found.', + data: null, + }), }, ], }, diff --git a/test/integrations/destinations/clicksend/maskedSecrets.ts b/test/integrations/destinations/clicksend/maskedSecrets.ts new file mode 100644 index 00000000000..22256c7d5f0 --- /dev/null +++ b/test/integrations/destinations/clicksend/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret1)}`; diff --git a/test/integrations/destinations/clicksend/router/data.ts b/test/integrations/destinations/clicksend/router/data.ts index 5a9da7e7a65..0c072800db6 100644 --- a/test/integrations/destinations/clicksend/router/data.ts +++ b/test/integrations/destinations/clicksend/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { commonInput, destination, @@ -11,8 +12,8 @@ const commonDestination = { ID: 'random_id', Name: 'clicksend', Config: { - clicksendPassword: 'dummy', - clicksendUsername: 'dummy', + clicksendPassword: secret1, + clicksendUsername: secret1, defaultCampaignSchedule: '2', defaultCampaignScheduleUnit: 'day', defaultSenderId: 'abc@gmail.com', @@ -129,7 +130,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms-campaigns/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -172,7 +173,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -196,8 +197,16 @@ export const data = [ body: { FORM: {}, JSON: { - address_line_1: '{"city":"New York","country":"USA","pinCode":"123456"}', - address_line_2: '{"city":"New York","country":"USA","pinCode":"123456"}', + address_line_1: JSON.stringify({ + city: 'New York', + country: 'USA', + pinCode: '123456', + }), + address_line_2: JSON.stringify({ + city: 'New York', + country: 'USA', + pinCode: '123456', + }), city: 'New York', contact_id: '111', email: 'abc@gmail.com', @@ -211,7 +220,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/lists/123345/contacts/111', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PUT', @@ -381,7 +390,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms-campaigns/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -444,7 +453,7 @@ export const data = [ endpoint: 'https://rest.clicksend.com/v3/sms/send', files: {}, headers: { - Authorization: 'Basic ZHVtbXk6ZHVtbXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', diff --git a/test/integrations/destinations/cordial/common.ts b/test/integrations/destinations/cordial/common.ts index 1ebd0db34b0..1ac3a951e7f 100644 --- a/test/integrations/destinations/cordial/common.ts +++ b/test/integrations/destinations/cordial/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'cordial'; @@ -6,7 +7,7 @@ const displayName = 'Cordial'; const destination: Destination = { Config: { apiBaseUrl: 'https://abc.example.com', - apiKey: 'test-api-key', + apiKey: secret1, }, DestinationDefinition: { DisplayName: displayName, @@ -46,7 +47,7 @@ const context = { }; const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hcGkta2V5Og==', + Authorization: authHeader1, }; const properties = { product_id: '622c6f5d5cf86a4c77358033', diff --git a/test/integrations/destinations/cordial/maskedSecrets.ts b/test/integrations/destinations/cordial/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/cordial/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/cordial/network.ts b/test/integrations/destinations/cordial/network.ts index 9cc6f42408e..c7b62c86769 100644 --- a/test/integrations/destinations/cordial/network.ts +++ b/test/integrations/destinations/cordial/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; import { destination } from './common'; export const networkCallsData = [ { httpReq: { url: `${destination.Config.apiBaseUrl}/v2/contacts/email:johndoe@example.com`, headers: { - Authorization: 'Basic dGVzdC1hcGkta2V5Og==', + Authorization: authHeader1, }, method: 'GET', }, @@ -38,7 +39,7 @@ export const networkCallsData = [ httpReq: { url: `${destination.Config.apiBaseUrl}/v2/contacts/6690fe3655e334d6270287b5`, headers: { - Authorization: 'Basic dGVzdC1hcGkta2V5Og==', + Authorization: authHeader1, }, method: 'GET', }, diff --git a/test/integrations/destinations/courier/maskedSecrets.ts b/test/integrations/destinations/courier/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/courier/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/courier/processor/data.ts b/test/integrations/destinations/courier/processor/data.ts index 9371f9e7b25..32e11e6a284 100644 --- a/test/integrations/destinations/courier/processor/data.ts +++ b/test/integrations/destinations/courier/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'courier', @@ -73,7 +74,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -92,7 +93,7 @@ export const data = [ endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -151,7 +152,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -170,7 +171,7 @@ export const data = [ endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -229,7 +230,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -281,7 +282,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -300,7 +301,7 @@ export const data = [ endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/courier/router/data.ts b/test/integrations/destinations/courier/router/data.ts index 268504b9033..83a02f0e898 100644 --- a/test/integrations/destinations/courier/router/data.ts +++ b/test/integrations/destinations/courier/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'courier', @@ -21,7 +22,7 @@ export const data = [ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff', anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: secret1 } }, metadata: { jobId: 1, userId: 'u1' }, }, { @@ -66,7 +67,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.courier.com/inbound/rudderstack', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -88,7 +89,7 @@ export const data = [ }, files: {}, }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: secret1 } }, metadata: [{ jobId: 1, userId: 'u1' }], statusCode: 200, }, diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/business.ts b/test/integrations/destinations/criteo_audience/dataDelivery/business.ts index f30bf73d7a9..a8767869a7d 100644 --- a/test/integrations/destinations/criteo_audience/dataDelivery/business.ts +++ b/test/integrations/destinations/criteo_audience/dataDelivery/business.ts @@ -1,7 +1,9 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload, generateMetadata } from '../../../testUtils'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; + export const headers = { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }; @@ -230,8 +232,15 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ message: 'AudienceId is Invalid. Please Provide Valid AudienceId', response: [ { - error: - '{"errors":[{"traceIdentifier":"80a1a0ba3981b04da847d05700752c77","type":"authorization","code":"audience-invalid"}]}', + error: JSON.stringify({ + errors: [ + { + traceIdentifier: '80a1a0ba3981b04da847d05700752c77', + type: 'authorization', + code: 'audience-invalid', + }, + ], + }), metadata: generateMetadata(4), statusCode: 400, }, diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/data.ts b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts index c603ef66648..f3e3fa911fb 100644 --- a/test/integrations/destinations/criteo_audience/dataDelivery/data.ts +++ b/test/integrations/destinations/criteo_audience/dataDelivery/data.ts @@ -1,3 +1,4 @@ +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; import { generateMetadata } from '../../../testUtils'; import { V1BusinessTestScenarion } from './business'; import { v1OauthScenarios } from './oauth'; @@ -18,7 +19,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -80,7 +81,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/3485/contactlist/expiredAccessToken', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -160,7 +161,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34895/contactlist/invalidAccessToken', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -240,7 +241,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34896/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -320,7 +321,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34897/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -399,7 +400,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34898/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -471,7 +472,7 @@ const v0testCases = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34899/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, diff --git a/test/integrations/destinations/criteo_audience/dataDelivery/other.ts b/test/integrations/destinations/criteo_audience/dataDelivery/other.ts index 145be62528a..2c6a599b125 100644 --- a/test/integrations/destinations/criteo_audience/dataDelivery/other.ts +++ b/test/integrations/destinations/criteo_audience/dataDelivery/other.ts @@ -172,7 +172,7 @@ export const v1OtherScenarios: ProxyV1TestData[] = [ status: 400, response: [ { - error: '{"message":"unknown error"}', + error: JSON.stringify({ message: 'unknown error' }), metadata: generateMetadata(3), statusCode: 400, }, diff --git a/test/integrations/destinations/criteo_audience/maskedSecrets.ts b/test/integrations/destinations/criteo_audience/maskedSecrets.ts new file mode 100644 index 00000000000..30165eac945 --- /dev/null +++ b/test/integrations/destinations/criteo_audience/maskedSecrets.ts @@ -0,0 +1,3 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; diff --git a/test/integrations/destinations/criteo_audience/network.ts b/test/integrations/destinations/criteo_audience/network.ts index 7ccf649e2a0..6fb61153402 100644 --- a/test/integrations/destinations/criteo_audience/network.ts +++ b/test/integrations/destinations/criteo_audience/network.ts @@ -1,5 +1,7 @@ +import { defaultAccessTokenAuthHeader } from '../../common/secrets'; + const headers = { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/destinations/criteo_audience/processor/data.ts b/test/integrations/destinations/criteo_audience/processor/data.ts index 61573fed9b2..14e771d98c2 100644 --- a/test/integrations/destinations/criteo_audience/processor/data.ts +++ b/test/integrations/destinations/criteo_audience/processor/data.ts @@ -1,3 +1,6 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; +import { secret1 } from '../maskedSecrets'; + export const data = [ { name: 'criteo_audience', @@ -11,7 +14,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -58,7 +61,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34894', audienceType: 'email', }, @@ -79,7 +82,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -112,7 +115,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -133,7 +136,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -197,7 +200,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, @@ -218,7 +221,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -252,7 +255,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -264,7 +267,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -298,7 +301,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -319,7 +322,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -360,7 +363,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34894', audienceType: 'email', }, @@ -381,7 +384,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34894/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -407,7 +410,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -428,7 +431,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -466,7 +469,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34895', audienceType: 'madid', }, @@ -487,7 +490,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34895/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -513,7 +516,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -534,7 +537,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -580,7 +583,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, @@ -601,7 +604,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -627,7 +630,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -639,7 +642,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -665,7 +668,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -686,7 +689,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -732,7 +735,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'identityLink', }, @@ -753,7 +756,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -779,7 +782,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -791,7 +794,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -817,7 +820,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -838,7 +841,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -884,7 +887,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'gum', gumCallerId: '329739', @@ -906,7 +909,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -933,7 +936,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -945,7 +948,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -972,7 +975,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 200, @@ -993,7 +996,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -1034,7 +1037,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1051,7 +1054,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1081,13 +1084,13 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1149,7 +1152,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1179,13 +1182,13 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1240,7 +1243,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1270,7 +1273,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -1290,7 +1293,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1307,7 +1310,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1337,13 +1340,13 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -1397,7 +1400,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1427,7 +1430,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, destination: { @@ -1508,7 +1511,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, @@ -1538,7 +1541,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, message: { @@ -1578,7 +1581,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34894', audienceType: 'email', }, @@ -1595,7 +1598,7 @@ export const data = [ { metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, statusCode: 400, diff --git a/test/integrations/destinations/criteo_audience/router/data.ts b/test/integrations/destinations/criteo_audience/router/data.ts index 755d83547e1..faa503caa3e 100644 --- a/test/integrations/destinations/criteo_audience/router/data.ts +++ b/test/integrations/destinations/criteo_audience/router/data.ts @@ -1,3 +1,6 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; +import { secret1 } from '../maskedSecrets'; + export const data = [ { name: 'criteo_audience', @@ -13,13 +16,13 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, ID: 'iwehr83843', }, - metadata: { secret: { accessToken: 'success_access_token' }, jobId: 1, userId: 'u1' }, + metadata: { secret: { accessToken: defaultAccessToken }, jobId: 1, userId: 'u1' }, message: { userId: 'user 1', type: 'audiencelist', @@ -55,13 +58,13 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, ID: 'iwehr83843', }, - metadata: { secret: { accessToken: 'success_access_token' }, jobId: 2, userId: 'u1' }, + metadata: { secret: { accessToken: defaultAccessToken }, jobId: 2, userId: 'u1' }, message: { userId: 'user 1', type: 'audiencelist', @@ -120,7 +123,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -144,15 +147,13 @@ export const data = [ files: {}, }, ], - metadata: [ - { jobId: 1, secret: { accessToken: 'success_access_token' }, userId: 'u1' }, - ], + metadata: [{ jobId: 1, secret: { accessToken: defaultAccessToken }, userId: 'u1' }], batched: false, statusCode: 200, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -167,7 +168,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -196,7 +197,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -220,15 +221,13 @@ export const data = [ files: {}, }, ], - metadata: [ - { jobId: 2, secret: { accessToken: 'success_access_token' }, userId: 'u1' }, - ], + metadata: [{ jobId: 2, secret: { accessToken: defaultAccessToken }, userId: 'u1' }], batched: false, statusCode: 200, destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'madid', }, @@ -254,7 +253,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -262,7 +261,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, jobId: 1, userId: 'u1', @@ -316,7 +315,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceType: 'email', 'warehouse-adAccountId': '123', }, @@ -324,7 +323,7 @@ export const data = [ }, metadata: { secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, jobId: 2, userId: 'u1', @@ -393,7 +392,7 @@ export const data = [ method: 'PATCH', endpoint: 'https://api.criteo.com/2022-10/audiences/34893/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -422,7 +421,7 @@ export const data = [ jobId: 1, userId: 'u1', secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, ], @@ -431,7 +430,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, audienceId: '34893', audienceType: 'email', }, @@ -447,7 +446,7 @@ export const data = [ endpoint: 'https://api.criteo.com/2022-10/audiences/23848494844100489/contactlist', headers: { - Authorization: 'Bearer success_access_token', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -476,7 +475,7 @@ export const data = [ jobId: 2, userId: 'u1', secret: { - accessToken: 'success_access_token', + accessToken: defaultAccessToken, }, }, ], @@ -485,7 +484,7 @@ export const data = [ destination: { Config: { clientId: 'abcdef8-f49-4cd6-b4c5-958b3d66d431', - clientSecret: 'sjhdkhfrz6yc9LrRRIPimE9h53jADLccXTykHCcA6eEoFR4rXQg', + clientSecret: secret1, 'warehouse-adAccountId': '123', audienceType: 'email', }, diff --git a/test/integrations/destinations/custify/deleteUsers/data.ts b/test/integrations/destinations/custify/deleteUsers/data.ts index 22a120770a1..0d0b758f926 100644 --- a/test/integrations/destinations/custify/deleteUsers/data.ts +++ b/test/integrations/destinations/custify/deleteUsers/data.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; const destType = 'custify'; const commonData = { name: destType, @@ -48,7 +49,7 @@ export const data = [ }, ], config: { - apiToken: 'dummyApiKey', + apiToken: secret1, }, }, ], @@ -83,7 +84,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, ], @@ -114,7 +115,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, ], @@ -123,7 +124,9 @@ export const data = [ output: { response: { status: 400, - body: [{ statusCode: 400, error: '{"error":"User: rudder3 has a problem"}' }], + body: [ + { statusCode: 400, error: JSON.stringify({ error: 'User: rudder3 has a problem' }) }, + ], }, }, }, @@ -142,7 +145,7 @@ export const data = [ {}, ], config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/custify/maskedSecrets.ts b/test/integrations/destinations/custify/maskedSecrets.ts new file mode 100644 index 00000000000..da90788f323 --- /dev/null +++ b/test/integrations/destinations/custify/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = undefined; + +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/custify/network.ts b/test/integrations/destinations/custify/network.ts index 242f54c97b2..5bddb89ad16 100644 --- a/test/integrations/destinations/custify/network.ts +++ b/test/integrations/destinations/custify/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -39,7 +40,7 @@ export const networkCallsData = [ method: 'delete', url: 'https://api.custify.com/people?user_id=rudder1', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, }, httpRes: { @@ -56,7 +57,7 @@ export const networkCallsData = [ method: 'delete', url: 'https://api.custify.com/people?user_id=rudder2', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, }, httpRes: { @@ -72,7 +73,7 @@ export const networkCallsData = [ method: 'delete', url: 'https://api.custify.com/people?user_id=rudder3', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/custify/processor/data.ts b/test/integrations/destinations/custify/processor/data.ts index b5bd8bd753f..e53005b2ac5 100644 --- a/test/integrations/destinations/custify/processor/data.ts +++ b/test/integrations/destinations/custify/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'custify', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -63,7 +64,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -120,7 +121,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -173,7 +174,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -230,7 +231,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -300,7 +301,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -371,7 +372,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: true, }, ID: 'custify-1234', @@ -422,7 +423,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -478,7 +479,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -529,7 +530,7 @@ export const data = [ endpoint: 'https://api.custify.com/event', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -572,7 +573,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apiKey_key_test_001', + apiKey: secret2, sendAnonymousId: false, }, ID: 'custify-1234', @@ -631,7 +632,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, diff --git a/test/integrations/destinations/custify/router/data.ts b/test/integrations/destinations/custify/router/data.ts index a88f36fc698..bbefaf755c4 100644 --- a/test/integrations/destinations/custify/router/data.ts +++ b/test/integrations/destinations/custify/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader2, authHeader3, secret2, secret3 } from '../maskedSecrets'; export const data = [ { name: 'custify', @@ -12,7 +13,7 @@ export const data = [ { description: 'Group callw with all parameters', destination: { - Config: { apiKey: 'apiKey_key_test_001', sendAnonymousId: false }, + Config: { apiKey: secret2, sendAnonymousId: false }, ID: 'custify-1234', }, metadata: { jobId: 1, userId: 'u1' }, @@ -54,7 +55,7 @@ export const data = [ { description: 'Identify with all parameters', destination: { - Config: { apiKeyToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiKeyToken: secret3, listId: 'correctListId123' }, ID: 'custify-1234', }, metadata: { jobId: 2, userId: 'u1' }, @@ -108,7 +109,7 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apiKey_key_test_001', + Authorization: authHeader2, Accept: 'application/json', }, params: {}, @@ -139,7 +140,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'apiKey_key_test_001', sendAnonymousId: false }, + Config: { apiKey: secret2, sendAnonymousId: false }, ID: 'custify-1234', }, }, @@ -151,8 +152,8 @@ export const data = [ endpoint: 'https://api.custify.com/people', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer undefined', Accept: 'application/json', + Authorization: authHeader3, }, params: {}, body: { @@ -189,7 +190,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKeyToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiKeyToken: secret3, listId: 'correctListId123' }, ID: 'custify-1234', }, }, diff --git a/test/integrations/destinations/customerio/maskedSecrets.ts b/test/integrations/destinations/customerio/maskedSecrets.ts new file mode 100644 index 00000000000..ff4c3b6cd40 --- /dev/null +++ b/test/integrations/destinations/customerio/maskedSecrets.ts @@ -0,0 +1,15 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const secret5 = path.basename(__dirname) + 5; +export const secret6 = path.basename(__dirname) + 6; +export const secret7 = path.basename(__dirname) + 7; +export const secret8 = path.basename(__dirname) + 8; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; +export const authHeader2 = `Basic ${base64Convertor(secret3 + ':' + secret4)}`; +export const authHeader3 = `Basic ${base64Convertor(secret5 + ':' + secret6)}`; +export const authHeader4 = `Basic ${base64Convertor(secret7 + ':' + secret8)}`; diff --git a/test/integrations/destinations/customerio/processor/data.ts b/test/integrations/destinations/customerio/processor/data.ts index 92cea4250d8..a9957449ba4 100644 --- a/test/integrations/destinations/customerio/processor/data.ts +++ b/test/integrations/destinations/customerio/processor/data.ts @@ -1,3 +1,17 @@ +import { + authHeader1, + secret1, + secret2, + authHeader2, + secret3, + secret4, + authHeader3, + secret5, + secret6, + authHeader4, + secret7, + secret8, +} from '../maskedSecrets'; export const data = [ { name: 'customerio', @@ -25,8 +39,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -52,7 +66,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/cio_1234', userId: 'cio_1234', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -143,7 +157,7 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', + siteID: secret1, }, }, }, @@ -247,8 +261,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -283,7 +297,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/123456', userId: '123456', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -371,8 +385,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -475,8 +489,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -511,7 +525,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/test@gmail.com', userId: '123456', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -585,8 +599,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -620,7 +634,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -692,8 +706,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -725,7 +739,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -797,8 +811,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -830,7 +844,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -901,8 +915,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -935,7 +949,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1023,8 +1037,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1057,7 +1071,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1145,8 +1159,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1169,7 +1183,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices/abcxyz', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1248,8 +1262,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1272,7 +1286,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices/somel', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1350,8 +1364,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1375,7 +1389,7 @@ export const data = [ 'https://track.customer.io/api/v1/customers/test@rudderstack.com/devices/somel', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1452,8 +1466,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1544,8 +1558,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1577,7 +1591,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/devices', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1654,8 +1668,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1688,7 +1702,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1767,8 +1781,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1800,7 +1814,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1878,8 +1892,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -1911,7 +1925,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -1989,8 +2003,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2022,7 +2036,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2101,8 +2115,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2134,7 +2148,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2213,8 +2227,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2238,7 +2252,7 @@ export const data = [ 'https://track.customer.io/api/v1/customers/12345/devices/sample_device_token', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2328,8 +2342,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2363,7 +2377,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/123456', userId: '123456', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2437,8 +2451,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2472,7 +2486,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2544,8 +2558,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2577,7 +2591,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2649,8 +2663,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2682,7 +2696,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2753,8 +2767,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2787,7 +2801,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2875,8 +2889,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -2909,7 +2923,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -2997,8 +3011,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3021,7 +3035,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices/abcxyz', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3100,8 +3114,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3124,7 +3138,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices/somel', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3201,8 +3215,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3293,8 +3307,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3327,7 +3341,7 @@ export const data = [ 'https://track-eu.customer.io/api/v1/customers/test@rudderstack.com/devices', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3404,8 +3418,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3438,7 +3452,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/events', userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3517,8 +3531,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3550,7 +3564,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3628,8 +3642,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3661,7 +3675,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3739,8 +3753,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3772,7 +3786,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3851,8 +3865,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3884,7 +3898,7 @@ export const data = [ endpoint: 'https://track-eu.customer.io/api/v1/customers/12345/devices', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -3963,8 +3977,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -3988,7 +4002,7 @@ export const data = [ 'https://track-eu.customer.io/api/v1/customers/12345/devices/sample_device_token', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -4059,8 +4073,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4078,7 +4092,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4165,8 +4179,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4184,7 +4198,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4269,8 +4283,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4288,7 +4302,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4375,8 +4389,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4394,7 +4408,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/test@rudderstack.com/events', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4491,8 +4505,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: 'abc', - apiKey: 'xyz', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4510,7 +4524,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/dummy-user-id-100/events', headers: { - Authorization: 'Basic YWJjOnh5eg==', + Authorization: authHeader1, }, params: {}, body: { @@ -4605,8 +4619,8 @@ export const data = [ destination: { Config: { datacenter: 'EU', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -4624,7 +4638,7 @@ export const data = [ method: 'PUT', endpoint: 'https://track-eu.customer.io/api/v1/customers/dummy-user-id-100', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, params: {}, body: { @@ -4729,9 +4743,9 @@ export const data = [ ResponseRules: null, }, Config: { - apiKey: 'a292d85ac36de15fc219', + apiKey: secret4, datacenter: 'US', - siteID: 'eead090ab9e2e35004dc', + siteID: secret3, }, Enabled: true, Transformations: [], @@ -4756,7 +4770,7 @@ export const data = [ method: 'PUT', endpoint: 'https://track.customer.io/api/v1/customers/xaviercharles@hotmail.com', headers: { - Authorization: 'Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=', + Authorization: authHeader2, }, params: {}, body: { @@ -4856,9 +4870,9 @@ export const data = [ ResponseRules: null, }, Config: { - apiKey: 'a292d85ac36de15fc219', + apiKey: secret4, datacenter: 'US', - siteID: 'eead090ab9e2e35004dc', + siteID: secret3, }, Enabled: true, Transformations: [], @@ -4883,7 +4897,7 @@ export const data = [ method: 'PUT', endpoint: 'https://track.customer.io/api/v1/customers/xaviercharles', headers: { - Authorization: 'Basic ZWVhZDA5MGFiOWUyZTM1MDA0ZGM6YTI5MmQ4NWFjMzZkZTE1ZmMyMTk=', + Authorization: authHeader2, }, params: {}, body: { @@ -5033,10 +5047,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5058,7 +5072,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5210,10 +5224,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5235,7 +5249,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5386,10 +5400,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5411,7 +5425,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5562,10 +5576,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5587,7 +5601,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5735,10 +5749,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5760,7 +5774,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -5911,10 +5925,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -5936,7 +5950,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6088,10 +6102,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6113,7 +6127,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/events', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6265,10 +6279,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6290,7 +6304,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6441,10 +6455,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6466,7 +6480,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6614,10 +6628,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6639,7 +6653,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6790,10 +6804,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'DESAU SAI', + apiKey: secret6, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'DESU SAI', + siteID: secret5, }, Enabled: true, Transformations: [], @@ -6815,7 +6829,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/e91e0378-63fe-11ec-82ac-0a028ee659c3/devices', headers: { - Authorization: 'Basic REVTVSBTQUk6REVTQVUgU0FJ', + Authorization: authHeader3, }, params: {}, body: { @@ -6932,10 +6946,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -6956,7 +6970,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7085,10 +7099,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7109,7 +7123,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7241,10 +7255,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7265,7 +7279,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7397,10 +7411,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7421,7 +7435,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7553,10 +7567,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7577,7 +7591,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7723,10 +7737,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'US', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7747,7 +7761,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -7893,10 +7907,10 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'ef32c3f60fb98f39ef35', + apiKey: secret8, datacenter: 'EU', deviceTokenEventName: 'device_token_registered', - siteID: 'c0efdbd20b9fbe24a7e2', + siteID: secret7, }, Enabled: true, Transformations: [], @@ -7917,7 +7931,7 @@ export const data = [ method: 'POST', endpoint: 'https://track-eu.customer.io/api/v2/batch', headers: { - Authorization: 'Basic YzBlZmRiZDIwYjlmYmUyNGE3ZTI6ZWYzMmMzZjYwZmI5OGYzOWVmMzU=', + Authorization: authHeader4, }, params: {}, body: { @@ -8028,8 +8042,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -8063,7 +8077,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -8135,8 +8149,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -8168,7 +8182,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -8234,8 +8248,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -8261,7 +8275,7 @@ export const data = [ endpoint: 'https://track.customer.io/api/v1/customers/12345/events', userId: '12345', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, }, version: '1', params: {}, @@ -8301,8 +8315,8 @@ export const data = [ destination: { Config: { datacenter: 'US', - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, diff --git a/test/integrations/destinations/customerio/router/data.ts b/test/integrations/destinations/customerio/router/data.ts index 12751477109..0f4d6fe0eb6 100644 --- a/test/integrations/destinations/customerio/router/data.ts +++ b/test/integrations/destinations/customerio/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'customerio', @@ -65,8 +66,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -109,8 +110,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -147,8 +148,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -185,8 +186,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -207,7 +208,7 @@ export const data = [ type: 'REST', method: 'PUT', endpoint: 'https://track.customer.io/api/v1/customers/123456', - headers: { Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=' }, + headers: { Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -237,8 +238,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -248,7 +249,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://track.customer.io/api/v1/customers/12345/events', - headers: { Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=' }, + headers: { Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -277,8 +278,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, @@ -289,7 +290,7 @@ export const data = [ method: 'POST', endpoint: 'https://track.customer.io/api/v2/batch', headers: { - Authorization: 'Basic NDZiZTU0NzY4ZTdkNDlhYjI2Mjg6ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -335,8 +336,8 @@ export const data = [ destination: { Config: { datacenterEU: false, - siteID: '46be54768e7d49ab2628', - apiKey: 'dummyApiKey', + siteID: secret1, + apiKey: secret2, }, }, }, diff --git a/test/integrations/destinations/customerio_audience/common.ts b/test/integrations/destinations/customerio_audience/common.ts index 91723cc12c6..a0c917efa8b 100644 --- a/test/integrations/destinations/customerio_audience/common.ts +++ b/test/integrations/destinations/customerio_audience/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; import { Connection, Destination } from '../../../../src/types'; import { VDM_V2_SCHEMA_VERSION } from '../../../../src/v0/util/constant'; @@ -7,10 +8,10 @@ const displayName = 'Customer.io Audience'; const channel = 'web'; const destination: Destination = { Config: { - apiKey: 'test-api-key', + apiKey: secret2, appApiKey: 'test-app-api-key', connectionMode: 'cloud', - siteId: 'test-site-id', + siteId: secret1, }, DestinationDefinition: { DisplayName: displayName, @@ -75,7 +76,7 @@ const RouterInstrumentationErrorStatTags = { const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1zaXRlLWlkOnRlc3QtYXBpLWtleQ==', + Authorization: authHeader1, }; const params = { diff --git a/test/integrations/destinations/customerio_audience/maskedSecrets.ts b/test/integrations/destinations/customerio_audience/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/customerio_audience/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/delighted/maskedSecrets.ts b/test/integrations/destinations/delighted/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/delighted/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/delighted/network.ts b/test/integrations/destinations/delighted/network.ts index 1ccc785ea32..ce7c7da9dc5 100644 --- a/test/integrations/destinations/delighted/network.ts +++ b/test/integrations/destinations/delighted/network.ts @@ -1,9 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { url: 'https://api.delighted.com/v1/people.json', method: 'GET', - headers: { Authorization: `Basic ZHVtbXlBcGlLZXk=` }, + headers: { Authorization: authHeader1 }, params: { email: 'identified_user@email.com', }, @@ -17,7 +19,7 @@ export const networkCallsData = [ httpReq: { url: 'https://api.delighted.com/v1/people.json', method: 'GET', - headers: { Authorization: `Basic ZHVtbXlBcGlLZXlmb3JmYWlsdXJl` }, + headers: { Authorization: authHeader1 }, params: { email: 'unidentified_user@email.com', }, @@ -31,9 +33,9 @@ export const networkCallsData = [ httpReq: { url: 'https://api.delighted.com/v1/people.json', method: 'GET', - headers: { Authorization: `Basic ZHVtbXlBcGlLZXlmb3JmYWlsdXJl` }, + headers: { Authorization: authHeader1 }, params: { - email: 'test@rudderlabs.com', + email: 'test429@rudderlabs.com', }, }, httpRes: { diff --git a/test/integrations/destinations/delighted/processor/data.ts b/test/integrations/destinations/delighted/processor/data.ts index f35c2d8ecb8..41d4b8987fb 100644 --- a/test/integrations/destinations/delighted/processor/data.ts +++ b/test/integrations/destinations/delighted/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'delighted', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -77,7 +78,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.delighted.com/v1/people.json', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -116,7 +117,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -186,7 +187,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -211,7 +212,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -295,7 +296,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -320,7 +321,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKeyforfailure', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -409,7 +410,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -497,7 +498,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -585,7 +586,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -666,7 +667,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -754,7 +755,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -847,7 +848,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -918,7 +919,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.delighted.com/v1/people.json', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -956,7 +957,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKeyforfailure', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [ @@ -995,7 +996,7 @@ export const data = [ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22', originalTimestamp: '2019-10-14T09:03:17.562Z', type: 'track', - userId: 'test@rudderlabs.com', + userId: 'test429@rudderlabs.com', event: 'Product Reviewed', properties: { review_id: '12345', @@ -1017,8 +1018,10 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Error occurred while checking user: {}","destinationResponse":{"response":{},"status":429}}', + error: JSON.stringify({ + message: 'Error occurred while checking user: {}', + destinationResponse: { response: {}, status: 429 }, + }), statTags: { destType: 'DELIGHTED', errorCategory: 'network', diff --git a/test/integrations/destinations/delighted/router/data.ts b/test/integrations/destinations/delighted/router/data.ts index b9e98823831..776f0680a9f 100644 --- a/test/integrations/destinations/delighted/router/data.ts +++ b/test/integrations/destinations/delighted/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'delighted', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], @@ -54,7 +55,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], @@ -120,7 +121,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -131,7 +132,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], @@ -151,7 +152,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -162,7 +163,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, channel: 'email', delay: 0, eventNamesSettings: [{ event: '' }], diff --git a/test/integrations/destinations/drip/maskedSecrets.ts b/test/integrations/destinations/drip/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/drip/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/drip/processor/data.ts b/test/integrations/destinations/drip/processor/data.ts index 1874f932fa1..c0065b128e7 100644 --- a/test/integrations/destinations/drip/processor/data.ts +++ b/test/integrations/destinations/drip/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'drip', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -75,7 +76,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -119,7 +120,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -204,7 +205,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -266,7 +267,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -311,7 +312,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -375,7 +376,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/campaigns/915194776/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -413,7 +414,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -475,7 +476,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -517,7 +518,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -600,7 +601,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -662,7 +663,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -704,7 +705,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -764,7 +765,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -806,7 +807,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -887,7 +888,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -949,7 +950,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v3/1809802/shopper_activity/order', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -986,7 +987,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -1054,7 +1055,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v3/1809802/shopper_activity/order', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1097,7 +1098,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: false, @@ -1160,7 +1161,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/events', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1202,7 +1203,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -1443,7 +1444,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.getdrip.com/v2/1809802/subscribers', headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/drip/router/data.ts b/test/integrations/destinations/drip/router/data.ts index 44aac7dd1ab..47bae3d87ef 100644 --- a/test/integrations/destinations/drip/router/data.ts +++ b/test/integrations/destinations/drip/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'drip', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -54,7 +55,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, @@ -123,7 +124,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -134,7 +135,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '', enableUserCreation: true, @@ -163,7 +164,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Basic ZHVtbXlBcGlLZXk=', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -174,7 +175,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, accountId: '1809802', campaignId: '915194776', enableUserCreation: true, diff --git a/test/integrations/destinations/emarsys/dataDelivery/data.ts b/test/integrations/destinations/emarsys/dataDelivery/data.ts index ac3ec780f7a..6f3ae661a7a 100644 --- a/test/integrations/destinations/emarsys/dataDelivery/data.ts +++ b/test/integrations/destinations/emarsys/dataDelivery/data.ts @@ -1,6 +1,6 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; - +import { defaultAccessToken } from '../../../common/secrets'; export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', Accept: 'application/json', @@ -115,7 +115,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -127,7 +127,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -220,12 +220,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: '{"2004":"Invalid key field id: 100"}', + error: JSON.stringify({ '2004': 'Invalid key field id: 100' }), }, { statusCode: 400, metadata: generateMetadata(2), - error: '{"2004":"Invalid key field id: 100"}', + error: JSON.stringify({ '2004': 'Invalid key field id: 100' }), }, ], }, @@ -337,7 +337,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(2), - error: '{"2010":"Contacts with the external id already exist: 3"}', + error: JSON.stringify({ '2010': 'Contacts with the external id already exist: 3' }), }, ], }, @@ -427,12 +427,20 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: '{"replyCode":2004,"replyText":"Invalid key field id: wrong_id","data":""}', + error: JSON.stringify({ + replyCode: 2004, + replyText: 'Invalid key field id: wrong_id', + data: '', + }), }, { statusCode: 400, metadata: generateMetadata(2), - error: '{"replyCode":2004,"replyText":"Invalid key field id: wrong_id","data":""}', + error: JSON.stringify({ + replyCode: 2004, + replyText: 'Invalid key field id: wrong_id', + data: '', + }), }, ], }, @@ -495,12 +503,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(2), - error: '{"2008":"No contact found with the external id: 3"}', + error: JSON.stringify({ '2008': 'No contact found with the external id: 3' }), }, { statusCode: 400, metadata: generateMetadata(3), - error: '{"2008":"No contact found with the external id: 3"}', + error: JSON.stringify({ '2008': 'No contact found with the external id: 3' }), }, { statusCode: 200, @@ -547,7 +555,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: '{"replyCode":1,"replyText":"Action Wrong-id is invalid.","data":""}', + error: JSON.stringify({ + replyCode: 1, + replyText: 'Action Wrong-id is invalid.', + data: '', + }), }, ], }, diff --git a/test/integrations/destinations/engage/deleteUsers/data.ts b/test/integrations/destinations/engage/deleteUsers/data.ts index 5a6ea9d2680..d4e76549c6c 100644 --- a/test/integrations/destinations/engage/deleteUsers/data.ts +++ b/test/integrations/destinations/engage/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'engage', @@ -22,8 +24,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -64,8 +66,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -106,8 +108,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -142,8 +144,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], @@ -181,7 +183,7 @@ export const data = [ }, ], config: { - privateKey: 'abcd', + privateKey: secret2, }, }, ], @@ -219,8 +221,8 @@ export const data = [ }, ], config: { - publicKey: 'abcd', - privateKey: 'efgh', + publicKey: secret1, + privateKey: secret2, }, }, ], diff --git a/test/integrations/destinations/engage/maskedSecrets.ts b/test/integrations/destinations/engage/maskedSecrets.ts new file mode 100644 index 00000000000..cc8cbd337ba --- /dev/null +++ b/test/integrations/destinations/engage/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/engage/network.ts b/test/integrations/destinations/engage/network.ts index a675603d4ec..0a748e4eb33 100644 --- a/test/integrations/destinations/engage/network.ts +++ b/test/integrations/destinations/engage/network.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -61,7 +63,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/6', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { data: { @@ -78,7 +80,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/7', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { status: 200, @@ -91,7 +93,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/8', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { data: { @@ -108,7 +110,7 @@ const deleteNwData = [ url: 'https://api.engage.so/v1/users/9', 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZDplZmdo', + Authorization: authHeader1, }, httpRes: { status: 200, diff --git a/test/integrations/destinations/engage/processor/data.ts b/test/integrations/destinations/engage/processor/data.ts index b0b3ae8ec3e..1bca1fb1a32 100644 --- a/test/integrations/destinations/engage/processor/data.ts +++ b/test/integrations/destinations/engage/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'engage', @@ -21,8 +23,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -83,8 +85,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -127,8 +129,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', @@ -168,8 +169,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -212,8 +213,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', @@ -253,8 +253,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -293,8 +293,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', @@ -326,8 +325,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -357,8 +356,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1/events', @@ -384,8 +382,8 @@ export const data = [ message: { userId: 1, name: 'Contact Customer Care', category: 'Help', type: 'page' }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, }, }, }, @@ -411,8 +409,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1/events', @@ -447,8 +444,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -472,8 +469,7 @@ export const data = [ endpoint: 'https://api.engage.so/v1/lists/17/subscribers/246', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, params: {}, body: { JSON: { subscribed: 'false' }, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -503,8 +499,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -559,8 +555,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -597,8 +593,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/lists/17/subscribers', @@ -630,8 +625,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -656,8 +651,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/lists/17/subscribers/1', diff --git a/test/integrations/destinations/engage/router/data.ts b/test/integrations/destinations/engage/router/data.ts index 248deff04dc..2dec38eebda 100644 --- a/test/integrations/destinations/engage/router/data.ts +++ b/test/integrations/destinations/engage/router/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; + export const data = [ { name: 'engage', @@ -18,8 +20,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -47,8 +49,7 @@ export const data = [ endpoint: 'https://api.engage.so/v1/lists/17/subscribers/246', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, params: {}, body: { JSON: { subscribed: true }, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -56,8 +57,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -107,8 +108,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -155,16 +156,15 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic NDl1cjQ5MHJqZm8zNGdpMDR5MzhyOWdvOm44OWczODl5cjM4OWZnYmVmMHUycmZm', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.engage.so/v1/users/1', }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -199,8 +199,8 @@ export const data = [ }, destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, @@ -224,8 +224,8 @@ export const data = [ metadata: [{ jobId: 3, userId: 'u1' }], destination: { Config: { - publicKey: '49ur490rjfo34gi04y38r9go', - privateKey: 'n89g389yr389fgbef0u2rff', + publicKey: secret1, + privateKey: secret2, listIds: [ { listId: '9834trg3rgy3g08oi9893rgfb' }, { listId: 'f39487tyh49go3h093gh2if2f2' }, diff --git a/test/integrations/destinations/eventbridge/data.ts b/test/integrations/destinations/eventbridge/data.ts index e9edde68dcd..5a5bc3d64d9 100644 --- a/test/integrations/destinations/eventbridge/data.ts +++ b/test/integrations/destinations/eventbridge/data.ts @@ -142,8 +142,97 @@ export const data = [ { output: { DetailType: 'newDetailType', - Detail: - '{"channel":"web","context":{"app":{"build":"1.0.0","name":"RudderLabs JavaScript SDK","namespace":"com.rudderlabs.javascript","version":"1.1.2"},"traits":{"abc":"1234"},"library":{"name":"RudderLabs JavaScript SDK","version":"1.1.2"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","locale":"en-GB","os":{"name":"","version":""},"screen":{"density":2},"page":{"path":"/tests/html/ecomm_test.html","referrer":"http://0.0.0.0:1112/tests/html/","search":"","title":"GA Ecommerce Test","url":"http://0.0.0.0:1112/tests/html/ecomm_test.html"}},"type":"track","messageId":"9116b734-7e6b-4497-ab51-c16744d4487e","originalTimestamp":"2020-06-24T12:05:19.394Z","anonymousId":"38e169a1-3234-46f7-9ceb-c1a6a69005fe","userId":"123","event":"Checkout Started","properties":{"order_id":"5241735","value":31.98,"revenue":31.98,"shipping":4,"coupon":"APPARELSALE","currency":"GBP","products":[{"id":"product-bacon-jam","sku":"sku-1","category":"Merch","name":"Food/Drink","brand":"","variant":"Extra topped","price":3,"quantity":2,"currency":"GBP","position":1,"value":6,"typeOfProduct":"Food","url":"https://www.example.com/product/bacon-jam","image_url":"https://www.example.com/product/bacon-jam.jpg"},{"id":"product-t-shirt","sku":"sku-2","category":"Merch","name":"T-Shirt","brand":"Levis","variant":"White","price":12.99,"quantity":1,"currency":"GBP","position":2,"value":12.99,"typeOfProduct":"Shirt","url":"https://www.example.com/product/t-shirt","image_url":"https://www.example.com/product/t-shirt.jpg"},{"id":"offer-t-shirt","sku":"sku-3","category":"Merch","name":"T-Shirt-on-offer","brand":"Levis","variant":"Black","price":12.99,"quantity":1,"currency":"GBP","value":12.99,"coupon":"APPARELSALE","typeOfProduct":"Shirt","url":"https://www.example.com/product/offer-t-shirt","image_url":"https://www.example.com/product/offer-t-shirt.jpg"}]},"integrations":{"All":true},"sentAt":"2020-06-24T12:05:19.395Z"}', + Detail: JSON.stringify({ + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { abc: '1234' }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.2' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'GA Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2020-06-24T12:05:19.394Z', + anonymousId: '38e169a1-3234-46f7-9ceb-c1a6a69005fe', + userId: '123', + event: 'Checkout Started', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + sku: 'sku-1', + category: 'Merch', + name: 'Food/Drink', + brand: '', + variant: 'Extra topped', + price: 3, + quantity: 2, + currency: 'GBP', + position: 1, + value: 6, + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + }, + { + id: 'product-t-shirt', + sku: 'sku-2', + category: 'Merch', + name: 'T-Shirt', + brand: 'Levis', + variant: 'White', + price: 12.99, + quantity: 1, + currency: 'GBP', + position: 2, + value: 12.99, + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + image_url: 'https://www.example.com/product/t-shirt.jpg', + }, + { + id: 'offer-t-shirt', + sku: 'sku-3', + category: 'Merch', + name: 'T-Shirt-on-offer', + brand: 'Levis', + variant: 'Black', + price: 12.99, + quantity: 1, + currency: 'GBP', + value: 12.99, + coupon: 'APPARELSALE', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + }, + ], + }, + integrations: { All: true }, + sentAt: '2020-06-24T12:05:19.395Z', + }), EventBusName: 'rudder-test1', Resources: [ 'arn:aws:events:*****:*****:event-bus/rudder-test1', @@ -300,8 +389,96 @@ export const data = [ { output: { DetailType: 'newDetailType', - Detail: - '{"channel":"web","context":{"app":{"build":"1.0.0","name":"RudderLabs JavaScript SDK","namespace":"com.rudderlabs.javascript","version":"1.1.2"},"traits":{"abc":"1234"},"library":{"name":"RudderLabs JavaScript SDK","version":"1.1.2"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","locale":"en-GB","os":{"name":"","version":""},"screen":{"density":2},"page":{"path":"/tests/html/ecomm_test.html","referrer":"http://0.0.0.0:1112/tests/html/","search":"","title":"GA Ecommerce Test","url":"http://0.0.0.0:1112/tests/html/ecomm_test.html"}},"type":"track","messageId":"9116b734-7e6b-4497-ab51-c16744d4487e","originalTimestamp":"2020-06-24T12:05:19.394Z","anonymousId":"38e169a1-3234-46f7-9ceb-c1a6a69005fe","event":"Checkout Started","properties":{"order_id":"5241735","value":31.98,"revenue":31.98,"shipping":4,"coupon":"APPARELSALE","currency":"GBP","products":[{"id":"product-bacon-jam","sku":"sku-1","category":"Merch","name":"Food/Drink","brand":"","variant":"Extra topped","price":3,"quantity":2,"currency":"GBP","position":1,"value":6,"typeOfProduct":"Food","url":"https://www.example.com/product/bacon-jam","image_url":"https://www.example.com/product/bacon-jam.jpg"},{"id":"product-t-shirt","sku":"sku-2","category":"Merch","name":"T-Shirt","brand":"Levis","variant":"White","price":12.99,"quantity":1,"currency":"GBP","position":2,"value":12.99,"typeOfProduct":"Shirt","url":"https://www.example.com/product/t-shirt","image_url":"https://www.example.com/product/t-shirt.jpg"},{"id":"offer-t-shirt","sku":"sku-3","category":"Merch","name":"T-Shirt-on-offer","brand":"Levis","variant":"Black","price":12.99,"quantity":1,"currency":"GBP","value":12.99,"coupon":"APPARELSALE","typeOfProduct":"Shirt","url":"https://www.example.com/product/offer-t-shirt","image_url":"https://www.example.com/product/offer-t-shirt.jpg"}]},"integrations":{"All":true},"sentAt":"2020-06-24T12:05:19.395Z"}', + Detail: JSON.stringify({ + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.2', + }, + traits: { abc: '1234' }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.2' }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', + locale: 'en-GB', + os: { name: '', version: '' }, + screen: { density: 2 }, + page: { + path: '/tests/html/ecomm_test.html', + referrer: 'http://0.0.0.0:1112/tests/html/', + search: '', + title: 'GA Ecommerce Test', + url: 'http://0.0.0.0:1112/tests/html/ecomm_test.html', + }, + }, + type: 'track', + messageId: '9116b734-7e6b-4497-ab51-c16744d4487e', + originalTimestamp: '2020-06-24T12:05:19.394Z', + anonymousId: '38e169a1-3234-46f7-9ceb-c1a6a69005fe', + event: 'Checkout Started', + properties: { + order_id: '5241735', + value: 31.98, + revenue: 31.98, + shipping: 4, + coupon: 'APPARELSALE', + currency: 'GBP', + products: [ + { + id: 'product-bacon-jam', + sku: 'sku-1', + category: 'Merch', + name: 'Food/Drink', + brand: '', + variant: 'Extra topped', + price: 3, + quantity: 2, + currency: 'GBP', + position: 1, + value: 6, + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + }, + { + id: 'product-t-shirt', + sku: 'sku-2', + category: 'Merch', + name: 'T-Shirt', + brand: 'Levis', + variant: 'White', + price: 12.99, + quantity: 1, + currency: 'GBP', + position: 2, + value: 12.99, + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + image_url: 'https://www.example.com/product/t-shirt.jpg', + }, + { + id: 'offer-t-shirt', + sku: 'sku-3', + category: 'Merch', + name: 'T-Shirt-on-offer', + brand: 'Levis', + variant: 'Black', + price: 12.99, + quantity: 1, + currency: 'GBP', + value: 12.99, + coupon: 'APPARELSALE', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + }, + ], + }, + integrations: { All: true }, + sentAt: '2020-06-24T12:05:19.395Z', + }), EventBusName: 'rudder-test1', Resources: [ 'arn:aws:events:*****:*****:event-bus/rudder-test1', diff --git a/test/integrations/destinations/facebook_conversions/processor/data.ts b/test/integrations/destinations/facebook_conversions/processor/data.ts index 49d2416726c..01c6a6e2d24 100644 --- a/test/integrations/destinations/facebook_conversions/processor/data.ts +++ b/test/integrations/destinations/facebook_conversions/processor/data.ts @@ -323,7 +323,21 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"value":400,"currency":"USD"}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'spin_result', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + value: 400, + currency: 'USD', + }, + }), ], }, }, @@ -442,7 +456,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Search","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Search', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -561,7 +592,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToCart","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddToCart', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -680,7 +728,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'ViewContent', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -806,7 +871,25 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55}],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'ViewContent', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + products: [{ product_id: 1234, quantity: 5, price: 55 }], + content_ids: [1234], + contents: [{ id: 1234, quantity: 5, item_price: 55 }], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -926,7 +1009,26 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"ViewContent","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"category":"randomCategory","content_ids":["randomCategory"],"contents":[{"id":"randomCategory","quantity":1}],"content_type":"product_group","content_category":"randomCategory","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'ViewContent', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + category: 'randomCategory', + content_ids: ['randomCategory'], + contents: [{ id: 'randomCategory', quantity: 1 }], + content_type: 'product_group', + content_category: 'randomCategory', + currency: 'USD', + value: 400, + }, + }), ], }, }, @@ -1045,7 +1147,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToWishlist","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"currency":"USD","value":400,"num_items":0}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddToWishlist', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + currency: 'USD', + value: 400, + num_items: 0, + }, + }), ], }, }, @@ -1174,7 +1293,27 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddPaymentInfo","event_time":1699784211,"action_source":"website","custom_data":{"application_tracking_enabled":1,"content_name":"Checkout","content_type":"product","num_items":1,"products":[{"id":"12809","price":80,"quantity":1}],"revenue":93.99,"content_ids":["12809"],"contents":[{"id":"12809","quantity":1,"item_price":80}],"currency":"USD","value":93.99}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddPaymentInfo', + event_time: 1699784211, + action_source: 'website', + custom_data: { + application_tracking_enabled: 1, + content_name: 'Checkout', + content_type: 'product', + num_items: 1, + products: [{ id: '12809', price: 80, quantity: 1 }], + revenue: 93.99, + content_ids: ['12809'], + contents: [{ id: '12809', quantity: 1, item_price: 80 }], + currency: 'USD', + value: 93.99, + }, + }), ], }, }, @@ -1299,7 +1438,29 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddPaymentInfo","event_time":1699784211,"action_source":"website","custom_data":{"application_tracking_enabled":1,"content_name":"Checkout","content_type":"product","num_items":1,"id":"12809","price":80,"quantity":1,"revenue":93.99,"content_ids":["12809"],"contents":[{"id":"12809","quantity":1,"item_price":80}],"currency":"USD","value":93.99}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddPaymentInfo', + event_time: 1699784211, + action_source: 'website', + custom_data: { + application_tracking_enabled: 1, + content_name: 'Checkout', + content_type: 'product', + num_items: 1, + id: '12809', + price: 80, + quantity: 1, + revenue: 93.99, + content_ids: ['12809'], + contents: [{ id: '12809', quantity: 1, item_price: 80 }], + currency: 'USD', + value: 93.99, + }, + }), ], }, }, @@ -1427,7 +1588,40 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55,"delivery_category":"home_delivery"}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55,"delivery_category":"home_delivery"}],"content_type":"product","currency":"USD","value":400,"num_items":1}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Purchase', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + products: [ + { + product_id: 1234, + quantity: 5, + price: 55, + delivery_category: 'home_delivery', + }, + ], + content_ids: [1234], + contents: [ + { + id: 1234, + quantity: 5, + item_price: 55, + delivery_category: 'home_delivery', + }, + ], + content_type: 'product', + currency: 'USD', + value: 400, + num_items: 1, + }, + }), ], }, }, @@ -1555,7 +1749,34 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"delivery_category":"home_delivery","products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55,"delivery_category":"home_delivery"}],"content_type":"product","currency":"USD","value":400,"num_items":1}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Purchase', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + delivery_category: 'home_delivery', + products: [{ product_id: 1234, quantity: 5, price: 55 }], + content_ids: [1234], + contents: [ + { + id: 1234, + quantity: 5, + item_price: 55, + delivery_category: 'home_delivery', + }, + ], + content_type: 'product', + currency: 'USD', + value: 400, + num_items: 1, + }, + }), ], }, }, @@ -1655,7 +1876,26 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Purchase","event_time":1699784211,"action_source":"website","custom_data":{"content_type":"product_group","revenue":400,"additional_bet_index":0,"products":[{"product_id":1234,"quantity":5,"price":55}],"content_ids":[1234],"contents":[{"id":1234,"quantity":5,"item_price":55}],"currency":"USD","value":400,"num_items":1}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Purchase', + event_time: 1699784211, + action_source: 'website', + custom_data: { + content_type: 'product_group', + revenue: 400, + additional_bet_index: 0, + products: [{ product_id: 1234, quantity: 5, price: 55 }], + content_ids: [1234], + contents: [{ id: 1234, quantity: 5, item_price: 55 }], + currency: 'USD', + value: 400, + num_items: 1, + }, + }), ], }, }, @@ -1776,7 +2016,26 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"AddToCart","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"id":"452345234","quantity":5,"content_ids":"452345234","contents":[{"id":"452345234","quantity":5}],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'AddToCart', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + id: '452345234', + quantity: 5, + content_ids: '452345234', + contents: [{ id: '452345234', quantity: 5 }], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, diff --git a/test/integrations/destinations/facebook_conversions/router/data.ts b/test/integrations/destinations/facebook_conversions/router/data.ts index 5a9c0c513fe..828d5759724 100644 --- a/test/integrations/destinations/facebook_conversions/router/data.ts +++ b/test/integrations/destinations/facebook_conversions/router/data.ts @@ -121,7 +121,21 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"spin_result","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"value":400,"currency":"USD"}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'spin_result', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + value: 400, + currency: 'USD', + }, + }), ], }, }, @@ -159,7 +173,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","zp":"03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4"},"event_name":"Search","event_time":1699784211,"action_source":"website","custom_data":{"revenue":400,"additional_bet_index":0,"content_ids":[],"contents":[],"content_type":"product","currency":"USD","value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + zp: '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + }, + event_name: 'Search', + event_time: 1699784211, + action_source: 'website', + custom_data: { + revenue: 400, + additional_bet_index: 0, + content_ids: [], + contents: [], + content_type: 'product', + currency: 'USD', + value: 400, + }, + }), ], }, }, diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts index 2b4af61ac3e..60f382e5661 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/business.ts @@ -4,7 +4,19 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/confi export const testFormData = { data: [ - '{"user_data":{"external_id":"c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab","client_ip_address":"32.122.223.26","client_user_agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1"},"event_name":"Checkout Step Viewed","event_time":1654772112,"event_source_url":"https://www.my.kaiser.com/checkout","event_id":"4f002656-a7b2-4c17-b9bd-8caa5a29190a","custom_data":{"checkout_id":"26SF29B","site":"www.my.kaiser.com","step":1}}', + JSON.stringify({ + user_data: { + external_id: 'c58f05b5e3cc4796f3181cf07349d306547c00b20841a175b179c6860e6a34ab', + client_ip_address: '32.122.223.26', + client_user_agent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1', + }, + event_name: 'Checkout Step Viewed', + event_time: 1654772112, + event_source_url: 'https://www.my.kaiser.com/checkout', + event_id: '4f002656-a7b2-4c17-b9bd-8caa5a29190a', + custom_data: { checkout_id: '26SF29B', site: 'www.my.kaiser.com', step: 1 }, + }), ], }; export const statTags = { @@ -91,7 +103,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: '{"events_received":1,"fbtrace_id":"facebook_trace_id"}', + error: JSON.stringify({ events_received: 1, fbtrace_id: 'facebook_trace_id' }), statusCode: 200, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts index 0e004c11832..9e38548834a 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/data.ts @@ -467,8 +467,13 @@ export const v0TestData = [ body: { output: { status: 500, - message: - '{"message":"Unhandled random error","type":"RandomException","code":5,"error_subcode":12,"fbtrace_id":"facebook_px_trace_id_10"}', + message: JSON.stringify({ + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }), destinationResponse: { error: { message: 'Unhandled random error', diff --git a/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts b/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts index 154c6f75ad9..a327bd782f2 100644 --- a/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts +++ b/test/integrations/destinations/facebook_pixel/dataDelivery/other.ts @@ -72,8 +72,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ body: { output: { status: 500, - message: - '{"message":"Unhandled random error","type":"RandomException","code":5,"error_subcode":12,"fbtrace_id":"facebook_px_trace_id_10"}', + message: JSON.stringify({ + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }), statTags: { ...statTags, errorType: 'retryable', @@ -81,8 +86,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ }, response: [ { - error: - '{"message":"Unhandled random error","type":"RandomException","code":5,"error_subcode":12,"fbtrace_id":"facebook_px_trace_id_10"}', + error: JSON.stringify({ + message: 'Unhandled random error', + type: 'RandomException', + code: 5, + error_subcode: 12, + fbtrace_id: 'facebook_px_trace_id_10', + }), statusCode: 500, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/facebook_pixel/router/data.ts b/test/integrations/destinations/facebook_pixel/router/data.ts index f3df4506a5a..5b41c7696f9 100644 --- a/test/integrations/destinations/facebook_pixel/router/data.ts +++ b/test/integrations/destinations/facebook_pixel/router/data.ts @@ -135,7 +135,15 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08"},"event_name":"spin_result","event_time":1697278611,"action_source":"other","custom_data":{"additional_bet_index":0,"value":400}}', + JSON.stringify({ + user_data: { + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + }, + event_name: 'spin_result', + event_time: 1697278611, + action_source: 'other', + custom_data: { additional_bet_index: 0, value: 400 }, + }), ], }, }, @@ -174,7 +182,24 @@ export const data = [ JSON_ARRAY: {}, FORM: { data: [ - '{"user_data":{"external_id":"8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92","em":"48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08","ph":"593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579","ge":"252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111","ln":"532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25","fn":"2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747","client_ip_address":"0.0.0.0","client_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},"event_name":"identify","event_time":1697221800,"event_id":"84e26acc-56a5-4835-8233-591137fca468","action_source":"website"}', + JSON.stringify({ + user_data: { + external_id: + '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', + em: '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', + ph: '593a6d58f34eb5c3de4f47e38d1faaa7d389fafe332a85400b1e54498391c579', + ge: '252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111', + ln: '532eaabd9574880dbf76b9b8cc00832c20a6ec113d682299550d7a6e0f345e25', + fn: '2c2ccf28d806f6f9a34b67aa874d2113b7ac1444f1a4092541b8b75b84771747', + client_ip_address: '0.0.0.0', + client_user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + }, + event_name: 'identify', + event_time: 1697221800, + event_id: '84e26acc-56a5-4835-8233-591137fca468', + action_source: 'website', + }), ], }, }, diff --git a/test/integrations/destinations/factorsai/data.ts b/test/integrations/destinations/factorsai/data.ts index be13c291f42..cf1286140d6 100644 --- a/test/integrations/destinations/factorsai/data.ts +++ b/test/integrations/destinations/factorsai/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from './maskedSecrets'; export const data = [ { name: 'factorsai', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -87,7 +88,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -110,7 +111,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -175,7 +176,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -251,7 +252,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -274,7 +275,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -332,7 +333,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -355,7 +356,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -403,7 +404,7 @@ export const data = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -426,7 +427,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -532,7 +533,7 @@ export const data = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -555,7 +556,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -631,7 +632,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -654,7 +655,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -726,7 +727,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', @@ -749,7 +750,7 @@ export const data = [ { destination: { Config: { - factorsAIApiKey: 'sdgerghsdfhsdhsdh432141dfgdfsg', + factorsAIApiKey: secret1, }, }, message: { @@ -799,7 +800,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic c2RnZXJnaHNkZmhzZGhzZGg0MzIxNDFkZmdkZnNnOg==', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.factors.ai/integrations/rudderstack_platform', diff --git a/test/integrations/destinations/factorsai/maskedSecrets.ts b/test/integrations/destinations/factorsai/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/factorsai/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/fb/dataDelivery/business.ts b/test/integrations/destinations/fb/dataDelivery/business.ts index 156dc265725..57e4f3447b2 100644 --- a/test/integrations/destinations/fb/dataDelivery/business.ts +++ b/test/integrations/destinations/fb/dataDelivery/business.ts @@ -10,19 +10,96 @@ export const testData1 = { 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }; export const testData2 = { - extinfo: '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { _logTime: 1567333011693, _eventName: 'Viewed Screen', fb_description: 'Main.1233' }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -123,7 +200,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: '{"events_received":1,"fbtrace_id":"facebook_trace_id"}', + error: JSON.stringify({ events_received: 1, fbtrace_id: 'facebook_trace_id' }), statusCode: 200, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/fb/dataDelivery/data.ts b/test/integrations/destinations/fb/dataDelivery/data.ts index dfa5dbc65e3..1fb4e394168 100644 --- a/test/integrations/destinations/fb/dataDelivery/data.ts +++ b/test/integrations/destinations/fb/dataDelivery/data.ts @@ -23,11 +23,70 @@ export const existingTestData = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -103,11 +162,70 @@ export const existingTestData = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -167,11 +285,70 @@ export const existingTestData = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -249,10 +426,31 @@ export const existingTestData = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Main.1233', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -319,10 +517,31 @@ export const existingTestData = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Main.1233', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', diff --git a/test/integrations/destinations/fb/processor/data.ts b/test/integrations/destinations/fb/processor/data.ts index b0b4ba9ecf8..049e1728057 100644 --- a/test/integrations/destinations/fb/processor/data.ts +++ b/test/integrations/destinations/fb/processor/data.ts @@ -610,11 +610,70 @@ export const data = [ 'ud[fn]': '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -795,11 +854,70 @@ export const data = [ 'ud[ge]': '62c66a7a5dd70c3146618063c344e531e6d4b59e379808443ce962b3abd63c5a', 'ud[ln]': '3547cb112ac4489af2310c0626cdba6f3097a2ad5a3b42ddd3b59c76c7a079a3', 'ud[ph]': '588211a01b10feacbf7988d97a06e86c18af5259a7f457fd8759b7f7409a7d1f', - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",640,480,"1.23",0,0,0,"Europe/Berlin"]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 640, + 480, + '1.23', + 0, + 0, + 0, + 'Europe/Berlin', + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), advertiser_tracking_enabled: '0', application_tracking_enabled: '0', }, @@ -903,10 +1021,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Main.1233"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Main.1233', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1003,10 +1142,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Main Screen","fb_description":"Main"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Main Screen', + fb_description: 'Main', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1187,10 +1347,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["i2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'i2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1287,10 +1468,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1387,10 +1589,31 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -1561,10 +1784,69 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', advertiser_id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', @@ -1741,10 +2023,69 @@ export const data = [ XML: {}, JSON_ARRAY: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":400,"fb_currency":"GBP","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345","567"]}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 400, + fb_currency: 'GBP', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345', '567'], + }, + ]), app_user_id: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', advertiser_id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R', 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', @@ -1843,9 +2184,31 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - extinfo: '["i2","","","","","","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"Viewed Screen","fb_description":"Viewed Main Screen1 by expicit call Screen"}]', + extinfo: JSON.stringify([ + 'i2', + '', + '', + '', + '', + '', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'Viewed Screen', + fb_description: 'Viewed Main Screen1 by expicit call Screen', + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', @@ -2163,10 +2526,69 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - extinfo: - '["a2","","","","8.1.0","Redmi 6","","","Banglalink",0,100,"50.00",0,0,0,""]', - custom_events: - '[{"_logTime":1567333011693,"_eventName":"spin_result","_valueToSum":0,"fb_currency":"INR","additional_bet_index":0,"battle_id":"N/A","bet_amount":9,"bet_level":1,"bet_multiplier":1,"coin_balance":9466052,"current_module_name":"CasinoGameModule","days_in_game":0,"extra_param":"N/A","fb_profile":"0","featureGameType":"N/A","game_fps":30,"game_id":"fireEagleBase","game_name":"FireEagleSlots","gem_balance":0,"graphicsQuality":"HD","idfa":"2bf99787-33d2-4ae2-a76a-c49672f97252","internetReachability":"ReachableViaLocalAreaNetwork","isLowEndDevice":"False","is_auto_spin":"False","is_turbo":"False","isf":"False","ishighroller":"False","jackpot_win_amount":90,"jackpot_win_type":"Silver","level":6,"lifetime_gem_balance":0,"no_of_spin":1,"player_total_battles":0,"player_total_shields":0,"start_date":"2019-08-01","total_payments":0,"tournament_id":"T1561970819","userId":"c82cbdff-e5be-4009-ac78-cdeea09ab4b1","versionSessionCount":2,"win_amount":0,"fb_content_id":["123","345"]}]', + extinfo: JSON.stringify([ + 'a2', + '', + '', + '', + '8.1.0', + 'Redmi 6', + '', + '', + 'Banglalink', + 0, + 100, + '50.00', + 0, + 0, + 0, + '', + ]), + custom_events: JSON.stringify([ + { + _logTime: 1567333011693, + _eventName: 'spin_result', + _valueToSum: 0, + fb_currency: 'INR', + additional_bet_index: 0, + battle_id: 'N/A', + bet_amount: 9, + bet_level: 1, + bet_multiplier: 1, + coin_balance: 9466052, + current_module_name: 'CasinoGameModule', + days_in_game: 0, + extra_param: 'N/A', + fb_profile: '0', + featureGameType: 'N/A', + game_fps: 30, + game_id: 'fireEagleBase', + game_name: 'FireEagleSlots', + gem_balance: 0, + graphicsQuality: 'HD', + idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252', + internetReachability: 'ReachableViaLocalAreaNetwork', + isLowEndDevice: 'False', + is_auto_spin: 'False', + is_turbo: 'False', + isf: 'False', + ishighroller: 'False', + jackpot_win_amount: 90, + jackpot_win_type: 'Silver', + level: 6, + lifetime_gem_balance: 0, + no_of_spin: 1, + player_total_battles: 0, + player_total_shields: 0, + start_date: '2019-08-01', + total_payments: 0, + tournament_id: 'T1561970819', + userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1', + versionSessionCount: 2, + win_amount: 0, + fb_content_id: ['123', '345'], + }, + ]), 'ud[em]': '48ddb93f0b30c475423fe177832912c5bcdce3cc72872f8051627967ef278e08', advertiser_tracking_enabled: '0', application_tracking_enabled: '0', diff --git a/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts b/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts index 6334094b3a9..1b81fc46cb2 100644 --- a/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts +++ b/test/integrations/destinations/fb_custom_audience/dataDelivery/business.ts @@ -107,8 +107,13 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"audience_id":"aud1","session_id":"123","num_received":4,"num_invalid_entries":0,"invalid_entry_samples":{}}', + error: JSON.stringify({ + audience_id: 'aud1', + session_id: '123', + num_received: 4, + num_invalid_entries: 0, + invalid_entry_samples: {}, + }), statusCode: 200, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/fb_custom_audience/router/data.ts b/test/integrations/destinations/fb_custom_audience/router/data.ts index 5946c7d6b8c..7a78cdfcbbb 100644 --- a/test/integrations/destinations/fb_custom_audience/router/data.ts +++ b/test/integrations/destinations/fb_custom_audience/router/data.ts @@ -10,7 +10,7 @@ import { rETLRecordV2RouterInvalidRequest, } from './rETL'; import { mockFns } from '../mocks'; - +import { defaultAccessToken } from '../../../common/secrets'; export const data = [ { name: 'fb_custom_audience', @@ -142,7 +142,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -265,7 +265,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -339,7 +339,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -351,7 +351,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -398,7 +398,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -453,7 +453,7 @@ export const data = [ dontBatch: false, jobId: 4, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -465,7 +465,7 @@ export const data = [ dontBatch: false, jobId: 5, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -477,7 +477,7 @@ export const data = [ dontBatch: false, jobId: 6, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -496,7 +496,7 @@ export const data = [ dontBatch: false, jobId: 7, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -583,7 +583,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -595,7 +595,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -670,7 +670,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -753,7 +753,7 @@ export const data = [ dontBatch: false, jobId: 4, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -765,7 +765,7 @@ export const data = [ dontBatch: false, jobId: 5, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -777,7 +777,7 @@ export const data = [ dontBatch: false, jobId: 6, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -821,7 +821,7 @@ export const data = [ dontBatch: false, jobId: 7, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -911,7 +911,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -923,7 +923,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -935,7 +935,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -947,7 +947,7 @@ export const data = [ dontBatch: false, jobId: 4, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -1014,7 +1014,7 @@ export const data = [ destinationId: 'default-destinationId', workspaceId: 'default-workspaceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, diff --git a/test/integrations/destinations/freshmarketer/maskedSecrets.ts b/test/integrations/destinations/freshmarketer/maskedSecrets.ts new file mode 100644 index 00000000000..30889820e0e --- /dev/null +++ b/test/integrations/destinations/freshmarketer/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Token token=${secret1}`; diff --git a/test/integrations/destinations/freshmarketer/processor/data.ts b/test/integrations/destinations/freshmarketer/processor/data.ts index 07112d762f9..825d59fb91d 100644 --- a/test/integrations/destinations/freshmarketer/processor/data.ts +++ b/test/integrations/destinations/freshmarketer/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshmarketer', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -97,7 +99,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -122,7 +124,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -208,7 +210,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -233,7 +235,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -318,7 +320,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -402,7 +404,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -509,7 +511,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -533,7 +535,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -621,7 +623,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -708,7 +710,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -796,7 +798,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -884,7 +886,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -951,7 +953,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1054,7 +1056,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1158,7 +1160,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1270,7 +1272,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1309,7 +1311,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -1400,7 +1402,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1419,7 +1421,7 @@ export const data = [ method: 'POST', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1523,7 +1525,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1630,7 +1632,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1741,7 +1743,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1852,7 +1854,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1963,7 +1965,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2001,7 +2003,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2095,7 +2097,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2133,7 +2135,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2177,7 +2179,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2227,7 +2229,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2283,7 +2285,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2369,7 +2371,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2397,7 +2399,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -2436,7 +2438,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2494,7 +2496,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2580,7 +2582,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2608,7 +2610,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -2705,7 +2707,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2812,7 +2814,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2845,7 +2847,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -2936,7 +2938,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -3050,7 +3052,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', rudderEventsToFreshmarketerEvents: [ { @@ -3104,7 +3106,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -3132,7 +3134,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', diff --git a/test/integrations/destinations/freshmarketer/router/data.ts b/test/integrations/destinations/freshmarketer/router/data.ts index 03690b6e276..4d88409265c 100644 --- a/test/integrations/destinations/freshmarketer/router/data.ts +++ b/test/integrations/destinations/freshmarketer/router/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshmarketer', @@ -12,7 +14,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -58,7 +60,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -103,7 +105,7 @@ export const data = [ }, { destination: { - Config: { apiKey: 'dummyApiKey', domain: 'domain-rudder.myfreshworks.com' }, + Config: { apiKey: secret1, domain: 'domain-rudder.myfreshworks.com' }, }, metadata: { jobId: 3, userId: 'u1' }, message: { @@ -165,7 +167,7 @@ export const data = [ endpoint: 'https://rudderstack-476952domain3105.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -195,7 +197,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -208,7 +210,7 @@ export const data = [ endpoint: 'https://rudderstack-476952domain3105.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -238,7 +240,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -284,7 +286,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -293,7 +295,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', domain: 'domain-rudder.myfreshworks.com' }, + Config: { apiKey: secret1, domain: 'domain-rudder.myfreshworks.com' }, }, }, ], diff --git a/test/integrations/destinations/freshsales/maskedSecrets.ts b/test/integrations/destinations/freshsales/maskedSecrets.ts new file mode 100644 index 00000000000..30889820e0e --- /dev/null +++ b/test/integrations/destinations/freshsales/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Token token=${secret1}`; diff --git a/test/integrations/destinations/freshsales/processor/data.ts b/test/integrations/destinations/freshsales/processor/data.ts index 7c0eca0926c..f7fc525cddc 100644 --- a/test/integrations/destinations/freshsales/processor/data.ts +++ b/test/integrations/destinations/freshsales/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshsales', @@ -76,7 +78,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -116,7 +118,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -202,7 +204,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -227,7 +229,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -313,7 +315,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: @@ -338,7 +340,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -403,7 +405,7 @@ export const data = [ endpoint: 'https://rudderstack-476952domain3105.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -448,7 +450,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'rudderstack-476952domain3105.myfreshworks.com', }, }, @@ -532,7 +534,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -639,7 +641,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -663,7 +665,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -751,7 +753,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -838,7 +840,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -926,7 +928,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -993,7 +995,7 @@ export const data = [ endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_accounts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1081,7 +1083,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1184,7 +1186,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1288,7 +1290,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1400,7 +1402,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', rudderEventsToFreshsalesEvents: [ { @@ -1446,7 +1448,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -1536,7 +1538,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1555,7 +1557,7 @@ export const data = [ method: 'POST', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1659,7 +1661,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1766,7 +1768,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1877,7 +1879,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -1988,7 +1990,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2099,7 +2101,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2137,7 +2139,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2231,7 +2233,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2269,7 +2271,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/sales_activities', @@ -2313,7 +2315,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2425,7 +2427,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2532,7 +2534,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, @@ -2565,7 +2567,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Token token=dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://domain-rudder.myfreshworks.com/crm/sales/api/contacts/upsert', @@ -2656,7 +2658,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, domain: 'domain-rudder.myfreshworks.com', }, }, diff --git a/test/integrations/destinations/freshsales/router/data.ts b/test/integrations/destinations/freshsales/router/data.ts index 8548d337b31..7e8f05cc8dd 100644 --- a/test/integrations/destinations/freshsales/router/data.ts +++ b/test/integrations/destinations/freshsales/router/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'freshsales', @@ -68,7 +70,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'hrkjfergeferf', + apiKey: secret1, domain: 'rudderstack-479541159204968909.myfreshworks.com', }, Enabled: true, @@ -97,7 +99,7 @@ export const data = [ endpoint: 'https://rudderstack-479541159204968909.myfreshworks.com/crm/sales/api/contacts/upsert', headers: { - Authorization: 'Token token=hrkjfergeferf', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -158,7 +160,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'hrkjfergeferf', + apiKey: secret1, domain: 'rudderstack-479541159204968909.myfreshworks.com', }, Enabled: true, diff --git a/test/integrations/destinations/fullstory/maskedSecrets.ts b/test/integrations/destinations/fullstory/maskedSecrets.ts new file mode 100644 index 00000000000..aaf5a0cbb37 --- /dev/null +++ b/test/integrations/destinations/fullstory/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${secret1}`; +export const authHeader2 = `Basic ${secret2}`; diff --git a/test/integrations/destinations/fullstory/processor/data.ts b/test/integrations/destinations/fullstory/processor/data.ts index 9c8d29c7e80..6f9e6a425e9 100644 --- a/test/integrations/destinations/fullstory/processor/data.ts +++ b/test/integrations/destinations/fullstory/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'fullstory', @@ -85,7 +86,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyfullstoryAPIKey', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -161,7 +162,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.fullstory.com/v2/events', headers: { - authorization: 'Basic dummyfullstoryAPIKey', + authorization: authHeader1, 'content-type': 'application/json', }, params: {}, @@ -222,7 +223,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyfullstoryAPIKey', + apiKey: secret1, }, Enabled: true, Transformations: [], @@ -309,7 +310,7 @@ export const data = [ }, }, Config: { - apiKey: 'fullstoryAPIKey', + apiKey: secret2, }, Enabled: true, Transformations: [], @@ -354,7 +355,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.fullstory.com/v2/users', headers: { - authorization: 'Basic fullstoryAPIKey', + authorization: authHeader2, 'content-type': 'application/json', }, params: {}, @@ -403,7 +404,7 @@ export const data = [ }, }, Config: { - apiKey: 'fullstoryAPIKey', + apiKey: secret2, }, Enabled: true, Transformations: [], @@ -442,7 +443,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.fullstory.com/v2/users', headers: { - authorization: 'Basic fullstoryAPIKey', + authorization: authHeader2, 'content-type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/ga/deleteUsers/data.ts b/test/integrations/destinations/ga/deleteUsers/data.ts index 6cbc5d5cfe4..7ef001382c4 100644 --- a/test/integrations/destinations/ga/deleteUsers/data.ts +++ b/test/integrations/destinations/ga/deleteUsers/data.ts @@ -1,4 +1,5 @@ import { AUTH_STATUS_INACTIVE } from '../../../../../src/adapters/networkhandler/authConstants'; +import { secret1, secret2, secret3 } from '../maskedSecrets'; export const data = [ { @@ -10,7 +11,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "valid_token" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret1 } }), }, body: [ { @@ -52,7 +53,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "expired_token" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret2 } }), }, body: [ { @@ -95,7 +96,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "valid_token_1" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret1 } }), }, body: [ { @@ -147,7 +148,7 @@ export const data = [ input: { request: { headers: { - 'x-rudder-dest-info': '{"secret": { "access_token": "no_permissions_token" }}', + 'x-rudder-dest-info': JSON.stringify({ secret: { access_token: secret3 } }), }, body: [ { diff --git a/test/integrations/destinations/ga/maskedSecrets.ts b/test/integrations/destinations/ga/maskedSecrets.ts new file mode 100644 index 00000000000..3ab9722af98 --- /dev/null +++ b/test/integrations/destinations/ga/maskedSecrets.ts @@ -0,0 +1,8 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; diff --git a/test/integrations/destinations/ga/network.ts b/test/integrations/destinations/ga/network.ts index acfe5db4305..7d9f0c326de 100644 --- a/test/integrations/destinations/ga/network.ts +++ b/test/integrations/destinations/ga/network.ts @@ -1,3 +1,5 @@ +import { authHeader1, authHeader2, authHeader3 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -12,7 +14,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-5', }, headers: { - Authorization: 'Bearer valid_token', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -44,7 +46,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-5', }, headers: { - Authorization: 'Bearer valid_token', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -76,7 +78,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-6', }, headers: { - Authorization: 'Bearer expired_token', + Authorization: authHeader2, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -107,7 +109,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-6', }, headers: { - Authorization: 'Bearer expired_token', + Authorization: authHeader2, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -138,7 +140,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -170,7 +172,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -202,7 +204,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -238,7 +240,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -270,7 +272,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer valid_token_1', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', }, @@ -302,7 +304,7 @@ const deleteNwData = [ webPropertyId: 'UA-123456789-7', }, headers: { - Authorization: 'Bearer no_permissions_token', + Authorization: authHeader3, Accept: 'application/json', 'Content-Type': 'application/json', }, diff --git a/test/integrations/destinations/ga4/dataDelivery/business.ts b/test/integrations/destinations/ga4/dataDelivery/business.ts index 80271abbdbb..2f1f76c60c0 100644 --- a/test/integrations/destinations/ga4/dataDelivery/business.ts +++ b/test/integrations/destinations/ga4/dataDelivery/business.ts @@ -248,7 +248,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: '[GA4 Response Handler] - Request Processed Successfully', response: [ { - error: '{"validationMessages":[]}', + error: JSON.stringify({ validationMessages: [] }), metadata: generateMetadata(1), statusCode: 200, }, diff --git a/test/integrations/destinations/gainsight_px/processor/data.ts b/test/integrations/destinations/gainsight_px/processor/data.ts index 3dfe86aa985..0b2c2bf9b9b 100644 --- a/test/integrations/destinations/gainsight_px/processor/data.ts +++ b/test/integrations/destinations/gainsight_px/processor/data.ts @@ -1068,7 +1068,7 @@ export const data = [ JSON: { attributes: { description: 'Stringify test for object values', - nested: '{"a":[1,2,3],"b":{"c":1}}', + nested: JSON.stringify({ a: [1, 2, 3], b: { c: 1 } }), arr: '[1,2,3]', }, propertyKey: 'AP-XABC-123', @@ -1205,7 +1205,7 @@ export const data = [ JSON: { attributes: { description: 'Stringify test for object values', - nested: '{"a":[1,2,3],"b":{"c":1}}', + nested: JSON.stringify({ a: [1, 2, 3], b: { c: 1 } }), arr: '[1,2,3]', }, propertyKey: 'AP-XABC-123', diff --git a/test/integrations/destinations/gainsight_px/router/data.ts b/test/integrations/destinations/gainsight_px/router/data.ts index 3a5255f7d2c..8ccbc868621 100644 --- a/test/integrations/destinations/gainsight_px/router/data.ts +++ b/test/integrations/destinations/gainsight_px/router/data.ts @@ -448,10 +448,13 @@ export const data = [ date: 1624704082335, attributes: { array: '[1,2,3]', - nested: '{"json":"test"}', + nested: JSON.stringify({ json: 'test' }), status: 'testing', description: 'Example track call', - fullyNested: '[{"a":1,"b":2},{"a":1,"b":[1,2,3]}]', + fullyNested: JSON.stringify([ + { a: 1, b: 2 }, + { a: 1, b: [1, 2, 3] }, + ]), }, url: 'file:///Users/anurajguha/workspace/simple-html-test/index.html', referrer: '$direct', @@ -595,8 +598,12 @@ export const data = [ body: { output: [ { - error: - '{"message":"error while fetching user: \\"403403 Forbidden\\"","destinationResponse":"403403 Forbidden"}', + error: JSON.stringify({ + message: + 'error while fetching user: "403403 Forbidden"', + destinationResponse: + '403403 Forbidden', + }), statTags: { destType: 'GAINSIGHT_PX', destinationId: destination2.ID, diff --git a/test/integrations/destinations/gladly/maskedSecrets.ts b/test/integrations/destinations/gladly/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/gladly/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/gladly/network.ts b/test/integrations/destinations/gladly/network.ts index 8c1c2287387..8507ae1ccc9 100644 --- a/test/integrations/destinations/gladly/network.ts +++ b/test/integrations/destinations/gladly/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; const deleteNwData = [ { httpReq: { @@ -5,7 +6,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=test%40rudderlabs.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -19,7 +20,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=test%2B2%40rudderlabs.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -46,7 +47,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?phoneNumber=%2B91%209999999988', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -85,7 +86,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=test6%40rudderlabs.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { @@ -99,7 +100,7 @@ const deleteNwData = [ url: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles?email=abc', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/gladly/processor/data.ts b/test/integrations/destinations/gladly/processor/data.ts index e81af999fbc..f04e1706538 100644 --- a/test/integrations/destinations/gladly/processor/data.ts +++ b/test/integrations/destinations/gladly/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'gladly', @@ -29,8 +30,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -98,8 +99,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -166,7 +167,7 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -242,8 +243,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -276,7 +277,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -333,8 +334,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -366,7 +367,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@2', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -421,8 +422,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -452,7 +453,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@3', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -500,8 +501,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -581,8 +582,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -619,7 +620,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -673,8 +674,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -704,7 +705,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', @@ -758,8 +759,8 @@ export const data = [ }, }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -789,7 +790,7 @@ export const data = [ }, endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, userId: '', diff --git a/test/integrations/destinations/gladly/router/data.ts b/test/integrations/destinations/gladly/router/data.ts index 462edd9772b..5af08edb707 100644 --- a/test/integrations/destinations/gladly/router/data.ts +++ b/test/integrations/destinations/gladly/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'gladly', @@ -31,8 +32,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -60,8 +61,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -87,8 +88,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -124,7 +125,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -134,9 +135,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -161,7 +162,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@2', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -171,9 +172,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -196,7 +197,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@3', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -206,9 +207,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -253,8 +254,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -283,8 +284,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -312,8 +313,8 @@ export const data = [ destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, Config: { - apiToken: 'testApiToken', - userName: 'testUserName', + apiToken: secret2, + userName: secret1, domain: 'rudderlabs.us-uat.gladly.qa', }, }, @@ -348,7 +349,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -358,9 +359,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -384,7 +385,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@2', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -394,9 +395,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -419,7 +420,7 @@ export const data = [ endpoint: 'https://rudderlabs.us-uat.gladly.qa/api/v1/customer-profiles/user@3', files: {}, headers: { - Authorization: 'Basic dGVzdFVzZXJOYW1lOnRlc3RBcGlUb2tlbg==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -429,9 +430,9 @@ export const data = [ }, destination: { Config: { - apiToken: 'testApiToken', + apiToken: secret2, domain: 'rudderlabs.us-uat.gladly.qa', - userName: 'testUserName', + userName: secret1, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts index 290e8db0ce4..3a5d3d684b9 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, @@ -8,7 +9,7 @@ import { ProxyV1TestData } from '../../../testTypes'; const API_VERSION = 'v18'; const headers = { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -176,8 +177,26 @@ export const testScenariosForV0API = [ message: 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', }, - message: - '{"code":3,"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]","details":[{"@type":"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure","errors":[{"errorCode":{"conversionAdjustmentUploadError":"CONVERSION_ALREADY_ENHANCED"},"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.","location":{"fieldPathElements":[{"fieldName":"conversion_adjustments","index":0}]}}]}]}', + message: JSON.stringify({ + code: 3, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', + details: [ + { + '@type': 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { conversionAdjustmentUploadError: 'CONVERSION_ALREADY_ENHANCED' }, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.', + location: { + fieldPathElements: [{ fieldName: 'conversion_adjustments', index: 0 }], + }, + }, + ], + }, + ], + }), statTags: expectedStatTags, status: 400, }, @@ -218,8 +237,22 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '[{"results":[{"adjustmentType":"ENHANCEMENT","conversionAction":"customers/7693729833/conversionActions/874224905","adjustmentDateTime":"2021-01-01 12:32:45-08:00","gclidDateTimePair":{"gclid":"1234","conversionDateTime":"2021-01-01 12:32:45-08:00"},"orderId":"12345"}]}]', + error: JSON.stringify([ + { + results: [ + { + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/7693729833/conversionActions/874224905', + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + gclidDateTimePair: { + gclid: '1234', + conversionDateTime: '2021-01-01 12:32:45-08:00', + }, + orderId: '12345', + }, + ], + }, + ]), metadata: generateMetadata(1), statusCode: 200, }, @@ -262,12 +295,51 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ status: 200, body: { output: { - message: - '{"code":3,"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]","details":[{"@type":"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure","errors":[{"errorCode":{"conversionAdjustmentUploadError":"CONVERSION_ALREADY_ENHANCED"},"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.","location":{"fieldPathElements":[{"fieldName":"conversion_adjustments","index":0}]}}]}]}', + message: JSON.stringify({ + code: 3, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', + details: [ + { + '@type': 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { conversionAdjustmentUploadError: 'CONVERSION_ALREADY_ENHANCED' }, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.', + location: { + fieldPathElements: [{ fieldName: 'conversion_adjustments', index: 0 }], + }, + }, + ], + }, + ], + }), response: [ { - error: - '{"code":3,"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]","details":[{"@type":"type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure","errors":[{"errorCode":{"conversionAdjustmentUploadError":"CONVERSION_ALREADY_ENHANCED"},"message":"Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.","location":{"fieldPathElements":[{"fieldName":"conversion_adjustments","index":0}]}}]}]}', + error: JSON.stringify({ + code: 3, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again., at conversion_adjustments[0]', + details: [ + { + '@type': + 'type.googleapis.com/google.ads.googleads.v15.errors.GoogleAdsFailure', + errors: [ + { + errorCode: { + conversionAdjustmentUploadError: 'CONVERSION_ALREADY_ENHANCED', + }, + message: + 'Conversion already has enhancements with the same Order ID and conversion action. Make sure your data is correctly configured and try again.', + location: { + fieldPathElements: [{ fieldName: 'conversion_adjustments', index: 0 }], + }, + }, + ], + }, + ], + }), metadata: generateMetadata(1), statusCode: 400, }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts index d9e1a49689b..1a8e3a8a096 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/dataDelivery/oauth.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; const API_VERSION = 'v18'; import { @@ -39,7 +40,7 @@ const requestPayload = { }; const headers = { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/maskedSecrets.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts index eeb3551cb48..8fb8a9aabbd 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; const API_VERSION = 'v18'; export const networkCallsData = [ @@ -8,7 +9,7 @@ export const networkCallsData = [ query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Product Added'`, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -37,7 +38,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -96,7 +97,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -131,7 +132,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -192,7 +193,7 @@ export const networkCallsData = [ destination: 'google_adwords_enhanced_conversion', }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -253,7 +254,7 @@ export const networkCallsData = [ destination: 'google_adwords_enhanced_conversion', }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -283,7 +284,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -342,7 +343,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', @@ -390,7 +391,7 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_enhanced_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '0987654321', diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts index c33be0d4af4..5128db634d7 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; const API_VERSION = 'v18'; export const data = [ { @@ -12,7 +13,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -131,7 +132,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '1234567890', @@ -189,7 +190,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -212,7 +213,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -326,7 +327,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -359,7 +360,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -465,7 +466,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -498,7 +499,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -618,7 +619,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '11', @@ -672,7 +673,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -695,7 +696,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -808,7 +809,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -840,7 +841,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -902,7 +903,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1072,7 +1073,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1187,7 +1188,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1220,7 +1221,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1329,7 +1330,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '1234567890', @@ -1387,7 +1388,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1410,7 +1411,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1519,7 +1520,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '1234567890', @@ -1573,7 +1574,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1596,7 +1597,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -1700,7 +1701,7 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts index 2d61da37d68..1a4bf08cce4 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -1,10 +1,11 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; const API_VERSION = 'v18'; const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -96,7 +97,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -228,7 +229,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -322,7 +323,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -416,7 +417,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -452,7 +453,7 @@ const events = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, @@ -662,7 +663,7 @@ export const data = [ endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, files: {}, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '11', @@ -696,7 +697,7 @@ export const data = [ { jobId: 1, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -729,7 +730,7 @@ export const data = [ { jobId: 2, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -832,7 +833,7 @@ export const data = [ endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567890:uploadConversionAdjustments`, files: {}, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'ijkl91011', 'login-customer-id': '11', @@ -866,7 +867,7 @@ export const data = [ { jobId: 4, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -899,7 +900,7 @@ export const data = [ { jobId: 5, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -941,7 +942,7 @@ export const data = [ { jobId: 7, secret: { - access_token: 'abcd1234', + access_token: secret1, developer_token: 'ijkl91011', refresh_token: 'efgh5678', }, @@ -973,7 +974,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', developer_token: 'ijkl91011', }, diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts index 818e7a4e1c5..7478355ce15 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret3 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, @@ -44,15 +45,15 @@ const products = [ const headers = { header1: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, header2: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, }; @@ -513,7 +514,7 @@ export const testScenariosForV1API = [ '[Google Ads Offline Conversions Response Handler] - Request processed successfully', response: [ { - error: '{"name":"customers/111-222-3333/operations/abcd="}', + error: JSON.stringify({ name: 'customers/111-222-3333/operations/abcd=' }), metadata: generateMetadata(1), statusCode: 200, }, @@ -557,8 +558,18 @@ export const testScenariosForV1API = [ '[Google Ads Offline Conversions Response Handler] - Request processed successfully', response: [ { - error: - '[{"adjustmentType":"ENHANCEMENT","conversionAction":"customers/1234567891/conversionActions/874224905","adjustmentDateTime":"2021-01-01 12:32:45-08:00","gclidDateTimePair":{"gclid":"1234","conversionDateTime":"2021-01-01 12:32:45-08:00"},"orderId":"12345"}]', + error: JSON.stringify([ + { + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/1234567891/conversionActions/874224905', + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + gclidDateTimePair: { + gclid: '1234', + conversionDateTime: '2021-01-01 12:32:45-08:00', + }, + orderId: '12345', + }, + ]), metadata: generateMetadata(1), statusCode: 200, }, @@ -602,8 +613,18 @@ export const testScenariosForV1API = [ '[Google Ads Offline Conversions Response Handler] - Request processed successfully', response: [ { - error: - '[{"adjustmentType":"ENHANCEMENT","conversionAction":"customers/1234567891/conversionActions/874224905","adjustmentDateTime":"2021-01-01 12:32:45-08:00","gclidDateTimePair":{"gclid":"1234","conversionDateTime":"2021-01-01 12:32:45-08:00"},"orderId":"12345"}]', + error: JSON.stringify([ + { + adjustmentType: 'ENHANCEMENT', + conversionAction: 'customers/1234567891/conversionActions/874224905', + adjustmentDateTime: '2021-01-01 12:32:45-08:00', + gclidDateTimePair: { + gclid: '1234', + conversionDateTime: '2021-01-01 12:32:45-08:00', + }, + orderId: '12345', + }, + ]), metadata: generateMetadata(1), statusCode: 200, }, diff --git a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts index d774bad8697..f71d5c143f6 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/dataDelivery/oauth.ts @@ -1,15 +1,17 @@ +import { authHeader1, authHeader2, secret3 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload, generateProxyV0Payload, } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; const API_VERSION = 'v18'; const commonHeaders = { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }; @@ -277,9 +279,9 @@ export const v1oauthScenarios = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, @@ -307,7 +309,7 @@ export const v1oauthScenarios = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -348,9 +350,9 @@ export const v1oauthScenarios = [ { ...{ ...commonRequestParameters, JSON: { isStoreConversion: false } }, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, @@ -378,7 +380,7 @@ export const v1oauthScenarios = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', diff --git a/test/integrations/destinations/google_adwords_offline_conversions/maskedSecrets.ts b/test/integrations/destinations/google_adwords_offline_conversions/maskedSecrets.ts new file mode 100644 index 00000000000..6b725d44020 --- /dev/null +++ b/test/integrations/destinations/google_adwords_offline_conversions/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/google_adwords_offline_conversions/network.ts b/test/integrations/destinations/google_adwords_offline_conversions/network.ts index 48efbbb7333..ad449076eca 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/network.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2, secret3 } from './maskedSecrets'; const API_VERSION = 'v18'; const commonResponse = { @@ -44,9 +45,9 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -67,9 +68,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -123,9 +124,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -188,9 +189,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -233,9 +234,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -251,9 +252,9 @@ export const networkCallsData = [ data: { validate_only: false }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -282,9 +283,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -318,9 +319,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -343,9 +344,9 @@ export const networkCallsData = [ query: `SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'`, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -372,9 +373,9 @@ export const networkCallsData = [ "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -402,9 +403,9 @@ export const networkCallsData = [ url: `https://googleads.googleapis.com/${API_VERSION}/customers/1234567891/googleAds:searchStream`, data: { query: 'SELECT conversion_custom_variable.name FROM conversion_custom_variable' }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -475,9 +476,9 @@ export const networkCallsData = [ partialFailure: true, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -536,9 +537,9 @@ export const networkCallsData = [ partialFailure: true, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -567,9 +568,9 @@ export const networkCallsData = [ "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -630,9 +631,9 @@ export const networkCallsData = [ partialFailure: true, }, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, method: 'POST', params: { destination: 'google_adwords_offline_conversion' }, @@ -693,9 +694,9 @@ export const networkCallsData = [ }, params: { destination: 'google_adwords_offline_conversion' }, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', @@ -712,9 +713,9 @@ export const networkCallsData = [ "SELECT conversion_action.id FROM conversion_action WHERE conversion_action.name = 'Sign-up - click'", }, headers: { - Authorization: 'Bearer invalidabcd1234', + Authorization: authHeader2, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, method: 'POST', diff --git a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts index dec57c7f5fb..492cc692fd7 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret3 } from '../maskedSecrets'; import { timestampMock } from '../mocks'; const API_VERSION = 'v18'; @@ -102,9 +103,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -180,9 +181,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -280,9 +281,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -392,9 +393,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -470,9 +471,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -570,9 +571,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -682,9 +683,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -760,9 +761,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -860,9 +861,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -972,9 +973,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1050,9 +1051,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -1125,9 +1126,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -1401,9 +1402,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1475,9 +1476,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -1574,9 +1575,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1648,9 +1649,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -1748,9 +1749,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -1822,9 +1823,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -1941,9 +1942,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2023,9 +2024,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Page view', @@ -2114,9 +2115,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2128,9 +2129,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Page view', @@ -2203,9 +2204,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2271,9 +2272,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2351,9 +2352,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, params: { @@ -2405,9 +2406,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2472,9 +2473,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2550,9 +2551,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -2597,9 +2598,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2707,9 +2708,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -2785,9 +2786,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -2859,9 +2860,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -2928,9 +2929,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3007,9 +3008,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -3059,9 +3060,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -3128,9 +3129,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3203,9 +3204,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -3281,9 +3282,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3356,9 +3357,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -3435,9 +3436,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3514,9 +3515,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, params: { @@ -3578,9 +3579,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -3646,9 +3647,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3721,8 +3722,8 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', - developer_token: 'ijkl91011', + access_token: secret1, + developer_token: secret3, refresh_token: 'efgh5678', }, }, @@ -3757,9 +3758,9 @@ export const data = [ endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, files: {}, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, method: 'POST', @@ -3850,9 +3851,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -3929,9 +3930,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': '8617859087', }, params: { @@ -3986,9 +3987,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4041,9 +4042,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4120,9 +4121,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4185,9 +4186,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4240,9 +4241,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4314,9 +4315,9 @@ export const data = [ { metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 400, @@ -4377,9 +4378,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4456,9 +4457,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4520,9 +4521,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4575,9 +4576,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4654,9 +4655,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4719,9 +4720,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4776,9 +4777,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -4855,9 +4856,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -4917,9 +4918,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -4974,9 +4975,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5018,9 +5019,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5080,9 +5081,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5133,9 +5134,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5177,9 +5178,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5239,9 +5240,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5290,9 +5291,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5334,9 +5335,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5391,9 +5392,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5446,9 +5447,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5481,9 +5482,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5525,9 +5526,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1112223333/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, 'login-customer-id': 'logincustomerid', }, params: { @@ -5582,9 +5583,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, statusCode: 200, @@ -5692,9 +5693,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5767,8 +5768,8 @@ export const data = [ error: "You can't use both wbraid and gbraid.", metadata: { secret: { - access_token: 'abcd1234', - developer_token: 'ijkl91011', + access_token: secret1, + developer_token: secret3, refresh_token: 'efgh5678', }, }, @@ -5831,9 +5832,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, }, destination: { @@ -5875,8 +5876,8 @@ export const data = [ "The value '0' does not match the regex pattern, ^([1-9]\\d*(\\.\\d+)?|0\\.\\d+)$", metadata: { secret: { - access_token: 'abcd1234', - developer_token: 'ijkl91011', + access_token: secret1, + developer_token: secret3, refresh_token: 'efgh5678', }, }, diff --git a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts index cf632434be8..e984ee55784 100644 --- a/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_offline_conversions/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret3 } from '../maskedSecrets'; import { timestampMock } from '../mocks'; const API_VERSION = 'v18'; @@ -94,9 +95,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', @@ -210,9 +211,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 2, userId: 'u1', @@ -274,9 +275,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 3, userId: 'u1', @@ -349,9 +350,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 4, userId: 'u1', @@ -424,9 +425,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 5, userId: 'u1', @@ -487,9 +488,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Store sales', customerId: '7693729833' }, body: { @@ -568,9 +569,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Order Completed', @@ -617,18 +618,18 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 3, userId: 'u1', }, { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 4, userId: 'u1', @@ -682,9 +683,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadClickConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Sign-up - click', @@ -771,9 +772,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', @@ -816,9 +817,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/9625812972:uploadCallConversions`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'search', @@ -885,9 +886,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 2, userId: 'u1', @@ -927,9 +928,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 5, userId: 'u1', @@ -1115,9 +1116,9 @@ export const data = [ }, metadata: { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', @@ -1169,9 +1170,9 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/1234556775/offlineUserDataJobs`, headers: { - Authorization: 'Bearer abcd1234', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'developer-token': 'ijkl91011', + 'developer-token': secret3, }, params: { event: 'Store sales', customerId: '1234556775' }, body: { @@ -1225,9 +1226,9 @@ export const data = [ metadata: [ { secret: { - access_token: 'abcd1234', + access_token: secret1, refresh_token: 'efgh5678', - developer_token: 'ijkl91011', + developer_token: secret3, }, jobId: 1, userId: 'u1', diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts index 5a0ea981e29..71cae86521d 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret3 } from '../maskedSecrets'; import { generateGoogleOAuthMetadata, generateProxyV0Payload, @@ -7,7 +8,7 @@ import { const API_VERSION = 'v18'; export const commonHeaders = { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }; @@ -414,7 +415,7 @@ export const testScenariosForV1API = [ dontBatch: false, jobId: 1, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts index 08b1adb1913..297ee8b9cf0 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/dataDelivery/oauth.ts @@ -1,3 +1,4 @@ +import { authHeader2, secret2, secret1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { commonHeaders, commonParams, validRequestPayload1 } from './business'; @@ -32,7 +33,7 @@ export const oauthError = [ params: commonParams, JSON: validRequestPayload1, endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, - accessToken: 'dummy-access', + accessToken: secret1, }), method: 'POST', }, @@ -55,7 +56,7 @@ export const oauthError = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'dummy-access', + accessToken: secret1, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -83,11 +84,11 @@ export const oauthError = [ input: { request: { body: generateProxyV1Payload({ - headers: { ...commonHeaders, Authorization: 'Bearer wrongCustomerID' }, - params: { ...commonParams, customerId: 'wrongCustomerID' }, + headers: { ...commonHeaders, Authorization: authHeader2 }, + params: { ...commonParams, customerId: secret2 }, JSON: validRequestPayload1, endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`, - accessToken: 'wrongCustomerID', + accessToken: secret2, }), method: 'POST', }, @@ -104,7 +105,7 @@ export const oauthError = [ { error: '{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.ads.googleads.v16.errors.GoogleAdsFailure","errors":[{"errorCode":{"authenticationError":"CUSTOMER_NOT_FOUND"},"message":"No customer found for the provided customer id."}],"requestId":"lvB3KOjGHsgduHjt0wCglQ"}]}} during ga_audience response transformation', - metadata: { ...generateMetadata(1), secret: { accessToken: 'wrongCustomerID' } }, + metadata: { ...generateMetadata(1), secret: { accessToken: secret2 } }, statusCode: 401, }, ], diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/maskedSecrets.ts b/test/integrations/destinations/google_adwords_remarketing_lists/maskedSecrets.ts new file mode 100644 index 00000000000..1ee175e1cb9 --- /dev/null +++ b/test/integrations/destinations/google_adwords_remarketing_lists/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +import { defaultAccessToken } from '../../common/secrets'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = defaultAccessToken; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts index f0bb8759c54..a979bd0b6e0 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/network.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2, secret2 } from './maskedSecrets'; const API_VERSION = 'v18'; export const networkCallsData = [ @@ -14,7 +15,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -58,7 +59,7 @@ export const networkCallsData = [ ], }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -73,7 +74,7 @@ export const networkCallsData = [ httpReq: { url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs/18025019461:run`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -96,7 +97,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -117,7 +118,7 @@ export const networkCallsData = [ operations: [{ create: { userIdentifiers: [{ hashedEmail: 'abcd@testmail.com' }] } }], }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -196,7 +197,7 @@ export const networkCallsData = [ ], }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -223,7 +224,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -248,7 +249,7 @@ export const networkCallsData = [ job: { type: 'CUSTOMER_MATCH_USER_LIST', customerMatchUserListMetadata: { - userList: 'customers/wrongCustomerID/userLists/709078448', + userList: `customers/${secret2}/userLists/709078448`, consent: { adPersonalization: 'UNSPECIFIED', adUserData: 'UNSPECIFIED', @@ -257,7 +258,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer wrongCustomerID', + Authorization: authHeader2, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -305,7 +306,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts b/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts index ef9bb85430a..c819e7ef106 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; const API_VERSION = 'v18'; export const data = [ @@ -13,7 +14,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -73,7 +74,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -121,7 +122,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -144,7 +145,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -205,7 +206,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', 'login-customer-id': '8704830944', @@ -239,7 +240,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -262,7 +263,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -324,7 +325,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -357,7 +358,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -380,7 +381,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -455,7 +456,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -488,7 +489,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -545,7 +546,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -578,7 +579,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -634,7 +635,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -666,7 +667,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -710,7 +711,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -742,7 +743,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -806,7 +807,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -838,7 +839,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -1425,7 +1426,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -2710,7 +2711,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2733,7 +2734,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2819,7 +2820,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -2884,7 +2885,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2898,7 +2899,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -2963,7 +2964,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -2986,7 +2987,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -4110,7 +4111,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -5395,7 +5396,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -5409,7 +5410,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -6694,7 +6695,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6717,7 +6718,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6785,7 +6786,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -6850,7 +6851,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6873,7 +6874,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6937,7 +6938,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -6970,7 +6971,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -8094,7 +8095,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -9379,7 +9380,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -9393,7 +9394,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -10678,7 +10679,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10701,7 +10702,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10787,7 +10788,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -10852,7 +10853,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10866,7 +10867,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -10931,7 +10932,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -10954,7 +10955,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11040,7 +11041,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11103,7 +11104,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11117,7 +11118,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11177,7 +11178,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11200,7 +11201,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11260,7 +11261,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11302,7 +11303,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11405,7 +11406,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11465,7 +11466,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11507,7 +11508,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11530,7 +11531,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11603,7 +11604,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11644,7 +11645,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11667,7 +11668,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11740,7 +11741,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11781,7 +11782,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11804,7 +11805,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11879,7 +11880,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -11923,7 +11924,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -11946,7 +11947,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, @@ -12021,7 +12022,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer dummy-access', + Authorization: authHeader1, 'Content-Type': 'application/json', 'developer-token': 'dummy-dev-token', }, @@ -12062,7 +12063,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummy-access', + access_token: secret1, refresh_token: 'dummy-refresh', developer_token: 'dummy-dev-token', }, diff --git a/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts b/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts index 1f341889378..0c64eab9513 100644 --- a/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts +++ b/test/integrations/destinations/google_adwords_remarketing_lists/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader3, secret3 } from '../maskedSecrets'; import { rETLAudienceRouterRequest } from './audience'; import { rETLRecordRouterRequest, @@ -33,7 +34,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -84,7 +85,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -128,7 +129,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -179,7 +180,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -223,7 +224,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -273,7 +274,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -324,7 +325,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -390,7 +391,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -443,7 +444,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -487,7 +488,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -558,7 +559,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -571,7 +572,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -614,7 +615,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -667,7 +668,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -710,7 +711,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -762,7 +763,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -815,7 +816,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -878,7 +879,7 @@ export const data = [ method: 'POST', endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: { @@ -916,7 +917,7 @@ export const data = [ destinationId: 'default-destinationId', dontBatch: false, secret: { - access_token: 'default-accessToken', + access_token: secret3, }, sourceId: 'default-sourceId', userId: 'default-userId', diff --git a/test/integrations/destinations/hs/dataDelivery/business.ts b/test/integrations/destinations/hs/dataDelivery/business.ts index 2239abfb951..44748de0a10 100644 --- a/test/integrations/destinations/hs/dataDelivery/business.ts +++ b/test/integrations/destinations/hs/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; const commonStatTags = { @@ -24,11 +25,32 @@ export const businessData = [ { endpoint: 'https://api.hubapi.com/contacts/v1/contact/batch/', JSON_ARRAY: { - batch: - '[{"email":"identify111051@test.com","properties":[{"property":"firstname","value":"John1051"},{"property":"lastname","value":"Sparrow1051"}]},{"email":"identify111052@test.com","properties":[{"property":"firstname","value":"John1052"},{"property":"lastname","value":"Sparrow1052"}]},{"email":"identify111053@test.com","properties":[{"property":"firstname","value":"John1053"},{"property":"lastname","value":"Sparrow1053"}]}]', + batch: JSON.stringify([ + { + email: 'identify111051@test.com', + properties: [ + { property: 'firstname', value: 'John1051' }, + { property: 'lastname', value: 'Sparrow1051' }, + ], + }, + { + email: 'identify111052@test.com', + properties: [ + { property: 'firstname', value: 'John1052' }, + { property: 'lastname', value: 'Sparrow1052' }, + ], + }, + { + email: 'identify111053@test.com', + properties: [ + { property: 'firstname', value: 'John1053' }, + { property: 'lastname', value: 'Sparrow1053' }, + ], + }, + ]), }, headers: { - Authorization: 'Bearer validApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, @@ -76,11 +98,32 @@ export const businessData = [ { endpoint: 'https://api.hubapi.com/contacts/v1/contact/batch/', JSON_ARRAY: { - batch: - '[{"email":"identify111051@test.com","properties":[{"property":"firstname","value":"John1051"},{"property":"lastname","value":"Sparrow1051"}]},{"email":"identify111052@test.con","properties":[{"property":"firstname","value":"John1052"},{"property":"lastname","value":"Sparrow1052"}]},{"email":"identify111053@test.com","properties":[{"property":"firstname","value":"John1053"},{"property":"lastname","value":"Sparrow1053"}]}]', + batch: JSON.stringify([ + { + email: 'identify111051@test.com', + properties: [ + { property: 'firstname', value: 'John1051' }, + { property: 'lastname', value: 'Sparrow1051' }, + ], + }, + { + email: 'identify111052@test.con', + properties: [ + { property: 'firstname', value: 'John1052' }, + { property: 'lastname', value: 'Sparrow1052' }, + ], + }, + { + email: 'identify111053@test.com', + properties: [ + { property: 'firstname', value: 'John1053' }, + { property: 'lastname', value: 'Sparrow1053' }, + ], + }, + ]), }, headers: { - Authorization: 'Bearer inValidApiKey', + Authorization: authHeader2, 'Content-Type': 'application/json', }, }, @@ -181,7 +224,7 @@ export const businessData = [ { headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer validAccessToken', + Authorization: authHeader1, }, method: 'POST', endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', @@ -460,7 +503,7 @@ export const businessData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, JSON: { email: 'osvaldocostaferreira98@gmail.com', @@ -508,7 +551,7 @@ export const businessData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer invalid-dummy-access-token', + Authorization: authHeader2, }, JSON: { email: 'osvaldocostaferreira98@gmail.com', @@ -560,7 +603,7 @@ export const businessData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, JSON: { inputs: [{ to: { id: 1 }, from: { id: 9405415215 }, type: 'contact_to_company' }], diff --git a/test/integrations/destinations/hs/dataDelivery/other.ts b/test/integrations/destinations/hs/dataDelivery/other.ts index 202b665a51e..0aab89465d6 100644 --- a/test/integrations/destinations/hs/dataDelivery/other.ts +++ b/test/integrations/destinations/hs/dataDelivery/other.ts @@ -1,4 +1,5 @@ import { generateMetadata } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonStatTags = { destType: 'HS', @@ -17,7 +18,7 @@ const commonBody = { method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, files: {}, @@ -188,7 +189,7 @@ export const otherData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, files: {}, diff --git a/test/integrations/destinations/hs/maskedSecrets.ts b/test/integrations/destinations/hs/maskedSecrets.ts new file mode 100644 index 00000000000..935d0e6d37e --- /dev/null +++ b/test/integrations/destinations/hs/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; +export const authHeader4 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/hs/network.ts b/test/integrations/destinations/hs/network.ts index 9d8658ff6b0..1b3658dc254 100644 --- a/test/integrations/destinations/hs/network.ts +++ b/test/integrations/destinations/hs/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2, authHeader3, authHeader4 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -424,7 +425,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, }, httpRes: { @@ -436,7 +437,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dummy-access-tokensuccess', + Authorization: authHeader2, }, }, httpRes: { @@ -466,7 +467,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token-hs-additonal-email', + Authorization: authHeader3, }, }, httpRes: { @@ -496,7 +497,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dummy-access-tokenmultiple', + Authorization: authHeader4, }, }, httpRes: { @@ -865,7 +866,7 @@ export const networkCallsData = [ url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', method: 'POST', headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, }, }, httpRes: { @@ -883,7 +884,7 @@ export const networkCallsData = [ headers: { 'User-Agent': 'RudderLabs', 'Content-Type': 'application/json', - Authorization: 'Bearer validApiKey', + Authorization: authHeader1, }, }, httpRes: { @@ -897,7 +898,7 @@ export const networkCallsData = [ headers: { 'User-Agent': 'RudderLabs', 'Content-Type': 'application/json', - Authorization: 'Bearer inValidApiKey', + Authorization: authHeader2, }, }, httpRes: { @@ -942,7 +943,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer validAccessToken', + Authorization: authHeader1, }, }, httpRes: { @@ -1010,7 +1011,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, }, httpRes: { @@ -1024,7 +1025,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer invalid-dummy-access-token', + Authorization: authHeader2, }, }, httpRes: { @@ -1044,7 +1045,7 @@ export const networkCallsData = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/hs/processor/data.ts b/test/integrations/destinations/hs/processor/data.ts index fa3c98737c4..99ce1e6560c 100644 --- a/test/integrations/destinations/hs/processor/data.ts +++ b/test/integrations/destinations/hs/processor/data.ts @@ -1,15 +1,16 @@ +import { authHeader1, secret1, authHeader2, secret2, secret3, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, generateSimplifiedIdentifyPayload } from '../../../testUtils'; const commonOutputHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }; const destination: Destination = { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1356,7 +1357,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [], @@ -1392,7 +1393,7 @@ export const data = [ source: 'rETL', operation: 'createObject', headers: { - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1488,7 +1489,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [], @@ -1524,7 +1525,7 @@ export const data = [ source: 'rETL', operation: 'updateObject', headers: { - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1917,7 +1918,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: 'dummy-hubId', apiKey: 'dummy-apikey', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'legacyApi', lookupField: '', blacklistedEvents: [ @@ -1951,7 +1952,7 @@ export const data = [ 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -2042,7 +2043,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-tokensuccess', + accessToken: secret2, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -2079,7 +2080,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/103604', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-tokensuccess', + Authorization: authHeader2, }, params: {}, operation: 'updateContacts', @@ -2165,7 +2166,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -2202,7 +2203,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, operation: 'createContacts', @@ -2287,7 +2288,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-tokenmultiple', + accessToken: secret4, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -2391,7 +2392,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '1', apiKey: '1', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -2455,7 +2456,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -2814,7 +2815,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -2913,7 +2914,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -2977,7 +2978,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3030,7 +3031,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -3094,7 +3095,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3142,7 +3143,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -3247,7 +3248,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -3310,7 +3311,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3887,7 +3888,7 @@ export const data = [ destination: { Config: { authorizationType: 'legacyApiKey', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikeysuccess', apiVersion: 'newApi', @@ -3980,7 +3981,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -4180,7 +4181,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', hubspotEvents: [ @@ -4533,7 +4534,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'legacyApi', lookupField: 'lookupField', hubspotEvents: [ @@ -4663,7 +4664,7 @@ export const data = [ apiKey: 'dummy-apikey', hubID: 'dummy-hubId', authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'legacyApi', }, Enabled: true, @@ -4685,7 +4686,7 @@ export const data = [ endpoint: 'https://track.hubspot.com/v1/event', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: { _a: 'dummy-hubId', @@ -5269,7 +5270,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', eventFilteringOption: 'disable', @@ -5466,7 +5467,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', eventFilteringOption: 'disable', diff --git a/test/integrations/destinations/hs/router/config.ts b/test/integrations/destinations/hs/router/config.ts index 89a0c13d1a8..6d14fd80e32 100644 --- a/test/integrations/destinations/hs/router/config.ts +++ b/test/integrations/destinations/hs/router/config.ts @@ -1,6 +1,7 @@ +import { secret1 } from '../maskedSecrets'; export const destination = { Config: { - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', authorizationType: 'newPrivateAppApi', apiVersion: 'newApi', diff --git a/test/integrations/destinations/hs/router/data.ts b/test/integrations/destinations/hs/router/data.ts index 1546193a4aa..71988d64697 100644 --- a/test/integrations/destinations/hs/router/data.ts +++ b/test/integrations/destinations/hs/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader3, secret3 } from '../maskedSecrets'; import { destination } from './config'; export const data = [ { @@ -15,7 +16,7 @@ export const data = [ ID: '123', Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'pat-123', + accessToken: secret1, apiVersion: 'newApi', }, }, @@ -74,7 +75,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.hubapi.com/crm/v3/associations/companies/contacts/batch/create', - headers: { 'Content-Type': 'application/json', Authorization: 'Bearer pat-123' }, + headers: { 'Content-Type': 'application/json', Authorization: authHeader1 }, params: {}, body: { JSON: { inputs: [{ to: { id: 1 }, from: { id: 9405415215 }, type: 'engineer' }] }, @@ -91,7 +92,7 @@ export const data = [ ID: '123', Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'pat-123', + accessToken: secret1, apiVersion: 'newApi', }, }, @@ -572,8 +573,12 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testhubspot1@email.com","properties":[{"property":"firstname","value":"Test Hubspot1"}]}]', + batch: JSON.stringify([ + { + email: 'testhubspot1@email.com', + properties: [{ property: 'firstname', value: 'Test Hubspot1' }], + }, + ]), }, XML: {}, FORM: {}, @@ -657,8 +662,12 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testhubspot3@email.com","properties":[{"property":"firstname","value":"Test Hubspot3"}]}]', + batch: JSON.stringify([ + { + email: 'testhubspot3@email.com', + properties: [{ property: 'firstname', value: 'Test Hubspot3' }], + }, + ]), }, XML: {}, FORM: {}, @@ -701,8 +710,12 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testhubspot4@email.com","properties":[{"property":"firstname","value":"Test Hubspot4"}]}]', + batch: JSON.stringify([ + { + email: 'testhubspot4@email.com', + properties: [{ property: 'firstname', value: 'Test Hubspot4' }], + }, + ]), }, XML: {}, FORM: {}, @@ -778,7 +791,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -855,7 +868,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -943,7 +956,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1010,7 +1023,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1052,7 +1065,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1107,7 +1120,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/update', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1135,7 +1148,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1233,7 +1246,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1316,7 +1329,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1399,7 +1412,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1482,7 +1495,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1549,7 +1562,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1615,7 +1628,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1644,7 +1657,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1699,7 +1712,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -1720,7 +1733,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token', + accessToken: secret1, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1811,7 +1824,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token-hs-additonal-email', + accessToken: secret3, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1857,7 +1870,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/update', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token-hs-additonal-email', + Authorization: authHeader3, }, params: {}, body: { @@ -1881,7 +1894,7 @@ export const data = [ destination: { Config: { authorizationType: 'newPrivateAppApi', - accessToken: 'dummy-access-token-hs-additonal-email', + accessToken: secret3, hubID: 'dummy-hubId', apiKey: 'dummy-apikey', apiVersion: 'newApi', @@ -1961,7 +1974,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2037,7 +2050,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2111,7 +2124,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2186,7 +2199,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2269,7 +2282,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2279,7 +2292,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2358,7 +2371,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2368,7 +2381,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2438,7 +2451,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2448,7 +2461,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2552,7 +2565,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2627,7 +2640,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -2710,7 +2723,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', files: {}, headers: { - Authorization: 'Bearer dontbatchtrueaccesstoken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -2720,7 +2733,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dontbatchtrueaccesstoken', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -3056,7 +3069,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3104,7 +3117,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3137,7 +3150,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3170,7 +3183,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3203,7 +3216,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3236,7 +3249,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/events/v3/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3269,7 +3282,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy-access-token', + Authorization: authHeader1, }, params: {}, body: { @@ -3480,8 +3493,23 @@ export const data = [ updatedAt: '2021-02-03T16:22:31.374Z', workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', }, - error: - '{"message":"Failed to get hubspot properties: {\\"status\\":\\"error\\",\\"message\\":\\"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/\\",\\"correlationId\\":\\"4d39ff11-e121-4514-bcd8-132a9dd1ff50\\",\\"category\\":\\"INVALID_AUTHENTICATION\\",\\"links\\":{\\"api key\\":\\"https://app.hubspot.com/l/api-key/\\"}}","destinationResponse":{"response":{"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}},"status":401}}', + error: JSON.stringify({ + message: + 'Failed to get hubspot properties: {"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}}', + destinationResponse: { + response: { + status: 'error', + message: + 'The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/', + correlationId: '4d39ff11-e121-4514-bcd8-132a9dd1ff50', + category: 'INVALID_AUTHENTICATION', + links: { + 'api key': 'https://app.hubspot.com/l/api-key/', + }, + }, + status: 401, + }, + }), metadata: [ { jobId: 2, @@ -3524,8 +3552,23 @@ export const data = [ updatedAt: '2021-02-03T16:22:31.374Z', workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', }, - error: - '{"message":"Failed to get hubspot properties: {\\"status\\":\\"error\\",\\"message\\":\\"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/\\",\\"correlationId\\":\\"4d39ff11-e121-4514-bcd8-132a9dd1ff50\\",\\"category\\":\\"INVALID_AUTHENTICATION\\",\\"links\\":{\\"api key\\":\\"https://app.hubspot.com/l/api-key/\\"}}","destinationResponse":{"response":{"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}},"status":401}}', + error: JSON.stringify({ + message: + 'Failed to get hubspot properties: {"status":"error","message":"The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"INVALID_AUTHENTICATION","links":{"api key":"https://app.hubspot.com/l/api-key/"}}', + destinationResponse: { + response: { + status: 'error', + message: + 'The API key provided is invalid. View or manage your API key here: https://app.hubspot.com/l/api-key/', + correlationId: '4d39ff11-e121-4514-bcd8-132a9dd1ff50', + category: 'INVALID_AUTHENTICATION', + links: { + 'api key': 'https://app.hubspot.com/l/api-key/', + }, + }, + status: 401, + }, + }), metadata: [ { jobId: 3, @@ -3587,7 +3630,7 @@ export const data = [ authorizationType: 'newPrivateAppApi', hubID: '', apiKey: '', - accessToken: 'dummy-access-token', + accessToken: secret1, apiVersion: 'newApi', lookupField: 'lookupField', eventFilteringOption: 'disable', @@ -3621,7 +3664,7 @@ export const data = [ batched: false, destination: { Config: { - accessToken: 'dummy-access-token', + accessToken: secret1, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', diff --git a/test/integrations/destinations/http/common.ts b/test/integrations/destinations/http/common.ts index 7f9cc61048f..914704d6c2a 100644 --- a/test/integrations/destinations/http/common.ts +++ b/test/integrations/destinations/http/common.ts @@ -1,3 +1,4 @@ +import { secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'http'; @@ -43,7 +44,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/contacts', auth: 'basicAuth', - username: 'test-user', + username: secret1, password: '', method: 'GET', format: 'JSON', @@ -148,7 +149,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/events', auth: 'bearerTokenAuth', - bearerToken: 'test-token', + bearerToken: secret2, method: 'POST', format: 'XML', xmlRootKey: 'body', @@ -298,7 +299,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/contacts', auth: 'basicAuth', - username: 'test-user', + username: secret1, password: '', method: 'GET', format: 'JSON', @@ -357,7 +358,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/contacts', auth: 'basicAuth', - username: 'test-user', + username: secret1, password: '', method: 'GET', format: 'JSON', @@ -416,7 +417,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/events', auth: 'bearerTokenAuth', - bearerToken: 'test-token', + bearerToken: secret2, method: 'POST', format: 'XML', headers: [ @@ -456,7 +457,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/events', auth: 'bearerTokenAuth', - bearerToken: 'test-token', + bearerToken: secret2, method: 'POST', format: 'FORM', headers: [ @@ -504,7 +505,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/events', auth: 'bearerTokenAuth', - bearerToken: 'test-token', + bearerToken: secret2, method: 'POST', format: 'FORM', headers: [ @@ -548,7 +549,7 @@ const destinations: Destination[] = [ Config: { apiUrl: 'http://abc.com/events', auth: 'bearerTokenAuth', - bearerToken: 'test-token', + bearerToken: secret2, method: 'POST', format: 'FORM', headers: [ diff --git a/test/integrations/destinations/http/maskedSecrets.ts b/test/integrations/destinations/http/maskedSecrets.ts new file mode 100644 index 00000000000..1e9bca66163 --- /dev/null +++ b/test/integrations/destinations/http/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/http/processor/configuration.ts b/test/integrations/destinations/http/processor/configuration.ts index 62676ba63de..9baa64bd75c 100644 --- a/test/integrations/destinations/http/processor/configuration.ts +++ b/test/integrations/destinations/http/processor/configuration.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2 } from '../maskedSecrets'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, transformResultBuilder } from '../../../testUtils'; import { @@ -148,7 +149,7 @@ export const configuration: ProcessorTestData[] = [ endpoint: destinations[1].Config.apiUrl, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC11c2VyOg==', + Authorization: authHeader1, h1: 'val1', h2: '2', 'content-type': 'application/json', @@ -203,7 +204,7 @@ export const configuration: ProcessorTestData[] = [ endpoint: destinations[4].Config.apiUrl, headers: { 'Content-Type': 'application/xml', - Authorization: 'Bearer test-token', + Authorization: authHeader2, h1: 'val1', 'content-type': 'application/json', }, @@ -256,7 +257,7 @@ export const configuration: ProcessorTestData[] = [ endpoint: 'http://abc.com/contacts/userId123/c1', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC11c2VyOg==', + Authorization: authHeader1, h1: 'val1', h2: '2', 'content-type': 'application/json', @@ -309,7 +310,7 @@ export const configuration: ProcessorTestData[] = [ endpoint: 'http://abc.com/contacts/userId123/c1', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC11c2VyOg==', + Authorization: authHeader1, h1: 'val1', h2: '2', 'content-type': 'application/json', @@ -364,8 +365,11 @@ export const configuration: ProcessorTestData[] = [ 'Content-Type': 'application/x-www-form-urlencoded', }, FORM: { - contacts: - '{"first_name":"John","email":"john.doe@example.com","address":{"pin_code":"123456"}}', + contacts: JSON.stringify({ + first_name: 'John', + email: 'john.doe@example.com', + address: { pin_code: '123456' }, + }), }, }), statusCode: 200, @@ -414,7 +418,7 @@ export const configuration: ProcessorTestData[] = [ endpoint: destinations[10].Config.apiUrl, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Bearer test-token', + Authorization: authHeader2, h1: 'val1', 'content-type': 'application/json', }, @@ -468,7 +472,7 @@ export const configuration: ProcessorTestData[] = [ userId: '', endpoint: destinations[11].Config.apiUrl, headers: { - Authorization: 'Bearer test-token', + Authorization: authHeader2, h1: 'val1', 'Content-Type': 'application/x-www-form-urlencoded', }, @@ -517,7 +521,7 @@ export const configuration: ProcessorTestData[] = [ userId: '', endpoint: destinations[12].Config.apiUrl, headers: { - Authorization: 'Bearer test-token', + Authorization: authHeader2, h1: 'val1', 'Content-Type': 'application/x-www-form-urlencoded', }, diff --git a/test/integrations/destinations/http/router/data.ts b/test/integrations/destinations/http/router/data.ts index c719196e6ba..1a762e84f13 100644 --- a/test/integrations/destinations/http/router/data.ts +++ b/test/integrations/destinations/http/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata } from '../../../testUtils'; import { destType, destinations, traits, properties } from '../common'; @@ -235,7 +236,7 @@ export const data = [ endpoint: 'http://abc.com/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC11c2VyOg==', + Authorization: authHeader1, 'content-type': 'application/json', h1: 'val1', h2: '2', @@ -268,7 +269,7 @@ export const data = [ endpoint: 'http://abc.com/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC11c2VyOg==', + Authorization: authHeader1, 'content-type': 'application/json', h1: 'val1', h2: '2', @@ -301,7 +302,7 @@ export const data = [ endpoint: 'http://abc.com/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC11c2VyOg==', + Authorization: authHeader1, 'content-type': 'application/json', h1: 'val1', h2: '2', @@ -365,8 +366,39 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Product Viewed","userId":"userId1","properties":{"items":[]}},{"event":"Order Completed","currency":"USD","userId":"userId2","properties":{"items":[{"item_id":"622c6f5d5cf86a4c77358033","name":"Cones of Dunshire","price":40},{"item_id":"577c6f5d5cf86a4c7735ba03","name":"Five Crowns","price":5}]}},{"event":"Product Added","currency":"USD","userId":"userId3","properties":{"items":[{"item_id":"622c6f5d5cf86a4c77358033","name":"Cones of Dunshire","price":40},{"item_id":"577c6f5d5cf86a4c7735ba03","name":"Five Crowns","price":5}]}}]', + batch: JSON.stringify([ + { event: 'Product Viewed', userId: 'userId1', properties: { items: [] } }, + { + event: 'Order Completed', + currency: 'USD', + userId: 'userId2', + properties: { + items: [ + { + item_id: '622c6f5d5cf86a4c77358033', + name: 'Cones of Dunshire', + price: 40, + }, + { item_id: '577c6f5d5cf86a4c7735ba03', name: 'Five Crowns', price: 5 }, + ], + }, + }, + { + event: 'Product Added', + currency: 'USD', + userId: 'userId3', + properties: { + items: [ + { + item_id: '622c6f5d5cf86a4c77358033', + name: 'Cones of Dunshire', + price: 40, + }, + { item_id: '577c6f5d5cf86a4c7735ba03', name: 'Five Crowns', price: 5 }, + ], + }, + }, + ]), }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/impact/maskedSecrets.ts b/test/integrations/destinations/impact/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/impact/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/impact/processor/data.ts b/test/integrations/destinations/impact/processor/data.ts index 0841f44c623..a33f38e4792 100644 --- a/test/integrations/destinations/impact/processor/data.ts +++ b/test/integrations/destinations/impact/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'impact', @@ -50,8 +51,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -122,7 +123,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -185,8 +186,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -294,7 +295,7 @@ export const data = [ destination: { Config: { accountSID: '', - apiKey: 'fghsdfgegvcergfvfdfsag', + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -627,8 +628,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -704,10 +705,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -777,8 +778,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -850,10 +851,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -925,8 +926,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1008,10 +1009,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1083,8 +1084,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1162,10 +1163,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1240,8 +1241,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1323,10 +1324,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1401,8 +1402,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1484,10 +1485,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -1547,8 +1548,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1619,7 +1620,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -1682,8 +1683,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1754,7 +1755,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -1827,8 +1828,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -1945,8 +1946,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -2059,8 +2060,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -2138,10 +2139,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -2216,8 +2217,8 @@ export const data = [ }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -2298,10 +2299,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, @@ -2348,10 +2349,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, userId: '', }, statusCode: 200, diff --git a/test/integrations/destinations/impact/router/data.ts b/test/integrations/destinations/impact/router/data.ts index e9120ae03dd..894c62f4f30 100644 --- a/test/integrations/destinations/impact/router/data.ts +++ b/test/integrations/destinations/impact/router/data.ts @@ -1,6 +1,7 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { - name: 'fb', + name: 'impact', description: 'Test 0', feature: 'router', module: 'destination', @@ -12,8 +13,8 @@ export const data = [ { destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -99,8 +100,8 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -156,8 +157,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', endpoint: 'https://trkapi.impact.com/PageLoad', @@ -167,8 +167,8 @@ export const data = [ statusCode: 200, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', @@ -220,11 +220,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Basic ZGZzZ2VydHJ0ZmYzZXJmYzM0cmZ3ZjpmZ2hzZGZnZWd2Y2VyZ2Z2ZmRmc2Fn', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions', + endpoint: `https://api.impact.com/Advertisers/${secret1}/Conversions`, }, ], metadata: [{ jobId: 2, userId: 'u1' }], @@ -232,8 +231,8 @@ export const data = [ statusCode: 200, destination: { Config: { - accountSID: 'dfsgertrtff3erfc34rfwf', - apiKey: 'fghsdfgegvcergfvfdfsag', + accountSID: secret1, + apiKey: secret2, campaignId: '23224', impactAppId: '2323', eventTypeId: '56446', diff --git a/test/integrations/destinations/intercom/dataDelivery/business.ts b/test/integrations/destinations/intercom/dataDelivery/business.ts index 05ac63147d1..8a4591ca776 100644 --- a/test/integrations/destinations/intercom/dataDelivery/business.ts +++ b/test/integrations/destinations/intercom/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, @@ -6,7 +7,7 @@ import { const commonHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -14,7 +15,7 @@ const commonHeaders = { const unauthorizedResponseHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer invalidApiKey', + Authorization: authHeader2, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -387,8 +388,11 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request123","errors":[{"code":"unauthorized","message":"Access Token Invalid"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request123', + errors: [{ code: 'unauthorized', message: 'Access Token Invalid' }], + }), metadata: generateMetadata(1), statusCode: 401, }, @@ -471,8 +475,11 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request124","errors":[{"code":"api_plan_restricted","message":"Active subscription needed."}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request124', + errors: [{ code: 'api_plan_restricted', message: 'Active subscription needed.' }], + }), metadata: generateMetadata(1), statusCode: 403, }, @@ -512,8 +519,16 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request125","errors":[{"code":"rate_limit_exceeded","message":"The rate limit for the App has been exceeded"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request125', + errors: [ + { + code: 'rate_limit_exceeded', + message: 'The rate limit for the App has been exceeded', + }, + ], + }), metadata: generateMetadata(1), statusCode: 429, }, @@ -557,8 +572,16 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request126","errors":[{"code":"conflict","message":"A contact matching those details already exists with id=test1"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request126', + errors: [ + { + code: 'conflict', + message: 'A contact matching those details already exists with id=test1', + }, + ], + }), metadata: generateMetadata(1), statusCode: 409, }, @@ -602,8 +625,15 @@ export const testScenariosForV1API = [ message: 'Request Processed Successfully', response: [ { - error: - '{"errors":[{"code":"media_type_not_acceptable","message":"The Accept header should send a media type of application/json"}],"type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'media_type_not_acceptable', + message: 'The Accept header should send a media type of application/json', + }, + ], + type: 'error.list', + }), metadata: generateMetadata(1), statusCode: 406, }, diff --git a/test/integrations/destinations/intercom/dataDelivery/other.ts b/test/integrations/destinations/intercom/dataDelivery/other.ts index 47690776278..4c77bd0ce30 100644 --- a/test/integrations/destinations/intercom/dataDelivery/other.ts +++ b/test/integrations/destinations/intercom/dataDelivery/other.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { ProxyV1TestData } from '../../../testTypes'; import { generateMetadata, @@ -7,7 +8,7 @@ import { const commonHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -245,8 +246,16 @@ export const otherScenariosV1: ProxyV1TestData[] = [ '[Intercom Response Handler] Request failed for destination intercom with status: 408', response: [ { - error: - '{"type":"error.list","request_id":"000on04msi4jpk7d3u60","errors":[{"code":"Request Timeout","message":"The server would not wait any longer for the client"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: '000on04msi4jpk7d3u60', + errors: [ + { + code: 'Request Timeout', + message: 'The server would not wait any longer for the client', + }, + ], + }), metadata: generateMetadata(1), statusCode: 500, }, @@ -288,8 +297,16 @@ export const otherScenariosV1: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request127","errors":[{"code":"service_unavailable","message":"Sorry, the API service is temporarily unavailable"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request127', + errors: [ + { + code: 'service_unavailable', + message: 'Sorry, the API service is temporarily unavailable', + }, + ], + }), metadata: generateMetadata(1), statusCode: 503, }, @@ -329,8 +346,11 @@ export const otherScenariosV1: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request128","errors":[{"code":"client_error","message":"Unknown server error"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request128', + errors: [{ code: 'client_error', message: 'Unknown server error' }], + }), metadata: generateMetadata(1), statusCode: 500, }, @@ -370,8 +390,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"type":"error.list","request_id":"request129","errors":[{"code":"server_timeout","message":"Server timed out when making request"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request129', + errors: [ + { code: 'server_timeout', message: 'Server timed out when making request' }, + ], + }), metadata: generateMetadata(1), statusCode: 504, }, diff --git a/test/integrations/destinations/intercom/deleteUsers/data.ts b/test/integrations/destinations/intercom/deleteUsers/data.ts index 58285ee683e..2fe1c785dd5 100644 --- a/test/integrations/destinations/intercom/deleteUsers/data.ts +++ b/test/integrations/destinations/intercom/deleteUsers/data.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; export const data = [ { name: 'intercom', @@ -19,7 +20,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], @@ -57,7 +58,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/intercom/maskedSecrets.ts b/test/integrations/destinations/intercom/maskedSecrets.ts new file mode 100644 index 00000000000..935d0e6d37e --- /dev/null +++ b/test/integrations/destinations/intercom/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; +export const authHeader3 = `Bearer ${secret3}`; +export const authHeader4 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/intercom/network.ts b/test/integrations/destinations/intercom/network.ts index 0a86ce3c897..c2e6ae80f2d 100644 --- a/test/integrations/destinations/intercom/network.ts +++ b/test/integrations/destinations/intercom/network.ts @@ -1,12 +1,13 @@ +import { authHeader1, authHeader2, authHeader3 } from './maskedSecrets'; const commonHeaders = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const v0VersionHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -14,7 +15,7 @@ const v0VersionHeaders = { const v1VersionHeaders = { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', @@ -45,7 +46,7 @@ const companyPayload = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer abcd=', + Authorization: authHeader3, Accept: 'application/json', 'Intercom-Version': '1.4', }; @@ -434,7 +435,7 @@ const deliveryCallsData = [ }, headers: { Accept: 'application/json', - Authorization: 'Bearer invalidApiKey', + Authorization: authHeader2, 'Content-Type': 'application/json', }, }, @@ -529,7 +530,7 @@ const deliveryCallsData = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer invalidApiKey', + Authorization: authHeader2, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', diff --git a/test/integrations/destinations/intercom/processor/groupTestData.ts b/test/integrations/destinations/intercom/processor/groupTestData.ts index f87da349650..dd282a14cda 100644 --- a/test/integrations/destinations/intercom/processor/groupTestData.ts +++ b/test/integrations/destinations/intercom/processor/groupTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader3, secret3 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, @@ -6,14 +7,14 @@ import { } from '../../../testUtils'; const v1Config = { - apiKey: 'abcd=', + apiKey: secret3, appId: 'asdasdasd', apiVersion: 'v1', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -21,7 +22,7 @@ const v2Config = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer abcd=', + Authorization: authHeader3, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -29,7 +30,7 @@ const v1Headers = { const v2Headers = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', diff --git a/test/integrations/destinations/intercom/processor/identifyTestData.ts b/test/integrations/destinations/intercom/processor/identifyTestData.ts index f078536b30a..24666b42a19 100644 --- a/test/integrations/destinations/intercom/processor/identifyTestData.ts +++ b/test/integrations/destinations/intercom/processor/identifyTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader4, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, @@ -6,14 +7,14 @@ import { } from '../../../testUtils'; const v1Config = { - apiKey: 'intercomApiKey', + apiKey: secret4, apiVersion: 'v1', appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -21,7 +22,7 @@ const v2Config = { const v2Headers = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', @@ -29,7 +30,7 @@ const v2Headers = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer intercomApiKey', + Authorization: authHeader4, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -234,7 +235,7 @@ const expectedUser6Traits = { company_id: 'company_id', custom_attributes: { key1: 'value1', - key2: '{"a":"a"}', + key2: JSON.stringify({ a: 'a' }), key3: '[1,2,3]', }, }, @@ -711,8 +712,8 @@ export const identifyTestData = [ ...expectedUser6Traits.companies[0], custom_attributes: { key1: 'value1', - key3: '["value1","value2"]', - key4: '{"foo":"bar"}', + key3: JSON.stringify(['value1', 'value2']), + key4: JSON.stringify({ foo: 'bar' }), }, company_id: 'c0277b5c814453e5135f515f943d085a', }, diff --git a/test/integrations/destinations/intercom/processor/trackTestData.ts b/test/integrations/destinations/intercom/processor/trackTestData.ts index b0878cc79d5..639a551c8ac 100644 --- a/test/integrations/destinations/intercom/processor/trackTestData.ts +++ b/test/integrations/destinations/intercom/processor/trackTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader4, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { generateMetadata, @@ -6,14 +7,14 @@ import { } from '../../../testUtils'; const v1Config = { - apiKey: 'intercomApiKey', + apiKey: secret4, apiVersion: 'v1', appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -21,7 +22,7 @@ const v2Config = { const v1Headers = { 'Content-Type': 'application/json', - Authorization: 'Bearer intercomApiKey', + Authorization: authHeader4, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -29,7 +30,7 @@ const v1Headers = { const v2Headers = { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '2.10', 'User-Agent': 'RudderStack', diff --git a/test/integrations/destinations/intercom/processor/validationTestData.ts b/test/integrations/destinations/intercom/processor/validationTestData.ts index 11a303d82b9..573b04dfce7 100644 --- a/test/integrations/destinations/intercom/processor/validationTestData.ts +++ b/test/integrations/destinations/intercom/processor/validationTestData.ts @@ -1,16 +1,17 @@ +import { secret1, secret2, secret4 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; const v1Config = { - apiKey: 'intercomApiKey', + apiKey: secret4, apiVersion: 'v1', appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0', collectContext: false, }; const v2Config = { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -28,7 +29,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'standard', sendAnonymousId: false, @@ -332,7 +333,7 @@ export const validationTestData: ProcessorTestData[] = [ { destination: { ...v2Destination, - Config: { ...v2Destination.Config, apiKey: 'invalidApiKey' }, + Config: { ...v2Destination.Config, apiKey: secret2 }, }, message: { userId: 'user@3', @@ -366,8 +367,38 @@ export const validationTestData: ProcessorTestData[] = [ status: 200, body: [ { - error: - '{"message":"{\\"message\\":\\"Unable to search contact due to : [{\\\\\\"code\\\\\\":\\\\\\"unauthorized\\\\\\",\\\\\\"message\\\\\\":\\\\\\"Access Token Invalid\\\\\\"}]: Workflow: procWorkflow, Step: searchContact, ChildStep: undefined, OriginalError: Unable to search contact due to : [{\\\\\\"code\\\\\\":\\\\\\"unauthorized\\\\\\",\\\\\\"message\\\\\\":\\\\\\"Access Token Invalid\\\\\\"}]\\",\\"destinationResponse\\":{\\"response\\":{\\"type\\":\\"error.list\\",\\"request_id\\":\\"request_1\\",\\"errors\\":[{\\"code\\":\\"unauthorized\\",\\"message\\":\\"Access Token Invalid\\"}]},\\"status\\":401}}","destinationResponse":{"response":{"type":"error.list","request_id":"request_1","errors":[{"code":"unauthorized","message":"Access Token Invalid"}]},"status":401}}', + error: JSON.stringify({ + message: JSON.stringify({ + message: + 'Unable to search contact due to : [{"code":"unauthorized","message":"Access Token Invalid"}]: Workflow: procWorkflow, Step: searchContact, ChildStep: undefined, OriginalError: Unable to search contact due to : [{"code":"unauthorized","message":"Access Token Invalid"}]', + destinationResponse: { + response: { + type: 'error.list', + request_id: 'request_1', + errors: [ + { + code: 'unauthorized', + message: 'Access Token Invalid', + }, + ], + }, + status: 401, + }, + }), + destinationResponse: { + response: { + type: 'error.list', + request_id: 'request_1', + errors: [ + { + code: 'unauthorized', + message: 'Access Token Invalid', + }, + ], + }, + status: 401, + }, + }), statTags: { ...expectedStatTags, errorCategory: 'network', errorType: 'aborted' }, statusCode: 401, metadata: generateMetadata(1), diff --git a/test/integrations/destinations/intercom/router/data.ts b/test/integrations/destinations/intercom/router/data.ts index 43af421f3a3..e5bc766c76d 100644 --- a/test/integrations/destinations/intercom/router/data.ts +++ b/test/integrations/destinations/intercom/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination, RouterTransformationRequest } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; @@ -14,7 +15,7 @@ const destination1: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiServer: 'standard', apiVersion: 'v2', sendAnonymousId: false, @@ -37,7 +38,7 @@ const destination2: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiServer: 'standard', apiVersion: 'v2', sendAnonymousId: false, @@ -60,7 +61,7 @@ const destination3: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v2', apiServer: 'eu', sendAnonymousId: false, @@ -82,7 +83,7 @@ const destination4: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, updateLastRequestAt: false, @@ -105,7 +106,7 @@ const destination5: Destination = { }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, collectContext: false, @@ -125,7 +126,7 @@ const destination6: Destination = { Config: {}, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, updateLastRequestAt: false, @@ -146,7 +147,7 @@ const destination7: Destination = { Config: {}, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, apiVersion: 'v1', sendAnonymousId: false, collectContext: false, @@ -842,7 +843,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/contacts', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -885,7 +886,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/events', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -914,7 +915,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.eu.intercom.io/contacts/70701240741e45d040/companies', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -943,7 +944,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.eu.intercom.io/contacts/70701240741e45d040/companies', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', @@ -1010,7 +1011,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1050,7 +1051,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1102,7 +1103,7 @@ export const data: RouterTestData[] = [ files: {}, headers: { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1132,7 +1133,7 @@ export const data: RouterTestData[] = [ files: {}, headers: { Accept: 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1155,7 +1156,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.intercom.io/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Intercom-Version': '1.4', 'User-Agent': 'RudderStack', @@ -1244,7 +1245,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.eu.intercom.io/contacts/70701240741e45d040', files: {}, headers: { - Authorization: 'Bearer testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', 'Intercom-Version': '2.10', diff --git a/test/integrations/destinations/intercom_v2/common.ts b/test/integrations/destinations/intercom_v2/common.ts index 60c7e02b330..e396d381e47 100644 --- a/test/integrations/destinations/intercom_v2/common.ts +++ b/test/integrations/destinations/intercom_v2/common.ts @@ -1,4 +1,6 @@ +import { authHeader1 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; +import { defaultAccessToken } from '../../common/secrets'; const destTypeInUpperCase = 'INTERCOM_V2'; const channel = 'web'; @@ -103,7 +105,7 @@ const properties = { }; const headers = { - Authorization: 'Bearer default-accessToken', + Authorization: `Bearer ${defaultAccessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.10', @@ -111,7 +113,7 @@ const headers = { const headersWithRevokedAccessToken = { ...headers, - Authorization: 'Bearer revoked-accessToken', + Authorization: authHeader1, }; const RouterInstrumentationErrorStatTags = { diff --git a/test/integrations/destinations/intercom_v2/dataDelivery/business.ts b/test/integrations/destinations/intercom_v2/dataDelivery/business.ts index c75993bc7a7..0870839e9d9 100644 --- a/test/integrations/destinations/intercom_v2/dataDelivery/business.ts +++ b/test/integrations/destinations/intercom_v2/dataDelivery/business.ts @@ -360,8 +360,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"errors":[{"code":"rate_limit_exceeded","message":"The rate limit for the App has been exceeded"}],"request_id":"request125","type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'rate_limit_exceeded', + message: 'The rate limit for the App has been exceeded', + }, + ], + request_id: 'request125', + type: 'error.list', + }), statusCode: 429, metadata: generateMetadata(1), }, @@ -404,8 +412,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"errors":[{"code":"conflict","message":"A contact matching those details already exists with id=test"}],"request_id":"request126","type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'conflict', + message: 'A contact matching those details already exists with id=test', + }, + ], + request_id: 'request126', + type: 'error.list', + }), statusCode: 409, metadata: generateMetadata(1), }, @@ -452,8 +468,15 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"errors":[{"code":"media_type_not_acceptable","message":"The Accept header should send a media type of application/json"}],"type":"error.list"}', + error: JSON.stringify({ + errors: [ + { + code: 'media_type_not_acceptable', + message: 'The Accept header should send a media type of application/json', + }, + ], + type: 'error.list', + }), statusCode: 406, metadata: generateMetadata(1), }, @@ -501,8 +524,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ '[Intercom V2 Response Handler] Request failed for destination intercom_v2 with status: 408', response: [ { - error: - '{"type":"error.list","request_id":"req-123","errors":[{"code":"Request Timeout","message":"The server would not wait any longer for the client"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'req-123', + errors: [ + { + code: 'Request Timeout', + message: 'The server would not wait any longer for the client', + }, + ], + }), metadata: generateMetadata(1), statusCode: 500, }, diff --git a/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts b/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts index 8f36a4bd55f..963d2d061d8 100644 --- a/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts +++ b/test/integrations/destinations/intercom_v2/dataDelivery/oauth.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; import { ProxyV1TestData } from '../../../testTypes'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { headers, headersWithRevokedAccessToken, RouterNetworkErrorStatTags } from '../common'; @@ -38,7 +39,7 @@ export const oauthScenariosV0 = [ body: generateProxyV1Payload({ ...commonRequestParameters, headers: headersWithRevokedAccessToken, - accessToken: 'revoked-accessToken', + accessToken: secret1, }), method: 'POST', }, @@ -122,7 +123,7 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ body: generateProxyV1Payload({ ...commonRequestParameters, headers: headersWithRevokedAccessToken, - accessToken: 'revoked-accessToken', + accessToken: secret1, }), method: 'POST', }, @@ -134,12 +135,15 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"type":"error.list","request_id":"request_id-1","errors":[{"code":"unauthorized","message":"Access Token Invalid"}]}', + error: JSON.stringify({ + type: 'error.list', + request_id: 'request_id-1', + errors: [{ code: 'unauthorized', message: 'Access Token Invalid' }], + }), statusCode: 400, metadata: { ...generateMetadata(1), - secret: { accessToken: 'revoked-accessToken' }, + secret: { accessToken: secret1 }, }, }, ], diff --git a/test/integrations/destinations/intercom_v2/maskedSecrets.ts b/test/integrations/destinations/intercom_v2/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/intercom_v2/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/intercom_v2/router/data.ts b/test/integrations/destinations/intercom_v2/router/data.ts index 4574dde9f6f..be320794c5f 100644 --- a/test/integrations/destinations/intercom_v2/router/data.ts +++ b/test/integrations/destinations/intercom_v2/router/data.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; import { RouterTransformationRequest } from '../../../../../src/types'; import { generateMetadata } from '../../../testUtils'; import { @@ -112,7 +113,7 @@ const routerRequest1: RouterTransformationRequest = { metadata: { ...generateMetadata(5), secret: { - accessToken: 'revoked-accessToken', + accessToken: secret1, }, }, }, @@ -543,8 +544,19 @@ export const data: RouterTestData[] = [ }, { batched: false, - error: - '{"message":"Unable to search contact due to","destinationResponse":"{\\"type\\":\\"error.list\\",\\"request_id\\":\\"request_id-1\\",\\"errors\\":[{\\"code\\":\\"unauthorized\\",\\"message\\":\\"Access Token Invalid\\"}]}"}', + error: JSON.stringify({ + message: 'Unable to search contact due to', + destinationResponse: JSON.stringify({ + type: 'error.list', + request_id: 'request_id-1', + errors: [ + { + code: 'unauthorized', + message: 'Access Token Invalid', + }, + ], + }), + }), statTags: { ...RouterNetworkErrorStatTags, errorType: 'retryable', @@ -555,7 +567,7 @@ export const data: RouterTestData[] = [ { ...generateMetadata(5), secret: { - accessToken: 'revoked-accessToken', + accessToken: secret1, }, }, ], diff --git a/test/integrations/destinations/iterable/dataDelivery/business.ts b/test/integrations/destinations/iterable/dataDelivery/business.ts index 0d6059806e1..5e62b164fc4 100644 --- a/test/integrations/destinations/iterable/dataDelivery/business.ts +++ b/test/integrations/destinations/iterable/dataDelivery/business.ts @@ -9,6 +9,7 @@ import { wrongIdentifyData, wrongTrackData, } from './network'; +import { defaultAccessToken } from '../../../common/secrets'; export const statTags = { destType: 'ITERABLE', @@ -32,7 +33,7 @@ export const singleMetadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -164,14 +165,20 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"msg":"[/api/events/trackBulk] Invalid JSON body","code":"BadJsonBody","params":{"obj.events[1].createdAt":"Number value expected"}}', + error: JSON.stringify({ + msg: '[/api/events/trackBulk] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.events[1].createdAt': 'Number value expected' }, + }), }, { statusCode: 400, metadata: generateMetadata(2), - error: - '{"msg":"[/api/events/trackBulk] Invalid JSON body","code":"BadJsonBody","params":{"obj.events[1].createdAt":"Number value expected"}}', + error: JSON.stringify({ + msg: '[/api/events/trackBulk] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.events[1].createdAt': 'Number value expected' }, + }), }, ], }, @@ -356,14 +363,20 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"msg":"[/api/users/bulkUpdate] Invalid JSON body","code":"BadJsonBody","params":{"obj.users[1].preferUserId":"Boolean value expected"}}', + error: JSON.stringify({ + msg: '[/api/users/bulkUpdate] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.users[1].preferUserId': 'Boolean value expected' }, + }), }, { statusCode: 400, metadata: generateMetadata(2), - error: - '{"msg":"[/api/users/bulkUpdate] Invalid JSON body","code":"BadJsonBody","params":{"obj.users[1].preferUserId":"Boolean value expected"}}', + error: JSON.stringify({ + msg: '[/api/users/bulkUpdate] Invalid JSON body', + code: 'BadJsonBody', + params: { 'obj.users[1].preferUserId': 'Boolean value expected' }, + }), }, ], }, @@ -479,8 +492,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"msg":"Invalid currentEmail sayan","code":"InvalidEmailAddressError","params":null}', + error: JSON.stringify({ + msg: 'Invalid currentEmail sayan', + code: 'InvalidEmailAddressError', + params: null, + }), }, ], }, @@ -576,8 +592,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"msg":"Invalid email: sayan","code":"InvalidEmailAddressError","params":null}', + error: JSON.stringify({ + msg: 'Invalid email: sayan', + code: 'InvalidEmailAddressError', + params: null, + }), }, ], }, @@ -627,8 +646,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 404, metadata: generateMetadata(1), - error: - '{"error":"NotFound","message":"Catalog not found: rudder-test","code":"error.catalogs.notFound","data":{"args":["rudder-test"]}}', + error: JSON.stringify({ + error: 'NotFound', + message: 'Catalog not found: rudder-test', + code: 'error.catalogs.notFound', + data: { args: ['rudder-test'] }, + }), }, ], }, @@ -738,8 +761,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 401, metadata: generateMetadata(1), - error: - '{"msg":"Disabled API key or insufficient privileges","code":"BadApiKey","params":{"ip":"103.189.130.133","endpoint":"/api/users/registerDeviceToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}}', + error: JSON.stringify({ + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.133', + endpoint: '/api/users/registerDeviceToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }), }, ], }, @@ -787,8 +818,16 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 401, metadata: generateMetadata(1), - error: - '{"msg":"Disabled API key or insufficient privileges","code":"BadApiKey","params":{"ip":"103.189.130.129","endpoint":"/api/users/registerBrowserToken","apiKeyIdentifier":"af831922","apiKeyType":"ServerSide"}}', + error: JSON.stringify({ + msg: 'Disabled API key or insufficient privileges', + code: 'BadApiKey', + params: { + ip: '103.189.130.129', + endpoint: '/api/users/registerBrowserToken', + apiKeyIdentifier: 'af831922', + apiKeyType: 'ServerSide', + }, + }), }, ], }, diff --git a/test/integrations/destinations/june/maskedSecrets.ts b/test/integrations/destinations/june/maskedSecrets.ts new file mode 100644 index 00000000000..c5a4dc839e8 --- /dev/null +++ b/test/integrations/destinations/june/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${secret1}`; diff --git a/test/integrations/destinations/june/processor/data.ts b/test/integrations/destinations/june/processor/data.ts index dfe35ed0a34..1f7772d5aaa 100644 --- a/test/integrations/destinations/june/processor/data.ts +++ b/test/integrations/destinations/june/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'june', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -64,7 +65,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -100,7 +101,7 @@ export const data = [ endpoint: 'https://api.june.so/api/identify', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -139,7 +140,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -194,7 +195,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -229,7 +230,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -270,7 +271,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -299,7 +300,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -334,7 +335,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -370,7 +371,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -414,7 +415,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -457,7 +458,7 @@ export const data = [ endpoint: 'https://api.june.so/api/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -501,7 +502,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -538,7 +539,7 @@ export const data = [ endpoint: 'https://api.june.so/api/group', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { @@ -581,7 +582,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -635,7 +636,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -690,7 +691,7 @@ export const data = [ { destination: { Config: { - apiKey: '93EMyDLvfpbRxxYn', + apiKey: secret1, }, ID: 'june123', }, @@ -725,7 +726,7 @@ export const data = [ endpoint: 'https://api.june.so/api/page', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/june/router/data.ts b/test/integrations/destinations/june/router/data.ts index 81e5c6eb5aa..275ecd2bd62 100644 --- a/test/integrations/destinations/june/router/data.ts +++ b/test/integrations/destinations/june/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'fb', @@ -10,7 +11,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, metadata: { jobId: 1, userId: 'u1' }, message: { type: 'identify', @@ -24,7 +25,7 @@ export const data = [ }, }, { - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, metadata: { jobId: 2, userId: 'u1' }, message: { type: 'track', @@ -69,7 +70,7 @@ export const data = [ endpoint: 'https://api.june.so/api/identify', files: {}, headers: { - Authorization: 'Basic 93EMyDLvfpbRxxYn', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -77,12 +78,12 @@ export const data = [ type: 'REST', version: '1', }, - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, metadata: [{ jobId: 1, userId: 'u1' }], statusCode: 200, }, { - destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' }, + destination: { Config: { apiKey: secret1 }, ID: 'june123' }, batched: false, error: 'Missing required value from "userIdOnly"', metadata: [{ jobId: 2, userId: 'u1' }], diff --git a/test/integrations/destinations/klaviyo/maskedSecrets.ts b/test/integrations/destinations/klaviyo/maskedSecrets.ts new file mode 100644 index 00000000000..333e6fa6b79 --- /dev/null +++ b/test/integrations/destinations/klaviyo/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretBadApiKey = path.basename(__dirname) + 2; + +export const authHeader1 = `Klaviyo-API-Key ${secret1}`; +export const authHeaderBadApiKey = `Klaviyo-API-Key ${secretBadApiKey}`; diff --git a/test/integrations/destinations/klaviyo/network.ts b/test/integrations/destinations/klaviyo/network.ts index d76d235c6f3..0b19ad781ed 100644 --- a/test/integrations/destinations/klaviyo/network.ts +++ b/test/integrations/destinations/klaviyo/network.ts @@ -1,3 +1,5 @@ +import { authHeaderBadApiKey } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -51,7 +53,7 @@ export const networkCallsData = [ httpReq: { url: 'https://a.klaviyo.com/api/profiles', method: 'POST', - headers: { Authorization: 'Klaviyo-API-Key dummyPrivateApiKeyforfailure' }, + headers: { Authorization: authHeaderBadApiKey }, }, httpRes: {}, }, diff --git a/test/integrations/destinations/klaviyo/processor/ecomTestData.ts b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts index 83055cfef1d..7b1d7b802e3 100644 --- a/test/integrations/destinations/klaviyo/processor/ecomTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts @@ -1,6 +1,7 @@ import { overrideDestination, transformResultBuilder, generateMetadata } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; import { Destination } from '../../../../../src/types'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -13,7 +14,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -33,7 +34,7 @@ const commonTraits = { const eventsEndpoint = 'https://a.klaviyo.com/api/events'; const commonOutputHeaders = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', diff --git a/test/integrations/destinations/klaviyo/processor/groupTestData.ts b/test/integrations/destinations/klaviyo/processor/groupTestData.ts index 844729b8225..92ddd163402 100644 --- a/test/integrations/destinations/klaviyo/processor/groupTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/groupTestData.ts @@ -5,7 +5,7 @@ import { generateSimplifiedGroupPayload, transformResultBuilder, } from '../../../testUtils'; - +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -17,7 +17,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -26,7 +26,7 @@ const destination: Destination = { const headers = { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2023-02-22', }; diff --git a/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts index 871388aed26..bc99a19b53d 100644 --- a/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/groupTestDataV2.ts @@ -5,6 +5,7 @@ import { generateSimplifiedGroupPayload, transformResultBuilder, } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -17,7 +18,7 @@ const destination: Destination = { }, Config: { apiVersion: 'v2', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, consent: ['email'], }, Enabled: true, @@ -26,7 +27,7 @@ const destination: Destination = { }; const headers = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestData.ts b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts index ec663cf8e93..3b099f76e32 100644 --- a/test/integrations/destinations/klaviyo/processor/identifyTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts @@ -7,6 +7,7 @@ import { } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; import { Destination } from '../../../../../src/types'; +import { secret1, authHeader1, secretBadApiKey } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -19,7 +20,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -90,7 +91,7 @@ const commonOutputSubscriptionProps = { }; const commonOutputHeaders = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -281,7 +282,7 @@ export const identifyData: ProcessorTestData[] = [ { destination: overrideDestination(destination, { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKeyforfailure', + privateApiKey: secretBadApiKey, }), message: generateSimplifiedIdentifyPayload({ sentAt, @@ -306,8 +307,10 @@ export const identifyData: ProcessorTestData[] = [ status: 200, body: [ { - error: - '{"message":"Failed to create user due to \\"\\"","destinationResponse":"\\"\\""}', + error: JSON.stringify({ + message: 'Failed to create user due to ""', + destinationResponse: '""', + }), statTags: { destType: 'KLAVIYO', errorCategory: 'network', diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts index 33c85e7d6a2..a5e3ae7ee16 100644 --- a/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/identifyTestDataV2.ts @@ -7,6 +7,7 @@ import { } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; import { Destination } from '../../../../../src/types'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -19,7 +20,7 @@ const destination: Destination = { }, Config: { apiVersion: 'v2', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -110,7 +111,7 @@ const subscriptionRelations = { }; const commonOutputHeaders = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', diff --git a/test/integrations/destinations/klaviyo/processor/screenTestData.ts b/test/integrations/destinations/klaviyo/processor/screenTestData.ts index d14c397bdca..24b3695eba9 100644 --- a/test/integrations/destinations/klaviyo/processor/screenTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/screenTestData.ts @@ -5,6 +5,7 @@ import { generateSimplifiedPageOrScreenPayload, transformResultBuilder, } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -17,7 +18,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -80,7 +81,7 @@ export const screenTestData: ProcessorTestData[] = [ endpoint: 'https://a.klaviyo.com/api/events', headers: { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2023-02-22', }, diff --git a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts index ecc1fcd7f7f..7195c4836aa 100644 --- a/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/screenTestDataV2.ts @@ -5,7 +5,7 @@ import { generateSimplifiedPageOrScreenPayload, transformResultBuilder, } from '../../../testUtils'; - +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -17,7 +17,7 @@ const destination: Destination = { }, Config: { apiVersion: 'v2', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -88,7 +88,7 @@ export const screenTestData: ProcessorTestData[] = [ endpoint: 'https://a.klaviyo.com/api/events', headers: { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2024-06-15', }, diff --git a/test/integrations/destinations/klaviyo/processor/trackTestData.ts b/test/integrations/destinations/klaviyo/processor/trackTestData.ts index 9bc4dfae21e..50a76f3144b 100644 --- a/test/integrations/destinations/klaviyo/processor/trackTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/trackTestData.ts @@ -7,6 +7,7 @@ import { overrideDestination, transformResultBuilder, } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -19,7 +20,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -40,7 +41,7 @@ const commonProps = { const commonOutputHeaders = { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2023-02-22', }; diff --git a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts index b2207998d5b..8fb6ec84785 100644 --- a/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/trackTestDataV2.ts @@ -7,7 +7,7 @@ import { overrideDestination, transformResultBuilder, } from '../../../testUtils'; - +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -18,7 +18,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, @@ -40,7 +40,7 @@ const commonProps = { const commonOutputHeaders = { Accept: 'application/json', - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', revision: '2024-06-15', }; diff --git a/test/integrations/destinations/klaviyo/processor/validationTestData.ts b/test/integrations/destinations/klaviyo/processor/validationTestData.ts index 94d0c7818b4..2bc23257701 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestData.ts @@ -1,6 +1,7 @@ import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; +import { secret1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -13,7 +14,7 @@ const destination: Destination = { }, Config: { publicApiKey: 'dummyPublicApiKey', - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', diff --git a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts index 2deb1debbbc..3aa66d1df01 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts @@ -1,7 +1,7 @@ import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; - +import { secret1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -12,7 +12,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, diff --git a/test/integrations/destinations/klaviyo/router/commonConfig.ts b/test/integrations/destinations/klaviyo/router/commonConfig.ts index a1297635eb9..7389a1215c5 100644 --- a/test/integrations/destinations/klaviyo/router/commonConfig.ts +++ b/test/integrations/destinations/klaviyo/router/commonConfig.ts @@ -1,5 +1,7 @@ import { generateMetadata } from '../../../testUtils'; import { Destination, RouterTransformationRequest } from '../../../../../src/types'; +import { secret1 } from '../maskedSecrets'; + const destination: Destination = { ID: '123', Name: 'klaviyo', @@ -10,7 +12,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -26,7 +28,7 @@ const destinationV2: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, diff --git a/test/integrations/destinations/klaviyo/router/data.ts b/test/integrations/destinations/klaviyo/router/data.ts index 02e22937e12..937c49983c5 100644 --- a/test/integrations/destinations/klaviyo/router/data.ts +++ b/test/integrations/destinations/klaviyo/router/data.ts @@ -3,6 +3,7 @@ import { RouterTestData } from '../../../testTypes'; import { routerRequest } from './commonConfig'; import { generateMetadata } from '../../../testUtils'; import { dataV2 } from './dataV2'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -14,7 +15,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, }, Enabled: true, WorkspaceID: '123', @@ -50,7 +51,7 @@ export const data: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -88,7 +89,7 @@ export const data: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -122,7 +123,7 @@ export const data: RouterTestData[] = [ method: 'PATCH', endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', @@ -170,7 +171,7 @@ export const data: RouterTestData[] = [ method: 'PATCH', endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2023-02-22', diff --git a/test/integrations/destinations/klaviyo/router/dataV2.ts b/test/integrations/destinations/klaviyo/router/dataV2.ts index d67d7947b4e..5b3c8ca0515 100644 --- a/test/integrations/destinations/klaviyo/router/dataV2.ts +++ b/test/integrations/destinations/klaviyo/router/dataV2.ts @@ -2,6 +2,7 @@ import { Destination } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; import { routerRequestV2 } from './commonConfig'; import { generateMetadata, transformResultBuilder } from '../../../testUtils'; +import { secret1, authHeader1 } from '../maskedSecrets'; const destination: Destination = { ID: '123', @@ -13,7 +14,7 @@ const destination: Destination = { Config: {}, }, Config: { - privateApiKey: 'dummyPrivateApiKey', + privateApiKey: secret1, apiVersion: 'v2', }, Enabled: true, @@ -23,7 +24,7 @@ const destination: Destination = { const userProfileCommonEndpoint = 'https://a.klaviyo.com/api/profile-import'; const headers = { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -731,7 +732,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -790,7 +791,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -847,7 +848,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -881,7 +882,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -914,7 +915,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -985,7 +986,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1132,7 +1133,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1166,7 +1167,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -1225,7 +1226,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1755,7 +1756,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1814,7 +1815,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1871,7 +1872,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1905,7 +1906,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-import', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', @@ -1938,7 +1939,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-delete-jobs', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', Accept: 'application/json', revision: '2024-06-15', @@ -1995,7 +1996,7 @@ export const dataV2: RouterTestData[] = [ method: 'POST', endpoint: 'https://a.klaviyo.com/api/events', headers: { - Authorization: 'Klaviyo-API-Key dummyPrivateApiKey', + Authorization: authHeader1, Accept: 'application/json', 'Content-Type': 'application/json', revision: '2024-06-15', diff --git a/test/integrations/destinations/kustomer/maskedSecrets.ts b/test/integrations/destinations/kustomer/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/kustomer/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/kustomer/processor/data.ts b/test/integrations/destinations/kustomer/processor/data.ts index ba8407baaff..5ba9964f6a8 100644 --- a/test/integrations/destinations/kustomer/processor/data.ts +++ b/test/integrations/destinations/kustomer/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'kustomer', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -105,7 +106,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -188,7 +189,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -248,7 +249,7 @@ export const data = [ 'https://api.kustomerapp.com/v1/customers/58210c3db0f09110006b7953?replace=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -289,7 +290,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -365,7 +366,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -407,7 +408,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -486,7 +487,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -533,7 +534,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -612,7 +613,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -660,7 +661,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -730,7 +731,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -773,7 +774,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -842,7 +843,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -885,7 +886,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, genericPage: true, }, }, @@ -958,7 +959,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1004,7 +1005,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, genericScreen: true, }, }, @@ -1081,7 +1082,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1123,7 +1124,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -1218,7 +1219,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1301,7 +1302,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -1401,7 +1402,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1484,7 +1485,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, message: { @@ -1590,7 +1591,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers/abcd1234?replace=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1673,7 +1674,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, genericScreen: true, }, }, @@ -1749,7 +1750,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1791,7 +1792,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, baseEndpoint: 'https://api.prod2.kustomerapp.com', genericScreen: true, }, @@ -1868,7 +1869,7 @@ export const data = [ endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/kustomer/router/data.ts b/test/integrations/destinations/kustomer/router/data.ts index 06f6243cf20..e5fdc384b08 100644 --- a/test/integrations/destinations/kustomer/router/data.ts +++ b/test/integrations/destinations/kustomer/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'kustomer', @@ -77,7 +78,7 @@ export const data = [ }, metadata: { jobId: 1, userId: 'u1' }, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -124,7 +125,7 @@ export const data = [ }, metadata: { jobId: 2, userId: 'u1' }, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -173,7 +174,7 @@ export const data = [ destination: { Config: { baseEndpoint: 'https://api.prod2.kustomerapp.com', - apiKey: 'dummyApiKey', + apiKey: secret1, genericPage: false, genericScreen: false, }, @@ -197,7 +198,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/customers', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -246,7 +247,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -257,7 +258,7 @@ export const data = [ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -280,7 +281,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false }, + Config: { apiKey: secret1, genericPage: false, genericScreen: false }, }, }, { @@ -291,7 +292,7 @@ export const data = [ endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -316,7 +317,7 @@ export const data = [ destination: { Config: { baseEndpoint: 'https://api.prod2.kustomerapp.com', - apiKey: 'dummyApiKey', + apiKey: secret1, genericPage: false, genericScreen: false, }, diff --git a/test/integrations/destinations/lambda/processor/data.ts b/test/integrations/destinations/lambda/processor/data.ts index 540de25417d..b6149139964 100644 --- a/test/integrations/destinations/lambda/processor/data.ts +++ b/test/integrations/destinations/lambda/processor/data.ts @@ -238,8 +238,22 @@ export const data = [ resultSetID: 10, }, output: { - payload: - '{"type":"identify","sentAt":"2022-08-03T10:44:55.382+05:30","userId":"user113","context":{"os":{"name":"android"},"device":{"name":"Mi","token":"qwertyuioprtyuiop"},"traits":{"name":"User2","email":"user112@mail.com"}},"rudderId":"ed33ef22-569d-44b1-a6cb-063c69dca8f0","messageId":"29beef33-2771-45fd-adb4-4376aa6d72d9","timestamp":"2022-08-03T10:44:54.942+05:30","receivedAt":"2022-08-03T10:44:54.943+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-03T10:44:55.382+05:30"}', + payload: JSON.stringify({ + type: 'identify', + sentAt: '2022-08-03T10:44:55.382+05:30', + userId: 'user113', + context: { + os: { name: 'android' }, + device: { name: 'Mi', token: 'qwertyuioprtyuiop' }, + traits: { name: 'User2', email: 'user112@mail.com' }, + }, + rudderId: 'ed33ef22-569d-44b1-a6cb-063c69dca8f0', + messageId: '29beef33-2771-45fd-adb4-4376aa6d72d9', + timestamp: '2022-08-03T10:44:54.942+05:30', + receivedAt: '2022-08-03T10:44:54.943+05:30', + request_ip: '[::1]', + originalTimestamp: '2022-08-03T10:44:55.382+05:30', + }), destConfig: { clientContext: '', invocationType: 'Event', lambda: 'testFunction' }, userId: '', }, diff --git a/test/integrations/destinations/lambda/router/data.ts b/test/integrations/destinations/lambda/router/data.ts index cba30e09747..ba580f0d335 100644 --- a/test/integrations/destinations/lambda/router/data.ts +++ b/test/integrations/destinations/lambda/router/data.ts @@ -29834,8 +29834,41 @@ export const data = [ }, { batchedRequest: { - payload: - '[{"name":"Screen View","type":"screen","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"identified user id","context":{"ip":"14.5.67.21","library":{"name":"http"}},"rudderId":"daf823fb-e8d3-413a-8313-d34cd756f968","messageId":"1b8ee4c3-ffad-4457-b453-31b32da1dfea","timestamp":"2020-02-02T00:23:09.544Z","properties":{"prop1":"5"},"receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","anonymousId":"anon-id-new","originalTimestamp":"2022-08-18T08:43:15.539+05:30"},{"type":"group","sentAt":"2022-08-18T08:43:15.539+05:30","traits":{"name":"Company","industry":"Industry","employees":123},"userId":"user123","context":{"ip":"14.5.67.21","traits":{"trait1":"new-val"},"library":{"name":"http"}},"groupId":"group1","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","messageId":"2c59b527-3235-4fc2-9680-f41ec52ebb51","timestamp":"2020-01-21T00:21:34.208Z","receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-18T08:43:15.539+05:30"}]', + payload: JSON.stringify([ + { + name: 'Screen View', + type: 'screen', + sentAt: '2022-08-18T08:43:15.539+05:30', + userId: 'identified user id', + context: { ip: '14.5.67.21', library: { name: 'http' } }, + rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968', + messageId: '1b8ee4c3-ffad-4457-b453-31b32da1dfea', + timestamp: '2020-02-02T00:23:09.544Z', + properties: { prop1: '5' }, + receivedAt: '2022-08-18T08:43:13.521+05:30', + request_ip: '[::1]', + anonymousId: 'anon-id-new', + originalTimestamp: '2022-08-18T08:43:15.539+05:30', + }, + { + type: 'group', + sentAt: '2022-08-18T08:43:15.539+05:30', + traits: { name: 'Company', industry: 'Industry', employees: 123 }, + userId: 'user123', + context: { + ip: '14.5.67.21', + traits: { trait1: 'new-val' }, + library: { name: 'http' }, + }, + groupId: 'group1', + rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5', + messageId: '2c59b527-3235-4fc2-9680-f41ec52ebb51', + timestamp: '2020-01-21T00:21:34.208Z', + receivedAt: '2022-08-18T08:43:13.521+05:30', + request_ip: '[::1]', + originalTimestamp: '2022-08-18T08:43:15.539+05:30', + }, + ]), destConfig: { clientContext: '', lambda: 'testFunction', invocationType: 'Event' }, }, metadata: [ @@ -29990,8 +30023,25 @@ export const data = [ }, { batchedRequest: { - payload: - '[{"type":"alias","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"user123","context":{"ip":"14.5.67.21","traits":{"trait1":"new-val"},"library":{"name":"http"}},"rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","messageId":"3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d","timestamp":"2020-01-21T00:21:34.208Z","previousId":"previd1","receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-18T08:43:15.539+05:30"}]', + payload: JSON.stringify([ + { + type: 'alias', + sentAt: '2022-08-18T08:43:15.539+05:30', + userId: 'user123', + context: { + ip: '14.5.67.21', + traits: { trait1: 'new-val' }, + library: { name: 'http' }, + }, + rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5', + messageId: '3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d', + timestamp: '2020-01-21T00:21:34.208Z', + previousId: 'previd1', + receivedAt: '2022-08-18T08:43:13.521+05:30', + request_ip: '[::1]', + originalTimestamp: '2022-08-18T08:43:15.539+05:30', + }, + ]), destConfig: { clientContext: '', lambda: 'testFunction', invocationType: 'Event' }, }, metadata: [ diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts index 64a95e9d8ba..04db1628d59 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/business.ts @@ -1,5 +1,6 @@ import { generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; export const element = { conversion: 'urn:lla:llaPartnerConversion:23456', @@ -75,12 +76,12 @@ export const metadata = { workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; export const headerBlockWithCorrectAccessToken = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts index 2e69a6dbd6f..432161cf199 100644 --- a/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts +++ b/test/integrations/destinations/linkedin_ads/dataDelivery/oauth.ts @@ -1,5 +1,7 @@ +import { secret1, authHeader2, secret2, authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; export const testJSONData = { elements: [ @@ -41,13 +43,13 @@ export const metadata = { workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: secret1, }, dontBatch: false, }; export const headerBlockWithCorrectAccessToken = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -58,16 +60,17 @@ const commonRequestParameters = { headers: headerBlockWithCorrectAccessToken, JSON: testJSONData, }; -const commonRequestParametersWithInvalidAccess = { - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer invalidToken' }, + +const commonRequestParametersWithRevokedAccess = { + headers: { ...headerBlockWithCorrectAccessToken, Authorization: authHeader1 }, JSON: testJSONData, - accessToken: 'invalidToken', + accessToken: secret1, }; -const commonRequestParametersWithRevokedAccess = { - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer revokedToken' }, +const commonRequestParametersWithInvalidAccess = { + headers: { ...headerBlockWithCorrectAccessToken, Authorization: authHeader2 }, JSON: testJSONData, - accessToken: 'revokedToken', + accessToken: secret2, }; export const oauthScenariosV1: ProxyV1TestData[] = [ @@ -96,10 +99,14 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"status":401,"serviceErrorCode":65601,"code":"REVOKED_ACCESS_TOKEN","message":"The token used in the request has been revoked by the user"}', + error: JSON.stringify({ + status: 401, + serviceErrorCode: 65601, + code: 'REVOKED_ACCESS_TOKEN', + message: 'The token used in the request has been revoked by the user', + }), statusCode: 400, - metadata: { ...metadata, secret: { accessToken: 'revokedToken' } }, + metadata: { ...metadata, secret: { accessToken: secret1 } }, }, ], statTags, @@ -137,10 +144,14 @@ export const oauthScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"status":401,"serviceErrorCode":65600,"code":"INVALID_ACCESS_TOKEN","message":"Invalid access token"}', + error: JSON.stringify({ + status: 401, + serviceErrorCode: 65600, + code: 'INVALID_ACCESS_TOKEN', + message: 'Invalid access token', + }), statusCode: 500, - metadata: { ...metadata, secret: { accessToken: 'invalidToken' } }, + metadata: { ...metadata, secret: { accessToken: secret2 } }, }, ], statTags: { ...statTags, errorType: 'retryable' }, diff --git a/test/integrations/destinations/linkedin_ads/maskedSecrets.ts b/test/integrations/destinations/linkedin_ads/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/linkedin_ads/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/linkedin_ads/network.ts b/test/integrations/destinations/linkedin_ads/network.ts index cff43996af7..d653f22395b 100644 --- a/test/integrations/destinations/linkedin_ads/network.ts +++ b/test/integrations/destinations/linkedin_ads/network.ts @@ -1,5 +1,8 @@ +import { defaultAccessTokenAuthHeader } from '../../common/secrets'; +import { authHeader1, authHeader2 } from './maskedSecrets'; + export const headerBlockWithCorrectAccessToken = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -67,7 +70,10 @@ const businessMockData = [ httpReq: { method: 'post', url: 'https://api.linkedin.com/rest/conversionEvents', - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer revokedToken' }, + headers: { + ...headerBlockWithCorrectAccessToken, + Authorization: authHeader1, + }, data: testJSONData, }, httpRes: { @@ -86,7 +92,10 @@ const businessMockData = [ httpReq: { method: 'post', url: 'https://api.linkedin.com/rest/conversionEvents', - headers: { ...headerBlockWithCorrectAccessToken, Authorization: 'Bearer invalidToken' }, + headers: { + ...headerBlockWithCorrectAccessToken, + Authorization: authHeader2, + }, data: testJSONData, }, httpRes: { diff --git a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts index 4ecece27524..d5e7b691230 100644 --- a/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/configLevelFeaturesTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateTrackPayload, @@ -6,6 +7,7 @@ import { } from '../../../testUtils'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; const commonDestination: Destination = { ID: '12335', @@ -55,7 +57,7 @@ const commonUserProperties = { const commonTimestamp = new Date('2023-10-14'); const commonHeader = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts index adc7a551a24..f2ad44cef8f 100644 --- a/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/trackTestData.ts @@ -1,6 +1,7 @@ import { generateMetadata, generateTrackPayload, transformResultBuilder } from '../../../testUtils'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; const commonDestination: Destination = { ID: '12335', @@ -113,7 +114,7 @@ const commonStatTags = { }; const commonHeader = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts index ba8e3b54def..ec206a47c25 100644 --- a/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts +++ b/test/integrations/destinations/linkedin_ads/processor/validationTestData.ts @@ -6,6 +6,7 @@ import { } from '../../../testUtils'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; const commonDestination: Destination = { ID: '12335', @@ -76,7 +77,7 @@ const commonStats = { }; const commonHeader = { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_ads/router/data.ts b/test/integrations/destinations/linkedin_ads/router/data.ts index a38294a61ce..c1240b6ae53 100644 --- a/test/integrations/destinations/linkedin_ads/router/data.ts +++ b/test/integrations/destinations/linkedin_ads/router/data.ts @@ -1,3 +1,5 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; + export const mockFns = (_) => { // @ts-ignore jest.useFakeTimers().setSystemTime(new Date('2023-10-15')); @@ -118,7 +120,7 @@ export const data = [ namespace: '', jobId: 1, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, destination: commonDestination, @@ -187,7 +189,7 @@ export const data = [ namespace: '', jobId: 2, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, destination: commonDestination, @@ -255,7 +257,7 @@ export const data = [ namespace: '', jobId: 3, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, destination: commonDestination, @@ -279,7 +281,7 @@ export const data = [ namespace: '', jobId: 3, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, ], @@ -420,7 +422,7 @@ export const data = [ 'X-RestLi-Method': 'BATCH_CREATE', 'X-Restli-Protocol-Version': '2.0.0', 'LinkedIn-Version': '202409', - Authorization: 'Bearer dummyToken', + Authorization: defaultAccessTokenAuthHeader, }, params: {}, files: {}, @@ -432,7 +434,7 @@ export const data = [ namespace: '', jobId: 1, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, { @@ -441,7 +443,7 @@ export const data = [ namespace: '', jobId: 2, secret: { - accessToken: 'dummyToken', + accessToken: defaultAccessToken, }, }, ], diff --git a/test/integrations/destinations/linkedin_audience/processor/business.ts b/test/integrations/destinations/linkedin_audience/processor/business.ts index 8878d58cedc..4bed9db7600 100644 --- a/test/integrations/destinations/linkedin_audience/processor/business.ts +++ b/test/integrations/destinations/linkedin_audience/processor/business.ts @@ -1,5 +1,6 @@ import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, generateRecordPayload } from '../../../testUtils'; +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; export const businessTestData: ProcessorTestData[] = [ { @@ -221,7 +222,7 @@ export const businessTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -356,7 +357,7 @@ export const businessTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -503,7 +504,7 @@ export const businessTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/companies', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_audience/processor/validation.ts b/test/integrations/destinations/linkedin_audience/processor/validation.ts index ae63251e249..738627ba678 100644 --- a/test/integrations/destinations/linkedin_audience/processor/validation.ts +++ b/test/integrations/destinations/linkedin_audience/processor/validation.ts @@ -1,3 +1,4 @@ +import { defaultAccessTokenAuthHeader } from '../../../common/secrets'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, generateRecordPayload } from '../../../testUtils'; @@ -127,7 +128,7 @@ export const validationTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -378,7 +379,7 @@ export const validationTestData: ProcessorTestData[] = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/1234/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', diff --git a/test/integrations/destinations/linkedin_audience/router/data.ts b/test/integrations/destinations/linkedin_audience/router/data.ts index c76d3e84c6f..25d6a65caf8 100644 --- a/test/integrations/destinations/linkedin_audience/router/data.ts +++ b/test/integrations/destinations/linkedin_audience/router/data.ts @@ -1,3 +1,4 @@ +import { defaultAccessToken, defaultAccessTokenAuthHeader } from '../../../common/secrets'; import { generateMetadata, generateRecordPayload } from '../../../testUtils'; export const data = [ @@ -271,7 +272,7 @@ export const data = [ endpoint: 'https://api.linkedin.com/rest/dmpSegments/32589526/users', files: {}, headers: { - Authorization: 'Bearer default-accessToken', + Authorization: defaultAccessTokenAuthHeader, 'Content-Type': 'application/json', 'LinkedIn-Version': '202409', 'X-RestLi-Method': 'BATCH_CREATE', @@ -308,7 +309,7 @@ export const data = [ dontBatch: false, jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -320,7 +321,7 @@ export const data = [ dontBatch: false, jobId: 2, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', @@ -358,7 +359,7 @@ export const data = [ dontBatch: false, jobId: 3, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, sourceId: 'default-sourceId', userId: 'default-userId', diff --git a/test/integrations/destinations/mailchimp/maskedSecrets.ts b/test/integrations/destinations/mailchimp/maskedSecrets.ts new file mode 100644 index 00000000000..3225565a0f0 --- /dev/null +++ b/test/integrations/destinations/mailchimp/maskedSecrets.ts @@ -0,0 +1,9 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const authHeader1 = `Basic ${base64Convertor('apiKey' + ':' + secret1)}`; +export const authHeader2 = `Basic ${base64Convertor('apiKey' + ':' + secret2)}`; +export const authHeader3 = `Basic ${base64Convertor('apiKey' + ':' + secret3)}`; diff --git a/test/integrations/destinations/mailchimp/network.ts b/test/integrations/destinations/mailchimp/network.ts index a29712ce9a0..0d2f6018914 100644 --- a/test/integrations/destinations/mailchimp/network.ts +++ b/test/integrations/destinations/mailchimp/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -82,7 +83,7 @@ export const networkCallsData = [ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/5587981bdf09024971ff9ddfb2590a6d', method: 'GET', headers: { - Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + Authorization: authHeader1, }, }, httpRes: { @@ -101,7 +102,7 @@ export const networkCallsData = [ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111', method: 'GET', headers: { - Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + Authorization: authHeader1, }, }, httpRes: { diff --git a/test/integrations/destinations/mailchimp/processor/data.ts b/test/integrations/destinations/mailchimp/processor/data.ts index bf3cb6ad064..9e34fe8be33 100644 --- a/test/integrations/destinations/mailchimp/processor/data.ts +++ b/test/integrations/destinations/mailchimp/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader2, secret2, secret1 } from '../maskedSecrets'; export const data = [ { name: 'mailchimp', @@ -18,7 +19,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -93,7 +94,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -146,7 +147,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -216,7 +217,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -260,7 +261,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -370,7 +371,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -486,7 +487,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -563,7 +564,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -607,7 +608,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -687,7 +688,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -777,7 +778,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud112', datacenterId: 'usXX', }, @@ -851,7 +852,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, audienceId: 'aud112', version: '1', @@ -884,7 +885,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -959,7 +960,7 @@ export const data = [ audienceId: 'aud111', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, version: '1', endpoint: @@ -991,7 +992,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1060,7 +1061,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1196,7 +1197,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, datacenterId: 'usXX', }, Enabled: true, @@ -1290,7 +1291,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: '', }, @@ -1385,7 +1386,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1480,7 +1481,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1527,7 +1528,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1572,7 +1573,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1620,7 +1621,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1666,7 +1667,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1734,7 +1735,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1807,7 +1808,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1850,7 +1851,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1891,7 +1892,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -1950,7 +1951,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -1961,7 +1962,10 @@ export const data = [ properties: { brand: 'Aster', product: 'Garments', - products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + products: JSON.stringify([ + { product_id: '123', price: '14' }, + { product_id: '123', price: 14 }, + ]), purchased: 'false', }, }, @@ -1998,7 +2002,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -2057,7 +2061,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5', + Authorization: authHeader2, }, params: {}, body: { @@ -2068,7 +2072,10 @@ export const data = [ properties: { brand: 'Aster', product: 'Garments', - products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + products: JSON.stringify([ + { product_id: '123', price: '14' }, + { product_id: '123', price: 14 }, + ]), purchased: 'false', }, }, @@ -2105,7 +2112,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, @@ -2190,7 +2197,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret2, audienceId: 'aud111', datacenterId: 'usXX', }, diff --git a/test/integrations/destinations/mailchimp/router/data.ts b/test/integrations/destinations/mailchimp/router/data.ts index 93635e53692..86dce69c3d5 100644 --- a/test/integrations/destinations/mailchimp/router/data.ts +++ b/test/integrations/destinations/mailchimp/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader3, secret3 } from '../maskedSecrets'; export const data = [ { name: 'mailchimp', @@ -19,7 +20,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -74,7 +75,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -124,7 +125,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -174,7 +175,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -209,7 +210,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -243,7 +244,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -296,7 +297,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111?skip_merge_validation=true&skip_duplicate_check=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + Authorization: authHeader3, }, params: {}, body: { @@ -336,7 +337,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -354,7 +355,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + Authorization: authHeader3, }, params: {}, body: { @@ -382,7 +383,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -400,7 +401,7 @@ export const data = [ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaWtleQ==', + Authorization: authHeader3, }, params: {}, body: { @@ -411,8 +412,10 @@ export const data = [ properties: { brand: 'Aster', product: 'Garments', - products: - '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]', + products: JSON.stringify([ + { product_id: '123', price: '14' }, + { product_id: '123', price: 14 }, + ]), purchased: 'false', }, }, @@ -435,7 +438,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -454,7 +457,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -485,7 +488,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apikey', + apiKey: secret3, audienceId: 'aud111', datacenterId: 'usXX', enableMergeFields: true, @@ -532,7 +535,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -589,7 +592,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -635,7 +638,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -681,7 +684,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -736,7 +739,7 @@ export const data = [ 'https://us20.api.mailchimp.com/3.0/lists/1232yyqw22?skip_merge_validation=false&skip_duplicate_check=false', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==', + Authorization: authHeader1, }, params: {}, body: { @@ -774,7 +777,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, @@ -792,7 +795,7 @@ export const data = [ DisplayName: 'MailChimp', }, Config: { - apiKey: 'apiKey-dummyApiKey', + apiKey: secret1, audienceId: '1232yyqw22', datacenterId: 'us20', }, diff --git a/test/integrations/destinations/mailjet/maskedSecrets.ts b/test/integrations/destinations/mailjet/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/mailjet/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/mailjet/processor/data.ts b/test/integrations/destinations/mailjet/processor/data.ts index 03c3232e723..881080726ff 100644 --- a/test/integrations/destinations/mailjet/processor/data.ts +++ b/test/integrations/destinations/mailjet/processor/data.ts @@ -1,3 +1,4 @@ +import { secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'mailjet', @@ -20,7 +21,7 @@ export const data = [ }, integrations: { All: true, 'user.com': { lookup: 'email' } }, }, - destination: { Config: { apiKey: 'dummyApiKey', apiSecret: 'dummyApiSecret' } }, + destination: { Config: { apiKey: secret1, apiSecret: secret2 } }, }, ], method: 'POST', @@ -75,7 +76,7 @@ export const data = [ }, }, }, - destination: { Config: { apiKey: 'dummyApiKey', apiSecret: 'dummyApiSecret' } }, + destination: { Config: { apiKey: secret1, apiSecret: secret2 } }, }, ], method: 'POST', @@ -129,7 +130,7 @@ export const data = [ }, }, }, - destination: { Config: { apiKey: 'dummyApiKey', apiSecret: 'dummyApiSecret' } }, + destination: { Config: { apiKey: secret1, apiSecret: secret2 } }, }, ], method: 'POST', @@ -185,8 +186,8 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, diff --git a/test/integrations/destinations/mailjet/router/data.ts b/test/integrations/destinations/mailjet/router/data.ts index 689e73ef2a6..7cb6edf5f64 100644 --- a/test/integrations/destinations/mailjet/router/data.ts +++ b/test/integrations/destinations/mailjet/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'mailjet', @@ -12,8 +13,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -56,7 +57,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -75,8 +76,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -100,8 +101,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -147,7 +148,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -176,8 +177,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -206,8 +207,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -237,8 +238,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -280,8 +281,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -323,8 +324,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -366,8 +367,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -409,8 +410,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -446,8 +447,8 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }], }, @@ -493,7 +494,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -528,8 +529,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -548,7 +549,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58570/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -574,8 +575,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -594,7 +595,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58576/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -620,8 +621,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -640,7 +641,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58576/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -666,8 +667,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -686,7 +687,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/585896/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -712,8 +713,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { @@ -732,7 +733,7 @@ export const data = [ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/584896/managemanycontacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=', + Authorization: authHeader1, }, params: {}, body: { @@ -758,8 +759,8 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'dummyApiSecret', + apiKey: secret1, + apiSecret: secret2, listId: '58578', contactPropertiesMapping: [ { diff --git a/test/integrations/destinations/marketo/dataDelivery/business.ts b/test/integrations/destinations/marketo/dataDelivery/business.ts index ca4e05afa99..2404ae12d89 100644 --- a/test/integrations/destinations/marketo/dataDelivery/business.ts +++ b/test/integrations/destinations/marketo/dataDelivery/business.ts @@ -1,6 +1,7 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const statTags = { aborted: { @@ -86,7 +87,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -106,8 +107,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"requestId":"664#17dae8c3d48","result":[{"id":1328328,"status":"updated"}],"success":true}', + error: JSON.stringify({ + requestId: '664#17dae8c3d48', + result: [{ id: 1328328, status: 'updated' }], + success: true, + }), metadata: proxyMetdata, statusCode: 200, }, @@ -132,7 +136,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_2', + Authorization: authHeader1, 'Content-Type': 'application/json', }, endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test2', @@ -153,8 +157,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for marketo, Access token invalid (Retryable).during Marketo Response Handling', response: [ { - error: - '{"requestId":"a61c#17daea5968a","success":false,"errors":[{"code":"601","message":"Access token invalid"}]}', + error: JSON.stringify({ + requestId: 'a61c#17daea5968a', + success: false, + errors: [{ code: '601', message: 'Access token invalid' }], + }), metadata: proxyMetdata, statusCode: 500, }, @@ -179,7 +186,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', }, endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test3', @@ -200,8 +207,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for marketo, Requested resource not found (Aborted).during Marketo Response Handling', response: [ { - error: - '{"requestId":"a61c#17daea5968a","success":false,"errors":[{"code":"610","message":"Requested resource not found"}]}', + error: JSON.stringify({ + requestId: 'a61c#17daea5968a', + success: false, + errors: [{ code: '610', message: 'Requested resource not found' }], + }), metadata: proxyMetdata, statusCode: 400, }, @@ -226,7 +236,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', }, endpoint: 'https://mktId.mktorest.com/rest/v1/leads.json/test4', @@ -270,7 +280,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ body: generateProxyV1Payload( { headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'invalid', 'User-Agent': 'RudderLabs', }, @@ -292,8 +302,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for marketo, Invalid Content Type (Aborted).during Marketo Response Handling', response: [ { - error: - '{"success":false,"errors":[{"code":"612","message":"Invalid Content Type"}]}', + error: JSON.stringify({ + success: false, + errors: [{ code: '612', message: 'Invalid Content Type' }], + }), metadata: proxyMetdata, statusCode: 400, }, @@ -317,7 +329,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ body: generateProxyV1Payload( { headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -338,8 +350,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request failed with status: 400', response: [ { - error: - '{"success":false,"errors":[{"code":"1077","message":"Value for field exceeds max length"}]}', + error: JSON.stringify({ + success: false, + errors: [{ code: '1077', message: 'Value for field exceeds max length' }], + }), metadata: proxyMetdata, statusCode: 400, }, diff --git a/test/integrations/destinations/marketo/dataDelivery/data.ts b/test/integrations/destinations/marketo/dataDelivery/data.ts index db379c9e956..30b223b8639 100644 --- a/test/integrations/destinations/marketo/dataDelivery/data.ts +++ b/test/integrations/destinations/marketo/dataDelivery/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { testScenariosForV1API } from './business'; import { otheMarketoScenariosV1 } from './other'; @@ -16,7 +17,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -81,7 +82,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_2', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -157,7 +158,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -233,7 +234,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -299,7 +300,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_5', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -365,7 +366,7 @@ const legacyTests = [ method: 'POST', userId: '', headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -432,7 +433,7 @@ const legacyTests = [ endpoint: 'https://unhandled_exception_in_proxy_req.mktorest.com/rest/v1/leads.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, body: { JSON: { diff --git a/test/integrations/destinations/marketo/dataDelivery/other.ts b/test/integrations/destinations/marketo/dataDelivery/other.ts index 5d4e3b1f177..72faf5248af 100644 --- a/test/integrations/destinations/marketo/dataDelivery/other.ts +++ b/test/integrations/destinations/marketo/dataDelivery/other.ts @@ -1,5 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; const statTags = { aborted: { @@ -27,7 +28,7 @@ const statTags = { const metadata = { jobId: 1, secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, attemptNum: 1, userId: 'default-userId', @@ -63,8 +64,13 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata, }, diff --git a/test/integrations/destinations/marketo/maskedSecrets.ts b/test/integrations/destinations/marketo/maskedSecrets.ts new file mode 100644 index 00000000000..c3e36ab909c --- /dev/null +++ b/test/integrations/destinations/marketo/maskedSecrets.ts @@ -0,0 +1,7 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretAccessToken = path.basename(__dirname) + 2; +export const expiredAccessToken = path.basename(__dirname) + 3; + +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/marketo/network.ts b/test/integrations/destinations/marketo/network.ts index 1606e78c516..e2f90643c9e 100644 --- a/test/integrations/destinations/marketo/network.ts +++ b/test/integrations/destinations/marketo/network.ts @@ -1,3 +1,4 @@ +import { authHeader1, expiredAccessToken, secret1, secretAccessToken } from './maskedSecrets'; const userObject = { City: 'Tokyo', Country: 'JP', @@ -9,7 +10,7 @@ const userObject = { }; const headerObject = { - Authorization: 'Bearer test_token_2', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; @@ -24,7 +25,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -80,7 +81,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -110,7 +111,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -127,7 +128,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_5', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -144,7 +145,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -172,7 +173,7 @@ const tfProxyMocksData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -200,7 +201,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secretAccessToken, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -216,7 +217,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_expired', + access_token: expiredAccessToken, expires_in: 0, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -306,7 +307,7 @@ const tfProxyMocksData = [ }, { httpReq: { - url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=b&client_secret=clientSecret&grant_type=client_credentials', + url: `https://munchkinId.mktorest.com/identity/oauth/token?client_id=b&client_secret=${secret1}&grant_type=client_credentials`, method: 'GET', }, httpRes: { @@ -319,12 +320,12 @@ const tfProxyMocksData = [ }, { httpReq: { - url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=clientSecret&grant_type=client_credentials', + url: `https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=${secret1}&grant_type=client_credentials`, method: 'GET', }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -388,7 +389,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -401,7 +402,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -444,7 +445,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -475,7 +476,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -488,7 +489,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -541,7 +542,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -605,7 +606,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -765,7 +766,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -816,7 +817,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -867,7 +868,7 @@ const tfProxyMocksData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -934,7 +935,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_1', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -992,7 +993,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_3', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1023,7 +1024,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_4', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1041,7 +1042,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_5', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1059,7 +1060,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1081,7 +1082,7 @@ const businessMockData = [ lookupField: 'id', }, headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -1110,7 +1111,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1127,7 +1128,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_expired', + access_token: expiredAccessToken, expires_in: 0, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1236,12 +1237,12 @@ const businessMockData = [ { description: 'Mock response for a failed access token request due to invalid client id', httpReq: { - url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=clientSecret&grant_type=client_credentials', + url: `https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=${secret1}&grant_type=client_credentials`, method: 'GET', }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1308,7 +1309,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1322,7 +1323,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1367,7 +1368,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1400,7 +1401,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1414,7 +1415,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'test_access_token', + access_token: secret1, }, status: 200, statusText: 'OK', @@ -1471,7 +1472,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1538,7 +1539,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1705,7 +1706,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1760,7 +1761,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1815,7 +1816,7 @@ const businessMockData = [ }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secret1, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', @@ -1878,7 +1879,7 @@ const businessMockData = [ httpReq: { url: 'https://mktId.mktorest.com/rest/v1/leads.json/test_invalid_header', headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'invalid', 'User-Agent': 'RudderLabs', }, @@ -1903,7 +1904,7 @@ const businessMockData = [ httpReq: { url: 'https://mktId.mktorest.com/rest/v1/leads.json/test_exceeded_length', headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/marketo/processor/data.ts b/test/integrations/destinations/marketo/processor/data.ts index 38201bd60df..f7c6e7fb6de 100644 --- a/test/integrations/destinations/marketo/processor/data.ts +++ b/test/integrations/destinations/marketo/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, expiredAccessToken, secret1 } from '../maskedSecrets'; export const data = [ { name: 'marketo', @@ -50,7 +51,7 @@ export const data = [ userId: 'lynnanderson@smith.net', }, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoYksLmUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -85,7 +86,7 @@ export const data = [ }, Config: { clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, accountId: 'marketo_acct_id_success', rudderEventsMapping: [], }, @@ -114,7 +115,7 @@ export const data = [ endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/customobjects/new_user.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -217,7 +218,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -264,7 +265,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -363,7 +364,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -409,7 +410,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -513,7 +514,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: false, customActivityPropertyMap: [ { @@ -555,7 +556,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -654,8 +655,16 @@ export const data = [ body: [ { statusCode: 500, - error: - '{"message":"Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token","destinationResponse":{"access_token":"access_token_expired","expires_in":0,"scope":"integrations@rudderstack.com","token_type":"bearer"}}', + error: JSON.stringify({ + message: + 'Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token', + destinationResponse: { + access_token: expiredAccessToken, + expires_in: 0, + scope: 'integrations@rudderstack.com', + token_type: 'bearer', + }, + }), statTags: { errorCategory: 'network', errorType: 'retryable', @@ -741,7 +750,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_failed', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: false, customActivityPropertyMap: [ { @@ -775,8 +784,17 @@ export const data = [ body: [ { statusCode: 500, - error: - '{"message":"Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token","destinationResponse":{"response":{"success":false,"errors":[{"code":"601","message":"Access Token Expired"}]},"status":200}}', + error: JSON.stringify({ + message: + 'Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token', + destinationResponse: { + response: { + success: false, + errors: [{ code: '601', message: 'Access Token Expired' }], + }, + status: 200, + }, + }), statTags: { errorCategory: 'network', errorType: 'retryable', @@ -839,7 +857,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -962,7 +980,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: false, customActivityPropertyMap: [ { @@ -1081,7 +1099,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1200,7 +1218,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1318,7 +1336,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1437,7 +1455,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1537,7 +1555,7 @@ export const data = [ Config: { accountId: 'marketo_acct_id_success', clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { @@ -1580,7 +1598,7 @@ export const data = [ method: 'POST', endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1657,7 +1675,7 @@ export const data = [ userId: 'dummyMail@dummyDomain.com', }, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoYksLmUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1692,7 +1710,7 @@ export const data = [ }, Config: { clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientSecret: secret1, accountId: 'marketo_acct_id_success', rudderEventsMapping: [], }, @@ -1720,7 +1738,7 @@ export const data = [ method: 'POST', endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/marketo/router/data.ts b/test/integrations/destinations/marketo/router/data.ts index d187792ea80..e71e1f1fc6c 100644 --- a/test/integrations/destinations/marketo/router/data.ts +++ b/test/integrations/destinations/marketo/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'marketo', @@ -49,8 +50,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -169,8 +170,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -316,8 +317,8 @@ export const data = [ destination: { Config: { accountId: 'valid_account_broken_event', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -469,8 +470,8 @@ export const data = [ destination: { Config: { accountId: 'unhandled_status_code', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -622,8 +623,8 @@ export const data = [ destination: { Config: { accountId: 'successful_identify_transformation', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -728,7 +729,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -757,8 +758,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -846,7 +847,7 @@ export const data = [ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -875,8 +876,8 @@ export const data = [ destination: { Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [{ from: 'name', to: 'productName' }], leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }], @@ -967,8 +968,8 @@ export const data = [ destination: { Config: { accountId: 'valid_account_broken_event', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -1055,8 +1056,18 @@ export const data = [ { batched: false, statusCode: 400, - error: - '{"message":"Error occurred [Marketo Transformer]: During lead look up using email -> some other problem","destinationResponse":{"response":{"requestId":"142e4#1835b117b76","success":false,"errors":[{"code":"random_marketo_code","message":"some other problem"}]},"status":200}}', + error: JSON.stringify({ + message: + 'Error occurred [Marketo Transformer]: During lead look up using email -> some other problem', + destinationResponse: { + response: { + requestId: '142e4#1835b117b76', + success: false, + errors: [{ code: 'random_marketo_code', message: 'some other problem' }], + }, + status: 200, + }, + }), statTags: { errorCategory: 'network', errorType: 'aborted', @@ -1065,8 +1076,8 @@ export const data = [ destination: { Config: { accountId: 'unhandled_status_code', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -1162,7 +1173,7 @@ export const data = [ 'https://successful_identify_transformation.mktorest.com/rest/v1/leads.json', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, }, params: {}, body: { @@ -1193,8 +1204,8 @@ export const data = [ destination: { Config: { accountId: 'successful_identify_transformation', - clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73', - clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: false, createIfNotExist: true, rudderEventsMapping: [ @@ -1333,8 +1344,8 @@ export const data = [ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { from: 'name', to: 'productName' }, @@ -1374,7 +1385,7 @@ export const data = [ endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1403,8 +1414,8 @@ export const data = [ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', Config: { accountId: 'marketo_acct_id_success', - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', + clientId: 'marketo_client_id', + clientSecret: secret1, trackAnonymousEvents: true, customActivityPropertyMap: [ { from: 'name', to: 'productName' }, diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts index 08be877ba84..c00a46613f8 100644 --- a/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/business.ts @@ -1,7 +1,7 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; - +import { authHeader1, authHeaderAccessToken } from '../maskedSecrets'; export const statTags = { aborted: { destType: 'MARKETO_STATIC_LIST', @@ -79,11 +79,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', }, reqMetadataArray, ), @@ -99,8 +99,19 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"requestId":"b6d1#18a8d2c10e7","result":[{"id":110,"status":"skipped","reasons":[{"code":"1015","message":"Lead not in list"}]},{"id":111,"status":"removed"},{"id":112,"status":"removed"}],"success":true}', + error: JSON.stringify({ + requestId: 'b6d1#18a8d2c10e7', + result: [ + { + id: 110, + status: 'skipped', + reasons: [{ code: '1015', message: 'Lead not in list' }], + }, + { id: 111, status: 'removed' }, + { id: 112, status: 'removed' }, + ], + success: true, + }), metadata: proxyMetdata, statusCode: 200, }, @@ -125,11 +136,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', }, reqMetadataArray, ), @@ -147,8 +158,11 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Request Failed for Marketo Static List, Access token invalid (Retryable).during Marketo Static List Response Handling', response: [ { - error: - '{"requestId":"68d8#1846058ee27","success":false,"errors":[{"code":"601","message":"Access token invalid"}]}', + error: JSON.stringify({ + requestId: '68d8#1846058ee27', + success: false, + errors: [{ code: '601', message: 'Access token invalid' }], + }), metadata: proxyMetdata, statusCode: 500, }, @@ -174,12 +188,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', }, reqMetadataArray, ), @@ -195,8 +209,14 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request Processed Successfully', response: [ { - error: - '{"requestId":"12d3c#1846057dce2","result":[{"id":1,"status":"added"},{"id":2,"status":"added"}],"success":true}', + error: JSON.stringify({ + requestId: '12d3c#1846057dce2', + result: [ + { id: 1, status: 'added' }, + { id: 2, status: 'added' }, + ], + success: true, + }), metadata: proxyMetdata, statusCode: 200, }, @@ -221,7 +241,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { ...commonRequestParameters, headers: { - Authorization: 'Bearer test_token_6', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts index c0398f6d2b8..8cb4e2854e2 100644 --- a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeaderAccessToken } from '../maskedSecrets'; import { testScenariosForV1API } from './business'; import { otherScenariosV1 } from './other'; @@ -13,11 +14,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', method: 'POST', userId: '', headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, body: { @@ -84,11 +85,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', method: 'POST', userId: '', headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, body: { @@ -152,11 +153,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', method: 'POST', userId: '', headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, body: { @@ -213,11 +214,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', method: 'POST', userId: '', headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -267,11 +268,11 @@ const legacyTests = [ body: { type: 'REST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', method: 'POST', userId: '', headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts index b1f3403fa6f..b2dc97de115 100644 --- a/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts +++ b/test/integrations/destinations/marketo_static_list/dataDelivery/other.ts @@ -1,6 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload, generateMetadata } from '../../../testUtils'; -import { reqMetadataArray, statTags } from './business'; +import { statTags } from './business'; export const otherScenariosV1: ProxyV1TestData[] = [ { @@ -28,8 +28,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/marketo_static_list/maskedSecrets.ts b/test/integrations/destinations/marketo_static_list/maskedSecrets.ts new file mode 100644 index 00000000000..2c99d64d815 --- /dev/null +++ b/test/integrations/destinations/marketo_static_list/maskedSecrets.ts @@ -0,0 +1,9 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretAccessToken = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; + +export const authHeader1 = `Bearer ${secret1}`; +export const authHeaderAccessToken = `Bearer ${secretAccessToken}`; +export const authHeader3 = `Bearer ${secret3}`; diff --git a/test/integrations/destinations/marketo_static_list/network.ts b/test/integrations/destinations/marketo_static_list/network.ts index f165291c15a..d9da4b3996f 100644 --- a/test/integrations/destinations/marketo_static_list/network.ts +++ b/test/integrations/destinations/marketo_static_list/network.ts @@ -1,10 +1,11 @@ +import { authHeader1, authHeaderAccessToken, secret1, secretAccessToken } from './maskedSecrets'; const deliveryCallsData = [ { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=110&id=111&id=112', params: { destination: 'marketo_static_list' }, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -25,10 +26,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', params: { destination: 'marketo_static_list' }, headers: { - Authorization: 'Bearer Incorrect_token', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -45,10 +46,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2', params: { destination: 'marketo_static_list' }, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -68,10 +69,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=3&id=4', params: {}, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -91,10 +92,10 @@ const deliveryCallsData = [ }, { httpReq: { - url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=5&id=6', params: {}, headers: { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -119,15 +120,15 @@ export const networkCallsData = [ httpReq: { method: 'GET', params: { - client_id: 'marketo_client_id_success', - client_secret: 'marketo_client_secret_success', + client_id: 'marketo_static_list_client_id_success', + client_secret: secret1, grant_type: 'client_credentials', }, - url: 'https://marketo_acct_id_success.mktorest.com/identity/oauth/token', + url: 'https://marketo_static_list_acct_id_success.mktorest.com/identity/oauth/token', }, httpRes: { data: { - access_token: 'access_token_success', + access_token: secretAccessToken, expires_in: 3599, scope: 'integrations@rudderstack.com', token_type: 'bearer', diff --git a/test/integrations/destinations/marketo_static_list/processor/data.ts b/test/integrations/destinations/marketo_static_list/processor/data.ts index 05fba54f6a5..3d944d07b85 100644 --- a/test/integrations/destinations/marketo_static_list/processor/data.ts +++ b/test/integrations/destinations/marketo_static_list/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeaderAccessToken, secret1 } from '../maskedSecrets'; export const data = [ { name: 'marketo_static_list', @@ -10,7 +11,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -20,9 +21,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 3421, }, Enabled: true, @@ -64,9 +65,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -82,9 +83,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -109,7 +110,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -119,9 +120,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -510,9 +511,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -528,9 +529,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -555,7 +556,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -565,9 +566,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -956,9 +957,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -974,9 +975,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1001,7 +1002,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1011,9 +1012,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1066,7 +1067,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1076,9 +1077,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1131,7 +1132,7 @@ export const data = [ body: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1141,9 +1142,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1175,9 +1176,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/marketo_static_list/router/data.ts b/test/integrations/destinations/marketo_static_list/router/data.ts index 6525f7419d9..7a7c66d4b83 100644 --- a/test/integrations/destinations/marketo_static_list/router/data.ts +++ b/test/integrations/destinations/marketo_static_list/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeaderAccessToken, secret1 } from '../maskedSecrets'; export const data = [ { name: 'marketo_static_list', @@ -12,7 +13,7 @@ export const data = [ input: [ { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -22,9 +23,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -50,7 +51,7 @@ export const data = [ }, { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -60,9 +61,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -455,9 +456,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -469,9 +470,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -480,12 +481,12 @@ export const data = [ }, ], metadata: [ - { destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, jobId: 1, userId: 'u1' }, + { destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, jobId: 1, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -495,9 +496,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -512,9 +513,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -526,9 +527,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -537,12 +538,12 @@ export const data = [ }, ], metadata: [ - { destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, jobId: 2, userId: 'u1' }, + { destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, jobId: 2, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -552,9 +553,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -589,9 +590,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -630,9 +631,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -671,9 +672,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -712,9 +713,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -753,9 +754,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -794,9 +795,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -825,7 +826,7 @@ export const data = [ }, { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -835,9 +836,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -863,7 +864,7 @@ export const data = [ }, { destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -873,9 +874,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1268,9 +1269,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=2001&id=2002&id=2003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=2001&id=2002&id=2003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1296,9 +1297,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1313,9 +1314,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1001&id=1002&id=1003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1001&id=1002&id=1003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1341,9 +1342,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1358,9 +1359,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1372,9 +1373,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=101&id=102&id=103', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=101&id=102&id=103', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1383,12 +1384,12 @@ export const data = [ }, ], metadata: [ - { jobId: 7, destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, userId: 'u1' }, + { jobId: 7, destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1398,9 +1399,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1415,9 +1416,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1429,9 +1430,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1440,12 +1441,12 @@ export const data = [ }, ], metadata: [ - { jobId: 8, destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, userId: 'u1' }, + { jobId: 8, destInfo: { authKey: 'marketoStaticListUdJnr7IHI' }, userId: 'u1' }, ], batched: false, statusCode: 200, destination: { - ID: '1zia9wKshXt80YksLmUdJnr7IHI', + ID: 'marketoStaticListUdJnr7IHI', Name: 'test_marketo_al', DestinationDefinition: { ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6', @@ -1455,9 +1456,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1234, }, Enabled: true, @@ -1493,9 +1494,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1534,9 +1535,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1575,9 +1576,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1616,9 +1617,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1657,9 +1658,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1698,9 +1699,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1744,9 +1745,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=2002', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=2002', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1770,9 +1771,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1787,9 +1788,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1814,9 +1815,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1831,9 +1832,9 @@ export const data = [ type: 'REST', method: 'DELETE', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001&id=2003', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001&id=2003', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1858,9 +1859,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, @@ -1875,9 +1876,9 @@ export const data = [ type: 'REST', method: 'POST', endpoint: - 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', + 'https://marketo_static_list_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002', headers: { - Authorization: 'Bearer access_token_success', + Authorization: authHeaderAccessToken, 'Content-Type': 'application/json', }, params: {}, @@ -1901,9 +1902,9 @@ export const data = [ transformAtV1: 'processor', }, Config: { - clientId: 'marketo_client_id_success', - clientSecret: 'marketo_client_secret_success', - accountId: 'marketo_acct_id_success', + clientId: 'marketo_static_list_client_id_success', + clientSecret: secret1, + accountId: 'marketo_static_list_acct_id_success', staticListId: 1122, }, Enabled: true, diff --git a/test/integrations/destinations/mautic/maskedSecrets.ts b/test/integrations/destinations/mautic/maskedSecrets.ts new file mode 100644 index 00000000000..36a02e326f6 --- /dev/null +++ b/test/integrations/destinations/mautic/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; +export const authHeader2 = `Basic ${base64Convertor(secret3 + ':' + secret2)}`; +export const authHeader3 = `Basic ${base64Convertor(secret4 + ':' + secret2)}`; diff --git a/test/integrations/destinations/mautic/network.ts b/test/integrations/destinations/mautic/network.ts index 593a6306412..c2ee4faa08b 100644 --- a/test/integrations/destinations/mautic/network.ts +++ b/test/integrations/destinations/mautic/network.ts @@ -1,8 +1,9 @@ +import { authHeader1, authHeader2 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -13,7 +14,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -24,7 +25,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -674,7 +675,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -1324,7 +1325,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -3221,7 +3222,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', diff --git a/test/integrations/destinations/mautic/processor/data.ts b/test/integrations/destinations/mautic/processor/data.ts index fe1dc6c41af..d4d93aacb8e 100644 --- a/test/integrations/destinations/mautic/processor/data.ts +++ b/test/integrations/destinations/mautic/processor/data.ts @@ -1,3 +1,12 @@ +import { + authHeader1, + secret1, + secret2, + authHeader2, + secret3, + authHeader3, + secret4, +} from '../maskedSecrets'; export const data = [ { name: 'mautic', @@ -32,11 +41,11 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', domainMethod: 'domainNameOption', domainName: 'https://testmautic.com', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -56,7 +65,7 @@ export const data = [ endpoint: 'https://testmautic.com/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -113,11 +122,11 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'test', domainMethod: 'subDomainNameOption', domainName: 'https://testmautic.com/', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -137,7 +146,7 @@ export const data = [ endpoint: 'https://test.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -193,11 +202,11 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'test', domainMethod: 'domainNameOption', domainName: 'https://testmautic.com', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -217,7 +226,7 @@ export const data = [ endpoint: 'https://testmautic.com/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -277,7 +286,7 @@ export const data = [ lookUpField: 'email', password: '', subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -340,7 +349,7 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', domainName: '', userName: 'opiogfuebj', @@ -416,9 +425,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -438,7 +447,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { @@ -519,9 +528,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -541,7 +550,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/contacts/247/edit', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { @@ -622,7 +631,7 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', userName: '', }, @@ -684,7 +693,7 @@ export const data = [ lookUpField: 'email', password: '', subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -757,9 +766,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -816,9 +825,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -876,9 +885,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -932,9 +941,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -988,9 +997,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1048,9 +1057,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1104,9 +1113,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1164,9 +1173,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1212,9 +1221,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1272,9 +1281,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -1328,9 +1337,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1350,7 +1359,7 @@ export const data = [ endpoint: 'https://testapi3.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -1406,9 +1415,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi3', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1428,7 +1437,7 @@ export const data = [ endpoint: 'https://testapi3.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmQGdtYWlsLmNvbTpkdW1teVBhc3N3b3Jk', + Authorization: authHeader3, }, params: {}, body: { @@ -1478,9 +1487,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1500,7 +1509,7 @@ export const data = [ endpoint: 'https://testapi5.mautic.net/api/contacts/246/edit', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { @@ -1541,9 +1550,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1592,9 +1601,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1614,7 +1623,7 @@ export const data = [ endpoint: 'https://testapi5.mautic.net/api/segments/17/contact/246/remove', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -1648,9 +1657,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1670,7 +1679,7 @@ export const data = [ endpoint: 'https://testapi5.mautic.net/api/segments/17/contact/246/add', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -1702,9 +1711,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1752,9 +1761,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'testapi5', - userName: 'abcdef@gmail.com', + userName: secret4, }, }, }, @@ -1803,9 +1812,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1825,7 +1834,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/companies/20/contact/247/add', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VGVzdDQ1ODIzUnVkZGVybGFic0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader2, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -1858,9 +1867,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, @@ -1907,9 +1916,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'Test45823Rudderlabs@gmail.com', + userName: secret3, }, }, }, diff --git a/test/integrations/destinations/mautic/router/data.ts b/test/integrations/destinations/mautic/router/data.ts index e0924053f8a..13c98378f55 100644 --- a/test/integrations/destinations/mautic/router/data.ts +++ b/test/integrations/destinations/mautic/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'mautic', @@ -45,9 +46,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, metadata: { jobId: 1, userId: 'u1' }, @@ -71,8 +72,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/contacts/new', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { @@ -107,9 +107,9 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, @@ -164,7 +164,7 @@ export const data = [ destination: { Config: { lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', domainName: '', userName: 'abcdef', @@ -197,7 +197,7 @@ export const data = [ Config: { domainName: '', lookUpField: 'email', - password: 'dummyPassword', + password: secret2, subDomainName: '', userName: 'abcdef', }, @@ -232,9 +232,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, metadata: { jobId: 3, userId: 'u1' }, @@ -258,8 +258,7 @@ export const data = [ endpoint: 'https://ruddertest2.mautic.net/api/segments/17/contact/246/add', headers: { 'Content-Type': 'application/json', - Authorization: - 'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==', + Authorization: authHeader1, }, params: {}, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, @@ -271,9 +270,9 @@ export const data = [ destination: { Config: { lookUpField: 'lastName', - password: 'dummyPassword', + password: secret2, subDomainName: 'ruddertest2', - userName: 'TestRudderlabs45823@gmail.com', + userName: secret1, }, }, }, diff --git a/test/integrations/destinations/moengage/maskedSecrets.ts b/test/integrations/destinations/moengage/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/moengage/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/moengage/processor/data.ts b/test/integrations/destinations/moengage/processor/data.ts index 50309c03724..e561d24491b 100644 --- a/test/integrations/destinations/moengage/processor/data.ts +++ b/test/integrations/destinations/moengage/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; const mockFns = (_) => { jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2023-10-14T00:00:00.000Z').valueOf()); }; @@ -151,8 +152,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -176,11 +177,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -375,8 +376,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -420,12 +421,12 @@ export const data = [ params: {}, userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -505,8 +506,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -548,12 +549,12 @@ export const data = [ params: {}, userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -643,8 +644,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -688,12 +689,12 @@ export const data = [ params: {}, userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -721,12 +722,12 @@ export const data = [ params: {}, userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/device/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/device/${secret1}`, }, statusCode: 200, }, @@ -808,8 +809,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'EU', @@ -853,12 +854,12 @@ export const data = [ params: {}, userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-02.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-02.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -940,8 +941,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'IND', @@ -985,12 +986,12 @@ export const data = [ params: {}, userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-03.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-03.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -1072,8 +1073,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'AMA', @@ -1181,8 +1182,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'IND', @@ -1291,8 +1292,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'IND', @@ -1480,8 +1481,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -1505,11 +1506,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -1772,8 +1773,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -1797,11 +1798,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -1965,8 +1966,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2010,12 +2011,12 @@ export const data = [ params: {}, userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, }, statusCode: 200, }, @@ -2043,12 +2044,12 @@ export const data = [ params: {}, userId: 'rudder123', headers: { - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: 'https://api-01.moengage.com/v1/device/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/device/${secret1}`, }, statusCode: 200, }, @@ -2206,8 +2207,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2231,11 +2232,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -2483,8 +2484,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2508,11 +2509,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -2652,8 +2653,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2691,11 +2692,10 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, }, version: '1', - endpoint: - 'https://api-01.moengage.com/v1/customer/merge?app_id=W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/merge?app_id=${secret1}`, }, statusCode: 200, }, @@ -2747,8 +2747,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2833,8 +2833,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -2865,12 +2865,12 @@ export const data = [ JSON_ARRAY: {}, XML: {}, }, - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, files: {}, headers: { - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + Authorization: authHeader1, 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', + 'MOE-APPKEY': secret1, }, method: 'POST', params: {}, diff --git a/test/integrations/destinations/moengage/router/data.ts b/test/integrations/destinations/moengage/router/data.ts index a31f407b2c8..01fe949bce9 100644 --- a/test/integrations/destinations/moengage/router/data.ts +++ b/test/integrations/destinations/moengage/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; const mockFns = (_) => { jest.spyOn(Date, 'now').mockReturnValueOnce(new Date('2023-10-14T00:00:00.000Z').valueOf()); }; @@ -141,8 +142,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -218,8 +219,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -245,11 +246,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/event/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -352,8 +353,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', @@ -368,11 +369,11 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, headers: { 'Content-Type': 'application/json', - 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA', - Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, }, params: {}, body: { @@ -421,8 +422,8 @@ export const data = [ }, }, Config: { - apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA', - apiKey: 'dummyApiKey', + apiId: secret1, + apiKey: secret2, eventDelivery: false, eventDeliveryTS: 1602757086384, region: 'US', diff --git a/test/integrations/destinations/monday/dataDelivery/data.ts b/test/integrations/destinations/monday/dataDelivery/data.ts index 16d20470952..1012b866104 100644 --- a/test/integrations/destinations/monday/dataDelivery/data.ts +++ b/test/integrations/destinations/monday/dataDelivery/data.ts @@ -113,7 +113,7 @@ export const data: ProxyV1TestData[] = [ output: { response: [ { - error: '{"error_message":"Rate Limit Exceeded.","status_code":429}', + error: JSON.stringify({ error_message: 'Rate Limit Exceeded.', status_code: 429 }), statusCode: 429, metadata: generateMetadata(1), }, @@ -163,7 +163,7 @@ export const data: ProxyV1TestData[] = [ output: { response: [ { - error: '{"error_message":"Internal server error","status_code":500}', + error: JSON.stringify({ error_message: 'Internal server error', status_code: 500 }), statusCode: 500, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/monday/maskedSecrets.ts b/test/integrations/destinations/monday/maskedSecrets.ts new file mode 100644 index 00000000000..f27971f42a6 --- /dev/null +++ b/test/integrations/destinations/monday/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secretApiToken = path.basename(__dirname) + 1; +export const secretFailedApiToken = path.basename(__dirname) + 2; diff --git a/test/integrations/destinations/monday/network.ts b/test/integrations/destinations/monday/network.ts index f91952069aa..25096b0401a 100644 --- a/test/integrations/destinations/monday/network.ts +++ b/test/integrations/destinations/monday/network.ts @@ -1,3 +1,5 @@ +import { secretFailedApiToken, secretApiToken } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -26,8 +28,12 @@ export const networkCallsData = [ title: 'Subitems', type: 'subtasks', description: null, - settings_str: - '{"allowMultipleItems":true,"itemTypeName":"column.subtasks.title","displayType":"BOARD_INLINE","boardIds":[3160974974]}', + settings_str: JSON.stringify({ + allowMultipleItems: true, + itemTypeName: 'column.subtasks.title', + displayType: 'BOARD_INLINE', + boardIds: [3160974974], + }), }, { id: 'person', @@ -41,8 +47,15 @@ export const networkCallsData = [ title: 'Status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_positions_v2":{"0":0,"1":2,"2":1,"5":3},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_positions_v2: { '0': 0, '1': 2, '2': 1, '5': 3 }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date4', @@ -63,30 +76,42 @@ export const networkCallsData = [ title: 'Connect boards', type: 'board-relation', description: null, - settings_str: '{"allowCreateReflectionColumn":false}', + settings_str: JSON.stringify({ allowCreateReflectionColumn: false }), }, { id: 'status_1', title: 'Other', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date_1', title: 'Date 1', type: 'date', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'status_12', title: 'new status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'numbers', @@ -114,8 +139,13 @@ export const networkCallsData = [ title: 'Dropdown', type: 'dropdown', description: null, - settings_str: - '{"hide_footer":false,"labels":[{"id":1,"name":"dropdown"},{"id":2,"name":"dropup"}]}', + settings_str: JSON.stringify({ + hide_footer: false, + labels: [ + { id: 1, name: 'dropdown' }, + { id: 2, name: 'dropup' }, + ], + }), }, { id: 'email', @@ -150,7 +180,7 @@ export const networkCallsData = [ title: 'Timeline', type: 'timerange', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'dependent_on', @@ -158,8 +188,11 @@ export const networkCallsData = [ type: 'dependency', description: 'Choose the item your task will be dependent on. If the “dependent on” item’s date is changing, the other dates will adjust automatically', - settings_str: - '{"boardIds":[3142482015],"dependencyNewInfra":true,"allowMultipleItems":true}', + settings_str: JSON.stringify({ + boardIds: [3142482015], + dependencyNewInfra: true, + allowMultipleItems: true, + }), }, { id: 'long_text', @@ -180,15 +213,23 @@ export const networkCallsData = [ title: 'Tags', type: 'tag', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'label', title: 'Label', type: 'color', description: '', - settings_str: - '{"done_colors":[1],"labels":{"3":"Label 2","105":"Label 1","156":"Label 3"},"labels_positions_v2":{"3":1,"5":3,"105":0,"156":2},"labels_colors":{"3":{"color":"#0086c0","border":"#3DB0DF","var_name":"blue-links"},"105":{"color":"#9AADBD","border":"#9AADBD","var_name":"winter"},"156":{"color":"#9D99B9","border":"#9D99B9","var_name":"purple_gray"}}}', + settings_str: JSON.stringify({ + done_colors: [1], + labels: { '3': 'Label 2', '105': 'Label 1', '156': 'Label 3' }, + labels_positions_v2: { '3': 1, '5': 3, '105': 0, '156': 2 }, + labels_colors: { + '3': { color: '#0086c0', border: '#3DB0DF', var_name: 'blue-links' }, + '105': { color: '#9AADBD', border: '#9AADBD', var_name: 'winter' }, + '156': { color: '#9D99B9', border: '#9D99B9', var_name: 'purple_gray' }, + }, + }), }, { id: 'world_clock', @@ -287,8 +328,7 @@ export const networkCallsData = [ url: 'https://api.monday.com/v2', method: 'POST', headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, }, httpRes: { @@ -310,8 +350,12 @@ export const networkCallsData = [ title: 'Subitems', type: 'subtasks', description: null, - settings_str: - '{"allowMultipleItems":true,"itemTypeName":"column.subtasks.title","displayType":"BOARD_INLINE","boardIds":[3160974974]}', + settings_str: JSON.stringify({ + allowMultipleItems: true, + itemTypeName: 'column.subtasks.title', + displayType: 'BOARD_INLINE', + boardIds: [3160974974], + }), }, { id: 'person', @@ -325,8 +369,15 @@ export const networkCallsData = [ title: 'Status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_positions_v2":{"0":0,"1":2,"2":1,"5":3},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_positions_v2: { '0': 0, '1': 2, '2': 1, '5': 3 }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date4', @@ -347,30 +398,42 @@ export const networkCallsData = [ title: 'Connect boards', type: 'board-relation', description: null, - settings_str: '{"allowCreateReflectionColumn":false}', + settings_str: JSON.stringify({ allowCreateReflectionColumn: false }), }, { id: 'status_1', title: 'Other', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'date_1', title: 'Date 1', type: 'date', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'status_12', title: 'new status', type: 'color', description: null, - settings_str: - '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}', + settings_str: JSON.stringify({ + labels: { '0': 'Working on it', '1': 'Done', '2': 'Stuck' }, + labels_colors: { + '0': { color: '#fdab3d', border: '#E99729', var_name: 'orange' }, + '1': { color: '#00c875', border: '#00B461', var_name: 'green-shadow' }, + '2': { color: '#e2445c', border: '#CE3048', var_name: 'red-shadow' }, + }, + }), }, { id: 'numbers', @@ -398,8 +461,13 @@ export const networkCallsData = [ title: 'Dropdown', type: 'dropdown', description: null, - settings_str: - '{"hide_footer":false,"labels":[{"id":1,"name":"dropdown"},{"id":2,"name":"dropup"}]}', + settings_str: JSON.stringify({ + hide_footer: false, + labels: [ + { id: 1, name: 'dropdown' }, + { id: 2, name: 'dropup' }, + ], + }), }, { id: 'email', @@ -434,7 +502,7 @@ export const networkCallsData = [ title: 'Timeline', type: 'timerange', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'dependent_on', @@ -442,8 +510,11 @@ export const networkCallsData = [ type: 'dependency', description: 'Choose the item your task will be dependent on. If the “dependent on” item’s date is changing, the other dates will adjust automatically', - settings_str: - '{"boardIds":[3142482015],"dependencyNewInfra":true,"allowMultipleItems":true}', + settings_str: JSON.stringify({ + boardIds: [3142482015], + dependencyNewInfra: true, + allowMultipleItems: true, + }), }, { id: 'long_text', @@ -464,15 +535,23 @@ export const networkCallsData = [ title: 'Tags', type: 'tag', description: null, - settings_str: '{"hide_footer":false}', + settings_str: JSON.stringify({ hide_footer: false }), }, { id: 'label', title: 'Label', type: 'color', description: '', - settings_str: - '{"done_colors":[1],"labels":{"3":"Label 2","105":"Label 1","156":"Label 3"},"labels_positions_v2":{"3":1,"5":3,"105":0,"156":2},"labels_colors":{"3":{"color":"#0086c0","border":"#3DB0DF","var_name":"blue-links"},"105":{"color":"#9AADBD","border":"#9AADBD","var_name":"winter"},"156":{"color":"#9D99B9","border":"#9D99B9","var_name":"purple_gray"}}}', + settings_str: JSON.stringify({ + done_colors: [1], + labels: { '3': 'Label 2', '105': 'Label 1', '156': 'Label 3' }, + labels_positions_v2: { '3': 1, '5': 3, '105': 0, '156': 2 }, + labels_colors: { + '3': { color: '#0086c0', border: '#3DB0DF', var_name: 'blue-links' }, + '105': { color: '#9AADBD', border: '#9AADBD', var_name: 'winter' }, + '156': { color: '#9D99B9', border: '#9D99B9', var_name: 'purple_gray' }, + }, + }), }, { id: 'world_clock', @@ -512,7 +591,7 @@ export const networkCallsData = [ url: 'https://api.monday.com/v2', method: 'POST', headers: { - Authorization: 'failedApiToken', + Authorization: secretFailedApiToken, }, }, httpRes: { diff --git a/test/integrations/destinations/monday/processor/data.ts b/test/integrations/destinations/monday/processor/data.ts index 082ff822fd5..8423d188a12 100644 --- a/test/integrations/destinations/monday/processor/data.ts +++ b/test/integrations/destinations/monday/processor/data.ts @@ -1,3 +1,5 @@ +import { secretFailedApiToken, secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'monday', @@ -11,8 +13,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -82,8 +83,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', files: {}, headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, 'Content-Type': 'application/json', }, method: 'POST', @@ -110,8 +110,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', whitelistedEvents: [ @@ -180,8 +179,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', files: {}, headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, 'Content-Type': 'application/json', }, method: 'POST', @@ -208,8 +206,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -293,8 +290,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -462,8 +458,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '', groupTitle: '', columnToPropertyMapping: [], @@ -547,8 +542,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -632,8 +626,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [ @@ -709,8 +702,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -743,8 +735,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -820,8 +811,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -854,8 +844,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next year', columnToPropertyMapping: [ @@ -951,8 +940,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -1049,8 +1037,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -1181,8 +1168,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -1215,8 +1201,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -1301,6 +1286,7 @@ export const data = [ }, }, { + only: true, name: 'monday', description: 'check for deleted boards (configured boards are deleted)', feature: 'processor', @@ -1312,7 +1298,7 @@ export const data = [ { destination: { Config: { - apiToken: 'failedApiToken', + apiToken: secretFailedApiToken, boardId: '339283934', groupTitle: 'Next year', columnToPropertyMapping: [ diff --git a/test/integrations/destinations/monday/router/data.ts b/test/integrations/destinations/monday/router/data.ts index abd649d805c..0228690878b 100644 --- a/test/integrations/destinations/monday/router/data.ts +++ b/test/integrations/destinations/monday/router/data.ts @@ -1,3 +1,5 @@ +import { secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'monday', @@ -12,8 +14,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -52,8 +53,7 @@ export const data = [ { destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ @@ -121,8 +121,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', files: {}, headers: { - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, 'Content-Type': 'application/json', }, method: 'POST', @@ -135,8 +134,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: '', columnToPropertyMapping: [], @@ -152,8 +150,7 @@ export const data = [ endpoint: 'https://api.monday.com/v2', headers: { 'Content-Type': 'application/json', - Authorization: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + Authorization: secretApiToken, }, params: {}, body: { @@ -172,8 +169,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: - 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih', + apiToken: secretApiToken, boardId: '339283933', groupTitle: 'Next month', columnToPropertyMapping: [ diff --git a/test/integrations/destinations/movable_ink/common.ts b/test/integrations/destinations/movable_ink/common.ts index 29fe76852cb..2cb83e99af7 100644 --- a/test/integrations/destinations/movable_ink/common.ts +++ b/test/integrations/destinations/movable_ink/common.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from './maskedSecrets'; import { Destination } from '../../../../src/types'; const destType = 'movable_ink'; @@ -7,8 +8,8 @@ const channel = 'web'; const destination: Destination = { Config: { endpoint: 'https://collector.movableink-dmz.com/behavioral/abc123', - accessKey: 'test-access-key', - accessSecret: 'test_access_secret', + accessKey: secret1, + accessSecret: secret2, }, DestinationDefinition: { DisplayName: displayName, @@ -48,7 +49,7 @@ const traits = { const headers = { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdC1hY2Nlc3Mta2V5OnRlc3RfYWNjZXNzX3NlY3JldA==', + Authorization: authHeader1, }; const commonProperties = { diff --git a/test/integrations/destinations/movable_ink/maskedSecrets.ts b/test/integrations/destinations/movable_ink/maskedSecrets.ts new file mode 100644 index 00000000000..156e87fe1e6 --- /dev/null +++ b/test/integrations/destinations/movable_ink/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + secret2)}`; diff --git a/test/integrations/destinations/mp/common.ts b/test/integrations/destinations/mp/common.ts index f8aae817808..75a197b9561 100644 --- a/test/integrations/destinations/mp/common.ts +++ b/test/integrations/destinations/mp/common.ts @@ -1,13 +1,13 @@ import { Destination } from '../../../../src/types'; - +import { secret1, secret2 } from './maskedSecrets'; const defaultMockFns = () => { jest.spyOn(Date, 'now').mockReturnValue(new Date(Date.UTC(2020, 0, 25)).valueOf()); }; const sampleDestination: Destination = { Config: { - apiKey: 'dummyApiKey', - token: 'test_api_token', + apiKey: secret1, + token: secret2, prefixProperties: true, useNativeSDK: false, }, @@ -26,7 +26,7 @@ const sampleDestination: Destination = { const destinationWithSetOnceProperty = { Config: { - apiSecret: 'dummySecret', + apiSecret: secret1, dataResidency: 'us', identityMergeApi: 'simplified', setOnceProperties: [ @@ -45,7 +45,7 @@ const destinationWithSetOnceProperty = { property: 'random', }, ], - token: 'dummyToken', + token: secret2, useNativeSDK: false, useNewMapping: false, userDeletionApi: 'engage', diff --git a/test/integrations/destinations/mp/deleteUsers/data.ts b/test/integrations/destinations/mp/deleteUsers/data.ts index 0f469b508fa..7905e3767e0 100644 --- a/test/integrations/destinations/mp/deleteUsers/data.ts +++ b/test/integrations/destinations/mp/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret4 } from '../maskedSecrets'; + export const data = [ { name: 'mp', @@ -3179,11 +3181,11 @@ export const data = [ }, ], config: { - token: 'test_token', + token: secret4, prefixProperties: true, useNativeSDK: false, userDeletionApi: 'task', - gdprApiToken: 'test_gdpr_token', + gdprApiToken: secret4, }, }, ], @@ -3218,7 +3220,7 @@ export const data = [ }, ], config: { - token: 'test_token', + token: secret4, prefixProperties: true, useNativeSDK: false, userDeletionApi: 'task', @@ -3257,7 +3259,7 @@ export const data = [ }, ], config: { - token: 'test_token', + token: secret4, prefixProperties: true, useNativeSDK: false, dataResidency: 'eu', diff --git a/test/integrations/destinations/mp/maskedSecrets.ts b/test/integrations/destinations/mp/maskedSecrets.ts new file mode 100644 index 00000000000..e78fce5e754 --- /dev/null +++ b/test/integrations/destinations/mp/maskedSecrets.ts @@ -0,0 +1,9 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader2 = `Basic ${base64Convertor(secret2 + ':')}`; +export const authHeader4 = `Bearer ${secret4}`; diff --git a/test/integrations/destinations/mp/network.ts b/test/integrations/destinations/mp/network.ts index cc5e265f43f..446bdc4d775 100644 --- a/test/integrations/destinations/mp/network.ts +++ b/test/integrations/destinations/mp/network.ts @@ -1,3 +1,5 @@ +import { authHeader4, secret4 } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -1077,16 +1079,14 @@ const deleteNwData = [ { httpReq: { method: 'post', - - url: 'https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token', + url: `https://mixpanel.com/api/app/data-deletions/v3.0/?token=${secret4}`, data: { distinct_ids: ['rudder1', 'rudder2', 'rudder3'], compliance_type: 'CCPA', }, headers: { 'Content-Type': 'application/json', - - Authorization: 'Bearer test_gdpr_token', + Authorization: authHeader4, }, }, httpRes: { @@ -1101,7 +1101,7 @@ const deleteNwData = [ httpReq: { method: 'post', - url: 'https://mixpanel.com/api/app/data-deletions/v3.0/?token=test_token', + url: `https://mixpanel.com/api/app/data-deletions/v3.0/?token=${secret4}`, data: { distinct_ids: ['rudder2'], compliance_type: 'GDPR', @@ -1109,7 +1109,7 @@ const deleteNwData = [ headers: { 'Content-Type': 'application/json', Accept: 'text/plain', - Authorization: 'Bearer test_gdpr_token', + Authorization: authHeader4, }, }, httpRes: { @@ -1150,7 +1150,7 @@ const deleteNwData = [ httpReq: { method: 'post', url: 'https://api-eu.mixpanel.com/engage', - data: [{ $distinct_id: 'rudder1', $token: 'test_token', $delete: null, $ignore_alias: true }], + data: [{ $distinct_id: 'rudder1', $token: secret4, $delete: null, $ignore_alias: true }], headers: { 'Content-Type': 'application/json', Accept: 'text/plain', diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index 8023f60fa26..1ed97577d66 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -1,5 +1,6 @@ import { overrideDestination } from '../../../testUtils'; import { sampleDestination, defaultMockFns, destinationWithSetOnceProperty } from '../common'; +import { authHeader2, secret2, secret3 } from '../maskedSecrets'; export const data = [ { @@ -12,7 +13,7 @@ export const data = [ request: { body: [ { - destination: overrideDestination(sampleDestination, { token: 'test_api_token' }), + destination: overrideDestination(sampleDestination, { token: secret2 }), message: { anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', channel: 'web', @@ -89,15 +90,44 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","campaign_id":"test_name","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + campaign_id: 'test_name', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + utm_campaign: 'test_name', + utm_source: 'rudder', + utm_medium: 'test_medium', + utm_term: 'test_tem', + utm_content: 'test_content', + utm_test: 'test', + utm_keyword: 'test_keyword', + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -196,15 +226,37 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Viewed a Contact Us page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us","category":"Contact","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Viewed a Contact Us page', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + name: 'Contact Us', + category: 'Contact', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -280,15 +332,32 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Screen","properties":{"category":"communication","ip":"0.0.0.0","$user_id":"hjikl","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Screen', + properties: { + category: 'communication', + ip: '0.0.0.0', + $user_id: 'hjikl', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + name: 'Contact Us', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -371,15 +440,37 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Screen","properties":{"path":"/tests/html/index2.html","referrer":"","search":"","title":"","url":"http://localhost/tests/html/index2.html","ip":"0.0.0.0","$user_id":"hjiklmk","$screen_dpi":2,"mp_lib":"RudderLabs Android SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjiklmk","time":1579847342402,"name":"Contact Us","category":"Contact"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Screen', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + ip: '0.0.0.0', + $user_id: 'hjiklmk', + $screen_dpi: 2, + mp_lib: 'RudderLabs Android SDK', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjiklmk', + time: 1579847342402, + name: 'Contact Us', + category: 'Contact', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -454,15 +545,31 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Screen","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1579847342402,"name":"Contact Us"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Screen', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1579847342402, + name: 'Contact Us', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -564,8 +671,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -678,8 +804,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.403Z","$amount":45.89}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.403Z', $amount: 45.89 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -700,8 +833,13 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$add":{"counter":1,"item_purchased":"2"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $add: { counter: 1, item_purchased: '2' }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -718,15 +856,51 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":45.89,"counter":1,"item_purchased":"2","number_of_logins":"","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","campaign_id":"test_name","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342403,"utm_campaign":"test_name","utm_source":"rudder","utm_medium":"test_medium","utm_term":"test_tem","utm_content":"test_content","utm_test":"test","utm_keyword":"test_keyword","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'test revenue MIXPANEL', + properties: { + currency: 'USD', + revenue: 45.89, + counter: 1, + item_purchased: '2', + number_of_logins: '', + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + campaign_id: 'test_name', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'a6a0ad5a-bd26-4f19-8f75-38484e580fc7', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342403, + utm_campaign: 'test_name', + utm_source: 'rudder', + utm_medium: 'test_medium', + utm_term: 'test_tem', + utm_content: 'test_content', + utm_test: 'test', + utm_keyword: 'test_keyword', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -816,15 +990,23 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$create_alias","properties":{"distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","alias":"1234abc","token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$create_alias', + properties: { + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + alias: '1234abc', + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -953,8 +1135,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.402Z","$amount":25}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.402Z', $amount: 25 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -971,15 +1160,69 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'KM Order Completed', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + revenue: 25, + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1112,8 +1355,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.402Z","$amount":34}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.402Z', $amount: 34 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -1130,15 +1380,78 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","revenue":34,"key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","first_name":"Mickey","lastName":"Mouse","name":"Mickey Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'KM Order Completed', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + revenue: 34, + key_1: { + child_key1: 'child_value1', + child_key2: { + child_key21: 'child_value21', + child_key22: 'child_value22', + }, + }, + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + first_name: 'Mickey', + lastName: 'Mouse', + name: 'Mickey Mouse', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1264,15 +1577,75 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":" new Order Completed totally","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: ' new Order Completed totally', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + total: 23, + order_id: '50314b8e9bcf000000000000', + key_1: { + child_key1: 'child_value1', + child_key2: { + child_key21: 'child_value21', + child_key22: 'child_value22', + }, + }, + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + shipping: 3, + subtotal: 22.5, + tax: 2, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1398,15 +1771,76 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":" Order Completed ","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"total":23,"order_id":"50314b8e9bcf000000000000","key_1":{"child_key1":"child_value1","child_key2":{"child_key21":"child_value21","child_key22":"child_value22"}},"products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"shipping":3,"subtotal":22.5,"tax":2,"Billing Amount":"77","city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: ' Order Completed ', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + total: 23, + order_id: '50314b8e9bcf000000000000', + key_1: { + child_key1: 'child_value1', + child_key2: { + child_key21: 'child_value21', + child_key22: 'child_value22', + }, + }, + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + shipping: 3, + subtotal: 22.5, + tax: 2, + 'Billing Amount': '77', + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1573,8 +2007,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -1660,8 +2110,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1682,8 +2138,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -1769,8 +2231,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"company":["testComp","testComp1"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { company: ['testComp', 'testComp1'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1791,8 +2259,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":["testComp","testComp1"]}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: ['testComp', 'testComp1'] }, + }, + ]), }, XML: {}, FORM: {}, @@ -1813,8 +2287,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp1","$set":{"company":["testComp","testComp1"]}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp1', + $set: { company: ['testComp', 'testComp1'] }, + }, + ]), }, XML: {}, FORM: {}, @@ -1901,8 +2381,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1923,8 +2409,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -2051,8 +2543,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.402Z","$amount":25}},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.402Z', $amount: 25 }, + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + }, + ]), }, XML: {}, FORM: {}, @@ -2069,15 +2568,70 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"KM Order Completed","properties":{"affiliation":"Google Store","checkout_id":"fksdjfsdjfisjf9sdfjsd9f","coupon":"hasbros","currency":"USD","discount":2.5,"order_id":"50314b8e9bcf000000000000","products":[{"category":"Games","image_url":"https:///www.example.com/product/path.jpg","name":"Monopoly: 3rd Edition","price":19,"product_id":"507f1f77bcf86cd799439011","quantity":1,"sku":"45790-32","url":"https://www.example.com/product/path"},{"category":"Games","name":"Uno Card Game","price":3,"product_id":"505bd76785ebb509fc183733","quantity":2,"sku":"46493-32"}],"revenue":25,"shipping":3,"subtotal":22.5,"tax":2,"total":27.5,"city":"Disney","country":"USA","email":"mickey@disney.com","firstname":"Mickey","lastname":"Mouse","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'KM Order Completed', + properties: { + affiliation: 'Google Store', + checkout_id: 'fksdjfsdjfisjf9sdfjsd9f', + coupon: 'hasbros', + currency: 'USD', + discount: 2.5, + order_id: '50314b8e9bcf000000000000', + products: [ + { + category: 'Games', + image_url: 'https:///www.example.com/product/path.jpg', + name: 'Monopoly: 3rd Edition', + price: 19, + product_id: '507f1f77bcf86cd799439011', + quantity: 1, + sku: '45790-32', + url: 'https://www.example.com/product/path', + }, + { + category: 'Games', + name: 'Uno Card Game', + price: 3, + product_id: '505bd76785ebb509fc183733', + quantity: 2, + sku: '46493-32', + }, + ], + revenue: 25, + shipping: 3, + subtotal: 22.5, + tax: 2, + total: 27.5, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstname: 'Mickey', + lastname: 'Mouse', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'aa5f5e44-8756-40ad-ad1e-b0d3b9fa710a', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2164,8 +2718,30 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","$android_devices":["test_device_token"],"$os":"Android","$android_model":"Android SDK built for x86","$android_os_version":"8.1.0","$android_manufacturer":"Google","$android_app_version":"1.0","$android_app_version_code":"1.0","$android_brand":"Google"},"$token":"test_api_token","$distinct_id":"5094f5704b9cf2b3","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + $android_devices: ['test_device_token'], + $os: 'Android', + $android_model: 'Android SDK built for x86', + $android_os_version: '8.1.0', + $android_manufacturer: 'Google', + $android_app_version: '1.0', + $android_app_version_code: '1.0', + $android_brand: 'Google', + }, + $token: secret2, + $distinct_id: '5094f5704b9cf2b3', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -2251,8 +2827,29 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -2269,15 +2866,22 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2366,15 +2970,41 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"path":"/tests/html/index2.html","referrer":"","search":"","title":"","url":"http://localhost/tests/html/index2.html","category":"communication","ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1579847342402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + path: '/tests/html/index2.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost/tests/html/index2.html', + category: 'communication', + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1579847342402, + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2464,15 +3094,23 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$create_alias","properties":{"distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","alias":"1234abc","token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$create_alias', + properties: { + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + alias: '1234abc', + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2564,8 +3202,28 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","createdat":"2020-01-23T08:54:02.362Z","$ios_devices":["test_device_token"],"$ios_device_model":"Android SDK built for x86","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + createdat: '2020-01-23T08:54:02.362Z', + $ios_devices: ['test_device_token'], + $ios_device_model: 'Android SDK built for x86', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -2582,15 +3240,22 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -2682,8 +3347,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -2774,8 +3457,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -2867,8 +3566,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$name":"Mickey Mouse","$country_code":"USA","$city":"Disney","$region":"US","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $name: 'Mickey Mouse', + $country_code: 'USA', + $city: 'Disney', + $region: 'US', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -2965,8 +3683,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3061,8 +3797,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3156,8 +3910,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3250,8 +4022,24 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3345,8 +4133,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$name":"Mickey Mouse","$country_code":"USA","$city":"Disney","$region":"US","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $name: 'Mickey Mouse', + $country_code: 'USA', + $city: 'Disney', + $region: 'US', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3446,8 +4253,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -3550,15 +4375,57 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","anonymousId":"ea776ad0-3136-44fb-9216-5b1578609a2b","userId":"as09sufa09usaf09as0f9uasf","id":"as09sufa09usaf09as0f9uasf","firstName":"Bob","lastName":"Marley","name":"Bob Marley","age":43,"email":"bob@marleymail.com","phone":"+447748544123","birthday":"1987-01-01T20:08:59+0000","createdAt":"2022-01-21T14:10:12+0000","address":"51,B.L.T road, Kolkata-700060","description":"I am great","gender":"male","title":"Founder","username":"bobm","website":"https://bobm.com","randomProperty":"randomValue","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"http://127.0.0.1:7307/Testing/","$initial_referring_domain":"127.0.0.1:7307","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', + batch: JSON.stringify([ + { + event: 'FirstTrackCall12', + properties: { + foo: 'bar', + $deviceId: 'nkasdnkasd', + anonymousId: 'ea776ad0-3136-44fb-9216-5b1578609a2b', + userId: 'as09sufa09usaf09as0f9uasf', + id: 'as09sufa09usaf09as0f9uasf', + firstName: 'Bob', + lastName: 'Marley', + name: 'Bob Marley', + age: 43, + email: 'bob@marleymail.com', + phone: '+447748544123', + birthday: '1987-01-01T20:08:59+0000', + createdAt: '2022-01-21T14:10:12+0000', + address: '51,B.L.T road, Kolkata-700060', + description: 'I am great', + gender: 'male', + title: 'Founder', + username: 'bobm', + website: 'https://bobm.com', + randomProperty: 'randomValue', + $user_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $current_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + $referrer: 'http://127.0.0.1:7307/Testing/', + $screen_height: 900, + $screen_width: 1440, + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'http://127.0.0.1:7307/Testing/', + $initial_referring_domain: '127.0.0.1:7307', + $app_build_number: '1.0.0', + $app_version_string: '1.1.18', + $insert_id: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1632986123523, + $browser: 'Chrome', + $browser_version: '93.0.4577.82', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -3743,15 +4610,44 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"MainActivity","properties":{"name":"MainActivity","automatic":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$user_id":"test_user_id","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"test_user_id","time":1520845503421}}]', + batch: JSON.stringify([ + { + event: 'MainActivity', + properties: { + name: 'MainActivity', + automatic: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $user_id: 'test_user_id', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'test_user_id', + time: 1520845503421, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4021,8 +4917,28 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402,"$ignore_time":true}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + $ignore_time: true, + }, + ]), }, XML: {}, FORM: {}, @@ -4127,8 +5043,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4332,8 +5267,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$first_name":"Mickey","$last_name":"Mouse","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"user1234","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $first_name: 'Mickey', + $last_name: 'Mouse', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'user1234', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4351,14 +5305,21 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["user1234","e6ab2c5e-2cda-44a9-a962-e2f67df78bca"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['user1234', 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4423,7 +5384,7 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiSecret: 'dummyApiKey', + apiSecret: secret3, useNewMapping: true, }), }, @@ -4443,15 +5404,43 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Installed","properties":{"build":4,"version":"1.0","anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":1662363980290}}]', + batch: JSON.stringify([ + { + event: 'Application Installed', + properties: { + build: 4, + version: '1.0', + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: 1662363980290, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4513,7 +5502,7 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiSecret: 'dummyApiKey', + apiSecret: secret3, useNewMapping: true, }), }, @@ -4533,15 +5522,43 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Opened","properties":{"build":4,"version":"1.0","anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":1662363980290}}]', + batch: JSON.stringify([ + { + event: 'Application Opened', + properties: { + build: 4, + version: '1.0', + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: 1662363980290, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4628,8 +5645,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"hjikl","$set":{"groupId":["testGroupId"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'hjikl', + $set: { groupId: ['testGroupId'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -4650,8 +5673,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"groupId","$group_id":"testGroupId","$set":{"company":"testComp","groupId":"groupIdInTraits"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'groupId', + $group_id: 'testGroupId', + $set: { company: 'testComp', groupId: 'groupIdInTraits' }, + }, + ]), }, XML: {}, FORM: {}, @@ -4678,7 +5707,7 @@ export const data = [ description: 'Track: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -4736,15 +5765,42 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Product Viewed","properties":{"name":"T-Shirt","$user_id":"userId01","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"userId01","time":1579847342402,"$device_id":"anonId01"}}]', + batch: JSON.stringify([ + { + event: 'Product Viewed', + properties: { + name: 'T-Shirt', + $user_id: 'userId01', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'userId01', + time: 1579847342402, + $device_id: 'anonId01', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -4773,7 +5829,7 @@ export const data = [ { description: 'Identify: skip merge event when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -4853,8 +5909,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"userId01","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'userId01', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4882,7 +5957,7 @@ export const data = [ 'Identify: append $device: to deviceId while creating the user when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -4961,8 +6036,27 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1579847342402}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:anonId01', + $ip: '0.0.0.0', + $time: 1579847342402, + }, + ]), }, XML: {}, FORM: {}, @@ -4989,7 +6083,7 @@ export const data = [ description: 'Unsupported alias call when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -5078,7 +6172,7 @@ export const data = [ 'Track revenue event: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -5148,8 +6242,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2020-01-24T06:29:02.403Z","$amount":18.9}},"$token":"test_api_token","$distinct_id":"userId01"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2020-01-24T06:29:02.403Z', $amount: 18.9 }, + }, + $token: secret2, + $distinct_id: 'userId01', + }, + ]), }, XML: {}, FORM: {}, @@ -5166,15 +6267,42 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"test revenue MIXPANEL","properties":{"currency":"USD","revenue":18.9,"city":"Disney","country":"USA","email":"mickey@disney.com","firstName":"Mickey","ip":"0.0.0.0","$user_id":"userId01","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"a6a0ad5a-bd26-4f19-8f75-38484e580fc7","token":"test_api_token","distinct_id":"userId01","time":1579847342403,"$device_id":"anonId01","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'test revenue MIXPANEL', + properties: { + currency: 'USD', + revenue: 18.9, + city: 'Disney', + country: 'USA', + email: 'mickey@disney.com', + firstName: 'Mickey', + ip: '0.0.0.0', + $user_id: 'userId01', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'a6a0ad5a-bd26-4f19-8f75-38484e580fc7', + token: secret2, + distinct_id: 'userId01', + time: 1579847342403, + $device_id: 'anonId01', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5204,7 +6332,7 @@ export const data = [ description: 'Page with anonymous user when simplified api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', }), message: { @@ -5273,15 +6401,36 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"$device:anonId01","time":1579847342402,"$device_id":"anonId01","name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: '$device:anonId01', + time: 1579847342402, + $device_id: 'anonId01', + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5311,7 +6460,7 @@ export const data = [ description: 'Group call with anonymous user when simplified api is selected', destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', groupKeySettings: [{ groupKey: 'company' }], }), @@ -5373,8 +6522,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"$device:anonId01","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: '$device:anonId01', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -5395,8 +6550,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -5422,7 +6583,7 @@ export const data = [ { destination: overrideDestination(sampleDestination, { apiKey: 'apiKey123', - token: 'test_api_token', + token: secret2, identityMergeApi: 'simplified', groupKeySettings: [{ groupKey: 'company' }], }), @@ -5540,9 +6701,9 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiKey: 'dummyApiKey', - token: 'test_api_token', - apiSecret: 'dummyApiKey', + apiKey: secret3, + token: secret2, + apiSecret: secret3, useNewMapping: true, }), }, @@ -5566,8 +6727,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2022-09-05T07:46:20.290Z","$amount":12.13}},"$token":"test_api_token","$distinct_id":"39da706ec83d0e90"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2022-09-05T07:46:20.290Z', $amount: 12.13 }, + }, + $token: secret2, + $distinct_id: '39da706ec83d0e90', + }, + ]), }, XML: {}, FORM: {}, @@ -5584,15 +6752,44 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Installed","properties":{"build":4,"version":"1.0","revenue":12.13,"anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":1662363980290}}]', + batch: JSON.stringify([ + { + event: 'Application Installed', + properties: { + build: 4, + version: '1.0', + revenue: 12.13, + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: 1662363980290, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5655,9 +6852,9 @@ export const data = [ originalTimestamp: '2022-09-05T07:46:20.290Z', }, destination: overrideDestination(sampleDestination, { - apiKey: 'dummyApiKey', - token: 'test_api_token', - apiSecret: 'dummyApiKey', + apiKey: secret3, + token: secret2, + apiSecret: secret3, useNewMapping: true, }), }, @@ -5681,8 +6878,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2022-09-05T07:46:20.290Z","$amount":23.45}},"$token":"test_api_token","$distinct_id":"39da706ec83d0e90"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2022-09-05T07:46:20.290Z', $amount: 23.45 }, + }, + $token: secret2, + $distinct_id: '39da706ec83d0e90', + }, + ]), }, XML: {}, FORM: {}, @@ -5699,15 +6903,44 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Application Installed","properties":{"build":4,"version":"1.0","revenue":23.45,"anonymousId":"39da706ec83d0e90","$os":"Android","$screen_height":2984,"$screen_width":1440,"$screen_dpi":560,"$carrier":"T-Mobile","$os_version":"12","$device":"emu64a","$manufacturer":"Google","$model":"sdk_gphone64_arm64","mp_device_model":"sdk_gphone64_arm64","$wifi":true,"$bluetooth_enabled":true,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"4","$app_version_string":"1.0","$insert_id":"168cf720-6227-4b56-a98e-c49bdc7279e9","$session_id":"1662363980","token":"test_api_token","distinct_id":"39da706ec83d0e90","time":null}}]', + batch: JSON.stringify([ + { + event: 'Application Installed', + properties: { + build: 4, + version: '1.0', + revenue: 23.45, + anonymousId: '39da706ec83d0e90', + $os: 'Android', + $screen_height: 2984, + $screen_width: 1440, + $screen_dpi: 560, + $carrier: 'T-Mobile', + $os_version: '12', + $device: 'emu64a', + $manufacturer: 'Google', + $model: 'sdk_gphone64_arm64', + mp_device_model: 'sdk_gphone64_arm64', + $wifi: true, + $bluetooth_enabled: true, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '4', + $app_version_string: '1.0', + $insert_id: '168cf720-6227-4b56-a98e-c49bdc7279e9', + $session_id: '1662363980', + token: secret2, + distinct_id: '39da706ec83d0e90', + time: null, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -5733,8 +6966,8 @@ export const data = [ { description: 'Track: with strict mode enabled', destination: overrideDestination(sampleDestination, { - apiKey: 'dummyApiKey', - token: 'test_api_token', + apiKey: secret3, + token: secret2, apiSecret: 'some_api_secret', dataResidency: 'eu', strictMode: true, @@ -5797,8 +7030,29 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -5815,15 +7069,22 @@ export const data = [ method: 'POST', endpoint: 'https://api-eu.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -6019,8 +7280,17 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set_once":{"$first_name":"Mickey test","$city":"Disney","nationality":"USA"},"$token":"dummyToken","$distinct_id":"Santiy"}]', + batch: JSON.stringify([ + { + $set_once: { + $first_name: 'Mickey test', + $city: 'Disney', + nationality: 'USA', + }, + $token: secret2, + $distinct_id: 'Santiy', + }, + ]), }, XML: {}, FORM: {}, @@ -6041,8 +7311,25 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"TestSanity@disney.com","$country_code":"USA","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","random":"superProp","$lastName":"VarChange","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"dummyToken","$distinct_id":"Santiy","$ip":"0.0.0.0","$time":null}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'TestSanity@disney.com', + $country_code: 'USA', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + random: 'superProp', + $lastName: 'VarChange', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'Santiy', + $ip: '0.0.0.0', + $time: null, + }, + ]), }, XML: {}, FORM: {}, @@ -6153,8 +7440,17 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set_once":{"$first_name":"Mickey test","$city":"Disney","nationality":"USA"},"$token":"dummyToken","$distinct_id":"$device:dummyAnnonymousId"}]', + batch: JSON.stringify([ + { + $set_once: { + $first_name: 'Mickey test', + $city: 'Disney', + nationality: 'USA', + }, + $token: secret2, + $distinct_id: '$device:dummyAnnonymousId', + }, + ]), }, XML: {}, FORM: {}, @@ -6175,8 +7471,25 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"TestSanity@disney.com","$country_code":"USA","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","random":"superProp","$lastName":"VarChange","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"dummyToken","$distinct_id":"$device:dummyAnnonymousId","$ip":"0.0.0.0","$time":null}]', + batch: JSON.stringify([ + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'TestSanity@disney.com', + $country_code: 'USA', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + random: 'superProp', + $lastName: 'VarChange', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:dummyAnnonymousId', + $ip: '0.0.0.0', + $time: null, + }, + ]), }, XML: {}, FORM: {}, @@ -6279,15 +7592,39 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"http://127.0.0.1:7307/Testing/","$initial_referring_domain":"127.0.0.1:7307","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', + batch: JSON.stringify([ + { + event: 'FirstTrackCall12', + properties: { + foo: 'bar', + $deviceId: 'nkasdnkasd', + $user_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $current_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', + $referrer: 'http://127.0.0.1:7307/Testing/', + $screen_height: 900, + $screen_width: 1440, + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'http://127.0.0.1:7307/Testing/', + $initial_referring_domain: '127.0.0.1:7307', + $app_build_number: '1.0.0', + $app_version_string: '1.1.18', + $insert_id: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1632986123523, + $browser: 'Chrome', + $browser_version: '93.0.4577.82', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -6343,15 +7680,27 @@ export const data = [ method: 'POST', endpoint: 'https://api.mixpanel.com/import/', headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: { strict: 0 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523}}]', + batch: JSON.stringify([ + { + event: 'FirstTrackCall12', + properties: { + foo: 'bar', + $deviceId: 'nkasdnkasd', + $user_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $insert_id: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', + token: secret2, + distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + time: 1632986123523, + }, + }, + ]), }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/mp/router/data.ts b/test/integrations/destinations/mp/router/data.ts index c7b30a32b8f..2b3824e1b1c 100644 --- a/test/integrations/destinations/mp/router/data.ts +++ b/test/integrations/destinations/mp/router/data.ts @@ -1,5 +1,6 @@ import { overrideDestination } from '../../../testUtils'; import { sampleDestination } from '../common'; +import { authHeader2, secret1, secret2, secret3 } from '../maskedSecrets'; export const data = [ { @@ -15,8 +16,8 @@ export const data = [ { description: 'Page call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, useOldMapping: true, strictMode: true, }), @@ -76,8 +77,8 @@ export const data = [ description: 'Track: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -124,8 +125,8 @@ export const data = [ { description: 'Identify call to create anonymous user profile', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, useOldMapping: true, strictMode: true, }), @@ -189,8 +190,8 @@ export const data = [ description: 'Identify: append $device: to deviceId while creating the user when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -254,8 +255,8 @@ export const data = [ { description: 'Merge call with strict mode enabled', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, strictMode: true, }), metadata: { jobId: 5, additionalProp: 5, userId: 'u1' }, @@ -300,8 +301,8 @@ export const data = [ { description: 'Group call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -363,8 +364,8 @@ export const data = [ { description: 'Group key not present in traits', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -442,15 +443,36 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: {}, GZIP: { - payload: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + payload: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1688624942402, + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -462,9 +484,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -494,8 +516,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2023-07-06T06:29:02.402Z","$amount":18.9}},"$token":"test_api_token","$distinct_id":"userId01"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2023-07-06T06:29:02.402Z', $amount: 18.9 }, + }, + $token: secret2, + $distinct_id: 'userId01', + }, + ]), }, XML: {}, FORM: {}, @@ -509,15 +538,43 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: {}, GZIP: { - payload: - '[{"event":"Product Viewed","properties":{"name":"T-Shirt","revenue":18.9,"$user_id":"userId01","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"userId01","time":1688624942402,"$device_id":"anonId01"}}]', + payload: JSON.stringify([ + { + event: 'Product Viewed', + properties: { + name: 'T-Shirt', + revenue: 18.9, + $user_id: 'userId01', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'userId01', + time: 1688624942402, + $device_id: 'anonId01', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -530,9 +587,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, identityMergeApi: 'simplified', strictMode: true, @@ -562,8 +619,64 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:anonId01', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -577,15 +690,22 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: {}, GZIP: { - payload: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + payload: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -602,9 +722,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -634,8 +754,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"userId06","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'userId06', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -652,8 +778,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -666,9 +798,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, groupKeySettings: [{ groupKey: 'company' }], strictMode: true, @@ -702,9 +834,9 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, groupKeySettings: [{ groupKey: 'company' }], @@ -740,8 +872,7 @@ export const data = [ { description: 'Page call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, useOldMapping: true, strictMode: true, }), @@ -801,8 +932,8 @@ export const data = [ description: 'Track: set device id and user id when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -849,8 +980,8 @@ export const data = [ { description: 'Identify call to create anonymous user profile', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, useOldMapping: true, strictMode: true, }), @@ -914,8 +1045,8 @@ export const data = [ description: 'Identify: append $device: to deviceId while creating the user when simplified id merge api is selected', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, identityMergeApi: 'simplified', strictMode: true, }), @@ -979,8 +1110,8 @@ export const data = [ { description: 'Merge call with strict mode enabled', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, strictMode: true, }), metadata: { jobId: 5, additionalProp: 5, userId: 'u1' }, @@ -1025,8 +1156,8 @@ export const data = [ { description: 'Group call', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -1088,8 +1219,8 @@ export const data = [ { description: 'Group key not present in traits', destination: overrideDestination(sampleDestination, { - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiSecret: secret3, + token: secret2, groupKeySettings: [ { groupKey: 'company', @@ -1166,14 +1297,35 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Loaded a Page","properties":{"ip":"0.0.0.0","$user_id":"hjikl","$current_url":"https://docs.rudderstack.com/destinations/mixpanel","$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$app_build_number":"1.0.0","$app_version_string":"1.0.5","$insert_id":"dd266c67-9199-4a52-ba32-f46ddde67312","token":"test_api_token","distinct_id":"hjikl","time":1688624942402,"name":"Contact Us","$browser":"Chrome","$browser_version":"79.0.3945.117"}}]', + batch: JSON.stringify([ + { + event: 'Loaded a Page', + properties: { + ip: '0.0.0.0', + $user_id: 'hjikl', + $current_url: 'https://docs.rudderstack.com/destinations/mixpanel', + $screen_dpi: 2, + mp_lib: 'RudderLabs JavaScript SDK', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $app_build_number: '1.0.0', + $app_version_string: '1.0.5', + $insert_id: 'dd266c67-9199-4a52-ba32-f46ddde67312', + token: secret2, + distinct_id: 'hjikl', + time: 1688624942402, + name: 'Contact Us', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1185,9 +1337,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -1217,8 +1369,15 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$append":{"$transactions":{"$time":"2023-07-06T06:29:02.402Z","$amount":18.9}},"$token":"test_api_token","$distinct_id":"userId01"}]', + batch: JSON.stringify([ + { + $append: { + $transactions: { $time: '2023-07-06T06:29:02.402Z', $amount: 18.9 }, + }, + $token: secret2, + $distinct_id: 'userId01', + }, + ]), }, XML: {}, FORM: {}, @@ -1232,14 +1391,42 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"Product Viewed","properties":{"name":"T-Shirt","revenue":18.9,"$user_id":"userId01","$os":"iOS","$screen_height":1794,"$screen_width":1080,"$screen_dpi":420,"$carrier":"Android","$os_version":"8.1.0","$device":"generic_x86","$manufacturer":"Google","$model":"Android SDK built for x86","mp_device_model":"Android SDK built for x86","$wifi":true,"$bluetooth_enabled":false,"mp_lib":"com.rudderstack.android.sdk.core","$app_build_number":"1","$app_version_string":"1.0","$insert_id":"id2","token":"test_api_token","distinct_id":"userId01","time":1688624942402,"$device_id":"anonId01"}}]', + batch: JSON.stringify([ + { + event: 'Product Viewed', + properties: { + name: 'T-Shirt', + revenue: 18.9, + $user_id: 'userId01', + $os: 'iOS', + $screen_height: 1794, + $screen_width: 1080, + $screen_dpi: 420, + $carrier: 'Android', + $os_version: '8.1.0', + $device: 'generic_x86', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + mp_device_model: 'Android SDK built for x86', + $wifi: true, + $bluetooth_enabled: false, + mp_lib: 'com.rudderstack.android.sdk.core', + $app_build_number: '1', + $app_version_string: '1.0', + $insert_id: 'id2', + token: secret2, + distinct_id: 'userId01', + time: 1688624942402, + $device_id: 'anonId01', + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1252,9 +1439,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, identityMergeApi: 'simplified', strictMode: true, @@ -1284,8 +1471,64 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$set":{"$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$firstName":"Mickey","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"mickey@disney.com","$country_code":"USA","$city":"Disney","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","$name":"Mickey Mouse","$firstName":"Mickey","$lastName":"Mouse","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"test_api_token","$distinct_id":"$device:anonId01","$ip":"0.0.0.0","$time":1688624942402},{"$set":{"$carrier":"Android","$manufacturer":"Google","$model":"Android SDK built for x86","$screen_height":1794,"$screen_width":1080,"$wifi":true,"anonymousId":"5094f5704b9cf2b3","userId":"test_user_id","$ios_devices":["test_device_token"],"$os":"iOS","$ios_device_model":"Android SDK built for x86","$ios_version":"8.1.0","$ios_app_release":"1.0","$ios_app_version":"1"},"$token":"test_api_token","$distinct_id":"test_user_id","$time":1584003903421}]', + batch: JSON.stringify([ + { + $set: { + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $firstName: 'Mickey', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $created: '2020-01-23T08:54:02.362Z', + $email: 'mickey@disney.com', + $country_code: 'USA', + $city: 'Disney', + $initial_referrer: 'https://docs.rudderstack.com', + $initial_referring_domain: 'docs.rudderstack.com', + $name: 'Mickey Mouse', + $firstName: 'Mickey', + $lastName: 'Mouse', + $browser: 'Chrome', + $browser_version: '79.0.3945.117', + }, + $token: secret2, + $distinct_id: '$device:anonId01', + $ip: '0.0.0.0', + $time: 1688624942402, + }, + { + $set: { + $carrier: 'Android', + $manufacturer: 'Google', + $model: 'Android SDK built for x86', + $screen_height: 1794, + $screen_width: 1080, + $wifi: true, + anonymousId: '5094f5704b9cf2b3', + userId: 'test_user_id', + $ios_devices: ['test_device_token'], + $os: 'iOS', + $ios_device_model: 'Android SDK built for x86', + $ios_version: '8.1.0', + $ios_app_release: '1.0', + $ios_app_version: '1', + }, + $token: secret2, + $distinct_id: 'test_user_id', + $time: 1584003903421, + }, + ]), }, XML: {}, FORM: {}, @@ -1299,14 +1542,21 @@ export const data = [ endpoint: 'https://api.mixpanel.com/import/', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', + Authorization: authHeader2, }, params: { strict: 1 }, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"event":"$merge","properties":{"$distinct_ids":["test_user_id","5094f5704b9cf2b3"],"token":"test_api_token"}}]', + batch: JSON.stringify([ + { + event: '$merge', + properties: { + $distinct_ids: ['test_user_id', '5094f5704b9cf2b3'], + token: secret2, + }, + }, + ]), }, XML: {}, FORM: {}, @@ -1323,9 +1573,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, useOldMapping: true, @@ -1355,8 +1605,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$distinct_id":"userId06","$set":{"company":["testComp"]},"$ip":"0.0.0.0"}]', + batch: JSON.stringify([ + { + $token: secret2, + $distinct_id: 'userId06', + $set: { company: ['testComp'] }, + $ip: '0.0.0.0', + }, + ]), }, XML: {}, FORM: {}, @@ -1373,8 +1629,14 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"$token":"test_api_token","$group_key":"company","$group_id":"testComp","$set":{"company":"testComp"}}]', + batch: JSON.stringify([ + { + $token: secret2, + $group_key: 'company', + $group_id: 'testComp', + $set: { company: 'testComp' }, + }, + ]), }, XML: {}, FORM: {}, @@ -1387,9 +1649,9 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, groupKeySettings: [{ groupKey: 'company' }], strictMode: true, @@ -1423,9 +1685,9 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', - apiSecret: 'test_api_secret', - token: 'test_api_token', + apiKey: secret1, + apiSecret: secret3, + token: secret2, prefixProperties: true, useNativeSDK: false, groupKeySettings: [{ groupKey: 'company' }], diff --git a/test/integrations/destinations/ometria/processor/data.ts b/test/integrations/destinations/ometria/processor/data.ts index c28854c9fd9..66cfee4e4ec 100644 --- a/test/integrations/destinations/ometria/processor/data.ts +++ b/test/integrations/destinations/ometria/processor/data.ts @@ -82,8 +82,19 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}}}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + }, + ]), }, XML: {}, FORM: {}, @@ -180,8 +191,19 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"updatedId1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":true,"allow_transactional":false}}}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'updatedId1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: true, allow_transactional: false } }, + }, + ]), }, XML: {}, FORM: {}, @@ -277,8 +299,20 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","customer_id":"userId1","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}},"firstname":"test","middlename":"one","lastname":"two"}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + customer_id: 'userId1', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + firstname: 'test', + middlename: 'one', + lastname: 'two', + }, + ]), }, XML: {}, FORM: {}, @@ -376,8 +410,20 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","phone_number":"+911234567890","customer_id":"userId1","@type":"contact","properties":{"field1":"val1"},"marketing_optin":"NOT_SPECIFIED","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}},"firstname":"test","lastname":"one"}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + phone_number: '+911234567890', + customer_id: 'userId1', + '@type': 'contact', + properties: { field1: 'val1' }, + marketing_optin: 'NOT_SPECIFIED', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + firstname: 'test', + lastname: 'one', + }, + ]), }, XML: {}, FORM: {}, @@ -477,8 +523,20 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","phone_number":"+911234567890","customer_id":"userId1","@type":"contact","properties":{"field1":"val1"},"marketing_optin":"NOT_SPECIFIED","channels":{"sms":{"allow_marketing":true,"allow_transactional":true}},"firstname":"test","lastname":"one"}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + phone_number: '+911234567890', + customer_id: 'userId1', + '@type': 'contact', + properties: { field1: 'val1' }, + marketing_optin: 'NOT_SPECIFIED', + channels: { sms: { allow_marketing: true, allow_transactional: true } }, + firstname: 'test', + lastname: 'one', + }, + ]), }, XML: {}, FORM: {}, @@ -567,8 +625,17 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"eventId1","timestamp":"2017-05-01T14:00:00Z","identity_email":"testone@gmail.com","identity_account_id":"userId1","@type":"custom_event","event_type":"event name","properties":{"field1":"val1"}}]', + batch: JSON.stringify([ + { + id: 'eventId1', + timestamp: '2017-05-01T14:00:00Z', + identity_email: 'testone@gmail.com', + identity_account_id: 'userId1', + '@type': 'custom_event', + event_type: 'event name', + properties: { field1: 'val1' }, + }, + ]), }, XML: {}, FORM: {}, @@ -659,8 +726,25 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"}}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + }, + ]), }, XML: {}, FORM: {}, @@ -752,8 +836,26 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [{ product_id: 'prod123', quantity: 4, subtotal: 10 }], + }, + ]), }, XML: {}, FORM: {}, @@ -852,8 +954,33 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10,"variant_options":[{"id":"newid","type":"size","label":"5"}]}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [ + { + product_id: 'prod123', + quantity: 4, + subtotal: 10, + variant_options: [{ id: 'newid', type: 'size', label: '5' }], + }, + ], + }, + ]), }, XML: {}, FORM: {}, @@ -954,8 +1081,33 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10,"variant_options":[{"id":"newid","type":"size","label":"5"}]}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [ + { + product_id: 'prod123', + quantity: 4, + subtotal: 10, + variant_options: [{ id: 'newid', type: 'size', label: '5' }], + }, + ], + }, + ]), }, XML: {}, FORM: {}, @@ -1060,8 +1212,39 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"id":"orderId1","timestamp":"2017-05-01T14:00:00Z","grand_total":1000,"currency":"INR","ip_address":"0.0.0.0","shipping_address":{"city":"Kolkata","state":"West Bengal","country_code":"IN","postcode":"700001"},"customer":{"id":"userId1","email":"testone@gmail.com","firstname":"test","lastname":"one"},"@type":"order","status":"complete","is_valid":true,"properties":{"field1":"val1"},"lineitems":[{"product_id":"prod123","quantity":4,"subtotal":10,"variant_options":[{"id":"newid","type":"size","label":"5"}]}]}]', + batch: JSON.stringify([ + { + id: 'orderId1', + timestamp: '2017-05-01T14:00:00Z', + grand_total: 1000, + currency: 'INR', + ip_address: '0.0.0.0', + shipping_address: { + city: 'Kolkata', + state: 'West Bengal', + country_code: 'IN', + postcode: '700001', + }, + customer: { + id: 'userId1', + email: 'testone@gmail.com', + firstname: 'test', + lastname: 'one', + }, + '@type': 'order', + status: 'complete', + is_valid: true, + properties: { field1: 'val1' }, + lineitems: [ + { + product_id: 'prod123', + quantity: 4, + subtotal: 10, + variant_options: [{ id: 'newid', type: 'size', label: '5' }], + }, + ], + }, + ]), }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/ometria/router/data.ts b/test/integrations/destinations/ometria/router/data.ts index 58f3a91d877..95b88c46130 100644 --- a/test/integrations/destinations/ometria/router/data.ts +++ b/test/integrations/destinations/ometria/router/data.ts @@ -239,8 +239,30 @@ export const data = [ body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"email":"testone@gmail.com","id":"test1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":false,"allow_transactional":false}}},{"email":"testone@gmail.com","id":"updatedId1","customer_id":"userId1","firstname":"test","lastname":"one","@type":"contact","properties":{"field1":"val1","ip":"0.0.0.0"},"marketing_optin":"EXPLICITLY_OPTEDOUT","channels":{"sms":{"allow_marketing":true,"allow_transactional":false}}}]', + batch: JSON.stringify([ + { + email: 'testone@gmail.com', + id: 'test1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: false, allow_transactional: false } }, + }, + { + email: 'testone@gmail.com', + id: 'updatedId1', + customer_id: 'userId1', + firstname: 'test', + lastname: 'one', + '@type': 'contact', + properties: { field1: 'val1', ip: '0.0.0.0' }, + marketing_optin: 'EXPLICITLY_OPTEDOUT', + channels: { sms: { allow_marketing: true, allow_transactional: false } }, + }, + ]), }, XML: {}, FORM: {}, diff --git a/test/integrations/destinations/optimizely_fullstack/network.ts b/test/integrations/destinations/optimizely_fullstack/network.ts index e6a1101ab90..a894449ae4d 100644 --- a/test/integrations/destinations/optimizely_fullstack/network.ts +++ b/test/integrations/destinations/optimizely_fullstack/network.ts @@ -37,8 +37,15 @@ const deleteNwData = [ { id: '$opt_test_audience', name: 'Optimizely-Generated Audience for Backwards Compatibility', - conditions: - '["or", {"match": "exact", "name": "$opt_test_attribute", "type": "custom_attribute", "value": "$opt_test_value"}]', + conditions: JSON.stringify([ + 'or', + { + match: 'exact', + name: '$opt_test_attribute', + type: 'custom_attribute', + value: '$opt_test_value', + }, + ]), }, ], version: '4', diff --git a/test/integrations/destinations/optimizely_fullstack/processor/data.ts b/test/integrations/destinations/optimizely_fullstack/processor/data.ts index fb514bc6b8a..56bd93490e3 100644 --- a/test/integrations/destinations/optimizely_fullstack/processor/data.ts +++ b/test/integrations/destinations/optimizely_fullstack/processor/data.ts @@ -598,8 +598,17 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"{\\"message\\":\\"Data File Lookup Failed due to {\\\\\\"code\\\\\\":\\\\\\"document_not_found\\\\\\",\\\\\\"message\\\\\\":\\\\\\"document_not_found\\\\\\"}: Workflow: procWorkflow, Step: dataFile, ChildStep: undefined, OriginalError: Data File Lookup Failed due to {\\\\\\"code\\\\\\":\\\\\\"document_not_found\\\\\\",\\\\\\"message\\\\\\":\\\\\\"document_not_found\\\\\\"}\\",\\"destinationResponse\\":{\\"code\\":\\"document_not_found\\",\\"message\\":\\"document_not_found\\"}}","destinationResponse":{"code":"document_not_found","message":"document_not_found"}}', + error: JSON.stringify({ + message: JSON.stringify({ + message: + 'Data File Lookup Failed due to {"code":"document_not_found","message":"document_not_found"}: Workflow: procWorkflow, Step: dataFile, ChildStep: undefined, OriginalError: Data File Lookup Failed due to {"code":"document_not_found","message":"document_not_found"}', + destinationResponse: { code: 'document_not_found', message: 'document_not_found' }, + }), + destinationResponse: { + code: 'document_not_found', + message: 'document_not_found', + }, + }), statTags: { destType: 'OPTIMIZELY_FULLSTACK', errorCategory: 'network', diff --git a/test/integrations/destinations/pardot/dataDelivery/constant.ts b/test/integrations/destinations/pardot/dataDelivery/constant.ts index 97e456998e1..ff7a570a821 100644 --- a/test/integrations/destinations/pardot/dataDelivery/constant.ts +++ b/test/integrations/destinations/pardot/dataDelivery/constant.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const retryStatTags = { destType: 'PARDOT', errorCategory: 'network', @@ -9,7 +10,7 @@ export const retryStatTags = { module: 'destination', }; const commonHeaders = { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/destinations/pardot/maskedSecrets.ts b/test/integrations/destinations/pardot/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/pardot/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/pardot/network.ts b/test/integrations/destinations/pardot/network.ts index 9493aab01fb..bcff01361cd 100644 --- a/test/integrations/destinations/pardot/network.ts +++ b/test/integrations/destinations/pardot/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; import { getFormData } from '../../../../src/adapters/network'; export const networkCallsData = [ @@ -268,7 +269,7 @@ export const networkCallsData = [ }).toString(), params: { destination: 'pardot' }, headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8', 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', 'User-Agent': 'RudderLabs', diff --git a/test/integrations/destinations/pardot/router/data.ts b/test/integrations/destinations/pardot/router/data.ts index 0862666bbab..23ebb973fa2 100644 --- a/test/integrations/destinations/pardot/router/data.ts +++ b/test/integrations/destinations/pardot/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, authHeader2, secret2 } from '../maskedSecrets'; import { FEATURES, MODULES } from '../../../../../src/v0/util/tags'; export const data = [ @@ -56,7 +57,7 @@ export const data = [ }, metadata: { jobId: 1, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -163,7 +164,7 @@ export const data = [ }, metadata: { jobId: 2, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -269,7 +270,7 @@ export const data = [ }, metadata: { jobId: 3, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -376,7 +377,7 @@ export const data = [ }, metadata: { jobId: 4, - secret: { access_token: 'myExpiredToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret2, refresh_token: 'myRefreshToken' }, userId: 'u1', }, message: { @@ -557,7 +558,7 @@ export const data = [ method: 'POST', endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -578,7 +579,7 @@ export const data = [ metadata: [ { jobId: 1, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -635,7 +636,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -656,7 +657,7 @@ export const data = [ metadata: [ { jobId: 2, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -713,7 +714,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -734,7 +735,7 @@ export const data = [ metadata: [ { jobId: 3, - secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret1, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -791,7 +792,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io', headers: { - Authorization: 'Bearer myExpiredToken', + Authorization: authHeader2, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, params: {}, @@ -812,7 +813,7 @@ export const data = [ metadata: [ { jobId: 4, - secret: { access_token: 'myExpiredToken', refresh_token: 'myRefreshToken' }, + secret: { access_token: secret2, refresh_token: 'myRefreshToken' }, userId: 'u1', }, ], @@ -936,7 +937,7 @@ export const data = [ method: 'POST', endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/id/123435', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { @@ -1072,7 +1073,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/Roger_12@waltair.io', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { @@ -1207,7 +1208,7 @@ export const data = [ method: 'POST', endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/fid/00Q6r000002LKhTPVR', headers: { - Authorization: 'Bearer myToken', + Authorization: authHeader1, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { @@ -1343,7 +1344,7 @@ export const data = [ endpoint: 'https://pi.pardot.com/api/prospect/version/4/do/upsert/email/rolex_waltair@mywebsite.io', headers: { - Authorization: 'Bearer myExpiredToken', + Authorization: authHeader2, 'Pardot-Business-Unit-Id': '0Uv2v000000k9tHCAQ', }, body: { diff --git a/test/integrations/destinations/pinterest_tag/maskedSecrets.ts b/test/integrations/destinations/pinterest_tag/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/pinterest_tag/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/pinterest_tag/processor/data.ts b/test/integrations/destinations/pinterest_tag/processor/data.ts index 4982444346c..a891ca1cc5f 100644 --- a/test/integrations/destinations/pinterest_tag/processor/data.ts +++ b/test/integrations/destinations/pinterest_tag/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'pinterest_tag', @@ -2791,7 +2792,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -2824,7 +2825,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -2972,7 +2973,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3005,7 +3006,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3156,7 +3157,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3189,7 +3190,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3321,7 +3322,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: '', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3510,7 +3511,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3580,7 +3581,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, files: {}, @@ -3636,7 +3637,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3761,7 +3762,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, diff --git a/test/integrations/destinations/pinterest_tag/router/data.ts b/test/integrations/destinations/pinterest_tag/router/data.ts index 4049f7663a8..7b2f04cb550 100644 --- a/test/integrations/destinations/pinterest_tag/router/data.ts +++ b/test/integrations/destinations/pinterest_tag/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { destType: 'pinterest_tag', @@ -1123,7 +1124,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, @@ -1217,7 +1218,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, @@ -1311,7 +1312,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, @@ -1352,7 +1353,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -1568,7 +1569,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', sendingUnHashedData: true, enableDeduplication: true, diff --git a/test/integrations/destinations/pinterest_tag/step/data.ts b/test/integrations/destinations/pinterest_tag/step/data.ts index 71f12c735ca..af9a3ace4b5 100644 --- a/test/integrations/destinations/pinterest_tag/step/data.ts +++ b/test/integrations/destinations/pinterest_tag/step/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'pinterest_tag', @@ -2810,7 +2811,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -2845,7 +2846,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -2993,7 +2994,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3028,7 +3029,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3179,7 +3180,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3214,7 +3215,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { @@ -3346,7 +3347,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: '', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3539,7 +3540,7 @@ export const data = [ tagId: '123456789', apiVersion: 'newApi', adAccountId: 'accountId123', - conversionToken: 'conversionToken123', + conversionToken: secret1, appId: '429047995', enhancedMatch: true, enableDeduplication: true, @@ -3574,7 +3575,7 @@ export const data = [ endpoint: 'https://api.pinterest.com/v5/ad_accounts/accountId123/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer conversionToken123', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/reddit/dataDelivery/business.ts b/test/integrations/destinations/reddit/dataDelivery/business.ts index cc2feccffa2..73b40dd9953 100644 --- a/test/integrations/destinations/reddit/dataDelivery/business.ts +++ b/test/integrations/destinations/reddit/dataDelivery/business.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV0Payload, @@ -105,7 +106,7 @@ const validRequestMultipleEventsInPayload = { }; const commonHeaders = { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -233,8 +234,14 @@ export const testScenariosForV1API = [ { metadata: generateMetadata(1), statusCode: 403, - error: - '{"success":false,"error":{"reason":"UNAUTHORIZED","explanation":"JSON error unexpected type number on field events event_metadata value"}}', + error: JSON.stringify({ + success: false, + error: { + reason: 'UNAUTHORIZED', + explanation: + 'JSON error unexpected type number on field events event_metadata value', + }, + }), }, ], statTags: { @@ -286,14 +293,68 @@ export const testScenariosForV1API = [ { metadata: { ...generateMetadata(1), dontBatch: true }, statusCode: 500, - error: - '{"message":"There were 1 invalid conversion events. None were processed.","invalid_events":[{"error_message":"event_at timestamp must be less than 168h0m0s old","event":{"event_at":"2018-10-14T09:03:17.562Z","event_type":{"tracking_type":"Purchase"},"event_metadata":{"item_count":0,"products":[{}],"conversion_id":"c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1"},"user":{"aaid":"c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a","email":"ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2","external_id":"7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d","ip_address":"e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36","screen_dimensions":{}}}}]}', + error: JSON.stringify({ + message: 'There were 1 invalid conversion events. None were processed.', + invalid_events: [ + { + error_message: 'event_at timestamp must be less than 168h0m0s old', + event: { + event_at: '2018-10-14T09:03:17.562Z', + event_type: { tracking_type: 'Purchase' }, + event_metadata: { + item_count: 0, + products: [{}], + conversion_id: + 'c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1', + }, + user: { + aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a', + email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2', + external_id: + '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d', + ip_address: + 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + screen_dimensions: {}, + }, + }, + }, + ], + }), }, { metadata: { ...generateMetadata(2), dontBatch: true }, statusCode: 500, - error: - '{"message":"There were 1 invalid conversion events. None were processed.","invalid_events":[{"error_message":"event_at timestamp must be less than 168h0m0s old","event":{"event_at":"2018-10-14T09:03:17.562Z","event_type":{"tracking_type":"Purchase"},"event_metadata":{"item_count":0,"products":[{}],"conversion_id":"c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1"},"user":{"aaid":"c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a","email":"ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2","external_id":"7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d","ip_address":"e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36","screen_dimensions":{}}}}]}', + error: JSON.stringify({ + message: 'There were 1 invalid conversion events. None were processed.', + invalid_events: [ + { + error_message: 'event_at timestamp must be less than 168h0m0s old', + event: { + event_at: '2018-10-14T09:03:17.562Z', + event_type: { tracking_type: 'Purchase' }, + event_metadata: { + item_count: 0, + products: [{}], + conversion_id: + 'c054005afd85a4de74638a776eb8348d44ee875184d7a401830705b7a06e7df1', + }, + user: { + aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a', + email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2', + external_id: + '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d', + ip_address: + 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db', + user_agent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + screen_dimensions: {}, + }, + }, + }, + ], + }), }, ], statTags: { diff --git a/test/integrations/destinations/reddit/dataDelivery/oauth.ts b/test/integrations/destinations/reddit/dataDelivery/oauth.ts index e3c5875a062..1c39798c4ac 100644 --- a/test/integrations/destinations/reddit/dataDelivery/oauth.ts +++ b/test/integrations/destinations/reddit/dataDelivery/oauth.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; import { generateMetadata, generateProxyV1Payload, @@ -40,7 +41,7 @@ const authorizationRequiredRequestPayload = { }; const commonHeaders = { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -217,8 +218,14 @@ export const v1oauthScenarios = [ 'This server could not verify that you are authorized to access the document you requested. during reddit response transformation', response: [ { - error: - '{"success":false,"error":{"reason":"UNAUTHORIZED","explanation":"This server could not verify that you are authorized to access the document you requested."}}', + error: JSON.stringify({ + success: false, + error: { + reason: 'UNAUTHORIZED', + explanation: + 'This server could not verify that you are authorized to access the document you requested.', + }, + }), metadata: generateMetadata(1), statusCode: 401, }, diff --git a/test/integrations/destinations/reddit/maskedSecrets.ts b/test/integrations/destinations/reddit/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/reddit/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/reddit/network.ts b/test/integrations/destinations/reddit/network.ts index 54d7a95b73e..aeafe967608 100644 --- a/test/integrations/destinations/reddit/network.ts +++ b/test/integrations/destinations/reddit/network.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -38,7 +39,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -90,7 +91,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -136,7 +137,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -193,7 +194,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -279,7 +280,7 @@ export const networkCallsData = [ }, params: { destination: 'reddit' }, headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', diff --git a/test/integrations/destinations/reddit/processor/data.ts b/test/integrations/destinations/reddit/processor/data.ts index e7b36f56ff8..529d2aa3a66 100644 --- a/test/integrations/destinations/reddit/processor/data.ts +++ b/test/integrations/destinations/reddit/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'reddit', @@ -84,7 +85,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -102,7 +103,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -157,7 +158,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -251,7 +252,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -269,7 +270,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -324,7 +325,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -403,7 +404,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -421,7 +422,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -472,7 +473,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -541,7 +542,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -559,7 +560,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -607,7 +608,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -676,7 +677,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -694,7 +695,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -740,7 +741,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -809,7 +810,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -827,7 +828,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -875,7 +876,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -954,7 +955,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -972,7 +973,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1023,7 +1024,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -1102,7 +1103,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1120,7 +1121,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1172,7 +1173,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, statusCode: 200, @@ -1249,7 +1250,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1277,7 +1278,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, @@ -1355,7 +1356,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1383,7 +1384,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, @@ -1461,7 +1462,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1489,7 +1490,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, @@ -1566,7 +1567,7 @@ export const data = [ destinationId: 'destId', workspaceId: 'wspId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, }, }, @@ -1594,7 +1595,7 @@ export const data = [ metadata: { destinationId: 'destId', secret: { - accessToken: 'dummyAccessToken', + accessToken: secret1, }, workspaceId: 'wspId', }, diff --git a/test/integrations/destinations/reddit/router/data.ts b/test/integrations/destinations/reddit/router/data.ts index f2dd887b849..4118d46191e 100644 --- a/test/integrations/destinations/reddit/router/data.ts +++ b/test/integrations/destinations/reddit/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'reddit', @@ -69,7 +70,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, @@ -127,7 +128,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 2, userId: 'u1', }, @@ -173,7 +174,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 3, userId: 'u1', }, @@ -238,7 +239,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 4, userId: 'u1', dontBatch: true, @@ -297,7 +298,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 5, userId: 'u1', dontBatch: true, @@ -410,7 +411,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -420,21 +421,21 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 2, userId: 'u1', }, { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 3, userId: 'u1', }, @@ -490,7 +491,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -500,7 +501,7 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 4, userId: 'u1', dontBatch: true, @@ -564,7 +565,7 @@ export const data = [ method: 'POST', endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -574,7 +575,7 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 5, userId: 'u1', dontBatch: true, @@ -657,7 +658,7 @@ export const data = [ metadata: { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, @@ -677,7 +678,7 @@ export const data = [ { destinationId: 'destId', workspaceId: 'wspId', - secret: { accessToken: 'dummyAccessToken' }, + secret: { accessToken: secret1 }, jobId: 1, userId: 'u1', }, diff --git a/test/integrations/destinations/redis/processor/data.ts b/test/integrations/destinations/redis/processor/data.ts index 999a954b59b..45846203d5f 100644 --- a/test/integrations/destinations/redis/processor/data.ts +++ b/test/integrations/destinations/redis/processor/data.ts @@ -320,7 +320,7 @@ export const data = [ Cízǔ: 'test', CamelCase123Key: 'test', '1CComega': 'test', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', }, @@ -449,7 +449,7 @@ export const data = [ Cízǔ: 'test', CamelCase123Key: 'test', '1CComega': 'test', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', }, @@ -560,7 +560,7 @@ export const data = [ fields: { country: 'USA', lastname: 'Mouse', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', firstname: 'Mickey', @@ -673,7 +673,7 @@ export const data = [ fields: { country: 'USA', lastname: 'Mouse', - arrayProp: '[{"x":1,"y":2}]', + arrayProp: JSON.stringify([{ x: 1, y: 2 }]), emptyKey: '', 'nestedProp.innerProp1': 'innerPropVal1', 'nestedProp.innerProp2': 'innerPropVal2', @@ -848,8 +848,13 @@ export const data = [ message: { hash: 'some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id', key: 'some-model', - value: - '{"MODEL_ID":"1691755780","VALID_AT":"2023-08-11T11:32:44.963062Z","USER_MAIN_ID":"rid5530313526204a95efe71d98cd17d5a1","CHURN_SCORE_7_DAYS":0.027986,"PERCENTILE_CHURN_SCORE_7_DAYS":0}', + value: JSON.stringify({ + MODEL_ID: '1691755780', + VALID_AT: '2023-08-11T11:32:44.963062Z', + USER_MAIN_ID: 'rid5530313526204a95efe71d98cd17d5a1', + CHURN_SCORE_7_DAYS: 0.027986, + PERCENTILE_CHURN_SCORE_7_DAYS: 0, + }), }, userId: 'some-user-id', }, diff --git a/test/integrations/destinations/refiner/maskedSecrets.ts b/test/integrations/destinations/refiner/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/refiner/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/refiner/processor/groupTestData.ts b/test/integrations/destinations/refiner/processor/groupTestData.ts index 7ee6ad7e687..d2abd03b148 100644 --- a/test/integrations/destinations/refiner/processor/groupTestData.ts +++ b/test/integrations/destinations/refiner/processor/groupTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -29,7 +30,7 @@ const destination: Destination = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; diff --git a/test/integrations/destinations/refiner/processor/identifyTestData.ts b/test/integrations/destinations/refiner/processor/identifyTestData.ts index 0d4b4a0d037..41948215697 100644 --- a/test/integrations/destinations/refiner/processor/identifyTestData.ts +++ b/test/integrations/destinations/refiner/processor/identifyTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -57,7 +58,7 @@ const expectedOutputUserTraits = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; diff --git a/test/integrations/destinations/refiner/processor/pageTestData.ts b/test/integrations/destinations/refiner/processor/pageTestData.ts index c53804db9f2..6249b65396e 100644 --- a/test/integrations/destinations/refiner/processor/pageTestData.ts +++ b/test/integrations/destinations/refiner/processor/pageTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -41,7 +42,7 @@ const properties = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; diff --git a/test/integrations/destinations/refiner/processor/trackTestData.ts b/test/integrations/destinations/refiner/processor/trackTestData.ts index cdea22540d8..aa21ad6f03a 100644 --- a/test/integrations/destinations/refiner/processor/trackTestData.ts +++ b/test/integrations/destinations/refiner/processor/trackTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -16,7 +17,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, @@ -53,7 +54,7 @@ const properties = { }; const headers = { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }; diff --git a/test/integrations/destinations/refiner/processor/validationTestData.ts b/test/integrations/destinations/refiner/processor/validationTestData.ts index 5b408b5e5c8..4305626c1e8 100644 --- a/test/integrations/destinations/refiner/processor/validationTestData.ts +++ b/test/integrations/destinations/refiner/processor/validationTestData.ts @@ -1,3 +1,4 @@ +import { secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; @@ -12,7 +13,7 @@ const destination: Destination = { Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665474171943, diff --git a/test/integrations/destinations/refiner/router/data.ts b/test/integrations/destinations/refiner/router/data.ts index 0ff75120d6d..9de7995f711 100644 --- a/test/integrations/destinations/refiner/router/data.ts +++ b/test/integrations/destinations/refiner/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'refiner', @@ -38,7 +39,7 @@ export const data = [ metadata: { jobId: 1, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -82,7 +83,7 @@ export const data = [ endpoint: 'https://api.refiner.io/v1/identify-user', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }, method: 'POST', @@ -92,7 +93,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -177,7 +178,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -210,7 +211,7 @@ export const data = [ endpoint: 'https://api.refiner.io/v1/track', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }, method: 'POST', @@ -220,7 +221,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665475307930, @@ -269,7 +270,7 @@ export const data = [ destination: { Config: { accountAttributesMapping: [{ from: 'email', to: 'businessEmail' }], - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665476456112, @@ -307,7 +308,7 @@ export const data = [ endpoint: 'https://api.refiner.io/v1/identify-user', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/x-www-form-urlencoded', }, method: 'POST', @@ -318,7 +319,7 @@ export const data = [ destination: { Config: { accountAttributesMapping: [{ from: 'email', to: 'businessEmail' }], - apiKey: 'dummyApiKey', + apiKey: secret1, blacklistedEvents: [{ eventName: '' }], eventDelivery: true, eventDeliveryTS: 1665476456112, diff --git a/test/integrations/destinations/revenue_cat/maskedSecrets.ts b/test/integrations/destinations/revenue_cat/maskedSecrets.ts new file mode 100644 index 00000000000..e85cee2dd65 --- /dev/null +++ b/test/integrations/destinations/revenue_cat/maskedSecrets.ts @@ -0,0 +1,11 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Basic ${secret1}`; +export const authHeader2 = `Basic ${secret2}`; +export const authHeader3 = `Basic ${secret3}`; +export const authHeader4 = `Basic ${secret4}`; diff --git a/test/integrations/destinations/revenue_cat/processor/data.ts b/test/integrations/destinations/revenue_cat/processor/data.ts index 84b7c5975f8..bd4a86b68b7 100644 --- a/test/integrations/destinations/revenue_cat/processor/data.ts +++ b/test/integrations/destinations/revenue_cat/processor/data.ts @@ -1,3 +1,13 @@ +import { + authHeader1, + secret1, + authHeader2, + secret2, + authHeader3, + secret3, + authHeader4, + secret4, +} from '../maskedSecrets'; export const data = [ { name: 'revenue_cat', @@ -11,7 +21,7 @@ export const data = [ { destination: { Config: { - apiKey: 'as9d920a5e75a18acb4a29abd9ec1e2e', + apiKey: secret1, xPlatform: 'stripe', }, }, @@ -89,7 +99,7 @@ export const data = [ method: 'GET', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678', headers: { - Authorization: 'Basic as9d920a5e75a18acb4a29abd9ec1e2e', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -111,7 +121,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes', headers: { - Authorization: 'Basic as9d920a5e75a18acb4a29abd9ec1e2e', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -178,7 +188,7 @@ export const data = [ { destination: { Config: { - apiKey: 'a5e75dfda29abd920ec1ec8a18acb42e', + apiKey: secret2, xPlatform: 'stripe', }, }, @@ -256,7 +266,7 @@ export const data = [ method: 'GET', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678', headers: { - Authorization: 'Basic a5e75dfda29abd920ec1ec8a18acb42e', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -278,7 +288,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes', headers: { - Authorization: 'Basic a5e75dfda29abd920ec1ec8a18acb42e', + Authorization: authHeader2, 'Content-Type': 'application/json', }, params: {}, @@ -438,7 +448,7 @@ export const data = [ { destination: { Config: { - apiKey: 'a5e75d99c8a18acb4a29abd920ec1e2e', + apiKey: secret3, }, }, message: { @@ -510,7 +520,7 @@ export const data = [ method: 'GET', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678', headers: { - Authorization: 'Basic a5e75d99c8a18acb4a29abd920ec1e2e', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: {}, @@ -532,7 +542,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/subscribers/rudder1235678/attributes', headers: { - Authorization: 'Basic a5e75d99c8a18acb4a29abd920ec1e2e', + Authorization: authHeader3, 'Content-Type': 'application/json', }, params: {}, @@ -581,7 +591,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, }, }, message: { @@ -660,7 +670,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, xPlatform: 'stripe', }, }, @@ -719,7 +729,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -751,7 +761,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -792,7 +802,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, xPlatform: 'stripe', }, }, @@ -870,7 +880,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -902,7 +912,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -934,7 +944,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -966,7 +976,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, @@ -1007,7 +1017,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret4, xPlatform: 'stripe', }, }, @@ -1051,7 +1061,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.revenuecat.com/v1/receipts', headers: { - Authorization: 'Basic dummyApiKey', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Platform': 'stripe', }, diff --git a/test/integrations/destinations/salesforce/dataDelivery/business.ts b/test/integrations/destinations/salesforce/dataDelivery/business.ts index 5374e3fae22..76f00074492 100644 --- a/test/integrations/destinations/salesforce/dataDelivery/business.ts +++ b/test/integrations/destinations/salesforce/dataDelivery/business.ts @@ -1,9 +1,10 @@ import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const params = { destination: 'salesforce' }; @@ -111,7 +112,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: '{"statusText":"No Content"}', + error: JSON.stringify({ statusText: 'No Content' }), metadata: proxyMetdata, statusCode: 200, }, @@ -153,8 +154,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: 500 - due to "Session expired or invalid", (Retryable) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]', + error: JSON.stringify([ + { message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }, + ]), metadata: proxyMetdata, statusCode: 500, }, @@ -196,7 +198,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: "401" due to "INVALID_HEADER_TYPE", (Aborted) during Salesforce Response Handling', response: [ { - error: '[{"message":"INVALID_HEADER_TYPE","errorCode":"INVALID_AUTH_HEADER"}]', + error: JSON.stringify([ + { message: 'INVALID_HEADER_TYPE', errorCode: 'INVALID_AUTH_HEADER' }, + ]), metadata: proxyMetdata, statusCode: 400, }, @@ -237,8 +241,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed - due to "REQUEST_LIMIT_EXCEEDED", (Throttled) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Request limit exceeded","errorCode":"REQUEST_LIMIT_EXCEEDED"}]', + error: JSON.stringify([ + { message: 'Request limit exceeded', errorCode: 'REQUEST_LIMIT_EXCEEDED' }, + ]), metadata: proxyMetdata, statusCode: 429, }, @@ -280,7 +285,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: 503 - due to Server Unavailable, during Salesforce Response Handling', response: [ { - error: '[{"message":"Server Unavailable","errorCode":"SERVER_UNAVAILABLE"}]', + error: JSON.stringify([ + { message: 'Server Unavailable', errorCode: 'SERVER_UNAVAILABLE' }, + ]), metadata: proxyMetdata, statusCode: 429, }, @@ -323,7 +330,10 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) during Salesforce Response Handling', response: [ { - error: '{"error":"invalid_grant","error_description":"authentication failure"}', + error: JSON.stringify({ + error: 'invalid_grant', + error_description: 'authentication failure', + }), metadata: proxyMetdata, statusCode: 400, }, @@ -365,8 +375,26 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: - '{"searchRecords":[{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA"},"Id":"a0J75100002w97gEAA","External_ID__c":"external_id"},{"attributes":{"type":"object_name","url":"/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI"},"Id":"a0J75200002w9ZsEAI","External_ID__c":"external_id TEST"}]}', + error: JSON.stringify({ + searchRecords: [ + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75100002w97gEAA', + }, + Id: 'a0J75100002w97gEAA', + External_ID__c: 'external_id', + }, + { + attributes: { + type: 'object_name', + url: '/services/data/v50.0/sobjects/object_name/a0J75200002w9ZsEAI', + }, + Id: 'a0J75200002w9ZsEAI', + External_ID__c: 'external_id TEST', + }, + ], + }), metadata: proxyMetdata, statusCode: 200, }, diff --git a/test/integrations/destinations/salesforce/dataDelivery/data.ts b/test/integrations/destinations/salesforce/dataDelivery/data.ts index f157161751b..568a2564dd5 100644 --- a/test/integrations/destinations/salesforce/dataDelivery/data.ts +++ b/test/integrations/destinations/salesforce/dataDelivery/data.ts @@ -2,6 +2,7 @@ import { AxiosError } from 'axios'; import MockAdapter from 'axios-mock-adapter'; import { testScenariosForV1API } from './business'; import { otherSalesforceScenariosV1 } from './other'; +import { authHeader1, authHeader2 } from '../maskedSecrets'; const legacyDataValue = { Email: 'danis.archurav@sbermarket.ru', @@ -28,7 +29,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1', @@ -83,7 +84,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/3', @@ -152,7 +153,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer Incorrect_token', + Authorization: authHeader2, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/2', @@ -221,7 +222,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/4', @@ -290,7 +291,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/5', @@ -359,7 +360,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6', @@ -426,7 +427,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/7', @@ -493,7 +494,7 @@ const legacyTests = [ 'https://rudderstack.my.salesforce.com/services/data/v50.0/parameterizedSearch/?q=123&sobject=object_name&in=External_ID__c&object_name.fields=id,External_ID__c', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, body: { JSON: { @@ -567,7 +568,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101', @@ -637,7 +638,7 @@ const legacyTests = [ }, { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', Accept: 'application/json, text/plain, */*', }, @@ -660,7 +661,7 @@ const legacyTests = [ userId: '', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, version: '1', endpoint: 'https://rudder.my.salesforce.com/services/data/v50.0/sobjects/Lead/102', @@ -730,7 +731,7 @@ const legacyTests = [ }, { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', Accept: 'application/json, text/plain, */*', }, diff --git a/test/integrations/destinations/salesforce/dataDelivery/other.ts b/test/integrations/destinations/salesforce/dataDelivery/other.ts index 8bf154de9b5..2a01ad6253c 100644 --- a/test/integrations/destinations/salesforce/dataDelivery/other.ts +++ b/test/integrations/destinations/salesforce/dataDelivery/other.ts @@ -1,5 +1,6 @@ import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; +import { defaultAccessToken } from '../../../common/secrets'; const statTags = { errorCategory: 'network', @@ -19,7 +20,7 @@ const metadata = { workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; @@ -50,8 +51,13 @@ export const otherSalesforceScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 500, metadata, }, diff --git a/test/integrations/destinations/salesforce/maskedSecrets.ts b/test/integrations/destinations/salesforce/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/salesforce/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/salesforce/network.ts b/test/integrations/destinations/salesforce/network.ts index b4cff85d7ba..32b9cf157a1 100644 --- a/test/integrations/destinations/salesforce/network.ts +++ b/test/integrations/destinations/salesforce/network.ts @@ -1,5 +1,6 @@ +import { authHeader1, authHeader2, secret1 } from './maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer token', + Authorization: authHeader1, 'Content-Type': 'application/json', }; @@ -20,7 +21,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -37,7 +38,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -54,7 +55,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, method: 'POST', }, @@ -70,7 +71,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -87,7 +88,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -104,7 +105,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -121,7 +122,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, }, method: 'POST', }, @@ -140,7 +141,7 @@ const tfProxyMocksData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -180,7 +181,7 @@ const transformationMocksData = [ httpRes: { status: 200, data: { - access_token: 'dummy.access.token', + access_token: secret1, instance_url: 'https://ap15.salesforce.com', id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', token_type: 'Bearer', @@ -197,7 +198,7 @@ const transformationMocksData = [ httpRes: { status: 200, data: { - access_token: 'dummy.access.token', + access_token: secret1, instance_url: 'https://ap15.salesforce.com', id: 'https://login.salesforce.com/id/00D2v000002lXbXEAU/0052v00000ga9WqAAI', token_type: 'Bearer', @@ -374,7 +375,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer Incorrect_token', + Authorization: authHeader2, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -391,7 +392,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -408,7 +409,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -425,7 +426,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -442,7 +443,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', @@ -462,7 +463,7 @@ const businessMockData = [ params: { destination: 'salesforce' }, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer token', + Authorization: authHeader1, 'User-Agent': 'RudderLabs', }, method: 'POST', diff --git a/test/integrations/destinations/salesforce/processor/data.ts b/test/integrations/destinations/salesforce/processor/data.ts index b33b75b55bd..61d9a6f68db 100644 --- a/test/integrations/destinations/salesforce/processor/data.ts +++ b/test/integrations/destinations/salesforce/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, authHeader2, secret2 } from '../maskedSecrets'; export const data = [ { name: 'salesforce', @@ -97,7 +98,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -224,7 +225,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -352,7 +353,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -588,7 +589,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -717,7 +718,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -850,7 +851,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Contact/sf-contact-id?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -983,7 +984,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/sf-contact-id?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, userId: '', @@ -1110,7 +1111,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -1236,7 +1237,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -1351,7 +1352,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -1400,7 +1401,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret2, instance_url: 'http://dummyurl.com', }, }, @@ -1467,7 +1468,7 @@ export const data = [ statusCode: 200, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret2, instance_url: 'http://dummyurl.com', }, }, @@ -1479,7 +1480,7 @@ export const data = [ 'http://dummyurl.com/services/data/v50.0/sobjects/custom_object__c/a005g0000383kmUAAQ?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader2, }, params: {}, body: { diff --git a/test/integrations/destinations/salesforce/router/data.ts b/test/integrations/destinations/salesforce/router/data.ts index 9e26625188f..69da683573d 100644 --- a/test/integrations/destinations/salesforce/router/data.ts +++ b/test/integrations/destinations/salesforce/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const data = [ { name: 'salesforce', @@ -92,7 +93,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -238,7 +239,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead/leadId?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -383,7 +384,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -453,7 +454,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -515,7 +516,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/Lead', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -668,7 +669,7 @@ export const data = [ endpoint: 'https://ap15.salesforce.com/services/data/v50.0/sobjects/customobject', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -826,7 +827,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/customobject2/id1101?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { @@ -984,7 +985,7 @@ export const data = [ 'https://ap15.salesforce.com/services/data/v50.0/sobjects/customobject2/id1102?_HttpMethod=PATCH', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummy.access.token', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts b/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts index 55eaa9cca1e..7924571524b 100644 --- a/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts +++ b/test/integrations/destinations/salesforce_oauth/dataDelivery/oauth.ts @@ -1,14 +1,15 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; const commonHeadersForWrongToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const commonHeadersForRightToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const params = { destination: 'salesforce_oauth' }; @@ -57,7 +58,7 @@ export const proxyMetdataWithSecretWithWrongAccessToken: ProxyMetdata = { destinationId: 'dummyDestinationId', workspaceId: 'dummyWorkspaceId', secret: { - access_token: 'expiredAccessToken', + access_token: secret1, instanceUrl: 'https://rudderstack.my.salesforce_oauth.com', }, destInfo: { authKey: 'dummyDestinationId' }, @@ -117,8 +118,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed - due to "INVALID_SESSION_ID", (Retryable) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]', + error: JSON.stringify([ + { message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }, + ]), metadata: proxyMetdataWithSecretWithWrongAccessToken, statusCode: 500, }, @@ -161,7 +163,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: '{"statusText":"No Content"}', + error: JSON.stringify({ statusText: 'No Content' }), metadata: proxyMetdataWithSecretWithRightAccessToken, statusCode: 200, }, diff --git a/test/integrations/destinations/salesforce_oauth/maskedSecrets.ts b/test/integrations/destinations/salesforce_oauth/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/salesforce_oauth/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/salesforce_oauth/network.ts b/test/integrations/destinations/salesforce_oauth/network.ts index ae5f9d3fe49..951fac1bb3c 100644 --- a/test/integrations/destinations/salesforce_oauth/network.ts +++ b/test/integrations/destinations/salesforce_oauth/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; const headerWithWrongAccessToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const headerWithRightAccessToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts b/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts index 30ee516e724..f09548e7147 100644 --- a/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts +++ b/test/integrations/destinations/salesforce_oauth_sandbox/dataDelivery/oauth.ts @@ -1,14 +1,15 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { ProxyMetdata } from '../../../../../src/types'; import { ProxyV1TestData } from '../../../testTypes'; import { generateProxyV1Payload } from '../../../testUtils'; const commonHeadersForWrongToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const commonHeadersForRightToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const params = { destination: 'salesforce_oauth_sandbox' }; @@ -57,7 +58,7 @@ export const proxyMetdataWithSecretWithWrongAccessToken: ProxyMetdata = { destinationId: 'dummyDestinationId', workspaceId: 'dummyWorkspaceId', secret: { - access_token: 'expiredAccessToken', + access_token: secret1, instanceUrl: 'https://rudderstack.my.salesforce_oauth_sandbox.com', }, destInfo: { authKey: 'dummyDestinationId' }, @@ -117,8 +118,9 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ 'Salesforce Request Failed - due to "INVALID_SESSION_ID", (Retryable) during Salesforce Response Handling', response: [ { - error: - '[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]', + error: JSON.stringify([ + { message: 'Session expired or invalid', errorCode: 'INVALID_SESSION_ID' }, + ]), metadata: proxyMetdataWithSecretWithWrongAccessToken, statusCode: 500, }, @@ -161,7 +163,7 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ message: 'Request for destination: salesforce Processed Successfully', response: [ { - error: '{"statusText":"No Content"}', + error: JSON.stringify({ statusText: 'No Content' }), metadata: proxyMetdataWithSecretWithRightAccessToken, statusCode: 200, }, diff --git a/test/integrations/destinations/salesforce_oauth_sandbox/maskedSecrets.ts b/test/integrations/destinations/salesforce_oauth_sandbox/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/salesforce_oauth_sandbox/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/salesforce_oauth_sandbox/network.ts b/test/integrations/destinations/salesforce_oauth_sandbox/network.ts index 09d2c759d2e..d917d80b8c8 100644 --- a/test/integrations/destinations/salesforce_oauth_sandbox/network.ts +++ b/test/integrations/destinations/salesforce_oauth_sandbox/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; const headerWithWrongAccessToken = { - Authorization: 'Bearer expiredAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; const headerWithRightAccessToken = { - Authorization: 'Bearer correctAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }; diff --git a/test/integrations/destinations/segment/maskedSecrets.ts b/test/integrations/destinations/segment/maskedSecrets.ts new file mode 100644 index 00000000000..ba0b28ba8a1 --- /dev/null +++ b/test/integrations/destinations/segment/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':' + '')}`; diff --git a/test/integrations/destinations/segment/processor/data.ts b/test/integrations/destinations/segment/processor/data.ts index 9ba9601d6ef..051c493877c 100644 --- a/test/integrations/destinations/segment/processor/data.ts +++ b/test/integrations/destinations/segment/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'segment', @@ -22,7 +23,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -102,7 +103,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -164,7 +165,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -236,7 +237,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -291,7 +292,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -368,7 +369,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -428,7 +429,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -506,7 +507,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { @@ -568,7 +569,7 @@ export const data = [ }, }, Config: { - writeKey: 'abcdefghijklmnopqrstuvwxyz', + writeKey: secret1, }, Enabled: true, Transformations: [], @@ -639,7 +640,7 @@ export const data = [ endpoint: 'https://api.segment.io/v1/batch', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXo6', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/sendgrid/deleteUsers/data.ts b/test/integrations/destinations/sendgrid/deleteUsers/data.ts index 85c6e1275f1..c7846826dc0 100644 --- a/test/integrations/destinations/sendgrid/deleteUsers/data.ts +++ b/test/integrations/destinations/sendgrid/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1 } from '../maskedSecrets'; + export const data = [ { name: 'sendgrid', @@ -581,7 +583,7 @@ export const data = [ }, ], config: { - apiKey: '1234', + apiKey: secret1, }, }, ], @@ -1185,7 +1187,7 @@ export const data = [ }, ], config: { - apiKey: '1234', + apiKey: secret1, }, }, ], @@ -1254,7 +1256,7 @@ export const data = [ userId: 'eab57ccf-6322-498e-9338-7761c6dc0656', }, config: { - apiKey: '1234', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/sendgrid/maskedSecrets.ts b/test/integrations/destinations/sendgrid/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/sendgrid/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/sendgrid/network.ts b/test/integrations/destinations/sendgrid/network.ts index 29cfbf84463..93c3a3a5244 100644 --- a/test/integrations/destinations/sendgrid/network.ts +++ b/test/integrations/destinations/sendgrid/network.ts @@ -1,10 +1,11 @@ +import { authHeader1 } from './maskedSecrets'; const deleteNwData = [ { httpReq: { method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -22,7 +23,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -39,7 +40,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=[user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2]', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -57,7 +58,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=[user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2]', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -75,7 +76,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -93,7 +94,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.sendgrid.com/v3/marketing/contacts?ids=user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2,test_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_idtest_user_id,user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2user_sdk2', headers: { - Authorization: 'Bearer 1234', + Authorization: authHeader1, }, }, httpRes: { @@ -111,7 +112,7 @@ const deleteNwData = [ method: 'get', url: 'https://api.sendgrid.com/v3/marketing/field_definitions', headers: { - Authorization: 'Bearer apikey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, diff --git a/test/integrations/destinations/sendgrid/processor/data.ts b/test/integrations/destinations/sendgrid/processor/data.ts index 4c5ca7f48f6..f1e208d15b6 100644 --- a/test/integrations/destinations/sendgrid/processor/data.ts +++ b/test/integrations/destinations/sendgrid/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'sendgrid', @@ -12,7 +13,7 @@ export const data = [ destination: { Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -114,7 +115,7 @@ export const data = [ destination: { Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -196,7 +197,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -237,7 +238,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -344,7 +345,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', @@ -367,7 +368,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -466,7 +467,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -521,7 +522,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -622,7 +623,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -677,7 +678,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -790,7 +791,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -849,7 +850,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -982,7 +983,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -1101,7 +1102,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1166,7 +1167,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -1288,7 +1289,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1353,7 +1354,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [ { event: 'testing', @@ -1479,7 +1480,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/mail/send', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1555,7 +1556,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -1663,7 +1664,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', diff --git a/test/integrations/destinations/sendgrid/router/data.ts b/test/integrations/destinations/sendgrid/router/data.ts index e9ef6712267..9db23e885bb 100644 --- a/test/integrations/destinations/sendgrid/router/data.ts +++ b/test/integrations/destinations/sendgrid/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'sendgrid', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }], subject: 'A sample subject', replyToEmail: 'ankit@rudderstack.com', @@ -101,7 +102,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { Authorization: 'Bearer apikey', 'Content-Type': 'application/json' }, + headers: { Authorization: authHeader1, 'Content-Type': 'application/json' }, version: '1', endpoint: 'https://api.sendgrid.com/v3/mail/send', }, @@ -110,7 +111,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'apikey', + apiKey: secret1, eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }], subject: 'A sample subject', replyToEmail: 'ankit@rudderstack.com', @@ -152,7 +153,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -226,7 +227,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -300,7 +301,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -375,7 +376,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -451,7 +452,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -518,7 +519,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -610,7 +611,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -640,7 +641,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -692,7 +693,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -721,7 +722,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -773,7 +774,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -805,7 +806,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -857,7 +858,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -890,7 +891,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -942,7 +943,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -971,7 +972,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', @@ -1023,7 +1024,7 @@ export const data = [ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer apikey', + Authorization: authHeader1, }, params: {}, body: { @@ -1058,7 +1059,7 @@ export const data = [ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU', Config: { IPPoolName: '', - apiKey: 'apikey', + apiKey: secret1, attachments: [ { content: '', diff --git a/test/integrations/destinations/sfmc/maskedSecrets.ts b/test/integrations/destinations/sfmc/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/sfmc/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/sfmc/network.ts b/test/integrations/destinations/sfmc/network.ts index 93854e36910..84b312206b3 100644 --- a/test/integrations/destinations/sfmc/network.ts +++ b/test/integrations/destinations/sfmc/network.ts @@ -1,3 +1,4 @@ +import { secret1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { @@ -7,7 +8,7 @@ export const networkCallsData = [ httpRes: { status: 200, data: { - access_token: 'yourAuthToken', + access_token: secret1, }, }, }, diff --git a/test/integrations/destinations/sfmc/processor/data.ts b/test/integrations/destinations/sfmc/processor/data.ts index e8d9375e43c..c0f647c8ace 100644 --- a/test/integrations/destinations/sfmc/processor/data.ts +++ b/test/integrations/destinations/sfmc/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const data = [ { name: 'sfmc', @@ -210,7 +211,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -236,7 +237,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -710,7 +711,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -736,7 +737,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -902,7 +903,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:C500FD37-155C-49BD-A21B-AFCEF3D1A9CB/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -1106,7 +1107,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1549,7 +1550,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1719,7 +1720,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1881,7 +1882,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, version: '1', endpoint: @@ -1986,8 +1987,15 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Could not retrieve access token","destinationResponse":{"error":"invalid_client","error_description":"Invalid client ID. Use the client ID in Marketing Cloud Installed Packages.","error_uri":"https://developer.salesforce.com/docs"}}', + error: JSON.stringify({ + message: 'Could not retrieve access token', + destinationResponse: { + error: 'invalid_client', + error_description: + 'Invalid client ID. Use the client ID in Marketing Cloud Installed Packages.', + error_uri: 'https://developer.salesforce.com/docs', + }, + }), statTags: { destType: 'SFMC', errorCategory: 'network', @@ -2058,8 +2066,15 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Could not retrieve access token","destinationResponse":{"message":"Your requests are temporarily blocked.","errorcode":50200,"documentation":"https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm"}}', + error: JSON.stringify({ + message: 'Could not retrieve access token', + destinationResponse: { + message: 'Your requests are temporarily blocked.', + errorcode: 50200, + documentation: + 'https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm', + }, + }), statTags: { destType: 'SFMC', errorCategory: 'network', @@ -2130,7 +2145,10 @@ export const data = [ status: 200, body: [ { - error: '{"message":"Could not retrieve access token","destinationResponse":{}}', + error: JSON.stringify({ + message: 'Could not retrieve access token', + destinationResponse: {}, + }), statTags: { destType: 'SFMC', errorCategory: 'network', @@ -2303,7 +2321,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:externalKey/rows/key1:someRandomEmail@test.com', files: {}, headers: { - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PUT', diff --git a/test/integrations/destinations/sfmc/router/data.ts b/test/integrations/destinations/sfmc/router/data.ts index 7707e709f43..ac2fd1e6990 100644 --- a/test/integrations/destinations/sfmc/router/data.ts +++ b/test/integrations/destinations/sfmc/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1 } from '../maskedSecrets'; export const data = [ { name: 'sfmc', @@ -237,7 +238,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { @@ -259,7 +260,7 @@ export const data = [ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer yourAuthToken', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/slack/processor/data.ts b/test/integrations/destinations/slack/processor/data.ts index 1fcbb2ca03f..db72671a5e5 100644 --- a/test/integrations/destinations/slack/processor/data.ts +++ b/test/integrations/destinations/slack/processor/data.ts @@ -146,8 +146,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"Identified my-namehiji: hulala favorite color: black ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'Identified my-namehiji: hulala favorite color: black ', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -474,8 +477,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"identified my-name-1 with hiji: hulala-1 ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'identified my-name-1 with hiji: hulala-1 ', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -655,8 +661,9 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"my-name performed test_isent1 with test_val1 test_val2 and traits hulala"}', + payload: JSON.stringify({ + text: 'my-name performed test_isent1 with test_val1 test_val2 and traits hulala', + }), }, }, files: {}, @@ -839,8 +846,9 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"my-name performed test_eventing_testis with test_val1 test_val2"}', + payload: JSON.stringify({ + text: 'my-name performed test_eventing_testis with test_val1 test_val2', + }), }, }, files: {}, @@ -1023,7 +1031,7 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: '{"text":"my-name did test_eventing_test"}', + payload: JSON.stringify({ text: 'my-name did test_eventing_test' }), }, }, files: {}, @@ -1204,8 +1212,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"my-name performed test_isent1 with test_val1 test_val2 and traits hulala","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'my-name performed test_isent1 with test_val1 test_val2 and traits hulala', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -1387,8 +1398,12 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"channel":"example-of-legacy","text":"my-name performed test_eventing_testis with test_val1 test_val2","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + channel: 'example-of-legacy', + text: 'my-name performed test_eventing_testis with test_val1 test_val2', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -1995,8 +2010,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"User 12345 did black_event","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'User 12345 did black_event', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, @@ -2150,8 +2168,11 @@ export const data = [ JSON_ARRAY: {}, XML: {}, FORM: { - payload: - '{"text":"Identified User 12345","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'Identified User 12345', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, }, files: {}, diff --git a/test/integrations/destinations/slack/router/data.ts b/test/integrations/destinations/slack/router/data.ts index 349b1a486f0..0eb0a723243 100644 --- a/test/integrations/destinations/slack/router/data.ts +++ b/test/integrations/destinations/slack/router/data.ts @@ -280,8 +280,11 @@ export const data = [ { body: { FORM: { - payload: - '{"text":"identified my-name-1 with hiji: hulala-1 ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}', + payload: JSON.stringify({ + text: 'identified my-name-1 with hiji: hulala-1 ', + username: 'RudderStack', + icon_url: 'https://cdn.rudderlabs.com/rudderstack.png', + }), }, JSON: {}, JSON_ARRAY: {}, diff --git a/test/integrations/destinations/snapchat_conversion/maskedSecrets.ts b/test/integrations/destinations/snapchat_conversion/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/snapchat_conversion/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/snapchat_conversion/processor/data.ts b/test/integrations/destinations/snapchat_conversion/processor/data.ts index b7fde67c4e7..b7cd6f2d5c6 100644 --- a/test/integrations/destinations/snapchat_conversion/processor/data.ts +++ b/test/integrations/destinations/snapchat_conversion/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'snapchat_conversion', @@ -72,7 +73,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', }, }, @@ -103,7 +104,7 @@ export const data = [ userId: '', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -217,7 +218,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -246,7 +247,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -365,7 +366,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -479,7 +480,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -592,7 +593,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -705,7 +706,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', }, }, @@ -735,7 +736,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -841,7 +842,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', }, }, @@ -955,7 +956,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', }, @@ -1072,7 +1073,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1104,7 +1105,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1225,7 +1226,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1257,7 +1258,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1377,7 +1378,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1409,7 +1410,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1528,7 +1529,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1560,7 +1561,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1671,7 +1672,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1703,7 +1704,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1817,7 +1818,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1849,7 +1850,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1962,7 +1963,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -1994,7 +1995,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2103,7 +2104,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2135,7 +2136,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2243,7 +2244,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2275,7 +2276,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2385,7 +2386,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2417,7 +2418,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2527,7 +2528,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2559,7 +2560,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2669,7 +2670,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2701,7 +2702,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2812,7 +2813,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2844,7 +2845,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -2956,7 +2957,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -2988,7 +2989,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3097,7 +3098,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, metadata: { @@ -3126,7 +3127,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3236,7 +3237,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -3268,7 +3269,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3378,7 +3379,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'ProdSearched', @@ -3414,7 +3415,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3520,7 +3521,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [], }, }, @@ -3629,7 +3630,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'Product_Added_To_Cart', @@ -3664,7 +3665,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3765,7 +3766,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'Product Added To Cart', @@ -3801,7 +3802,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -3919,7 +3920,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', deduplicationKey: 'properties.custom_dedup_id', enableDeduplication: true, @@ -3953,7 +3954,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4074,7 +4075,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4106,7 +4107,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4224,7 +4225,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4256,7 +4257,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4376,7 +4377,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4408,7 +4409,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4531,7 +4532,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, pixelId: 'dummyPixelId', appId: 'dhfeih44f', snapAppId: 'hfhdhfd', @@ -4563,7 +4564,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4667,7 +4668,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [ { from: 'Custom Event', @@ -4703,7 +4704,7 @@ export const data = [ method: 'POST', endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -4807,7 +4808,7 @@ export const data = [ }, Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, rudderEventsToSnapEvents: [], }, }, diff --git a/test/integrations/destinations/snapchat_conversion/router/data.ts b/test/integrations/destinations/snapchat_conversion/router/data.ts index 685ed2e5b4e..5e1adc0f27c 100644 --- a/test/integrations/destinations/snapchat_conversion/router/data.ts +++ b/test/integrations/destinations/snapchat_conversion/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { FEATURES, IMPLEMENTATIONS, MODULES } from '../../../../../src/v0/util/tags'; export const data = [ @@ -74,7 +75,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -141,7 +142,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -208,7 +209,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -230,14 +231,65 @@ export const data = [ endpoint: 'https://tr.snapchat.com/v2/conversion', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { JSON: {}, JSON_ARRAY: { - batch: - '[{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"},{"search_string":"t-shirts","event_type":"SEARCH","user_agent":"mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36","hashed_email":"73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2","hashed_phone_number":"bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492","hashed_idfv":"54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f","hashed_mobile_ad_id":"f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2","timestamp":"1650625078","event_conversion_type":"OFFLINE","pixel_id":"dummyPixelId"}]', + batch: JSON.stringify([ + { + search_string: 't-shirts', + event_type: 'SEARCH', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + hashed_email: + '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_idfv: + '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + { + search_string: 't-shirts', + event_type: 'SEARCH', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + hashed_email: + '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_idfv: + '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + { + search_string: 't-shirts', + event_type: 'SEARCH', + user_agent: + 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36', + hashed_email: + '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2', + hashed_phone_number: + 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492', + hashed_idfv: + '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f', + hashed_mobile_ad_id: + 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2', + timestamp: '1650625078', + event_conversion_type: 'OFFLINE', + pixel_id: 'dummyPixelId', + }, + ]), }, XML: {}, FORM: {}, @@ -263,7 +315,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, }, }, }, @@ -392,7 +444,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, appId: 'jahsdfjk-5487-asdfa-9957-7c74eb8d3e80', snapAppId: '', enableDeduplication: false, @@ -436,7 +488,7 @@ export const data = [ destination: { Config: { pixelId: 'dummyPixelId', - apiKey: 'dummyApiKey', + apiKey: secret1, appId: 'jahsdfjk-5487-asdfa-9957-7c74eb8d3e80', snapAppId: '', enableDeduplication: false, diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts index 4ee646bedbf..5bdfd09bada 100644 --- a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/business.ts @@ -4,9 +4,10 @@ import { generateProxyV0Payload, generateProxyV1Payload, } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts index e4bf5d45882..9a2de350410 100644 --- a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/oauth.ts @@ -4,9 +4,10 @@ import { generateProxyV0Payload, generateProxyV1Payload, } from '../../../testUtils'; +import { authHeader1 } from '../maskedSecrets'; const commonHeaders = { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }; @@ -23,19 +24,6 @@ const commonRequestParameters = { }, }; -const commonDeleteRequestParameters = { - headers: commonHeaders, - JSON: { - users: [ - { - id: '123456', - schema: ['EMAIL_SHA256'], - data: [['938758751f5af66652a118e26503af824404bc13acd1cb7642ddff99916f0e1c']], - }, - ], - }, -}; - const retryStatTags = { destType: 'SNAPCHAT_CUSTOM_AUDIENCE', errorCategory: 'network', diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts index 90508c2481c..b9fe80c0470 100644 --- a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts +++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/other.ts @@ -38,8 +38,13 @@ export const otherScenariosV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/snapchat_custom_audience/maskedSecrets.ts b/test/integrations/destinations/snapchat_custom_audience/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/snapchat_custom_audience/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/snapchat_custom_audience/network.ts b/test/integrations/destinations/snapchat_custom_audience/network.ts index 39bd46122dd..09659d4c2b2 100644 --- a/test/integrations/destinations/snapchat_custom_audience/network.ts +++ b/test/integrations/destinations/snapchat_custom_audience/network.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -12,7 +14,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -41,7 +43,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -63,7 +65,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, @@ -94,7 +96,7 @@ export const networkCallsData = [ }, params: { destination: 'snapchat_custom_audience' }, headers: { - Authorization: 'Bearer abcd123', + Authorization: authHeader1, 'Content-Type': 'application/json', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts index 546f056fa43..188cf16b268 100644 --- a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts +++ b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'snapchat_custom_audience', @@ -11,7 +12,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -66,7 +67,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -88,7 +89,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -111,7 +112,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -166,7 +167,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -189,7 +190,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -212,7 +213,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -277,7 +278,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -299,7 +300,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -313,7 +314,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -336,7 +337,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -359,7 +360,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -422,7 +423,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -447,7 +448,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -470,7 +471,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -533,7 +534,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -559,7 +560,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -582,7 +583,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -633,7 +634,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -665,7 +666,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -715,7 +716,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -747,7 +748,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -783,7 +784,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -815,7 +816,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -854,7 +855,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -886,7 +887,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -928,7 +929,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -961,7 +962,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1019,7 +1020,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1051,7 +1052,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1113,7 +1114,7 @@ export const data = [ method: 'DELETE', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1136,7 +1137,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1159,7 +1160,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1214,7 +1215,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1236,7 +1237,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1259,7 +1260,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -1315,7 +1316,7 @@ export const data = [ method: 'POST', endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, 'Content-Type': 'application/json', }, params: {}, @@ -1337,7 +1338,7 @@ export const data = [ }, metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, diff --git a/test/integrations/destinations/snapchat_custom_audience/router/data.ts b/test/integrations/destinations/snapchat_custom_audience/router/data.ts index 44fdb4b47b2..b4c9a823655 100644 --- a/test/integrations/destinations/snapchat_custom_audience/router/data.ts +++ b/test/integrations/destinations/snapchat_custom_audience/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'snapchat_custom_audience', @@ -12,7 +13,7 @@ export const data = [ { metadata: { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, refresh_token: 'dummyRefreshToken', developer_token: 'dummyDeveloperToken', }, @@ -62,7 +63,7 @@ export const data = [ endpoint: 'https://adsapi.snapchat.com/v1/segments/123/users', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyAccessToken', + Authorization: authHeader1, }, params: {}, body: { @@ -86,7 +87,7 @@ export const data = [ metadata: [ { secret: { - access_token: 'dummyAccessToken', + access_token: secret1, developer_token: 'dummyDeveloperToken', refresh_token: 'dummyRefreshToken', }, diff --git a/test/integrations/destinations/splitio/maskedSecrets.ts b/test/integrations/destinations/splitio/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/splitio/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/splitio/processor/data.ts b/test/integrations/destinations/splitio/processor/data.ts index d4c3e39794e..2656ff23d0f 100644 --- a/test/integrations/destinations/splitio/processor/data.ts +++ b/test/integrations/destinations/splitio/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'splitio', @@ -41,7 +42,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'anonymous', }, @@ -62,7 +63,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -142,7 +143,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -163,7 +164,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -244,7 +245,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'anonymous', }, @@ -265,7 +266,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -334,7 +335,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'user', }, @@ -355,7 +356,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -418,7 +419,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -439,7 +440,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -506,7 +507,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -527,7 +528,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -590,7 +591,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -652,7 +653,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'user', }, @@ -713,7 +714,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'user', }, @@ -775,7 +776,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'production', trafficType: 'user', }, @@ -796,7 +797,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { @@ -859,7 +860,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'abcde', + apiKey: secret1, environment: 'staging', trafficType: 'anonymous', }, @@ -880,7 +881,7 @@ export const data = [ endpoint: 'https://events.split.io/api/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer abcde', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/splitio/router/data.ts b/test/integrations/destinations/splitio/router/data.ts index 47f8ad5cff1..43ec89f2467 100644 --- a/test/integrations/destinations/splitio/router/data.ts +++ b/test/integrations/destinations/splitio/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'splitio', @@ -36,7 +37,7 @@ export const data = [ }, metadata: { jobId: 1, userId: 'u1' }, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], @@ -56,7 +57,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://events.split.io/api/events', - headers: { 'Content-Type': 'application/json', Authorization: 'Bearer abcde' }, + headers: { 'Content-Type': 'application/json', Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -77,7 +78,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], @@ -119,7 +120,7 @@ export const data = [ }, metadata: { jobId: 2, userId: 'u1' }, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], @@ -139,7 +140,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://events.split.io/api/events', - headers: { 'Content-Type': 'application/json', Authorization: 'Bearer abcde' }, + headers: { 'Content-Type': 'application/json', Authorization: authHeader1 }, params: {}, body: { JSON: { @@ -160,7 +161,7 @@ export const data = [ batched: false, statusCode: 200, destination: { - Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' }, + Config: { apiKey: secret1, environment: 'staging', trafficType: 'user' }, }, }, ], diff --git a/test/integrations/destinations/stormly/maskedSecrets.ts b/test/integrations/destinations/stormly/maskedSecrets.ts new file mode 100644 index 00000000000..c5a4dc839e8 --- /dev/null +++ b/test/integrations/destinations/stormly/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${secret1}`; diff --git a/test/integrations/destinations/stormly/processor/data.ts b/test/integrations/destinations/stormly/processor/data.ts index 52356ba9e09..2c5b4ee3804 100644 --- a/test/integrations/destinations/stormly/processor/data.ts +++ b/test/integrations/destinations/stormly/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'stormly', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -64,7 +65,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -100,7 +101,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -138,7 +139,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -193,7 +194,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -228,7 +229,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -268,7 +269,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -297,7 +298,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -331,7 +332,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -367,7 +368,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -410,7 +411,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -453,7 +454,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -496,7 +497,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, }, ID: 'stormly123', }, @@ -533,7 +534,7 @@ export const data = [ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/group', headers: { 'Content-Type': 'application/json', - Authorization: 'Basic dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/stormly/router/data.ts b/test/integrations/destinations/stormly/router/data.ts index 1973173795d..fb12d71db8a 100644 --- a/test/integrations/destinations/stormly/router/data.ts +++ b/test/integrations/destinations/stormly/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'stormly', @@ -10,7 +11,7 @@ export const data = [ body: { input: [ { - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, metadata: { jobId: 1, userId: 'u1' }, message: { type: 'identify', @@ -24,7 +25,7 @@ export const data = [ }, }, { - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, metadata: { jobId: 2, userId: 'u1' }, message: { type: 'track', @@ -68,18 +69,18 @@ export const data = [ }, endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify', files: {}, - headers: { Authorization: 'Basic dummyApiKey', 'Content-Type': 'application/json' }, + headers: { Authorization: authHeader1, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', version: '1', }, - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, metadata: [{ jobId: 1, userId: 'u1' }], statusCode: 200, }, { - destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' }, + destination: { Config: { apiKey: secret1 }, ID: 'stormly123' }, batched: false, error: 'Missing required value from "userIdOnly"', metadata: [{ jobId: 2, userId: 'u1' }], diff --git a/test/integrations/destinations/the_trade_desk/delivery/business.ts b/test/integrations/destinations/the_trade_desk/delivery/business.ts index 0406a5f0bc7..26336b60b4f 100644 --- a/test/integrations/destinations/the_trade_desk/delivery/business.ts +++ b/test/integrations/destinations/the_trade_desk/delivery/business.ts @@ -159,8 +159,9 @@ export const businessProxyV1: ProxyV1TestData[] = [ 'Request failed with status: 200 due to {"FailedLines":[{"ErrorCode":"MissingUserId","Message":"Invalid UID2, item #2"}]}', response: [ { - error: - '{"FailedLines":[{"ErrorCode":"MissingUserId","Message":"Invalid UID2, item #2"}]}', + error: JSON.stringify({ + FailedLines: [{ ErrorCode: 'MissingUserId', Message: 'Invalid UID2, item #2' }], + }), metadata: generateMetadata(1), statusCode: 400, }, diff --git a/test/integrations/destinations/the_trade_desk/delivery/other.ts b/test/integrations/destinations/the_trade_desk/delivery/other.ts index bed10e6ec58..51f8dd51a5f 100644 --- a/test/integrations/destinations/the_trade_desk/delivery/other.ts +++ b/test/integrations/destinations/the_trade_desk/delivery/other.ts @@ -107,8 +107,13 @@ export const otherProxyV1: ProxyV1TestData[] = [ output: { response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1), }, diff --git a/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts b/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts index 895188fa3f6..865764cef3f 100644 --- a/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts +++ b/test/integrations/destinations/tiktok_ads/dataDelivery/business.ts @@ -101,7 +101,7 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ message: '[TIKTOK_ADS Response Handler] - Request Processed Successfully', response: [ { - error: '{"code":0,"message":"OK"}', + error: JSON.stringify({ code: 0, message: 'OK' }), statusCode: 200, metadata: generateMetadata(1234), }, @@ -168,8 +168,10 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { statusCode: 400, - error: - '{"code":40002,"message":"Batch.0.properties.contents.0.content_id: Not a valid string"}', + error: JSON.stringify({ + code: 40002, + message: 'Batch.0.properties.contents.0.content_id: Not a valid string', + }), metadata: generateMetadata(1234), }, ], @@ -235,8 +237,11 @@ export const V1BusinessTestScenarion: ProxyV1TestData[] = [ response: [ { statusCode: 400, - error: - '{"code":40001,"message":"No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account."}', + error: JSON.stringify({ + code: 40001, + message: + 'No permission to operate pixel code: BU35TSQHT2A1QT375OMG. You must be an admin or operator of this advertiser account.', + }), metadata: generateMetadata(1234), }, ], diff --git a/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts b/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts index 0675ebcd051..48c59c3ff90 100644 --- a/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts +++ b/test/integrations/destinations/tiktok_ads/dataDelivery/other.ts @@ -57,7 +57,10 @@ export const v1OtherScenarios: ProxyV1TestData[] = [ message: 'Request failed with status: 40100', response: [ { - error: '{"code":40100,"message":"Too many requests. Please retry in some time."}', + error: JSON.stringify({ + code: 40100, + message: 'Too many requests. Please retry in some time.', + }), statusCode: 429, metadata: generateMetadata(1234), }, @@ -157,8 +160,13 @@ export const v1OtherScenarios: ProxyV1TestData[] = [ message: 'Request failed with status: 503', response: [ { - error: - '{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', + error: JSON.stringify({ + error: { + message: 'Service Unavailable', + description: + 'The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later.', + }, + }), statusCode: 503, metadata: generateMetadata(1234), }, diff --git a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts index 81e125eacab..0f0559e7dd8 100644 --- a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts +++ b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts @@ -543,8 +543,18 @@ export const data = [ properties: { phone: 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05', value: 32.839999999999996, - emails: - '["efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900","078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f","","","","","","","",""]', + emails: JSON.stringify([ + 'efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900', + '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f', + '', + '', + '', + '', + '', + '', + '', + '', + ]), eventId: '8965fb56-090f-47a5-aa7f-bbab22d9ec90', currency: 'USD', order_id: 60241286212, @@ -667,8 +677,18 @@ export const data = [ properties: { phone: 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05', value: 32.839999999999996, - emails: - '["efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900","078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f","","","","","","","",""]', + emails: JSON.stringify([ + 'efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900', + '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f', + '', + '', + '', + '', + '', + '', + '', + '', + ]), eventId: '8965fb56-090f-47a5-aa7f-bbab22d9ec90', currency: 'USD', order_id: 60241286212, @@ -787,8 +807,18 @@ export const data = [ properties: { phone: 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05', value: 32.839999999999996, - emails: - '["efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900","078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f","","","","","","","",""]', + emails: JSON.stringify([ + 'efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900', + '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f', + '', + '', + '', + '', + '', + '', + '', + '', + ]), eventId: '8965fb56-090f-47a5-aa7f-bbab22d9ec90', currency: 'USD', order_id: 60241286212, diff --git a/test/integrations/destinations/topsort/maskedSecrets.ts b/test/integrations/destinations/topsort/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/topsort/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/topsort/processor/trackClicksTestData.ts b/test/integrations/destinations/topsort/processor/trackClicksTestData.ts index 7e187cc0d4c..418f40bb919 100644 --- a/test/integrations/destinations/topsort/processor/trackClicksTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackClicksTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -19,7 +20,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -110,7 +111,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -230,7 +231,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -493,7 +494,7 @@ export const trackClicksTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', diff --git a/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts b/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts index 385a068d70b..c71bc855380 100644 --- a/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackImpressionsTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -19,7 +20,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -106,7 +107,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -226,7 +227,7 @@ export const trackImpressionsTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', diff --git a/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts b/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts index b1ab98b8f12..db2fc6dcc69 100644 --- a/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts +++ b/test/integrations/destinations/topsort/processor/trackPurchasesTestData.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { @@ -19,7 +20,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -106,7 +107,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -226,7 +227,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -370,7 +371,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', @@ -414,7 +415,7 @@ export const trackPurchasesTestData: ProcessorTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, userId: '', diff --git a/test/integrations/destinations/topsort/router/data.ts b/test/integrations/destinations/topsort/router/data.ts index d226f8610c4..7314df2c68d 100644 --- a/test/integrations/destinations/topsort/router/data.ts +++ b/test/integrations/destinations/topsort/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; import { Destination } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; @@ -14,7 +15,7 @@ const destination: Destination = { }, }, Config: { - apiKey: 'test-api', + apiKey: secret1, connectionMode: { web: 'cloud', }, @@ -113,7 +114,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, body: { @@ -245,7 +246,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, body: { @@ -371,7 +372,7 @@ export const data: RouterTestData[] = [ endpoint: 'https://api.topsort.com/v2/events', headers: { 'content-type': 'application/json', - Authorization: 'Bearer test-api', + Authorization: authHeader1, }, params: {}, body: { diff --git a/test/integrations/destinations/trengo/maskedSecrets.ts b/test/integrations/destinations/trengo/maskedSecrets.ts new file mode 100644 index 00000000000..61db9ef38a9 --- /dev/null +++ b/test/integrations/destinations/trengo/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const authHeader1 = `Bearer ${secret1}`; +export const authHeader2 = `Bearer ${secret2}`; diff --git a/test/integrations/destinations/trengo/network.ts b/test/integrations/destinations/trengo/network.ts index 62b50165580..caf798abe8b 100644 --- a/test/integrations/destinations/trengo/network.ts +++ b/test/integrations/destinations/trengo/network.ts @@ -1,8 +1,9 @@ +import { authHeader1, authHeader2 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -80,7 +81,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -110,7 +111,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -140,7 +141,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -152,7 +153,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -182,7 +183,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -194,7 +195,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -319,7 +320,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -453,7 +454,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -587,7 +588,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -712,7 +713,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -846,7 +847,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -980,7 +981,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -1114,7 +1115,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -1248,7 +1249,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, method: 'GET', @@ -1326,7 +1327,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Bearer wrong_trengo_integration_test_api_token', + Authorization: authHeader2, }, method: 'GET', diff --git a/test/integrations/destinations/trengo/processor/data.ts b/test/integrations/destinations/trengo/processor/data.ts index 6772a1b940c..0efa45ab551 100644 --- a/test/integrations/destinations/trengo/processor/data.ts +++ b/test/integrations/destinations/trengo/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'trengo', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: true, @@ -71,7 +72,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -105,7 +106,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'phone', enableDedup: true, @@ -186,7 +187,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -246,7 +247,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -280,7 +281,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -361,7 +362,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -441,7 +442,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: false, @@ -501,7 +502,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -535,7 +536,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: false, @@ -600,7 +601,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -634,7 +635,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: false, @@ -695,7 +696,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -729,7 +730,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: false, @@ -811,7 +812,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -878,7 +879,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -912,7 +913,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -979,7 +980,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1009,7 +1010,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1076,7 +1077,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1106,7 +1107,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1173,7 +1174,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1207,7 +1208,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1293,7 +1294,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -1353,7 +1354,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { JSON: { name: 'Thalmor Bretz 2' }, XML: {}, JSON_ARRAY: {}, FORM: {} }, @@ -1378,7 +1379,7 @@ export const data = [ { destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1443,7 +1444,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -1474,7 +1475,7 @@ export const data = [ { destination: { Config: { - apiToken: 'wrong_trengo_integration_test_api_token', + apiToken: secret2, channelId: 'trengo_phone_channel', channelIdentifier: 'email', enableDedup: false, @@ -1528,8 +1529,13 @@ export const data = [ body: [ { // though we are getting undefined as statusText through mocked response but we are getting that from actual response - error: - '{"message":"Inside lookupContact, failed to make request: undefined","destinationResponse":{"response":{"message":"Unauthenticated.","errors":[]},"status":401}}', + error: JSON.stringify({ + message: 'Inside lookupContact, failed to make request: undefined', + destinationResponse: { + response: { message: 'Unauthenticated.', errors: [] }, + status: 401, + }, + }), statTags: { destType: 'TRENGO', errorCategory: 'network', diff --git a/test/integrations/destinations/trengo/router/data.ts b/test/integrations/destinations/trengo/router/data.ts index f7b50220363..6e1f956e488 100644 --- a/test/integrations/destinations/trengo/router/data.ts +++ b/test/integrations/destinations/trengo/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'trengo', @@ -48,7 +49,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -125,7 +126,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -141,7 +142,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_phone_channel', channelIdentifier: 'phone', enableDedup: true, @@ -245,7 +246,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: true, @@ -322,7 +323,7 @@ export const data = [ headers: { 'Content-Type': 'application/json', Accept: 'application/json', - Authorization: 'Bearer trengo_integration_test_api_token', + Authorization: authHeader1, }, params: {}, body: { @@ -342,7 +343,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'trengo_integration_test_api_token', + apiToken: secret1, channelId: 'trengo_email_channel', channelIdentifier: 'email', enableDedup: true, diff --git a/test/integrations/destinations/user/maskedSecrets.ts b/test/integrations/destinations/user/maskedSecrets.ts new file mode 100644 index 00000000000..35f0f387449 --- /dev/null +++ b/test/integrations/destinations/user/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Token ${secret1}`; diff --git a/test/integrations/destinations/user/network.ts b/test/integrations/destinations/user/network.ts index dff2e0726d8..d0a89b22821 100644 --- a/test/integrations/destinations/user/network.ts +++ b/test/integrations/destinations/user/network.ts @@ -1,8 +1,9 @@ +import { authHeader1 } from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -44,7 +45,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -92,7 +93,7 @@ export const networkCallsData = [ user_custom_id: 'user@123', }, headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -130,7 +131,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -167,7 +168,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -204,7 +205,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -241,7 +242,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -277,7 +278,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -313,7 +314,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -355,7 +356,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, @@ -403,7 +404,7 @@ export const networkCallsData = [ user_custom_id: 'user@123', }, headers: { - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, diff --git a/test/integrations/destinations/user/processor/data.ts b/test/integrations/destinations/user/processor/data.ts index ef8ddebfd58..a6a195d8934 100644 --- a/test/integrations/destinations/user/processor/data.ts +++ b/test/integrations/destinations/user/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'user', @@ -22,7 +23,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userEvents: [{ rsEventName: 'login', userEventName: 'product viewed' }], companyAttributesMapping: [ @@ -87,7 +88,7 @@ export const data = [ traits: { googleUrl: 'www.google.com' }, }, destination: { - Config: { apiKey: 'dummyApiKey', appSubdomain: 'commander' }, + Config: { apiKey: secret1, appSubdomain: 'commander' }, }, }, ], @@ -133,7 +134,7 @@ export const data = [ timestamp: '2020-02-02T00:23:09.544Z', }, destination: { - Config: { apiKey: 'dummyApiKey', appSubdomain: 'commander' }, + Config: { apiKey: secret1, appSubdomain: 'commander' }, }, }, ], @@ -198,7 +199,7 @@ export const data = [ userId: 'user@123', }, destination: { - Config: { apiKey: 'dummyApiKey', appSubdomain: 'commander' }, + Config: { apiKey: secret1, appSubdomain: 'commander' }, }, }, ], @@ -258,7 +259,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, @@ -297,7 +298,7 @@ export const data = [ files: {}, headers: { Accept: '*/*;version=2', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'PUT', @@ -344,7 +345,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, @@ -385,7 +386,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/users/59/', @@ -441,7 +442,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -482,7 +483,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/events/', @@ -551,7 +552,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -592,7 +593,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/site-views/', @@ -643,7 +644,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -683,7 +684,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/companies/21/add_member/', diff --git a/test/integrations/destinations/user/router/data.ts b/test/integrations/destinations/user/router/data.ts index acdb5c953e4..9ad050db38b 100644 --- a/test/integrations/destinations/user/router/data.ts +++ b/test/integrations/destinations/user/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'user', @@ -40,7 +41,7 @@ export const data = [ metadata: { jobId: 1, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -83,7 +84,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/companies/21/add_member/', @@ -93,7 +94,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -149,7 +150,7 @@ export const data = [ metadata: { jobId: 2, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ @@ -204,7 +205,7 @@ export const data = [ headers: { Accept: '*/*;version=2', 'Content-Type': 'application/json', - Authorization: 'Token dummyApiKey', + Authorization: authHeader1, }, version: '1', endpoint: 'https://commander.user.com/api/public/users/59/', @@ -214,7 +215,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, appSubdomain: 'commander', userAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], userEvents: [ diff --git a/test/integrations/destinations/variance/maskedSecrets.ts b/test/integrations/destinations/variance/maskedSecrets.ts new file mode 100644 index 00000000000..74d160ff192 --- /dev/null +++ b/test/integrations/destinations/variance/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${base64Convertor(secret1)}`; diff --git a/test/integrations/destinations/variance/processor/data.ts b/test/integrations/destinations/variance/processor/data.ts index f4f3054296c..591d5a92503 100644 --- a/test/integrations/destinations/variance/processor/data.ts +++ b/test/integrations/destinations/variance/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1 } from '../maskedSecrets'; + export const data = [ { name: 'variance', @@ -109,7 +111,7 @@ export const data = [ }, Config: { webhookUrl: 'http://6b0e6a60.ngrok.io', - authHeader: 'Basic MVA4dUtGOF=', + authHeader: authHeader1, }, }, metadata: { @@ -131,7 +133,7 @@ export const data = [ method: 'POST', endpoint: 'http://6b0e6a60.ngrok.io', headers: { - authorization: 'Basic MVA4dUtGOF=', + authorization: authHeader1, 'content-type': 'application/json', }, params: {}, diff --git a/test/integrations/destinations/vitally/maskedSecrets.ts b/test/integrations/destinations/vitally/maskedSecrets.ts new file mode 100644 index 00000000000..c5a4dc839e8 --- /dev/null +++ b/test/integrations/destinations/vitally/maskedSecrets.ts @@ -0,0 +1,5 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Basic ${secret1}`; diff --git a/test/integrations/destinations/vitally/processor/data.ts b/test/integrations/destinations/vitally/processor/data.ts index 2c3fdd32979..eee043de65f 100644 --- a/test/integrations/destinations/vitally/processor/data.ts +++ b/test/integrations/destinations/vitally/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'vitally', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { @@ -66,7 +67,7 @@ export const data = [ method: 'POST', userId: '', headers: { - authorization: 'Basic abc123', + authorization: authHeader1, 'content-type': 'application/json', }, }, @@ -92,7 +93,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { @@ -145,7 +146,7 @@ export const data = [ method: 'POST', userId: '', headers: { - authorization: 'Basic abc123', + authorization: authHeader1, 'content-type': 'application/json', }, }, @@ -171,7 +172,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { @@ -220,7 +221,7 @@ export const data = [ method: 'POST', userId: '', headers: { - authorization: 'Basic abc123', + authorization: authHeader1, 'content-type': 'application/json', }, }, @@ -247,7 +248,7 @@ export const data = [ { destination: { Config: { - apiKeyVitally: 'abc123', + apiKeyVitally: secret1, }, DestinationDefinition: { Config: { diff --git a/test/integrations/destinations/webengage/maskedSecrets.ts b/test/integrations/destinations/webengage/maskedSecrets.ts new file mode 100644 index 00000000000..2feea9882d7 --- /dev/null +++ b/test/integrations/destinations/webengage/maskedSecrets.ts @@ -0,0 +1,4 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const authHeader1 = `Bearer ${secret1}`; diff --git a/test/integrations/destinations/webengage/processor/data.ts b/test/integrations/destinations/webengage/processor/data.ts index e4cc9bfd3df..62d43e98ce6 100644 --- a/test/integrations/destinations/webengage/processor/data.ts +++ b/test/integrations/destinations/webengage/processor/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; export const data = [ { name: 'webengage', @@ -11,7 +12,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -86,7 +87,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -141,7 +142,7 @@ export const data = [ endpoint: 'https://api.in.webengage.com/v1/accounts/3bjsjdbh7/events', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -202,7 +203,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -256,7 +257,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -318,7 +319,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -372,7 +373,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -434,7 +435,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -489,7 +490,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -552,7 +553,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -645,7 +646,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -670,7 +671,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -763,7 +764,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -788,7 +789,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -880,7 +881,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -905,7 +906,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -959,7 +960,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1022,7 +1023,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1096,7 +1097,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1170,7 +1171,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1243,7 +1244,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'standard', }, @@ -1316,7 +1317,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'standard', }, @@ -1370,7 +1371,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1433,7 +1434,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'standard', }, @@ -1486,7 +1487,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1548,7 +1549,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1632,7 +1633,7 @@ export const data = [ method: 'POST', params: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, version: '1', @@ -1657,7 +1658,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1724,7 +1725,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1764,7 +1765,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1835,7 +1836,7 @@ export const data = [ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, }, params: {}, body: { @@ -1878,7 +1879,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -1954,7 +1955,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -2029,7 +2030,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -2118,7 +2119,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: secret1, licenseCode: '3bjsjdbh7', dataCenter: 'ind', }, @@ -2205,7 +2206,7 @@ export const data = [ endpoint: 'https://api.in.webengage.com/v1/accounts/3bjsjdbh7/events', files: {}, headers: { - Authorization: 'Bearer dummyApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', diff --git a/test/integrations/destinations/webhook/processor/data.ts b/test/integrations/destinations/webhook/processor/data.ts index 7720bc683c8..c4e29e30fc7 100644 --- a/test/integrations/destinations/webhook/processor/data.ts +++ b/test/integrations/destinations/webhook/processor/data.ts @@ -1939,7 +1939,7 @@ export const data = [ test2: 'value2', dynamic_header_key_string: 'dynamic_header_value_string', dynamic_header_key_num: '10', - dynamic_header_key_object: '{"k1":"v1"}', + dynamic_header_key_object: JSON.stringify({ k1: 'v1' }), }, params: {}, files: {}, @@ -3355,9 +3355,14 @@ export const data = [ files: {}, headers: { 'content-type': 'application/json', - ijkl: '{"int":1234,"string":"abcd","array":[1,2,"a",true],"object":{"key1":"value"}}', + ijkl: JSON.stringify({ + int: 1234, + string: 'abcd', + array: [1, 2, 'a', true], + object: { key1: 'value' }, + }), key1: 'abcd', - key2: '{"key1":"","key2":""}', + key2: JSON.stringify({ key1: '', key2: '' }), key3: 'true', key4: 'null', key5: 'undefined', diff --git a/test/integrations/destinations/wootric/maskedSecrets.ts b/test/integrations/destinations/wootric/maskedSecrets.ts new file mode 100644 index 00000000000..4fcad9f777b --- /dev/null +++ b/test/integrations/destinations/wootric/maskedSecrets.ts @@ -0,0 +1,10 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secretPassword = path.basename(__dirname) + 1; +export const secretAccountToken = path.basename(__dirname) + 2; +export const secretInvalidToken = path.basename(__dirname) + 3; +export const secretAccessToken = path.basename(__dirname) + 4; +export const secretRefreshToken = path.basename(__dirname) + 5; + +export const authHeaderAccessToken = `Bearer ${secretAccessToken}`; diff --git a/test/integrations/destinations/wootric/network.ts b/test/integrations/destinations/wootric/network.ts index 1b51cc700c2..5b89680b365 100644 --- a/test/integrations/destinations/wootric/network.ts +++ b/test/integrations/destinations/wootric/network.ts @@ -1,3 +1,10 @@ +import { + secretInvalidToken, + secretAccountToken, + secretAccessToken, + secretRefreshToken, +} from './maskedSecrets'; + export const networkCallsData = [ { httpReq: { @@ -134,15 +141,15 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://api.wootric.com/oauth/token?account_token=NPS-dummyToken', + url: `https://api.wootric.com/oauth/token?account_token=${secretAccountToken}`, method: 'POST', }, httpRes: { data: { - access_token: '2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + access_token: secretAccessToken, token_type: 'Bearer', expires_in: 7200, - refresh_token: 'f4033a61742e84405a5ef8b2e09b82395dc041f0259fd5fb715fc196a1b9cd52', + refresh_token: secretRefreshToken, scope: 'delete_account admin respond export read survey invalidate_response', created_at: 1660292389, }, @@ -169,7 +176,7 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://api.wootric.com/oauth/token?account_token=NPS-dummyToken12', + url: `https://api.wootric.com/oauth/token?account_token=${secretInvalidToken}`, method: 'POST', }, httpRes: { diff --git a/test/integrations/destinations/wootric/processor/data.ts b/test/integrations/destinations/wootric/processor/data.ts index ae747e982d5..94d005e6261 100644 --- a/test/integrations/destinations/wootric/processor/data.ts +++ b/test/integrations/destinations/wootric/processor/data.ts @@ -1,3 +1,10 @@ +import { + secretPassword, + secretAccountToken, + authHeaderAccessToken, + secretInvalidToken, +} from '../maskedSecrets'; + export const data = [ { name: 'wootric', @@ -12,8 +19,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken12', + password: secretPassword, + accountToken: secretInvalidToken, }, ID: 'wootric-1234', }, @@ -40,8 +47,11 @@ export const data = [ status: 200, body: [ { - error: - '{"message":"Access token could not be generated due to {\\"error\\":\\"Not found\\",\\"status\\":404}","destinationResponse":{"response":{"error":"Not found","status":404},"status":500}}', + error: JSON.stringify({ + message: + 'Access token could not be generated due to {"error":"Not found","status":404}', + destinationResponse: { response: { error: 'Not found', status: 404 }, status: 500 }, + }), statTags: { destType: 'WOOTRIC', errorCategory: 'network', @@ -69,8 +79,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -151,8 +161,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -194,8 +203,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -275,8 +284,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -317,8 +325,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -398,8 +406,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -440,8 +447,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -533,8 +540,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -634,8 +641,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -716,8 +723,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/490635419', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -756,8 +762,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -832,8 +838,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -871,8 +876,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -950,8 +955,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -989,8 +993,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1078,8 +1082,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/responses', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1121,8 +1124,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1222,8 +1225,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1329,8 +1332,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1430,8 +1433,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1509,8 +1512,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/declines', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1543,8 +1545,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1643,8 +1645,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, @@ -1754,8 +1756,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: 'wootric-1234', }, diff --git a/test/integrations/destinations/wootric/router/data.ts b/test/integrations/destinations/wootric/router/data.ts index 9af28f4f483..1c29dcfae24 100644 --- a/test/integrations/destinations/wootric/router/data.ts +++ b/test/integrations/destinations/wootric/router/data.ts @@ -1,3 +1,5 @@ +import { secretPassword, secretAccountToken, authHeaderAccessToken } from '../maskedSecrets'; + export const data = [ { name: 'wootric', @@ -13,8 +15,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -77,8 +79,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -140,8 +142,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -203,8 +205,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -257,8 +259,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -319,8 +321,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -374,8 +376,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -429,8 +431,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -490,8 +492,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -558,8 +560,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -617,8 +619,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -676,8 +678,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -734,8 +736,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -792,8 +794,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -861,8 +863,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -942,8 +944,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -972,8 +973,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -985,8 +986,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1014,8 +1014,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1027,8 +1027,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1056,8 +1055,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1065,8 +1064,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1087,8 +1086,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1113,8 +1112,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1132,8 +1130,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1145,8 +1143,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1164,8 +1161,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1177,8 +1174,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1203,8 +1199,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1216,8 +1212,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/responses', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1246,8 +1241,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1256,8 +1251,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1277,8 +1272,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1303,8 +1298,7 @@ export const data = [ endpoint: 'https://api.wootric.com/v1/end_users/486438462/declines', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - Authorization: - 'Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c', + Authorization: authHeaderAccessToken, }, params: {}, body: { @@ -1324,8 +1318,8 @@ export const data = [ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, }, }, @@ -1333,8 +1327,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1355,8 +1349,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, @@ -1378,8 +1372,8 @@ export const data = [ destination: { Config: { username: 'wootricfakeuser@example.com', - password: 'password@123', - accountToken: 'NPS-dummyToken', + password: secretPassword, + accountToken: secretAccountToken, }, ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG', }, diff --git a/test/integrations/destinations/wunderkind/router/data.ts b/test/integrations/destinations/wunderkind/router/data.ts index 8081bdf456f..8597901dd4d 100644 --- a/test/integrations/destinations/wunderkind/router/data.ts +++ b/test/integrations/destinations/wunderkind/router/data.ts @@ -111,8 +111,127 @@ export const data = [ }, { batchedRequest: { - payload: - '{"account":{"account_id":"test-account-id","account_settings":{"instance_id":"test-instance-id","key":"test-api-key"}},"type":"event_processing_request","id":"a2a5575b-d3b0-4a14-96a5-79f8e38b0778","timestamp_ms":1718893923387,"source_id":"test-source-id","source_channel":"native","device_application_stamp":"test-device-application-stamp","user_identities":[{"type":"customer","encoding":"raw","value":"eb3f565d-49bd-418c-ae31-801f25da0ce2"},{"type":"email","encoding":"raw","value":"johndoe@gmail.com"},{"type":"other","encoding":"raw","value":"7c2c3abd-62bf-473e-998d-034df0f25ea3"}],"user_attribute_lists":{},"runtime_environment":{"sdk_version":"8.8.0","type":"ios","identities":[{"type":"apple_push_notification_token","encoding":"raw","value":"9e3dba8db39f9d130f3d1584c8aab674e9f4b06d0b1b52867e128d3e7b1130f1"},{"type":"ios_vendor_id","encoding":"raw","value":"78c53c15-32a1-4b65-adac-bec2d7bb8fab"}],"build_id":"20E12","brand":"iPhone14,7","product":"iPhone14,7","name":"iPhone","manufacturer":"Apple","os_version":"16.3.1","model":"iPhone14,7","screen_height":2532,"screen_width":1170,"locale_language":"en-US","locale_country":"US","network_country":"us","network_carrier":"Verizon","network_code":"480","network_mobile_country_code":"311","timezone_offset":-7,"timezone_name":"America/Phoenix","cpu_architecture":"arm64","radio_access_technology":"LTE","application_name":"Abc.com - New Account","application_version":"8.8.0","application_package":"com.abc","apple_search_ads_attribution":{},"client_ip_address":"192.0.2.0"},"user_attributes":{"firstName":"john","lastName":"doe"},"events":[{"screen_name":"shopping/vehicle-details","type":"custom_event","id":"1393f120-53b8-4126-8deb-874c26b5b06d","timestamp_ms":1703685306737,"source_id":"test-source-id","session_id":1688982077105115000,"name":"srp-screen-view","custom_event_type":"other","attributes":{"profileLoginType":"logged-in","launchType":"organic","platform":"iphone-app","fuelType":"Gasoline","makeName":"Volvo","vehicleAdCategory":"multi_cat","searchInstanceId":"test-search-instance-id","customerId":"test-customer-id","drivetrain":"All-wheel Drive","year":"2024","canonical_mmt":"volvo:xc90:b5_core_bright_theme","mileage":"5","make":"volvo","pushNotification":"disabled","advertiserId":"00000000-0000-0000-0000-000000000000","exteriorColor":"Crystal White","adobeId":"test-adobe-id","pageChannel":"shopping","bodyStyle":"suv","tripId":"test-trip-id","stockType":"new","makeModelTrim":"volvo:xc90:b5_core_bright_theme","pageName":"shopping/vehicle-details","model":"xc90","deviceType":"mobile","listingId":"test-listing-id","dealerZip":"30341","cpoIndicator":"false","trim":"b5_core_bright_theme","canonical_mmty":"volvo:xc90:b5_core_bright_theme:2024","sellerType":"franchise","price":"56002","vin":"test-vin","resultSelected":"89","zip":"85381","stockSubStock":"new","profileUserId":"test-profile-user-id","pageKey":"vehicle-details","badges":"homeDelivery,virtualAppointment","modelName":"XC90"}}]}', + payload: JSON.stringify({ + account: { + account_id: 'test-account-id', + account_settings: { instance_id: 'test-instance-id', key: 'test-api-key' }, + }, + type: 'event_processing_request', + id: 'a2a5575b-d3b0-4a14-96a5-79f8e38b0778', + timestamp_ms: 1718893923387, + source_id: 'test-source-id', + source_channel: 'native', + device_application_stamp: 'test-device-application-stamp', + user_identities: [ + { + type: 'customer', + encoding: 'raw', + value: 'eb3f565d-49bd-418c-ae31-801f25da0ce2', + }, + { type: 'email', encoding: 'raw', value: 'johndoe@gmail.com' }, + { + type: 'other', + encoding: 'raw', + value: '7c2c3abd-62bf-473e-998d-034df0f25ea3', + }, + ], + user_attribute_lists: {}, + runtime_environment: { + sdk_version: '8.8.0', + type: 'ios', + identities: [ + { + type: 'apple_push_notification_token', + encoding: 'raw', + value: '9e3dba8db39f9d130f3d1584c8aab674e9f4b06d0b1b52867e128d3e7b1130f1', + }, + { + type: 'ios_vendor_id', + encoding: 'raw', + value: '78c53c15-32a1-4b65-adac-bec2d7bb8fab', + }, + ], + build_id: '20E12', + brand: 'iPhone14,7', + product: 'iPhone14,7', + name: 'iPhone', + manufacturer: 'Apple', + os_version: '16.3.1', + model: 'iPhone14,7', + screen_height: 2532, + screen_width: 1170, + locale_language: 'en-US', + locale_country: 'US', + network_country: 'us', + network_carrier: 'Verizon', + network_code: '480', + network_mobile_country_code: '311', + timezone_offset: -7, + timezone_name: 'America/Phoenix', + cpu_architecture: 'arm64', + radio_access_technology: 'LTE', + application_name: 'Abc.com - New Account', + application_version: '8.8.0', + application_package: 'com.abc', + apple_search_ads_attribution: {}, + client_ip_address: '192.0.2.0', + }, + user_attributes: { firstName: 'john', lastName: 'doe' }, + events: [ + { + screen_name: 'shopping/vehicle-details', + type: 'custom_event', + id: '1393f120-53b8-4126-8deb-874c26b5b06d', + timestamp_ms: 1703685306737, + source_id: 'test-source-id', + session_id: 1688982077105115000, + name: 'srp-screen-view', + custom_event_type: 'other', + attributes: { + profileLoginType: 'logged-in', + launchType: 'organic', + platform: 'iphone-app', + fuelType: 'Gasoline', + makeName: 'Volvo', + vehicleAdCategory: 'multi_cat', + searchInstanceId: 'test-search-instance-id', + customerId: 'test-customer-id', + drivetrain: 'All-wheel Drive', + year: '2024', + canonical_mmt: 'volvo:xc90:b5_core_bright_theme', + mileage: '5', + make: 'volvo', + pushNotification: 'disabled', + advertiserId: '00000000-0000-0000-0000-000000000000', + exteriorColor: 'Crystal White', + adobeId: 'test-adobe-id', + pageChannel: 'shopping', + bodyStyle: 'suv', + tripId: 'test-trip-id', + stockType: 'new', + makeModelTrim: 'volvo:xc90:b5_core_bright_theme', + pageName: 'shopping/vehicle-details', + model: 'xc90', + deviceType: 'mobile', + listingId: 'test-listing-id', + dealerZip: '30341', + cpoIndicator: 'false', + trim: 'b5_core_bright_theme', + canonical_mmty: 'volvo:xc90:b5_core_bright_theme:2024', + sellerType: 'franchise', + price: '56002', + vin: 'test-vin', + resultSelected: '89', + zip: '85381', + stockSubStock: 'new', + profileUserId: 'test-profile-user-id', + pageKey: 'vehicle-details', + badges: 'homeDelivery,virtualAppointment', + modelName: 'XC90', + }, + }, + ], + }), }, metadata: [generateMetadata(2)], destination, diff --git a/test/integrations/destinations/x_audience/common.ts b/test/integrations/destinations/x_audience/common.ts index 547e04ba848..8a16c8c6fc2 100644 --- a/test/integrations/destinations/x_audience/common.ts +++ b/test/integrations/destinations/x_audience/common.ts @@ -2,7 +2,7 @@ export const authHeaderConstant = 'OAuth oauth_consumer_key="qwe", oauth_nonce="V1kMh028kZLLhfeYozuL0B45Pcx6LvuW", oauth_signature="Di4cuoGv4PnCMMEeqfWTcqhvdwc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1685603652", oauth_token="dummyAccessToken", oauth_version="1.0"'; export const destination = { Config: { - accountId: '{"Dummy Name":"1234"}', + accountId: JSON.stringify({ 'Dummy Name': '1234' }), audienceId: 'dummyId', }, ID: 'xpixel-1234', diff --git a/test/integrations/destinations/zendesk/maskedSecrets.ts b/test/integrations/destinations/zendesk/maskedSecrets.ts new file mode 100644 index 00000000000..472f605b9c5 --- /dev/null +++ b/test/integrations/destinations/zendesk/maskedSecrets.ts @@ -0,0 +1,13 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secret2 = path.basename(__dirname) + 2; +export const secret3 = path.basename(__dirname) + 3; +export const secret4 = path.basename(__dirname) + 4; +export const authHeader1 = `Basic ${base64Convertor('myDummyUserName1/token' + ':' + secret1)}`; +export const authHeader2 = `Basic ${base64Convertor('rudderlabtest2@email.com/token' + ':' + secret2)}`; +export const authHeader3 = `Basic ${base64Convertor('test@rudder.com/token' + ':' + secret1)}`; +export const authHeader4 = `Basic ${base64Convertor('test@rudder.com/token' + ':' + secret3)}`; +export const authHeader5 = `Basic ${base64Convertor('myDummyUserName2/token' + ':' + secret4)}`; +export const authHeader6 = `Basic ${base64Convertor('rudderlabtest1@email.com/token' + ':' + secret2)}`; diff --git a/test/integrations/destinations/zendesk/network.ts b/test/integrations/destinations/zendesk/network.ts index 578fddfa8f8..8e015f313cf 100644 --- a/test/integrations/destinations/zendesk/network.ts +++ b/test/integrations/destinations/zendesk/network.ts @@ -1,8 +1,16 @@ +import { + authHeader1, + authHeader2, + authHeader3, + authHeader4, + authHeader5, + authHeader6, +} from './maskedSecrets'; export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -70,7 +78,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -114,7 +122,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -145,7 +153,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -205,7 +213,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -216,7 +224,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -235,7 +243,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'POST', @@ -246,7 +254,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -314,7 +322,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -382,7 +390,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -426,7 +434,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'POST', @@ -457,7 +465,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -517,7 +525,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -528,7 +536,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -588,7 +596,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -656,7 +664,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -716,7 +724,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -745,7 +753,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -813,7 +821,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -873,7 +881,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -902,7 +910,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -973,7 +981,7 @@ export const networkCallsData = [ user_field: { active: true, description: 'country', key: 'country', title: 'country' }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'POST', @@ -1041,7 +1049,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -1112,7 +1120,7 @@ export const networkCallsData = [ user_field: { active: true, description: 'country', key: 'country', title: 'country' }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'POST', @@ -1180,7 +1188,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -1251,7 +1259,7 @@ export const networkCallsData = [ user_field: { active: true, description: 'country', key: 'country', title: 'country' }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'POST', @@ -1319,7 +1327,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', }, method: 'GET', @@ -1338,7 +1346,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', }, method: 'POST', @@ -1393,7 +1401,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', }, method: 'GET', @@ -1412,7 +1420,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', }, method: 'POST', @@ -1467,7 +1475,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMi90b2tlbjpteUR1bW15QXBpVG9rZW4y', + Authorization: authHeader5, 'Content-Type': 'application/json', }, method: 'GET', @@ -1478,7 +1486,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1546,7 +1554,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1614,7 +1622,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1675,7 +1683,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1721,7 +1729,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader6, 'Content-Type': 'application/json', }, method: 'GET', @@ -1740,7 +1748,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader6, 'Content-Type': 'application/json', }, method: 'POST', @@ -1795,7 +1803,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'GET', @@ -1814,7 +1822,7 @@ export const networkCallsData = [ }, }, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDJAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'POST', @@ -1826,7 +1834,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1888,7 +1896,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -1946,7 +1954,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -2008,7 +2016,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -2053,7 +2061,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', @@ -2115,7 +2123,7 @@ export const networkCallsData = [ { httpReq: { headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', }, method: 'GET', diff --git a/test/integrations/destinations/zendesk/processor/data.ts b/test/integrations/destinations/zendesk/processor/data.ts index da84f643dc8..be0907026c4 100644 --- a/test/integrations/destinations/zendesk/processor/data.ts +++ b/test/integrations/destinations/zendesk/processor/data.ts @@ -1,3 +1,14 @@ +import { + authHeader1, + secret1, + authHeader3, + authHeader4, + secret3, + authHeader5, + secret4, + authHeader6, + secret2, +} from '../maskedSecrets'; export const data = [ { name: 'zendesk', @@ -11,7 +22,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -183,7 +194,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken3', + apiToken: secret3, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -244,7 +255,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -307,7 +318,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -349,7 +360,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -418,7 +429,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/organization_memberships.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -454,7 +465,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -520,7 +531,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/events', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -566,7 +577,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -631,7 +642,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/organization_memberships/900004877903.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -651,7 +662,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -693,7 +704,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -758,7 +769,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/organization_memberships/900004877903.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -778,7 +789,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -906,7 +917,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: false, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -935,7 +946,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1073,7 +1084,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: false, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1102,7 +1113,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1240,7 +1251,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1269,7 +1280,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjQ=', + Authorization: authHeader3, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1414,7 +1425,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken3', + apiToken: secret3, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1464,7 +1475,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/events', files: {}, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -1597,7 +1608,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiToken: 'myDummyApiToken3', + apiToken: secret3, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'test@rudder.com', @@ -1647,7 +1658,7 @@ export const data = [ endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/900113780483/events', files: {}, headers: { - Authorization: 'Basic dGVzdEBydWRkZXIuY29tL3Rva2VuOm15RHVtbXlBcGlUb2tlbjM=', + Authorization: authHeader4, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -1687,7 +1698,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken2', + apiToken: secret4, createUsersAsVerified: true, domain: 'blendohelp', email: 'myDummyUserName2', @@ -1776,7 +1787,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken2', + apiToken: secret4, createUsersAsVerified: true, domain: 'blendohelp', email: 'myDummyUserName2', @@ -1865,7 +1876,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken2', + apiToken: secret4, createUsersAsVerified: true, domain: 'blendohelp', email: 'myDummyUserName2', @@ -1933,7 +1944,7 @@ export const data = [ method: 'POST', endpoint: 'https://blendohelp.zendesk.com/api/v2/organizations/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMi90b2tlbjpteUR1bW15QXBpVG9rZW4y', + Authorization: authHeader5, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -1974,7 +1985,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2037,7 +2048,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2078,7 +2089,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2144,7 +2155,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2163,7 +2174,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2233,7 +2244,7 @@ export const data = [ ID: 'xxxXXXXXXXXXXXxxxxxxxxxorpz', Name: 'Zendesk', Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest1', email: 'rudderlabtest1@email.com', @@ -2278,7 +2289,7 @@ export const data = [ endpoint: 'https://rudderlabtest1.zendesk.com/api/v2/users/900113780483/events', files: {}, headers: { - Authorization: 'Basic cnVkZGVybGFidGVzdDFAZW1haWwuY29tL3Rva2VuOmR1bW15QXBpVG9rZW4=', + Authorization: authHeader6, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Name': 'RudderStack', @@ -2336,7 +2347,7 @@ export const data = [ ID: 'xxxXXXXXXXXXXXxxxxxxxxxorpz', Name: 'Zendesk', Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest2', email: 'rudderlabtest2@email.com', @@ -2382,7 +2393,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2468,7 +2479,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2534,7 +2545,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-App-Id': '263241', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2553,7 +2564,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2596,7 +2607,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2655,7 +2666,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -2698,7 +2709,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -2757,7 +2768,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', diff --git a/test/integrations/destinations/zendesk/router/data.ts b/test/integrations/destinations/zendesk/router/data.ts index 4e7aacd1d1f..371b256b077 100644 --- a/test/integrations/destinations/zendesk/router/data.ts +++ b/test/integrations/destinations/zendesk/router/data.ts @@ -1,3 +1,4 @@ +import { authHeader1, secret1, secret2 } from '../maskedSecrets'; export const data = [ { name: 'zendesk', @@ -12,7 +13,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -80,7 +81,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/users/create_or_update.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -110,7 +111,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -147,7 +148,7 @@ export const data = [ { destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -220,7 +221,7 @@ export const data = [ method: 'POST', endpoint: 'https://rudderlabshelp.zendesk.com/api/v2/organization_memberships.json', headers: { - Authorization: 'Basic bXlEdW1teVVzZXJOYW1lMS90b2tlbjpteUR1bW15QXBpVG9rZW40', + Authorization: authHeader1, 'Content-Type': 'application/json', 'X-Zendesk-Marketplace-Name': 'RudderStack', 'X-Zendesk-Marketplace-Organization-Id': '3339', @@ -246,7 +247,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiToken: 'myDummyApiToken4', + apiToken: secret1, createUsersAsVerified: true, domain: 'rudderlabshelp', email: 'myDummyUserName1', @@ -283,7 +284,7 @@ export const data = [ { destination: { Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest2', email: 'rudderlabtest2@email.com', @@ -355,7 +356,7 @@ export const data = [ batched: false, destination: { Config: { - apiToken: 'dummyApiToken', + apiToken: secret2, createUsersAsVerified: true, domain: 'rudderlabtest2', email: 'rudderlabtest2@email.com', diff --git a/test/integrations/destinations/zoho/dataDelivery/business.ts b/test/integrations/destinations/zoho/dataDelivery/business.ts index 89c3ca214b1..003c8f3d538 100644 --- a/test/integrations/destinations/zoho/dataDelivery/business.ts +++ b/test/integrations/destinations/zoho/dataDelivery/business.ts @@ -1,5 +1,6 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; +import { defaultAccessToken } from '../../../common/secrets'; export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', @@ -39,7 +40,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -51,7 +52,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -63,7 +64,7 @@ export const metadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -78,7 +79,7 @@ export const singleMetadata = [ workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }, @@ -236,8 +237,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ { statusCode: 400, metadata: generateMetadata(1), - error: - '{"code":"INVALID_MODULE","details":{"resource_path_index":0},"message":"the module name given seems to be invalid","status":"error"}', + error: JSON.stringify({ + code: 'INVALID_MODULE', + details: { resource_path_index: 0 }, + message: 'the module name given seems to be invalid', + status: 'error', + }), }, ], }, @@ -278,8 +283,12 @@ export const testScenariosForV1API: ProxyV1TestData[] = [ authErrorCategory: 'REFRESH_TOKEN', response: [ { - error: - '{"code":"INVALID_TOKEN","details":{},"message":"invalid oauth token","status":"error"}', + error: JSON.stringify({ + code: 'INVALID_TOKEN', + details: {}, + message: 'invalid oauth token', + status: 'error', + }), statusCode: 500, metadata: generateMetadata(1), }, diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index 0b83db51899..1515fd4b781 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -141,7 +141,7 @@ export type RouterTestData = { }; }; -export type ProxyV1TestData = { +export type ProxyV1TestData = BaseTestCase & { id: string; name: string; description: string; diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts index e70c4da008f..b2c52cc9eae 100644 --- a/test/integrations/testUtils.ts +++ b/test/integrations/testUtils.ts @@ -1,7 +1,7 @@ import { globSync } from 'glob'; import { join } from 'path'; import { MockHttpCallsData, TestCaseData } from './testTypes'; -import MockAdapter from 'axios-mock-adapter'; +import MockAxiosAdapter from 'axios-mock-adapter'; import isMatch from 'lodash/isMatch'; import { OptionValues } from 'commander'; import { filter, removeUndefinedAndNullValues } from '@rudderstack/integrations-lib'; @@ -18,10 +18,14 @@ import { ProxyV1RequestSchema, RouterTransformationResponseListSchema, } from '../../src/types/zodTypes'; +import { defaultAccessToken } from './common/secrets'; +import { randomBytes } from 'crypto'; -const generateAlphanumericId = (size = 36) => - [...Array(size)].map(() => ((Math.random() * size) | 0).toString(size)).join(''); - +const generateAlphanumericId = (size = 36) => { + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const bytes = randomBytes(size); + return Array.from(bytes, (byte) => chars[byte % chars.length]).join(''); +}; export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): string[] => { const globPattern = join(dirPath, '**', 'data.ts'); let testFilePaths = globSync(globPattern); @@ -29,8 +33,9 @@ export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): strin const destinationOrSource = opts.destination || opts.source; if (destinationOrSource) { - filteredTestFilePaths = testFilePaths.filter( - (testFile) => destinationOrSource && testFile.includes(`/${destinationOrSource}/`), + const resources = destinationOrSource.split(','); + filteredTestFilePaths = testFilePaths.filter((testFile) => + resources.some((resource) => testFile.includes(`/${resource}/`)), ); } if (opts.feature) { @@ -45,24 +50,50 @@ export const getTestData = (filePath): TestCaseData[] => { return filter(require(filePath).data as TestCaseData[]); }; +export const getTestSecrets = (destination: string) => { + const filePath = join(__dirname, 'destinations', destination, 'maskedSecrets.ts'); + return require(filePath); +}; + export const getMockHttpCallsData = (filePath): MockHttpCallsData[] => { return require(filePath).networkCallsData as MockHttpCallsData[]; }; -export const getAllTestMockDataFilePaths = (dirPath: string, destination: string): string[] => { +export const registerAxiosMocks = ( + mockAdapter: MockAxiosAdapter, + axiosMocks: MockHttpCallsData[], +) => { + axiosMocks.forEach((axiosMock) => addMock(mockAdapter, axiosMock)); +}; + +export const getAllTestMockDataFilePaths = (dirPath: string, resourceName?: string): string[] => { const globPattern = join(dirPath, '**', 'network.ts'); let testFilePaths = globSync(globPattern); - if (destination) { + + if (resourceName) { + const resources = resourceName.split(','); const commonTestFilePaths = testFilePaths.filter((testFile) => testFile.includes('test/integrations/common'), ); - testFilePaths = testFilePaths.filter((testFile) => testFile.includes(destination)); + testFilePaths = testFilePaths.filter((testFile) => + resources.some((resource) => testFile.includes(`/${resource}/`)), + ); testFilePaths = [...commonTestFilePaths, ...testFilePaths]; } return testFilePaths; }; -export const addMock = (mock: MockAdapter, axiosMock: MockHttpCallsData) => { +export const getTestMockData = (resourceName?: string) => { + const allTestMockDataFilePaths = getAllTestMockDataFilePaths(__dirname, resourceName); + return allTestMockDataFilePaths + .map((currPath) => { + const mockNetworkCallsData: MockHttpCallsData[] = getMockHttpCallsData(currPath); + return mockNetworkCallsData; + }) + .flat(); +}; + +export const addMock = (mock: MockAxiosAdapter, axiosMock: MockHttpCallsData) => { const { url, method, data: reqData, params, ...opts } = axiosMock.httpReq; const { data, headers, status } = axiosMock.httpRes; @@ -99,6 +130,7 @@ export const addMock = (mock: MockAdapter, axiosMock: MockHttpCallsData) => { break; } }; + export const overrideDestination = (destination: Destination, overrideConfigValues) => { return Object.assign({}, destination, { Config: { ...destination.Config, ...overrideConfigValues }, @@ -481,7 +513,7 @@ export const generateProxyV0Payload = ( workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; @@ -523,7 +555,7 @@ export const generateProxyV1Payload = ( workspaceId: 'default-workspaceId', sourceId: 'default-sourceId', secret: { - accessToken: payloadParameters.accessToken || 'default-accessToken', + accessToken: payloadParameters.accessToken || defaultAccessToken, }, dontBatch: false, }, @@ -605,7 +637,7 @@ export const generateMetadata = (jobId: number, userId?: string): any => { destinationId: 'default-destinationId', workspaceId: 'default-workspaceId', secret: { - accessToken: 'default-accessToken', + accessToken: defaultAccessToken, }, dontBatch: false, }; @@ -619,7 +651,7 @@ export const generateGoogleOAuthMetadata = (jobId: number): any => { destinationId: 'default-destinationId', workspaceId: 'default-workspaceId', secret: { - access_token: 'default-accessToken', // applicable for google destinations + access_token: defaultAccessToken, // applicable for google destinations }, dontBatch: false, }; diff --git a/test/scripts/removeRedundentFunctionsFromSecrets.ts b/test/scripts/removeRedundentFunctionsFromSecrets.ts new file mode 100644 index 00000000000..0419c32d68d --- /dev/null +++ b/test/scripts/removeRedundentFunctionsFromSecrets.ts @@ -0,0 +1,73 @@ +#!/usr/bin/env node +/** + * This script will: + * 1. Find all .js and .ts files (except in node_modules). + * 2. For any file with “maskedSecrets” in its path, update the export declarations: + * - Convert “export const getAuthHeader_N = () => …;” to “export const authHeaderN = …;” + * - Convert “export const getSecret_N = () => …;” to “export const secretN = …;” + * (Also update inner calls from getSecret_N() to secretN.) + * 3. For all files, update import statements and function usages. + */ + +import fs from 'fs'; +import { globSync } from 'glob'; +import path from 'path'; + +const updateFileContent = (content: string, filePath: string) => { + let newContent = content; + + // --- 1. Update export declarations in maskedSecrets files --- + if (filePath.includes('maskedSecrets')) { + // Replace getAuthHeader declarations + newContent = newContent.replace( + /export\s+const\s+getAuthHeader_(\d+)\s*=\s*\(\)\s*=>\s*(.+);/g, + (match, num, body) => { + // Update inner reference from getSecret_N() to secretN + const modifiedBody = body.replace(/getSecret_(\d+)\(\)/g, 'secret$1'); + // Remove the "get" part and also remove the underscore before the number + return `export const authHeader${num} = ${modifiedBody};`; + }, + ); + + // Replace getSecret declarations + newContent = newContent.replace( + /export\s+const\s+getSecret_(\d+)\s*=\s*\(\)\s*=>\s*(.+);/g, + (match, num, body) => { + return `export const secret${num} = ${body};`; + }, + ); + } + + // --- 2. Update import statements and usage in all files --- + // Replace function call usages: e.g. getAuthHeader_1() -> authHeader1 and getSecret_1() -> secret1 + newContent = newContent + .replace(/getAuthHeader_(\d+)\s*\(\)/g, 'authHeader$1') + .replace(/getSecret_(\d+)\s*\(\)/g, 'secret$1') + // Also update any identifier (such as in import lists) so that the "get" prefix is removed. + .replace(/\bgetAuthHeader_(\d+)\b/g, 'authHeader$1') + .replace(/\bgetSecret_(\d+)\b/g, 'secret$1'); + + return newContent; +}; + +// Find all maskedSecrets.ts files matching the pattern. +const maskedSecretsFiles = globSync( + path.join(__dirname, '..', 'integrations', 'destinations', '**', '*.ts'), +); + +maskedSecretsFiles.forEach((filePath) => { + fs.readFile(filePath, 'utf8', (err, data) => { + if (err) { + console.error('Error reading file:', filePath, err); + return; + } + const updatedContent = updateFileContent(data, filePath); + fs.writeFile(filePath, updatedContent, 'utf8', (err) => { + if (err) { + console.error('Error writing file:', filePath, err); + } else { + console.log('File updated successfully:', filePath); + } + }); + }); +}); From 90315435521c9f21a8bb30f0d762edc262a4485f Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Thu, 6 Mar 2025 14:39:13 +0530 Subject: [PATCH 134/160] chore: mask secrets in headers 2 (#4142) * chore: replace secrets in test cases with functions * fix: masked secret files * fix: remove hard code secrets and use dynamic values * fix: json stringified values * chore: remove scripts * chore: remove hardcode secrets * chore: remove hardcode secrets * fix: remove hardcode secrets --------- Co-authored-by: Vinay Teki --- src/v0/destinations/profitwell/utils.test.js | 17 +++-- test/integrations/common/secrets.ts | 1 + .../destinations/active_campaign/network.ts | 58 ++++++++-------- .../active_campaign/processor/data.ts | 41 ++++++------ .../algolia/dataDelivery/constant.ts | 4 +- .../destinations/algolia/processor/data.ts | 56 ++++++++-------- .../destinations/algolia/router/data.ts | 66 ++++++++++--------- .../destinations/autopilot/processor/data.ts | 28 ++++---- .../destinations/autopilot/router/data.ts | 14 ++-- .../clicksend/dataDelivery/data.ts | 3 +- .../destinations/clicksend/network.ts | 4 +- .../destinations/clickup/maskedSecrets.ts | 3 + .../destinations/clickup/processor/data.ts | 30 +++++---- .../destinations/clickup/router/data.ts | 24 +++---- .../dynamic_yield/processor/data.ts | 36 +++++----- .../destinations/iterable/deleteUsers/data.ts | 10 +-- .../destinations/iterable/network.ts | 12 ++-- .../destinations/lytics/processor/data.ts | 50 +++++++------- .../destinations/mailmodo/processor/data.ts | 26 ++++---- .../destinations/mailmodo/router/data.ts | 20 +++--- .../destinations/mp/deleteUsers/data.ts | 3 +- .../destinations/ometria/processor/data.ts | 46 ++++++------- .../destinations/ometria/router/data.ts | 10 +-- .../destinations/ortto/processor/data.ts | 22 ++++--- .../destinations/ortto/router/data.ts | 14 ++-- .../destinations/persistiq/processor/data.ts | 26 ++++---- .../destinations/persistiq/router/data.ts | 8 ++- .../destinations/profitwell/maskedSecrets.ts | 3 + .../destinations/profitwell/processor/data.ts | 36 +++++----- .../destinations/profitwell/router/data.ts | 8 ++- .../destinations/signl4/processor/data.ts | 24 +++---- .../destinations/signl4/router/data.ts | 12 ++-- .../destinations/singular/processor/data.ts | 60 +++++++++-------- .../destinations/singular/router/data.ts | 20 +++--- .../destinations/sprig/deleteUsers/data.ts | 10 +-- .../destinations/sprig/maskedSecrets.ts | 6 ++ .../destinations/sprig/network.ts | 10 +-- .../destinations/sprig/processor/data.ts | 18 ++--- 38 files changed, 459 insertions(+), 380 deletions(-) create mode 100644 test/integrations/destinations/clickup/maskedSecrets.ts create mode 100644 test/integrations/destinations/profitwell/maskedSecrets.ts create mode 100644 test/integrations/destinations/sprig/maskedSecrets.ts diff --git a/src/v0/destinations/profitwell/utils.test.js b/src/v0/destinations/profitwell/utils.test.js index d6fa5e7df0f..74efe4b2a9a 100644 --- a/src/v0/destinations/profitwell/utils.test.js +++ b/src/v0/destinations/profitwell/utils.test.js @@ -1,3 +1,4 @@ +const path = require('path'); const { validatePayloadAndRetunImpIds, createMissingSubscriptionResponse, @@ -48,6 +49,8 @@ const getTestMessage = () => { return message; }; +const secretApiKey = path.basename(__dirname) + 1; + describe('profitwell utils test cases', () => { describe('createResponseForSubscribedUser', () => { it('correct flow', async () => { @@ -65,7 +68,7 @@ describe('profitwell utils test cases', () => { }, endpoint: 'https://api.profitwell.com/v2/subscriptions/testId/', files: {}, - headers: { Authorization: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiKey, 'Content-Type': 'application/json' }, method: 'PUT', params: {}, type: 'REST', @@ -73,7 +76,7 @@ describe('profitwell utils test cases', () => { }; expect( createResponseForSubscribedUser(getTestMessage(), 'testId', 'testAlias', { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toEqual(expectedOutput); }); @@ -83,7 +86,7 @@ describe('profitwell utils test cases', () => { fittingPayload.traits.effectiveDate = '2019-10-15T09:35:31.288Z'; expect(() => createResponseForSubscribedUser(fittingPayload, 'testId', 'testAlias', { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toThrow('Invalid timestamp format for effectiveDate. Aborting'); }); @@ -108,7 +111,7 @@ describe('profitwell utils test cases', () => { }, endpoint: 'https://api.profitwell.com/v2/subscriptions/', files: {}, - headers: { Authorization: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiKey, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', @@ -116,7 +119,7 @@ describe('profitwell utils test cases', () => { }; expect( createMissingSubscriptionResponse('testId', 'testAlias', null, null, getTestMessage(), { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toEqual(expectedOutput); }); @@ -126,7 +129,7 @@ describe('profitwell utils test cases', () => { fittingPayload.traits.planInterval = 'test'; expect(() => createMissingSubscriptionResponse('testId', 'testAlias', null, null, fittingPayload, { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toThrow('invalid format for planInterval. Aborting'); }); @@ -136,7 +139,7 @@ describe('profitwell utils test cases', () => { fittingPayload.traits.planInterval = 'test'; expect(() => createMissingSubscriptionResponse('testId', 'testAlias', 124, fittingPayload, { - privateApiKey: 'dummyApiKey', + privateApiKey: secretApiKey, }), ).toThrow('Profitwell subscription_id not found'); }); diff --git a/test/integrations/common/secrets.ts b/test/integrations/common/secrets.ts index a8fcb84b9aa..73d428a8f5c 100644 --- a/test/integrations/common/secrets.ts +++ b/test/integrations/common/secrets.ts @@ -1,4 +1,5 @@ import path from 'path'; export const defaultAccessToken = path.basename(__dirname) + 'AccessToken'; +export const defaultApiKey = path.basename(__dirname) + 'ApiKey'; export const defaultAccessTokenAuthHeader = `Bearer ${defaultAccessToken}`; diff --git a/test/integrations/destinations/active_campaign/network.ts b/test/integrations/destinations/active_campaign/network.ts index 34834096b19..7ccd5fea4e9 100644 --- a/test/integrations/destinations/active_campaign/network.ts +++ b/test/integrations/destinations/active_campaign/network.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../common/secrets'; + export const networkCallsData = [ { httpReq: { @@ -565,7 +567,7 @@ export const networkCallsData = [ }, }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -638,7 +640,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 2, status: '1' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -652,7 +654,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 3, status: '2' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -664,7 +666,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': defaultApiKey }, method: 'GET', @@ -807,7 +809,7 @@ export const networkCallsData = [ }, }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -879,7 +881,7 @@ export const networkCallsData = [ { httpReq: { headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -956,7 +958,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Test_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1037,7 +1039,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Interested_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1118,7 +1120,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: '5' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1143,7 +1145,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 6 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1168,7 +1170,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 7 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1193,7 +1195,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 2, status: '1' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1207,7 +1209,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 3, status: '2' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1219,7 +1221,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': defaultApiKey }, method: 'GET', @@ -1354,7 +1356,7 @@ export const networkCallsData = [ { httpReq: { headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1375,7 +1377,7 @@ export const networkCallsData = [ httpReq: { data: { eventTrackingEvent: { name: 'ScreenViewed' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1387,7 +1389,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { 'Api-Token': 'dummyApiKey', Accept: 'application/json, text/plain, */*' }, + headers: { 'Api-Token': defaultApiKey, Accept: 'application/json, text/plain, */*' }, method: 'GET', @@ -1405,7 +1407,7 @@ export const networkCallsData = [ httpReq: { data: { eventTrackingEvent: { name: 'Tracking Action' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1419,7 +1421,7 @@ export const networkCallsData = [ httpReq: { data: { contact: { email: 'jamesDoe@gmail.com', phone: '92374162212' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1491,7 +1493,7 @@ export const networkCallsData = [ { httpReq: { headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1568,7 +1570,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Test_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1649,7 +1651,7 @@ export const networkCallsData = [ httpReq: { data: { tag: { description: '', tag: 'Interested_User', tagType: 'contact' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1730,7 +1732,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: '5' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1755,7 +1757,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 11 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1780,7 +1782,7 @@ export const networkCallsData = [ httpReq: { data: { contactTag: { contact: '2', tag: 12 } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1805,7 +1807,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 2, status: '1' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1819,7 +1821,7 @@ export const networkCallsData = [ httpReq: { data: { contactList: { contact: '2', list: 3, status: '2' } }, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, @@ -1831,7 +1833,7 @@ export const networkCallsData = [ }, { httpReq: { - headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': 'dummyApiKey' }, + headers: { Accept: 'application/json, text/plain, */*', 'Api-Token': defaultApiKey }, method: 'GET', diff --git a/test/integrations/destinations/active_campaign/processor/data.ts b/test/integrations/destinations/active_campaign/processor/data.ts index 56bb3892b92..485151ca3fa 100644 --- a/test/integrations/destinations/active_campaign/processor/data.ts +++ b/test/integrations/destinations/active_campaign/processor/data.ts @@ -7,6 +7,7 @@ import { ProcessorTestData } from '../../../testTypes'; import { Metadata } from '../../../../../src/types'; import MockAdapter from 'axios-mock-adapter'; import { isMatch } from 'lodash'; +import { defaultApiKey } from '../../../common/secrets'; const baseMetadata: Metadata = { sourceId: 'default-source', @@ -117,7 +118,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -145,7 +146,7 @@ export const data: ProcessorTestData[] = [ endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', headers: { 'Content-Type': 'application/json', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, params: {}, body: { @@ -264,7 +265,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -292,7 +293,7 @@ export const data: ProcessorTestData[] = [ endpoint: 'https://active.campaigns.rudder.com/api/3/contact/sync', headers: { 'Content-Type': 'application/json', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, params: {}, body: { @@ -412,7 +413,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -449,7 +450,7 @@ export const data: ProcessorTestData[] = [ method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, version: '1', @@ -539,7 +540,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -578,7 +579,7 @@ export const data: ProcessorTestData[] = [ method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/x-www-form-urlencoded', }, version: '1', @@ -656,7 +657,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -695,7 +696,7 @@ export const data: ProcessorTestData[] = [ method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/x-www-form-urlencoded', }, version: '1', @@ -804,7 +805,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.rudder.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -860,7 +861,7 @@ export const data: ProcessorTestData[] = [ method: 'POST', params: {}, headers: { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }, version: '1', @@ -970,7 +971,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.dumber.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -1026,7 +1027,7 @@ export const data: ProcessorTestData[] = [ { asymmetricMatch: (actual) => { return isMatch(actual, { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }); }, @@ -1130,7 +1131,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.dumber2.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -1186,7 +1187,7 @@ export const data: ProcessorTestData[] = [ { asymmetricMatch: (actual) => { return isMatch(actual, { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }); }, @@ -1197,7 +1198,7 @@ export const data: ProcessorTestData[] = [ '\\n\\n\\n\\n \\n\\n\\n\\naccurx.api-us1.com | 504: Gateway time-out\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
\\n
\\n
\\n

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

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

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

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

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

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

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

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

What happened?

\\n

The web server reported a gateway time-out error.

\\n
\\n
\\n

What can I do?

\\n

Please try again in a few minutes.

\\n
\\n
\\n
\\n\\n \\n\\n\\n
\\n
\\n\\n\\n")', { Accept: 'application/json, text/plain, */*', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, ); }, @@ -1296,7 +1297,7 @@ export const data: ProcessorTestData[] = [ Config: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, apiUrl: 'https://active.campaigns.dumber2.com', actid: '476550467', eventKey: 'f8a866fddc721350fdc2fbbd2e5c43a6dddaaa03', @@ -1352,7 +1353,7 @@ export const data: ProcessorTestData[] = [ { asymmetricMatch: (actual) => { return isMatch(actual, { - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, 'Content-Type': 'application/json', }); }, @@ -1375,7 +1376,7 @@ export const data: ProcessorTestData[] = [ }, { Accept: 'application/json, text/plain, */*', - 'Api-Token': 'dummyApiKey', + 'Api-Token': defaultApiKey, }, ); }, diff --git a/test/integrations/destinations/algolia/dataDelivery/constant.ts b/test/integrations/destinations/algolia/dataDelivery/constant.ts index e8d0817a7fe..bf6dfeeaf68 100644 --- a/test/integrations/destinations/algolia/dataDelivery/constant.ts +++ b/test/integrations/destinations/algolia/dataDelivery/constant.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + const proxyMetdata1 = { jobId: 1, attemptNum: 1, @@ -35,7 +37,7 @@ export const abortStatTags = { export const commonRequestProperties = { commonHeaders: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', 'User-Agent': 'RudderLabs', }, diff --git a/test/integrations/destinations/algolia/processor/data.ts b/test/integrations/destinations/algolia/processor/data.ts index b37b6e42465..f8d9e01dd7b 100644 --- a/test/integrations/destinations/algolia/processor/data.ts +++ b/test/integrations/destinations/algolia/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'algolia', @@ -74,7 +76,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -117,7 +119,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', files: {}, headers: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', }, method: 'POST', @@ -225,7 +227,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -266,7 +268,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', files: {}, headers: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', }, method: 'POST', @@ -365,7 +367,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [], }, @@ -480,7 +482,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [], }, @@ -605,7 +607,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -735,7 +737,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -775,7 +777,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', files: {}, headers: { - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, 'X-Algolia-Application-Id': 'O2YARRI15I', }, method: 'POST', @@ -883,7 +885,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1013,7 +1015,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1143,7 +1145,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', }, }, @@ -1256,7 +1258,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1376,7 +1378,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1492,7 +1494,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1582,7 +1584,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1727,7 +1729,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1786,7 +1788,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -1902,7 +1904,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -1961,7 +1963,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2078,7 +2080,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2137,7 +2139,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2235,7 +2237,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2279,7 +2281,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2388,7 +2390,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2510,7 +2512,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2554,7 +2556,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, diff --git a/test/integrations/destinations/algolia/router/data.ts b/test/integrations/destinations/algolia/router/data.ts index adc7be1596f..c200e1234ee 100644 --- a/test/integrations/destinations/algolia/router/data.ts +++ b/test/integrations/destinations/algolia/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'algolia', @@ -265,7 +267,7 @@ export const data = [ metadata: { jobId: 3, userId: 'u1' }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [{ from: 'product clicked', to: 'cLick ' }], }, @@ -369,7 +371,7 @@ export const data = [ batched: false, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [{ from: 'product clicked', to: 'cLick ' }], }, @@ -2227,7 +2229,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2324,7 +2326,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2421,7 +2423,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2518,7 +2520,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2641,7 +2643,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2668,7 +2670,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2749,7 +2751,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2776,7 +2778,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2857,7 +2859,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2884,7 +2886,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -2965,7 +2967,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -2992,7 +2994,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3073,7 +3075,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3170,7 +3172,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3267,7 +3269,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3364,7 +3366,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3461,7 +3463,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3598,7 +3600,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -3645,7 +3647,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3726,7 +3728,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -3753,7 +3755,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3834,7 +3836,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -3861,7 +3863,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -3942,7 +3944,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4039,7 +4041,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4136,7 +4138,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4233,7 +4235,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4330,7 +4332,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { @@ -4481,7 +4483,7 @@ export const data = [ endpoint: 'https://insights.algolia.io/1/events', headers: { 'X-Algolia-Application-Id': 'O2YARRI15I', - 'X-Algolia-API-Key': 'dummyApiKey', + 'X-Algolia-API-Key': defaultApiKey, }, params: {}, files: {}, @@ -4548,7 +4550,7 @@ export const data = [ }, Config: { cdkV2Enabled: true, - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, applicationId: 'O2YARRI15I', eventTypeSettings: [ { diff --git a/test/integrations/destinations/autopilot/processor/data.ts b/test/integrations/destinations/autopilot/processor/data.ts index 135e3e22f74..0c4edb30203 100644 --- a/test/integrations/destinations/autopilot/processor/data.ts +++ b/test/integrations/destinations/autopilot/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'autopilot', @@ -23,7 +25,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -105,7 +107,7 @@ export const data = [ endpoint: 'https://api2.autopilothq.com/v1/contact', headers: { Accept: 'application/json', - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -160,7 +162,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -248,7 +250,7 @@ export const data = [ 'https://api2.autopilothq.com/v1/trigger/00XX/contact/testmp@rudderstack.com', headers: { Accept: 'application/json', - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -300,7 +302,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -426,7 +428,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -551,7 +553,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -675,7 +677,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -801,7 +803,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -881,7 +883,7 @@ export const data = [ endpoint: 'https://api2.autopilothq.com/v1/contact', headers: { Accept: 'application/json', - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -933,7 +935,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -1058,7 +1060,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', @@ -1177,7 +1179,7 @@ export const data = [ }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [ { from: '0001', diff --git a/test/integrations/destinations/autopilot/router/data.ts b/test/integrations/destinations/autopilot/router/data.ts index 92117a97c80..f05bb198902 100644 --- a/test/integrations/destinations/autopilot/router/data.ts +++ b/test/integrations/destinations/autopilot/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'autopilot', @@ -20,7 +22,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, @@ -76,7 +78,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, @@ -141,7 +143,7 @@ export const data = [ method: 'POST', endpoint: 'https://api2.autopilothq.com/v1/contact', headers: { - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -174,7 +176,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, @@ -191,7 +193,7 @@ export const data = [ endpoint: 'https://api2.autopilothq.com/v1/trigger/00XX/contact/testmp@rudderstack.com', headers: { - autopilotapikey: 'dummyApiKey', + autopilotapikey: defaultApiKey, 'Content-Type': 'application/json', Accept: 'application/json', }, @@ -218,7 +220,7 @@ export const data = [ Config: { excludeKeys: [], includeKeys: [] }, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, customMappings: [{ from: '0001', to: 'Signup' }], triggerId: '00XX', }, diff --git a/test/integrations/destinations/clicksend/dataDelivery/data.ts b/test/integrations/destinations/clicksend/dataDelivery/data.ts index cb3430af1d7..a6c79684051 100644 --- a/test/integrations/destinations/clicksend/dataDelivery/data.ts +++ b/test/integrations/destinations/clicksend/dataDelivery/data.ts @@ -1,10 +1,11 @@ import { generateMetadata, generateProxyV1Payload } from '../../../testUtils'; import { ProxyV1TestData } from '../../../testTypes'; import { defaultAccessToken } from '../../../common/secrets'; +import { secret1 } from '../maskedSecrets'; export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', - Authorization: 'dummy-key', + Authorization: secret1, }; export const contactPayload = { diff --git a/test/integrations/destinations/clicksend/network.ts b/test/integrations/destinations/clicksend/network.ts index aa1013d8169..e0cfbae8085 100644 --- a/test/integrations/destinations/clicksend/network.ts +++ b/test/integrations/destinations/clicksend/network.ts @@ -1,6 +1,8 @@ +import { secret1 } from './maskedSecrets'; + export const headerBlockWithCorrectAccessToken = { 'Content-Type': 'application/json', - Authorization: 'dummy-key', + Authorization: secret1, }; export const contactPayload = { diff --git a/test/integrations/destinations/clickup/maskedSecrets.ts b/test/integrations/destinations/clickup/maskedSecrets.ts new file mode 100644 index 00000000000..67e579d0869 --- /dev/null +++ b/test/integrations/destinations/clickup/maskedSecrets.ts @@ -0,0 +1,3 @@ +import path from 'path'; + +export const secretApiToken = path.basename(__dirname) + 1; diff --git a/test/integrations/destinations/clickup/processor/data.ts b/test/integrations/destinations/clickup/processor/data.ts index 686bf670e2e..e553c54711c 100644 --- a/test/integrations/destinations/clickup/processor/data.ts +++ b/test/integrations/destinations/clickup/processor/data.ts @@ -1,3 +1,5 @@ +import { secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'clickup', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', }, ID: 'clickup-1234', @@ -64,7 +66,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -122,7 +124,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -180,7 +182,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -238,7 +240,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -300,7 +302,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -358,7 +360,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { @@ -460,7 +462,7 @@ export const data = [ endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', headers: { 'Content-Type': 'application/json', - Authorization: 'pk_123', + Authorization: secretApiToken, }, params: {}, body: { @@ -557,7 +559,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', }, ID: 'clickup-1234', @@ -604,7 +606,7 @@ export const data = [ endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', headers: { 'Content-Type': 'application/json', - Authorization: 'pk_123', + Authorization: secretApiToken, }, params: {}, body: { @@ -637,7 +639,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', whitelistedEvents: [ { @@ -698,7 +700,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', whitelistedEvents: [ { @@ -759,7 +761,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', }, ID: 'clickup-1234', @@ -795,7 +797,7 @@ export const data = [ endpoint: 'https://api.clickup.com/api/v2/list/correctListId456/task', headers: { 'Content-Type': 'application/json', - Authorization: 'pk_123', + Authorization: secretApiToken, }, params: {}, body: { diff --git a/test/integrations/destinations/clickup/router/data.ts b/test/integrations/destinations/clickup/router/data.ts index b77cb90b473..8306081ff91 100644 --- a/test/integrations/destinations/clickup/router/data.ts +++ b/test/integrations/destinations/clickup/router/data.ts @@ -1,3 +1,5 @@ +import { secretApiToken } from '../maskedSecrets'; + export const data = [ { name: 'clickup', @@ -12,7 +14,7 @@ export const data = [ { description: 'Creating task using listId from externalId array', destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: { jobId: 1, userId: 'u1' }, @@ -28,7 +30,7 @@ export const data = [ { description: 'Creating task with assignees', destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: { jobId: 2, userId: 'u1' }, @@ -52,7 +54,7 @@ export const data = [ description: 'Creating task with valid custom fields values', destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [ { from: 'industry', to: 'Industry' }, @@ -111,7 +113,7 @@ export const data = [ description: 'Custom field: Invalid location latitude', destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [{ from: 'location', to: 'Location' }], }, @@ -147,14 +149,14 @@ export const data = [ body: { FORM: {}, JSON: { name: 'anonymous page visit' }, JSON_ARRAY: {}, XML: {} }, endpoint: 'https://api.clickup.com/api/v2/list/correctListId456/task', files: {}, - headers: { Authorization: 'pk_123', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiToken, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', version: '1', }, destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: [{ jobId: 1, userId: 'u1' }], @@ -171,14 +173,14 @@ export const data = [ }, endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', files: {}, - headers: { Authorization: 'pk_123', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiToken, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', version: '1', }, destination: { - Config: { apiToken: 'pk_123', listId: 'correctListId123' }, + Config: { apiToken: secretApiToken, listId: 'correctListId123' }, ID: 'clickup-1234', }, metadata: [{ jobId: 2, userId: 'u1' }], @@ -244,7 +246,7 @@ export const data = [ }, endpoint: 'https://api.clickup.com/api/v2/list/correctListId123/task', files: {}, - headers: { Authorization: 'pk_123', 'Content-Type': 'application/json' }, + headers: { Authorization: secretApiToken, 'Content-Type': 'application/json' }, method: 'POST', params: {}, type: 'REST', @@ -252,7 +254,7 @@ export const data = [ }, destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, keyToCustomFieldName: [ { from: 'industry', to: 'Industry' }, { from: 'Payment Status', to: 'Payment Status' }, @@ -276,7 +278,7 @@ export const data = [ { destination: { Config: { - apiToken: 'pk_123', + apiToken: secretApiToken, listId: 'correctListId123', keyToCustomFieldName: [{ from: 'location', to: 'Location' }], }, diff --git a/test/integrations/destinations/dynamic_yield/processor/data.ts b/test/integrations/destinations/dynamic_yield/processor/data.ts index f72f1574f71..76537a589b2 100644 --- a/test/integrations/destinations/dynamic_yield/processor/data.ts +++ b/test/integrations/destinations/dynamic_yield/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'dynamic_yield', @@ -32,7 +34,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: true, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -62,7 +64,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -126,7 +128,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -156,7 +158,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -233,7 +235,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -263,7 +265,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -326,7 +328,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -356,7 +358,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -433,7 +435,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -463,7 +465,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -541,7 +543,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -571,7 +573,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -667,7 +669,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, hashEmail: false, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, @@ -697,7 +699,7 @@ export const data = [ endpoint: 'https://dy-api.com/v2/collect/user/event', headers: { 'Content-Type': 'application/json', - 'DY-API-Key': 'dummyApiKey', + 'DY-API-Key': defaultApiKey, }, params: {}, body: { @@ -774,7 +776,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -845,7 +847,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, @@ -999,7 +1001,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, DestinationDefinition: { Config: { cdkV2Enabled: true } }, }, diff --git a/test/integrations/destinations/iterable/deleteUsers/data.ts b/test/integrations/destinations/iterable/deleteUsers/data.ts index 9e7eab1ee13..b20708134d8 100644 --- a/test/integrations/destinations/iterable/deleteUsers/data.ts +++ b/test/integrations/destinations/iterable/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + const destType = 'iterable'; export const data = [ @@ -50,7 +52,7 @@ export const data = [ }, ], config: { - apiToken: 'dummyApiKey', + apiToken: defaultApiKey, }, }, ], @@ -88,7 +90,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, ], @@ -165,7 +167,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, ], @@ -200,7 +202,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, dataCenter: 'EUDC', }, }, diff --git a/test/integrations/destinations/iterable/network.ts b/test/integrations/destinations/iterable/network.ts index 1cf26dfd4f4..06f7167ee27 100644 --- a/test/integrations/destinations/iterable/network.ts +++ b/test/integrations/destinations/iterable/network.ts @@ -1,10 +1,12 @@ +import { defaultApiKey } from '../../common/secrets'; + const deleteNwData = [ { httpReq: { method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder1', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -21,7 +23,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder2', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -76,7 +78,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder5', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -93,7 +95,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.iterable.com/api/users/byUserId/rudder6', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { @@ -110,7 +112,7 @@ const deleteNwData = [ method: 'delete', url: 'https://api.eu.iterable.com/api/users/byUserId/rudder7', headers: { - api_key: 'dummyApiKey', + api_key: defaultApiKey, }, }, httpRes: { diff --git a/test/integrations/destinations/lytics/processor/data.ts b/test/integrations/destinations/lytics/processor/data.ts index dd5511140aa..3fc30d20c20 100644 --- a/test/integrations/destinations/lytics/processor/data.ts +++ b/test/integrations/destinations/lytics/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'lytics', @@ -113,7 +115,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -137,7 +139,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -266,7 +268,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -290,7 +292,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -381,7 +383,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -405,7 +407,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -489,7 +491,7 @@ export const data = [ destination: { ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -513,7 +515,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -596,7 +598,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -620,7 +622,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -703,7 +705,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -727,7 +729,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -810,7 +812,7 @@ export const data = [ metadata: { destinationID: 'ewksfdgDFSdvzsdmwsdfvcxj' }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -897,7 +899,7 @@ export const data = [ metadata: { destinationID: 'ewksfdgDFSdvzsdmwsdfvcxj' }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1043,7 +1045,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1067,7 +1069,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1187,7 +1189,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1211,7 +1213,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1287,7 +1289,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1311,7 +1313,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1397,7 +1399,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1421,7 +1423,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -1507,7 +1509,7 @@ export const data = [ }, destination: { DestinationDefinition: { Config: { cdkV2Enabled: true } }, - Config: { apiKey: 'dummyApiKey', stream: 'default' }, + Config: { apiKey: defaultApiKey, stream: 'default' }, Enabled: true, Transformations: [], IsProcessorEnabled: true, @@ -1531,7 +1533,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey', + endpoint: `https://api.lytics.io/collect/json/default?access_token=${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { diff --git a/test/integrations/destinations/mailmodo/processor/data.ts b/test/integrations/destinations/mailmodo/processor/data.ts index 45a14e2a52e..70e21f816c9 100644 --- a/test/integrations/destinations/mailmodo/processor/data.ts +++ b/test/integrations/destinations/mailmodo/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'mailmodo', @@ -9,7 +11,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, message: { event: 'trackevent', type: 'track', @@ -72,7 +74,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addEvent', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { email: 'firstUser@testmail.com', event_name: 'trackevent' }, @@ -264,7 +266,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'page', event: 'Email Opened', @@ -317,7 +319,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: '' } }, + destination: { Config: { apiKey: defaultApiKey, listName: '' } }, message: { type: 'identify', event: 'Email Opened', @@ -351,7 +353,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { listName: 'Rudderstack', values: [{ email: 'test3@abc.com' }] }, @@ -378,7 +380,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', event: 'Email Opened', @@ -412,7 +414,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { listName: 'abcdef', values: [{ email: 'test3@abc.com' }] }, @@ -439,7 +441,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', event: 'Email Opened', @@ -493,7 +495,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', userId: 'identified user id', @@ -530,7 +532,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { @@ -575,7 +577,7 @@ export const data = [ request: { body: [ { - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abcdef' } }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abcdef' } }, message: { type: 'identify', userId: 'identified user id', @@ -612,7 +614,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, params: {}, body: { JSON: { diff --git a/test/integrations/destinations/mailmodo/router/data.ts b/test/integrations/destinations/mailmodo/router/data.ts index 3b492b0a827..36f25c8e384 100644 --- a/test/integrations/destinations/mailmodo/router/data.ts +++ b/test/integrations/destinations/mailmodo/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'mailmodo', @@ -28,7 +30,7 @@ export const data = [ originalTimestamp: '2020-08-28T16:26:06.468Z', }, metadata: { jobId: 2, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { message: { @@ -49,7 +51,7 @@ export const data = [ originalTimestamp: '2020-08-28T16:26:06.468Z', }, metadata: { jobId: 3, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { message: { @@ -72,7 +74,7 @@ export const data = [ timestamp: '2020-02-02T00:23:09.544Z', }, metadata: { jobId: 4, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { message: { @@ -92,7 +94,7 @@ export const data = [ originalTimestamp: '2020-08-28T16:26:06.468Z', }, metadata: { jobId: 5, userId: 'u1' }, - destination: { Config: { apiKey: 'dummyApiKey', listName: '' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: '' }, Enabled: true }, }, ], destType: 'mailmodo', @@ -133,7 +135,7 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, version: '1', endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch', }, @@ -143,7 +145,7 @@ export const data = [ ], batched: true, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { batchedRequest: { @@ -166,14 +168,14 @@ export const data = [ files: {}, method: 'POST', params: {}, - headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' }, + headers: { mmApiKey: defaultApiKey, 'Content-Type': 'application/json' }, version: '1', endpoint: 'https://api.mailmodo.com/api/v1/addEvent', }, metadata: [{ jobId: 3, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: 'abc' }, Enabled: true }, }, { batched: false, @@ -189,7 +191,7 @@ export const data = [ module: 'destination', }, statusCode: 400, - destination: { Config: { apiKey: 'dummyApiKey', listName: '' }, Enabled: true }, + destination: { Config: { apiKey: defaultApiKey, listName: '' }, Enabled: true }, }, ], }, diff --git a/test/integrations/destinations/mp/deleteUsers/data.ts b/test/integrations/destinations/mp/deleteUsers/data.ts index 7905e3767e0..fdd0413e097 100644 --- a/test/integrations/destinations/mp/deleteUsers/data.ts +++ b/test/integrations/destinations/mp/deleteUsers/data.ts @@ -1,3 +1,4 @@ +import { defaultApiKey } from '../../../common/secrets'; import { secret4 } from '../maskedSecrets'; export const data = [ @@ -3101,7 +3102,7 @@ export const data = [ }, ], config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, prefixProperties: true, useNativeSDK: false, }, diff --git a/test/integrations/destinations/ometria/processor/data.ts b/test/integrations/destinations/ometria/processor/data.ts index 66cfee4e4ec..6f70c37efad 100644 --- a/test/integrations/destinations/ometria/processor/data.ts +++ b/test/integrations/destinations/ometria/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ometria', @@ -55,7 +57,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -77,7 +79,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -164,7 +166,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -186,7 +188,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -272,7 +274,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -294,7 +296,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -383,7 +385,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'NOT_SPECIFIED', @@ -405,7 +407,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -496,7 +498,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'NOT_SPECIFIED', @@ -518,7 +520,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -603,7 +605,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -620,7 +622,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -704,7 +706,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -721,7 +723,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -814,7 +816,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -831,7 +833,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -932,7 +934,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -949,7 +951,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -1059,7 +1061,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -1076,7 +1078,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -1190,7 +1192,7 @@ export const data = [ integrations: { All: true }, sentAt: '2019-10-14T09:03:22.563Z', }, - destination: { Config: { apiKey: 'dummyApiKey' } }, + destination: { Config: { apiKey: defaultApiKey } }, }, ], method: 'POST', @@ -1207,7 +1209,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, diff --git a/test/integrations/destinations/ometria/router/data.ts b/test/integrations/destinations/ometria/router/data.ts index 95b88c46130..246a23c5d5f 100644 --- a/test/integrations/destinations/ometria/router/data.ts +++ b/test/integrations/destinations/ometria/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ometria', @@ -103,7 +105,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -207,7 +209,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', @@ -234,7 +236,7 @@ export const data = [ type: 'REST', method: 'POST', endpoint: 'https://api.ometria.com/v2/push', - headers: { 'X-Ometria-Auth': 'dummyApiKey' }, + headers: { 'X-Ometria-Auth': defaultApiKey }, params: {}, body: { JSON: {}, @@ -313,7 +315,7 @@ export const data = [ ResponseRules: {}, }, Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, allowMarketing: false, allowTransactional: false, marketingOptin: 'EXPLICITLY_OPTEDOUT', diff --git a/test/integrations/destinations/ortto/processor/data.ts b/test/integrations/destinations/ortto/processor/data.ts index ff84f5dbbd1..903765a94b5 100644 --- a/test/integrations/destinations/ortto/processor/data.ts +++ b/test/integrations/destinations/ortto/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ortto', @@ -18,7 +20,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -149,7 +151,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/person/merge', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -219,7 +221,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -383,7 +385,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -542,7 +544,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, orttoEventsMapping: [ { rsEventName: 'RudderEvent', @@ -868,7 +870,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -1006,7 +1008,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/activities/create', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -1084,7 +1086,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -1221,7 +1223,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/activities/create', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -1296,7 +1298,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { diff --git a/test/integrations/destinations/ortto/router/data.ts b/test/integrations/destinations/ortto/router/data.ts index 8999637a669..0e94045e544 100644 --- a/test/integrations/destinations/ortto/router/data.ts +++ b/test/integrations/destinations/ortto/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'ortto', @@ -19,7 +21,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -140,7 +142,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -314,7 +316,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/person/merge', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -338,7 +340,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { @@ -424,7 +426,7 @@ export const data = [ method: 'POST', endpoint: 'https://api.ap3api.com/v1/activities/create', headers: { - 'X-Api-Key': 'dummyApiKey', + 'X-Api-Key': defaultApiKey, 'Content-Type': 'application/json', }, params: {}, @@ -448,7 +450,7 @@ export const data = [ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', Name: 'ORTTO', Config: { - privateApiKey: 'dummyApiKey', + privateApiKey: defaultApiKey, instanceRegion: 'other', orttoEventsMapping: [ { diff --git a/test/integrations/destinations/persistiq/processor/data.ts b/test/integrations/destinations/persistiq/processor/data.ts index 05bafe6123f..b4f07ea7cc9 100644 --- a/test/integrations/destinations/persistiq/processor/data.ts +++ b/test/integrations/destinations/persistiq/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'persistiq', @@ -43,7 +45,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [ { from: 'useroccupation', @@ -87,7 +89,7 @@ export const data = [ files: {}, userId: '', headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, method: 'PATCH', params: {}, @@ -140,7 +142,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [ { from: 'useroccupation', @@ -189,7 +191,7 @@ export const data = [ files: {}, userId: '', headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, method: 'POST', params: {}, @@ -224,7 +226,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -285,7 +287,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -339,7 +341,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -400,7 +402,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -429,7 +431,7 @@ export const data = [ method: 'POST', params: {}, headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, version: '1', endpoint: 'https://api.persistiq.com/v1/campaigns/testgroup1/leads', @@ -472,7 +474,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, }, }, }, @@ -498,7 +500,7 @@ export const data = [ method: 'DELETE', params: {}, headers: { - 'x-api-key': 'dummyApiKey', + 'x-api-key': defaultApiKey, }, version: '1', endpoint: 'https://api.persistiq.com/v1/campaigns/testgroup1/leads/lel1c5u1wuk8', @@ -547,7 +549,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [ { from: 'useroccupation', diff --git a/test/integrations/destinations/persistiq/router/data.ts b/test/integrations/destinations/persistiq/router/data.ts index ddb39b90280..12208aaf411 100644 --- a/test/integrations/destinations/persistiq/router/data.ts +++ b/test/integrations/destinations/persistiq/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'persistiq', @@ -37,7 +39,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, }, @@ -79,7 +81,7 @@ export const data = [ }, endpoint: 'https://api.persistiq.com/v1/leads/lel1c5u1wuk8', files: {}, - headers: { 'x-api-key': 'dummyApiKey' }, + headers: { 'x-api-key': defaultApiKey }, method: 'PATCH', params: {}, type: 'REST', @@ -87,7 +89,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, persistIqAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }], }, }, diff --git a/test/integrations/destinations/profitwell/maskedSecrets.ts b/test/integrations/destinations/profitwell/maskedSecrets.ts new file mode 100644 index 00000000000..fa268ef78c3 --- /dev/null +++ b/test/integrations/destinations/profitwell/maskedSecrets.ts @@ -0,0 +1,3 @@ +import path from 'path'; + +export const secretApiKey = path.basename(__dirname) + 1; diff --git a/test/integrations/destinations/profitwell/processor/data.ts b/test/integrations/destinations/profitwell/processor/data.ts index 58bd2ed35fb..57b2194f9ce 100644 --- a/test/integrations/destinations/profitwell/processor/data.ts +++ b/test/integrations/destinations/profitwell/processor/data.ts @@ -1,3 +1,5 @@ +import { secretApiKey } from '../maskedSecrets'; + export const data = [ { name: 'profitwell', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -92,7 +94,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -179,7 +181,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -241,7 +243,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -281,7 +283,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -362,7 +364,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -450,7 +452,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -518,7 +520,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -559,7 +561,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -652,7 +654,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -725,7 +727,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -761,7 +763,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -854,7 +856,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -927,7 +929,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { @@ -1053,7 +1055,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -1147,7 +1149,7 @@ export const data = [ { destination: { Config: { - privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62', + privateApiKey: secretApiKey, }, }, message: { @@ -1210,7 +1212,7 @@ export const data = [ endpoint: 'https://api.profitwell.com/v2/subscriptions/', headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, params: {}, body: { diff --git a/test/integrations/destinations/profitwell/router/data.ts b/test/integrations/destinations/profitwell/router/data.ts index b308155dae8..fbd82cfe392 100644 --- a/test/integrations/destinations/profitwell/router/data.ts +++ b/test/integrations/destinations/profitwell/router/data.ts @@ -1,3 +1,5 @@ +import { secretApiKey } from '../maskedSecrets'; + export const data = [ { name: 'profitwell', @@ -10,7 +12,7 @@ export const data = [ body: { input: [ { - destination: { Config: { privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62' } }, + destination: { Config: { privateApiKey: secretApiKey } }, metadata: { jobId: 2, userId: 'u1' }, message: { channel: 'web', @@ -81,7 +83,7 @@ export const data = [ params: {}, headers: { 'Content-Type': 'application/json', - Authorization: '9270161a8e5abaa0e56efddfd9dbcb62', + Authorization: secretApiKey, }, version: '1', endpoint: 'https://api.profitwell.com/v2/subscriptions/', @@ -89,7 +91,7 @@ export const data = [ metadata: [{ jobId: 2, userId: 'u1' }], batched: false, statusCode: 200, - destination: { Config: { privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62' } }, + destination: { Config: { privateApiKey: secretApiKey } }, }, ], }, diff --git a/test/integrations/destinations/signl4/processor/data.ts b/test/integrations/destinations/signl4/processor/data.ts index 11dc6fbadb6..3a3105bdeca 100644 --- a/test/integrations/destinations/signl4/processor/data.ts +++ b/test/integrations/destinations/signl4/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'signl4', @@ -37,7 +39,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -66,7 +68,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -132,7 +134,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -161,7 +163,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -236,7 +238,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: '', s4ServiceProperty: 's4Service', s4LocationValue: '', @@ -265,7 +267,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -340,7 +342,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'defaultServiceValue', s4ServiceProperty: 's4Service', s4LocationValue: 'defaultLocationValue', @@ -369,7 +371,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -435,7 +437,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -591,7 +593,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -669,7 +671,7 @@ export const data = [ }, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', diff --git a/test/integrations/destinations/signl4/router/data.ts b/test/integrations/destinations/signl4/router/data.ts index 0fcf55d0465..af93571158e 100644 --- a/test/integrations/destinations/signl4/router/data.ts +++ b/test/integrations/destinations/signl4/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'signl4', @@ -12,7 +14,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -71,7 +73,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://connect.signl4.com/webhook/dummyApiKey', + endpoint: `https://connect.signl4.com/webhook/${defaultApiKey}`, headers: { 'Content-Type': 'application/json' }, params: {}, body: { @@ -97,7 +99,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -131,7 +133,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', @@ -188,7 +190,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, s4ServiceValue: 'service', s4ServiceProperty: '', s4LocationValue: '67.3, 32.3', diff --git a/test/integrations/destinations/singular/processor/data.ts b/test/integrations/destinations/singular/processor/data.ts index 6e749dd0a01..7daac907101 100644 --- a/test/integrations/destinations/singular/processor/data.ts +++ b/test/integrations/destinations/singular/processor/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'singular', @@ -11,7 +13,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -135,7 +137,7 @@ export const data = [ install_time: 1630511211, update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -159,7 +161,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -273,7 +275,7 @@ export const data = [ receipt_signature: '1234dfghnh', purchase_product_id: '789', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, e: { url: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', install: 'SM-G935F', @@ -320,7 +322,7 @@ export const data = [ amt: 6.9, asid: 'IISqwYJKoZIcNqts0jvcNvPc', receipt_signature: '1234dfghnh', - a: 'dummyApiKey', + a: defaultApiKey, c: 'wifi', e: { url: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', @@ -361,7 +363,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -470,7 +472,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -588,7 +590,7 @@ export const data = [ openuri: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', install_source: '', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -612,7 +614,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -721,7 +723,7 @@ export const data = [ receipt_signature: '1234dfghnh', amt: 20, is_revenue_event: true, - a: 'dummyApiKey', + a: defaultApiKey, c: 'wifi', e: { url: 'myapp%3A%2F%2Fhome%2Fpage%3Fqueryparam1%3Dvalue1', @@ -763,7 +765,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -875,7 +877,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -988,7 +990,7 @@ export const data = [ install_time: 1630511211, update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1012,7 +1014,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1125,7 +1127,7 @@ export const data = [ install_time: 1630511211, update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1149,7 +1151,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1255,7 +1257,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1376,7 +1378,7 @@ export const data = [ idfv: 'fc8d449516de0dfb', install_time: 1630511211, update_time: 1630511211, - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1400,7 +1402,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1509,7 +1511,7 @@ export const data = [ purchase_transaction_id: '2134dfg', idfa: '8ecd7512-2864-440c-93f3-a3cabe62525b', idfv: 'fc8d449516de0dfb', - a: 'dummyApiKey', + a: defaultApiKey, c: 'carrier', e: { asid: 'IISqwYJKoZIcNqts0jvcNvPc', @@ -1554,7 +1556,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1669,7 +1671,7 @@ export const data = [ idfv: 'fc8d449516de0dfb', install_time: 1630511211, update_time: 1630511211, - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -1693,7 +1695,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1804,7 +1806,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1915,7 +1917,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -1992,7 +1994,7 @@ export const data = [ endpoint: 'https://s2s.singular.net/api/v1/launch', headers: {}, params: { - a: 'dummyApiKey', + a: defaultApiKey, av: '1.1.5.581823alpha', data_sharing_options: '%7B%22limit_data_sharing%22%3Atrue%7D', i: 'com.singular.game', @@ -2028,7 +2030,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -2137,7 +2139,7 @@ export const data = [ cur: 'USD', amt: 28, purchase_product_id: '789', - a: 'dummyApiKey', + a: defaultApiKey, install_source: 'selfdistributed', os: 'metaquest_pro', p: 'metaquest', @@ -2172,7 +2174,7 @@ export const data = [ amt: 6.9, os: 'metaquest_pro', p: 'metaquest', - a: 'dummyApiKey', + a: defaultApiKey, sdid: '49c2d3a6-326e-4ec5-a16b-0a47e34ed953', ua: 'Mozilla/5.0 (Nintendo Switch; WebApplet) AppleWebKit/613.0 (KHTML, like Gecko) NF/6.0.3.25.0 NintendoBrowser/5.1.0.32061', ve: 'qst2-2023h2', diff --git a/test/integrations/destinations/singular/router/data.ts b/test/integrations/destinations/singular/router/data.ts index 9074ef2fdc8..f3aba585780 100644 --- a/test/integrations/destinations/singular/router/data.ts +++ b/test/integrations/destinations/singular/router/data.ts @@ -1,3 +1,5 @@ +import { defaultApiKey } from '../../../common/secrets'; + export const data = [ { name: 'singular', @@ -12,7 +14,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -140,7 +142,7 @@ export const data = [ update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -150,7 +152,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -177,7 +179,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -305,7 +307,7 @@ export const data = [ update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -315,7 +317,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -342,7 +344,7 @@ export const data = [ { destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, @@ -470,7 +472,7 @@ export const data = [ update_time: 1630511211, ua: 'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)', c: 'wifi', - a: 'dummyApiKey', + a: defaultApiKey, }, body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} }, files: {}, @@ -480,7 +482,7 @@ export const data = [ statusCode: 200, destination: { Config: { - apiKey: 'dummyApiKey', + apiKey: defaultApiKey, sessionEventList: [ { sessionEventName: 'mysessionevent' }, { sessionEventName: 'randomuser' }, diff --git a/test/integrations/destinations/sprig/deleteUsers/data.ts b/test/integrations/destinations/sprig/deleteUsers/data.ts index 7ab5620e66c..db5af989150 100644 --- a/test/integrations/destinations/sprig/deleteUsers/data.ts +++ b/test/integrations/destinations/sprig/deleteUsers/data.ts @@ -1,3 +1,5 @@ +import { secret1, secretInvalid } from '../maskedSecrets'; + export const data = [ { name: 'sprig', @@ -57,7 +59,7 @@ export const data = [ }, ], config: { - apiKey: 'invalidApiKey', + apiKey: secretInvalid, }, }, ], @@ -119,7 +121,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], @@ -154,7 +156,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], @@ -196,7 +198,7 @@ export const data = [ }, ], config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, ], diff --git a/test/integrations/destinations/sprig/maskedSecrets.ts b/test/integrations/destinations/sprig/maskedSecrets.ts new file mode 100644 index 00000000000..b0273d7671f --- /dev/null +++ b/test/integrations/destinations/sprig/maskedSecrets.ts @@ -0,0 +1,6 @@ +import path from 'path'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretInvalid = path.basename(__dirname) + 2; +export const authHeader1 = `API-Key ${secret1}`; +export const authHeaderInvalid = `API-Key ${secretInvalid}`; diff --git a/test/integrations/destinations/sprig/network.ts b/test/integrations/destinations/sprig/network.ts index e5f2ff23b1e..67f3e877102 100644 --- a/test/integrations/destinations/sprig/network.ts +++ b/test/integrations/destinations/sprig/network.ts @@ -1,3 +1,5 @@ +import { authHeader1, authHeaderInvalid } from './maskedSecrets'; + const deleteNwData = [ { httpReq: { @@ -8,7 +10,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key invalidApiKey', + Authorization: authHeaderInvalid, 'Content-Type': 'application/json', }, }, @@ -26,7 +28,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, @@ -44,7 +46,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, @@ -64,7 +66,7 @@ const deleteNwData = [ }, headers: { Accept: 'application/json', - Authorization: 'API-Key testApiKey', + Authorization: authHeader1, 'Content-Type': 'application/json', }, }, diff --git a/test/integrations/destinations/sprig/processor/data.ts b/test/integrations/destinations/sprig/processor/data.ts index 6b99e5e13b6..cadddaecf9c 100644 --- a/test/integrations/destinations/sprig/processor/data.ts +++ b/test/integrations/destinations/sprig/processor/data.ts @@ -1,3 +1,5 @@ +import { authHeader1, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'sprig', @@ -29,7 +31,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -97,7 +99,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -227,7 +229,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -293,7 +295,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -317,7 +319,7 @@ export const data = [ endpoint: 'https://api.sprig.com/v2/users', headers: { accept: 'application/json', - authorization: 'API-Key testApiKey', + authorization: authHeader1, 'content-type': 'application/json', }, body: { @@ -379,7 +381,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -447,7 +449,7 @@ export const data = [ }, }, Config: { - apiKey: 'testApiKey', + apiKey: secret1, }, }, metadata: { @@ -471,7 +473,7 @@ export const data = [ endpoint: 'https://api.sprig.com/v2/users', headers: { accept: 'application/json', - authorization: 'API-Key testApiKey', + authorization: authHeader1, 'content-type': 'application/json', }, body: { From 2c67c9abe6ca50320bea195d22bc00f70ee65ddf Mon Sep 17 00:00:00 2001 From: Mahesh Kutty <39219085+maheshkutty@users.noreply.github.com> Date: Thu, 6 Mar 2025 14:50:24 +0530 Subject: [PATCH 135/160] fix(destination): use coql api to delete record for zoho (#4134) * fix(destination): use coql api to delete record for zoho * fix: use identifier to create coql query * fix: limiting where clause criteria to 25 * fix: test * fix: code duplication --- .../v2/destinations/zoho/transformRecord.js | 12 +- .../v2/destinations/zoho/transformRecordV2.js | 17 +- src/cdk/v2/destinations/zoho/utils.js | 151 +++++---- src/cdk/v2/destinations/zoho/utils.test.js | 301 ++++++++++++----- test/integrations/destinations/zoho/common.ts | 4 +- .../integrations/destinations/zoho/network.ts | 319 ++++-------------- .../destinations/zoho/router/deletion.ts | 261 +++++++++++++- 7 files changed, 649 insertions(+), 416 deletions(-) diff --git a/src/cdk/v2/destinations/zoho/transformRecord.js b/src/cdk/v2/destinations/zoho/transformRecord.js index 952c38d6113..1e21f9ad817 100644 --- a/src/cdk/v2/destinations/zoho/transformRecord.js +++ b/src/cdk/v2/destinations/zoho/transformRecord.js @@ -201,10 +201,17 @@ const handleDeletion = async ( fields, Config, operationModuleType, + identifierType, transformedResponseToBeBatched, errorResponseList, ) => { - const searchResponse = await searchRecordId(fields, input.metadata, Config, operationModuleType); + const searchResponse = await searchRecordId( + fields, + input.metadata, + Config, + operationModuleType, + identifierType, + ); if (searchResponse.erroneous) { const error = handleSearchError(searchResponse); @@ -230,6 +237,7 @@ const handleDeletion = async ( const processInput = async ( input, operationModuleType, + identifierType, Config, transformedResponseToBeBatched, errorResponseList, @@ -257,6 +265,7 @@ const processInput = async ( fields, Config, operationModuleType, + identifierType, transformedResponseToBeBatched, errorResponseList, ); @@ -311,6 +320,7 @@ const processRecordInputs = async (inputs, destination) => { processInput( input, operationModuleType, + identifierType, Config, transformedResponseToBeBatched, errorResponseList, diff --git a/src/cdk/v2/destinations/zoho/transformRecordV2.js b/src/cdk/v2/destinations/zoho/transformRecordV2.js index 538de09d658..44874235f08 100644 --- a/src/cdk/v2/destinations/zoho/transformRecordV2.js +++ b/src/cdk/v2/destinations/zoho/transformRecordV2.js @@ -186,6 +186,11 @@ const handleSearchError = (searchResponse) => { REFRESH_TOKEN, ); } + if (searchResponse.message.code === 'INSTRUMENTATION_ERROR') { + return new InstrumentationError( + `failed to fetch zoho id for record for: ${searchResponse.message}`, + ); + } return new ConfigurationError( `failed to fetch zoho id for record for ${JSON.stringify(searchResponse.message)}`, ); @@ -202,13 +207,13 @@ const handleSearchError = (searchResponse) => { */ const handleDeletion = async ( input, - fields, + identifiers, Config, destConfig, transformedResponseToBeBatched, errorResponseList, ) => { - const searchResponse = await searchRecordIdV2(fields, input.metadata, Config, destConfig); + const searchResponse = await searchRecordIdV2(identifiers, input.metadata, Config, destConfig); if (searchResponse.erroneous) { const error = handleSearchError(searchResponse); @@ -259,9 +264,15 @@ const processInput = async ( errorResponseList, ); } else { + if (isEmptyObject(identifiers)) { + const error = new InstrumentationError('`identifiers` cannot be empty'); + errorResponseList.push(handleRtTfSingleEventError(input, error, {})); + return; + } + await handleDeletion( input, - allFields, + identifiers, Config, destConfig, transformedResponseToBeBatched, diff --git a/src/cdk/v2/destinations/zoho/utils.js b/src/cdk/v2/destinations/zoho/utils.js index e6623f0abe4..3260a44738b 100644 --- a/src/cdk/v2/destinations/zoho/utils.js +++ b/src/cdk/v2/destinations/zoho/utils.js @@ -3,6 +3,7 @@ const { isDefinedAndNotNull, ConfigurationError, isDefinedAndNotNullAndNotEmpty, + removeUndefinedNullEmptyExclBoolInt, } = require('@rudderstack/integrations-lib'); const { getDestinationExternalIDInfoForRetl, isHttpStatusSuccess } = require('../../../../v0/util'); const zohoConfig = require('./config'); @@ -129,48 +130,76 @@ const handleDuplicateCheckV2 = (addDefaultDuplicateCheck, identifierType, operat return Array.from(new Set([...identifierType, ...additionalFields])); }; -function escapeAndEncode(value) { - return encodeURIComponent(value.replace(/([(),\\])/g, '\\$1')); -} - -function transformToURLParams(fields, Config, operationModuleType) { - const criteria = Object.entries(fields) - .map(([key, value]) => `(${key}:equals:${escapeAndEncode(value)})`) - .join('and'); - - const dataCenter = Config.region; - const regionBasedEndPoint = zohoConfig.DATA_CENTRE_BASE_ENDPOINTS_MAP[dataCenter]; +// Zoho has limitation that where clause should be formatted in a specific way +// ref: https://www.zoho.com/crm/developer/docs/api/v6/COQL-Limitations.html +const groupConditions = (conditions) => { + if (conditions.length === 1) { + return conditions[0]; // No need for grouping with a single condition + } + if (conditions.length === 2) { + return `(${conditions[0]} AND ${conditions[1]})`; // Base case + } + return `(${groupConditions(conditions.slice(0, 2))} AND ${groupConditions(conditions.slice(2))})`; +}; - return `${regionBasedEndPoint}/crm/v6/${operationModuleType}/search?criteria=${criteria}`; -} +// supported data type in where clause +// ref: https://help.zoho.com/portal/en/kb/creator/developer-guide/forms/add-and-manage-fields/articles/understand-fields#Types_of_fields +// ref: https://www.zoho.com/crm/developer/docs/api/v6/Get-Records-through-COQL-Query.html +const generateWhereClause = (fields) => { + const conditions = Object.keys(removeUndefinedNullEmptyExclBoolInt(fields)).map((key) => { + const value = fields[key]; + if (Array.isArray(value)) { + return `${key} = '${value.join(';')}'`; + } + if (typeof value === 'number') { + return `${key} = ${value}`; + } + return `${key} = '${value}'`; + }); -function transformToURLParamsV2(fields, Config, object) { - const criteria = Object.entries(fields) - .map(([key, value]) => `(${key}:equals:${escapeAndEncode(value)})`) - .join('and'); + return conditions.length > 0 ? `WHERE ${groupConditions(conditions)}` : ''; +}; - const dataCenter = Config.region; - const regionBasedEndPoint = zohoConfig.DATA_CENTRE_BASE_ENDPOINTS_MAP[dataCenter]; +const generateSqlQuery = (module, fields) => { + // Generate the WHERE clause based on the fields + // Limiting to 25 fields + const entries = Object.entries(fields).slice(0, 25); + const whereClause = generateWhereClause(Object.fromEntries(entries)); + if (whereClause === '') { + return ''; + } - return `${regionBasedEndPoint}/crm/v6/${object}/search?criteria=${criteria}`; -} + // Construct the SQL query with specific fields in the SELECT clause + return `SELECT id FROM ${module} ${whereClause}`; +}; -const searchRecordId = async (fields, metadata, Config, operationModuleType) => { +const sendCOQLRequest = async (region, accessToken, object, selectQuery) => { try { - const searchURL = transformToURLParams(fields, Config, operationModuleType); + if (selectQuery === '') { + return { + erroneous: true, + code: 'INSTRUMENTATION_ERROR', + message: `Identifier values are not provided for ${object}`, + }; + } + + const searchURL = `${zohoConfig.DATA_CENTRE_BASE_ENDPOINTS_MAP[region]}/crm/v6/coql`; const searchResult = await handleHttpRequest( - 'get', + 'post', searchURL, + { + select_query: selectQuery, + }, { headers: { - Authorization: `Zoho-oauthtoken ${metadata.secret.accessToken}`, + Authorization: `Zoho-oauthtoken ${accessToken}`, }, }, { destType: 'zoho', feature: 'deleteRecords', - requestMethod: 'GET', - endpointPath: `crm/v6/${operationModuleType}/search?criteria=`, + requestMethod: 'POST', + endpointPath: searchURL, module: 'router', }, ); @@ -188,7 +217,7 @@ const searchRecordId = async (fields, metadata, Config, operationModuleType) => ) { return { erroneous: true, - message: 'No contact is found with record details', + message: `No ${object} is found with record details`, }; } @@ -204,48 +233,36 @@ const searchRecordId = async (fields, metadata, Config, operationModuleType) => } }; -const searchRecordIdV2 = async (fields, metadata, Config, destConfig) => { +const searchRecordId = async (fields, metadata, Config, operationModuleType, identifierType) => { try { - const { object } = destConfig; - const searchURL = transformToURLParamsV2(fields, Config, object); - const searchResult = await handleHttpRequest( - 'get', - searchURL, - { - headers: { - Authorization: `Zoho-oauthtoken ${metadata.secret.accessToken}`, - }, - }, - { - destType: 'zoho', - feature: 'deleteRecords', - requestMethod: 'GET', - endpointPath: `crm/v6/${object}/search?criteria=`, - module: 'router', - }, + const { region } = Config; + + const selectQuery = generateSqlQuery(operationModuleType, { + [identifierType]: fields[identifierType], + }); + const result = await sendCOQLRequest( + region, + metadata.secret.accessToken, + operationModuleType, + selectQuery, ); - - if (!isHttpStatusSuccess(searchResult.processedResponse.status)) { - return { - erroneous: true, - message: searchResult.processedResponse.response, - }; - } - - if ( - searchResult.processedResponse.status === 204 || - !CommonUtils.isNonEmptyArray(searchResult.processedResponse.response?.data) - ) { - return { - erroneous: true, - message: 'No contact is found with record details', - }; - } - + return result; + } catch (error) { return { - erroneous: false, - message: searchResult.processedResponse.response.data.map((record) => record.id), + erroneous: true, + message: error.message, }; + } +}; + +const searchRecordIdV2 = async (identifiers, metadata, Config, destConfig) => { + try { + const { region } = Config; + const { object } = destConfig; + + const selectQuery = generateSqlQuery(object, identifiers); + const result = await sendCOQLRequest(region, metadata.secret.accessToken, object, selectQuery); + return result; } catch (error) { return { erroneous: true, @@ -290,8 +307,6 @@ module.exports = { handleDuplicateCheckV2, searchRecordId, searchRecordIdV2, - transformToURLParams, - transformToURLParamsV2, calculateTrigger, validateConfigurationIssue, }; diff --git a/src/cdk/v2/destinations/zoho/utils.test.js b/src/cdk/v2/destinations/zoho/utils.test.js index edc45c6426a..68e2a8e6376 100644 --- a/src/cdk/v2/destinations/zoho/utils.test.js +++ b/src/cdk/v2/destinations/zoho/utils.test.js @@ -9,8 +9,6 @@ const { validateConfigurationIssue, formatMultiSelectFields, formatMultiSelectFieldsV2, - transformToURLParams, - transformToURLParamsV2, calculateTrigger, searchRecordId, searchRecordIdV2, @@ -154,57 +152,6 @@ describe('formatMultiSelectFieldsV2', () => { }); }); -describe('transformToURLParams', () => { - const testCases = [ - { - name: 'should build a proper URL with encoded criteria based on fields and config for Leads module', - input: { - fields: { First_Name: 'John, Doe', Age: '30' }, - config: { region: 'US' }, - object: 'Leads', - }, - expected: `https://www.zohoapis.com/crm/v6/Leads/search?criteria=(First_Name:equals:John%5C%2C%20Doe)and(Age:equals:30)`, - }, - { - name: 'should build a proper URL with encoded criteria based on fields and config for Contacts module', - input: { - fields: { First_Name: 'John, Doe', Age: '30' }, - config: { region: 'US' }, - object: 'Contacts', - }, - expected: `https://www.zohoapis.com/crm/v6/Contacts/search?criteria=(First_Name:equals:John%5C%2C%20Doe)and(Age:equals:30)`, - }, - ]; - - testCases.forEach(({ name, input, expected }) => { - it(name, () => { - const url = transformToURLParams(input.fields, input.config, input.object); - expect(url).toEqual(expected); - }); - }); -}); - -describe('transformToURLParamsV2', () => { - const testCases = [ - { - name: 'should build a proper URL with encoded criteria based on fields and config', - input: { - fields: { First_Name: 'John, Doe', Age: '30' }, - config: { region: 'US' }, - object: 'Leads', - }, - expected: `https://www.zohoapis.com/crm/v6/Leads/search?criteria=(First_Name:equals:John%5C%2C%20Doe)and(Age:equals:30)`, - }, - ]; - - testCases.forEach(({ name, input, expected }) => { - it(name, () => { - const url = transformToURLParamsV2(input.fields, input.config, input.object); - expect(url).toEqual(expected); - }); - }); -}); - describe('calculateTrigger', () => { const testCases = [ { @@ -237,9 +184,11 @@ describe('calculateTrigger', () => { }); describe('searchRecordId', () => { - const mockFields = { Email: 'test@example.com' }; + const module = 'Leads'; + const mockFields = { Email: 'test@example.com', Name: 'John Doe' }; const mockMetadata = { secret: { accessToken: 'mock-token' } }; - const mockConfig = { region: 'us' }; + const mockConfig = { region: 'US' }; + const mockQuery = "SELECT id FROM Leads WHERE Email = 'test@example.com'"; beforeEach(() => { jest.clearAllMocks(); @@ -247,7 +196,11 @@ describe('searchRecordId', () => { const testCases = [ { + fields: mockFields, + module, + query: mockQuery, name: 'should handle non-array response data', + identifierType: 'Email', response: { processedResponse: { status: 200, @@ -258,11 +211,15 @@ describe('searchRecordId', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module, name: 'should handle missing response data property', + identifierType: 'Email', response: { processedResponse: { status: 200, @@ -271,11 +228,15 @@ describe('searchRecordId', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module, name: 'should handle null response data', + identifierType: 'Email', response: { processedResponse: { status: 200, @@ -286,11 +247,15 @@ describe('searchRecordId', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module, name: 'should handle empty array response data', + identifierType: 'Email', response: { processedResponse: { status: 200, @@ -301,11 +266,15 @@ describe('searchRecordId', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module, name: 'should handle valid array response data with single record', + identifierType: 'Email', response: { processedResponse: { status: 200, @@ -320,22 +289,11 @@ describe('searchRecordId', () => { }, }, { - name: 'should handle valid array response data with multiple records', - response: { - processedResponse: { - status: 200, - response: { - data: [{ id: '123' }, { id: '456' }], - }, - }, - }, - expected: { - erroneous: false, - message: ['123', '456'], - }, - }, - { + fields: mockFields, + query: mockQuery, + module, name: 'should handle non-success HTTP status code', + identifierType: 'Email', response: { processedResponse: { status: 400, @@ -348,7 +306,11 @@ describe('searchRecordId', () => { }, }, { + fields: mockFields, + query: mockQuery, + module, name: 'should handle HTTP request error', + identifierType: 'Email', error: new Error('Network Error'), expected: { erroneous: true, @@ -357,7 +319,7 @@ describe('searchRecordId', () => { }, ]; - testCases.forEach(({ name, response, error, expected }) => { + testCases.forEach(({ name, response, error, expected, query, fields, identifierType }) => { it(name, async () => { if (error) { handleHttpRequest.mockRejectedValueOnce(error); @@ -365,23 +327,77 @@ describe('searchRecordId', () => { handleHttpRequest.mockResolvedValueOnce(response); } - const result = await searchRecordId(mockFields, mockMetadata, mockConfig); + const result = await searchRecordId(fields, mockMetadata, mockConfig, module, identifierType); + expect(handleHttpRequest).toHaveBeenCalledWith( + 'post', + 'https://www.zohoapis.com/crm/v6/coql', + { + select_query: query, + }, + { + headers: { + Authorization: `Zoho-oauthtoken ${mockMetadata.secret.accessToken}`, + }, + }, + { + destType: 'zoho', + feature: 'deleteRecords', + requestMethod: 'POST', + endpointPath: 'https://www.zohoapis.com/crm/v6/coql', + module: 'router', + }, + ); expect(result).toEqual(expected); }); }); + + const testCases2 = [ + { + fields: { + Email: '', + phone: null, + jobs: [], + }, + query: mockQuery, + module, + identifierType: 'Email', + name: 'should return intrumentation error when identifier value is empty', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], + }, + }, + }, + expected: { + erroneous: true, + code: 'INSTRUMENTATION_ERROR', + message: 'Identifier values are not provided for Leads', + }, + }, + ]; + + testCases2.forEach(({ name, expected, fields, identifierType }) => { + it(name, async () => { + const result = await searchRecordId(fields, mockMetadata, mockConfig, module, identifierType); + expect(result).toEqual(expected); + }); + }); }); describe('searchRecordIdV2', () => { const mockFields = { Email: 'test@example.com' }; const mockMetadata = { secret: { accessToken: 'mock-token' } }; - const mockConfig = { region: 'us' }; + const mockConfig = { region: 'US' }; const mockConConfig = { destination: { object: 'Leads', identifierMappings: [{ to: 'Email', from: 'Email' }], }, }; + const mockQuery = "SELECT id FROM Leads WHERE Email = 'test@example.com'"; beforeEach(() => { jest.clearAllMocks(); @@ -389,6 +405,9 @@ describe('searchRecordIdV2', () => { const testCases = [ { + fields: mockFields, + module: mockConConfig.destination.object, + query: mockQuery, name: 'should handle non-array response data', response: { processedResponse: { @@ -400,10 +419,13 @@ describe('searchRecordIdV2', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, name: 'should handle missing response data property', response: { processedResponse: { @@ -413,10 +435,13 @@ describe('searchRecordIdV2', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, name: 'should handle null response data', response: { processedResponse: { @@ -428,10 +453,13 @@ describe('searchRecordIdV2', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, name: 'should handle empty array response data', response: { processedResponse: { @@ -443,10 +471,13 @@ describe('searchRecordIdV2', () => { }, expected: { erroneous: true, - message: 'No contact is found with record details', + message: 'No Leads is found with record details', }, }, { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, name: 'should handle valid array response data with single record', response: { processedResponse: { @@ -462,6 +493,42 @@ describe('searchRecordIdV2', () => { }, }, { + fields: { + Name: 'rid1927ce14265c006ae11555ec6e1cdbbac', + Name1: 'Liam Bailey', + Has_Chargeback: true, + Last_Client_Purchase: '2021-06-15T00:00:00Z', + Purchase_Category: ['category1', 'category2'], + Lifetime_Client_Revenue: 1200, + Name2: 'Olivia Smith', + Has_Chargeback2: false, + Last_Client_Purchase2: '2022-01-10T00:00:00Z', + Purchase_Category2: ['category3', 'category4'], + Lifetime_Client_Revenue2: 800, + Name3: 'Noah Johnson', + Has_Chargeback3: true, + Last_Client_Purchase3: '2023-03-22T00:00:00Z', + Purchase_Category3: ['category5'], + Lifetime_Client_Revenue3: 1500, + Name4: 'Emma Davis', + Has_Chargeback4: false, + Last_Client_Purchase4: '2023-07-01T00:00:00Z', + Purchase_Category4: ['category6', 'category7'], + Lifetime_Client_Revenue4: 900, + Name5: 'James Wilson', + Has_Chargeback5: true, + Last_Client_Purchase5: '2022-11-05T00:00:00Z', + Purchase_Category5: ['category8'], + Lifetime_Client_Revenue5: 1100, + Name6: 'Sophia Miller', + Has_Chargeback6: false, + Last_Client_Purchase6: '2024-01-12T00:00:00Z', + Purchase_Category6: ['category9', 'category10'], + Lifetime_Client_Revenue6: 1300, + }, + module: mockConConfig.destination.object, + query: + "SELECT id FROM Leads WHERE ((Name = 'rid1927ce14265c006ae11555ec6e1cdbbac' AND Name1 = 'Liam Bailey') AND ((Has_Chargeback = 'true' AND Last_Client_Purchase = '2021-06-15T00:00:00Z') AND ((Purchase_Category = 'category1;category2' AND Lifetime_Client_Revenue = 1200) AND ((Name2 = 'Olivia Smith' AND Has_Chargeback2 = 'false') AND ((Last_Client_Purchase2 = '2022-01-10T00:00:00Z' AND Purchase_Category2 = 'category3;category4') AND ((Lifetime_Client_Revenue2 = 800 AND Name3 = 'Noah Johnson') AND ((Has_Chargeback3 = 'true' AND Last_Client_Purchase3 = '2023-03-22T00:00:00Z') AND ((Purchase_Category3 = 'category5' AND Lifetime_Client_Revenue3 = 1500) AND ((Name4 = 'Emma Davis' AND Has_Chargeback4 = 'false') AND ((Last_Client_Purchase4 = '2023-07-01T00:00:00Z' AND Purchase_Category4 = 'category6;category7') AND ((Lifetime_Client_Revenue4 = 900 AND Name5 = 'James Wilson') AND ((Has_Chargeback5 = 'true' AND Last_Client_Purchase5 = '2022-11-05T00:00:00Z') AND Purchase_Category5 = 'category8'))))))))))))", name: 'should handle valid array response data with multiple records', response: { processedResponse: { @@ -477,6 +544,9 @@ describe('searchRecordIdV2', () => { }, }, { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, name: 'should handle non-success HTTP status code', response: { processedResponse: { @@ -490,6 +560,9 @@ describe('searchRecordIdV2', () => { }, }, { + fields: mockFields, + query: mockQuery, + module: mockConConfig.destination.object, name: 'should handle HTTP request error', error: new Error('Network Error'), expected: { @@ -499,7 +572,7 @@ describe('searchRecordIdV2', () => { }, ]; - testCases.forEach(({ name, response, error, expected }) => { + testCases.forEach(({ name, response, error, expected, query, fields }) => { it(name, async () => { if (error) { handleHttpRequest.mockRejectedValueOnce(error); @@ -507,8 +580,70 @@ describe('searchRecordIdV2', () => { handleHttpRequest.mockResolvedValueOnce(response); } - const result = await searchRecordIdV2(mockFields, mockMetadata, mockConfig, mockConConfig); + const result = await searchRecordIdV2( + fields, + mockMetadata, + mockConfig, + mockConConfig.destination, + ); + expect(handleHttpRequest).toHaveBeenCalledWith( + 'post', + 'https://www.zohoapis.com/crm/v6/coql', + { + select_query: query, + }, + { + headers: { + Authorization: `Zoho-oauthtoken ${mockMetadata.secret.accessToken}`, + }, + }, + { + destType: 'zoho', + feature: 'deleteRecords', + requestMethod: 'POST', + endpointPath: 'https://www.zohoapis.com/crm/v6/coql', + module: 'router', + }, + ); + + expect(result).toEqual(expected); + }); + }); + const testCases2 = [ + { + fields: { + Email: '', + phone: null, + jobs: [], + }, + query: mockQuery, + module: mockConConfig.destination.object, + name: 'should return intrumentation error when identifier value is empty', + response: { + processedResponse: { + status: 200, + response: { + data: [{ id: '123' }], + }, + }, + }, + expected: { + erroneous: true, + code: 'INSTRUMENTATION_ERROR', + message: 'Identifier values are not provided for Leads', + }, + }, + ]; + + testCases2.forEach(({ name, expected, fields }) => { + it(name, async () => { + const result = await searchRecordIdV2( + fields, + mockMetadata, + mockConfig, + mockConConfig.destination, + ); expect(result).toEqual(expected); }); }); diff --git a/test/integrations/destinations/zoho/common.ts b/test/integrations/destinations/zoho/common.ts index 17c8e1b442c..272040ce118 100644 --- a/test/integrations/destinations/zoho/common.ts +++ b/test/integrations/destinations/zoho/common.ts @@ -13,7 +13,7 @@ const deletionPayload1 = { externalId: [ { type: 'ZOHO-Leads', - identifierType: 'email', + identifierType: 'Email', }, ], mappedToDestination: 'true', @@ -40,7 +40,7 @@ const deletionPayload2 = { externalId: [ { type: 'ZOHO-Contacts', - identifierType: 'email', + identifierType: 'Email', }, ], mappedToDestination: 'true', diff --git a/test/integrations/destinations/zoho/network.ts b/test/integrations/destinations/zoho/network.ts index dc4adc8b9f3..2324fb364dd 100644 --- a/test/integrations/destinations/zoho/network.ts +++ b/test/integrations/destinations/zoho/network.ts @@ -212,109 +212,43 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted3%40gmail.com)and(First_Name:equals:subcribed3)and(Last_Name:equals:%20User3)', + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, - method: 'GET', + data: { + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted@gmail.com'", + }, + method: 'POST', }, httpRes: { data: { - data: '', + data: [ + { + id: '', + }, + ], }, - status: 204, + status: 200, statusText: 'OK', }, }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted%40gmail.com)and(First_Name:equals:subcribed)and(Last_Name:equals:%20User)', + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, - method: 'GET', + data: { + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted2@gmail.com'", + }, + method: 'POST', }, httpRes: { data: { data: [ { - Owner: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Company: null, - Email: 'tobedeleted@gmail.com', - $currency_symbol: '$', - $field_states: null, - $sharing_permission: 'full_access', - Last_Activity_Time: '2024-07-18T23:55:42+05:30', - Industry: null, - Unsubscribed_Mode: null, - $process_flow: false, - Street: null, - Zip_Code: null, - id: '', - $approval: { - delegate: false, - approve: false, - reject: false, - resubmit: false, - }, - Created_Time: '2024-07-18T19:34:50+05:30', - $editable: true, - City: null, - No_of_Employees: null, - Converted_Account: null, - State: null, - Country: null, - Created_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - $zia_owner_assignment: 'owner_recommendation_unavailable', - Annual_Revenue: null, - Secondary_Email: null, - Description: null, - Rating: null, - $review_process: { - approve: false, - reject: false, - resubmit: false, - }, - Website: null, - Twitter: null, - Salutation: null, - First_Name: 'subcribed', - Full_Name: 'subcribed User', - Lead_Status: null, - Record_Image: null, - Modified_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Converted_Deal: null, - $review: null, - Lead_Conversion_Time: null, - Skype_ID: null, - Phone: null, - Email_Opt_Out: false, - $zia_visions: null, - Designation: null, - Modified_Time: '2024-07-18T23:55:42+05:30', - $converted_detail: {}, - Unsubscribed_Time: null, - Converted_Contact: null, - Mobile: null, - $orchestration: null, - Last_Name: 'User', - $in_merge: false, - Lead_Source: null, - Fax: null, - $approval_state: 'approved', - $pathfinder: null, + id: '', }, ], }, @@ -324,189 +258,60 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted2%40gmail.com)and(First_Name:equals:subcribed2)and(Last_Name:equals:%20User2)', + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, - method: 'GET', + data: { + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted3@gmail.com'", + }, + method: 'POST', }, httpRes: { + data: '', + status: 204, + statusText: 'OK', + }, + }, + { + httpReq: { + url: 'https://www.zohoapis.in/crm/v6/coql', + headers: { + Authorization: 'Zoho-oauthtoken expired-access-token', + }, data: { - data: [ - { - Owner: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Company: null, - Email: 'tobedeleted2@gmail.com', - $currency_symbol: '$', - $field_states: null, - $sharing_permission: 'full_access', - Last_Activity_Time: '2024-07-18T23:55:42+05:30', - Industry: null, - Unsubscribed_Mode: null, - $process_flow: false, - Street: null, - Zip_Code: null, - id: '', - $approval: { - delegate: false, - approve: false, - reject: false, - resubmit: false, - }, - Created_Time: '2024-07-18T19:34:50+05:30', - $editable: true, - City: null, - No_of_Employees: null, - Converted_Account: null, - State: null, - Country: null, - Created_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - $zia_owner_assignment: 'owner_recommendation_unavailable', - Annual_Revenue: null, - Secondary_Email: null, - Description: null, - Rating: null, - $review_process: { - approve: false, - reject: false, - resubmit: false, - }, - Website: null, - Twitter: null, - Salutation: null, - First_Name: 'subcribed2', - Full_Name: 'subcribed2 User', - Lead_Status: null, - Record_Image: null, - Modified_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Converted_Deal: null, - $review: null, - Lead_Conversion_Time: null, - Skype_ID: null, - Phone: null, - Email_Opt_Out: false, - $zia_visions: null, - Designation: null, - Modified_Time: '2024-07-18T23:55:42+05:30', - $converted_detail: {}, - Unsubscribed_Time: null, - Converted_Contact: null, - Mobile: null, - $orchestration: null, - Last_Name: 'User2', - $in_merge: false, - Lead_Source: null, - Fax: null, - $approval_state: 'approved', - $pathfinder: null, - }, - ], + select_query: "SELECT id FROM Leads WHERE Email = 'tobedeleted3@gmail.com'", }, - status: 200, - statusText: 'OK', + method: 'POST', + }, + httpRes: { + data: { + code: 'INVALID_TOKEN', + details: {}, + message: 'invalid oauth token', + status: 'error', + }, + status: 401, + statusText: 'Bad Request', }, }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Contacts/search?criteria=(Email:equals:tobedeleted2%40gmail.com)and(First_Name:equals:subcribed2)and(Last_Name:equals:%20User2)', + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { Authorization: 'Zoho-oauthtoken correct-access-token', }, - method: 'GET', + data: { + select_query: + "SELECT id FROM Leads WHERE ((Email = 'tobedeleted2@gmail.com' AND First_Name = 'subcribed2') AND Last_Name = ' User2')", + }, + method: 'POST', }, httpRes: { data: { data: [ { - Owner: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Company: null, - Email: 'tobedeleted2@gmail.com', - $currency_symbol: '$', - $field_states: null, - $sharing_permission: 'full_access', - Last_Activity_Time: '2024-07-18T23:55:42+05:30', - Industry: null, - Unsubscribed_Mode: null, - $process_flow: false, - Street: null, - Zip_Code: null, id: '', - $approval: { - delegate: false, - approve: false, - reject: false, - resubmit: false, - }, - Created_Time: '2024-07-18T19:34:50+05:30', - $editable: true, - City: null, - No_of_Employees: null, - Converted_Account: null, - State: null, - Country: null, - Created_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - $zia_owner_assignment: 'owner_recommendation_unavailable', - Annual_Revenue: null, - Secondary_Email: null, - Description: null, - Rating: null, - $review_process: { - approve: false, - reject: false, - resubmit: false, - }, - Website: null, - Twitter: null, - Salutation: null, - First_Name: 'subcribed2', - Full_Name: 'subcribed2 User', - Lead_Status: null, - Record_Image: null, - Modified_By: { - name: 'dummy-user', - id: '724445000000323001', - email: 'dummy@gmail.com', - }, - Converted_Deal: null, - $review: null, - Lead_Conversion_Time: null, - Skype_ID: null, - Phone: null, - Email_Opt_Out: false, - $zia_visions: null, - Designation: null, - Modified_Time: '2024-07-18T23:55:42+05:30', - $converted_detail: {}, - Unsubscribed_Time: null, - Converted_Contact: null, - Mobile: null, - $orchestration: null, - Last_Name: 'User2', - $in_merge: false, - Lead_Source: null, - Fax: null, - $approval_state: 'approved', - $pathfinder: null, }, ], }, @@ -516,21 +321,25 @@ export const networkCallsData = [ }, { httpReq: { - url: 'https://www.zohoapis.in/crm/v6/Leads/search?criteria=(Email:equals:tobedeleted3%40gmail.com)and(First_Name:equals:subcribed3)and(Last_Name:equals:User3)', + url: 'https://www.zohoapis.in/crm/v6/coql', headers: { - Authorization: 'Zoho-oauthtoken expired-access-token', + Authorization: 'Zoho-oauthtoken correct-access-token', + }, + data: { + select_query: "SELECT id FROM Contacts WHERE Email = 'tobedeleted2@gmail.com'", }, - method: 'GET', + method: 'POST', }, httpRes: { data: { - code: 'INVALID_TOKEN', - details: {}, - message: 'invalid oauth token', - status: 'error', + data: [ + { + id: '', + }, + ], }, - status: 401, - statusText: 'Bad Request', + status: 200, + statusText: 'OK', }, }, ]; diff --git a/test/integrations/destinations/zoho/router/deletion.ts b/test/integrations/destinations/zoho/router/deletion.ts index 549fcb3db7f..50bd66a45a2 100644 --- a/test/integrations/destinations/zoho/router/deletion.ts +++ b/test/integrations/destinations/zoho/router/deletion.ts @@ -142,7 +142,7 @@ export const deleteData = [ externalId: [ { type: 'ZOHO-Contacts', - identifierType: 'email', + identifierType: 'Email', }, ], mappedToDestination: 'true', @@ -452,7 +452,7 @@ export const deleteData = [ externalId: [ { type: 'ZOHO-Leads', - identifierType: 'email', + identifierType: 'Email', }, ], mappedToDestination: 'true', @@ -536,7 +536,7 @@ export const deleteData = [ batched: false, statusCode: 400, error: - 'failed to fetch zoho id for record for "No contact is found with record details"', + 'failed to fetch zoho id for record for "No Leads is found with record details"', statTags: { errorCategory: 'dataValidation', errorType: 'configuration', @@ -663,7 +663,7 @@ export const deleteData = [ batched: false, statusCode: 400, error: - 'failed to fetch zoho id for record for "No contact is found with record details"', + 'failed to fetch zoho id for record for "No Leads is found with record details"', statTags: { errorCategory: 'dataValidation', errorType: 'configuration', @@ -764,4 +764,257 @@ export const deleteData = [ }, mockFns: defaultMockFns, }, + { + name: destType, + id: 'zoho_deletion_2_v2', + description: 'Test empty identifier in deletion payload V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed3', + Last_Name: ' User3', + }, + identifiers: {}, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: '`identifiers` cannot be empty', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_1_v2', + description: 'Instrumentation error when the identifiers are empty in the payload V2', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + First_Name: 'subcribed2', + Last_Name: ' User2', + }, + identifiers: { + Email: '', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + connection: commonDeletionConnectionConfigV2, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: + 'failed to fetch zoho id for record for "Identifier values are not provided for Leads"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, + { + name: destType, + id: 'zoho_deletion_2', + description: 'Instrumentation error when the identifiers are empty in the payload', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + action: 'delete', + context: { + externalId: [ + { + type: 'ZOHO-Leads', + identifierType: 'Email', + }, + ], + mappedToDestination: 'true', + sources: { + job_run_id: 'cgiiurt8um7k7n5dq480', + task_run_id: 'cgiiurt8um7k7n5dq48g', + job_id: '2MUWghI7u85n91dd1qzGyswpZan', + version: '895/merge', + }, + }, + recordId: '2', + rudderId: '2', + fields: { + Email: '', + First_Name: 'subcribed3', + Last_Name: ' User3', + }, + type: 'record', + }, + metadata: { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + destination: commonDeletionDestConfig, + }, + ], + destType, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + metadata: [ + { + jobId: 2, + userId: 'u1', + secret: { + accessToken: 'correct-access-token', + }, + }, + ], + batched: false, + statusCode: 400, + error: + 'failed to fetch zoho id for record for "Identifier values are not provided for Leads"', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ZOHO', + module: 'destination', + implementation: 'cdkV2', + feature: 'router', + }, + destination: commonDeletionDestConfig, + }, + ], + }, + }, + }, + mockFns: defaultMockFns, + }, ]; From 29175ac13e1918a67e9a8367423fd9c1327aacc5 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:30:59 +0530 Subject: [PATCH 136/160] fix: marketo get auth token cache issue (#4140) * fix: marketo get auth token cache issue * fix: marketo get auth token cache issue * fix: marketo get auth token cache issue --- src/v0/destinations/marketo/networkHandler.js | 5 +- src/v0/destinations/marketo/transform.js | 50 +----- src/v0/destinations/marketo/util.js | 37 ++++- src/v0/destinations/marketo/util.test.js | 157 ++++++++++++++++++ .../marketo_static_list/networkHandler.js | 5 +- .../marketo_static_list/transform.js | 13 +- .../marketo_static_list/transformV2.js | 5 +- .../destinations/marketo_static_list/util.js | 5 + src/v0/util/index.js | 28 +--- .../marketo_static_list/processor/data.ts | 3 +- .../marketo_static_list/router/data.ts | 3 +- 11 files changed, 217 insertions(+), 94 deletions(-) create mode 100644 src/v0/destinations/marketo/util.test.js diff --git a/src/v0/destinations/marketo/networkHandler.js b/src/v0/destinations/marketo/networkHandler.js index ac555accfe2..f3bb4c9da70 100644 --- a/src/v0/destinations/marketo/networkHandler.js +++ b/src/v0/destinations/marketo/networkHandler.js @@ -1,13 +1,12 @@ -const v0Utils = require('../../util'); const { marketoResponseHandler } = require('./util'); const { proxyRequest, prepareProxyRequest } = require('../../../adapters/network'); const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); +const { authCache } = require('./transform'); const responseHandler = (responseParams) => { - const { destinationResponse, destType, rudderJobMetadata } = responseParams; + const { destinationResponse, rudderJobMetadata } = responseParams; const message = 'Request Processed Successfully'; const { status } = destinationResponse; - const authCache = v0Utils.getDestAuthCacheInstance(destType); // check for marketo application level failures marketoResponseHandler( destinationResponse, diff --git a/src/v0/destinations/marketo/transform.js b/src/v0/destinations/marketo/transform.js index 78e23bf0731..683d4bd8ffb 100644 --- a/src/v0/destinations/marketo/transform.js +++ b/src/v0/destinations/marketo/transform.js @@ -10,13 +10,7 @@ const { } = require('@rudderstack/integrations-lib'); const stats = require('../../../util/stats'); const { EventType, MappedToDestinationKey } = require('../../../constants'); -const { - identifyConfig, - formatConfig, - LEAD_LOOKUP_METRIC, - ACTIVITY_METRIC, - FETCH_TOKEN_METRIC, -} = require('./config'); +const { identifyConfig, formatConfig, LEAD_LOOKUP_METRIC, ACTIVITY_METRIC } = require('./config'); const { addExternalIdToTraits, getDestinationExternalIDInfoForRetl, @@ -35,49 +29,13 @@ const { } = require('../../util'); const Cache = require('../../util/cache'); const { USER_LEAD_CACHE_TTL, AUTH_CACHE_TTL, JSON_MIME_TYPE } = require('../../util/constant'); -const { - marketoResponseHandler, - sendGetRequest, - sendPostRequest, - getResponseHandlerData, -} = require('./util'); +const { sendGetRequest, sendPostRequest, getResponseHandlerData, getAuthToken } = require('./util'); const logger = require('../../../logger'); const userIdLeadCache = new Cache(USER_LEAD_CACHE_TTL); // 1 day const emailLeadCache = new Cache(USER_LEAD_CACHE_TTL); // 1 day const authCache = new Cache(AUTH_CACHE_TTL); // 1 hr -// ////////////////////////////////////////////////////////////////////// -// BASE URL REF: https://developers.marketo.com/rest-api/base-url/ -// ////////////////////////////////////////////////////////////////////// - -// calls Marketo Auth API and fetches bearer token -// fails the transformer if auth fails -// ------------------------ -// Ref: https://developers.marketo.com/rest-api/authentication/#creating_an_access_token -const getAuthToken = async (formattedDestination, metadata) => - authCache.get(formattedDestination.ID, async () => { - const { accountId, clientId, clientSecret } = formattedDestination; - const clientResponse = await sendGetRequest( - `https://${accountId}.mktorest.com/identity/oauth/token`, - { - params: { - client_id: clientId, - client_secret: clientSecret, - grant_type: 'client_credentials', - }, - }, - metadata, - ); - const data = marketoResponseHandler(clientResponse, 'During fetching auth token'); - if (data) { - stats.increment(FETCH_TOKEN_METRIC, { status: 'success' }); - return { value: data.access_token, age: data.expires_in }; - } - stats.increment(FETCH_TOKEN_METRIC, { status: 'failed' }); - return null; - }); - // lookup Marketo with userId or anonymousId // Marketo will create the lead // fails transformer if lookup fails - fields are not created in Marketo @@ -460,7 +418,7 @@ const processEvent = async ({ message, destination, metadata }, token) => { }; const process = async (event) => { - const token = await getAuthToken(formatConfig(event.destination), event.metadata); + const token = await getAuthToken(authCache, formatConfig(event.destination), event.metadata); if (!token) { throw new UnauthorizedError('Authorization failed'); } @@ -473,7 +431,7 @@ const processRouterDest = async (inputs, reqMetadata) => { // If destination information is not present Error should be thrown let token; try { - token = await getAuthToken(formatConfig(inputs[0].destination), inputs[0].metadata); + token = await getAuthToken(authCache, formatConfig(inputs[0].destination), inputs[0].metadata); // If token is null track/identify calls cannot be executed. if (!token) { diff --git a/src/v0/destinations/marketo/util.js b/src/v0/destinations/marketo/util.js index aee872efac0..1a88653a544 100644 --- a/src/v0/destinations/marketo/util.js +++ b/src/v0/destinations/marketo/util.js @@ -6,6 +6,7 @@ const { UnhandledStatusCodeError, InstrumentationError, } = require('@rudderstack/integrations-lib'); +const stats = require('../../../util/stats'); const { httpGET, httpPOST } = require('../../../adapters/network'); const { getDynamicErrorType, @@ -59,7 +60,7 @@ const MARKETO_THROTTLED_CODES = ['502', '606', '607', '608', '615']; // '1049', // ]; -const { DESTINATION } = require('./config'); +const { DESTINATION, FETCH_TOKEN_METRIC } = require('./config'); const logger = require('../../../logger'); // handles marketo application level failures @@ -72,12 +73,14 @@ const marketoApplicationErrorHandler = (marketoResponse, sourceMessage, destinat 400, marketoResponse, ); - } else if (errors && MARKETO_THROTTLED_CODES.includes(errors[0].code)) { + } + if (errors && MARKETO_THROTTLED_CODES.includes(errors[0].code)) { throw new ThrottledError( `Request Failed for ${destination}, ${errors[0].message} (Throttled).${sourceMessage}`, marketoResponse, ); - } else if (errors && MARKETO_RETRYABLE_CODES.includes(errors[0].code)) { + } + if (errors && MARKETO_RETRYABLE_CODES.includes(errors[0].code)) { throw new RetryableError( `Request Failed for ${destination}, ${errors[0].message} (Retryable).${sourceMessage}`, 500, @@ -283,7 +286,35 @@ const getResponseHandlerData = (clientResponse, lookupMessage, formattedDestinat authCache, ); +// ////////////////////////////////////////////////////////////////////// +// BASE URL REF: https://developers.marketo.com/rest-api/base-url/ +// ////////////////////////////////////////////////////////////////////// + +// calls Marketo Auth API and fetches bearer token +// fails the transformer if auth fails +// ------------------------ +// Ref: https://developers.marketo.com/rest-api/authentication/#creating_an_access_token +const getAuthToken = async (authCache, formattedDestination, metadata) => + authCache.get(formattedDestination.ID, async () => { + const { accountId, clientId, clientSecret } = formattedDestination; + const clientResponse = await sendGetRequest( + `https://${accountId}.mktorest.com/identity/oauth/token`, + { + params: { + client_id: clientId, + client_secret: clientSecret, + grant_type: 'client_credentials', + }, + }, + metadata, + ); + const data = marketoResponseHandler(clientResponse, 'During fetching auth token'); + stats.increment(FETCH_TOKEN_METRIC, { status: 'success' }); + return { value: data.access_token, age: data.expires_in }; + }); + module.exports = { + getAuthToken, marketoResponseHandler, sendGetRequest, sendPostRequest, diff --git a/src/v0/destinations/marketo/util.test.js b/src/v0/destinations/marketo/util.test.js new file mode 100644 index 00000000000..b8ac7970664 --- /dev/null +++ b/src/v0/destinations/marketo/util.test.js @@ -0,0 +1,157 @@ +const { getAuthToken } = require('./util'); +const { httpGET } = require('../../../adapters/network'); +const stats = require('../../../util/stats'); +const { + RetryableError, + filter, + UnhandledStatusCodeError, + ThrottledError, +} = require('@rudderstack/integrations-lib'); + +jest.mock('../../../adapters/network'); +jest.mock('../../../util/stats'); + +describe('getAuthToken', () => { + const mockAuthCache = { + get: jest.fn().mockImplementation(async (key, fn) => fn()), + }; + + const mockFormattedDestination = { + ID: 'test-dest-id', + accountId: 'test-account', + clientId: 'test-client', + clientSecret: 'test-secret', + }; + + const mockMetadata = { + jobId: 'test-job', + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + const testCases = [ + { + name: 'should successfully get auth token', + mockResponse: { + success: true, + response: { + data: { + access_token: 'test-token', + expires_in: 3600, + }, + status: 200, + }, + }, + expectedResult: { + value: 'test-token', + age: 3600, + }, + expectedStats: { + increment: { + metric: 'marketo_fetch_token', + tags: { status: 'success' }, + }, + }, + }, + { + name: 'should handle expired token', + mockResponse: { + success: true, + response: { + data: { + access_token: 'expired-token', + expires_in: 0, + }, + status: 200, + }, + }, + expectedError: new RetryableError( + 'Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token', + 500, + ), + }, + { + name: 'should handle throttled status code', + mockResponse: { + response: { + data: { + errors: [ + { + code: '606', + }, + ], + }, + status: 200, + }, + }, + expectedError: new ThrottledError( + 'Request Failed for marketo, undefined (Throttled).During fetching auth token', + ), + }, + { + name: 'should handle unknown status code', + mockResponse: { + response: { + data: { + errors: [ + { + code: 'unknown-code', + }, + ], + }, + status: 200, + }, + }, + expectedError: new UnhandledStatusCodeError('Error occurred During fetching auth token', { + data: { + errors: [{ code: 'unknown-code' }], + }, + }), + }, + ]; + + filter(testCases).forEach( + ({ name, mockResponse, expectedResult, expectedError, expectedStats }) => { + it(name, async () => { + httpGET.mockResolvedValueOnce(mockResponse); + + if (expectedError) { + await expect( + getAuthToken(mockAuthCache, mockFormattedDestination, mockMetadata), + ).rejects.toThrow(expectedError); + } else { + const result = await getAuthToken(mockAuthCache, mockFormattedDestination, mockMetadata); + expect(result).toEqual(expectedResult); + } + + expect(httpGET).toHaveBeenCalledWith( + 'https://test-account.mktorest.com/identity/oauth/token', + { + params: { + client_id: 'test-client', + client_secret: 'test-secret', + grant_type: 'client_credentials', + }, + }, + { + destType: 'marketo', + feature: 'transformation', + endpointPath: '/v1/leads', + requestMethod: 'GET', + module: 'router', + metadata: mockMetadata, + }, + ); + + if (expectedStats) { + expect(stats.increment).toHaveBeenCalledWith( + expectedStats.increment.metric, + expectedStats.increment.tags, + ); + } + }); + }, + ); +}); diff --git a/src/v0/destinations/marketo_static_list/networkHandler.js b/src/v0/destinations/marketo_static_list/networkHandler.js index 086378cf6ac..2b59c36fafd 100644 --- a/src/v0/destinations/marketo_static_list/networkHandler.js +++ b/src/v0/destinations/marketo_static_list/networkHandler.js @@ -1,14 +1,13 @@ const { marketoResponseHandler } = require('../marketo/util'); const { proxyRequest, prepareProxyRequest } = require('../../../adapters/network'); -const v0Utils = require('../../util'); const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); const { DESTINATION } = require('./config'); +const { authCache } = require('./util'); const responseHandler = (responseParams) => { - const { destinationResponse, destType, rudderJobMetadata } = responseParams; + const { destinationResponse, rudderJobMetadata } = responseParams; const message = 'Request Processed Successfully'; const { status } = destinationResponse; - const authCache = v0Utils.getDestAuthCacheInstance(destType); // check for marketo application level failures marketoResponseHandler( destinationResponse, diff --git a/src/v0/destinations/marketo_static_list/transform.js b/src/v0/destinations/marketo_static_list/transform.js index 936b528de7b..c6f55c473cf 100644 --- a/src/v0/destinations/marketo_static_list/transform.js +++ b/src/v0/destinations/marketo_static_list/transform.js @@ -8,16 +8,13 @@ const { simpleProcessRouterDest, getErrorRespEvents, } = require('../../util'); -const { AUTH_CACHE_TTL, JSON_MIME_TYPE } = require('../../util/constant'); -const { getIds, validateMessageType } = require('./util'); +const { JSON_MIME_TYPE } = require('../../util/constant'); +const { getIds, validateMessageType, authCache } = require('./util'); const { getDestinationExternalID, defaultRequestConfig } = require('../../util'); const { formatConfig, MAX_LEAD_IDS_SIZE } = require('./config'); -const Cache = require('../../util/cache'); -const { getAuthToken } = require('../marketo/transform'); +const { getAuthToken } = require('../marketo/util'); const { processRecordInputs } = require('./transformV2'); -const authCache = new Cache(AUTH_CACHE_TTL); // 1 hr - const responseBuilder = (endPoint, leadIds, operation, token) => { let updatedEndpoint = endPoint; if (leadIds.length > 0) { @@ -90,7 +87,7 @@ const processEvent = (event) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars const process = async (event, _processParams) => { - const token = await getAuthToken(formatConfig(event.destination), event.metadata); + const token = await getAuthToken(authCache, formatConfig(event.destination), event.metadata); if (!token) { throw new UnauthorizedError('Authorization failed'); } @@ -105,7 +102,7 @@ const processRouterDest = async (inputs, reqMetadata) => { const { destination, metadata } = inputs[0]; try { - const token = await getAuthToken(formatConfig(destination), metadata); + const token = await getAuthToken(authCache, formatConfig(destination), metadata); if (!token) { throw new UnauthorizedError('Could not retrieve authorisation token'); } diff --git a/src/v0/destinations/marketo_static_list/transformV2.js b/src/v0/destinations/marketo_static_list/transformV2.js index 912d548d098..0c58ab2a5ab 100644 --- a/src/v0/destinations/marketo_static_list/transformV2.js +++ b/src/v0/destinations/marketo_static_list/transformV2.js @@ -11,8 +11,9 @@ const { } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); const { MAX_LEAD_IDS_SIZE } = require('./config'); -const { getAuthToken } = require('../marketo/transform'); +const { getAuthToken } = require('../marketo/util'); const { formatConfig } = require('../marketo/config'); +const { authCache } = require('./util'); /** * Generates the final response structure to be sent to the destination @@ -73,7 +74,7 @@ const batchResponseBuilder = (listId, Config, token, leadIds, operation) => { * @returns An array containing the batched responses for the insert and delete actions along with the metadata. */ async function processRecordInputs(groupedRecordInputs, destination, listId) { - const token = await getAuthToken(formatConfig(destination)); + const token = await getAuthToken(authCache, formatConfig(destination)); if (!token) { throw new UnauthorizedError('Authorization failed'); } diff --git a/src/v0/destinations/marketo_static_list/util.js b/src/v0/destinations/marketo_static_list/util.js index c6959cb2564..39cc6c147e3 100644 --- a/src/v0/destinations/marketo_static_list/util.js +++ b/src/v0/destinations/marketo_static_list/util.js @@ -1,5 +1,9 @@ /* eslint-disable unicorn/consistent-destructuring */ const { InstrumentationError } = require('@rudderstack/integrations-lib'); +const Cache = require('../../util/cache'); +const { AUTH_CACHE_TTL } = require('../../util/constant'); + +const authCache = new Cache(AUTH_CACHE_TTL); // 1 hr /** * Fetches the ids from the array of objects @@ -38,4 +42,5 @@ const validateMessageType = (message, allowedTypes) => { module.exports = { getIds, validateMessageType, + authCache, }; diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 4542a7abe5e..3206283c77c 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -29,7 +29,7 @@ const { JsonTemplateEngine, PathType } = require('@rudderstack/json-template-eng const isString = require('lodash/isString'); const logger = require('../../logger'); const stats = require('../../util/stats'); -const { DestCanonicalNames, DestHandlerMap } = require('../../constants/destinationCanonicalNames'); +const { DestCanonicalNames } = require('../../constants/destinationCanonicalNames'); const { client: errNotificationClient } = require('../../util/errorNotifier'); const { HTTP_STATUS_CODES, VDM_V2_SCHEMA_VERSION, ERROR_MESSAGES } = require('./constant'); const { @@ -1897,31 +1897,6 @@ const flattenMultilevelPayload = (payload) => { return flattenedPayload; }; -/** - * Gets the destintion's transform.js file used for transformation - * **Note**: The transform.js file is imported from - * `v0/destinations/${dest}/transform` - * @param {*} _version -> version for the transfor - * @param {*} dest destination name - * @returns - * The transform.js instance used for destination transformation - */ -const getDestHandler = (dest) => { - const destName = DestHandlerMap[dest] || dest; - // eslint-disable-next-line import/no-dynamic-require, global-require - return require(`../destinations/${destName}/transform`); -}; - -/** - * Obtain the authCache instance used to store the access token information to send/get information to/from destination - * @param {string} destType destination name - * @returns {Cache | undefined} The instance of "v0/util/cache.js" - */ -const getDestAuthCacheInstance = (destType) => { - const destInf = getDestHandler(destType); - return destInf?.authCache || {}; -}; - /** * This function removes all those variables which are * empty or undefined or null from all levels of object. @@ -2495,7 +2470,6 @@ module.exports = { simpleProcessRouterDestSync, handleRtTfSingleEventError, getErrorStatusCode, - getDestAuthCacheInstance, refinePayload, validateEventName, validatePhoneWithCountryCode, diff --git a/test/integrations/destinations/marketo_static_list/processor/data.ts b/test/integrations/destinations/marketo_static_list/processor/data.ts index 3d944d07b85..944858908d1 100644 --- a/test/integrations/destinations/marketo_static_list/processor/data.ts +++ b/test/integrations/destinations/marketo_static_list/processor/data.ts @@ -1,4 +1,5 @@ -import { authHeader1, authHeaderAccessToken, secret1 } from '../maskedSecrets'; +import { authHeaderAccessToken, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'marketo_static_list', diff --git a/test/integrations/destinations/marketo_static_list/router/data.ts b/test/integrations/destinations/marketo_static_list/router/data.ts index 7a7c66d4b83..474925e4b82 100644 --- a/test/integrations/destinations/marketo_static_list/router/data.ts +++ b/test/integrations/destinations/marketo_static_list/router/data.ts @@ -1,4 +1,5 @@ -import { authHeader1, authHeaderAccessToken, secret1 } from '../maskedSecrets'; +import { authHeaderAccessToken, secret1 } from '../maskedSecrets'; + export const data = [ { name: 'marketo_static_list', From d2291852cbd6d063e1aa4ad00a60babc0ac6c233 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Fri, 7 Mar 2025 12:06:05 +0530 Subject: [PATCH 137/160] chore: fix allure workflow (#4144) * chore: fix allure workflow * chore: fix allure workflow * chore: fix allure workflow * chore: fix allure workflow * chore: fix allure workflow * chore: fix allure workflow * chore: fix allure workflow * chore: fix allure workflow --- .github/workflows/allure-test-reporter.yml | 95 ++++++++++++---------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/.github/workflows/allure-test-reporter.yml b/.github/workflows/allure-test-reporter.yml index 68c5926434b..959127a2a65 100644 --- a/.github/workflows/allure-test-reporter.yml +++ b/.github/workflows/allure-test-reporter.yml @@ -34,71 +34,76 @@ jobs: - name: Run Tests and Generate Report run: | - npm run test:ts + npm run test:ts:silent - - name: Load test report history - uses: actions/checkout@v4 - if: always() - continue-on-error: true - with: - ref: gh-pages - path: gh-pages + - name: Install Allure + run: npm install -g allure-commandline - name: Generate Allure Report - uses: simple-elf/allure-report-action@master - if: always() - with: - gh_pages: gh-pages - allure_results: allure-results - allure_history: allure-history - keep_reports: 20 - - - name: Publish to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - id: deploy - if: always() + run: | + REPO_NAME=$(basename ${{ github.repository }}) + PR_NUMBER=${{ github.event.pull_request.number }} + REPORT_FOLDER="${REPO_NAME}/${PR_NUMBER}" + allure generate allure-results --clean -o "${REPORT_FOLDER}" + echo "REPORT_FOLDER=${REPORT_FOLDER}" >> $GITHUB_ENV # Persist this variable + + - name: Checkout Reports Repository + uses: actions/checkout@v4 with: - github_token: ${{ secrets.PAT }} - publish_branch: gh-pages - publish_dir: allure-history + repository: rudderlabs/test-reports + token: ${{ secrets.PAT }} + path: test-reports - - name: Get Report Number - id: report-number - if: always() + - name: Copy Allure Report to Reports Repository run: | - # Wait a moment for gh-pages to update - sleep 10 + mkdir -p "test-reports/$REPORT_FOLDER" + cp -r $REPORT_FOLDER/* test-reports/$REPORT_FOLDER/ + + - name: Cleanup Old Reports (Keep Only Last 50) + run: | + REPO_NAME=$(basename ${{ github.repository }}) + cd test-reports/${REPO_NAME} + ls -t | tail -n +51 | xargs rm -rf || echo "No old reports to delete" + + - name: Commit and Push Report + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: | + cd test-reports + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + + # Stash any unstaged changes before pulling + git add . + git stash || echo "No changes to stash" - # Create a temporary directory for gh-pages checkout - mkdir temp_gh_pages - cd temp_gh_pages + # Pull latest changes safely + git pull --rebase origin main - # Initialize git and fetch gh-pages - git init - git remote add origin https://github.com/rudderlabs/rudder-transformer.git - git fetch origin gh-pages - git checkout gh-pages + # Apply the stashed changes back + git stash pop || echo "No stash to apply" - # Find the latest numbered directory - LATEST_NUM=$(find . -maxdepth 1 -type d -name "[0-9]*" | sort -n | tail -1 | sed 's/\.\///') - echo "number=${LATEST_NUM}" >> $GITHUB_OUTPUT + # Commit new report if there are changes + git add . + git commit -m "chore: add allure report for $REPORT_FOLDER" || echo "No changes to commit" - # Cleanup - cd .. - rm -rf temp_gh_pages + # Push changes with retry logic + for i in {1..5}; do + git push origin main && break || sleep 5 + git pull --rebase origin main + done - name: Add Test Report Link as Comment on PR uses: actions/github-script@v7 - if: always() with: github-token: ${{ secrets.PAT }} script: | const { owner, repo } = context.repo; const prNumber = context.payload.pull_request.number; - const reportNumber = '${{ steps.report-number.outputs.number }}'; + const reportFolder = process.env.REPORT_FOLDER; // Read from environment variable const commentBody = `Allure Test reports for this run are available at: - - Allure Report: https://rudderlabs.github.io/rudder-transformer/${reportNumber}/index.html`; + - Allure Report: [View Report](https://rudderlabs.github.io/test-reports/${reportFolder}/index.html)`; // Comment on the pull request await github.rest.issues.createComment({ From 21c8562357ee94e1dd79d1671d7e4b15032a10ff Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Fri, 7 Mar 2025 12:34:40 +0530 Subject: [PATCH 138/160] chore: update tagged participants in gh new release workflow (#4138) Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --- .github/workflows/publish-new-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-new-release.yml b/.github/workflows/publish-new-release.yml index a91a1e2b22b..b6a7f404e3d 100644 --- a/.github/workflows/publish-new-release.yml +++ b/.github/workflows/publish-new-release.yml @@ -99,7 +99,7 @@ jobs: channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }} payload: | { - "text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <@U03KG4BK1L1> <@U024YF8CR53> <@U01LVJ30QEB>", + "text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <@S02AEQL26CT> <@S03SEKBFX0D> <@U021E50QAGY>", "blocks": [ { "type": "header", From 3aae1cbba494c29824154d98beff5ae5ec67b506 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Fri, 7 Mar 2025 15:33:59 +0530 Subject: [PATCH 139/160] fix: wrong method during update call when dont batch true (#4146) --- src/v0/destinations/hs/HSTransform-v2.js | 1 + src/v0/destinations/hs/util.js | 11 +- .../destinations/hs/processor/data.ts | 2 +- .../destinations/hs/router/data.ts | 201 ++++++++++++++++++ 4 files changed, 208 insertions(+), 7 deletions(-) diff --git a/src/v0/destinations/hs/HSTransform-v2.js b/src/v0/destinations/hs/HSTransform-v2.js index 586934fc708..e4578a6c5b7 100644 --- a/src/v0/destinations/hs/HSTransform-v2.js +++ b/src/v0/destinations/hs/HSTransform-v2.js @@ -159,6 +159,7 @@ const processIdentify = async ({ message, destination, metadata }, propertyMap) // update endpoint = IDENTIFY_CRM_UPDATE_CONTACT.replace(':contactId', contactId); response.operation = 'updateContacts'; + response.method = defaultPatchRequestConfig.requestMethod; } else { // contact do not exist // create diff --git a/src/v0/destinations/hs/util.js b/src/v0/destinations/hs/util.js index 56ec6e41675..b2aa61ed505 100644 --- a/src/v0/destinations/hs/util.js +++ b/src/v0/destinations/hs/util.js @@ -23,7 +23,6 @@ const { isNull, validateEventName, defaultBatchRequestConfig, - defaultPostRequestConfig, getSuccessRespEvents, } = require('../../util'); const { @@ -608,8 +607,8 @@ const performHubSpotSearch = async ( /* searchResults = { id: 'existing_contact_id', - property: 'existing_contact_email', // when email is identifier - hs_additional_emails: ['secondary_email'] // when email is identifier + property: 'existing_contact_email', // when email is identifier + hs_additional_emails: ['secondary_email'] // when email is identifier } */ return searchResults; }; @@ -838,9 +837,9 @@ const addExternalIdToHSTraits = (message) => { const externalIdObj = message.context?.externalId?.[0]; if (externalIdObj.useSecondaryObject) { /* this condition help us to NOT override the primary key value with the secondary key value - example: + example: for `email` as primary key and `hs_additonal_emails` as secondary key we don't want to override `email` with `hs_additional_emails`. - neither we want to map anything for `hs_additional_emails` as this property can not be set + neither we want to map anything for `hs_additional_emails` as this property can not be set */ return; } @@ -859,7 +858,7 @@ const convertToResponseFormat = (successRespListWithDontBatchTrue) => { batchedResponse.batchedRequest.endpoint = endpoint; batchedResponse.batchedRequest.body = message.body; batchedResponse.batchedRequest.params = message.params; - batchedResponse.batchedRequest.method = defaultPostRequestConfig.requestMethod; + batchedResponse.batchedRequest.method = message.method; batchedResponse.metadata = [metadata]; batchedResponse.destination = destination; diff --git a/test/integrations/destinations/hs/processor/data.ts b/test/integrations/destinations/hs/processor/data.ts index fa3c98737c4..9aa16be1c5e 100644 --- a/test/integrations/destinations/hs/processor/data.ts +++ b/test/integrations/destinations/hs/processor/data.ts @@ -2075,7 +2075,7 @@ export const data = [ version: '1', type: 'REST', userId: '', - method: 'POST', + method: 'PATCH', endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/103604', headers: { 'Content-Type': 'application/json', diff --git a/test/integrations/destinations/hs/router/data.ts b/test/integrations/destinations/hs/router/data.ts index 1546193a4aa..4da3980820d 100644 --- a/test/integrations/destinations/hs/router/data.ts +++ b/test/integrations/destinations/hs/router/data.ts @@ -3663,4 +3663,205 @@ export const data = [ }, }, }, + { + name: 'hs', + description: 'if dontBatch is true we should use patch request method for update for retl flow', + feature: 'router', + module: 'destination', + version: 'v0', + scenario: 'buisness', + id: 'dontbatchtrueid', + successCriteria: + 'should not create a batch with the events if that events contains dontBatch true', + input: { + request: { + body: { + input: [ + { + message: { + type: 'identify', + sentAt: '2024-05-23T16:49:57.461+05:30', + userId: 'identify425@test.com', + channel: 'mobile', + context: { + traits: { + age: '30', + name: 'John Sparrow', + email: 'identify425@test.com', + phone: '9112340425', + lastname: 'Sparrow', + firstname: 'John', + }, + context: { + sources: { + job_id: '2qY238MjR41Cn1pnO5kSK0Metno', + version: 'v1.60.8', + job_run_id: 'cus0gkdes5sukm8iqqh0', + task_run_id: 'cus0gkdes5sukm8iqqig', + }, + externalId: [ + { + id: 'identify425@test.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + mappedToDestination: 'true', + }, + userAgent: + 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)', + }, + timestamp: '2024-05-23T16:49:57.070+05:30', + receivedAt: '2024-05-23T16:49:57.071+05:30', + anonymousId: '8d872292709c6fbe', + }, + metadata: { + jobId: 1, + sourceId: '2RnN36pc7p5lzoApxZnDfRnYFx0', + destinationId: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + transformAt: 'router', + workspaceId: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + dontBatch: true, + }, + destination: { + ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + Name: 'hs-1', + Config: { + accessToken: 'dummy-access-tokensuccess', + apiKey: '', + apiVersion: 'newApi', + authorizationType: 'newPrivateAppApi', + blacklistedEvents: [], + connectionMode: 'cloud', + doAssociation: false, + eventDelivery: false, + eventDeliveryTS: 1687884567403, + eventFilteringOption: 'disable', + hubID: '25092171', + hubspotEvents: [ + { + eventProperties: [ + { + from: 'first_name', + to: 'first_name', + }, + { + from: 'last_name', + to: 'last_name', + }, + ], + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + rsEventName: 'Order Complete', + }, + ], + lookupField: 'email', + useNativeSDK: false, + whitelistedEvents: [], + }, + Enabled: true, + WorkspaceID: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + Transformations: [], + IsProcessorEnabled: true, + RevisionID: '2gqf7Mc7WEwqQtQy3G105O22s3D', + }, + request: { + query: {}, + }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batched: false, + batchedRequest: { + body: { + FORM: {}, + JSON: { + properties: { + email: 'identify425@test.com', + firstname: 'John', + lastname: 'Sparrow', + phone: '9112340425', + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/103604', + files: {}, + headers: { + Authorization: 'Bearer dummy-access-tokensuccess', + 'Content-Type': 'application/json', + }, + method: 'PATCH', + params: {}, + type: 'REST', + version: '1', + }, + destination: { + Config: { + accessToken: 'dummy-access-tokensuccess', + apiKey: '', + apiVersion: 'newApi', + authorizationType: 'newPrivateAppApi', + blacklistedEvents: [], + connectionMode: 'cloud', + doAssociation: false, + eventDelivery: false, + eventDeliveryTS: 1687884567403, + eventFilteringOption: 'disable', + hubID: '25092171', + hubspotEvents: [ + { + eventProperties: [ + { + from: 'first_name', + to: 'first_name', + }, + { + from: 'last_name', + to: 'last_name', + }, + ], + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + rsEventName: 'Order Complete', + }, + ], + lookupField: 'email', + useNativeSDK: false, + whitelistedEvents: [], + }, + Enabled: true, + ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + IsProcessorEnabled: true, + Name: 'hs-1', + RevisionID: '2gqf7Mc7WEwqQtQy3G105O22s3D', + Transformations: [], + WorkspaceID: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + }, + metadata: [ + { + destinationId: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', + dontBatch: true, + jobId: 1, + sourceId: '2RnN36pc7p5lzoApxZnDfRnYFx0', + transformAt: 'router', + workspaceId: '2QapBTEvZYwuf6O9KB5AEvvBt8j', + }, + ], + statusCode: 200, + }, + ], + }, + }, + }, + }, ]; From 2ec134ae74ac2cbe9a15d6f61243bdc0c6b71a10 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 7 Mar 2025 10:16:59 +0000 Subject: [PATCH 140/160] chore(release): 1.92.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aaebf57add..60c8c7cb3c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.92.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.92.0...v1.92.1) (2025-03-07) + + +### Bug Fixes + +* wrong method during update call when dont batch true ([#4146](https://github.com/rudderlabs/rudder-transformer/issues/4146)) ([3aae1cb](https://github.com/rudderlabs/rudder-transformer/commit/3aae1cbba494c29824154d98beff5ae5ec67b506)) + ## [1.92.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.91.5...v1.92.0) (2025-03-03) diff --git a/package-lock.json b/package-lock.json index 28e2d1ed4b9..b06376a47c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.92.0", + "version": "1.92.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.92.0", + "version": "1.92.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 6ce2948b4fe..5d4a71b6926 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.92.0", + "version": "1.92.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 8bd2c6cddb9fd6e982bb78badfa0f1f69364861f Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 10 Mar 2025 10:09:18 +0530 Subject: [PATCH 141/160] chore: fixing hs component test to use masked secret (#4150) --- test/integrations/destinations/hs/router/data.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integrations/destinations/hs/router/data.ts b/test/integrations/destinations/hs/router/data.ts index a4014bfb61c..c72393de790 100644 --- a/test/integrations/destinations/hs/router/data.ts +++ b/test/integrations/destinations/hs/router/data.ts @@ -1,4 +1,4 @@ -import { authHeader1, secret1, authHeader3, secret3 } from '../maskedSecrets'; +import { authHeader1, secret1, authHeader2, authHeader3, secret3, secret2 } from '../maskedSecrets'; import { destination } from './config'; export const data = [ { @@ -3770,7 +3770,7 @@ export const data = [ ID: '2RnSBhn4zPTOF8NdqAIrnVPPnfr', Name: 'hs-1', Config: { - accessToken: 'dummy-access-tokensuccess', + accessToken: secret2, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', @@ -3841,7 +3841,7 @@ export const data = [ endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/103604', files: {}, headers: { - Authorization: 'Bearer dummy-access-tokensuccess', + Authorization: authHeader2, 'Content-Type': 'application/json', }, method: 'PATCH', @@ -3851,7 +3851,7 @@ export const data = [ }, destination: { Config: { - accessToken: 'dummy-access-tokensuccess', + accessToken: secret2, apiKey: '', apiVersion: 'newApi', authorizationType: 'newPrivateAppApi', From 5edfbb834bfde0d39f6f177406ebf70a1138ddad Mon Sep 17 00:00:00 2001 From: Mahesh Kutty <39219085+maheshkutty@users.noreply.github.com> Date: Mon, 10 Mar 2025 12:01:06 +0530 Subject: [PATCH 142/160] feat(destination): pass object data in event for moengage (#4111) * feat(destination): pass object data in event for moengage * chore: code quality * chore: misc * fix: misc * chore: add separate mapping for identify and device * fix: test * fix: use lib function * fix: add test for mergeCustomAttributes * fix: add test for destination endpoint * fix: use masked secret * fix: update test name --- src/v0/destinations/moengage/config.js | 13 + .../MOENGAGEDeviceAttributesObjectConfig.json | 45 ++ ...OENGAGEIdentifyAttributesObjectConfig.json | 149 +++++ .../MOENGAGETrackAttributesObjectConfig.json | 35 ++ src/v0/destinations/moengage/transform.js | 157 ++++-- .../destinations/moengage/transform.test.js | 74 +++ .../destinations/moengage/processor/data.ts | 529 +++++++++++++++++- 7 files changed, 923 insertions(+), 79 deletions(-) create mode 100644 src/v0/destinations/moengage/data/MOENGAGEDeviceAttributesObjectConfig.json create mode 100644 src/v0/destinations/moengage/data/MOENGAGEIdentifyAttributesObjectConfig.json create mode 100644 src/v0/destinations/moengage/data/MOENGAGETrackAttributesObjectConfig.json create mode 100644 src/v0/destinations/moengage/transform.test.js diff --git a/src/v0/destinations/moengage/config.js b/src/v0/destinations/moengage/config.js index 95aa6c0f89f..98efac4f166 100644 --- a/src/v0/destinations/moengage/config.js +++ b/src/v0/destinations/moengage/config.js @@ -24,6 +24,7 @@ const endpointIND = { alias: `https://api-03.moengage.com/v1/customer/merge?app_id=`, }; +// moengage supports object types, we added a new mapping for identify, track and device to support object data type const CONFIG_CATEGORIES = { IDENTIFY: { type: 'identify', name: 'MOENGAGEIdentifyConfig' }, TRACK: { type: 'track', name: 'MOENGAGETrackConfig' }, @@ -32,14 +33,26 @@ const CONFIG_CATEGORIES = { type: 'identifyAttr', name: 'MOENGAGEIdentifyAttributesConfig', }, + IDENTIFY_ATTR_OBJ: { + type: 'identifyAttr', + name: 'MOENGAGEIdentifyAttributesObjectConfig', + }, DEVICE_ATTR: { type: 'deviceAttr', name: 'MOENGAGEDeviceAttributesConfig', }, + DEVICE_ATTR_OBJ: { + type: 'deviceAttr', + name: 'MOENGAGEDeviceAttributesObjectConfig', + }, TRACK_ATTR: { type: 'trackAttr', name: 'MOENGAGETrackAttributesConfig', }, + TRACK_ATTR_OBJ: { + type: 'trackAttrObj', + name: 'MOENGAGETrackAttributesObjectConfig', + }, ALIAS: { type: 'alias', name: 'MoEngageAliasConfig' }, }; diff --git a/src/v0/destinations/moengage/data/MOENGAGEDeviceAttributesObjectConfig.json b/src/v0/destinations/moengage/data/MOENGAGEDeviceAttributesObjectConfig.json new file mode 100644 index 00000000000..d7578a4d522 --- /dev/null +++ b/src/v0/destinations/moengage/data/MOENGAGEDeviceAttributesObjectConfig.json @@ -0,0 +1,45 @@ +[ + { + "destKey": "platform", + "sourceKeys": ["context.device.type", "channel"], + "required": true + }, + { + "destKey": "push_id", + "sourceKeys": "context.device.token", + "required": true + }, + { + "destKey": "model", + "sourceKeys": "context.device.model", + "required": false + }, + { + "destKey": "push_preference", + "sourceKeys": ["properties.push_preference", "properties.pushPreference"], + "required": false + }, + { + "destKey": "app_version", + "sourceKeys": "context.app.version", + "required": false + }, + { + "destKey": "os_version", + "sourceKeys": "context.os.version", + "required": false + }, + { + "destKey": "active", + "sourceKeys": "properties.active", + "required": false + }, + { + "destKey": "data", + "sourceKeys": "properties", + "required": false, + "metadata": { + "excludes": ["active", "push_preference", "id", "_id", "pushPreference"] + } + } +] diff --git a/src/v0/destinations/moengage/data/MOENGAGEIdentifyAttributesObjectConfig.json b/src/v0/destinations/moengage/data/MOENGAGEIdentifyAttributesObjectConfig.json new file mode 100644 index 00000000000..5b0d9310c7d --- /dev/null +++ b/src/v0/destinations/moengage/data/MOENGAGEIdentifyAttributesObjectConfig.json @@ -0,0 +1,149 @@ +[ + { + "destKey": "name", + "sourceKeys": ["traits.name", "context.traits.name"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "first_name", + "sourceKeys": [ + "traits.firstname", + "traits.first_name", + "traits.firstName", + "context.traits.firstname", + "context.traits.first_name", + "context.traits.firstName" + ], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "last_name", + "sourceKeys": [ + "traits.lastname", + "traits.last_name", + "traits.lastName", + "context.traits.lastname", + "context.traits.last_name", + "context.traits.lastName" + ], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "email", + "sourceKeys": ["traits.email", "context.traits.email"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "age", + "sourceKeys": ["traits.age", "context.traits.age"], + "required": false, + "metadata": { + "type": "toNumber" + } + }, + { + "destKey": "gender", + "sourceKeys": ["traits.gender", "context.traits.gender"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "mobile", + "sourceKeys": ["traits.mobile", "context.traits.mobile"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "source", + "sourceKeys": ["traits.source", "context.traits.source"], + "required": false, + "metadata": { + "type": "toString" + } + }, + { + "destKey": "created_time", + "sourceKeys": ["traits.createdAt", "context.traits.createdAt"], + "required": false + }, + { + "destKey": "last_seen", + "sourceKeys": [ + "traits.last_seen", + "context.traits.last_seen", + "traits.lastSeen", + "context.traits.lastSeen" + ], + "required": false + }, + { + "destKey": "transactions", + "sourceKeys": ["traits.transactions", "context.traits.transactions"], + "required": false, + "metadata": { + "type": "toNumber" + } + }, + { + "destKey": "revenue", + "sourceKeys": ["traits.revenue", "context.traits.revenue"], + "required": false, + "metadata": { + "type": "toNumber" + } + }, + { + "destKey": "moe_unsubscribe", + "sourceKeys": [ + "traits.moe_unsubscribe", + "context.traits.moe_unsubscribe", + "traits.moeUnsubscribe", + "context.traits.moeUnsubscribe" + ], + "required": false + }, + { + "destKey": "data", + "sourceKeys": ["traits", "context.traits"], + "required": false, + "metadata": { + "excludes": [ + "_id", + "age", + "email", + "firstName", + "first_name", + "firstname", + "gender", + "id", + "lastName", + "lastSeen", + "last_name", + "last_seen", + "lastname", + "mobile", + "moeUnsubscribe", + "moe_unsubscribe", + "revenue", + "source", + "transactions" + ] + } + } +] diff --git a/src/v0/destinations/moengage/data/MOENGAGETrackAttributesObjectConfig.json b/src/v0/destinations/moengage/data/MOENGAGETrackAttributesObjectConfig.json new file mode 100644 index 00000000000..cb08c38e48e --- /dev/null +++ b/src/v0/destinations/moengage/data/MOENGAGETrackAttributesObjectConfig.json @@ -0,0 +1,35 @@ +[ + { + "destKey": "action", + "sourceKeys": "event", + "required": true + }, + { + "destKey": "attributes", + "sourceKeys": "properties", + "required": false + }, + { + "destKey": "platform", + "sourceKeys": ["context.device.type", "channel"], + "required": false + }, + { + "destKey": "app_version", + "sourceKeys": "context.app.version", + "required": false + }, + { + "destKey": "current_time", + "sourceKeys": ["timestamp", "originalTimestamp"], + "required": false + }, + { + "destKey": "user_timezone_offset", + "sourceKeys": "context.timezone", + "required": false, + "metadata": { + "type": "getOffsetInSec" + } + } +] diff --git a/src/v0/destinations/moengage/transform.js b/src/v0/destinations/moengage/transform.js index 2df921cb60f..2b094067592 100644 --- a/src/v0/destinations/moengage/transform.js +++ b/src/v0/destinations/moengage/transform.js @@ -3,6 +3,8 @@ const { ConfigurationError, TransformationError, InstrumentationError, + isObject, + isEmptyObject, } = require('@rudderstack/integrations-lib'); const { EventType } = require('../../../constants'); const { @@ -23,24 +25,92 @@ const { } = require('../../util'); const { JSON_MIME_TYPE } = require('../../util/constant'); -function responseBuilderSimple(message, category, destination) { - const payload = constructPayload(message, MAPPING_CONFIG[category.name]); - const { apiId, region, apiKey } = destination.Config; - const response = defaultRequestConfig(); - // check the region and which api end point should be used +// moengage supports object type, if user enables object data type we merge the custom attributes +// ref: https://help.moengage.com/hc/en-us/articles/29787626775828-Support-for-Object-Data-Type +const mergeCustomAttributes = (attributes) => { + if (!attributes.data) { + return attributes; + } + const { data, ...rest } = attributes; + return isObject(data) ? { ...rest, ...data } : rest; +}; + +// check the region and which api end point should be used +const getCommonDestinationEndpoint = ({ apiId, region, category }) => { switch (region) { case 'EU': - response.endpoint = `${endpointEU[category.type]}${apiId}`; - break; + return `${endpointEU[category.type]}${apiId}`; case 'US': - response.endpoint = `${endpointUS[category.type]}${apiId}`; - break; + return `${endpointUS[category.type]}${apiId}`; case 'IND': - response.endpoint = `${endpointIND[category.type]}${apiId}`; - break; + return `${endpointIND[category.type]}${apiId}`; default: throw new ConfigurationError('The region is not valid'); } +}; + +const createDestinationPayload = ({ message, category, useObjectData }) => { + const payload = {}; + const setPayloadAttributes = (configCategory) => { + payload.attributes = constructPayload(message, MAPPING_CONFIG[configCategory]); + payload.attributes = useObjectData + ? mergeCustomAttributes(payload.attributes) + : flattenJson(payload.attributes); + }; + + switch (category.type) { + case 'identify': + // Track User + payload.type = 'customer'; + setPayloadAttributes( + useObjectData + ? CONFIG_CATEGORIES.IDENTIFY_ATTR_OBJ.name + : CONFIG_CATEGORIES.IDENTIFY_ATTR.name, + ); + return payload; + case 'device': + // Track Device + payload.type = 'device'; + setPayloadAttributes( + useObjectData ? CONFIG_CATEGORIES.DEVICE_ATTR_OBJ.name : CONFIG_CATEGORIES.DEVICE_ATTR.name, + ); + + if (isAppleFamily(payload.attributes?.platform)) { + payload.attributes.platform = 'iOS'; + } + return payload; + case 'track': + // Create Event + payload.type = 'event'; + payload.actions = [ + constructPayload( + message, + useObjectData + ? MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_ATTR_OBJ.name] + : MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_ATTR.name], + ), + ]; + + if (isAppleFamily(payload.actions[0]?.platform)) { + payload.actions[0].platform = 'iOS'; + } + return payload; + default: + throw new InstrumentationError(`Event type ${category.type} is not supported`); + } +}; + +function responseBuilderSimple(message, category, destination) { + // preparing base payload with mandatory fields + const basePayload = constructPayload(message, MAPPING_CONFIG[category.name]); + if (!basePayload) { + // fail-safety for developer error + throw new TransformationError('Base payload could not be constructed'); + } + + const { apiId, region, apiKey, useObjectData } = destination.Config; + const response = defaultRequestConfig(); + response.endpoint = getCommonDestinationEndpoint({ apiId, region, category }); response.method = defaultPostRequestConfig.requestMethod; response.headers = { 'Content-Type': JSON_MIME_TYPE, @@ -50,58 +120,18 @@ function responseBuilderSimple(message, category, destination) { Authorization: `Basic ${btoa(`${apiId}:${apiKey}`)}`, }; response.userId = message.userId || message.anonymousId; - if (payload) { - switch (category.type) { - case 'identify': - // Ref: https://docs.moengage.com/docs/data-import-apis#user-api - payload.type = 'customer'; - payload.attributes = constructPayload( - message, - MAPPING_CONFIG[CONFIG_CATEGORIES.IDENTIFY_ATTR.name], - ); - // nested attributes are not by moengage so it is falttened - payload.attributes = flattenJson(payload.attributes); - break; - case 'device': - // Ref: https://docs.moengage.com/docs/data-import-apis#device-api - payload.type = 'device'; - payload.attributes = constructPayload( - message, - MAPPING_CONFIG[CONFIG_CATEGORIES.DEVICE_ATTR.name], - ); - // nested attributes are not by moengage so it is falttened - payload.attributes = flattenJson(payload.attributes); - - // Ref - https://developers.moengage.com/hc/en-us/articles/4413167466260-Device- - if (isAppleFamily(payload.attributes?.platform)) { - payload.attributes.platform = 'iOS'; - } - break; - case 'track': - // Ref: https://docs.moengage.com/docs/data-import-apis#event-api - payload.type = 'event'; - payload.actions = [ - constructPayload(message, MAPPING_CONFIG[CONFIG_CATEGORIES.TRACK_ATTR.name]), - ]; - // Ref - https://developers.moengage.com/hc/en-us/articles/4413174104852-Event- - if (isAppleFamily(payload.actions[0]?.platform)) { - payload.actions[0].platform = 'iOS'; - } - break; - case EventType.ALIAS: - // clean as per merge user call in moengage - delete response.headers['MOE-APPKEY']; - break; - default: - throw new InstrumentationError(`Event type ${category.type} is not supported`); - } - - response.body.JSON = removeUndefinedAndNullValues(payload); - } else { - // fail-safety for developer error + if (category.type === 'alias') { + delete response.headers['MOE-APPKEY']; + response.body.JSON = removeUndefinedAndNullValues(basePayload); + return response; + } + + const payload = createDestinationPayload({ message, category, useObjectData }); + if (isEmptyObject(payload)) { throw new TransformationError('Payload could not be constructed'); } + response.body.JSON = removeUndefinedAndNullValues({ ...basePayload, ...payload }); return response; } @@ -153,4 +183,9 @@ const processRouterDest = async (inputs, reqMetadata) => { return respList; }; -module.exports = { process, processRouterDest }; +module.exports = { + process, + processRouterDest, + mergeCustomAttributes, + getCommonDestinationEndpoint, +}; diff --git a/src/v0/destinations/moengage/transform.test.js b/src/v0/destinations/moengage/transform.test.js new file mode 100644 index 00000000000..54ad7bc9f50 --- /dev/null +++ b/src/v0/destinations/moengage/transform.test.js @@ -0,0 +1,74 @@ +const { mergeCustomAttributes, getCommonDestinationEndpoint } = require('./transform'); +const { endpointEU, endpointUS, endpointIND } = require('./config'); +const { ConfigurationError } = require('@rudderstack/integrations-lib'); + +describe('mergeCustomAttributes', () => { + test('should return attributes as is if data is not present', () => { + const attributes = { key1: 'value1', key2: 'value2' }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual(attributes); + }); + + test('should merge data into attributes if data is an object', () => { + const attributes = { key1: 'value1', data: { key2: 'value2', key3: 'value3' } }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual({ key1: 'value1', key2: 'value2', key3: 'value3' }); + }); + + test('should return attributes without data if data is not an object', () => { + const attributes = { key1: 'value1', data: 'notAnObject' }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual({ key1: 'value1' }); + }); + + test('should handle empty attributes', () => { + const attributes = {}; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual(attributes); + }); + + test('should handle attributes with empty data object', () => { + const attributes = { key1: 'value1', data: {} }; + const result = mergeCustomAttributes(attributes); + expect(result).toEqual({ key1: 'value1' }); + }); +}); + +describe('getCommonDestinationEndpoint', () => { + test('should return EU endpoint', () => { + const result = getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'EU', + category: { type: 'identify' }, + }); + expect(result).toBe(endpointEU.identify + 'testApiId'); + }); + + test('should return US endpoint', () => { + const result = getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'US', + category: { type: 'track' }, + }); + expect(result).toBe(endpointUS.track + 'testApiId'); + }); + + test('should return IND endpoint', () => { + const result = getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'IND', + category: { type: 'device' }, + }); + expect(result).toBe(endpointIND.device + 'testApiId'); + }); + + test('should throw ConfigurationError for invalid region', () => { + expect(() => { + getCommonDestinationEndpoint({ + apiId: 'testApiId', + region: 'INVALID', + category: { type: 'identify' }, + }); + }).toThrow(new ConfigurationError('The region is not valid')); + }); +}); diff --git a/test/integrations/destinations/moengage/processor/data.ts b/test/integrations/destinations/moengage/processor/data.ts index e561d24491b..f7572185621 100644 --- a/test/integrations/destinations/moengage/processor/data.ts +++ b/test/integrations/destinations/moengage/processor/data.ts @@ -6,7 +6,7 @@ const mockFns = (_) => { export const data = [ { name: 'moengage', - description: 'Test 0', + description: 'Test 0: Track event with nested arrays and product properties', feature: 'processor', module: 'destination', version: 'v0', @@ -304,7 +304,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 1', + description: 'Test 1: Identify call with user traits', feature: 'processor', module: 'destination', version: 'v0', @@ -436,7 +436,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 2', + description: 'Test 2: Identify call with custom traits', feature: 'processor', module: 'destination', version: 'v0', @@ -564,7 +564,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 3', + description: 'Test 3: Identify call with device information for Android', feature: 'processor', module: 'destination', version: 'v0', @@ -737,7 +737,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 4', + description: 'Test 4: Identify call with EU region configuration', feature: 'processor', module: 'destination', version: 'v0', @@ -869,7 +869,209 @@ export const data = [ }, { name: 'moengage', - description: 'Test 5', + description: 'Test 5: Pass traits as object with nested properties', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + anonymousId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5', + channel: 'web', + properties: { + key1: { + key1_1: 'value1', + key1_2: 'value2', + data: 'hello', + }, + data: { + key2: 'value2', + }, + key2: 'value2', + }, + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + device: { + id: '7e32188a4dab669f', + manufacturer: 'Google', + model: 'Android SDK built for x86', + name: 'generic_x86', + token: 'desuhere', + type: 'android', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + address: { + city: 'San Francisco', + country: 'USA', + }, + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', + }, + integrations: { All: true }, + messageId: '531e3507-1ef5-4a06-b83c-cb521ff34f0c', + originalTimestamp: '2020-10-16T08:53:29.386Z', + receivedAt: '2020-10-16T14:23:29.402+05:30', + request_ip: '[::1]', + sentAt: '2020-10-16T08:53:29.387Z', + timestamp: '2020-10-16T14:23:29.401+05:30', + type: 'identify', + userId: 'rudder123', + }, + destination: { + ID: '1iuTZs6eEZVMm6GjRBe6bNShaL3', + Name: 'MoEngage Testing', + DestinationDefinition: { + ID: '1iu4802Tx27kNC4KNYYou6D8jzL', + Name: 'MOENGAGE', + DisplayName: 'MoEngage', + Config: { + destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] }, + excludeKeys: [], + includeKeys: [], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + }, + Config: { + apiId: secret1, + apiKey: secret2, + eventDelivery: false, + eventDeliveryTS: 1602757086384, + region: 'US', + useObjectData: true, + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + type: 'customer', + attributes: { + name: 'Rudder Test', + plan: 'Enterprise', + email: 'rudderTest@gmail.com', + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + company: { id: 'abc123' }, + address: { + city: 'San Francisco', + country: 'USA', + }, + created_time: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + }, + customer_id: 'rudder123', + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + userId: 'rudder123', + headers: { + 'MOE-APPKEY': secret1, + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + version: '1', + endpoint: `https://api-01.moengage.com/v1/customer/${secret1}`, + }, + statusCode: 200, + }, + { + output: { + body: { + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + JSON: { + type: 'device', + device_id: '7e32188a4dab669f', + attributes: { + model: 'Android SDK built for x86', + push_id: 'desuhere', + platform: 'android', + app_version: '1.1.6', + key1: { + key1_1: 'value1', + key1_2: 'value2', + data: 'hello', + }, + data: { + key2: 'value2', + }, + key2: 'value2', + }, + customer_id: 'rudder123', + }, + }, + type: 'REST', + files: {}, + method: 'POST', + params: {}, + userId: 'rudder123', + headers: { + 'MOE-APPKEY': secret1, + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + version: '1', + endpoint: `https://api-01.moengage.com/v1/device/${secret1}`, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'moengage', + description: 'Test 6: Identify call with IND region configuration', feature: 'processor', module: 'destination', version: 'v0', @@ -1001,7 +1203,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 6', + description: 'Test 7: Invalid region configuration', feature: 'processor', module: 'destination', version: 'v0', @@ -1111,7 +1313,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 7', + description: 'Test 8: Missing event type validation', feature: 'processor', module: 'destination', version: 'v0', @@ -1220,7 +1422,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 8', + description: 'Test 9: Unsupported event type validation', feature: 'processor', module: 'destination', version: 'v0', @@ -1330,7 +1532,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 9', + description: 'Test 10: Track event with timezone offset', feature: 'processor', module: 'destination', version: 'v0', @@ -1639,7 +1841,299 @@ export const data = [ }, { name: 'moengage', - description: 'Test 10', + description: 'Test 11: Track event with object data enabled', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + timezone: 'Asia/Kolkata', + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.1.6', + }, + library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' }, + locale: 'en-GB', + os: { name: '', version: '' }, + page: { + path: '/testing/script-test.html', + referrer: '', + search: '', + title: '', + url: 'http://localhost:3243/testing/script-test.html', + }, + screen: { density: 2 }, + traits: { + company: { id: 'abc123' }, + createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)', + email: 'rudderTest@gmail.com', + name: 'Rudder Test', + plan: 'Enterprise', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36', + }, + event: 'Order Completed', + integrations: { All: true }, + messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a', + originalTimestamp: '2020-10-16T08:10:12.782Z', + properties: { + category: 'some category', + originalArray: [ + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + ], + checkout_id: 'what is checkout id here??', + coupon: 'APPARELSALE', + currency: 'GBP', + order_id: 'transactionId', + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, + }, + receivedAt: '2020-10-16T13:40:12.792+05:30', + request_ip: '[::1]', + sentAt: '2020-10-16T08:10:12.783Z', + timestamp: '2020-10-16T13:40:12.791+05:30', + type: 'track', + userId: 'rudder123', + }, + destination: { + ID: '1iuTZs6eEZVMm6GjRBe6bNShaL3', + Name: 'MoEngage Testing', + DestinationDefinition: { + ID: '1iu4802Tx27kNC4KNYYou6D8jzL', + Name: 'MOENGAGE', + DisplayName: 'MoEngage', + Config: { + destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] }, + excludeKeys: [], + includeKeys: [], + supportedSourceTypes: [ + 'android', + 'ios', + 'web', + 'unity', + 'amp', + 'cloud', + 'reactnative', + ], + }, + }, + Config: { + apiId: secret1, + apiKey: secret2, + eventDelivery: false, + eventDeliveryTS: 1602757086384, + region: 'US', + useObjectData: true, + }, + Enabled: true, + Transformations: [], + IsProcessorEnabled: true, + }, + }, + ], + method: 'POST', + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: `https://api-01.moengage.com/v1/event/${secret1}`, + headers: { + 'Content-Type': 'application/json', + 'MOE-APPKEY': secret1, + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + customer_id: 'rudder123', + type: 'event', + actions: [ + { + action: 'Order Completed', + attributes: { + checkout_id: 'what is checkout id here??', + coupon: 'APPARELSALE', + currency: 'GBP', + order_id: 'transactionId', + category: 'some category', + originalArray: [ + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { nested_field: 'nested value', tags: ['tag_1', 'tag_2', 'tag_3'] }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + { + nested_field: 'nested value', + tags: ['tag_1', 'tag_2', 'tag_3', 'tag_1', 'tag_2', 'tag_3'], + }, + ], + products: [ + { + brand: '', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/bacon-jam.jpg', + name: 'Food/Drink', + position: 1, + price: 3, + product_id: 'product-bacon-jam', + quantity: 2, + sku: 'sku-1', + typeOfProduct: 'Food', + url: 'https://www.example.com/product/bacon-jam', + value: 6, + variant: 'Extra topped', + }, + { + brand: 'Levis', + category: 'Merch', + currency: 'GBP', + image_url: 'https://www.example.com/product/t-shirt.jpg', + name: 'T-Shirt', + position: 2, + price: 12.99, + product_id: 'product-t-shirt', + quantity: 1, + sku: 'sku-2', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/t-shirt', + value: 12.99, + variant: 'White', + }, + { + brand: 'Levis', + category: 'Merch', + coupon: 'APPARELSALE', + currency: 'GBP', + image_url: 'https://www.example.com/product/offer-t-shirt.jpg', + name: 'T-Shirt-on-offer', + position: 1, + price: 12.99, + product_id: 'offer-t-shirt', + quantity: 1, + sku: 'sku-3', + typeOfProduct: 'Shirt', + url: 'https://www.example.com/product/offer-t-shirt', + value: 12.99, + variant: 'Black', + }, + ], + revenue: 31.98, + shipping: 4, + value: 31.98, + }, + app_version: '1.1.6', + current_time: '2020-10-16T13:40:12.791+05:30', + user_timezone_offset: 19800, + platform: 'web', + }, + ], + }, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + userId: 'rudder123', + }, + statusCode: 200, + }, + ], + }, + }, + mockFns, + }, + { + name: 'moengage', + description: 'Test 12: Track event with invalid timezone', feature: 'processor', module: 'destination', version: 'v0', @@ -1886,7 +2380,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 11', + description: 'Test 13: Identify call with iOS device information', feature: 'processor', module: 'destination', version: 'v0', @@ -2059,7 +2553,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 12', + description: 'Test 14: Track event with iOS device information and invalid timezone', feature: 'processor', module: 'destination', version: 'v0', @@ -2329,7 +2823,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 13', + description: 'Test 15: Track event with nested object properties and invalid timezone', feature: 'processor', module: 'destination', version: 'v0', @@ -2610,7 +3104,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 14', + description: 'Test 16: Alias call for user merging', feature: 'processor', module: 'destination', version: 'v0', @@ -2705,7 +3199,7 @@ export const data = [ }, { name: 'moengage', - description: 'Test 15', + description: 'Test 17: Alias call without previousId validation', feature: 'processor', module: 'destination', version: 'v0', @@ -2785,8 +3279,7 @@ export const data = [ }, { name: 'moengage', - description: - 'when identify is sent without context, the event should not throw internal server error', + description: 'Test 18: Identify call without context', feature: 'processor', module: 'destination', version: 'v0', From 7e54fa22e416aa998e6d2d009b36cff814df94a1 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 10 Mar 2025 13:43:09 +0530 Subject: [PATCH 143/160] feat: onboarding new source facebook lead ads (#4132) * feat: onboard new source facebook lead ads * chore: minor changes * fix: addressing comments * fix: addressing comments * fix: addressing comments * fix: addressing comments --------- Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --- src/sources/facebook_lead_ads/mapping.json | 66 ++ src/sources/facebook_lead_ads/transform.ts | 58 ++ src/sources/facebook_lead_ads/type.ts | 18 + src/v0/util/index.js | 16 + src/v0/util/index.test.js | 65 ++ .../sources/facebook_lead_ads/data.ts | 609 ++++++++++++++++++ 6 files changed, 832 insertions(+) create mode 100644 src/sources/facebook_lead_ads/mapping.json create mode 100644 src/sources/facebook_lead_ads/transform.ts create mode 100644 src/sources/facebook_lead_ads/type.ts create mode 100644 test/integrations/sources/facebook_lead_ads/data.ts diff --git a/src/sources/facebook_lead_ads/mapping.json b/src/sources/facebook_lead_ads/mapping.json new file mode 100644 index 00000000000..fabd79e3759 --- /dev/null +++ b/src/sources/facebook_lead_ads/mapping.json @@ -0,0 +1,66 @@ +[ + { + "sourceKeys": ["id", "facebook_lead_id"], + "destKeys": "userId" + }, + { + "sourceKeys": "full_name", + "destKeys": "context.traits.name" + }, + { + "sourceKeys": "first_name", + "destKeys": "context.traits.firstName" + }, + { + "sourceKeys": "last_name", + "destKeys": "context.traits.lastName" + }, + { + "sourceKeys": "date_of_birth", + "destKeys": "context.traits.birthday" + }, + { + "sourceKeys": "phone_number", + "destKeys": "context.traits.phone" + }, + { + "sourceKeys": "email", + "destKeys": "context.traits.email" + }, + { + "sourceKeys": "gender", + "destKeys": "context.traits.gender" + }, + { + "sourceKeys": "zip_code", + "destKeys": "context.traits.address.zipCode" + }, + { + "sourceKeys": "post_code", + "destKeys": "context.traits.address.postalCode" + }, + { + "sourceKeys": "state", + "destKeys": "context.traits.address.state" + }, + { + "sourceKeys": "city", + "destKeys": "context.traits.address.city" + }, + { + "sourceKeys": "country", + "destKeys": "context.traits.address.country" + }, + { + "sourceKeys": "province", + "destKeys": "context.traits.address.province" + }, + { + "sourceKeys": "street_address", + "destKeys": "context.traits.address.street" + }, + { + "sourceKeys": "company_name", + "destKeys": "context.traits.company.name" + } +] diff --git a/src/sources/facebook_lead_ads/transform.ts b/src/sources/facebook_lead_ads/transform.ts new file mode 100644 index 00000000000..70ede2610bf --- /dev/null +++ b/src/sources/facebook_lead_ads/transform.ts @@ -0,0 +1,58 @@ +import { TransformationError } from '@rudderstack/integrations-lib'; +import get from 'get-value'; +import Message = require('../message'); +import { EventType } from '../../constants'; +import { InputEventType, OutputEventType } from './type'; +import { SourceInputV2 } from '../../types'; +import { generateUUID } from '../../v0/util'; + +const { + removeUndefinedAndNullValues, + getBodyFromV2SpecPayload, + unwrapArrayValues, +} = require('../../v0/util'); + +const mapping = require('./mapping.json'); + +function processEvent(inputEvent: InputEventType): any { + const unwrappedInputEvent = unwrapArrayValues(inputEvent); + + if (Object.keys(unwrappedInputEvent).length === 0) { + throw new TransformationError('input event must have at least one field'); + } + + const message = new Message(`FacebookLeadAds`); + + // set event type identify + message.setEventType(EventType.IDENTIFY); + + // setting traits based on mapping + message.setPropertiesV2(unwrappedInputEvent, mapping); + + // set and transform originalTimestamp to ISO 8601 from mm/dd/yyyy hh:mm + if (unwrappedInputEvent.created_time) { + const date: Date = new Date(`${unwrappedInputEvent.created_time} UTC`); + if (!Number.isNaN(date.getTime())) { + message.setProperty('originalTimestamp', date.toISOString()); + } + } + + // set anonymous id if userId unavailable + if (!get(message, 'userId')) { + message.setProperty('anonymousId', generateUUID()); + } + + // add everything as it is in context.traits + if (!message.context.traits) message.context.traits = {}; + Object.assign(message.context.traits, unwrappedInputEvent); + + return message; +} + +const process = (payload: SourceInputV2) => { + const event = getBodyFromV2SpecPayload(payload); + const response: OutputEventType = processEvent(event); + return removeUndefinedAndNullValues(response); +}; + +export { process }; diff --git a/src/sources/facebook_lead_ads/type.ts b/src/sources/facebook_lead_ads/type.ts new file mode 100644 index 00000000000..05a3d9448da --- /dev/null +++ b/src/sources/facebook_lead_ads/type.ts @@ -0,0 +1,18 @@ +export type InputEventType = Record; + +export type OutputEventType = { + userId?: string; + anonymousId?: string; + type: 'identify'; + context: { + traits: Record; + library: { + name: string; + version: string; + }; + integration: { + name: string; + }; + }; + originalTimestamp?: Date; +}; diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 3206283c77c..5e41dfc687d 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -2367,6 +2367,21 @@ const getBodyFromV2SpecPayload = ({ request }) => { throw new TransformationError(ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD); }; +const unwrapArrayValues = (payload) => { + if (!payload || typeof payload !== 'object' || Array.isArray(payload)) { + throw new InstrumentationError('Payload must be an valid object'); + } + const result = {}; + Object.keys(payload).forEach((key) => { + if (Array.isArray(payload[key]) && payload[key].length === 1) { + [result[key]] = payload[key]; + } else { + result[key] = payload[key]; + } + }); + return result; +}; + // ======================================================================== // EXPORTS // ======================================================================== @@ -2496,4 +2511,5 @@ module.exports = { isAxiosError, convertToUuid, handleMetadataForValue, + unwrapArrayValues, }; diff --git a/src/v0/util/index.test.js b/src/v0/util/index.test.js index ba27ee1f703..06e0f84cb8c 100644 --- a/src/v0/util/index.test.js +++ b/src/v0/util/index.test.js @@ -13,6 +13,7 @@ const { isAxiosError, removeHyphens, convertToUuid, + unwrapArrayValues, } = require('./index'); const exp = require('constants'); const { ERROR_MESSAGES } = require('./constant'); @@ -1163,3 +1164,67 @@ describe('getBodyFromV2SpecPayload', () => { expect(utilities.getBodyFromV2SpecPayload(input)).toEqual([1, 2, 3]); }); }); + +describe('unwrapArrayValues', () => { + const testCases = [ + { + name: 'should throw an error if the payload is null', + input: null, + error: new InstrumentationError('Payload must be an valid object'), + }, + { + name: 'should throw an error if the payload is string', + input: 'payload', + error: new InstrumentationError('Payload must be an valid object'), + }, + { + name: 'should throw an error if the payload is array', + input: [], + error: new InstrumentationError('Payload must be an valid object'), + }, + { + name: 'should return an empty object when given an empty object', + input: {}, + expected: {}, + }, + { + name: 'should unwrap array of length 1 and assign the other value as it is', + input: { + ids: [1, 2, 3], + names: ['Test 1', 'Test 2', 'Test 3'], + items: [['apple', 'banana']], + age: [100], + id: '456', + emptyStr: [''], + emptyArray: [], + array: [null], + boolean: true, + null: null, + undefined: undefined, + }, + expected: { + ids: [1, 2, 3], + names: ['Test 1', 'Test 2', 'Test 3'], + items: ['apple', 'banana'], + age: 100, + id: '456', + emptyStr: '', + emptyArray: [], + array: null, + boolean: true, + null: null, + undefined: undefined, + }, + }, + ]; + + testCases.forEach(({ name, input, error, expected }) => { + it(name, () => { + if (error) { + expect(() => unwrapArrayValues(input)).toThrow(error); + } else { + expect(unwrapArrayValues(input)).toEqual(expected); + } + }); + }); +}); diff --git a/test/integrations/sources/facebook_lead_ads/data.ts b/test/integrations/sources/facebook_lead_ads/data.ts new file mode 100644 index 00000000000..694fae95b19 --- /dev/null +++ b/test/integrations/sources/facebook_lead_ads/data.ts @@ -0,0 +1,609 @@ +import utils from '../../../../src/v0/util'; + +const defaultMockFns = () => { + jest.spyOn(utils, 'generateUUID').mockReturnValue('dummy-anonymous-id-0-0'); +}; + +export const data = [ + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with facebook_lead_id', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 10:20'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: [200000], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: 200000, + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 10:20', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: 200000, + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + originalTimestamp: '2025-02-01T10:20:00.000Z', + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with valid created_time', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 10:20'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + id: ['3960271960958574'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 10:20', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + id: '3960271960958574', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + originalTimestamp: '2025-02-01T10:20:00.000Z', + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads without userId', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 10:20'], + date_of_birth: ['01/01/2000'], + first_name: ['Dummy'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 10:20', + date_of_birth: '01/01/2000', + firstName: 'Dummy', + first_name: 'Dummy', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + originalTimestamp: '2025-02-01T10:20:00.000Z', + anonymousId: 'dummy-anonymous-id-0-0', + type: 'identify', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with invalid created_time', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + created_time: ['02/01/2025 invalid 10:20'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + id: ['3960271960958574'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + created_time: '02/01/2025 invalid 10:20', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + id: '3960271960958574', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with unavailable/null created_time', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({ + available_at_this_time: ['2025-02-01T00:00:00+0530'], + city: ['Bengaluru'], + conditional_question_1: ['Sweatshirt'], + conditional_question_2: ['Black'], + conditional_question_3: ['Medium'], + country: ['IN'], + date_of_birth: ['01/01/2000'], + facebook_lead_id: ['3960271960958574'], + first_name: ['Dummy'], + id: ['3960271960958574'], + last_name: ['Name'], + military_status: ['na'], + phone_number: ['+910123456789'], + post_code: ['200000'], + relationship_status: ['na'], + 'short_answer_ques_1?': ['dummy short answer'], + state: ['Dummy State'], + street_address: ['Dummy Street'], + 'test_ques_1?': ['test ques'], + }), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + output: { + batch: [ + { + context: { + integration: { + name: 'FacebookLeadAds', + }, + library: { + name: 'unknown', + version: 'unknown', + }, + traits: { + address: { + city: 'Bengaluru', + country: 'IN', + postalCode: '200000', + state: 'Dummy State', + street: 'Dummy Street', + }, + available_at_this_time: '2025-02-01T00:00:00+0530', + birthday: '01/01/2000', + city: 'Bengaluru', + conditional_question_1: 'Sweatshirt', + conditional_question_2: 'Black', + conditional_question_3: 'Medium', + country: 'IN', + date_of_birth: '01/01/2000', + facebook_lead_id: '3960271960958574', + firstName: 'Dummy', + first_name: 'Dummy', + id: '3960271960958574', + lastName: 'Name', + last_name: 'Name', + military_status: 'na', + phone: '+910123456789', + phone_number: '+910123456789', + post_code: '200000', + relationship_status: 'na', + 'short_answer_ques_1?': 'dummy short answer', + state: 'Dummy State', + street_address: 'Dummy Street', + 'test_ques_1?': 'test ques', + }, + }, + integrations: { + FacebookLeadAds: false, + }, + type: 'identify', + userId: '3960271960958574', + }, + ], + }, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with null payload', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify(null), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Payload must be an valid object', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + implementation: 'native', + module: 'source', + srcType: 'facebook_lead_ads', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'facebook_lead_ads', + description: 'facebook lead ads with empty payload', + module: 'source', + version: 'v2', + input: { + request: { + body: [ + { + request: { + body: JSON.stringify({}), + }, + source: {}, + }, + ], + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + }, + pathSuffix: '', + }, + output: { + response: { + status: 200, + body: [ + { + error: 'input event must have at least one field', + statTags: { + destinationId: 'Non determinable', + errorCategory: 'transformation', + implementation: 'native', + module: 'source', + srcType: 'facebook_lead_ads', + workspaceId: 'Non determinable', + }, + statusCode: 400, + }, + ], + }, + }, + }, +].map((tc) => ({ + ...tc, + mockFns: () => { + defaultMockFns(); + }, +})); From 202f2445ca29f51b9c071213eba01b28d2821266 Mon Sep 17 00:00:00 2001 From: Alexandros Milaios Date: Mon, 10 Mar 2025 12:11:13 +0200 Subject: [PATCH 144/160] chore: use the new intgration lib in zoho vdmv2 implementation (#4151) * chore: use the new intgration lib in zoho vdmv2 implementation * chore: code review changes --- package-lock.json | 46 +++++-------------- package.json | 2 +- .../v2/destinations/zoho/transformRecordV2.js | 4 +- src/cdk/v2/destinations/zoho/utils.js | 33 ++++++++++--- src/cdk/v2/destinations/zoho/utils.test.js | 2 +- .../destinations/zoho/router/upsert.ts | 2 + 6 files changed, 44 insertions(+), 45 deletions(-) diff --git a/package-lock.json b/package-lock.json index c62da8f37f2..7b08b1e6b42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.19", + "@rudderstack/integrations-lib": "^0.2.22", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", @@ -2074,7 +2074,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "license": "MIT", "engines": { "node": ">=0.1.90" } @@ -2649,7 +2648,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", - "license": "MIT", "dependencies": { "colorspace": "1.1.x", "enabled": "2.0.x", @@ -4055,10 +4053,9 @@ "license": "MIT" }, "node_modules/@rudderstack/integrations-lib": { - "version": "0.2.20", - "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.20.tgz", - "integrity": "sha512-upXlQI+TiyZimQroBkDnSmo27z6WJYuSbtektR00vLNfSrc483ThIbfZiCLsa/UnWN5tR4vW9Kg1Xg5+hJi8oA==", - "license": "MIT", + "version": "0.2.22", + "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.22.tgz", + "integrity": "sha512-XB8bnyT4PSZGGsTRg6Sj5+n2d8ZG35MdSLrUAe5Udm+iKGtuY5XfjQMMIMsI2PPFoFTJj6PnmdN0wrhlTEcB2A==", "dependencies": { "axios": "^1.4.0", "eslint-config-airbnb-base": "^15.0.0", @@ -4085,7 +4082,6 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], - "license": "MIT", "bin": { "uuid": "dist/esm/bin/uuid" } @@ -5271,8 +5267,7 @@ "node_modules/@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "license": "MIT" + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==" }, "node_modules/@types/yargs": { "version": "17.0.33", @@ -7054,7 +7049,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "license": "MIT", "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" @@ -7079,7 +7073,6 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "license": "MIT", "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -7114,7 +7107,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", - "license": "MIT", "dependencies": { "color": "^3.1.3", "text-hex": "1.0.x" @@ -9299,8 +9291,7 @@ "node_modules/enabled": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "license": "MIT" + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -10484,8 +10475,7 @@ "node_modules/fecha": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "license": "MIT" + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" }, "node_modules/figures": { "version": "3.2.0", @@ -10714,8 +10704,7 @@ "node_modules/fn.name": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "license": "MIT" + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { "version": "1.15.9", @@ -15315,7 +15304,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", - "license": "MIT", "engines": { "node": "*" } @@ -15606,8 +15594,7 @@ "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "license": "MIT" + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" }, "node_modules/lazy-ass": { "version": "1.6.0", @@ -16471,7 +16458,6 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", - "license": "MIT", "dependencies": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", @@ -18037,7 +18023,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", - "license": "MIT", "dependencies": { "fn.name": "1.x.x" } @@ -20450,7 +20435,6 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "license": "MIT", "dependencies": { "is-arrayish": "^0.3.1" } @@ -20458,8 +20442,7 @@ "node_modules/simple-swizzle/node_modules/is-arrayish": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "license": "MIT" + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, "node_modules/sisteransi": { "version": "1.0.5", @@ -20658,7 +20641,6 @@ "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", - "license": "MIT", "engines": { "node": "*" } @@ -21758,8 +21740,7 @@ "node_modules/text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "license": "MIT" + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, "node_modules/text-table": { "version": "0.2.0", @@ -21863,7 +21844,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "license": "MIT", "engines": { "node": ">= 14.0.0" } @@ -22701,7 +22681,6 @@ "version": "3.17.0", "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", - "license": "MIT", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", @@ -22723,7 +22702,6 @@ "version": "4.9.0", "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", - "license": "MIT", "dependencies": { "logform": "^2.7.0", "readable-stream": "^3.6.2", @@ -22737,7 +22715,6 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -22751,7 +22728,6 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", diff --git a/package.json b/package.json index c87f995f668..c2c2c8c96fc 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.19", + "@rudderstack/integrations-lib": "^0.2.22", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", diff --git a/src/cdk/v2/destinations/zoho/transformRecordV2.js b/src/cdk/v2/destinations/zoho/transformRecordV2.js index 44874235f08..a81b10767da 100644 --- a/src/cdk/v2/destinations/zoho/transformRecordV2.js +++ b/src/cdk/v2/destinations/zoho/transformRecordV2.js @@ -17,7 +17,7 @@ const { const zohoConfig = require('./config'); const { deduceModuleInfoV2, - validatePresenceOfMandatoryProperties, + validatePresenceOfMandatoryPropertiesV2, formatMultiSelectFieldsV2, handleDuplicateCheckV2, searchRecordIdV2, @@ -155,7 +155,7 @@ const handleUpsert = async ( transformedResponseToBeBatched, errorResponseList, ) => { - const eventErroneous = validatePresenceOfMandatoryProperties(operationModuleType, allFields); + const eventErroneous = validatePresenceOfMandatoryPropertiesV2(destConfig.object, allFields); if (eventErroneous?.status) { const error = new ConfigurationError( diff --git a/src/cdk/v2/destinations/zoho/utils.js b/src/cdk/v2/destinations/zoho/utils.js index 3260a44738b..a38103ccc19 100644 --- a/src/cdk/v2/destinations/zoho/utils.js +++ b/src/cdk/v2/destinations/zoho/utils.js @@ -4,7 +4,9 @@ const { ConfigurationError, isDefinedAndNotNullAndNotEmpty, removeUndefinedNullEmptyExclBoolInt, + ZOHO_SDK, } = require('@rudderstack/integrations-lib'); +const { isEmpty } = require('lodash'); const { getDestinationExternalIDInfoForRetl, isHttpStatusSuccess } = require('../../../../v0/util'); const zohoConfig = require('./config'); const { handleHttpRequest } = require('../../../../adapters/network'); @@ -37,7 +39,10 @@ const deduceModuleInfoV2 = (Config, destConfig) => { const identifierType = identifierMappings.map(({ to }) => to); return { operationModuleType: object, - upsertEndPoint: zohoConfig.COMMON_RECORD_ENDPOINT(Config.region).replace('moduleType', object), + upsertEndPoint: ZOHO_SDK.ZOHO.getBaseRecordUrl({ + dataCenter: Config.region, + moduleName: object, + }), identifierType, }; }; @@ -59,6 +64,24 @@ function validatePresenceOfMandatoryProperties(objectName, object) { }; } +function validatePresenceOfMandatoryPropertiesV2(objectName, object) { + const { ZOHO } = ZOHO_SDK; + const moduleWiseMandatoryFields = ZOHO.fetchModuleWiseMandatoryFields(objectName); + if (isEmpty(moduleWiseMandatoryFields)) { + return undefined; + } + // All the required field keys are mapped but we need to check they have values + // We have this gurantee because the creation of the configuration doens't permit user to omit the mandatory fields + const missingFields = moduleWiseMandatoryFields.filter( + (field) => object.hasOwnProperty(field) && !isDefinedAndNotNullAndNotEmpty(object[field]), + ); + + return { + status: missingFields.length > 0, + missingField: missingFields, + }; +} + const formatMultiSelectFields = (config, fields) => { const multiSelectFields = getHashFromArray( config.multiSelectFieldLevelDecision, @@ -120,11 +143,8 @@ const handleDuplicateCheckV2 = (addDefaultDuplicateCheck, identifierType, operat let additionalFields = []; if (addDefaultDuplicateCheck) { - const moduleDuplicateCheckField = - zohoConfig.MODULE_WISE_DUPLICATE_CHECK_FIELD[operationModuleType]; - additionalFields = isDefinedAndNotNull(moduleDuplicateCheckField) - ? moduleDuplicateCheckField - : ['Name']; + const { ZOHO } = ZOHO_SDK; + additionalFields = ZOHO.fetchModuleWiseDuplicateCheckField(operationModuleType); } return Array.from(new Set([...identifierType, ...additionalFields])); @@ -301,6 +321,7 @@ module.exports = { deduceModuleInfo, deduceModuleInfoV2, validatePresenceOfMandatoryProperties, + validatePresenceOfMandatoryPropertiesV2, formatMultiSelectFields, formatMultiSelectFieldsV2, handleDuplicateCheck, diff --git a/src/cdk/v2/destinations/zoho/utils.test.js b/src/cdk/v2/destinations/zoho/utils.test.js index 68e2a8e6376..cf8e5a7ab71 100644 --- a/src/cdk/v2/destinations/zoho/utils.test.js +++ b/src/cdk/v2/destinations/zoho/utils.test.js @@ -820,7 +820,7 @@ describe('deduceModuleInfoV2', () => { { name: 'should use default US region when config.region is null', input: { - config: { region: null }, + config: {}, destination: { object: 'Leads', identifierMappings: [{ to: 'Email', from: 'Email' }], diff --git a/test/integrations/destinations/zoho/router/upsert.ts b/test/integrations/destinations/zoho/router/upsert.ts index 8c19ef06e40..1b5d584f7ab 100644 --- a/test/integrations/destinations/zoho/router/upsert.ts +++ b/test/integrations/destinations/zoho/router/upsert.ts @@ -992,6 +992,8 @@ export const upsertData = [ rudderId: '2', fields: { 'multi-language': 'Bengali', + First_Name: 'subcribed', + Last_Name: null, }, identifiers: { email: 'subscribed@eewrfrd.com', From 6c458a20db3e10a3149631a7bf9b8450735a4dd2 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 10 Mar 2025 10:45:20 +0000 Subject: [PATCH 145/160] chore(release): 1.93.0 --- CHANGELOG.md | 14 ++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c8c7cb3c2..3b256264fc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ 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.93.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.92.1...v1.93.0) (2025-03-10) + + +### Features + +* **destination:** pass object data in event for moengage ([#4111](https://github.com/rudderlabs/rudder-transformer/issues/4111)) ([5edfbb8](https://github.com/rudderlabs/rudder-transformer/commit/5edfbb834bfde0d39f6f177406ebf70a1138ddad)) +* onboarding new source facebook lead ads ([#4132](https://github.com/rudderlabs/rudder-transformer/issues/4132)) ([7e54fa2](https://github.com/rudderlabs/rudder-transformer/commit/7e54fa22e416aa998e6d2d009b36cff814df94a1)) + + +### Bug Fixes + +* **destination:** use coql api to delete record for zoho ([#4134](https://github.com/rudderlabs/rudder-transformer/issues/4134)) ([2c67c9a](https://github.com/rudderlabs/rudder-transformer/commit/2c67c9abe6ca50320bea195d22bc00f70ee65ddf)) +* marketo get auth token cache issue ([#4140](https://github.com/rudderlabs/rudder-transformer/issues/4140)) ([29175ac](https://github.com/rudderlabs/rudder-transformer/commit/29175ac13e1918a67e9a8367423fd9c1327aacc5)) + ### [1.92.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.92.0...v1.92.1) (2025-03-07) diff --git a/package-lock.json b/package-lock.json index 7b08b1e6b42..8f36253ae1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.92.1", + "version": "1.93.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.92.1", + "version": "1.93.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index c2c2c8c96fc..f79286a33e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.92.1", + "version": "1.93.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From 39f670d3850fc4a7f41d6cbd5ac8ee3daa0f77c7 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Wed, 12 Mar 2025 11:06:56 +0530 Subject: [PATCH 146/160] chore: add skipping support to component test (#4157) * chore: add skipping support to component test * chore: address pr comments --- CONTRIBUTING.md | 30 ++++- jest.config.js | 2 +- jest.config.typescript.js | 2 +- package-lock.json | 6 +- test/integrations/component.test.ts | 121 ++++++++++-------- .../destinations/examples/processor/data.ts | 24 ++++ .../destinations/examples/router/data.ts | 24 ++++ test/integrations/testUtils.ts | 3 +- 8 files changed, 149 insertions(+), 63 deletions(-) create mode 100644 test/integrations/destinations/examples/processor/data.ts create mode 100644 test/integrations/destinations/examples/router/data.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f735f4f04b4..6a810cd0df5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ See the project's [README](README.md) for further information about working in t 1. Submit an [issue][issue] describing your proposed change. 2. We will try to respond to your issue promptly. 3. Fork this repo, develop and test your code changes. See the project's [README](README.md) for further information about working in this repository. -4. Submit a pull request against this repo's `main` branch. +4. Submit a pull request against this repo's `develop` branch. - Include instructions on how to test your changes. 5. Your branch may be merged once all configured checks pass, including: - A review from appropriate maintainers @@ -31,11 +31,37 @@ See the project's [README](README.md) for further information about working in t ### Are you developing a new Integration with us? 1. Fork this repo, develop and test your code changes. See the project's [README](README.md) for further information about working in this repository. -2. Submit a pull request against this repo's `main` branch. +2. Submit a pull request against this repo's `develop` branch. - Include instructions on how to test your changes. 3. Your branch may be merged once all configured checks pass, including: - A review from appropriate maintainers +### Test-Driven Development (Recommended) + +1. **Write Component Test Cases First:** + Before developing a new integration (whether for a source or destination), start by writing [component test cases](./test/integrations/). This approach ensures clarity on expected behavior and outcomes. + +2. **Use Skipped Tests for Context:** + Write your test cases with the `skip` option to prevent them from running initially. This allows reviewers to understand the business context and requirements before the actual integration is developed. Once the test cases are approved, proceed with the implementation. + +3. **Skipping Entire Test Files:** + To skip an entire test file, use the following syntax. See this [example](./test/integrations/destinations/examples/processor/data.ts): + ```ts + export const skip = true; + export const data = [...] + ``` + +4. **Skipping Individual Test Cases:** + To skip specific test cases within a file, use this syntax. See this [example](./test/integrations/destinations/examples/router/data.ts): + ```ts + export const data = [ + { + skip: true, + ... + } + ] + ``` + ## Committing We prefer squash or rebase commits so that all changes from a branch are diff --git a/jest.config.js b/jest.config.js index f126aee9ca9..b76badd5a44 100644 --- a/jest.config.js +++ b/jest.config.js @@ -79,7 +79,7 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - modulePathIgnorePatterns: ['/test/__mocks__/axios.js'], + modulePathIgnorePatterns: ['/test/__mocks__/axios.js', '/dist/'], // Activates notifications for test results notify: true, diff --git a/jest.config.typescript.js b/jest.config.typescript.js index 35997cb70c3..6aa029f8973 100644 --- a/jest.config.typescript.js +++ b/jest.config.typescript.js @@ -78,7 +78,7 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - modulePathIgnorePatterns: ['/test/__mocks__/axios.js'], + modulePathIgnorePatterns: ['/test/__mocks__/axios.js', '/dist/'], // Activates notifications for test results notify: true, diff --git a/package-lock.json b/package-lock.json index 7b08b1e6b42..b1ed048207e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6011,9 +6011,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", - "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz", + "integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 7c9ecfc0f98..8388370b0e0 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -21,7 +21,7 @@ import tags from '../../src/v0/util/tags'; import { Server } from 'http'; import { appendFileSync } from 'fs'; import { assertRouterOutput, responses } from '../testHelper'; -import { generateTestReport, initaliseReport } from '../test_reporter/reporter'; +import { initaliseReport } from '../test_reporter/reporter'; import _ from 'lodash'; import defaultFeaturesConfig from '../../src/features'; import { ControllerUtility } from '../../src/controllers/util'; @@ -41,7 +41,7 @@ command .allowUnknownOption() .option('-d, --destination ', 'Enter Destination Name') .option('-f, --feature ', 'Enter Feature Name(processor, router)') - .option('-i, --index ', 'Enter Test index') + .option('-i, --index ', 'Enter Test index', parseInt) .option('-g, --generate ', 'Enter "true" If you want to generate network file') .option('-id, --id ', 'Enter unique "Id" of the test case you want to run') .option('-s, --source ', 'Enter Source Name') @@ -198,61 +198,72 @@ const sourceTestHandler = async (tcData) => { const mockAdapter = new MockAxiosAdapter(axios as any, { onNoMatch: 'throwException' }); registerAxiosMocks(mockAdapter, getTestMockData(opts.destination || opts.source)); -describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { - beforeEach(() => { - jest.resetAllMocks(); - jest.clearAllMocks(); - }); - let testData: TestCaseData[] = getTestData(testDataPath); - if (opts.index !== undefined) { - testData = [testData[parseInt(opts.index)]]; - } - if (opts.id) { - testData = testData.filter((data) => data.id === opts.id); - } - - const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => { - if (tcData.module === tags.MODULES.SOURCE) { - return [ - { - tcData, - sourceTransformV2Flag: false, - descriptionSuffix: ' (sourceTransformV2Flag: false)', - }, - { - tcData, - sourceTransformV2Flag: true, - descriptionSuffix: ' (sourceTransformV2Flag: true)', - }, - ]; - } - return [{ tcData, descriptionSuffix: '' }]; - }); +describe('Component Test Suite', () => { + if (allTestDataFilePaths.length === 0) { + // Reason: No test cases matched the given criteria + test.skip('No test cases provided. Skipping tests.', () => {}); + } else { + describe.each(allTestDataFilePaths)('%s Tests', (testDataPath) => { + beforeEach(() => { + jest.resetAllMocks(); + jest.clearAllMocks(); + }); + let testData: TestCaseData[] = getTestData(testDataPath); + if (opts.index < testData.length && opts.index >= 0) { + testData = [testData[opts.index]]; + } + if (opts.id) { + testData = testData.filter((data) => data.id === opts.id); + } - describe(`${testData[0].name} ${testData[0].module}`, () => { - test.each(extendedTestData)( - '$tcData.feature -> $tcData.description$descriptionSuffix (index: $#)', - async ({ tcData, sourceTransformV2Flag }) => { - tcData?.mockFns?.(mockAdapter); - - switch (tcData.module) { - case tags.MODULES.DESTINATION: - await destinationTestHandler(tcData); - break; - case tags.MODULES.SOURCE: - tcData?.mockFns?.(mockAdapter); - testSetupSourceTransformV2(sourceTransformV2Flag); - await sourceTestHandler(tcData); - break; - default: - console.log('Invalid module'); - // Intentionally fail the test case - expect(true).toEqual(false); - break; + const extendedTestData: ExtendedTestCaseData[] = testData.flatMap((tcData) => { + if (tcData.module === tags.MODULES.SOURCE) { + return [ + { + tcData, + sourceTransformV2Flag: false, + descriptionSuffix: ' (sourceTransformV2Flag: false)', + }, + { + tcData, + sourceTransformV2Flag: true, + descriptionSuffix: ' (sourceTransformV2Flag: true)', + }, + ]; } - }, - ); - }); + return [{ tcData, descriptionSuffix: '' }]; + }); + if (extendedTestData.length === 0) { + // Reason: user may have skipped the test cases + test.skip('No test cases provided. Skipping tests.', () => {}); + } else { + describe(`${testData[0].name} ${testData[0].module}`, () => { + test.each(extendedTestData)( + '$tcData.feature -> $tcData.description$descriptionSuffix (index: $#)', + async ({ tcData, sourceTransformV2Flag }) => { + tcData?.mockFns?.(mockAdapter); + + switch (tcData.module) { + case tags.MODULES.DESTINATION: + await destinationTestHandler(tcData); + break; + case tags.MODULES.SOURCE: + tcData?.mockFns?.(mockAdapter); + testSetupSourceTransformV2(sourceTransformV2Flag); + await sourceTestHandler(tcData); + break; + default: + console.log('Invalid module'); + // Intentionally fail the test case + expect(true).toEqual(false); + break; + } + }, + ); + }); + } + }); + } }); const testSetupSourceTransformV2 = (flag) => { diff --git a/test/integrations/destinations/examples/processor/data.ts b/test/integrations/destinations/examples/processor/data.ts new file mode 100644 index 00000000000..bd108005a78 --- /dev/null +++ b/test/integrations/destinations/examples/processor/data.ts @@ -0,0 +1,24 @@ +import { TestCaseData } from '../../../testTypes'; +export const skip = true; +export const data: TestCaseData[] = [ + { + name: 'test', + module: 'test', + description: 'test', + feature: 'test', + input: { + request: { + method: 'GET', + body: { + test: 'test', + }, + }, + }, + output: { + response: { + status: 200, + body: 'test', + }, + }, + }, +]; diff --git a/test/integrations/destinations/examples/router/data.ts b/test/integrations/destinations/examples/router/data.ts new file mode 100644 index 00000000000..601fedd66e0 --- /dev/null +++ b/test/integrations/destinations/examples/router/data.ts @@ -0,0 +1,24 @@ +import { TestCaseData } from '../../../testTypes'; +export const data: TestCaseData[] = [ + { + name: 'test', + module: 'test', + description: 'test', + feature: 'test', + skip: true, + input: { + request: { + method: 'GET', + body: { + test: 'test', + }, + }, + }, + output: { + response: { + status: 200, + body: 'test', + }, + }, + }, +]; diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts index b2c52cc9eae..6c234bcd0f3 100644 --- a/test/integrations/testUtils.ts +++ b/test/integrations/testUtils.ts @@ -47,7 +47,8 @@ export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): strin }; export const getTestData = (filePath): TestCaseData[] => { - return filter(require(filePath).data as TestCaseData[]); + const { data, skip } = require(filePath); + return skip ? [] : filter(data as TestCaseData[]); }; export const getTestSecrets = (destination: string) => { From 8aad46fd8bde0d839a33751ef16e9e68c168c125 Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:13:17 +0530 Subject: [PATCH 147/160] feat: onboarding new destination accoil analytics (#4156) * feat: new destination for accoil analytics * feat: removed anonymousId mapping, added ACCOIL_ANALYTICS to features.ts * feat: refactored processor and router data test files * fix: minor changes * feat: added masked secrets * fix: addressing comment * fix: apply suggestions from code review Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> --------- Co-authored-by: David Meiklejohn Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> --- .../accoil_analytics/procWorkflow.yaml | 122 ++ .../accoil_analytics/rtWorkflow.yaml | 33 + .../v2/destinations/accoil_analytics/utils.ts | 6 + src/features.ts | 1 + .../accoil_analytics/maskedSecrets.ts | 8 + .../accoil_analytics/processor/data.ts | 1397 +++++++++++++++++ .../accoil_analytics/router/data.ts | 471 ++++++ 7 files changed, 2038 insertions(+) create mode 100644 src/cdk/v2/destinations/accoil_analytics/procWorkflow.yaml create mode 100644 src/cdk/v2/destinations/accoil_analytics/rtWorkflow.yaml create mode 100644 src/cdk/v2/destinations/accoil_analytics/utils.ts create mode 100644 test/integrations/destinations/accoil_analytics/maskedSecrets.ts create mode 100644 test/integrations/destinations/accoil_analytics/processor/data.ts create mode 100644 test/integrations/destinations/accoil_analytics/router/data.ts diff --git a/src/cdk/v2/destinations/accoil_analytics/procWorkflow.yaml b/src/cdk/v2/destinations/accoil_analytics/procWorkflow.yaml new file mode 100644 index 00000000000..3d9eb319843 --- /dev/null +++ b/src/cdk/v2/destinations/accoil_analytics/procWorkflow.yaml @@ -0,0 +1,122 @@ +bindings: + - name: EventType + path: ../../../../constants + - path: ../../bindings/jsontemplate + exportAll: true + - name: removeUndefinedAndNullValues + path: ../../../../v0/util + - name: base64Convertor + path: ../../../../v0/util + - path: ./utils + +steps: + - name: validateInput + template: | + $.assert(.message.type, "message type is not present. Aborting message."); + $.assert(.message.type in {{$.EventType.([.TRACK, .PAGE, .SCREEN, .IDENTIFY, .GROUP])}}, + "message type " + .message.type + " is not supported"); + $.assertConfig(.destination.Config.apiKey, "apiKey must be supplied in destination config"); + +# Note our auth does not require a password in basic auth just the string "key:" + - name: prepareContext + template: | + $.context.messageType = .message.type.toLowerCase(); + $.context.payload = { + "type": $.context.messageType + }; + $.context.finalHeaders = { + "Authorization": "Basic " + $.base64Convertor(.destination.Config.apiKey + ":"), + "Content-Type": "application/json" + }; + $.context.endpoint = $.endpointUrl(.destination.Config.apiKey); + + - name: trackPayload + condition: $.context.messageType == {{$.EventType.TRACK}} + template: | + $.context.payload.event = .message.event; + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}) + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}) + + - name: pagePayload + condition: $.context.messageType == {{$.EventType.PAGE}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}); + $.context.payload.name = .message.name; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + + - name: screenPayload + condition: $.context.messageType == {{$.EventType.SCREEN}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}); + $.context.payload.name = .message.name; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + + - name: identifyPayload + condition: $.context.messageType == {{$.EventType.IDENTIFY}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userIdOnly")}}}}); + $.context.payload.traits = .message.traits ?? .message.context.traits; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + + - name: groupPayload + condition: $.context.messageType == {{$.EventType.GROUP}} + template: | + $.context.payload.userId = .message.().({{{{$.getGenericPaths("userId")}}}}); + $.context.payload.groupId = .message.groupId; + $.context.payload.timestamp = .message.().({{{{$.getGenericPaths("timestamp")}}}}); + $.context.payload.traits = .message.traits; + + - name: validateTimestamp + template: | + $.assert($.context.payload.timestamp, "timestamp is required for all calls") + + - name: validateTrackPayload + condition: $.context.messageType == {{$.EventType.TRACK}} + template: | + $.assert($.context.payload.event, "event is required for track call") + $.assert($.context.payload.userId, "userId is required for track call") + + - name: validatePagePayload + condition: $.context.messageType == {{$.EventType.PAGE}} + template: | + $.assert($.context.payload.name, "name is required for page call") + $.assert($.context.payload.userId, "userId is required for page call") + + - name: validateScreenPayload + condition: $.context.messageType == {{$.EventType.SCREEN}} + template: | + $.assert($.context.payload.name, "name is required for screen call") + $.assert($.context.payload.userId, "userId is required for screen call") + + - name: validateIdentifyPayload + condition: $.context.messageType == {{$.EventType.IDENTIFY}} + template: | + $.assert($.context.payload.userId, "userId is required for identify call") + + - name: validateGroupPayload + condition: $.context.messageType == {{$.EventType.GROUP}} + template: | + $.assert($.context.payload.userId, "userId is required for group call") + $.assert($.context.payload.groupId, "groupId is required for group call") + + - name: cleanPayload + template: | + $.context.payload = $.removeUndefinedAndNullValues($.context.payload); + + - name: buildResponseForProcessTransformation + template: | + $.context.payload.({ + "body": { + "JSON": ., + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": $.context.endpoint, + "headers": $.context.finalHeaders, + "params": {}, + "files": {} + }) \ No newline at end of file diff --git a/src/cdk/v2/destinations/accoil_analytics/rtWorkflow.yaml b/src/cdk/v2/destinations/accoil_analytics/rtWorkflow.yaml new file mode 100644 index 00000000000..88cb78352f2 --- /dev/null +++ b/src/cdk/v2/destinations/accoil_analytics/rtWorkflow.yaml @@ -0,0 +1,33 @@ +bindings: + - name: handleRtTfSingleEventError + path: ../../../../v0/util/index + +steps: + - name: validateInput + template: | + $.assert(Array.isArray(^) && ^.length > 0, "Invalid event array") + + - name: transform + externalWorkflow: + path: ./procWorkflow.yaml + loopOverInput: true + + - name: successfulEvents + template: | + $.outputs.transform#idx.output.({ + "batchedRequest": ., + "batched": false, + "destination": ^[idx].destination, + "metadata": ^[idx].metadata[], + "statusCode": 200 + })[] + + - name: failedEvents + template: | + $.outputs.transform#idx.error.( + $.handleRtTfSingleEventError(^[idx], .originalError ?? ., {}) + )[] + + - name: finalPayload + template: | + [...$.outputs.failedEvents, ...$.outputs.successfulEvents] diff --git a/src/cdk/v2/destinations/accoil_analytics/utils.ts b/src/cdk/v2/destinations/accoil_analytics/utils.ts new file mode 100644 index 00000000000..f59fac2ea26 --- /dev/null +++ b/src/cdk/v2/destinations/accoil_analytics/utils.ts @@ -0,0 +1,6 @@ +const stgRegex = /^stg_/i; + +export const endpointUrl = (apiKey: string): string => { + const staging: boolean = stgRegex.test(apiKey); + return staging ? 'https://instaging.accoil.com/segment' : 'https://in.accoil.com/segment'; +}; diff --git a/src/features.ts b/src/features.ts index 460f2720aff..cc4f0e541db 100644 --- a/src/features.ts +++ b/src/features.ts @@ -95,6 +95,7 @@ const defaultFeaturesConfig: FeaturesConfig = { LINKEDIN_AUDIENCE: true, TOPSORT: true, CUSTOMERIO_AUDIENCE: true, + ACCOIL_ANALYTICS: true, }, regulations: [ 'BRAZE', diff --git a/test/integrations/destinations/accoil_analytics/maskedSecrets.ts b/test/integrations/destinations/accoil_analytics/maskedSecrets.ts new file mode 100644 index 00000000000..f1b1c5acae9 --- /dev/null +++ b/test/integrations/destinations/accoil_analytics/maskedSecrets.ts @@ -0,0 +1,8 @@ +import path from 'path'; +import { base64Convertor } from '@rudderstack/integrations-lib'; + +export const secret1 = path.basename(__dirname) + 1; +export const secretStaging1 = `stg_` + path.basename(__dirname) + 1; + +export const authHeader1 = `Basic ${base64Convertor(secret1 + ':')}`; +export const authHeaderStaging1 = `Basic ${base64Convertor(secretStaging1 + ':')}`; diff --git a/test/integrations/destinations/accoil_analytics/processor/data.ts b/test/integrations/destinations/accoil_analytics/processor/data.ts new file mode 100644 index 00000000000..fae881f8b64 --- /dev/null +++ b/test/integrations/destinations/accoil_analytics/processor/data.ts @@ -0,0 +1,1397 @@ +import { ProcessorTestData } from '../../../testTypes'; +import { Metadata } from '../../../../../src/types'; +import { authHeader1, authHeaderStaging1, secret1, secretStaging1 } from '../maskedSecrets'; + +const baseMetadata: Metadata = { + destinationDefinitionId: 'default-dest-def', + destinationType: 'default-destination-type', + eventName: 'default-event', + eventType: 'default-type', + instanceId: 'default-instance', + jobId: 1, + jobRunId: 'default-job-run', + mergedTpConfig: {}, + messageId: 'default-message-id', + messageIds: ['default-message-id'], + namespace: 'default-namespace', + oauthAccessToken: 'default-token', + receivedAt: '2024-12-10T06:45:09.572Z', + recordId: {}, + rudderId: 'default-rudder-id', + sourceBatchId: 'default-batch', + sourceCategory: 'default-category', + sourceDefinitionId: 'default-source-def', + sourceId: 'default-source', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + sourceTpConfig: {}, + sourceType: 'default-source-type', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + transformationId: 'default-transform', + destinationId: 'default-destination', + workspaceId: 'default-workspace', +}; + +export const data: ProcessorTestData[] = [ + // Successful track + { + id: 'accoil-analytics-destination-processor-100', + name: 'accoil_analytics', + description: 'Successful track event', + scenario: 'Track event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + event: 'Activated', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + type: 'track', + event: 'Activated', + userId: '1234567890', + timestamp: '2024-01-23T08:35:17.562Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful identify + { + id: 'accoil-analytics-destination-processor-200', + name: 'accoil_analytics', + description: 'Successful identify event', + scenario: 'Identify event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'identify', + traits: { + email: 'bobby@example.com', + name: 'Little Bobby', + role: 'admin', + createdAt: '2024-01-20T08:35:17.342Z', + accountStatus: 'trial', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'identify', + traits: { + email: 'bobby@example.com', + name: 'Little Bobby', + role: 'admin', + createdAt: '2024-01-20T08:35:17.342Z', + accountStatus: 'trial', + }, + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful group + { + id: 'accoil-analytics-destination-processor-300', + name: 'accoil_analytics', + description: 'Successful group event', + scenario: 'Group event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + groupId: 'bobbygroup', + type: 'group', + traits: { + name: 'Little Bobby Group', + createdAt: '2024-01-20T08:35:17.342Z', + status: 'paid', + mrr: '10.1', + plan: 'basic', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + groupId: 'bobbygroup', + type: 'group', + traits: { + name: 'Little Bobby Group', + createdAt: '2024-01-20T08:35:17.342Z', + status: 'paid', + mrr: '10.1', + plan: 'basic', + }, + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful page + { + id: 'accoil-analytics-destination-processor-400', + name: 'accoil_analytics', + description: 'Successful page event', + scenario: 'Page event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'page', + name: 'Account Details', + traits: { + name: 'Sub page: Configuration', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'page', + name: 'Account Details', + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Successful screen + { + id: 'accoil-analytics-destination-processor-500', + name: 'accoil_analytics', + description: 'Successful screen event', + scenario: 'Screen event is received and processed', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + traits: { + account: 'Bobby Account', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://in.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeader1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + // Verify sending to staging environment + { + id: 'accoil-analytics-destination-processor-600', + name: 'accoil_analytics', + description: 'Successful screen event: staging', + scenario: 'Screen event is received and processed for staging environment', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + traits: { + account: 'Bobby Account', + }, + timestamp: '2024-01-20T08:35:17.342Z', + originalTimestamp: '2024-01-23T08:35:17.342Z', + sentAt: '2024-01-23T08:35:35.234Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secretStaging1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://instaging.accoil.com/segment', + headers: { + 'Content-Type': 'application/json', + Authorization: authHeaderStaging1, + }, + params: {}, + body: { + JSON: { + userId: 'bobby', + type: 'screen', + name: 'Configuration', + timestamp: '2024-01-20T08:35:17.342Z', + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + metadata: baseMetadata, + statusCode: 200, + }, + ], + }, + }, + }, + + // Verify checking for invalid payloads (eg no apiKey, missing parts of message) + // Global validation + { + id: 'accoil-analytics-destination-processor-700', + name: 'accoil_analytics', + description: 'Missing required api key', + scenario: 'Event is rejected due to bad config', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + event: 'Activated', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiUrl: 'https://in.accoil.com/segment', + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'apiKey must be supplied in destination config: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: apiKey must be supplied in destination config', + statTags: { + errorCategory: 'dataValidation', + errorType: 'configuration', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-701', + name: 'accoil_analytics', + description: 'Missing required timestamp', + scenario: 'Event is rejected due to missing timestamp', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + event: 'Activated', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'timestamp is required for all calls: Workflow: procWorkflow, Step: validateTimestamp, ChildStep: undefined, OriginalError: timestamp is required for all calls', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Track validation + { + id: 'accoil-analytics-destination-processor-800', + name: 'accoil_analytics', + description: 'Missing required event', + scenario: 'Event is rejected due to missing event', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: '1234567890', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'event is required for track call: Workflow: procWorkflow, Step: validateTrackPayload, ChildStep: undefined, OriginalError: event is required for track call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-801', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + event: 'event', + type: 'track', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for track call: Workflow: procWorkflow, Step: validateTrackPayload, ChildStep: undefined, OriginalError: userId is required for track call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Page validation + { + id: 'accoil-analytics-destination-processor-900', + name: 'accoil_analytics', + description: 'Missing required name', + scenario: 'Event is rejected due to missing name', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'page', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'name is required for page call: Workflow: procWorkflow, Step: validatePagePayload, ChildStep: undefined, OriginalError: name is required for page call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-901', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + name: 'Page name', + type: 'page', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for page call: Workflow: procWorkflow, Step: validatePagePayload, ChildStep: undefined, OriginalError: userId is required for page call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Validate screen + { + id: 'accoil-analytics-destination-processor-1000', + name: 'accoil_analytics', + description: 'Missing required name', + scenario: 'Event is rejected due to missing name', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'bobby', + type: 'screen', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'name is required for screen call: Workflow: procWorkflow, Step: validateScreenPayload, ChildStep: undefined, OriginalError: name is required for screen call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-1001', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + name: 'screen name', + type: 'screen', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for screen call: Workflow: procWorkflow, Step: validateScreenPayload, ChildStep: undefined, OriginalError: userId is required for screen call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Identify validate + { + id: 'accoil-analytics-destination-processor-1100', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'identify', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for identify call: Workflow: procWorkflow, Step: validateIdentifyPayload, ChildStep: undefined, OriginalError: userId is required for identify call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + // Group validate + { + id: 'accoil-analytics-destination-processor-1200', + name: 'accoil_analytics', + description: 'Missing required userId', + scenario: 'Event is rejected due to missing userId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + type: 'group', + groupId: 'group1', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'userId is required for group call: Workflow: procWorkflow, Step: validateGroupPayload, ChildStep: undefined, OriginalError: userId is required for group call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, + { + id: 'accoil-analytics-destination-processor-1201', + name: 'accoil_analytics', + description: 'Missing required groupId', + scenario: 'Event is rejected due to missing groupId', + successCriteria: 'Processor test should pass successfully', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + method: 'POST', + body: [ + { + message: { + userId: 'user', + type: 'group', + messageId: '1873f8bd-68f7-40fc-b262-56a245f22862', + properties: { + email: 'frank@example.com', + }, + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: baseMetadata, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Config: { + apiKey: secret1, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: baseMetadata, + statusCode: 400, + error: + 'groupId is required for group call: Workflow: procWorkflow, Step: validateGroupPayload, ChildStep: undefined, OriginalError: groupId is required for group call', + statTags: { + errorCategory: 'dataValidation', + errorType: 'instrumentation', + destType: 'ACCOIL_ANALYTICS', + module: 'destination', + implementation: 'cdkV2', + destinationId: 'default-destination', + workspaceId: 'default-workspace', + feature: 'processor', + }, + }, + ], + }, + }, + }, +]; diff --git a/test/integrations/destinations/accoil_analytics/router/data.ts b/test/integrations/destinations/accoil_analytics/router/data.ts new file mode 100644 index 00000000000..6b9e1949add --- /dev/null +++ b/test/integrations/destinations/accoil_analytics/router/data.ts @@ -0,0 +1,471 @@ +import { RouterTestData } from '../../../testTypes'; +import { authHeader1, authHeaderStaging1, secret1, secretStaging1 } from '../maskedSecrets'; + +export const data: RouterTestData[] = [ + { + id: 'accoil-analytics-destination-router-100', + name: 'accoil_analytics', + description: 'Router batch request', + scenario: 'Scenario which tests for a successful batch request', + successCriteria: 'Router test should pass successfully', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + message: { + userId: 'user-uuid', + event: 'User Signed Up', + type: 'track', + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + }, + { + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + message: { + userId: 'user-uuid', + event: 'User Deleted account', + type: 'track', + messageId: '8bc79b03-2a5c-4615-b2da-54c0aaaaaae8', + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + }, + { + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secretStaging1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + message: { + userId: 'user-uuid', + event: 'User Deleted account', + type: 'track', + messageId: '8bc79b03-2a5c-4615-b2da-54c0aaaaaae8', + timestamp: '2024-01-23T08:35:17.562Z', + }, + metadata: { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 3, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + }, + ], + destType: 'accoil_analytics', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + body: { + FORM: {}, + JSON_ARRAY: {}, + XML: {}, + JSON: { + userId: 'user-uuid', + type: 'track', + event: 'User Signed Up', + timestamp: '2024-01-23T08:35:17.562Z', + }, + }, + endpoint: 'https://in.accoil.com/segment', + files: {}, + params: {}, + type: 'REST', + version: '1', + method: 'POST', + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + }, + batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 1, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], + statusCode: 200, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + { + batchedRequest: { + body: { + FORM: {}, + JSON_ARRAY: {}, + XML: {}, + JSON: { + userId: 'user-uuid', + type: 'track', + event: 'User Deleted account', + timestamp: '2024-01-23T08:35:17.562Z', + }, + }, + endpoint: 'https://in.accoil.com/segment', + files: {}, + params: {}, + type: 'REST', + version: '1', + method: 'POST', + headers: { + Authorization: authHeader1, + 'Content-Type': 'application/json', + }, + }, + batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 2, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], + statusCode: 200, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secret1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + { + batchedRequest: { + body: { + FORM: {}, + JSON_ARRAY: {}, + XML: {}, + JSON: { + userId: 'user-uuid', + type: 'track', + event: 'User Deleted account', + timestamp: '2024-01-23T08:35:17.562Z', + }, + }, + endpoint: 'https://instaging.accoil.com/segment', + files: {}, + params: {}, + type: 'REST', + version: '1', + method: 'POST', + headers: { + Authorization: authHeaderStaging1, + 'Content-Type': 'application/json', + }, + }, + batched: false, + metadata: [ + { + sourceId: 'default-source', + workspaceId: 'default-workspace', + namespace: 'default-namespace', + instanceId: 'default-instance', + sourceType: 'default-source-type', + sourceCategory: 'default-category', + trackingPlanId: 'default-tracking-plan', + trackingPlanVersion: 1, + sourceTpConfig: {}, + mergedTpConfig: {}, + destinationId: 'default-destination', + jobRunId: 'default-job-run', + jobId: 3, + sourceBatchId: 'default-batch', + sourceJobId: 'default-source-job', + sourceJobRunId: 'default-source-job-run', + sourceTaskId: 'default-task', + sourceTaskRunId: 'default-task-run', + recordId: {}, + destinationType: 'default-destination-type', + messageId: 'default-message-id', + oauthAccessToken: 'default-token', + messageIds: ['default-message-id'], + rudderId: 'default-rudder-id', + receivedAt: '2024-12-06T12:28:58.577Z', + eventName: 'default-event', + eventType: 'default-type', + sourceDefinitionId: 'default-source-def', + destinationDefinitionId: 'default-dest-def', + transformationId: 'default-transform', + dontBatch: false, + }, + ], + statusCode: 200, + destination: { + ID: 'default-destination-id', + Name: 'Default Destination', + Config: { + apiKey: secretStaging1, + }, + DestinationDefinition: { + ID: 'default-dest-def-id', + Name: 'Default Destination Definition', + DisplayName: 'Default Display Name', + Config: { + cdkV2Enabled: true, + }, + }, + Enabled: true, + WorkspaceID: 'default-workspace', + Transformations: [], + RevisionID: 'default-revision', + IsProcessorEnabled: true, + IsConnectionEnabled: true, + }, + }, + ], + }, + }, + }, + }, +]; From 2167959a80ddb36acd925dee0ed5cf46b00692f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 19:09:44 +0530 Subject: [PATCH 148/160] chore(deps): bump moment-timezone from 0.5.44 to 0.5.47 (#4033) Bumps [moment-timezone](https://github.com/moment/moment-timezone) from 0.5.44 to 0.5.47. - [Release notes](https://github.com/moment/moment-timezone/releases) - [Changelog](https://github.com/moment/moment-timezone/blob/develop/changelog.md) - [Commits](https://github.com/moment/moment-timezone/compare/0.5.44...0.5.47) --- updated-dependencies: - dependency-name: moment-timezone dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mahesh Kutty <39219085+maheshkutty@users.noreply.github.com> --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba62c5fb2fc..5c578d4d325 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,7 @@ "md5": "^2.3.0", "modclean": "^3.0.0-beta.1", "moment": "^2.29.4", - "moment-timezone": "^0.5.43", + "moment-timezone": "^0.5.47", "node-cache": "^5.1.2", "node-fetch": "^2.6.12", "oauth-1.0a": "^2.2.6", diff --git a/package.json b/package.json index f79286a33e3..9e39dd7dfd8 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "md5": "^2.3.0", "modclean": "^3.0.0-beta.1", "moment": "^2.29.4", - "moment-timezone": "^0.5.43", + "moment-timezone": "^0.5.47", "node-cache": "^5.1.2", "node-fetch": "^2.6.12", "oauth-1.0a": "^2.2.6", From 24f974404824cd0bb88af9e9d9e46fa10d1383d9 Mon Sep 17 00:00:00 2001 From: Mahesh Kutty <39219085+maheshkutty@users.noreply.github.com> Date: Wed, 12 Mar 2025 23:11:12 +0530 Subject: [PATCH 149/160] chore: update ajv package to latest (#4160) --- package-lock.json | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c578d4d325..c6b6ad4378c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", - "ajv": "^8.12.0", + "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", "amazon-dsp-formatter": "^1.0.2", @@ -5556,7 +5556,6 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", diff --git a/package.json b/package.json index 9e39dd7dfd8..2d283c95464 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", - "ajv": "^8.12.0", + "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", "amazon-dsp-formatter": "^1.0.2", From 5d3b2263754b94193c302c2f88cac2a055a22b53 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Thu, 13 Mar 2025 15:39:30 +0530 Subject: [PATCH 150/160] fix: add 2655 error handling to fb error handler at proxy (#4152) * fix: add 2655 error handling to fb error handler at proxy * chore: update test Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> * chore: update test Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --------- Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com> --- src/v0/util/facebookUtils/networkHandler.js | 6 ++ .../fb_custom_audience/dataDelivery/data.ts | 68 +++++++++++++++++++ .../fb_custom_audience/network.ts | 41 +++++++++++ 3 files changed, 115 insertions(+) diff --git a/src/v0/util/facebookUtils/networkHandler.js b/src/v0/util/facebookUtils/networkHandler.js index 46ac59a07af..39835f2617e 100644 --- a/src/v0/util/facebookUtils/networkHandler.js +++ b/src/v0/util/facebookUtils/networkHandler.js @@ -212,6 +212,12 @@ const errorDetailsMap = { .setMessage('There have been too many calls to this ad-account.') .build(), }, + 2655: { + default: new ErrorDetailsExtractorBuilder() + .setStatus(400) + .setMessage('Marketing Messaging TOS not accepted.') + .build(), + }, 200: { default: new ErrorDetailsExtractorBuilder() .setStatus(403) diff --git a/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts b/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts index cd440aaa37c..ed057427e61 100644 --- a/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts +++ b/test/integrations/destinations/fb_custom_audience/dataDelivery/data.ts @@ -648,6 +648,74 @@ export const existingTestData = [ }, }, }, + { + name: 'fb_custom_audience', + description: 'User not accepted TOS for messaging API', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: getEndPoint('aud1'), + headers: { + 'test-dest-response-key': 'messagingTOSNotAccepted', + }, + params: { + access_token: 'ABC', + payload: { + is_raw: true, + data_source: { + sub_type: 'ANYTHING', + }, + schema: ['DOBY', 'PHONE', 'GEN', 'FI', 'MADID', 'ZIP', 'ST', 'COUNTRY'], + data: [['2013', '@09432457768', 'f', 'Ms.', 'ABC', 'ZIP ', '123abc ', 'IN']], + }, + }, + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + }, + }, + output: { + response: { + status: 400, + body: { + output: { + destinationResponse: { + error: { + code: 2655, + fbtrace_id: 'fbtrace_id', + message: '(#2655) Marketing Messaging TOS not accepted', + type: 'OAuthException', + }, + status: 400, + }, + message: 'Marketing Messaging TOS not accepted.', + statTags: { + destType: 'FB_CUSTOM_AUDIENCE', + destinationId: 'Non-determininable', + errorCategory: 'network', + errorType: 'aborted', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'Non-determininable', + }, + status: 400, + }, + }, + }, + }, + }, ]; export const data = [...existingTestData, ...testScenariosForV1API, ...otherScenariosV1]; diff --git a/test/integrations/destinations/fb_custom_audience/network.ts b/test/integrations/destinations/fb_custom_audience/network.ts index ba14d537ad6..f7546cc95a7 100644 --- a/test/integrations/destinations/fb_custom_audience/network.ts +++ b/test/integrations/destinations/fb_custom_audience/network.ts @@ -626,4 +626,45 @@ export const networkCallsData = [ status: 400, }, }, + { + httpReq: { + version: '1', + type: 'REST', + method: 'DELETE', + endpoint: getEndPoint('aud-new'), + headers: { + 'test-dest-response-key': 'messagingTOSNotAccepted', + }, + params: { + access_token: 'XYZ', + payload: { + is_raw: true, + data_source: { + sub_type: 'ANYTHING', + }, + schema: ['DOBY', 'PHONE', 'GEN', 'FI', 'MADID', 'ZIP', 'ST', 'COUNTRY'], + data: [['2013', '@09432457768', 'f', 'Ms.', 'ABC', 'ZIP ', '123abc ', 'IN']], + }, + }, + userId: '', + body: { + JSON: {}, + XML: {}, + JSON_ARRAY: {}, + FORM: {}, + }, + files: {}, + }, + httpRes: { + data: { + error: { + message: '(#2655) Marketing Messaging TOS not accepted', + type: 'OAuthException', + code: 2655, + fbtrace_id: 'fbtrace_id', + }, + }, + status: 400, + }, + }, ]; From 42b98f094da14b4ed56f9abf66dec77bad5c4fab Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 17 Mar 2025 14:54:27 +0530 Subject: [PATCH 151/160] chore: putRequestDetailsInContext flag based context --- src/sources/webhook/transform.js | 15 +++- test/integrations/sources/webhook/data.ts | 90 ++++++++++++++++++++++- 2 files changed, 100 insertions(+), 5 deletions(-) diff --git a/src/sources/webhook/transform.js b/src/sources/webhook/transform.js index d0499ced1c6..1386907f61d 100644 --- a/src/sources/webhook/transform.js +++ b/src/sources/webhook/transform.js @@ -7,18 +7,25 @@ const { function processEvent(payload) { const event = getBodyFromV2SpecPayload(payload); + const putRequestDetailsInContext = Boolean(payload.source.Config?.putRequestDetailsInContext); + const request = { ...payload.request }; - delete request.body; const response = { type: 'track', event: 'webhook_source_event', properties: event, anonymousId: generateUUID(), - context: { - ...request, - }, }; + + if (putRequestDetailsInContext) { + delete request.body; + response.context = { + ...response.context, + ...request, + }; + } + return response; } diff --git a/test/integrations/sources/webhook/data.ts b/test/integrations/sources/webhook/data.ts index eb339bb5d64..ed622a7308a 100644 --- a/test/integrations/sources/webhook/data.ts +++ b/test/integrations/sources/webhook/data.ts @@ -14,6 +14,58 @@ export const data = [ input: { request: { body: [ + { + request: { + body: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + }), + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: { + Config: { + putRequestDetailsInContext: true, + }, + }, + }, + { + request: { + body: JSON.stringify({ + prop1: 'value1', + prop2: 'value2', + }), + method: 'POST', + url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', + proto: 'HTTP/1.1', + headers: { + Connection: ['keep-alive'], + 'Content-Length': ['48'], + 'Content-Type': ['application/json'], + }, + query_parameters: { + query_param_key_1: ['query_param_value_1'], + query_param_key_2: ['query_param_value_2'], + writeKey: ['write_key'], + }, + }, + source: { + Config: { + putRequestDetailsInContext: false, + }, + }, + }, { request: { body: JSON.stringify({ @@ -73,6 +125,38 @@ export const data = [ ], }, }, + { + output: { + batch: [ + { + type: 'track', + event: 'webhook_source_event', + properties: { + prop1: 'value1', + prop2: 'value2', + }, + anonymousId: ANONYMOUS_ID, + context: {}, + }, + ], + }, + }, + { + output: { + batch: [ + { + type: 'track', + event: 'webhook_source_event', + properties: { + prop1: 'value1', + prop2: 'value2', + }, + anonymousId: ANONYMOUS_ID, + context: {}, + }, + ], + }, + }, ], }, }, @@ -106,7 +190,11 @@ export const data = [ writeKey: ['write_key'], }, }, - source: {}, + source: { + Config: { + putRequestDetailsInContext: true, + }, + }, }, ], }, From 6f7dde104a1c81753e4224ba2191ae56a0814984 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Mon, 17 Mar 2025 20:32:33 +0530 Subject: [PATCH 152/160] chore: simplify setting context key --- src/sources/webhook/transform.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/sources/webhook/transform.js b/src/sources/webhook/transform.js index 1386907f61d..d6111033f7c 100644 --- a/src/sources/webhook/transform.js +++ b/src/sources/webhook/transform.js @@ -20,10 +20,7 @@ function processEvent(payload) { if (putRequestDetailsInContext) { delete request.body; - response.context = { - ...response.context, - ...request, - }; + response.context = request; } return response; From 0d316fe90730c8cef5456953ab8fabbd3ead27bf Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Mon, 17 Mar 2025 21:55:59 +0530 Subject: [PATCH 153/160] chore: use common flattenParams utility from lib for fb lead ads and adjust source (#4155) * chore: use common flattenParams utility from lib for fb lead ads and adjust source * chore: minor changes --- package-lock.json | 13 +- package.json | 2 +- src/sources/adjust/transform.js | 5 +- src/sources/adjust/utils.js | 25 +--- src/sources/adjust/utils.test.js | 141 ------------------ src/sources/facebook_lead_ads/transform.ts | 10 +- src/v0/util/index.js | 17 --- src/v0/util/index.test.js | 65 -------- .../sources/facebook_lead_ads/data.ts | 5 +- 9 files changed, 17 insertions(+), 266 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6b6ad4378c..7c4282e9e2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.22", + "@rudderstack/integrations-lib": "^0.2.25", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", @@ -4053,9 +4053,10 @@ "license": "MIT" }, "node_modules/@rudderstack/integrations-lib": { - "version": "0.2.22", - "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.22.tgz", - "integrity": "sha512-XB8bnyT4PSZGGsTRg6Sj5+n2d8ZG35MdSLrUAe5Udm+iKGtuY5XfjQMMIMsI2PPFoFTJj6PnmdN0wrhlTEcB2A==", + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.25.tgz", + "integrity": "sha512-/GKqGlGrGWYxkZdqlyYgIK4mL6OK2ijkMcW3Lbg/INK7uZaR9/HFrc/cYX0JbGIb0b5Z49jc0lPO1+jLc3O5lg==", + "license": "MIT", "dependencies": { "axios": "^1.4.0", "eslint-config-airbnb-base": "^15.0.0", @@ -4069,9 +4070,11 @@ "moment-timezone": "^0.5.43", "set-value": "^4.1.0", "sha256": "^0.2.0", + "sqlstring": "^2.3.3", "tslib": "^2.4.0", "uuid": "^11.0.5", - "winston": "^3.11.0" + "winston": "^3.11.0", + "zod": "^3.24.2" } }, "node_modules/@rudderstack/integrations-lib/node_modules/uuid": { diff --git a/package.json b/package.json index 2d283c95464..0661a874153 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.22", + "@rudderstack/integrations-lib": "^0.2.25", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", diff --git a/src/sources/adjust/transform.js b/src/sources/adjust/transform.js index b916723ad65..42dec5320a8 100644 --- a/src/sources/adjust/transform.js +++ b/src/sources/adjust/transform.js @@ -1,7 +1,6 @@ -const { TransformationError } = require('@rudderstack/integrations-lib'); +const { flattenQueryParams, TransformationError } = require('@rudderstack/integrations-lib'); const { CommonUtils } = require('../../util/common'); const logger = require('../../logger'); -const { flattenParams } = require('./utils'); const { processPayload } = require('./core'); /** @@ -22,7 +21,7 @@ const getPayloadFromRequest = (inputRequest) => { throw new TransformationError('Query_parameters is missing'); } - return flattenParams(qParams); + return flattenQueryParams(qParams); }; /** diff --git a/src/sources/adjust/utils.js b/src/sources/adjust/utils.js index 40509ffdee3..9b85ea24009 100644 --- a/src/sources/adjust/utils.js +++ b/src/sources/adjust/utils.js @@ -1,4 +1,4 @@ -const { TransformationError, isDefinedAndNotNull } = require('@rudderstack/integrations-lib'); +const { TransformationError } = require('@rudderstack/integrations-lib'); /** * Converts a raw timestamp to ISO 8601 date string format @@ -28,29 +28,6 @@ const convertToISODate = (rawTimestamp) => { return date.toISOString(); }; -/** - * Flattens an object containing array parameters into a simple key-value object with first element of array as value - * @param {Object.} qParams - Object containing parameters where values are arrays - * @returns {Object.} Flattened object where array values are replaced with their first element - * @description - * This function flattens an object containing array parameters into a simple key-value object - * with first element of array as value if it is an array, otherwise the value is returned as is - * In case of empty array, the key is removed from the output - */ -const flattenParams = (qParams) => { - const formattedOutput = {}; - if (qParams) { - Object.entries(qParams).forEach(([key, value]) => { - const finalValue = Array.isArray(value) ? value[0] : value; - if (isDefinedAndNotNull(finalValue)) { - formattedOutput[key] = finalValue; - } - }); - } - return formattedOutput; -}; - module.exports = { convertToISODate, - flattenParams, }; diff --git a/src/sources/adjust/utils.test.js b/src/sources/adjust/utils.test.js index cc9a145a20b..cc1ab6e2606 100644 --- a/src/sources/adjust/utils.test.js +++ b/src/sources/adjust/utils.test.js @@ -64,144 +64,3 @@ describe('convertToISODate', () => { }); }); }); - -describe('flattenParams', () => { - const { flattenParams } = require('./utils'); - - const testCases = [ - { - name: 'flatten array values to first elements', - input: { - key1: ['value1'], - key2: ['value2'], - key3: [123], - }, - expected: { - key1: 'value1', - key2: 'value2', - key3: 123, - }, - }, - { - name: 'handle null input', - input: null, - expected: {}, - }, - { - name: 'handle undefined input', - input: undefined, - expected: {}, - }, - { - name: 'handle empty object', - input: {}, - expected: {}, - }, - { - name: 'ignore null/undefined array elements', - input: { - key1: [undefined], - key2: [null], - key3: [undefined, 'value'], - key4: [null, 'value'], - }, - expected: {}, - }, - { - name: 'handle mixed type values in arrays', - input: { - number: [42], - string: ['test'], - boolean: [true], - object: [{ nested: 'value' }], - date: [new Date('2024-01-01')], - }, - expected: { - number: 42, - string: 'test', - boolean: true, - object: { nested: 'value' }, - date: new Date('2024-01-01'), - }, - }, - { - name: 'handle empty arrays', - input: { - key1: [], - key2: ['value'], - key3: [], - }, - expected: { - key2: 'value', - }, - }, - { - name: 'keep non-array values unchanged', - input: { - string: 'direct string', - number: 42, - boolean: true, - object: { test: 'value' }, - array: ['first', 'second'], - }, - expected: { - string: 'direct string', - number: 42, - boolean: true, - object: { test: 'value' }, - array: 'first', - }, - }, - { - name: 'handle mixed array and non-array values', - input: { - arrayValue: ['first'], - emptyArray: [], - directValue: 'string', - nullValue: null, - undefinedValue: undefined, - }, - expected: { - arrayValue: 'first', - directValue: 'string', - }, - }, - { - name: 'handle nested arrays', - input: { - nested: [ - [1, 2], - [3, 4], - ], - mixed: [['a', 'b'], 'c'], - }, - expected: { - nested: [1, 2], - mixed: ['a', 'b'], - }, - }, - { - name: 'handle special values in arrays', - input: { - nan: [NaN], - infinity: [Infinity], - negInfinity: [-Infinity], - zero: [0], - negZero: [-0], - }, - expected: { - nan: NaN, - infinity: Infinity, - negInfinity: -Infinity, - zero: 0, - negZero: -0, - }, - }, - ]; - - testCases.forEach(({ name, input, expected }) => { - it(`should ${name}`, () => { - expect(flattenParams(input)).toEqual(expected); - }); - }); -}); diff --git a/src/sources/facebook_lead_ads/transform.ts b/src/sources/facebook_lead_ads/transform.ts index 70ede2610bf..c1cd5695cb9 100644 --- a/src/sources/facebook_lead_ads/transform.ts +++ b/src/sources/facebook_lead_ads/transform.ts @@ -1,4 +1,4 @@ -import { TransformationError } from '@rudderstack/integrations-lib'; +import { flattenQueryParams, TransformationError } from '@rudderstack/integrations-lib'; import get from 'get-value'; import Message = require('../message'); import { EventType } from '../../constants'; @@ -6,16 +6,12 @@ import { InputEventType, OutputEventType } from './type'; import { SourceInputV2 } from '../../types'; import { generateUUID } from '../../v0/util'; -const { - removeUndefinedAndNullValues, - getBodyFromV2SpecPayload, - unwrapArrayValues, -} = require('../../v0/util'); +const { removeUndefinedAndNullValues, getBodyFromV2SpecPayload } = require('../../v0/util'); const mapping = require('./mapping.json'); function processEvent(inputEvent: InputEventType): any { - const unwrappedInputEvent = unwrapArrayValues(inputEvent); + const unwrappedInputEvent = flattenQueryParams(inputEvent); if (Object.keys(unwrappedInputEvent).length === 0) { throw new TransformationError('input event must have at least one field'); diff --git a/src/v0/util/index.js b/src/v0/util/index.js index 5e41dfc687d..36dcdddd5cf 100644 --- a/src/v0/util/index.js +++ b/src/v0/util/index.js @@ -2366,22 +2366,6 @@ const getBodyFromV2SpecPayload = ({ request }) => { } throw new TransformationError(ERROR_MESSAGES.REQUEST_BODY_NOT_PRESENT_IN_V2_SPEC_PAYLOAD); }; - -const unwrapArrayValues = (payload) => { - if (!payload || typeof payload !== 'object' || Array.isArray(payload)) { - throw new InstrumentationError('Payload must be an valid object'); - } - const result = {}; - Object.keys(payload).forEach((key) => { - if (Array.isArray(payload[key]) && payload[key].length === 1) { - [result[key]] = payload[key]; - } else { - result[key] = payload[key]; - } - }); - return result; -}; - // ======================================================================== // EXPORTS // ======================================================================== @@ -2511,5 +2495,4 @@ module.exports = { isAxiosError, convertToUuid, handleMetadataForValue, - unwrapArrayValues, }; diff --git a/src/v0/util/index.test.js b/src/v0/util/index.test.js index 06e0f84cb8c..ba27ee1f703 100644 --- a/src/v0/util/index.test.js +++ b/src/v0/util/index.test.js @@ -13,7 +13,6 @@ const { isAxiosError, removeHyphens, convertToUuid, - unwrapArrayValues, } = require('./index'); const exp = require('constants'); const { ERROR_MESSAGES } = require('./constant'); @@ -1164,67 +1163,3 @@ describe('getBodyFromV2SpecPayload', () => { expect(utilities.getBodyFromV2SpecPayload(input)).toEqual([1, 2, 3]); }); }); - -describe('unwrapArrayValues', () => { - const testCases = [ - { - name: 'should throw an error if the payload is null', - input: null, - error: new InstrumentationError('Payload must be an valid object'), - }, - { - name: 'should throw an error if the payload is string', - input: 'payload', - error: new InstrumentationError('Payload must be an valid object'), - }, - { - name: 'should throw an error if the payload is array', - input: [], - error: new InstrumentationError('Payload must be an valid object'), - }, - { - name: 'should return an empty object when given an empty object', - input: {}, - expected: {}, - }, - { - name: 'should unwrap array of length 1 and assign the other value as it is', - input: { - ids: [1, 2, 3], - names: ['Test 1', 'Test 2', 'Test 3'], - items: [['apple', 'banana']], - age: [100], - id: '456', - emptyStr: [''], - emptyArray: [], - array: [null], - boolean: true, - null: null, - undefined: undefined, - }, - expected: { - ids: [1, 2, 3], - names: ['Test 1', 'Test 2', 'Test 3'], - items: ['apple', 'banana'], - age: 100, - id: '456', - emptyStr: '', - emptyArray: [], - array: null, - boolean: true, - null: null, - undefined: undefined, - }, - }, - ]; - - testCases.forEach(({ name, input, error, expected }) => { - it(name, () => { - if (error) { - expect(() => unwrapArrayValues(input)).toThrow(error); - } else { - expect(unwrapArrayValues(input)).toEqual(expected); - } - }); - }); -}); diff --git a/test/integrations/sources/facebook_lead_ads/data.ts b/test/integrations/sources/facebook_lead_ads/data.ts index 694fae95b19..e54d0662426 100644 --- a/test/integrations/sources/facebook_lead_ads/data.ts +++ b/test/integrations/sources/facebook_lead_ads/data.ts @@ -545,11 +545,10 @@ export const data = [ status: 200, body: [ { - error: 'Payload must be an valid object', + error: 'input event must have at least one field', statTags: { destinationId: 'Non determinable', - errorCategory: 'dataValidation', - errorType: 'instrumentation', + errorCategory: 'transformation', implementation: 'native', module: 'source', srcType: 'facebook_lead_ads', From b7423a4896d5ce20aadb4624ae32e4a3eb09b01d Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Tue, 18 Mar 2025 11:45:33 +0530 Subject: [PATCH 154/160] chore: flatten headers and params - product requirement --- package-lock.json | 13 ++++++++----- package.json | 2 +- src/sources/webhook/transform.js | 11 +++++++++-- test/integrations/sources/webhook/data.ts | 12 ++++++------ 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6b6ad4378c..7c4282e9e2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.22", + "@rudderstack/integrations-lib": "^0.2.25", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", @@ -4053,9 +4053,10 @@ "license": "MIT" }, "node_modules/@rudderstack/integrations-lib": { - "version": "0.2.22", - "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.22.tgz", - "integrity": "sha512-XB8bnyT4PSZGGsTRg6Sj5+n2d8ZG35MdSLrUAe5Udm+iKGtuY5XfjQMMIMsI2PPFoFTJj6PnmdN0wrhlTEcB2A==", + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@rudderstack/integrations-lib/-/integrations-lib-0.2.25.tgz", + "integrity": "sha512-/GKqGlGrGWYxkZdqlyYgIK4mL6OK2ijkMcW3Lbg/INK7uZaR9/HFrc/cYX0JbGIb0b5Z49jc0lPO1+jLc3O5lg==", + "license": "MIT", "dependencies": { "axios": "^1.4.0", "eslint-config-airbnb-base": "^15.0.0", @@ -4069,9 +4070,11 @@ "moment-timezone": "^0.5.43", "set-value": "^4.1.0", "sha256": "^0.2.0", + "sqlstring": "^2.3.3", "tslib": "^2.4.0", "uuid": "^11.0.5", - "winston": "^3.11.0" + "winston": "^3.11.0", + "zod": "^3.24.2" } }, "node_modules/@rudderstack/integrations-lib/node_modules/uuid": { diff --git a/package.json b/package.json index 2d283c95464..0661a874153 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@koa/router": "^12.0.0", "@ndhoule/extend": "^2.0.0", "@pyroscope/nodejs": "^0.2.9", - "@rudderstack/integrations-lib": "^0.2.22", + "@rudderstack/integrations-lib": "^0.2.25", "@rudderstack/json-template-engine": "^0.19.5", "@rudderstack/workflow-engine": "^0.8.13", "@shopify/jest-koa-mocks": "^5.1.1", diff --git a/src/sources/webhook/transform.js b/src/sources/webhook/transform.js index d6111033f7c..fcfe51604fd 100644 --- a/src/sources/webhook/transform.js +++ b/src/sources/webhook/transform.js @@ -1,3 +1,4 @@ +const { flattenQueryParams: flattenMapWithArrayValues } = require('@rudderstack/integrations-lib'); const { removeUndefinedAndNullValues, generateUUID, @@ -19,8 +20,14 @@ function processEvent(payload) { }; if (putRequestDetailsInContext) { - delete request.body; - response.context = request; + response.context = { + method: request.method, + url: request.url, + proto: request.proto, + headers: request.headers && flattenMapWithArrayValues(request.headers), + query_parameters: + request.query_parameters && flattenMapWithArrayValues(request.query_parameters), + }; } return response; diff --git a/test/integrations/sources/webhook/data.ts b/test/integrations/sources/webhook/data.ts index ed622a7308a..68fb8db10af 100644 --- a/test/integrations/sources/webhook/data.ts +++ b/test/integrations/sources/webhook/data.ts @@ -111,14 +111,14 @@ export const data = [ url: '/v1/webhook?writeKey=write_key&query_param_key_1=query_param_value_1&query_param_key_2=query_param_value_2', proto: 'HTTP/1.1', headers: { - Connection: ['keep-alive'], - 'Content-Length': ['48'], - 'Content-Type': ['application/json'], + Connection: 'keep-alive', + 'Content-Length': '48', + 'Content-Type': 'application/json', }, query_parameters: { - query_param_key_1: ['query_param_value_1'], - query_param_key_2: ['query_param_value_2'], - writeKey: ['write_key'], + query_param_key_1: 'query_param_value_1', + query_param_key_2: 'query_param_value_2', + writeKey: 'write_key', }, }, }, From e3a266a7535b3b71c861fee029154d6040315fc0 Mon Sep 17 00:00:00 2001 From: Utsab Chowdhury Date: Tue, 18 Mar 2025 12:56:01 +0530 Subject: [PATCH 155/160] chore: re-order folder structure for types (#4090) * chore: re-order folder structure for types --- .gitignore | 1 + jest.config.js | 6 +- jest.config.typescript.js | 6 +- jest.default.config.js | 2 +- package.json | 3 +- src/cdk/v2/destinations/bloomreach/types.ts | 8 + src/cdk/v2/destinations/bloomreach/utils.ts | 6 +- src/controllers/__tests__/delivery.test.ts | 2 +- src/controllers/__tests__/destination.test.ts | 2 +- src/controllers/__tests__/regulation.test.ts | 2 +- src/controllers/__tests__/source.test.ts | 2 +- src/controllers/destination.ts | 44 +- src/controllers/util/index.test.ts | 12 +- src/helpers/__tests__/serviceSelector.test.ts | 2 +- src/services/comparator.ts | 5 +- .../__tests__/nativeIntegration.test.ts | 4 +- .../__tests__/preTransformation.test.ts | 4 +- src/services/destination/cdkV2Integration.ts | 4 +- src/services/destination/nativeIntegration.ts | 4 +- src/services/misc.ts | 2 +- .../__tests__/nativeIntegration.test.ts | 12 +- .../__tests__/postTransformation.test.ts | 4 +- src/services/source/postTransformation.ts | 11 +- src/types/controlPlaneConfig.ts | 69 +++ src/types/destinationTransformation.ts | 233 ++++++++++ src/types/index.ts | 430 +----------------- src/types/rudderEvents.ts | 91 ++++ src/types/sourceTransformation.ts | 56 +++ src/types/userRegulation.ts | 19 + src/types/userTransformation.ts | 23 + src/v0/destinations/airship/utils.test.ts | 12 +- .../customerio_audience/config.ts | 6 - .../customerio_audience/transform.ts | 83 +--- .../destinations/customerio_audience/type.ts | 131 ++++-- .../customerio_audience/utils.test.ts | 140 ++++++ .../destinations/customerio_audience/utils.ts | 97 ++-- src/v0/destinations/ga4_v2/transform.test.ts | 133 ++++++ src/v0/destinations/ga4_v2/transform.ts | 7 +- test/apitests/service.api.test.ts | 2 +- test/integrations/component.test.ts | 31 +- .../accoil_analytics/processor/data.ts | 2 +- .../active_campaign/processor/data.ts | 2 +- .../destinations/branch/processor/data.ts | 2 +- .../destinations/branch/router/data.ts | 4 +- .../customerio_audience/common.ts | 7 + .../customerio_audience/router/data.ts | 32 +- .../processor/identifyTestData.ts | 4 +- .../ga4/processor/validationTestData.ts | 7 +- .../router/data.ts | 12 +- .../destinations/intercom_v2/router/data.ts | 4 +- .../iterable/processor/aliasTestData.ts | 2 +- .../iterable/processor/identifyTestData.ts | 4 +- .../iterable/processor/pageScreenTestData.ts | 2 +- .../iterable/processor/trackTestData.ts | 2 +- .../iterable/processor/validationTestData.ts | 4 +- .../destinations/iterable/router/data.ts | 4 +- .../klaviyo/processor/validationTestData.ts | 4 +- .../klaviyo/processor/validationTestDataV2.ts | 4 +- .../klaviyo/router/commonConfig.ts | 10 +- .../destinations/klaviyo/router/dataV2.ts | 4 +- test/integrations/destinations/mp/common.ts | 2 +- .../destinations/mp/router/data.ts | 10 + .../destinations/tune/router/data.ts | 1 - test/integrations/testTypes.ts | 6 +- tsconfig.test.json | 8 + 65 files changed, 1165 insertions(+), 689 deletions(-) create mode 100644 src/cdk/v2/destinations/bloomreach/types.ts create mode 100644 src/types/controlPlaneConfig.ts create mode 100644 src/types/destinationTransformation.ts create mode 100644 src/types/rudderEvents.ts create mode 100644 src/types/sourceTransformation.ts create mode 100644 src/types/userRegulation.ts create mode 100644 src/types/userTransformation.ts create mode 100644 src/v0/destinations/customerio_audience/utils.test.ts create mode 100644 src/v0/destinations/ga4_v2/transform.test.ts create mode 100644 tsconfig.test.json diff --git a/.gitignore b/.gitignore index 48658b27ffb..5526573051e 100644 --- a/.gitignore +++ b/.gitignore @@ -92,6 +92,7 @@ out # Nuxt.js build / generate output .nuxt dist +dist-test # Gatsby files .cache/ diff --git a/jest.config.js b/jest.config.js index b76badd5a44..07ba4bfaa53 100644 --- a/jest.config.js +++ b/jest.config.js @@ -79,7 +79,11 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - modulePathIgnorePatterns: ['/test/__mocks__/axios.js', '/dist/'], + modulePathIgnorePatterns: [ + '/test/__mocks__/axios.js', + '/dist/', + '/dist-test/', + ], // Activates notifications for test results notify: true, diff --git a/jest.config.typescript.js b/jest.config.typescript.js index 6aa029f8973..64e07de0da6 100644 --- a/jest.config.typescript.js +++ b/jest.config.typescript.js @@ -78,7 +78,11 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - modulePathIgnorePatterns: ['/test/__mocks__/axios.js', '/dist/'], + modulePathIgnorePatterns: [ + '/test/__mocks__/axios.js', + '/dist/', + '/dist-test/', + ], // Activates notifications for test results notify: true, diff --git a/jest.default.config.js b/jest.default.config.js index d1b5390b9e7..8661387a772 100644 --- a/jest.default.config.js +++ b/jest.default.config.js @@ -79,7 +79,7 @@ module.exports = { // moduleNameMapper: {}, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader - // modulePathIgnorePatterns: [], + modulePathIgnorePatterns: ['/dist/', '/dist-test/'], // Activates notifications for test results notify: true, diff --git a/package.json b/package.json index 0661a874153..90eb0fad410 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "main": "GATransform.js", "scripts": { "copy": "find ./src -name '*.yaml' -o -name '*.csv' | cpio -pdm ./dist", - "clean": "rm -rf ./dist", + "clean": "rm -rf ./dist ./dist-test", "setup": "npm ci", "setup:swagger": "swagger-cli bundle swagger/api.yaml --outfile dist/swagger.json --type json", "format": "prettier --write .", @@ -27,6 +27,7 @@ "build:start": "npm run build && npm run start", "build:ci": "tsc -p tsconfig.json", "build:swagger": "npm run build && npm run setup:swagger", + "build:test": "tsc -p tsconfig.test.json", "build": "npm run build:ci && npm run copy", "clean:build": "npm run clean && npm run build", "build:clean": "npm run clean && npm run build", diff --git a/src/cdk/v2/destinations/bloomreach/types.ts b/src/cdk/v2/destinations/bloomreach/types.ts new file mode 100644 index 00000000000..4a1125819dc --- /dev/null +++ b/src/cdk/v2/destinations/bloomreach/types.ts @@ -0,0 +1,8 @@ +export type BloomreachDestinationConfig = { + hardID: string; + softID: string; + appSecret: string; + apiKey: string; + apiBaseUrl: string; + projectToken: string; +}; diff --git a/src/cdk/v2/destinations/bloomreach/utils.ts b/src/cdk/v2/destinations/bloomreach/utils.ts index f834fa74e7a..7669ec8990a 100644 --- a/src/cdk/v2/destinations/bloomreach/utils.ts +++ b/src/cdk/v2/destinations/bloomreach/utils.ts @@ -1,5 +1,6 @@ import { isObject, isEmptyObject, getIntegrationsObj } from '../../../../v0/util'; import { RudderMessage, Destination } from '../../../../types'; +import { BloomreachDestinationConfig } from './types'; const getCustomerIDsFromIntegrationObject = (message: RudderMessage): any => { const integrationObj = getIntegrationsObj(message, 'bloomreach' as any) || {}; @@ -21,7 +22,10 @@ const getCustomerIDsFromIntegrationObject = (message: RudderMessage): any => { return customerIDs; }; -export const prepareCustomerIDs = (message: RudderMessage, destination: Destination): any => { +export const prepareCustomerIDs = ( + message: RudderMessage, + destination: Destination, +): any => { const customerIDs = { [destination.Config.hardID]: message.userId, [destination.Config.softID]: message.anonymousId, diff --git a/src/controllers/__tests__/delivery.test.ts b/src/controllers/__tests__/delivery.test.ts index 0f91913f9d0..b5e37e1d589 100644 --- a/src/controllers/__tests__/delivery.test.ts +++ b/src/controllers/__tests__/delivery.test.ts @@ -18,7 +18,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { diff --git a/src/controllers/__tests__/destination.test.ts b/src/controllers/__tests__/destination.test.ts index 3c49a9a0aff..105f16b8560 100644 --- a/src/controllers/__tests__/destination.test.ts +++ b/src/controllers/__tests__/destination.test.ts @@ -19,7 +19,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { diff --git a/src/controllers/__tests__/regulation.test.ts b/src/controllers/__tests__/regulation.test.ts index cfde691c8a1..42e45d9e138 100644 --- a/src/controllers/__tests__/regulation.test.ts +++ b/src/controllers/__tests__/regulation.test.ts @@ -18,7 +18,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { diff --git a/src/controllers/__tests__/source.test.ts b/src/controllers/__tests__/source.test.ts index e0ff9e7a4b9..dead14c3829 100644 --- a/src/controllers/__tests__/source.test.ts +++ b/src/controllers/__tests__/source.test.ts @@ -20,7 +20,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { diff --git a/src/controllers/destination.ts b/src/controllers/destination.ts index 1b9d19c5afe..bc82afe9dc8 100644 --- a/src/controllers/destination.ts +++ b/src/controllers/destination.ts @@ -8,7 +8,7 @@ import { ProcessorTransformationResponse, RouterTransformationRequest, RouterTransformationResponse, -} from '../types/index'; +} from '../types'; import { DynamicConfigParser } from '../util/dynamicConfigParser'; import stats from '../util/stats'; import { getIntegrationVersion } from '../util/utils'; @@ -47,7 +47,7 @@ export class DestinationController { version, requestMetadata, ); - } catch (error: any) { + } catch (error: unknown) { resplist = events.map((ev) => { const metaTO = integrationService.getTags( destination, @@ -57,7 +57,7 @@ export class DestinationController { ); metaTO.metadata = ev.metadata; const errResp = DestinationPostTransformationService.handleProcessorTransformFailureEvents( - error, + error as Error, metaTO, ); return errResp; @@ -79,6 +79,7 @@ export class DestinationController { const routerRequest = ctx.request.body as RouterTransformationRequest; const destination = routerRequest.destType; let events = routerRequest.input; + const errorRespEvents = checkInvalidRtTfEvents(events); if (errorRespEvents.length > 0) { errorRespEvents[0].metadata = [ @@ -86,6 +87,7 @@ export class DestinationController { destType: destination, }, ]; + logger.debug( `[${destination}] Invalid router transform payload structure: ${JSON.stringify(events)}`, ); @@ -93,38 +95,45 @@ export class DestinationController { ControllerUtility.postProcess(ctx); return ctx; } + const metaTags = MiscService.getMetaTags(events[0].metadata); stats.histogram('dest_transform_input_events', events.length, { destination, version: 'v0', ...metaTags, }); + const integrationService = ServiceSelector.getDestinationService(events); let resplist: RouterTransformationResponse[]; + try { - events = DestinationPreTransformationService.preProcess(events, ctx); - const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(events); + const processedEvents = DestinationPreTransformationService.preProcess(events, ctx); + + const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(processedEvents); + events = DynamicConfigParser.process(timestampCorrectEvents); + resplist = await integrationService.doRouterTransformation( events, destination, getIntegrationVersion(), requestMetadata, ); - } catch (error: any) { + } catch (error: unknown) { const metaTO = integrationService.getTags( destination, - events[0].metadata?.destinationId, - events[0].metadata?.workspaceId, + events[0]?.metadata?.destinationId, + events[0]?.metadata?.workspaceId, tags.FEATURES.ROUTER, ); metaTO.metadatas = events.map((ev) => ev.metadata); const errResp = DestinationPostTransformationService.handleRouterTransformFailureEvents( - error, + error as Error, metaTO, ); resplist = [errResp]; } + ctx.body = { output: resplist }; ControllerUtility.postProcess(ctx); stats.histogram('dest_transform_output_events', resplist.length, { @@ -140,11 +149,14 @@ export class DestinationController { const requestMetadata = MiscService.getRequestMetadata(ctx); const routerRequest = ctx.request.body as RouterTransformationRequest; const destination = routerRequest.destType; - let events = routerRequest.input; + const events = routerRequest.input; + const integrationService = ServiceSelector.getDestinationService(events); try { - events = DestinationPreTransformationService.preProcess(events, ctx); - const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(events); + const processedEvents = DestinationPreTransformationService.preProcess(events, ctx); + + const timestampCorrectEvents = ControllerUtility.handleTimestampInEvents(processedEvents); + const resplist = integrationService.doBatchTransformation( timestampCorrectEvents, destination, @@ -152,16 +164,16 @@ export class DestinationController { requestMetadata, ); ctx.body = resplist; - } catch (error: any) { + } catch (error: unknown) { const metaTO = integrationService.getTags( destination, - events[0].metadata.destinationId, - events[0].metadata.workspaceId, + events[0]?.metadata?.destinationId, + events[0]?.metadata?.workspaceId, tags.FEATURES.BATCH, ); metaTO.metadatas = events.map((ev) => ev.metadata); const errResp = DestinationPostTransformationService.handleBatchTransformFailureEvents( - error, + error as Error, metaTO, ); ctx.body = [errResp]; diff --git a/src/controllers/util/index.test.ts b/src/controllers/util/index.test.ts index e1a383148a2..65f42ed56bc 100644 --- a/src/controllers/util/index.test.ts +++ b/src/controllers/util/index.test.ts @@ -1,10 +1,12 @@ import { TransformationError } from '@rudderstack/integrations-lib'; import { ErrorMessages } from '../../constants'; import { + Connection, Destination, Metadata, ProcessorTransformationRequest, RouterTransformationRequestData, + RudderMessage, } from '../../types'; import { ControllerUtility } from './index'; import lodash from 'lodash'; @@ -494,7 +496,7 @@ type timestampTestCases = { inputEvents: Array; }; -const metadata: Metadata = { +const metadata = { sourceId: '27O0bmEEx3GgfmEhZHUcPwJQVWC', workspaceId: '27O0bhB6p5ehfOWeeZlOSsSDTLg', namespace: '', @@ -525,7 +527,7 @@ const metadata: Metadata = { sourceDefinitionId: '1b6gJdqOPOCadT3cddw8eidV591', destinationDefinitionId: '', transformationId: '', -}; +} as unknown as Metadata; const destination: Destination = { ID: 'string', @@ -542,7 +544,7 @@ const destination: Destination = { Transformations: [], }; -const message = { +const message: RudderMessage = { anonymousId: '2073230', event: 'Test', messageId: 'e3a51e9a-6313-4389-ae73-07e487c8d9d0', @@ -565,11 +567,11 @@ function getDestination(overrides: Destination): Destination { return lodash.merge({}, destination, overrides); } -function getMessage(overrides: object): object { +function getMessage(overrides: object): RudderMessage { return lodash.merge({}, message, overrides); } -function getMessageWithShallowMerge(overrides: object): object { +function getMessageWithShallowMerge(overrides: object): RudderMessage { return lodash.assign({}, message, overrides); } diff --git a/src/helpers/__tests__/serviceSelector.test.ts b/src/helpers/__tests__/serviceSelector.test.ts index 0dab906f7ab..e0efff91ec7 100644 --- a/src/helpers/__tests__/serviceSelector.test.ts +++ b/src/helpers/__tests__/serviceSelector.test.ts @@ -51,7 +51,7 @@ describe('ServiceSelector Service', () => { }, }, }, - ] as ProcessorTransformationRequest[]; + ] as unknown as ProcessorTransformationRequest[]; expect(ServiceSelector['getPrimaryDestinationService'](events)).toBeInstanceOf( CDKV2DestinationService, ); diff --git a/src/services/comparator.ts b/src/services/comparator.ts index 1eb67cd5979..3f90d962e3f 100644 --- a/src/services/comparator.ts +++ b/src/services/comparator.ts @@ -61,8 +61,9 @@ export class ComparatorService implements DestinationService { return metaTO; } - private getTestThreshold(destination: Destination) { - return destination.DestinationDefinition?.Config?.camparisonTestThreshold || 0; + private getTestThreshold(destination: Destination): number { + const threshold = destination.DestinationDefinition.Config.camparisonTestThreshold; + return typeof threshold === 'number' ? threshold : 0; } private getComparisonLogs( diff --git a/src/services/destination/__tests__/nativeIntegration.test.ts b/src/services/destination/__tests__/nativeIntegration.test.ts index 3ec3222b9d6..326a170cd0b 100644 --- a/src/services/destination/__tests__/nativeIntegration.test.ts +++ b/src/services/destination/__tests__/nativeIntegration.test.ts @@ -16,7 +16,7 @@ describe('NativeIntegration Service', () => { const destType = '__rudder_test__'; const version = 'v0'; const requestMetadata = {}; - const event = { message: { a: 'b' } } as ProcessorTransformationRequest; + const event = { message: { a: 'b' } } as unknown as ProcessorTransformationRequest; const events: ProcessorTransformationRequest[] = [event, event]; const tevent = { version: 'v0', endpoint: 'http://abc' } as ProcessorTransformationOutput; @@ -58,7 +58,7 @@ describe('NativeIntegration Service', () => { const destType = '__rudder_test__'; const version = 'v0'; const requestMetadata = {}; - const event = { message: { a: 'b' } } as ProcessorTransformationRequest; + const event = { message: { a: 'b' } } as unknown as ProcessorTransformationRequest; const events: ProcessorTransformationRequest[] = [event, event]; FetchHandler.getDestHandler = jest.fn().mockImplementation((d, v) => { diff --git a/src/services/destination/__tests__/preTransformation.test.ts b/src/services/destination/__tests__/preTransformation.test.ts index c10bab78acb..5d6624b7f41 100644 --- a/src/services/destination/__tests__/preTransformation.test.ts +++ b/src/services/destination/__tests__/preTransformation.test.ts @@ -8,13 +8,13 @@ describe('PreTransformation Service', () => { ctx.request.query = { cycle: 'true', x: 'y' }; const events: ProcessorTransformationRequest[] = [ - { message: { a: 'b' } } as ProcessorTransformationRequest, + { message: { a: 'b' } } as unknown as ProcessorTransformationRequest, ]; const expected: ProcessorTransformationRequest[] = [ { message: { a: 'b' }, request: { query: { cycle: 'true', x: 'y' } }, - } as ProcessorTransformationRequest, + } as unknown as ProcessorTransformationRequest, ]; const resp = DestinationPreTransformationService.preProcess(events, ctx); diff --git a/src/services/destination/cdkV2Integration.ts b/src/services/destination/cdkV2Integration.ts index 0789a98c1e7..8175d167a69 100644 --- a/src/services/destination/cdkV2Integration.ts +++ b/src/services/destination/cdkV2Integration.ts @@ -61,8 +61,8 @@ export class CDKV2DestinationService implements DestinationService { events.map(async (event) => { const metaTo = this.getTags( destinationType, - event.metadata.destinationId, - event.metadata.workspaceId, + event.metadata?.destinationId, + event.metadata?.workspaceId, tags.FEATURES.PROCESSOR, ); metaTo.metadata = event.metadata; diff --git a/src/services/destination/nativeIntegration.ts b/src/services/destination/nativeIntegration.ts index 38ec934ff7a..c0b389bf565 100644 --- a/src/services/destination/nativeIntegration.ts +++ b/src/services/destination/nativeIntegration.ts @@ -151,8 +151,8 @@ export class NativeIntegrationDestinationService implements DestinationService { const response = groupedEvents.map((destEvents) => { const metaTO = this.getTags( destinationType, - destEvents[0].metadata.destinationId, - destEvents[0].metadata.workspaceId, + destEvents[0].metadata?.destinationId, + destEvents[0].metadata?.workspaceId, tags.FEATURES.BATCH, ); metaTO.metadatas = events.map((event) => event.metadata); diff --git a/src/services/misc.ts b/src/services/misc.ts index 3efbe617bfa..897e8acc793 100644 --- a/src/services/misc.ts +++ b/src/services/misc.ts @@ -36,7 +36,7 @@ export class MiscService { }; } - public static getMetaTags(metadata: Metadata) { + public static getMetaTags(metadata?: Metadata) { if (!metadata) { return {}; } diff --git a/src/services/source/__tests__/nativeIntegration.test.ts b/src/services/source/__tests__/nativeIntegration.test.ts index 51bb37f5f13..d0decd20258 100644 --- a/src/services/source/__tests__/nativeIntegration.test.ts +++ b/src/services/source/__tests__/nativeIntegration.test.ts @@ -1,5 +1,8 @@ import { FetchHandler } from '../../../helpers/fetchHandlers'; -import { RudderMessage, SourceTransformationResponse } from '../../../types/index'; +import { + SourceTransformationResponse, + SourceTransformationSuccessResponse, +} from '../../../types/index'; import stats from '../../../util/stats'; import { NativeIntegrationSourceService } from '../nativeIntegration'; import { SourcePostTransformationService } from '../postTransformation'; @@ -21,8 +24,11 @@ describe('NativeIntegration Source Service', () => { const event = { message: { a: 'b' }, headers }; const events = [event, event]; - const tevent = { anonymousId: 'test', context: { headers } } as RudderMessage; - const tresp = { output: { batch: [tevent] }, statusCode: 200 } as SourceTransformationResponse; + const tevent = { anonymousId: 'test', context: { headers } }; + const tresp = { + output: { batch: [tevent] }, + statusCode: 200, + } as unknown as SourceTransformationSuccessResponse; const tresponse = [tresp, tresp]; diff --git a/src/services/source/__tests__/postTransformation.test.ts b/src/services/source/__tests__/postTransformation.test.ts index ea8b463bf92..1a30df21d68 100644 --- a/src/services/source/__tests__/postTransformation.test.ts +++ b/src/services/source/__tests__/postTransformation.test.ts @@ -28,12 +28,14 @@ describe('Source PostTransformation Service', () => { const event = { outputToSource: {}, output: { batch: [{ anonymousId: 'test' }] }, + statusCode: 200, } as SourceTransformationResponse; const postProcessedEvents = { outputToSource: {}, output: { batch: [{ anonymousId: 'test', context: { headers } }] }, - } as SourceTransformationResponse; + statusCode: 200, + } as unknown as SourceTransformationResponse; const result = SourcePostTransformationService.handleSuccessEventsSource(event, { headers }); diff --git a/src/services/source/postTransformation.ts b/src/services/source/postTransformation.ts index c62f0ed7138..962860fa925 100644 --- a/src/services/source/postTransformation.ts +++ b/src/services/source/postTransformation.ts @@ -1,4 +1,9 @@ -import { MetaTransferObject, RudderMessage, SourceTransformationResponse } from '../../types/index'; +import { + MetaTransferObject, + RudderMessage, + SourceTransformationResponse, + SourceTransformationSuccessResponse, +} from '../../types/index'; import { CommonUtils } from '../../util/common'; import { CatchErr } from '../../util/types'; import { generateErrorObject } from '../../v0/util'; @@ -26,12 +31,12 @@ export class SourcePostTransformationService { // We send response back to the source // through outputToSource. This is not sent to gateway // We will not return array for events not meant for gateway - let sourceTransformationResponse = events as SourceTransformationResponse; + let sourceTransformationResponse = events as SourceTransformationSuccessResponse; if (!Object.prototype.hasOwnProperty.call(events, 'outputToSource')) { const eventsBatch = CommonUtils.toArray(events); sourceTransformationResponse = { output: { batch: eventsBatch }, - } as SourceTransformationResponse; + } as SourceTransformationSuccessResponse; } if (sourceTransformationResponse.output) { diff --git a/src/types/controlPlaneConfig.ts b/src/types/controlPlaneConfig.ts new file mode 100644 index 00000000000..3454307b240 --- /dev/null +++ b/src/types/controlPlaneConfig.ts @@ -0,0 +1,69 @@ +// import type { FixMe } from '../util/types'; +import type { UserTransformationInput } from './userTransformation'; + +export type DestinationDefinition = { + ID: string; + Name: string; + DisplayName: string; + Config: Record; +}; + +export type Destination> = { + ID: string; + Name: string; + DestinationDefinition: DestinationDefinition; + Config: DestinationConfig; + Enabled: boolean; + WorkspaceID: string; + Transformations: UserTransformationInput[]; + RevisionID?: string; + IsProcessorEnabled?: boolean; + IsConnectionEnabled?: boolean; +}; + +export type DestinationConnectionConfig = { + destination: T; +}; + +export type Connection> = { + sourceId: string; + destinationId: string; + enabled: boolean; + config: T; + processorEnabled?: boolean; +}; + +export type SourceDefinition = { + ID: string; + Name: string; + Category: string; + Type: string; +}; + +export type Source = { + ID: string; + OriginalID: string; + Name: string; + SourceDefinition: SourceDefinition; + Config: object; + Enabled: boolean; + WorkspaceID: string; + WriteKey: string; + Transformations?: UserTransformationInput[]; + RevisionID?: string; + Destinations?: Destination[]; + Transient: boolean; + EventSchemasEnabled: boolean; + DgSourceTrackingPlanConfig: object; +}; + +export type UserTransformationLibrary = { + VersionID: string; +}; + +export type Credential = { + id: string; + key: string; + value: string; + isSecret: boolean; +}; diff --git a/src/types/destinationTransformation.ts b/src/types/destinationTransformation.ts new file mode 100644 index 00000000000..a1960db072d --- /dev/null +++ b/src/types/destinationTransformation.ts @@ -0,0 +1,233 @@ +import type { + Connection, + Credential, + Destination, + UserTransformationLibrary, +} from './controlPlaneConfig'; +import type { Metadata, RudderMessage } from './rudderEvents'; + +/** + * Processor transformation request/response structures + */ +export type ProcessorTransformationRequest = { + request?: object; + message: M; + metadata: MD; + destination: Destination; + connection?: Connection; + libraries?: UserTransformationLibrary[]; + credentials?: Credential[]; +}; + +export type BatchedRequestBody> = { + JSON?: T; + JSON_ARRAY?: Record; + XML?: Record; + FORM?: Record; +}; + +export type BatchedRequest< + TPayload = Record, + THeaders = Record, + TParams = Record, +> = { + body: BatchedRequestBody; + version: string; + type: string; + method: string; + endpoint: string; + headers: THeaders; + params: TParams; + files: Record; +}; + +export type BatchRequestOutput< + TPayload = Record, + THeaders = Record, + TParams = Record, + TDestination = Destination, +> = { + batchedRequest: BatchedRequest; + metadata: Partial[]; + batched: boolean; + statusCode: number; + destination: TDestination; +}; + +/** + * Output structure for processor transformations + */ +export type ProcessorTransformationOutput = { + version: string; + type: string; + method: string; + endpoint: string; + userId?: string; + headers?: Record; + params?: Record; + body?: BatchedRequestBody; + files?: Record; +}; + +export type ProcessorTransformationResponse = { + output?: ProcessorTransformationOutput | RudderMessage; + metadata: Partial; + statusCode: number; + error?: string; + statTags?: object; +}; + +/** + * Router transformation structures + */ +export type RouterTransformationRequestData< + M = RudderMessage, + D = Destination, + C = Connection, + MD = Metadata, +> = { + request?: object; + message: M; + metadata: MD; + destination: D; + connection?: C; +}; + +export type RouterTransformationRequest = { + input: RouterTransformationRequestData[]; + destType: string; +}; + +export type RouterTransformationResponse = { + batchedRequest?: ProcessorTransformationOutput | ProcessorTransformationOutput[]; + metadata: Partial[]; + destination: Destination; + batched: boolean; + statusCode: number; + error?: string; + statTags?: object; +}; + +/** + * Metadata structure for proxy requests + */ +export type ProxyMetdata = { + jobId: number; + attemptNum: number; + userId: string; + sourceId: string; + destinationId: string; + workspaceId: string; + secret: Record; + destInfo?: Record; + omitempty?: Record; + dontBatch: boolean; +}; + +/** + * Proxy request structure for version 0 + */ +export type ProxyV0Request = { + version: string; + type: string; + method: string; + endpoint: string; + userId: string; + headers?: Record; + params?: Record; + body?: { + JSON?: Record; + JSON_ARRAY?: Record; + XML?: Record; + FORM?: Record; + }; + files?: Record; + metadata: ProxyMetdata; + destinationConfig: Record; +}; + +/** + * Proxy request structure for version 1 + */ +export type ProxyV1Request = Omit & { + metadata: ProxyMetdata[]; +}; + +export type ProxyRequest = ProxyV0Request | ProxyV1Request; + +/** + * Error detailer structure for proxy + */ +export type ErrorDetailer = { + module: string; + implementation: string; + feature: string; +} & ErrorDetailerOptions; + +export type ErrorDetailerOptions = { + errorCategory?: string; + errorType?: string; + meta?: string; + destType?: string; + srcType?: string; + cluster?: string; + customer?: string; + destinationId?: string; + workspaceId?: string; + sourceId?: string; +}; + +export type MetaTransferObjectForProxy = { + metadata?: ProxyMetdata; + metadatas?: ProxyMetdata[]; + errorDetails: ErrorDetailer; + errorContext: string; +}; + +export type MetaTransferObject = + | { + metadatas?: Partial[]; + metadata?: Partial; + errorDetails: ErrorDetailer; + errorContext: string; + } + | MetaTransferObjectForProxy; + +/** + * Delivery response structures + */ +export type DeliveryV0Response = { + status: number; + message: string; + destinationResponse: any; + statTags: object; + authErrorCategory?: string; +}; + +export type DeliveryJobState = { + error: string; + statusCode: number; + metadata: ProxyMetdata; +}; + +export type DeliveryV1Response = { + status: number; + message: string; + statTags?: object; + destinationResponse?: any; + authErrorCategory?: string; + response: DeliveryJobState[]; +}; + +export type ComparatorInput = { + events: ProcessorTransformationRequest[] | RouterTransformationRequestData[]; + destination: string; + version: string; + requestMetadata: object; + feature: string; +}; + +// Add helper type for pre-processing functions +export type PreProcessableRequest = + | ProcessorTransformationRequest + | RouterTransformationRequestData; diff --git a/src/types/index.ts b/src/types/index.ts index 59bee82f422..8927a7fe60d 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,423 +1,7 @@ -import { CatchErr, FixMe } from '../util/types'; - -/* eslint-disable @typescript-eslint/no-explicit-any */ -type ProcessorTransformationOutput = { - version: string; - type: string; - method: string; - endpoint: string; - userId?: string; - headers?: Record; - params?: Record; - body?: { - JSON?: Record; - JSON_ARRAY?: Record; - XML?: Record; - FORM?: Record; - }; - files?: Record; -}; - -type ProxyV0Request = { - version: string; - type: string; - method: string; - endpoint: string; - userId: string; - headers?: Record; - params?: Record; - body?: { - JSON?: Record; - JSON_ARRAY?: Record; - XML?: Record; - FORM?: Record; - }; - files?: Record; - metadata: ProxyMetdata; - destinationConfig: Record; -}; - -type ProxyV1Request = { - version: string; - type: string; - method: string; - endpoint: string; - userId: string; - headers?: Record; - params?: Record; - body?: { - JSON?: Record; - JSON_ARRAY?: Record; - XML?: Record; - FORM?: Record; - }; - files?: Record; - metadata: ProxyMetdata[]; - destinationConfig: Record; -}; - -type ProxyRequest = ProxyV0Request | ProxyV1Request; - -type ProxyMetdata = { - jobId: number; - attemptNum: number; - userId: string; - sourceId: string; - destinationId: string; - workspaceId: string; - secret: Record; - destInfo?: Record; - omitempty?: Record; - dontBatch: boolean; -}; - -type Metadata = { - sourceId: string; - workspaceId: string; - namespace: string; - instanceId: string; - sourceType: string; - sourceCategory: string; - trackingPlanId: string; - trackingPlanVersion: number; - sourceTpConfig: object; - mergedTpConfig: object; - destinationId: string; - jobRunId: string; - jobId: number; - sourceBatchId: string; - sourceJobId: string; - sourceJobRunId: string; - sourceTaskId: string; - sourceTaskRunId: string; - recordId: object; - destinationType: string; - messageId: string; - oauthAccessToken: string; - messageIds: string[]; - rudderId: string; - receivedAt: string; - eventName: string; - eventType: string; - sourceDefinitionId: string; - destinationDefinitionId: string; - transformationId: string; - dontBatch?: boolean; -}; - -type MessageIdMetadataMap = { - [key: string]: Metadata; -}; - -type UserTransformationInput = { - VersionID: string; - ID: string; - Config: object; -}; - -type DestinationDefinition = { - ID: string; - Name: string; - DisplayName: string; - Config: FixMe; -}; - -type Destination = { - ID: string; - Name: string; - DestinationDefinition: DestinationDefinition; - Config: DestinationConfig; - Enabled: boolean; - WorkspaceID: string; - Transformations: UserTransformationInput[]; - RevisionID?: string; - IsProcessorEnabled?: boolean; - IsConnectionEnabled?: boolean; -}; - -type Connection = { - sourceId: string; - destinationId: string; - enabled: boolean; - config: Record; - processorEnabled?: boolean; -}; - -type UserTransformationLibrary = { - VersionID: string; -}; - -type Credential = { - id: string; - key: string; - value: string; - isSecret: boolean; -}; - -type ProcessorTransformationRequest = { - request?: object; - message: object; - metadata: Metadata; - destination: Destination; - connection?: Connection; - libraries?: UserTransformationLibrary[]; - credentials?: Credential[]; -}; - -type RouterTransformationRequestData< - Message = object, - DestinationType = Destination, - ConnectionType = Connection, -> = { - request?: object; - message: Message; - metadata: Metadata; - destination: DestinationType; - connection?: ConnectionType; -}; - -type RouterTransformationRequest = { - input: RouterTransformationRequestData[]; - destType: string; -}; - -type ProcessorTransformationResponse = { - output?: ProcessorTransformationOutput | RudderMessage; - metadata: Metadata; - statusCode: number; - error?: string; - statTags?: object; -}; - -type RouterTransformationResponse = { - batchedRequest?: ProcessorTransformationOutput | ProcessorTransformationOutput[]; - metadata: Metadata[]; - destination: Destination; - batched: boolean; - statusCode: number; - error?: string; - statTags?: object; -}; - -type SourceTransformationEvent = { - headers?: Record; - query_params?: Record; - [key: string]: any; -}; - -type SourceTransformationOutput = { - batch: RudderMessage[]; -}; - -type SourceTransformationResponse = { - output: SourceTransformationOutput; - error: CatchErr; - statusCode: number; - outputToSource: object; - statTags: object; -}; - -type DeliveryV0Response = { - status: number; - message: string; - destinationResponse: any; - statTags: object; - authErrorCategory?: string; -}; - -type DeliveryJobState = { - error: string; - statusCode: number; - metadata: ProxyMetdata; -}; - -type DeliveryV1Response = { - status: number; - message: string; - statTags?: object; - destinationResponse?: any; - authErrorCategory?: string; - response: DeliveryJobState[]; -}; - -enum MessageType { - IDENTIFY = 'identify', - TRACK = 'track', - PAGE = 'page', - SCREEN = 'screen', - GROUP = 'group', - ALIAS = 'alias', - AUDIENCE_LIST = 'audiencelist', -} - -type RudderMessage = { - userId?: string; - anonymousId: string; - type: MessageType; - channel: string; - context: object; - originalTimestamp: Date; - sentAt: Date; - timestamp: Date; - event?: string; - integrations?: object; - messageId: string; - properties?: object; - traits?: object; -}; - -type ErrorDetailer = { - module: string; - implementation: string; - feature: string; -} & ErrorDetailerOptions; - -type ErrorDetailerOptions = { - errorCategory?: string; - errorType?: string; - meta?: string; - destType?: string; - srcType?: string; - cluster?: string; - customer?: string; - destinationId?: string; - workspaceId?: string; - sourceId?: string; -}; - -type MetaTransferObjectForProxy = { - metadata?: ProxyMetdata; - metadatas?: ProxyMetdata[]; - errorDetails: ErrorDetailer; - errorContext: string; -}; - -type MetaTransferObject = - | { - metadatas?: Metadata[]; - metadata?: Metadata; - errorDetails: ErrorDetailer; - errorContext: string; - } - | MetaTransferObjectForProxy; - -type UserTransformationResponse = { - transformedEvent: RudderMessage; - metadata: Metadata; - error: CatchErr; -}; - -type UserTransformationServiceResponse = { - transformedEvents: ProcessorTransformationResponse[]; - retryStatus: number; -}; - -type UserDeletionRequest = { - userAttributes: FixMe[]; - config: object; - destType: string; - jobId: string; -}; - -type UserDeletionResponse = { - statusCode: number; - error?: string; - status?: string; - authErrorCategory: FixMe; - statTags: object; -}; - -type ComparatorInput = { - events: ProcessorTransformationRequest[] | RouterTransformationRequestData[]; - destination: string; - version: string; - requestMetadata: object; - feature: string; -}; -type SourceDefinition = { - ID: string; - Name: string; - Category: string; - Type: string; -}; - -type Source = { - ID: string; - OriginalID: string; - Name: string; - SourceDefinition: SourceDefinition; - Config: object; - Enabled: boolean; - WorkspaceID: string; - WriteKey: string; - Transformations?: UserTransformationInput[]; - RevisionID?: string; - Destinations?: Destination[]; - Transient: boolean; - EventSchemasEnabled: boolean; - DgSourceTrackingPlanConfig: object; -}; - -type SourceInput = { - event: { - query_parameters?: any; - [key: string]: any; - }; - source?: Source; -}; - -type SourceRequestV2 = { - method?: string; - url?: string; - proto?: string; - body: string; - headers?: Record; - query_parameters?: Record; -}; - -type SourceInputV2 = { - request: SourceRequestV2; - source?: Source; -}; - -type SourceInputConversionResult = { - output?: T; - conversionError?: Error; -}; - -export { - ComparatorInput, - DeliveryJobState, - DeliveryV0Response, - DeliveryV1Response, - Connection, - Destination, - ErrorDetailer, - ErrorDetailerOptions, - MessageIdMetadataMap, - MetaTransferObject, - Metadata, - ProcessorTransformationOutput, - ProcessorTransformationRequest, - ProcessorTransformationResponse, - ProxyMetdata, - ProxyRequest, - ProxyV0Request, - ProxyV1Request, - RouterTransformationRequest, - RouterTransformationRequestData, - RouterTransformationResponse, - RudderMessage, - SourceTransformationEvent, - SourceTransformationResponse, - UserDeletionRequest, - UserDeletionResponse, - SourceInput, - SourceInputV2, - SourceRequestV2, - Source, - SourceInputConversionResult, - UserTransformationLibrary, - UserTransformationResponse, - UserTransformationServiceResponse, -}; +export * from './rudderEvents'; +export * from './controlPlaneConfig'; +export * from './destinationTransformation'; +export * from './sourceTransformation'; +export * from './userTransformation'; +export * from './userRegulation'; +export * from './zodTypes'; diff --git a/src/types/rudderEvents.ts b/src/types/rudderEvents.ts new file mode 100644 index 00000000000..29ba4fe4787 --- /dev/null +++ b/src/types/rudderEvents.ts @@ -0,0 +1,91 @@ +import { z } from 'zod'; + +/** + * Supported message types in the event specification + */ +export const MessageTypeSchema = z.enum([ + 'identify', + 'track', + 'page', + 'screen', + 'group', + 'alias', + 'record', + 'audiencelist', +]); + +export type MessageType = z.infer; + +/** + * Core event message structure following Rudder event spec + */ + +export const RudderMessageSchema = z + .object({ + userId: z.string().optional(), + anonymousId: z.string().optional(), + type: MessageTypeSchema, + channel: z.string().optional(), + context: z.object({}).optional(), + originalTimestamp: z.string().optional(), + sentAt: z.string().optional(), + timestamp: z.string().optional(), + event: z.string().optional(), + integrations: z.object({}).optional(), + messageId: z.string().optional(), + properties: z.object({}).optional(), + traits: z.object({}).optional(), + statusCode: z.number().optional(), + }) + .passthrough(); + +export type RudderMessage = z.infer; + +export const RudderRecordV1Schema = z.object({ + type: z.literal('record'), +}); + +export type RudderRecordV1 = z.infer; + +/** + * Metadata structure for messages + */ +export const MetadataSchema = z + .object({ + sourceId: z.string(), + workspaceId: z.string(), + namespace: z.string().optional(), + instanceId: z.string().optional(), + sourceType: z.string(), + sourceCategory: z.string(), + trackingPlanId: z.string().optional(), + trackingPlanVersion: z.number().optional(), + sourceTpConfig: z.object({}).optional(), + mergedTpConfig: z.object({}).optional(), + destinationId: z.string(), + jobRunId: z.string().optional(), + jobId: z.number(), + sourceBatchId: z.string().optional(), + sourceJobId: z.string().optional(), + sourceJobRunId: z.string().optional(), + sourceTaskId: z.string().optional(), + sourceTaskRunId: z.string().optional(), + recordId: z.object({}).optional(), + destinationType: z.string(), + messageId: z.string(), + oauthAccessToken: z.string().optional(), + messageIds: z.array(z.string()).optional(), + rudderId: z.string().optional(), + receivedAt: z.string().optional(), + eventName: z.string().optional(), + eventType: z.string().optional(), + sourceDefinitionId: z.string().optional(), + destinationDefinitionId: z.string().optional(), + transformationId: z.string().optional(), + dontBatch: z.boolean().optional(), + }) + .passthrough(); + +export type Metadata = z.infer; + +export type MessageIdMetadataMap = Record>; diff --git a/src/types/sourceTransformation.ts b/src/types/sourceTransformation.ts new file mode 100644 index 00000000000..1ee569e4e6c --- /dev/null +++ b/src/types/sourceTransformation.ts @@ -0,0 +1,56 @@ +import type { CatchErr } from '../util/types'; +import type { Source } from './controlPlaneConfig'; +import type { RudderMessage } from './rudderEvents'; + +export type SourceTransformationEvent = { + headers?: Record; + query_params?: Record; + [key: string]: any; +}; + +export type SourceRequestV2 = { + method?: string; + url?: string; + proto?: string; + body: string; + headers?: Record; + query_parameters?: Record; +}; + +export type SourceInput = { + event: { + query_parameters?: any; + [key: string]: any; + }; + source?: Source; +}; + +export type SourceInputV2 = { + request: SourceRequestV2; + source?: Source; +}; + +export type SourceInputConversionResult = { + output?: T; + conversionError?: Error; +}; + +export type SourceTransformationOutput = { + batch: RudderMessage[]; +}; + +export type SourceTransformationSuccessResponse = { + output: SourceTransformationOutput; + statusCode: number; + outputToSource?: object; +}; + +export type SourceTransformationErrorResponse = { + error: CatchErr; + statusCode: number; + statTags: object; +}; + +export type SourceTransformationResponse = + | SourceTransformationSuccessResponse + | SourceTransformationErrorResponse; diff --git a/src/types/userRegulation.ts b/src/types/userRegulation.ts new file mode 100644 index 00000000000..a2390c7f9a4 --- /dev/null +++ b/src/types/userRegulation.ts @@ -0,0 +1,19 @@ +import type { FixMe } from '../util/types'; + +/** + * Types for user data regulation operations + */ +export type UserDeletionRequest = { + userAttributes: FixMe[]; + config: object; + destType: string; + jobId: string; +}; + +export type UserDeletionResponse = { + statusCode: number; + error?: string; + status?: string; + authErrorCategory: FixMe; + statTags: object; +}; diff --git a/src/types/userTransformation.ts b/src/types/userTransformation.ts new file mode 100644 index 00000000000..ec6b2ace370 --- /dev/null +++ b/src/types/userTransformation.ts @@ -0,0 +1,23 @@ +import type { CatchErr } from '../util/types'; +import type { Metadata, RudderMessage } from './rudderEvents'; +import type { ProcessorTransformationResponse } from './destinationTransformation'; + +/** + * Input structure for user transformations + */ +export type UserTransformationInput = { + VersionID: string; + ID: string; + Config: object; +}; + +export type UserTransformationResponse = { + transformedEvent: RudderMessage; + metadata: Metadata; + error: CatchErr; +}; + +export type UserTransformationServiceResponse = { + transformedEvents: ProcessorTransformationResponse[]; + retryStatus: number; +}; diff --git a/src/v0/destinations/airship/utils.test.ts b/src/v0/destinations/airship/utils.test.ts index cf637abb73c..0ed77a6fa67 100644 --- a/src/v0/destinations/airship/utils.test.ts +++ b/src/v0/destinations/airship/utils.test.ts @@ -52,7 +52,7 @@ describe('Airship utils - getAirshipTimestamp', () => { test.each(timestampCases)('getAirshipTimestamp - $description', ({ input, output, error }) => { const message = { timestamp: input, - } as unknown as RudderMessage; + } as RudderMessage; if (error) { expect(() => getAirshipTimestamp(message)).toThrow(error); } else { @@ -128,7 +128,7 @@ describe('Airship utils - prepareAttributePayload', () => { All: true, }, type: 'identify', - } as unknown as RudderMessage; + }; const expectedAttributePayload = { attributes: [ @@ -186,7 +186,7 @@ describe('Airship utils - prepareAttributePayload', () => { }, }, type: 'identify', - } as unknown as RudderMessage; + }; const traits = getFieldValueFromMessage(message, 'traits'); const flattenedTraits = flattenJson(traits); @@ -220,7 +220,7 @@ describe('Airship utils - prepareAttributePayload', () => { }, }, type: 'identify', - } as unknown as RudderMessage; + }; const expectedAttributePayload = { attributes: [ @@ -279,7 +279,7 @@ describe('Airship utils - prepareAttributePayload', () => { }, }, type: 'identify', - } as unknown as RudderMessage; + }; const expectedAttributePayload = { attributes: [ @@ -351,7 +351,7 @@ describe('Airship utils - prepareAttributePayload', () => { }, }, type: 'identify', - } as unknown as RudderMessage; + }; const expectedAttributePayload = { attributes: [ diff --git a/src/v0/destinations/customerio_audience/config.ts b/src/v0/destinations/customerio_audience/config.ts index d9b223c59b8..c6acbcdb6e4 100644 --- a/src/v0/destinations/customerio_audience/config.ts +++ b/src/v0/destinations/customerio_audience/config.ts @@ -3,9 +3,3 @@ export const MAX_ITEMS = 1000; export const DEFAULT_ID_TYPE = 'id'; export const BASE_ENDPOINT = 'https://track.customer.io/api/v1/segments'; - -export const SegmentAction = { - INSERT: 'insert', - UPDATE: 'update', - DELETE: 'delete', -}; diff --git a/src/v0/destinations/customerio_audience/transform.ts b/src/v0/destinations/customerio_audience/transform.ts index c8d9f8a89c0..4bbef334af5 100644 --- a/src/v0/destinations/customerio_audience/transform.ts +++ b/src/v0/destinations/customerio_audience/transform.ts @@ -1,75 +1,24 @@ -import { ConfigurationError } from '@rudderstack/integrations-lib'; -import { SegmentAction } from './config'; -import { CustomerIORouterRequestType, RespList } from './type'; - -const { InstrumentationError } = require('@rudderstack/integrations-lib'); -const { batchResponseBuilder, getEventAction } = require('./utils'); -const { handleRtTfSingleEventError, getEventType } = require('../../util'); -const { EventType } = require('../../../constants'); - -interface ProcessedEvent extends RespList { - eventAction: keyof typeof SegmentAction; -} - -const createEventChunk = (event: CustomerIORouterRequestType): ProcessedEvent => { - const eventAction = getEventAction(event); - const { identifiers } = event?.message || {}; - const id: string | number = Object.values(identifiers)[0]; - - return { - payload: { ids: [id] }, - metadata: event.metadata, - eventAction, - }; -}; - -const validateEvent = (event: CustomerIORouterRequestType): boolean => { - const eventType = getEventType(event?.message); - if (eventType !== EventType.RECORD) { - throw new InstrumentationError(`message type ${eventType} is not supported`); - } - - const eventAction = getEventAction(event); - if (!Object.values(SegmentAction).includes(eventAction)) { - throw new InstrumentationError(`action ${eventAction} is not supported`); - } - - const identifiers = event?.message?.identifiers; - if (!identifiers || Object.keys(identifiers).length === 0) { - throw new InstrumentationError(`identifiers cannot be empty`); - } - - if (Object.keys(identifiers).length > 1) { - throw new InstrumentationError(`only one identifier is supported`); - } - - const id = Object.values(identifiers)[0]; - if (typeof id !== 'string' && typeof id !== 'number') { - throw new ConfigurationError(`identifier type should be a string or integer`); - } - - const audienceId = event?.connection?.config?.destination?.audienceId; - if (!audienceId) { - throw new InstrumentationError('audienceId is required, aborting.'); - } - - const identifierMappings = event?.connection?.config?.destination?.identifierMappings; - if (!identifierMappings || Object.keys(identifierMappings).length === 0) { - throw new InstrumentationError('identifierMappings cannot be empty'); - } - - return true; -}; - -const processRouterDest = async (inputs: CustomerIORouterRequestType[], reqMetadata: any) => { +import { + SegmentAction, + CustomerIOConnection, + CustomerIODestination, + CustomerIORouterRequest, + ProcessedEvent, +} from './type'; +import { batchResponseBuilder, createEventChunk } from './utils'; +import { handleRtTfSingleEventError } from '../../util'; + +const processRouterDest = async (inputs: CustomerIORouterRequest[], reqMetadata: any) => { if (!inputs?.length) return []; const { destination, connection } = inputs[0]; + const customerIODestination = destination as CustomerIODestination; + const customerIOConnection = connection as CustomerIOConnection; + // Process events and separate valid and error cases const processedEvents = inputs.map((event) => { try { - validateEvent(event); return { success: true, data: createEventChunk(event), @@ -103,8 +52,8 @@ const processRouterDest = async (inputs: CustomerIORouterRequestType[], reqMetad const batchSuccessfulRespList = batchResponseBuilder( insertOrUpdateRespList, deleteRespList, - destination, - connection, + customerIODestination, + customerIOConnection, ); return [...batchSuccessfulRespList, ...errorEvents]; diff --git a/src/v0/destinations/customerio_audience/type.ts b/src/v0/destinations/customerio_audience/type.ts index 5c5335d6c8e..ea883b093b9 100644 --- a/src/v0/destinations/customerio_audience/type.ts +++ b/src/v0/destinations/customerio_audience/type.ts @@ -1,60 +1,125 @@ -import { Connection, Destination, Metadata, RouterTransformationRequestData } from '../../../types'; +import { z } from 'zod'; + +import { + Connection, + Destination, + DestinationConnectionConfig, + MessageTypeSchema, + Metadata, + RouterTransformationRequestData, +} from '../../../types'; + +import { + BatchedRequest, + BatchedRequestBody, + BatchRequestOutput, +} from '../../../types/destinationTransformation'; // Basic response type for audience list operations export type RespList = { payload: { ids: (string | number)[]; }; - metadata: Metadata; + metadata: Partial; }; // Types for API request components -export type SegmentationPayloadType = { +export type SegmentationPayload = { ids: (string | number)[]; }; -export type SegmentationParamType = { +export type SegmentationParam = { id_type: string; }; -export type SegmentationHeadersType = { +export type SegmentationHeaders = { 'Content-Type': string; Authorization: string; }; +export const SegmentAction = { + INSERT: 'insert', + UPDATE: 'update', + DELETE: 'delete', +} as const; + +export const CustomerIODestinationConfigSchema = z + .object({ + apiKey: z.string(), + appApiKey: z.string(), + siteId: z.string(), + }) + .passthrough(); + // CustomerIO specific configuration types -type CustomerIODestinationConfig = { - apiKey: string; - appApiKey: string; - siteId: string; - [key: string]: any; -}; +export type CustomerIODestinationConfig = z.infer; -type CustomerIOConnectionConfig = { - destination: { - audienceId: string | number; - identifierMappings: { - from: string; - to: string; - }[]; - }; -}; +export const CustomerIOConnectionConfigSchema = z + .object({ + audienceId: z.string().nonempty(), + identifierMappings: z.array(z.object({ from: z.string(), to: z.string() })).nonempty(), + }) + .passthrough(); + +export type CustomerIOConnectionConfig = z.infer; + +const SegmentActionSchema = z.nativeEnum(SegmentAction); // Message type specific to CustomerIO -export type CustomerIOMessageType = { - action: string; - identifiers: Record; - [key: string]: any; -}; +export const CustomerIOMessageSchema = z + .object({ + type: z.literal(MessageTypeSchema.enum.record), + action: SegmentActionSchema, + identifiers: z + .record(z.string(), z.union([z.string(), z.number()])) + .superRefine((identifiers, ctx) => { + if (Object.keys(identifiers).length === 0) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: 'cannot be empty', + }); + } else if (Object.keys(identifiers).length !== 1) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: 'only one identifier is supported', + }); + } + }), + }) + .passthrough(); + +export type SegmentActionType = z.infer; + +export type CustomerIOMessage = z.infer; // Final exported types using generics from base types -export type CustomerIODestinationType = Destination; -export type CustomerIOConnectionType = Connection & { - config: CustomerIOConnectionConfig; -}; +export type CustomerIODestination = Destination; +export type CustomerIOConnection = Connection< + DestinationConnectionConfig +>; + +export type CustomerIORouterRequest = RouterTransformationRequestData< + CustomerIOMessage, + CustomerIODestination, + CustomerIOConnection +>; -export type CustomerIORouterRequestType = RouterTransformationRequestData< - CustomerIOMessageType, - CustomerIODestinationType, - CustomerIOConnectionType +// Remove the duplicate types and use the generic ones instead +export type CustomerIOBatchResponse = BatchRequestOutput< + SegmentationPayload, + SegmentationHeaders, + SegmentationParam, + CustomerIODestination >; + +export type CustomerIOBatchedRequest = BatchedRequest< + SegmentationPayload, + SegmentationHeaders, + SegmentationParam +>; + +export type CustomerIOBatchedRequestBody = BatchedRequestBody; + +export type ProcessedEvent = RespList & { + eventAction: SegmentActionType; +}; diff --git a/src/v0/destinations/customerio_audience/utils.test.ts b/src/v0/destinations/customerio_audience/utils.test.ts new file mode 100644 index 00000000000..b8803d41053 --- /dev/null +++ b/src/v0/destinations/customerio_audience/utils.test.ts @@ -0,0 +1,140 @@ +import { batchResponseBuilder, createEventChunk } from './utils'; +import { InstrumentationError, ConfigurationError } from '@rudderstack/integrations-lib'; +describe('utils', () => { + describe('batchResponseBuilder', () => { + const mockDestination = { + Config: { + siteId: 'test-site', + apiKey: 'test-key', + }, + }; + + const mockConnection = { + config: { + destination: { + identifierMappings: [{ to: 'email' }], + audienceId: '123', + }, + }, + }; + + const testCases = [ + { + name: 'should build batch responses for insert and delete', + input: { + insertOrUpdateRespList: [{ payload: { ids: ['user1'] }, metadata: { sourceId: '1' } }], + deleteRespList: [{ payload: { ids: ['user2'] }, metadata: { sourceId: '2' } }], + }, + expected: { + length: 2, + firstEndpoint: 'https://track.customer.io/api/v1/segments/123/add_customers', + secondEndpoint: 'https://track.customer.io/api/v1/segments/123/remove_customers', + }, + }, + { + name: 'should handle empty lists', + input: { + insertOrUpdateRespList: [], + deleteRespList: [], + }, + expected: { + length: 0, + }, + }, + ]; + + testCases.forEach(({ name, input, expected }) => { + test(name, () => { + const result = batchResponseBuilder( + input.insertOrUpdateRespList, + input.deleteRespList, + mockDestination as any, + mockConnection as any, + ); + + expect(result).toHaveLength(expected.length); + if (expected.length > 0) { + expect(result[0].batchedRequest.endpoint).toBe(expected.firstEndpoint); + expect(result[1].batchedRequest.endpoint).toBe(expected.secondEndpoint); + } + }); + + describe('createEventChunk', () => { + const testCases = [ + { + name: 'should create valid event chunk', + input: { + message: { + type: 'record', + action: 'insert', + identifiers: { email: 'test@test.com' }, + }, + connection: { + config: { + destination: { + identifierMappings: [{ to: 'email', from: 'email' }], + audienceId: '123', + }, + }, + }, + metadata: { sourceId: '1' }, + }, + expected: { + payload: { ids: ['test@test.com'] }, + eventAction: 'insert', + metadata: { sourceId: '1' }, + }, + }, + { + name: 'should throw InstrumentationError for invalid message', + input: { + message: { + action: null, + identifiers: {}, + }, + connection: { + config: { + destination: { + identifierMappings: [{ to: 'email', from: 'email' }], + audienceId: '123', + }, + }, + }, + }, + throws: InstrumentationError, + }, + { + name: 'should throw ConfigurationError for invalid connection config', + input: { + message: { + type: 'record', + action: 'insert', + identifiers: { email: 'test@test.com' }, + }, + connection: { + config: { + destination: { + identifierMappings: [], + audienceId: null, + }, + }, + }, + }, + throws: ConfigurationError, + }, + ]; + + testCases.forEach(({ name, input, expected, throws }) => { + test(name, () => { + if (throws) { + expect(() => createEventChunk(input as any)).toThrow(throws); + } else { + const result = createEventChunk(input as any); + expect(result).toEqual(expected); + } + }); + }); + }); + }); + }); +}); diff --git a/src/v0/destinations/customerio_audience/utils.ts b/src/v0/destinations/customerio_audience/utils.ts index c642618963b..ed80f6816a2 100644 --- a/src/v0/destinations/customerio_audience/utils.ts +++ b/src/v0/destinations/customerio_audience/utils.ts @@ -1,46 +1,57 @@ -import { base64Convertor } from '@rudderstack/integrations-lib'; +import { + base64Convertor, + ConfigurationError, + formatZodError, + InstrumentationError, +} from '@rudderstack/integrations-lib'; import { BatchUtils } from '@rudderstack/workflow-engine'; import { BASE_ENDPOINT, DEFAULT_ID_TYPE, MAX_ITEMS } from './config'; import { - CustomerIOConnectionType, - CustomerIODestinationType, - CustomerIORouterRequestType, + CustomerIOConnection, + CustomerIODestination, + CustomerIORouterRequest, RespList, - SegmentationHeadersType, - SegmentationParamType, - SegmentationPayloadType, + SegmentationHeaders, + SegmentationParam, + SegmentationPayload, + CustomerIOBatchResponse, + SegmentActionType, + CustomerIOConnectionConfigSchema, + CustomerIOMessageSchema, + ProcessedEvent, } from './type'; import { Metadata } from '../../../types'; -const getIdType = (connection: CustomerIOConnectionType): string => +const getIdType = (connection: CustomerIOConnection): string => connection.config.destination.identifierMappings[0]?.to || DEFAULT_ID_TYPE; -const getSegmentId = (connection: CustomerIOConnectionType): string | number => +const getSegmentId = (connection: CustomerIOConnection): string | number => connection.config.destination.audienceId; -const getHeaders = (destination: CustomerIODestinationType): SegmentationHeadersType => ({ +const getHeaders = (destination: CustomerIODestination): SegmentationHeaders => ({ 'Content-Type': 'application/json', Authorization: `Basic ${base64Convertor(`${destination.Config.siteId}:${destination.Config.apiKey}`)}`, }); -const getParams = (connection: CustomerIOConnectionType): SegmentationParamType => ({ +const getParams = (connection: CustomerIOConnection): SegmentationParam => ({ id_type: getIdType(connection), }); -const getMergedPayload = (batch: RespList[]): SegmentationPayloadType => ({ +const getMergedPayload = (batch: RespList[]): SegmentationPayload => ({ ids: batch.flatMap((input) => input.payload.ids), }); -const getMergedMetadata = (batch: RespList[]): Metadata[] => batch.map((input) => input.metadata); +const getMergedMetadata = (batch: RespList[]): Partial[] => + batch.map((input) => input.metadata); const buildBatchedResponse = ( - payload: SegmentationPayloadType, + payload: SegmentationPayload, endpoint: string, - headers: SegmentationHeadersType, - params: SegmentationParamType, - metadata: Metadata[], - destination: CustomerIODestinationType, -) => ({ + headers: SegmentationHeaders, + params: SegmentationParam, + metadata: Partial[], + destination: CustomerIODestination, +): CustomerIOBatchResponse => ({ batchedRequest: { body: { JSON: payload, @@ -65,9 +76,9 @@ const buildBatchedResponse = ( const processBatch = ( respList: RespList[], endpoint: string, - destination: CustomerIODestinationType, - connection: CustomerIOConnectionType, -): any[] => { + destination: CustomerIODestination, + connection: CustomerIOConnection, +): CustomerIOBatchResponse[] => { if (!respList?.length) { return []; } @@ -90,12 +101,12 @@ const processBatch = ( }); }; -const batchResponseBuilder = ( +export const batchResponseBuilder = ( insertOrUpdateRespList: RespList[], deleteRespList: RespList[], - destination: CustomerIODestinationType, - connection: CustomerIOConnectionType, -): any[] => { + destination: CustomerIODestination, + connection: CustomerIOConnection, +): CustomerIOBatchResponse[] => { const segmentId = getSegmentId(connection); const insertResponses = processBatch( @@ -115,7 +126,35 @@ const batchResponseBuilder = ( return [...insertResponses, ...deleteResponses]; }; -const getEventAction = (event: CustomerIORouterRequestType): string => - event?.message?.action?.toLowerCase() || ''; +const getEventAction = (event: CustomerIORouterRequest): string => event.message.action; + +const validateEvent = (event: CustomerIORouterRequest): boolean => { + const { message, connection } = event; + + const connectionValidation = CustomerIOConnectionConfigSchema.safeParse( + connection?.config.destination, + ); + + if (!connectionValidation.success) { + throw new ConfigurationError(formatZodError(connectionValidation.error)); + } + const messageValidation = CustomerIOMessageSchema.safeParse(message); + + if (!messageValidation.success) { + throw new InstrumentationError(formatZodError(messageValidation.error)); + } + + return true; +}; + +export const createEventChunk = (event: CustomerIORouterRequest): ProcessedEvent => { + validateEvent(event); + const eventAction = getEventAction(event); + const id = Object.values(event.message.identifiers)[0]; -export { batchResponseBuilder, getEventAction }; + return { + payload: { ids: [id] }, + metadata: event.metadata, + eventAction: eventAction as SegmentActionType, + }; +}; diff --git a/src/v0/destinations/ga4_v2/transform.test.ts b/src/v0/destinations/ga4_v2/transform.test.ts new file mode 100644 index 00000000000..02babb75199 --- /dev/null +++ b/src/v0/destinations/ga4_v2/transform.test.ts @@ -0,0 +1,133 @@ +import { process } from './transform'; +import { ProcessorTransformationRequest } from '../../../types'; +import { handleCustomMappings } from './customMappingsHandler'; +import { processEvents as ga4Process } from '../ga4/transform'; + +// Mock dependencies +jest.mock('./customMappingsHandler'); +jest.mock('../ga4/transform'); +jest.mock('../ga4/utils'); + +describe('process', () => { + const mockHandleCustomMappings = handleCustomMappings as jest.Mock; + const mockGa4Process = ga4Process as jest.Mock; + + beforeEach(() => { + jest.restoreAllMocks(); + + jest.clearAllMocks(); + }); + + const testCases = [ + { + name: 'should process track events with custom mappings', + input: { + message: { + type: 'track', + event: 'test_event', + }, + destination: { + Config: { + configData: JSON.stringify({ + PROPERTY: 'test-property', + DATA_STREAM: { type: 'gtag', value: 'G-123456' }, + MEASUREMENT_PROTOCOL_SECRET: 'secret', + }), + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedConfig: { + propertyId: 'test-property', + typesOfClient: 'gtag', + measurementId: 'G-123456', + apiSecret: 'secret', + configData: expect.any(String), + }, + shouldCallCustomMappings: true, + shouldCallGa4Process: false, + }, + { + name: 'should process non-track events with ga4Process', + input: { + message: { + type: 'identify', + }, + destination: { + Config: { + configData: JSON.stringify({ + PROPERTY: 'test-property', + DATA_STREAM: { type: 'firebase', value: 'app-id' }, + MEASUREMENT_PROTOCOL_SECRET: 'secret', + }), + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedConfig: { + propertyId: 'test-property', + typesOfClient: 'firebase', + firebaseAppId: 'app-id', + apiSecret: 'secret', + configData: expect.any(String), + }, + shouldCallCustomMappings: false, + shouldCallGa4Process: true, + }, + ]; + + test.each(testCases)( + '$name', + ({ input, expectedConfig, shouldCallCustomMappings, shouldCallGa4Process }) => { + process(input); + + if (shouldCallCustomMappings) { + expect(mockHandleCustomMappings).toHaveBeenCalledWith( + input.message, + expect.objectContaining(expectedConfig), + ); + } else { + expect(mockHandleCustomMappings).not.toHaveBeenCalled(); + } + + if (shouldCallGa4Process) { + expect(mockGa4Process).toHaveBeenCalledWith({ event: input, destType: 'ga4_v2' }); + } else { + expect(mockGa4Process).not.toHaveBeenCalled(); + } + }, + ); + + const errorTestCases = [ + { + name: 'should throw error when message type is missing', + input: { + message: {}, + destination: { + Config: { + configData: JSON.stringify({ + PROPERTY: 'test-property', + DATA_STREAM: { type: 'gtag', value: 'G-123456' }, + MEASUREMENT_PROTOCOL_SECRET: 'secret', + }), + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedError: 'Message Type is not present. Aborting message.', + }, + { + name: 'should throw error when configData is not a string', + input: { + message: { type: 'track' }, + destination: { + Config: { + configData: { invalid: 'object' }, + }, + }, + } as unknown as ProcessorTransformationRequest, + expectedError: 'Config data is not a string', + }, + ]; + + test.each(errorTestCases)('$name', ({ input, expectedError }) => { + expect(() => process(input)).toThrow(expectedError); + }); +}); diff --git a/src/v0/destinations/ga4_v2/transform.ts b/src/v0/destinations/ga4_v2/transform.ts index 883cb420a1f..ee2516c5ba3 100644 --- a/src/v0/destinations/ga4_v2/transform.ts +++ b/src/v0/destinations/ga4_v2/transform.ts @@ -1,5 +1,5 @@ import { InstrumentationError, isDefinedAndNotNull } from '@rudderstack/integrations-lib'; -import { ProcessorTransformationRequest } from '../../../types'; +import { ProcessorTransformationRequest, RudderMessage } from '../../../types'; import { handleCustomMappings } from './customMappingsHandler'; import { processEvents as ga4Process } from '../ga4/transform'; import { basicConfigvalidaiton } from '../ga4/utils'; @@ -8,6 +8,9 @@ export function process(event: ProcessorTransformationRequest) { const { message, destination } = event; const { Config } = destination; if (isDefinedAndNotNull(Config.configData)) { + if (typeof Config.configData !== 'string') { + throw new InstrumentationError('Config data is not a string'); + } const configDetails = JSON.parse(Config.configData); Config.propertyId = configDetails.PROPERTY; Config.typesOfClient = configDetails.DATA_STREAM.type; @@ -19,7 +22,7 @@ export function process(event: ProcessorTransformationRequest) { Config.apiSecret = configDetails.MEASUREMENT_PROTOCOL_SECRET; } - const eventPayload = message as any; + const eventPayload = message as RudderMessage; if (!eventPayload.type) { throw new InstrumentationError('Message Type is not present. Aborting message.'); diff --git a/test/apitests/service.api.test.ts b/test/apitests/service.api.test.ts index 082bc3fbefc..4c53178c76f 100644 --- a/test/apitests/service.api.test.ts +++ b/test/apitests/service.api.test.ts @@ -22,7 +22,7 @@ beforeAll(async () => { }), ); applicationRoutes(app); - server = app.listen(9090); + server = app.listen(); }); afterAll(async () => { diff --git a/test/integrations/component.test.ts b/test/integrations/component.test.ts index 8388370b0e0..cc786678f09 100644 --- a/test/integrations/component.test.ts +++ b/test/integrations/component.test.ts @@ -124,22 +124,6 @@ const testRoute = async (route, tcData: TestCaseData) => { .send(body); const outputResp = tcData.output.response || ({} as any); - if (tcData.feature === tags.FEATURES.BATCH || tcData.feature === tags.FEATURES.ROUTER) { - //TODO get rid of these skipped destinations after they are fixed - if ( - tcData.name != 'marketo_static_list' && - tcData.name != 'mailmodo' && - tcData.name != 'hs' && - tcData.name != 'iterable' && - tcData.name != 'klaviyo' && - tcData.name != 'tiktok_ads' && - tcData.name != 'mailjet' && - tcData.name != 'google_adwords_offline_conversions' - ) { - assertRouterOutput(response.body.output, tcData.input.request.body.input); - } - } - expect(response.status).toEqual(outputResp.status); if (INTEGRATIONS_WITH_UPDATED_TEST_STRUCTURE.includes(tcData.name?.toLocaleLowerCase())) { @@ -155,6 +139,21 @@ const testRoute = async (route, tcData: TestCaseData) => { if (outputResp.headers !== undefined) { expect(response.headers).toEqual(outputResp.headers); } + if (tcData.feature === tags.FEATURES.BATCH || tcData.feature === tags.FEATURES.ROUTER) { + //TODO get rid of these skipped destinations after they are fixed + if ( + tcData.name != 'marketo_static_list' && + tcData.name != 'mailmodo' && + tcData.name != 'hs' && + tcData.name != 'iterable' && + tcData.name != 'klaviyo' && + tcData.name != 'tiktok_ads' && + tcData.name != 'mailjet' && + tcData.name != 'google_adwords_offline_conversions' + ) { + assertRouterOutput(response.body.output, tcData.input.request.body.input); + } + } }; const destinationTestHandler = async (tcData: TestCaseData) => { diff --git a/test/integrations/destinations/accoil_analytics/processor/data.ts b/test/integrations/destinations/accoil_analytics/processor/data.ts index fae881f8b64..d0842cc447d 100644 --- a/test/integrations/destinations/accoil_analytics/processor/data.ts +++ b/test/integrations/destinations/accoil_analytics/processor/data.ts @@ -2,7 +2,7 @@ import { ProcessorTestData } from '../../../testTypes'; import { Metadata } from '../../../../../src/types'; import { authHeader1, authHeaderStaging1, secret1, secretStaging1 } from '../maskedSecrets'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { destinationDefinitionId: 'default-dest-def', destinationType: 'default-destination-type', eventName: 'default-event', diff --git a/test/integrations/destinations/active_campaign/processor/data.ts b/test/integrations/destinations/active_campaign/processor/data.ts index 485151ca3fa..06393dfe43f 100644 --- a/test/integrations/destinations/active_campaign/processor/data.ts +++ b/test/integrations/destinations/active_campaign/processor/data.ts @@ -9,7 +9,7 @@ import MockAdapter from 'axios-mock-adapter'; import { isMatch } from 'lodash'; import { defaultApiKey } from '../../../common/secrets'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { sourceId: 'default-source', workspaceId: 'default-workspace', namespace: 'default-namespace', diff --git a/test/integrations/destinations/branch/processor/data.ts b/test/integrations/destinations/branch/processor/data.ts index e5519b7c39a..ba8fb3f6d19 100644 --- a/test/integrations/destinations/branch/processor/data.ts +++ b/test/integrations/destinations/branch/processor/data.ts @@ -6,7 +6,7 @@ import { ProcessorTestData } from '../../../testTypes'; import { Metadata } from '../../../../../src/types'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { sourceId: 'default-source', workspaceId: 'default-workspace', namespace: 'default-namespace', diff --git a/test/integrations/destinations/branch/router/data.ts b/test/integrations/destinations/branch/router/data.ts index ddfebb4e1bb..3076adf1758 100644 --- a/test/integrations/destinations/branch/router/data.ts +++ b/test/integrations/destinations/branch/router/data.ts @@ -4,7 +4,7 @@ */ import { RouterTestData } from '../../../testTypes'; -import {} from '../../../../../src/types'; +import { Metadata } from '../../../../../src/types'; export const data: RouterTestData[] = [ { @@ -196,7 +196,7 @@ export const data: RouterTestData[] = [ destinationDefinitionId: 'default-dest-def', transformationId: 'default-transform', dontBatch: false, - }, + } as unknown as Metadata, destination: { ID: '1WTpIHpH7NTBgjeiUPW1kCUgZGI', Name: 'branch test', diff --git a/test/integrations/destinations/customerio_audience/common.ts b/test/integrations/destinations/customerio_audience/common.ts index a0c917efa8b..e54190d04ac 100644 --- a/test/integrations/destinations/customerio_audience/common.ts +++ b/test/integrations/destinations/customerio_audience/common.ts @@ -74,6 +74,12 @@ const RouterInstrumentationErrorStatTags = { feature: 'router', }; +const RouterConfigurationErrorStatTags = { + ...processorInstrumentationErrorStatTags, + feature: 'router', + errorType: 'configuration', +}; + const headers = { 'Content-Type': 'application/json', Authorization: authHeader1, @@ -91,6 +97,7 @@ export { inValidConnection, processorInstrumentationErrorStatTags, RouterInstrumentationErrorStatTags, + RouterConfigurationErrorStatTags, headers, params, insertOrUpdateEndpoint, diff --git a/test/integrations/destinations/customerio_audience/router/data.ts b/test/integrations/destinations/customerio_audience/router/data.ts index ed486f781b6..f9964a79ecd 100644 --- a/test/integrations/destinations/customerio_audience/router/data.ts +++ b/test/integrations/destinations/customerio_audience/router/data.ts @@ -10,6 +10,7 @@ import { connection, params, inValidConnection, + RouterConfigurationErrorStatTags, } from '../common'; const routerRequest1 = { @@ -105,6 +106,10 @@ const routerRequest1 = { { message: { type: 'identify', + action: 'insert', + identifiers: { + id: 'test-id-9', + }, anonymousId: 'anonId1', userId: 'userId1', integrations: { @@ -192,7 +197,7 @@ export const data = [ { id: 'customerio-segment-router-test-1', name: destType, - description: 'Basic Router Test to test record payloads', + description: 'Basic Router Test to test correct record payloads', scenario: 'Framework+Business', successCriteria: 'All events should be transformed successfully and status code should be 200', feature: 'router', @@ -282,7 +287,8 @@ export const data = [ metadata: [generateMetadata(8)], batched: false, statusCode: 400, - error: 'action dummy-action is not supported', + error: + "action: Invalid enum value. Expected 'insert' | 'update' | 'delete', received 'dummy-action'", statTags: RouterInstrumentationErrorStatTags, destination, }, @@ -290,7 +296,7 @@ export const data = [ metadata: [generateMetadata(9)], batched: false, statusCode: 400, - error: 'message type identify is not supported', + error: 'type: Invalid literal value, expected "record"', statTags: RouterInstrumentationErrorStatTags, destination, }, @@ -298,7 +304,7 @@ export const data = [ metadata: [generateMetadata(10)], batched: false, statusCode: 400, - error: 'identifiers cannot be empty', + error: 'identifiers: cannot be empty', statTags: RouterInstrumentationErrorStatTags, destination, }, @@ -306,7 +312,7 @@ export const data = [ metadata: [generateMetadata(11)], batched: false, statusCode: 400, - error: 'only one identifier is supported', + error: 'identifiers: only one identifier is supported', statTags: RouterInstrumentationErrorStatTags, destination, }, @@ -319,7 +325,7 @@ export const data = [ { id: 'customerio-segment-router-test-2', name: destType, - description: 'Basic Router Test to test record payloads', + description: 'Basic Router Test to test incorrect connection config', scenario: 'Framework', successCriteria: 'All events should throw error', feature: 'router', @@ -340,24 +346,26 @@ export const data = [ metadata: [generateMetadata(1)], batched: false, statusCode: 400, - error: 'identifier type should be a string or integer', - statTags: { ...RouterInstrumentationErrorStatTags, errorType: 'configuration' }, + error: + 'audienceId: String must contain at least 1 character(s); identifierMappings: Required', + statTags: RouterConfigurationErrorStatTags, destination, }, { metadata: [generateMetadata(2)], batched: false, statusCode: 400, - error: 'audienceId is required, aborting.', - statTags: RouterInstrumentationErrorStatTags, + error: + 'audienceId: String must contain at least 1 character(s); identifierMappings: Required', + statTags: RouterConfigurationErrorStatTags, destination, }, { metadata: [generateMetadata(3)], batched: false, statusCode: 400, - error: 'identifierMappings cannot be empty', - statTags: RouterInstrumentationErrorStatTags, + error: 'identifierMappings: Required', + statTags: RouterConfigurationErrorStatTags, destination, }, ], diff --git a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts index 7d872efae02..70419f7a0b0 100644 --- a/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts +++ b/test/integrations/destinations/facebook_pixel/processor/identifyTestData.ts @@ -1,5 +1,5 @@ import { VERSION } from '../../../../../src/v0/destinations/facebook_pixel/config'; -import { Destination } from '../../../../../src/types'; +import { Destination, RudderMessage } from '../../../../../src/types'; import { generateMetadata, transformResultBuilder, overrideDestination } from '../../../testUtils'; import { ProcessorTestData } from '../../../testTypes'; @@ -81,7 +81,7 @@ const commonMessage = { plan: 'standard plan', name: 'rudder test', }, - type: 'identify', + type: 'identify' as const, messageId: '84e26acc-56a5-4835-8233-591137fca468', originalTimestamp: '2023-10-14T15:46:51.693229+05:30', anonymousId: '00000000000000000000000000', diff --git a/test/integrations/destinations/ga4/processor/validationTestData.ts b/test/integrations/destinations/ga4/processor/validationTestData.ts index a7587cbac35..28c71c8e864 100644 --- a/test/integrations/destinations/ga4/processor/validationTestData.ts +++ b/test/integrations/destinations/ga4/processor/validationTestData.ts @@ -1,5 +1,5 @@ import { defaultMockFns } from '../mocks'; -import { Destination } from '../../../../../src/types'; +import { Destination, RudderMessage } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata, generateSimplifiedTrackPayload } from '../../../testUtils'; @@ -848,9 +848,8 @@ export const validationTestData: ProcessorTestData[] = [ destination, message: { type: 'track', - event: { - name: 'promotion_viewed', - }, + // intentional to test event name as number + event: 122 as unknown as string, properties: { products: commonProductInfo, }, diff --git a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts index 1a4bf08cce4..d96f716f21e 100644 --- a/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts +++ b/test/integrations/destinations/google_adwords_enhanced_conversions/router/data.ts @@ -545,11 +545,7 @@ const invalidRtTfCases = [ output: [ { error: 'Invalid event array', - metadata: [ - { - destType: undefined, - }, - ], + metadata: [{}], batched: false, statusCode: 400, }, @@ -578,11 +574,7 @@ const invalidRtTfCases = [ output: [ { error: 'Invalid event array', - metadata: [ - { - destType: undefined, - }, - ], + metadata: [{}], batched: false, statusCode: 400, }, diff --git a/test/integrations/destinations/intercom_v2/router/data.ts b/test/integrations/destinations/intercom_v2/router/data.ts index be320794c5f..3a871ca1588 100644 --- a/test/integrations/destinations/intercom_v2/router/data.ts +++ b/test/integrations/destinations/intercom_v2/router/data.ts @@ -1,5 +1,5 @@ import { secret1 } from '../maskedSecrets'; -import { RouterTransformationRequest } from '../../../../../src/types'; +import { MessageType, RouterTransformationRequest, RudderMessage } from '../../../../../src/types'; import { generateMetadata } from '../../../testUtils'; import { anonymousId, @@ -400,7 +400,7 @@ const routerRequest5: RouterTransformationRequest = { ...companyTraits, }, }, - type: 'dummyGroupType', + type: 'dummyGroupType' as MessageType, integrations: { All: true }, originalTimestamp, timestamp, diff --git a/test/integrations/destinations/iterable/processor/aliasTestData.ts b/test/integrations/destinations/iterable/processor/aliasTestData.ts index 48f92f5ac22..e99870adea7 100644 --- a/test/integrations/destinations/iterable/processor/aliasTestData.ts +++ b/test/integrations/destinations/iterable/processor/aliasTestData.ts @@ -2,7 +2,7 @@ import { ProcessorTestData } from '../../../testTypes'; import { Destination, Metadata } from '../../../../../src/types'; import { overrideDestination } from '../../../testUtils'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { sourceId: 'default-sourceId', workspaceId: 'default-workspaceId', namespace: 'default-namespace', diff --git a/test/integrations/destinations/iterable/processor/identifyTestData.ts b/test/integrations/destinations/iterable/processor/identifyTestData.ts index f61ab0b6749..078df56c5ee 100644 --- a/test/integrations/destinations/iterable/processor/identifyTestData.ts +++ b/test/integrations/destinations/iterable/processor/identifyTestData.ts @@ -1,7 +1,7 @@ -import { ProcessorTestData } from '../../../testTypes'; import { Metadata } from '../../../../../src/types'; +import { ProcessorTestData } from '../../../testTypes'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { sourceId: 'default-sourceId', workspaceId: 'default-workspaceId', namespace: 'default-namespace', diff --git a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts index 6fd35cf8fb8..6bf6465068c 100644 --- a/test/integrations/destinations/iterable/processor/pageScreenTestData.ts +++ b/test/integrations/destinations/iterable/processor/pageScreenTestData.ts @@ -1,7 +1,7 @@ import { ProcessorTestData } from '../../../testTypes'; import { Metadata } from '../../../../../src/types'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { sourceId: 'default-sourceId', workspaceId: 'default-workspaceId', namespace: 'default-namespace', diff --git a/test/integrations/destinations/iterable/processor/trackTestData.ts b/test/integrations/destinations/iterable/processor/trackTestData.ts index 91271097a8a..1945d2c7a9a 100644 --- a/test/integrations/destinations/iterable/processor/trackTestData.ts +++ b/test/integrations/destinations/iterable/processor/trackTestData.ts @@ -1,7 +1,7 @@ import { ProcessorTestData } from '../../../testTypes'; import { Metadata } from '../../../../../src/types'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { sourceId: 'default-sourceId', workspaceId: 'default-workspaceId', namespace: 'default-namespace', diff --git a/test/integrations/destinations/iterable/processor/validationTestData.ts b/test/integrations/destinations/iterable/processor/validationTestData.ts index 28cdc37212b..8251982b56f 100644 --- a/test/integrations/destinations/iterable/processor/validationTestData.ts +++ b/test/integrations/destinations/iterable/processor/validationTestData.ts @@ -1,7 +1,7 @@ import { ProcessorTestData } from '../../../testTypes'; -import { Metadata, Destination } from '../../../../../src/types'; +import { Metadata, Destination, RudderMessage } from '../../../../../src/types'; -const baseMetadata: Metadata = { +const baseMetadata: Partial = { sourceId: 'default-sourceId', workspaceId: 'default-workspaceId', namespace: 'default-namespace', diff --git a/test/integrations/destinations/iterable/router/data.ts b/test/integrations/destinations/iterable/router/data.ts index ff9809f5dc7..4d0385d99a8 100644 --- a/test/integrations/destinations/iterable/router/data.ts +++ b/test/integrations/destinations/iterable/router/data.ts @@ -1,5 +1,5 @@ import { RouterTestData } from '../../../testTypes'; -import {} from '../../../../../src/types'; +import { MessageType, RudderMessage } from '../../../../../src/types'; import { generateMetadata } from '../../../testUtils'; export const data: RouterTestData[] = [ @@ -1397,7 +1397,7 @@ export const data: RouterTestData[] = [ message: { statusCode: 200, version: '1', - type: 'REST', + type: 'REST' as MessageType, method: 'POST', endpoint: 'https://api.eu.iterable.com/api/catalogs/test-ruchira/items', headers: { diff --git a/test/integrations/destinations/klaviyo/processor/validationTestData.ts b/test/integrations/destinations/klaviyo/processor/validationTestData.ts index 2bc23257701..868ca760eb5 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestData.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestData.ts @@ -1,4 +1,4 @@ -import { Destination } from '../../../../../src/types'; +import { Destination, MessageType } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; import { secret1 } from '../maskedSecrets'; @@ -39,7 +39,7 @@ export const validationTestData: ProcessorTestData[] = [ destination, message: { userId: 'user123', - type: 'random', + type: 'random' as MessageType, groupId: 'XUepkK', traits: { subscribe: true, diff --git a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts index 3aa66d1df01..762861a3500 100644 --- a/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts +++ b/test/integrations/destinations/klaviyo/processor/validationTestDataV2.ts @@ -1,4 +1,4 @@ -import { Destination } from '../../../../../src/types'; +import { Destination, MessageType } from '../../../../../src/types'; import { ProcessorTestData } from '../../../testTypes'; import { generateMetadata } from '../../../testUtils'; import { secret1 } from '../maskedSecrets'; @@ -38,7 +38,7 @@ export const validationTestData: ProcessorTestData[] = [ destination, message: { userId: 'user123', - type: 'random', + type: 'random' as MessageType, groupId: 'XUepkK', traits: { subscribe: true, diff --git a/test/integrations/destinations/klaviyo/router/commonConfig.ts b/test/integrations/destinations/klaviyo/router/commonConfig.ts index 7389a1215c5..f2ccfbf11a8 100644 --- a/test/integrations/destinations/klaviyo/router/commonConfig.ts +++ b/test/integrations/destinations/klaviyo/router/commonConfig.ts @@ -1,5 +1,9 @@ import { generateMetadata } from '../../../testUtils'; -import { Destination, RouterTransformationRequest } from '../../../../../src/types'; +import { + Destination, + RouterTransformationRequest, + RouterTransformationRequestData, +} from '../../../../../src/types'; import { secret1 } from '../maskedSecrets'; const destination: Destination = { @@ -192,10 +196,10 @@ const getRequest = (apiVersion) => { ]; }; export const routerRequest: RouterTransformationRequest = { - input: getRequest('v1'), + input: getRequest('v1') as unknown as RouterTransformationRequestData[], destType: 'klaviyo', }; export const routerRequestV2: RouterTransformationRequest = { - input: getRequest('v2'), + input: getRequest('v2') as unknown as RouterTransformationRequestData[], destType: 'klaviyo', }; diff --git a/test/integrations/destinations/klaviyo/router/dataV2.ts b/test/integrations/destinations/klaviyo/router/dataV2.ts index 5b3c8ca0515..70371f2d421 100644 --- a/test/integrations/destinations/klaviyo/router/dataV2.ts +++ b/test/integrations/destinations/klaviyo/router/dataV2.ts @@ -1,4 +1,4 @@ -import { Destination } from '../../../../../src/types'; +import { Destination, RouterTransformationRequestData } from '../../../../../src/types'; import { RouterTestData } from '../../../testTypes'; import { routerRequestV2 } from './commonConfig'; import { generateMetadata, transformResultBuilder } from '../../../testUtils'; @@ -74,7 +74,7 @@ const alreadyTransformedEvent = { }, metadata: generateMetadata(10), destination, -}; +} as unknown as RouterTransformationRequestData; export const dataV2: RouterTestData[] = [ { diff --git a/test/integrations/destinations/mp/common.ts b/test/integrations/destinations/mp/common.ts index 75a197b9561..56baf27d0f4 100644 --- a/test/integrations/destinations/mp/common.ts +++ b/test/integrations/destinations/mp/common.ts @@ -15,7 +15,7 @@ const sampleDestination: Destination = { DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', - Config: undefined, + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', diff --git a/test/integrations/destinations/mp/router/data.ts b/test/integrations/destinations/mp/router/data.ts index 2b3824e1b1c..e6fa145eab5 100644 --- a/test/integrations/destinations/mp/router/data.ts +++ b/test/integrations/destinations/mp/router/data.ts @@ -496,6 +496,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -599,6 +600,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -734,6 +736,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -810,6 +813,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -846,6 +850,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1349,6 +1354,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1451,6 +1457,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1585,6 +1592,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1661,6 +1669,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', @@ -1697,6 +1706,7 @@ export const data = [ DisplayName: 'Mixpanel', ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', Name: 'MP', + Config: {}, }, Enabled: true, ID: '1WhcOCGgj9asZu850HvugU2C3Aq', diff --git a/test/integrations/destinations/tune/router/data.ts b/test/integrations/destinations/tune/router/data.ts index 66d19f481df..488655a41fc 100644 --- a/test/integrations/destinations/tune/router/data.ts +++ b/test/integrations/destinations/tune/router/data.ts @@ -135,7 +135,6 @@ export const data: RouterTestData[] = [ destination, metadata: generateMetadata(1), message: { - type: 123, event: 'Product added', anonymousId: 'sampath', channel: 'web', diff --git a/test/integrations/testTypes.ts b/test/integrations/testTypes.ts index 1515fd4b781..29d777219d7 100644 --- a/test/integrations/testTypes.ts +++ b/test/integrations/testTypes.ts @@ -4,11 +4,13 @@ import { BaseTestCase } from '@rudderstack/integrations-lib'; import { DeliveryV1Response, + Metadata, ProcessorTransformationRequest, ProcessorTransformationResponse, ProxyV1Request, RouterTransformationRequest, RouterTransformationResponse, + RudderMessage, } from '../../src/types'; export interface requestType { @@ -104,7 +106,7 @@ export type ProcessorTestData = { input: { request: { method: string; - body: ProcessorTransformationRequest[]; + body: ProcessorTransformationRequest, Partial>[]; }; }; output: { @@ -127,7 +129,7 @@ export type RouterTestData = { version: string; input: { request: { - body: RouterTransformationRequest; + body: RouterTransformationRequest, Partial>; method: string; }; }; diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000000..44502a8a371 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["node_modules", "dist"], + "include": ["src/**/*.ts", "test/**/*.ts"], + "compilerOptions": { + "outDir": "./dist-test" + } +} From 750a1087e39b5f26ca11a076e266af985a7fd170 Mon Sep 17 00:00:00 2001 From: Mahesh Kutty <39219085+maheshkutty@users.noreply.github.com> Date: Tue, 18 Mar 2025 17:32:34 +0530 Subject: [PATCH 156/160] chore: use github cli to create pull request (#4172) * chore: use github cli to create pull request * fix: misc --- .github/workflows/draft-new-release.yml | 15 ++++++++------- .github/workflows/publish-new-release.yml | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index ce38023d6ae..726b28cc96c 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -79,10 +79,11 @@ jobs: git push - name: Create Pull Request - uses: repo-sync/pull-request@v2.12.1 - with: - source_branch: ${{ steps.create-release.outputs.branch_name }} - destination_branch: 'main' - github_token: ${{ secrets.PAT }} - pr_title: 'chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main' - pr_body: ':crown: *An automated PR*' + run: | + gh pr create \ + --base main \ + --head "${{ steps.create-release.outputs.branch_name }}" \ + --title "chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main" \ + --body ":crown: *An automated PR*" + env: + GH_TOKEN: ${{ secrets.PAT }} diff --git a/.github/workflows/publish-new-release.yml b/.github/workflows/publish-new-release.yml index b6a7f404e3d..5953f94c93e 100644 --- a/.github/workflows/publish-new-release.yml +++ b/.github/workflows/publish-new-release.yml @@ -63,13 +63,14 @@ jobs: echo "DATE=$(date)" >> $GITHUB_ENV - name: Pull Changes Into develop Branch - uses: repo-sync/pull-request@v2.12.1 - with: - source_branch: 'main' - destination_branch: 'develop' - github_token: ${{ secrets.PAT }} - pr_title: 'chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}' - pr_body: ':crown: *An automated PR*' + run: | + gh pr create \ + --base develop \ + --head main \ + --title "chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}" \ + --body ":crown: *An automated PR*" + env: + GH_TOKEN: ${{ secrets.PAT }} - name: Delete Release Branch uses: koj-co/delete-merged-action@master From 25bfc187969fe86cf29929da082aeaecc10c51d3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 18 Mar 2025 13:10:03 +0000 Subject: [PATCH 157/160] chore(release): 1.94.0 --- CHANGELOG.md | 12 ++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b256264fc4..32fd6be4654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.94.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.93.0...v1.94.0) (2025-03-18) + + +### Features + +* onboarding new destination accoil analytics ([#4156](https://github.com/rudderlabs/rudder-transformer/issues/4156)) ([8aad46f](https://github.com/rudderlabs/rudder-transformer/commit/8aad46fd8bde0d839a33751ef16e9e68c168c125)) + + +### Bug Fixes + +* add 2655 error handling to fb error handler at proxy ([#4152](https://github.com/rudderlabs/rudder-transformer/issues/4152)) ([5d3b226](https://github.com/rudderlabs/rudder-transformer/commit/5d3b2263754b94193c302c2f88cac2a055a22b53)) + ## [1.93.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.92.1...v1.93.0) (2025-03-10) diff --git a/package-lock.json b/package-lock.json index 7c4282e9e2c..f56190f1670 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.93.0", + "version": "1.94.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.93.0", + "version": "1.94.0", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 90eb0fad410..95e666e032b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.93.0", + "version": "1.94.0", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": { From ae83eb661e3cd21d867f9707d45b0ccef8c843d9 Mon Sep 17 00:00:00 2001 From: Dilip Kola <33080863+koladilip@users.noreply.github.com> Date: Wed, 19 Mar 2025 06:04:21 +0530 Subject: [PATCH 158/160] fix: customer io audience id type (#4179) --- .../destinations/customerio_audience/type.ts | 2 +- .../customerio_audience/utils.test.ts | 26 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/v0/destinations/customerio_audience/type.ts b/src/v0/destinations/customerio_audience/type.ts index ea883b093b9..cfffa6608b1 100644 --- a/src/v0/destinations/customerio_audience/type.ts +++ b/src/v0/destinations/customerio_audience/type.ts @@ -56,7 +56,7 @@ export type CustomerIODestinationConfig = z.infer { describe('createEventChunk', () => { const testCases = [ { - name: 'should create valid event chunk', + name: 'should create valid event chunk when audienceId is a string', input: { message: { type: 'record', @@ -85,6 +85,30 @@ describe('utils', () => { metadata: { sourceId: '1' }, }, }, + { + name: 'should create valid event chunk when audienceId is a number', + input: { + message: { + type: 'record', + action: 'insert', + identifiers: { email: 'test@test.com' }, + }, + connection: { + config: { + destination: { + identifierMappings: [{ to: 'email', from: 'email' }], + audienceId: 123, + }, + }, + }, + metadata: { sourceId: '1' }, + }, + expected: { + payload: { ids: ['test@test.com'] }, + eventAction: 'insert', + metadata: { sourceId: '1' }, + }, + }, { name: 'should throw InstrumentationError for invalid message', input: { From 4afce030e325fa577da9f4f78af370c0c0a6a748 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Thu, 20 Mar 2025 14:32:02 +0530 Subject: [PATCH 159/160] chore: onboard am to proxy (#4110) * chore: onboard am to proxy * chore: update tests * fix: network handler class name * chore: add test * chore: refactor, address comments --------- Co-authored-by: Dilip Kola --- src/adapters/networkHandlerFactory.js | 7 +- src/v0/destinations/am/networkHandler.js | 60 ++++ .../destinations/am/dataDelivery/data.ts | 281 ++++++++++++++++-- test/integrations/destinations/am/network.ts | 10 +- 4 files changed, 317 insertions(+), 41 deletions(-) create mode 100644 src/v0/destinations/am/networkHandler.js diff --git a/src/adapters/networkHandlerFactory.js b/src/adapters/networkHandlerFactory.js index de80809a041..7a15e4e18fa 100644 --- a/src/adapters/networkHandlerFactory.js +++ b/src/adapters/networkHandlerFactory.js @@ -26,10 +26,9 @@ SUPPORTED_VERSIONS.forEach((version) => { // dest: handler // }, // generic: GenericNetworkHandler, - // } - handlers[version][dest] = require( - `../${version}/destinations/${dest}/networkHandler`, - ).networkHandler; + // }' + const networkHandler = require(`../${version}/destinations/${dest}/networkHandler`); + handlers[version][dest] = networkHandler.networkHandler || networkHandler.NetworkHandler; } catch { // Do nothing as exception indicates // network handler is not defined for that destination diff --git a/src/v0/destinations/am/networkHandler.js b/src/v0/destinations/am/networkHandler.js new file mode 100644 index 00000000000..0e9dc42b8c2 --- /dev/null +++ b/src/v0/destinations/am/networkHandler.js @@ -0,0 +1,60 @@ +const { ThrottledError, AbortedError, RetryableError } = require('@rudderstack/integrations-lib'); +const { processAxiosResponse } = require('../../../adapters/utils/networkUtils'); +const { prepareProxyRequest, proxyRequest } = require('../../../adapters/network'); +const { isHttpStatusSuccess, isHttpStatusRetryable } = require('../../util'); +const logger = require('../../../logger'); +const { DESTINATION } = require('./config'); + +class NetworkHandler { + constructor() { + this.prepareProxyRequest = prepareProxyRequest; + this.proxy = proxyRequest; + this.processAxiosResponse = processAxiosResponse; + } + + responseHandler(responseParams) { + const { destinationResponse } = responseParams; + const message = `[${DESTINATION} Response Handler] - Request Processed Successfully`; + const { status, response } = destinationResponse; + if (isHttpStatusSuccess(status)) { + const { error, code, throttled_users: throttledUsers } = response; + if (code === 429) { + // log the error when throttled_users in response > 0 and throw a RetryableError + if (Object.keys(throttledUsers).length > 0) { + logger.error('Too many requests for some devices and users.'); + throw new RetryableError( + `Request Failed during ${DESTINATION} response transformation: ${error} - due to Request Limit exceeded, (Retryable)`, + 500, + destinationResponse, + ); + } + // throw a ThrottledError in other 429 cases + throw new ThrottledError( + `Request Failed during ${DESTINATION} response transformation: ${error} - due to Request Limit exceeded, (Throttled)`, + destinationResponse, + ); + } + return { + destinationResponse: JSON.stringify(response), + message, + status, + }; + } + if (isHttpStatusRetryable(status)) { + throw new RetryableError( + `Request Failed during ${DESTINATION} response transformation: with status "${status}" due to "${JSON.stringify(response)}", (Retryable)`, + 500, + destinationResponse, + ); + } + throw new AbortedError( + `Request Failed during ${DESTINATION} response transformation: with status "${status}" due to "${JSON.stringify(response)}", (Aborted)`, + 400, + destinationResponse, + ); + } +} + +module.exports = { + NetworkHandler, +}; diff --git a/test/integrations/destinations/am/dataDelivery/data.ts b/test/integrations/destinations/am/dataDelivery/data.ts index 19baca02c38..339a98e4dd9 100644 --- a/test/integrations/destinations/am/dataDelivery/data.ts +++ b/test/integrations/destinations/am/dataDelivery/data.ts @@ -23,7 +23,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -65,26 +65,9 @@ export const data = [ body: { output: { status: 200, - message: - '[Generic Response Handler] Request for destination: am Processed Successfully', - destinationResponse: { - headers: { - 'access-control-allow-methods': 'GET, POST', - 'access-control-allow-origin': '*', - connection: 'keep-alive', - 'content-length': '93', - 'content-type': 'application/json', - date: 'Sat, 11 Dec 2021 15:08:22 GMT', - 'strict-transport-security': 'max-age=15768000', - }, - response: { - code: 200, - server_upload_time: 1639235302252, - payload_size_bytes: 863, - events_ingested: 1, - }, - status: 200, - }, + message: '[amplitude Response Handler] - Request Processed Successfully', + destinationResponse: + '{"code":200,"server_upload_time":1639235302252,"payload_size_bytes":863,"events_ingested":1}', }, }, }, @@ -109,7 +92,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -152,7 +135,7 @@ export const data = [ output: { status: 400, message: - '[Generic Response Handler] Request failed for destination am with status: 400', + 'Request Failed during amplitude response transformation: with status "400" due to "{"code":400,"server_upload_time":1639235302252,"payload_size_bytes":863,"events_ingested":0}", (Aborted)', destinationResponse: { headers: { 'access-control-allow-methods': 'GET, POST', @@ -205,7 +188,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -248,7 +231,7 @@ export const data = [ output: { status: 400, message: - '[Generic Response Handler] Request failed for destination am with status: 400', + 'Request Failed during amplitude response transformation: with status "400" due to ""[ENOTFOUND] :: DNS lookup failed"", (Aborted)', destinationResponse: { response: '[ENOTFOUND] :: DNS lookup failed', status: 400, @@ -274,7 +257,7 @@ export const data = [ { asymmetricMatch: (actual) => { const expected = { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -335,7 +318,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -378,7 +361,7 @@ export const data = [ output: { status: 400, message: - '[Generic Response Handler] Request failed for destination am with status: 400', + 'Request Failed during amplitude response transformation: with status "400" due to """", (Aborted)', destinationResponse: { response: '', status: 400, @@ -417,7 +400,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -460,7 +443,7 @@ export const data = [ output: { status: 500, message: - '[Generic Response Handler] Request failed for destination am with status: 500', + 'Request Failed during amplitude response transformation: with status "500" due to """", (Retryable)', destinationResponse: { response: '', status: 500, @@ -499,7 +482,7 @@ export const data = [ body: { FORM: {}, JSON: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -542,7 +525,7 @@ export const data = [ output: { status: 500, message: - '[Generic Response Handler] Request failed for destination am with status: 500', + 'Request Failed during amplitude response transformation: with status "500" due to """", (Retryable)', destinationResponse: { response: '', status: 500, @@ -562,4 +545,238 @@ export const data = [ }, }, }, + { + name: 'am', + description: 'Test 6: for 429 Rate Limit Handling', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/rate-limited', + method: 'POST', + userId: 'test_user_123', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'dummy-api-key', + events: [ + { + app_name: 'Rudder-Amplitude_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'testrluser@email.com', + user_properties: { + city: 'San Francisco', + country: 'US', + email: 'testrluser@email.com', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 500, // Expected status is 500 (RetryableError) + body: { + output: { + status: 500, + message: + 'Request Failed during amplitude response transformation: Too many requests for some devices and users - due to Request Limit exceeded, (Retryable)', + destinationResponse: { + headers: { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '120', + }, + response: { + code: 429, + error: 'Too many requests for some devices and users', + eps_threshold: 30, + throttled_devices: { + 'HIJ3L821-F01A-2GY5-2C81-7F03X7DS291D': 31, + }, + throttled_users: { + 'testrluser@email.com': 32, + }, + throttled_events: [3, 4, 7], + }, + status: 200, + }, + statTags: { + destType: 'AM', + errorCategory: 'network', + destinationId: 'Non-determininable', + workspaceId: 'Non-determininable', + errorType: 'retryable', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + }, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + mockAdapter + .onPost('https://api.amplitude.com/2/httpapi/rate-limited', { + asymmetricMatch: (actual) => { + // Simple check to match the request body + return actual.api_key === 'dummy-api-key'; + }, + }) + .replyOnce( + 200, + { + code: 429, + error: 'Too many requests for some devices and users', + eps_threshold: 30, + throttled_devices: { + 'HIJ3L821-F01A-2GY5-2C81-7F03X7DS291D': 31, + }, + throttled_users: { + 'testrluser@email.com': 32, + }, + throttled_events: [3, 4, 7], + }, + { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '120', + }, + ); + }, + }, + { + name: 'am', + description: 'Test 7: for standard 429 Rate Limit Handling (ThrottledError)', + feature: 'dataDelivery', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + type: 'REST', + endpoint: 'https://api.amplitude.com/2/httpapi/standard-rate-limited', + method: 'POST', + userId: 'test_user_456', + headers: { + 'Content-Type': 'application/json', + }, + body: { + FORM: {}, + JSON: { + api_key: 'random-api-key', + events: [ + { + app_name: 'Rudder-Amplitude_Example', + app_version: '1.0', + time: 1619006730330, + user_id: 'user@example.com', + user_properties: { + city: 'San Francisco', + country: 'US', + email: 'user@example.com', + }, + }, + ], + options: { + min_id_length: 1, + }, + }, + JSON_ARRAY: {}, + XML: {}, + }, + files: {}, + params: { + destination: 'am', + }, + }, + method: 'POST', + }, + }, + output: { + response: { + status: 429, + body: { + output: { + destinationResponse: { + headers: { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '60', + }, + response: { + code: 429, + eps_threshold: 20, + error: 'Rate limit exceeded', + throttled_events: [], + throttled_users: {}, + }, + status: 200, + }, + message: + 'Request Failed during amplitude response transformation: Rate limit exceeded - due to Request Limit exceeded, (Throttled)', + statTags: { + destType: 'AM', + destinationId: 'Non-determininable', + errorCategory: 'network', + errorType: 'throttled', + feature: 'dataDelivery', + implementation: 'native', + module: 'destination', + workspaceId: 'Non-determininable', + }, + status: 429, + }, + }, + }, + }, + mockFns: (mockAdapter: MockAdapter) => { + mockAdapter + .onPost('https://api.amplitude.com/2/httpapi/standard-rate-limited', { + asymmetricMatch: (actual) => { + // Simple check to match the request body + return actual.api_key === 'random-api-key'; + }, + }) + .replyOnce( + 200, + { + code: 429, + error: 'Rate limit exceeded', + eps_threshold: 20, + throttled_users: {}, + throttled_events: [], + }, + { + 'access-control-allow-methods': 'GET, POST', + 'access-control-allow-origin': '*', + 'content-type': 'application/json', + 'retry-after': '60', + }, + ); + }, + }, ]; diff --git a/test/integrations/destinations/am/network.ts b/test/integrations/destinations/am/network.ts index 5fe8e4ebfd7..49c702f5646 100644 --- a/test/integrations/destinations/am/network.ts +++ b/test/integrations/destinations/am/network.ts @@ -252,7 +252,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test1', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -303,7 +303,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test2', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -356,7 +356,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test4', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -389,7 +389,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test5', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', @@ -422,7 +422,7 @@ const deliveryNwData = [ httpReq: { url: 'https://api.amplitude.com/2/httpapi/test6', data: { - api_key: 'c9d8a13b8bcab46a547f7be5200c483d', + api_key: 'dummy-api-key', events: [ { app_name: 'Rudder-CleverTap_Example', From eeb7a5038a8377c3c9f087960ff431ef9e9a4cb6 Mon Sep 17 00:00:00 2001 From: Vinay Teki Date: Thu, 20 Mar 2025 14:57:50 +0530 Subject: [PATCH 160/160] chore: add au data center --- src/v0/destinations/braze/braze.util.test.js | 55 +++++++++++++++++++ src/v0/destinations/braze/util.js | 29 ++++++---- .../destinations/braze/processor/data.ts | 22 +++++++- 3 files changed, 94 insertions(+), 12 deletions(-) diff --git a/src/v0/destinations/braze/braze.util.test.js b/src/v0/destinations/braze/braze.util.test.js index c68f1e046be..8e0725a8543 100644 --- a/src/v0/destinations/braze/braze.util.test.js +++ b/src/v0/destinations/braze/braze.util.test.js @@ -7,6 +7,7 @@ const { setAliasObject, handleReservedProperties, combineSubscriptionGroups, + getEndpointFromConfig, } = require('./util'); const { processBatch } = require('./util'); const { @@ -343,6 +344,7 @@ describe('dedup utility tests', () => { Name: 'Test Destination', Config: { restApiKey: generateRandomString(), + dataCenter: 'EU-01', }, }; @@ -434,6 +436,7 @@ describe('dedup utility tests', () => { Name: 'Test Destination', Config: { restApiKey: 'test_rest_api_key', + dataCenter: 'EU-01', }, }; const chunks = [ @@ -1880,3 +1883,55 @@ describe('combineSubscriptionGroups', () => { expect(result).toEqual(expectedOutput); }); }); + +describe('getEndpointFromConfig', () => { + const testCases = [ + { + name: 'returns correct EU endpoint', + input: { Config: { dataCenter: 'EU-02' } }, + expected: 'https://rest.fra-02.braze.eu', + }, + { + name: 'returns correct US endpoint', + input: { Config: { dataCenter: 'US-03' } }, + expected: 'https://rest.iad-03.braze.com', + }, + { + name: 'returns correct AU endpoint', + input: { Config: { dataCenter: 'AU-01' } }, + expected: 'https://rest.au-01.braze.com', + }, + { + name: 'handles lowercase input correctly', + input: { Config: { dataCenter: 'eu-03' } }, + expected: 'https://rest.fra-03.braze.eu', + }, + { + name: 'handles whitespace in input', + input: { Config: { dataCenter: ' US-02 ' } }, + expected: 'https://rest.iad-02.braze.com', + }, + { + name: 'throws error for empty dataCenter', + input: { Config: {} }, + throws: true, + errorMessage: 'Invalid Data Center: valid values are EU, US, AU', + }, + { + name: 'throws error for invalid region', + input: { Config: { dataCenter: 'INVALID-01' } }, + throws: true, + errorMessage: 'Invalid Data Center: INVALID-01, valid values are EU, US, AU', + }, + ]; + + testCases.forEach(({ name, input, expected, throws, errorMessage }) => { + test(name, () => { + if (throws) { + expect(() => getEndpointFromConfig(input)).toThrow(errorMessage); + } else { + expect(getEndpointFromConfig(input)).toBe(expected); + } + }); + }); +}); diff --git a/src/v0/destinations/braze/util.js b/src/v0/destinations/braze/util.js index 87119b91171..ffc0905960c 100644 --- a/src/v0/destinations/braze/util.js +++ b/src/v0/destinations/braze/util.js @@ -30,19 +30,28 @@ const { removeUndefinedValues, getIntegrationsObj } = require('../../util'); const { InstrumentationError, isDefined } = require('@rudderstack/integrations-lib'); const getEndpointFromConfig = (destination) => { - // Init -- mostly for test cases - let endpoint = 'https://rest.fra-01.braze.eu'; + if (!destination.Config?.dataCenter || typeof destination.Config.dataCenter !== 'string') { + throw new InstrumentationError('Invalid Data Center: valid values are EU, US, AU'); + } // Ref: https://www.braze.com/docs/user_guide/administrative/access_braze/braze_instances - if (destination.Config.dataCenter) { - const dataCenterArr = destination.Config.dataCenter.trim().split('-'); - if (dataCenterArr[0].toLowerCase() === 'eu') { - endpoint = `https://rest.fra-${dataCenterArr[1]}.braze.eu`; - } else { - endpoint = `https://rest.iad-${dataCenterArr[1]}.braze.com`; - } + const [dataCenterRegion, dataCenterNumber] = destination.Config.dataCenter + .trim() + .toLowerCase() + .split('-'); + + switch (dataCenterRegion) { + case 'eu': + return `https://rest.fra-${dataCenterNumber}.braze.eu`; + case 'us': + return `https://rest.iad-${dataCenterNumber}.braze.com`; + case 'au': + return `https://rest.au-${dataCenterNumber}.braze.com`; + default: + throw new InstrumentationError( + `Invalid Data Center: ${destination.Config.dataCenter}, valid values are EU, US, AU`, + ); } - return endpoint; }; // Merges external_ids, emails, and phones for entries with the same subscription_group_id and subscription_state diff --git a/test/integrations/destinations/braze/processor/data.ts b/test/integrations/destinations/braze/processor/data.ts index 7fa6f3d0195..10a0546bf5b 100644 --- a/test/integrations/destinations/braze/processor/data.ts +++ b/test/integrations/destinations/braze/processor/data.ts @@ -15,7 +15,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, - dataCenter: 'us-01', + dataCenter: 'au-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -87,7 +87,7 @@ export const data = [ version: '1', type: 'REST', method: 'POST', - endpoint: 'https://rest.iad-01.braze.com/users/track', + endpoint: 'https://rest.au-01.braze.com/users/track', headers: { 'Content-Type': 'application/json', Accept: 'application/json', @@ -228,6 +228,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -345,6 +346,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -722,6 +724,7 @@ export const data = [ prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -865,6 +868,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1136,6 +1140,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1235,6 +1240,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1425,6 +1431,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1605,6 +1612,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -1786,6 +1794,7 @@ export const data = [ prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -2017,6 +2026,7 @@ export const data = [ prefixProperties: true, useNativeSDK: false, enableNestedArrayOperations: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3124,6 +3134,7 @@ export const data = [ prefixProperties: true, useNativeSDK: false, enableSubscriptionGroupInGroupCall: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3245,6 +3256,7 @@ export const data = [ prefixProperties: true, useNativeSDK: false, enableSubscriptionGroupInGroupCall: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3315,6 +3327,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3447,6 +3460,7 @@ export const data = [ prefixProperties: true, useNativeSDK: false, sendPurchaseEventWithExtraProperties: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3716,6 +3730,7 @@ export const data = [ prefixProperties: true, useNativeSDK: false, sendPurchaseEventWithExtraProperties: true, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -3887,6 +3902,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -4200,6 +4216,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze', @@ -4299,6 +4316,7 @@ export const data = [ restApiKey: secret1, prefixProperties: true, useNativeSDK: false, + dataCenter: 'eu-01', }, DestinationDefinition: { DisplayName: 'Braze',