diff --git a/test/__mocks__/axios.js b/test/__mocks__/axios.js index 1ed76a1ca7..d0961d6acf 100644 --- a/test/__mocks__/axios.js +++ b/test/__mocks__/axios.js @@ -14,13 +14,8 @@ const gainsightRequestHandler = require("./gainsight.mock"); const mailchimpGetRequestHandler = require("./mailchimp.mock"); const yahooDspPostRequestHandler = require("./yahoo_dsp.mock"); const { gainsightPXGetRequestHandler } = require("./gainsight_px.mock"); -const { hsGetRequestHandler, hsPostRequestHandler } = require("./hs.mock"); const profitwellGetRequestHandler = require("./profitwell.mock"); const cannyPostRequestHandler = require("./canny.mock"); -const { - wootricGetRequestHandler, - wootricPostRequestHandler -} = require("./wootric.mock"); const { userGetRequestHandler, userPutRequestHandler } = require("./user.mock"); const { mixpanelPostRequestHandler } = require("./mixpanel.mock"); const { mondayPostRequestHandler } = require("./monday.mock"); @@ -29,7 +24,6 @@ const { sendinblueGetRequestHandler } = require("./sendinblue.mock"); const { courierGetRequestHandler } = require("./courier.mock"); const urlDirectoryMap = { - "api.hubapi.com": "hs", "zendesk.com": "zendesk", "salesforce.com": "salesforce", "mktorest.com": "marketo", @@ -94,16 +88,22 @@ function get(url, options) { if (url.includes("https://a.klaviyo.com/api/v2/people/search")) { return klaviyoGetRequestHandler(getParamEncodedUrl(url, options)); } - if (url.includes("https://api.hubapi.com")) { - return hsGetRequestHandler(url, mockData); - } if (url.includes("https://api.profitwell.com")) { return profitwellGetRequestHandler(url, mockData); } - if (url.includes("https://api.wootric.com")) { - return new Promise((resolve, reject) => { - resolve(wootricGetRequestHandler(url)); - }); + if ( + url.includes( + "https://api.getdrip.com/v2/1809802/subscribers/identified_user@gmail.com" + ) + ) { + return Promise.resolve({ status: 200 }); + } + if ( + url.includes( + "https://api.getdrip.com/v2/1809802/subscribers/unidentified_user@gmail.com" + ) + ) { + return Promise.reject({ status: 404 }); } if (url.includes("https://commander.user.com")) { return new Promise((resolve, reject) => { @@ -164,14 +164,6 @@ function post(url, payload) { resolve(cannyPostRequestHandler(url)); }); } - if (url.includes("https://api.hubapi.com")) { - return hsPostRequestHandler(payload, mockData); - } - if (url.includes("https://api.wootric.com")) { - return new Promise((resolve, reject) => { - resolve(wootricPostRequestHandler(url, payload)); - }); - } if ( url.includes("https://api.mixpanel.com/engage/") || url.includes("https://api-eu.mixpanel.com/engage/") diff --git a/test/__mocks__/data/hs/response.json b/test/__mocks__/data/hs/response.json deleted file mode 100644 index e552275466..0000000000 --- a/test/__mocks__/data/hs/response.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "https://api.hubapi.com/properties/v1/contacts/properties?hapikey=dummy-apikey": [ - { "name": "company_size", "type": "string" }, - { "name": "date_of_birth", "type": "string" }, - { "name": "days_to_close", "type": "number" }, - { - "name": "date_submitted", - "type": "date" - }, - { - "name": "days_create", - "type": "date" - }, - { - "name": "days_closed", - "type": "date" - }, - { "name": "degree", "type": "string" }, - { "name": "field_of_study", "type": "string" }, - { "name": "first_conversion_date", "type": "datetime" }, - { "name": "first_conversion_event_name", "type": "string" }, - { "name": "first_deal_created_date", "type": "datetime" }, - { "name": "gender", "type": "string" }, - { "name": "graduation_date", "type": "string" }, - { "name": "hs_additional_emails", "type": "enumeration" }, - { "name": "hs_all_contact_vids", "type": "enumeration" }, - { - "name": "hs_analytics_first_touch_converting_campaign", - "type": "string" - }, - { "name": "hs_analytics_last_touch_converting_campaign", "type": "string" }, - { "name": "hs_avatar_filemanager_key", "type": "string" }, - { "name": "hs_calculated_form_submissions", "type": "enumeration" }, - { "name": "hs_calculated_merged_vids", "type": "enumeration" }, - { "name": "hs_calculated_mobile_number", "type": "string" }, - { "name": "hs_calculated_phone_number", "type": "string" }, - { "name": "hs_calculated_phone_number_area_code", "type": "string" }, - { "name": "hs_calculated_phone_number_country_code", "type": "string" }, - { "name": "hs_calculated_phone_number_region_code", "type": "string" }, - { "name": "hs_content_membership_email_confirmed", "type": "bool" }, - { "name": "hs_content_membership_notes", "type": "string" }, - { "name": "hs_content_membership_registered_at", "type": "datetime" }, - { - "name": "hs_content_membership_registration_domain_sent_to", - "type": "string" - }, - { - "name": "hs_content_membership_registration_email_sent_at", - "type": "datetime" - }, - { "name": "hs_content_membership_status", "type": "enumeration" }, - { "name": "hs_conversations_visitor_email", "type": "string" }, - { "name": "hs_created_by_conversations", "type": "bool" }, - { "name": "hs_created_by_user_id", "type": "string" }, - { "name": "hs_createdate", "type": "datetime" }, - { "name": "hs_document_last_revisited", "type": "datetime" }, - { "name": "hs_email_domain", "type": "string" }, - { "name": "hs_email_quarantined", "type": "bool" }, - { "name": "hs_email_quarantined_reason", "type": "enumeration" }, - { "name": "hs_email_recipient_fatigue_recovery_time", "type": "datetime" }, - { "name": "hs_email_sends_since_last_engagement", "type": "number" }, - { "name": "hs_emailconfirmationstatus", "type": "enumeration" }, - { "name": "hs_facebook_ad_clicked", "type": "bool" }, - { "name": "hs_feedback_last_nps_follow_up", "type": "string" }, - { "name": "hs_feedback_last_nps_rating", "type": "enumeration" }, - { "name": "hs_feedback_last_survey_date", "type": "datetime" }, - { "name": "hs_feedback_show_nps_web_survey", "type": "bool" }, - { "name": "hs_google_click_id", "type": "string" }, - { "name": "hs_ip_timezone", "type": "string" }, - { "name": "hs_is_contact", "type": "bool" }, - { "name": "hs_last_sales_activity_date", "type": "datetime" }, - { "name": "hs_lastmodifieddate", "type": "datetime" }, - { "name": "hs_lead_status", "type": "enumeration" }, - { "name": "hs_legal_basis", "type": "enumeration" }, - { "name": "hs_merged_object_ids", "type": "enumeration" }, - { "name": "hs_object_id", "type": "number" }, - { "name": "hs_predictivecontactscore_v2", "type": "number" }, - { "name": "hs_predictivescoringtier", "type": "enumeration" }, - { "name": "hs_sales_email_last_clicked", "type": "datetime" }, - { "name": "hs_sales_email_last_opened", "type": "datetime" }, - { - "name": "hs_searchable_calculated_international_mobile_number", - "type": "phone_number" - }, - { - "name": "hs_searchable_calculated_international_phone_number", - "type": "phone_number" - }, - { - "name": "hs_searchable_calculated_mobile_number", - "type": "phone_number" - }, - { "name": "hs_searchable_calculated_phone_number", "type": "phone_number" }, - { "name": "hs_sequences_is_enrolled", "type": "bool" }, - { "name": "hs_updated_by_user_id", "type": "string" }, - { "name": "hubspot_owner_assigneddate", "type": "datetime" }, - { "name": "ip_city", "type": "string" }, - { "name": "ip_country", "type": "string" }, - { "name": "ip_country_code", "type": "string" }, - { "name": "ip_latlon", "type": "string" }, - { "name": "ip_state", "type": "string" }, - { "name": "ip_state_code", "type": "string" }, - { "name": "ip_zipcode", "type": "string" }, - { "name": "job_function", "type": "string" }, - { "name": "lastmodifieddate", "type": "datetime" }, - { "name": "marital_status", "type": "string" }, - { "name": "military_status", "type": "string" }, - { "name": "num_associated_deals", "type": "number" }, - { "name": "num_conversion_events", "type": "number" }, - { "name": "num_unique_conversion_events", "type": "number" }, - { "name": "recent_conversion_date", "type": "datetime" }, - { "name": "recent_conversion_event_name", "type": "string" }, - { "name": "recent_deal_amount", "type": "number" }, - { "name": "recent_deal_close_date", "type": "datetime" }, - { "name": "relationship_status", "type": "string" }, - { "name": "school", "type": "string" }, - { "name": "seniority", "type": "string" }, - { "name": "start_date", "type": "string" }, - { "name": "test_date", "type": "date" }, - { "name": "test_key", "type": "string" }, - { "name": "test_prop", "type": "string" }, - { "name": "test_property", "type": "string" }, - { "name": "total_revenue", "type": "number" }, - { "name": "work_email", "type": "string" }, - { "name": "firstname", "type": "string" }, - { "name": "hs_analytics_first_url", "type": "string" }, - { "name": "hs_email_delivered", "type": "number" }, - { "name": "hs_email_optout_7283808", "type": "enumeration" }, - { "name": "twitterhandle", "type": "string" }, - { "name": "currentlyinworkflow", "type": "enumeration" }, - { "name": "hs_analytics_last_url", "type": "string" }, - { "name": "hs_email_open", "type": "number" }, - { "name": "fax", "type": "string" }, - { "name": "hs_analytics_first_timestamp", "type": "datetime" }, - { "name": "hs_email_last_email_name", "type": "string" }, - { "name": "hs_email_last_send_date", "type": "datetime" }, - { "name": "address", "type": "string" }, - { "name": "engagements_last_meeting_booked", "type": "datetime" }, - { "name": "engagements_last_meeting_booked_campaign", "type": "string" }, - { "name": "engagements_last_meeting_booked_medium", "type": "string" }, - { "name": "engagements_last_meeting_booked_source", "type": "string" }, - { "name": "hs_analytics_first_visit_timestamp", "type": "datetime" }, - { "name": "hs_email_last_open_date", "type": "datetime" }, - { "name": "hs_sales_email_last_replied", "type": "datetime" }, - { "name": "hubspot_owner_id", "type": "enumeration" }, - { "name": "notes_last_contacted", "type": "datetime" }, - { "name": "notes_last_updated", "type": "datetime" }, - { "name": "notes_next_activity_date", "type": "datetime" }, - { "name": "num_contacted_notes", "type": "number" }, - { "name": "num_notes", "type": "number" }, - { "name": "surveymonkeyeventlastupdated", "type": "number" }, - { "name": "webinareventlastupdated", "type": "number" }, - { "name": "city", "type": "string" }, - { "name": "hs_analytics_last_timestamp", "type": "datetime" }, - { "name": "hs_email_last_click_date", "type": "datetime" }, - { "name": "hubspot_team_id", "type": "enumeration" }, - { "name": "hs_all_owner_ids", "type": "enumeration" }, - { "name": "hs_analytics_last_visit_timestamp", "type": "datetime" }, - { "name": "hs_email_first_send_date", "type": "datetime" }, - { "name": "state", "type": "string" }, - { "name": "hs_all_team_ids", "type": "enumeration" }, - { "name": "hs_analytics_source", "type": "enumeration" }, - { "name": "hs_email_first_open_date", "type": "datetime" }, - { "name": "zip", "type": "string" }, - { "name": "country", "type": "string" }, - { "name": "hs_all_accessible_team_ids", "type": "enumeration" }, - { "name": "hs_analytics_source_data_1", "type": "string" }, - { "name": "hs_email_first_click_date", "type": "datetime" }, - { "name": "hs_analytics_source_data_2", "type": "string" }, - { "name": "hs_email_is_ineligible", "type": "bool" }, - { "name": "hs_language", "type": "enumeration" }, - { "name": "hs_analytics_first_referrer", "type": "string" }, - { "name": "jobtitle", "type": "string" }, - { "name": "hs_analytics_last_referrer", "type": "string" }, - { "name": "message", "type": "string" }, - { "name": "closedate", "type": "datetime" }, - { "name": "hs_analytics_average_page_views", "type": "number" }, - { "name": "hs_analytics_revenue", "type": "number" }, - { "name": "hs_lifecyclestage_lead_date", "type": "datetime" }, - { - "name": "hs_lifecyclestage_marketingqualifiedlead_date", - "type": "datetime" - }, - { "name": "hs_lifecyclestage_opportunity_date", "type": "datetime" }, - { "name": "lifecyclestage", "type": "enumeration" }, - { "name": "hs_lifecyclestage_salesqualifiedlead_date", "type": "datetime" }, - { "name": "createdate", "type": "datetime" }, - { "name": "hs_lifecyclestage_evangelist_date", "type": "datetime" }, - { "name": "hs_lifecyclestage_customer_date", "type": "datetime" }, - { "name": "hubspotscore", "type": "number" }, - { "name": "company", "type": "string" }, - { "name": "hs_lifecyclestage_subscriber_date", "type": "datetime" }, - { "name": "hs_lifecyclestage_other_date", "type": "datetime" }, - { "name": "website", "type": "string" }, - { "name": "numemployees", "type": "enumeration" }, - { "name": "annualrevenue", "type": "string" }, - { "name": "industry", "type": "string" }, - { "name": "associatedcompanyid", "type": "number" }, - { "name": "associatedcompanylastupdated", "type": "number" }, - { "name": "hs_predictivecontactscorebucket", "type": "enumeration" }, - { "name": "hs_predictivecontactscore", "type": "number" } - ], - "https://api.hubapi.com/properties/v1/contacts/properties": [ - { "name": "company_size", "type": "string" }, - { "name": "date_of_birth", "type": "string" }, - { "name": "days_to_close", "type": "number" }, - { - "name": "date_submitted", - "type": "date" - }, - { - "name": "date_created", - "type": "date" - }, - { - "name": "date_closed", - "type": "date" - }, - { "name": "degree", "type": "string" }, - { "name": "field_of_study", "type": "string" }, - { "name": "first_conversion_date", "type": "datetime" }, - { "name": "first_conversion_event_name", "type": "string" }, - { "name": "first_deal_created_date", "type": "datetime" }, - { "name": "gender", "type": "string" }, - { "name": "graduation_date", "type": "string" }, - { "name": "hs_additional_emails", "type": "enumeration" }, - { "name": "hs_all_contact_vids", "type": "enumeration" }, - { - "name": "hs_analytics_first_touch_converting_campaign", - "type": "string" - }, - { "name": "hs_analytics_last_touch_converting_campaign", "type": "string" }, - { "name": "hs_avatar_filemanager_key", "type": "string" }, - { "name": "hs_calculated_form_submissions", "type": "enumeration" }, - { "name": "hs_calculated_merged_vids", "type": "enumeration" }, - { "name": "hs_calculated_mobile_number", "type": "string" }, - { "name": "hs_calculated_phone_number", "type": "string" }, - { "name": "hs_calculated_phone_number_area_code", "type": "string" }, - { "name": "hs_calculated_phone_number_country_code", "type": "string" }, - { "name": "hs_calculated_phone_number_region_code", "type": "string" }, - { "name": "hs_content_membership_email_confirmed", "type": "bool" }, - { "name": "hs_content_membership_notes", "type": "string" }, - { "name": "hs_content_membership_registered_at", "type": "datetime" }, - { - "name": "hs_content_membership_registration_domain_sent_to", - "type": "string" - }, - { - "name": "hs_content_membership_registration_email_sent_at", - "type": "datetime" - }, - { "name": "hs_content_membership_status", "type": "enumeration" }, - { "name": "hs_conversations_visitor_email", "type": "string" }, - { "name": "hs_created_by_conversations", "type": "bool" }, - { "name": "hs_created_by_user_id", "type": "string" }, - { "name": "hs_createdate", "type": "datetime" }, - { "name": "hs_document_last_revisited", "type": "datetime" }, - { "name": "hs_email_domain", "type": "string" }, - { "name": "hs_email_quarantined", "type": "bool" }, - { "name": "hs_email_quarantined_reason", "type": "enumeration" }, - { "name": "hs_email_recipient_fatigue_recovery_time", "type": "datetime" }, - { "name": "hs_email_sends_since_last_engagement", "type": "number" }, - { "name": "hs_emailconfirmationstatus", "type": "enumeration" }, - { "name": "hs_facebook_ad_clicked", "type": "bool" }, - { "name": "hs_feedback_last_nps_follow_up", "type": "string" }, - { "name": "hs_feedback_last_nps_rating", "type": "enumeration" }, - { "name": "hs_feedback_last_survey_date", "type": "datetime" }, - { "name": "hs_feedback_show_nps_web_survey", "type": "bool" }, - { "name": "hs_google_click_id", "type": "string" }, - { "name": "hs_ip_timezone", "type": "string" }, - { "name": "hs_is_contact", "type": "bool" }, - { "name": "hs_last_sales_activity_date", "type": "datetime" }, - { "name": "hs_lastmodifieddate", "type": "datetime" }, - { "name": "hs_lead_status", "type": "enumeration" }, - { "name": "hs_legal_basis", "type": "enumeration" }, - { "name": "hs_merged_object_ids", "type": "enumeration" }, - { "name": "hs_object_id", "type": "number" }, - { "name": "hs_predictivecontactscore_v2", "type": "number" }, - { "name": "hs_predictivescoringtier", "type": "enumeration" }, - { "name": "hs_sales_email_last_clicked", "type": "datetime" }, - { "name": "hs_sales_email_last_opened", "type": "datetime" }, - { - "name": "hs_searchable_calculated_international_mobile_number", - "type": "phone_number" - }, - { - "name": "hs_searchable_calculated_international_phone_number", - "type": "phone_number" - }, - { - "name": "hs_searchable_calculated_mobile_number", - "type": "phone_number" - }, - { "name": "hs_searchable_calculated_phone_number", "type": "phone_number" }, - { "name": "hs_sequences_is_enrolled", "type": "bool" }, - { "name": "hs_updated_by_user_id", "type": "string" }, - { "name": "hubspot_owner_assigneddate", "type": "datetime" }, - { "name": "ip_city", "type": "string" }, - { "name": "ip_country", "type": "string" }, - { "name": "ip_country_code", "type": "string" }, - { "name": "ip_latlon", "type": "string" }, - { "name": "ip_state", "type": "string" }, - { "name": "ip_state_code", "type": "string" }, - { "name": "ip_zipcode", "type": "string" }, - { "name": "job_function", "type": "string" }, - { "name": "lastmodifieddate", "type": "datetime" }, - { "name": "marital_status", "type": "string" }, - { "name": "military_status", "type": "string" }, - { "name": "num_associated_deals", "type": "number" }, - { "name": "num_conversion_events", "type": "number" }, - { "name": "num_unique_conversion_events", "type": "number" }, - { "name": "recent_conversion_date", "type": "datetime" }, - { "name": "recent_conversion_event_name", "type": "string" }, - { "name": "recent_deal_amount", "type": "number" }, - { "name": "recent_deal_close_date", "type": "datetime" }, - { "name": "relationship_status", "type": "string" }, - { "name": "school", "type": "string" }, - { "name": "seniority", "type": "string" }, - { "name": "start_date", "type": "string" }, - { "name": "test_date", "type": "date" }, - { "name": "test_key", "type": "string" }, - { "name": "test_prop", "type": "string" }, - { "name": "test_property", "type": "string" }, - { "name": "total_revenue", "type": "number" }, - { "name": "work_email", "type": "string" }, - { "name": "firstname", "type": "string" }, - { "name": "hs_analytics_first_url", "type": "string" }, - { "name": "hs_email_delivered", "type": "number" }, - { "name": "hs_email_optout_7283808", "type": "enumeration" }, - { "name": "twitterhandle", "type": "string" }, - { "name": "currentlyinworkflow", "type": "enumeration" }, - { "name": "hs_analytics_last_url", "type": "string" }, - { "name": "hs_email_open", "type": "number" }, - { "name": "fax", "type": "string" }, - { "name": "hs_analytics_first_timestamp", "type": "datetime" }, - { "name": "hs_email_last_email_name", "type": "string" }, - { "name": "hs_email_last_send_date", "type": "datetime" }, - { "name": "address", "type": "string" }, - { "name": "engagements_last_meeting_booked", "type": "datetime" }, - { "name": "engagements_last_meeting_booked_campaign", "type": "string" }, - { "name": "engagements_last_meeting_booked_medium", "type": "string" }, - { "name": "engagements_last_meeting_booked_source", "type": "string" }, - { "name": "hs_analytics_first_visit_timestamp", "type": "datetime" }, - { "name": "hs_email_last_open_date", "type": "datetime" }, - { "name": "hs_sales_email_last_replied", "type": "datetime" }, - { "name": "hubspot_owner_id", "type": "enumeration" }, - { "name": "notes_last_contacted", "type": "datetime" }, - { "name": "notes_last_updated", "type": "datetime" }, - { "name": "notes_next_activity_date", "type": "datetime" }, - { "name": "num_contacted_notes", "type": "number" }, - { "name": "num_notes", "type": "number" }, - { "name": "surveymonkeyeventlastupdated", "type": "number" }, - { "name": "webinareventlastupdated", "type": "number" }, - { "name": "city", "type": "string" }, - { "name": "hs_analytics_last_timestamp", "type": "datetime" }, - { "name": "hs_email_last_click_date", "type": "datetime" }, - { "name": "hubspot_team_id", "type": "enumeration" }, - { "name": "hs_all_owner_ids", "type": "enumeration" }, - { "name": "hs_analytics_last_visit_timestamp", "type": "datetime" }, - { "name": "hs_email_first_send_date", "type": "datetime" }, - { "name": "state", "type": "string" }, - { "name": "hs_all_team_ids", "type": "enumeration" }, - { "name": "hs_analytics_source", "type": "enumeration" }, - { "name": "hs_email_first_open_date", "type": "datetime" }, - { "name": "zip", "type": "string" }, - { "name": "country", "type": "string" }, - { "name": "hs_all_accessible_team_ids", "type": "enumeration" }, - { "name": "hs_analytics_source_data_1", "type": "string" }, - { "name": "hs_email_first_click_date", "type": "datetime" }, - { "name": "hs_analytics_source_data_2", "type": "string" }, - { "name": "hs_email_is_ineligible", "type": "bool" }, - { "name": "hs_language", "type": "enumeration" }, - { "name": "hs_analytics_first_referrer", "type": "string" }, - { "name": "jobtitle", "type": "string" }, - { "name": "hs_analytics_last_referrer", "type": "string" }, - { "name": "message", "type": "string" }, - { "name": "closedate", "type": "datetime" }, - { "name": "hs_analytics_average_page_views", "type": "number" }, - { "name": "hs_analytics_revenue", "type": "number" }, - { "name": "hs_lifecyclestage_lead_date", "type": "datetime" }, - { - "name": "hs_lifecyclestage_marketingqualifiedlead_date", - "type": "datetime" - }, - { "name": "hs_lifecyclestage_opportunity_date", "type": "datetime" }, - { "name": "lifecyclestage", "type": "enumeration" }, - { "name": "hs_lifecyclestage_salesqualifiedlead_date", "type": "datetime" }, - { "name": "createdate", "type": "datetime" }, - { "name": "hs_lifecyclestage_evangelist_date", "type": "datetime" }, - { "name": "hs_lifecyclestage_customer_date", "type": "datetime" }, - { "name": "hubspotscore", "type": "number" }, - { "name": "company", "type": "string" }, - { "name": "hs_lifecyclestage_subscriber_date", "type": "datetime" }, - { "name": "hs_lifecyclestage_other_date", "type": "datetime" }, - { "name": "website", "type": "string" }, - { "name": "numemployees", "type": "enumeration" }, - { "name": "annualrevenue", "type": "string" }, - { "name": "industry", "type": "string" }, - { "name": "associatedcompanyid", "type": "number" }, - { "name": "associatedcompanylastupdated", "type": "number" }, - { "name": "hs_predictivecontactscorebucket", "type": "enumeration" }, - { "name": "hs_predictivecontactscore", "type": "number" } - ], - "https://api.hubapi.com/crm/v3/objects/contacts/search": { - "total": 1, - "results": [ - { - "id": "103604", - "properties": { - "createdate": "2022-07-15T15:25:08.975Z", - "email": "testhubspot@email.com", - "hs_object_id": "103604", - "lastmodifieddate": "2022-07-15T15:26:49.590Z" - }, - "createdAt": "2022-07-15T15:25:08.975Z", - "updatedAt": "2022-07-15T15:26:49.590Z", - "archived": false - } - ] - }, - "https://api.hubapi.com/crm/v3/objects/lead/search": { - "total": 1, - "results": [ - { - "id": "103605", - "properties": { - "createdate": "2022-08-15T15:25:08.975Z", - "email": "testhubspot2@email.com", - "hs_object_id": "103605", - "lastmodifieddate": "2022-08-15T15:26:49.590Z" - }, - "createdAt": "2022-08-15T15:25:08.975Z", - "updatedAt": "2022-08-15T15:26:49.590Z", - "archived": false - } - ] - }, - "https://api.hubapi.com/crm/v3/objects/lead/search?hapikey=dummy-apikey": { - "total": 1, - "results": [ - { - "id": "103605", - "properties": { - "createdate": "2022-08-15T15:25:08.975Z", - "email": "testhubspot2@email.com", - "hs_object_id": "103605", - "lastmodifieddate": "2022-08-15T15:26:49.590Z" - }, - "createdAt": "2022-08-15T15:25:08.975Z", - "updatedAt": "2022-08-15T15:26:49.590Z", - "archived": false - } - ] - } -} diff --git a/test/__mocks__/data/wootric/response.json b/test/__mocks__/data/wootric/response.json deleted file mode 100644 index 48cdd44a83..0000000000 --- a/test/__mocks__/data/wootric/response.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "https://api.wootric.com/v1/end_users/dummyId1?lookup_by_external_id=true": { - "id": 486438462, - "created_at": "2022-08-10 11:39:50 -0700", - "updated_at": "2022-08-10 11:39:50 -0700", - "email": "dummyuser1@gmail.com", - "last_surveyed": "2022-01-20 05:39:21 -0800", - "external_created_at": 1611149961, - "last_seen_at": null, - "properties": { - "city": "Mumbai", - "name": "Dummy User 1", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack" - }, - "phone_number": "+19123456789", - "external_id": "dummyId1", - "last_response": null, - "settings": { - "email_nps": true, - "mobile_nps": true, - "web_nps": true, - "force_mobile_survey": null, - "force_web_survey": null, - "surveys_disabled_by_end_user": null - } - }, - "https://api.wootric.com/v1/end_users/exclueFunTestId?lookup_by_external_id=true": { - "id": 486336190, - "created_at": "2022-08-10 07:30:50 -0700", - "updated_at": "2022-08-10 10:12:46 -0700", - "email": "excludeUser@gmail.com", - "last_surveyed": "2022-01-20 05:39:21 -0800", - "external_created_at": 1579755367, - "last_seen_at": null, - "properties": { - "city": "Mumbai", - "name": "exclude test user", - "email": "excludeUser@gmail.com", - "title": "AD", - "gender": "Male", - "company": "Rockstar" - }, - "phone_number": "+18324671283", - "external_id": "exclueFunTestId", - "last_response": null, - "settings": { - "email_nps": true, - "mobile_nps": true, - "web_nps": true, - "force_mobile_survey": null, - "force_web_survey": null, - "surveys_disabled_by_end_user": null - } - }, - "https://api.wootric.com/v1/end_users/my-external-id-1234?lookup_by_external_id=true": { - "type": "error_list", - "errors": [ - { - "status": "record_not_found", - "message": "The record could not be found", - "field": null - } - ] - }, - "https://api.wootric.com/v1/end_users/490635419": { - "id": 490635419, - "created_at": "2022-08-20 00:55:26 -0700", - "updated_at": "2022-08-22 11:17:05 -0700", - "email": "firstuser@gmail.com", - "last_surveyed": "2022-08-01 00:11:44 -0700", - "external_created_at": 1661002761, - "last_seen_at": null, - "properties": { - "Department": "Marketing", - "product_plan": "Web", - "revenue amount": "5000" - }, - "phone_number": "+8859133456781", - "external_id": "firstUserId123", - "last_response": { - "id": 101013218, - "score": 9, - "text": "Good !!!", - "survey": { - "channel": "web" - } - }, - "settings": { - "email_nps": true, - "mobile_nps": true, - "web_nps": true, - "force_mobile_survey": null, - "force_web_survey": null, - "surveys_disabled_by_end_user": null - } - }, - "https://api.wootric.com/oauth/token?account_token=NPS-dummyToken": { - "access_token": "2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c", - "token_type": "Bearer", - "expires_in": 7200, - "refresh_token": "f4033a61742e84405a5ef8b2e09b82395dc041f0259fd5fb715fc196a1b9cd52", - "scope": "delete_account admin respond export read survey invalidate_response", - "created_at": 1660292389 - } -} diff --git a/test/__mocks__/hs.mock.js b/test/__mocks__/hs.mock.js deleted file mode 100644 index ae88ed776b..0000000000 --- a/test/__mocks__/hs.mock.js +++ /dev/null @@ -1,123 +0,0 @@ -const hsGetRequestHandler = (url, mockData) => { - if (url.includes("invalid-api-key")) { - return Promise.reject({ - response: { - data: { - 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 - } - }); - } - if (url.includes("rate-limit-id")) { - return Promise.reject({ - response: { - data: { - status: "error", - message: "Request Rate Limit reached", - correlationId: "4d39ff11-e121-4514-bcd8-132a9dd1ff50", - category: "RATE-LIMIT_REACHED", - links: { - "api key": "https://app.hubspot.com/l/api-key/" - } - }, - status: 429 - } - }); - } - if (mockData) { - //resolve with status 200 - return Promise.resolve({ data: mockData, status: 200 }); - } else { - return Promise.reject({ - response: { - data: { - status: "error", - message: "404 not found", - correlationId: "4d39ff11-e121-4514-bcd8-132a9dd1ff50", - category: "DATA_NOT_DOUND", - links: { - "api key": "https://app.hubspot.com/l/api-key/" - } - }, - status: 404 - } - }); - } -}; - -const hsPostRequestHandler = (payload, mockData) => { - if (payload.filterGroups[0].filters[0].value === "noname@email.com") { - // no contact found for noname@gmail.com (email) - return Promise.resolve({ - data: { - total: 0, - results: [] - }, - status: 200 - }); - } else if (payload.filterGroups[0].filters[0].value === "Jhon") { - // multiple contact found for Jhon (firstname) - return Promise.resolve({ - data: { - total: 2, - results: [ - { - id: "103601", - properties: { - createdate: "2022-07-14T15:25:08.975Z", - email: "testhubspot8@email.com", - firstname: "Alex", - hs_object_id: "103601", - lastmodifieddate: "2022-07-14T15:26:49.590Z" - }, - createdAt: "2022-07-14T15:25:08.975Z", - updatedAt: "2022-07-14T15:26:49.590Z", - archived: false - }, - { - id: "103602", - properties: { - createdate: "2022-07-14T15:27:08.975Z", - email: "testhubspot9@email.com", - firstname: "Jhon", - hs_object_id: "103602", - lastmodifieddate: "2022-07-14T15:28:49.590Z" - }, - createdAt: "2022-07-14T15:27:08.975Z", - updatedAt: "2022-07-14T15:28:49.590Z", - archived: false - } - ] - }, - status: 200 - }); - } else if (mockData) { - //resolve with status 200 - return Promise.resolve({ data: mockData, status: 200 }); - } - - return Promise.reject({ - response: { - data: { - status: "error", - message: "404 not found", - correlationId: "4d39ff11-e121-4514-bcd8-132a9dd1ff50", - category: "DATA_NOT_DOUND", - links: { - "api key": "https://app.hubspot.com/l/api-key/" - } - }, - status: 404 - } - }); -}; - -module.exports = { hsGetRequestHandler, hsPostRequestHandler }; diff --git a/test/__mocks__/wootric.mock.js b/test/__mocks__/wootric.mock.js deleted file mode 100644 index 0a1519f1d2..0000000000 --- a/test/__mocks__/wootric.mock.js +++ /dev/null @@ -1,55 +0,0 @@ -const fs = require("fs"); -const path = require("path"); - -const urlDirectoryMap = { - "api.wootric.com": "wootric" -}; - -const getData = url => { - let directory = ""; - Object.keys(urlDirectoryMap).forEach(key => { - if (url.includes(key)) { - directory = urlDirectoryMap[key]; - } - }); - if (directory) { - const dataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${directory}/response.json`) - ); - const data = JSON.parse(dataFile); - return data[url]; - } - return {}; -}; - -const wootricGetRequestHandler = url => { - const mockData = getData(url); - if (mockData) { - return { data: mockData, status: 200 }; - } - return new Promise((resolve, reject) => { - resolve({ error: "Request failed", status: 404 }); - }); -}; - -const wootricPostRequestHandler = (url, payload) => { - const mockData = getData(url); - if (mockData) { - return { data: mockData, status: 200 }; - } - return new Promise((resolve, reject) => { - reject({ - response: { - data: { - error: "Not found", - status: 404 - } - } - }); - }); -}; - -module.exports = { - wootricGetRequestHandler, - wootricPostRequestHandler -}; diff --git a/test/__tests__/data/hs.json b/test/__tests__/data/hs.json deleted file mode 100644 index fe51488c70..0000000000 --- a/test/__tests__/data/hs.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/test/__tests__/data/hs_input.json b/test/__tests__/data/hs_input.json deleted file mode 100644 index 0dab49824f..0000000000 --- a/test/__tests__/data/hs_input.json +++ /dev/null @@ -1,3185 +0,0 @@ -[ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "page", - "messageId": "e8585d9a-7137-4223-b295-68ab1b17dad7", - "originalTimestamp": "2019-10-15T09:35:31.289Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - }, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "properties": { - "revenue": 4.99, - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "properties": { - "value": 4.99, - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "invalid-api-key", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "rate-limit-id", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "description": "[HS] (legacyApiKey): trigger update all objects endpoint for rETL source", - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot2@email.com", - "type": "HS-lead" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "description": "[HS] (legacyApiKey): trigger create custom objects endpoint", - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot@email.com", - "type": "HS-lead" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "description": "[HS] (newApiKey): trigger create all objects endpoint for rETL source", - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot@email.com", - "type": "HS-lead" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (newApiKey): trigger update all objects endpoint for rETL source", - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot2@email.com", - "type": "HS-lead" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": {}, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "sentAt": "2019-10-14T11:15:53.296Z", - "properties": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - } - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (legacyApi): use (API Key) - check external id i.e hubspotId", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "hubspotId", - "id": "6556" - } - ] - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS 2", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (legacyApi): use (API Key) - check HS common config mappings", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "externalId": [ - { - "type": "hubspotId", - "id": "6556" - } - ] - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS 2", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345, - "address": { - "street": "24. park" - }, - "company": { - "name": "RudderStack" - } - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (legacyApi): use (newPrivateAppApi) for contact endpoint", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "accessToken": "dummy-access-token", - "apiVersion": "legacyApi", - "lookupField": "", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (newApi): get contact from hs with email (lookupField) exactly matching with one contact", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345", - "lookupField": "email" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (newApi): get contact from hs with email (lookupField) having no contacts", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "noname@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345", - "lookupField": "email" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (newApi): get contact from hs with firstname (lookupField) having more than one result", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "nonamess@email.com", - "firstname": "Jhon", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "firstname", - "hubspotEvents": [], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (newApi): Track - validate properties of custom behavioral events", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "Purchase", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345, - "Revenue": 100 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "1", - "apiKey": "1", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (legacyApi): (legacyApiKey) Identify - testing legacy api with new destination config", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "accessToken": "", - "apiVersion": "legacyApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "blacklistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (legacyApi): (legacyApiKey) Track - testing legacy api with new destination config", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "accessToken": "", - "apiVersion": "legacyApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "whitelistedEvents": [ - { - "eventName": "" - } - ], - "blacklistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) check for email in traits which is the deafult lookup field", - "message": { - "type": "identify", - "traits": {}, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ], - "mappedToDestination": false - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) email is present in traits as a default lookup field", - "message": { - "type": "identify", - "traits": { - "email": "noname@email.com" - }, - "context": { - "mappedToDestination": false - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) - rETL source - minimum config check", - "message": { - "type": "identify", - "traits": {}, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ], - "mappedToDestination": "true" - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) rETL - object type is not provided i.e externalId is empty", - "message": { - "type": "identify", - "traits": {}, - "context": { - "mappedToDestination": "true" - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) sample track call for property check", - "message": { - "type": "track", - "traits": {}, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ] - }, - "event": "Purchase", - "properties": { - "Revenue": "name1" - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) - check for accesstoken existence", - "message": { - "type": "identify", - "traits": { - "lookupField": "firstname", - "firstname": "Test" - }, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ] - }, - "event": "Purchase", - "properties": { - "revenue": "name1" - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (legacyApiKey) - check for hubId existence", - "message": { - "type": "identify", - "traits": { - "lookupField": "firstname", - "firstname": "Test" - }, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ] - }, - "event": "Purchase", - "properties": { - "revenue": "name1" - } - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "", - "apiKey": "", - "accessToken": "", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (legacyApiKey) - check basic track call", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "Purchase", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345, - "address": { - "city": "kolkata", - "country": "India" - }, - "objectId": "5005" - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "accessToken": "", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (legacyApiKey) - either of email, utk or objectId must be present", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "Purchase", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345, - "address": { - "city": "kolkata", - "country": "India" - } - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "accessToken": "", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "message": { - "description": "[HS] (newApi): check for legacyApiKey", - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "noname@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) message type not present", - "message": { - "traits": {}, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ] - }, - "event": "Purchase", - "properties": { - "revenue": "name1" - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (legacyApiKey) - check for api key existence", - "message": { - "type": "identify", - "traits": { - "lookupField": "firstname", - "firstname": "Test" - }, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ] - }, - "event": "Purchase", - "properties": { - "revenue": "name1" - } - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "dummy-hubId", - "apiKey": "", - "accessToken": "", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) Identify: traits is not supplied", - "message": { - "type": "identify", - "context": { - "mappedToDestination": false - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (legacyApiKey) - event not found", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "Temp Event", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345, - "address": { - "city": "kolkata", - "country": "India" - }, - "objectId": "5005" - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "accessToken": "", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (legacyApiKey) - event name is required", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345, - "address": { - "city": "kolkata", - "country": "India" - }, - "objectId": "5005" - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "authorizationType": "legacyApiKey", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "accessToken": "", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (Legacy API v1) - (newPrivateAppApi) rETL - object type is not provided i.e externalId is empty", - "message": { - "type": "identify", - "traits": {}, - "context": { - "mappedToDestination": "true" - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "legacyApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pe22315509_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pe22315509_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - }, - { - "description": "[HS] (Legacy API v1) - (newPrivateAppApi) - sample track call for legacy api with newPrivateAppApi", - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId", - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "apiVersion": "legacyApi" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot2@email.com", - "type": "HS-lead" - } - ], - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "rate-limit-id", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "days_to_close": "29 days to close" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2023-04-11T09:35:31.288Z", - "anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090", - "userId": "user@1", - "integrations": { - "All": true - } - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "identify", - "messageId": "e8585d9a-7137-4223-b295-68ab1b17dad7", - "originalTimestamp": "2019-10-15T09:35:31.289Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": {}, - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "identify", - "messageId": "e8585d9a-7137-4223-b295-68ab1b17dad7", - "originalTimestamp": "2019-10-15T09:35:31.289Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot", - "anonymousId": "12345" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "identify", - "messageId": "e8585d9a-7137-4223-b295-68ab1b17dad7", - "originalTimestamp": "2019-10-15T09:35:31.289Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "properties": "", - "integrations": { - "All": true - }, - "name": "ApplicationLoaded", - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "Enabled": true - } - }, - { - "description": "[HS] (New API v3) - (newPrivateAppApi) sample track call when hubspotEvents is undefined", - "message": { - "type": "track", - "traits": {}, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ] - }, - "event": "Purchase", - "properties": { - "Revenue": "name1" - } - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "hubID": "", - "apiKey": "", - "accessToken": "dummy-access-token", - "apiVersion": "newApi", - "lookupField": "lookupField", - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "Enabled": true - } - } -] diff --git a/test/__tests__/data/hs_output.json b/test/__tests__/data/hs_output.json deleted file mode 100644 index 72fe50ba0d..0000000000 --- a/test/__tests__/data/hs_output.json +++ /dev/null @@ -1,843 +0,0 @@ -[ - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "properties": [ - { - "property": "email", - "value": "testhubspot2@email.com" - }, - { - "property": "firstname", - "value": "Test Hubspot" - } - ] - }, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Message type page is not supported" - }, - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "properties": [ - { - "property": "email", - "value": "testhubspot2@email.com" - }, - { - "property": "firstname", - "value": "Test Hubspot" - } - ] - }, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Identify without email is not supported." - }, - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "_m": 4.99, - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "_m": 4.99, - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - { - "error": "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/\"}}" - }, - { - "error": "Failed to get hubspot properties: {\"status\":\"error\",\"message\":\"Request Rate Limit reached\",\"correlationId\":\"4d39ff11-e121-4514-bcd8-132a9dd1ff50\",\"category\":\"RATE-LIMIT_REACHED\",\"links\":{\"api key\":\"https://app.hubspot.com/l/api-key/\"}}" - }, - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - [ - { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead/103605", - "source": "rETL", - "operation": "updateObject", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "properties": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India", - "email": "testhubspot2@email.com" - } - }, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead", - "source": "rETL", - "operation": "createObject", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "properties": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India", - "email": "testhubspot@email.com" - } - }, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead", - "source": "rETL", - "operation": "createObject", - "headers": { - "Authorization": "Bearer dummy-access-token", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "properties": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India", - "email": "testhubspot@email.com" - } - }, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "PATCH", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead/103605", - "source": "rETL", - "operation": "updateObject", - "headers": { - "Authorization": "Bearer dummy-access-token", - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "properties": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India", - "email": "testhubspot2@email.com" - } - }, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - } - ], - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS 2", - "id": "6556", - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS 2", - "id": "6556", - "address": "24. park", - "company": "RudderStack" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "properties": [ - { - "property": "email", - "value": "testhubspot2@email.com" - }, - { - "property": "firstname", - "value": "Test Hubspot" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/contacts/103604", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "operation": "updateContacts", - "body": { - "JSON": { - "properties": { - "email": "testhubspot@email.com", - "firstname": "Test Hubspot" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/contacts", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "operation": "createContacts", - "body": { - "JSON": { - "properties": { - "email": "noname@email.com", - "firstname": "Test Hubspot" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Unable to get single Hubspot contact. More than one contacts found. Retry with unique lookupPropertyName and lookupValue" - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "messageType": "track", - "endpoint": "https://api.hubapi.com/events/v3/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "email": "testhubspot2@email.com", - "occurredAt": "2019-10-15T09:35:31.291Z", - "eventName": "pe22315509_rs_hub_test", - "properties": { - "value": 100 - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "properties": [ - { - "property": "email", - "value": "testhubspot2@email.com" - }, - { - "property": "firstname", - "value": "Test Hubspot" - } - ] - }, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - } - ], - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - { - "statusCode": 400, - "error": "Identify:: email i.e a default lookup field for contact lookup not found in traits", - "statTags": { - "destination": "hs", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/contacts", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "properties": { - "email": "noname@email.com" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "operation": "createContacts" - } - ], - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/contacts", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "properties": { - "email": "osvaldocostaferreira98@gmail.com" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "source": "rETL", - "operation": "createObject" - } - ], - { - "statusCode": 400, - "error": "rETL - external Id not found.", - "statTags": { - "destination": "hs", - "stage": "transform", - "scope": "exception" - } - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/events/v3/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "email": "osvaldocostaferreira98@gmail.com", - "eventName": "pe22315509_rs_hub_test", - "properties": { - "value": "name1" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "messageType": "track" - }, - { - "statusCode": 400, - "error": "Access Token not found. Aborting", - "statTags": { - "destination": "hs", - "stage": "transform", - "scope": "exception" - } - }, - { - "statusCode": 400, - "error": "Hub ID not found. Aborting", - "statTags": { - "destination": "hs", - "stage": "transform", - "scope": "exception" - } - }, - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/events/v3/send?hapikey=dummy-apikey", - "headers": { - "Content-Type": "application/json" - }, - "params": {}, - "body": { - "JSON": { - "occurredAt": "2019-10-15T09:35:31.291Z", - "objectId": "5005", - "eventName": "pe22315509_rs_hub_test", - "properties": { - "hs_city": "kolkata", - "hs_country": "India" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {}, - "messageType": "track" - }, - { - "statusCode": 400, - "error": "Either of email, utk or objectId is required for custom behavioral events", - "statTags": { - "destination": "hs", - "stage": "transform", - "scope": "exception" - } - }, - [ - { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/contacts", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "operation": "createContacts", - "body": { - "JSON": { - "properties": { - "email": "noname@email.com", - "firstname": "Test Hubspot" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - } - ], - { - "statusCode": 400, - "error": "Message type is not present. Aborting message." - }, - { - "statusCode": 400, - "error": "API Key not found. Aborting" - }, - { - "statusCode": 400, - "error": "Identify - Invalid traits value for lookup field" - }, - { - "statusCode": 400, - "error": "Event name 'temp event' mappings are not configured in the destination" - }, - { - "statusCode": 400, - "error": "event name is required for track call" - }, - { - "statusCode": 400, - "error": "rETL - external Id not found.", - "statTags": { - "destination": "hs", - "stage": "transform", - "scope": "exception" - } - }, - { - "version": "1", - "type": "REST", - "method": "GET", - "messageType": "track", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot" - }, - "body": { - "JSON": {}, - "XML": {}, - "FORM": {}, - "JSON_ARRAY": {} - }, - "files": {} - }, - { - "error": "rETL - Error during searching object record. 404 not found" - }, - { - "error": "Property days_to_close data type string is not matching with Hubspot property data type number" - }, - [ - { - "body": { - "FORM": {}, - "JSON": { - "properties": [ - { "property": "email", "value": "testhubspot2@email.com" }, - { "property": "firstname", "value": "Test Hubspot" } - ] - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "files": {}, - "headers": { "Content-Type": "application/json" }, - "method": "POST", - "params": { "hapikey": "dummy-apikey" }, - "type": "REST", - "version": "1" - } - ], - [ - { - "body": { - "FORM": {}, - "JSON": { - "properties": [ - { "property": "email", "value": "testhubspot2@email.com" }, - { "property": "firstname", "value": "Test Hubspot" } - ] - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "files": {}, - "headers": { "Content-Type": "application/json" }, - "method": "POST", - "params": { "hapikey": "dummy-apikey" }, - "type": "REST", - "version": "1" - } - ], - [ - { - "body": { - "FORM": {}, - "JSON": { - "properties": [ - { "property": "email", "value": "testhubspot2@email.com" }, - { "property": "firstname", "value": "Test Hubspot" } - ] - }, - "JSON_ARRAY": {}, - "XML": {} - }, - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "files": {}, - "headers": { "Content-Type": "application/json" }, - "method": "POST", - "params": { "hapikey": "dummy-apikey" }, - "type": "REST", - "version": "1" - } - ], - - { - "statusCode": 400, - "error": "Event and property mappings are required for track call", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation", - "destType": "HS", - "module": "destination", - "implementation": "native", - "feature": "processor" - } - } -] diff --git a/test/__tests__/data/hs_router_associations_rEtl_input.json b/test/__tests__/data/hs_router_associations_rEtl_input.json deleted file mode 100644 index 4cd0ac8d43..0000000000 --- a/test/__tests__/data/hs_router_associations_rEtl_input.json +++ /dev/null @@ -1,57 +0,0 @@ -[ - { - "destination": { - "ID": "123", - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "pat-123", - "apiVersion": "newApi" - } - }, - "message": { - "type": "identify", - "sentAt": "2022-08-23T05:59:38.214Z", - "traits": { - "to": { - "id": 1 - }, - "from": { - "id": 9405415215 - } - }, - "userId": "1", - "channel": "sources", - "context": { - "sources": { - "job_id": "2DkDam0hJ8CXZA43zksWMdPAPRe/Syncher", - "task_id": "HUBSPOT_ASSOC_COMPANY_CONTACT", - "version": "v1.8.15", - "batch_id": "8d566f29-5f9b-4fa7-ad0c-d8087ca52d6a", - "job_run_id": "cc26p35qhlpr6fd4jrmg", - "task_run_id": "cc26p35qhlpr6fd4jrn0" - }, - "externalId": [ - { - "id": 1, - "type": "HS-association", - "toObjectType": "contacts", - "fromObjectType": "companies", - "identifierType": "id", - "associationTypeId": "engineer" - } - ], - "mappedToDestination": "true" - }, - "recordId": "1", - "rudderId": "3afcdbfe-b6ec-4bdd-8ba6-28696e3cc163", - "messageId": "e0c554aa-0a9a-4e24-9a9a-c951a71a0875", - "timestamp": "2022-08-23T05:59:33.758Z", - "receivedAt": "2022-08-23T05:59:33.759Z", - "request_ip": "10.1.90.32", - "originalTimestamp": "2022-08-23T05:59:38.214Z" - }, - "metadata": { - "jobId": 2 - } - } -] diff --git a/test/__tests__/data/hs_router_associations_rEtl_output.json b/test/__tests__/data/hs_router_associations_rEtl_output.json deleted file mode 100644 index e8535c48d2..0000000000 --- a/test/__tests__/data/hs_router_associations_rEtl_output.json +++ /dev/null @@ -1,49 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/associations/companies/contacts/batch/create", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer pat-123" - }, - "params": {}, - "body": { - "JSON": { - "inputs": [ - { - "to": { - "id": 1 - }, - "from": { - "id": 9405415215 - }, - "type": "engineer" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "ID": "123", - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "pat-123", - "apiVersion": "newApi" - } - } - } -] diff --git a/test/__tests__/data/hs_router_input.json b/test/__tests__/data/hs_router_input.json deleted file mode 100644 index 7f82f2f8d4..0000000000 --- a/test/__tests__/data/hs_router_input.json +++ /dev/null @@ -1,573 +0,0 @@ -[ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "noname@email.com", - "firstname": "Test Hubspot22", - "anonymousId": "4444" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "noname@email.com", - "firstname": "Test Hubspot44", - "anonymousId": "4444" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "type": "track", - "traits": {}, - "context": { - "externalId": [ - { - "id": "osvaldocostaferreira98@gmail.com", - "type": "HS-contacts", - "identifierType": "email" - } - ] - }, - "event": "Purchase", - "properties": { - "Revenue": "name1" - } - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot@email.com", - "firstname": "Test Hubspot22", - "anonymousId": "4444" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot@email.com", - "firstname": "Test Hubspot44", - "anonymousId": "4444" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 5 - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/hs_router_input_legacy.json b/test/__tests__/data/hs_router_input_legacy.json deleted file mode 100644 index 022aba7315..0000000000 --- a/test/__tests__/data/hs_router_input_legacy.json +++ /dev/null @@ -1,281 +0,0 @@ -[ - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot1@email.com", - "firstname": "Test Hubspot1", - "anonymousId": "1111" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 1 - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot2" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "type": "track", - "messageId": "08829772-d991-427c-b976-b4c4f4430b4e", - "originalTimestamp": "2019-10-15T09:35:31.291Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "event": "test track event HS", - "properties": { - "user_actual_role": "system_admin, system_user", - "user_actual_id": 12345 - }, - "sentAt": "2019-10-14T11:15:53.296Z" - }, - "metadata": { - "jobId": 2 - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com", - "headers": { - "Content-Type": "application/json" - }, - "userId": "00000000000000000000000000", - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "properties": [ - { - "property": "email", - "value": "testhubspot3@email.com" - }, - { - "property": "firstname", - "value": "Test Hubspot3" - } - ] - }, - "XML": {}, - "FORM": {} - }, - "files": {}, - "statusCode": 200 - }, - "metadata": { - "jobId": 3 - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "traits": { - "email": "testhubspot4@email.com", - "firstname": "Test Hubspot4", - "anonymousId": "4444" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-GB", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - }, - "page": { - "path": "", - "referrer": "", - "search": "", - "title": "", - "url": "" - } - }, - "type": "identify", - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "metadata": { - "jobId": 4 - }, - "destination": { - "Config": { - "apiKey": "rate-limit-id", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/hs_router_legacy_rETL_input.json b/test/__tests__/data/hs_router_legacy_rETL_input.json deleted file mode 100644 index 6bba7d72de..0000000000 --- a/test/__tests__/data/hs_router_legacy_rETL_input.json +++ /dev/null @@ -1,130 +0,0 @@ -[ - { - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot2@email.com", - "type": "HS-lead" - } - ], - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 2 - } - }, - { - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot@email.com", - "type": "HS-lead" - } - ], - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot 1", - "anonymousId": "123451", - "country": "India 1" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 3 - } - } -] diff --git a/test/__tests__/data/hs_router_legacy_rETL_output.json b/test/__tests__/data/hs_router_legacy_rETL_output.json deleted file mode 100644 index dcd3ab91b1..0000000000 --- a/test/__tests__/data/hs_router_legacy_rETL_output.json +++ /dev/null @@ -1,129 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead/batch/create", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "inputs": [ - { - "properties": { - "firstname": "Test Hubspot 1", - "anonymousId": "123451", - "country": "India 1", - "email": "testhubspot@email.com" - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 3 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead/batch/update", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": { - "inputs": [ - { - "properties": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India", - "email": "testhubspot2@email.com" - }, - "id": "103605" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/hs_router_output.json b/test/__tests__/data/hs_router_output.json deleted file mode 100644 index bd0045e7e6..0000000000 --- a/test/__tests__/data/hs_router_output.json +++ /dev/null @@ -1,321 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/contacts/batch/create", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "inputs": [ - { - "properties": { - "email": "noname@email.com", - "firstname": "Test Hubspot44" - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - }, - { - "jobId": 2 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/contacts/batch/update", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "inputs": [ - { - "id": "103604", - "properties": { - "email": "testhubspot@email.com", - "firstname": "Test Hubspot44" - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 4 - }, - { - "jobId": 5 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/events/v3/send", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "email": "osvaldocostaferreira98@gmail.com", - "eventName": "pedummy-hubId_rs_hub_test", - "properties": { - "value": "name1" - } - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 3 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "email", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/hs_router_output_legacy.json b/test/__tests__/data/hs_router_output_legacy.json deleted file mode 100644 index 7ce945a24a..0000000000 --- a/test/__tests__/data/hs_router_output_legacy.json +++ /dev/null @@ -1,117 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/contacts/v1/contact/batch/", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "hapikey": "dummy-apikey" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": { - "batch": "[{\"email\":\"testhubspot3@email.com\",\"properties\":[{\"property\":\"firstname\",\"value\":\"Test Hubspot3\"}]},{\"email\":\"testhubspot1@email.com\",\"properties\":[{\"property\":\"firstname\",\"value\":\"Test Hubspot1\"}]},{\"email\":\"testhubspot4@email.com\",\"properties\":[{\"property\":\"firstname\",\"value\":\"Test Hubspot4\"}]}]" - }, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 3 - }, - { - "jobId": 1 - }, - { - "jobId": 4 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "GET", - "endpoint": "https://track.hubspot.com/v1/event", - "headers": { - "Content-Type": "application/json" - }, - "params": { - "_a": "dummy-hubId", - "_n": "test track event HS", - "email": "testhubspot2@email.com", - "firstname": "Test Hubspot2" - }, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "Config": { - "apiKey": "dummy-apikey", - "hubID": "dummy-hubId" - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/hs_router_rETL_input.json b/test/__tests__/data/hs_router_rETL_input.json deleted file mode 100644 index 3e855855b4..0000000000 --- a/test/__tests__/data/hs_router_rETL_input.json +++ /dev/null @@ -1,332 +0,0 @@ -[ - { - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot2@email.com", - "type": "HS-lead" - } - ], - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 2 - } - }, - { - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspot@email.com", - "type": "HS-lead" - } - ], - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot 1", - "anonymousId": "123451", - "country": "India 1" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 3 - } - }, - { - "message": { - "channel": "web", - "context": { - "mappedToDestination": true, - "externalId": [ - { - "identifierType": "email", - "id": "testhubspotdatetime@email.com", - "type": "HS-lead" - } - ], - "sources": { - "job_id": "24c5HJxHomh6YCngEOCgjS5r1KX/Syncher", - "task_id": "vw_rs_mailchimp_mocked_hg_data", - "version": "v1.8.1", - "batch_id": "f252c69d-c40d-450e-bcd2-2cf26cb62762", - "job_run_id": "c8el40l6e87v0c4hkbl0", - "task_run_id": "c8el40l6e87v0c4hkblg" - } - }, - "type": "identify", - "traits": { - "firstname": "Test Hubspot", - "anonymousId": "123451", - "country": "India", - "date_submitted": "2023-09-25T17:31:04.128251Z", - "date_created": "2023-03-30T01:02:03.05Z", - "date_closed": "2023-10-18T04:38:59.229347Z" - }, - "messageId": "50360b9c-ea8d-409c-b672-c9230f91cce5", - "originalTimestamp": "2019-10-15T09:35:31.288Z", - "anonymousId": "00000000000000000000000000", - "userId": "12345", - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - }, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - }, - "metadata": { - "jobId": 4 - } - } -] diff --git a/test/__tests__/data/hs_router_rETL_output.json b/test/__tests__/data/hs_router_rETL_output.json deleted file mode 100644 index c20694cdf4..0000000000 --- a/test/__tests__/data/hs_router_rETL_output.json +++ /dev/null @@ -1,231 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead/batch/create", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "inputs": [ - { - "properties": { - "firstname": "Test Hubspot 1", - "anonymousId": "123451", - "country": "India 1", - "email": "testhubspot@email.com" - } - }, - { - "properties": { - "firstname": "Test Hubspot", - "anonymousId": "123451", - "country": "India", - "email": "testhubspotdatetime@email.com", - "date_closed": 1697587200000, - "date_created": 1680134400000, - "date_submitted": 1695600000000 - } - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 3 - }, - { - "jobId": 4 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.hubapi.com/crm/v3/objects/lead/batch/update", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer dummy-access-token" - }, - "params": {}, - "body": { - "JSON": { - "inputs": [ - { - "properties": { - "firstname": "Test Hubspot", - "anonymousId": "12345", - "country": "India", - "email": "testhubspot2@email.com" - }, - "id": "103605" - } - ] - }, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "authorizationType": "newPrivateAppApi", - "accessToken": "dummy-access-token", - "hubID": "dummy-hubId", - "apiKey": "dummy-apikey", - "apiVersion": "newApi", - "lookupField": "lookupField", - "hubspotEvents": [ - { - "rsEventName": "Purchase", - "hubspotEventName": "pedummy-hubId_rs_hub_test", - "eventProperties": [ - { - "from": "Revenue", - "to": "value" - }, - { - "from": "Price", - "to": "cost" - } - ] - }, - { - "rsEventName": "Order Complete", - "hubspotEventName": "pedummy-hubId_rs_hub_chair", - "eventProperties": [ - { - "from": "firstName", - "to": "first_name" - }, - { - "from": "lastName", - "to": "last_name" - } - ] - } - ], - "eventFilteringOption": "disable", - "blacklistedEvents": [ - { - "eventName": "" - } - ], - "whitelistedEvents": [ - { - "eventName": "" - } - ] - }, - "secretConfig": {}, - "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", - "name": "Hubspot", - "enabled": true, - "workspaceId": "1TSN08muJTZwH8iCDmnnRt1pmLd", - "deleted": false, - "createdAt": "2020-12-30T08:39:32.005Z", - "updatedAt": "2021-02-03T16:22:31.374Z", - "destinationDefinition": { - "id": "1aIXqM806xAVm92nx07YwKbRrO9", - "name": "HS", - "displayName": "Hubspot", - "createdAt": "2020-04-09T09:24:31.794Z", - "updatedAt": "2021-01-11T11:03:28.103Z" - }, - "transformations": [], - "isConnectionEnabled": true, - "isProcessorEnabled": true - } - } -] diff --git a/test/__tests__/data/wootric.json b/test/__tests__/data/wootric.json deleted file mode 100644 index c7c63694f1..0000000000 --- a/test/__tests__/data/wootric.json +++ /dev/null @@ -1,1467 +0,0 @@ -[ - { - "description": "Wrong Account Token Passed", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken12" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": {}, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "Access token could not be generated due to {\"error\":\"Not found\",\"status\":404}" - } - }, - { - "description": "Identify call for creating user", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Bangalore", - "name": "Dummy User 2", - "email": "dummyUser2@gmail.com", - "phone": "+19123456777", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "email": "dummyUser2@gmail.com", - "phone_number": "+19123456777", - "last_surveyed": "1642685961", - "external_created_at": "1611149961", - "external_id": "dummyId2", - "properties[city]": "Bangalore", - "properties[name]": "Dummy User 2", - "properties[title]": "SDE", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - } - }, - { - "description": "Identify call for creating user without-sending email and sending phone number", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Bangalore", - "name": "Dummy User 2", - "phone": "+19123456777", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "phone_number": "+19123456777", - "last_surveyed": "1642685961", - "external_created_at": "1611149961", - "external_id": "dummyId2", - "properties[city]": "Bangalore", - "properties[name]": "Dummy User 2", - "properties[title]": "SDE", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - } - }, - { - "description": "Identify call for creating user without-sending phone number and sending email", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "dummyUser2@gmail.com", - "city": "Bangalore", - "name": "Dummy User 2", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "email": "dummyUser2@gmail.com", - "last_surveyed": "1642685961", - "external_created_at": "1611149961", - "external_id": "dummyId2", - "properties[city]": "Bangalore", - "properties[name]": "Dummy User 2", - "properties[title]": "SDE", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - } - }, - { - "description": "Identify call for creating user without sending traits", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "email/phone number are missing. At least one parameter must be provided", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - }, - { - "description": "Identify call for creating user without-sending (email and phone number)", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "email/phone number are missing. At least one parameter must be provided", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - }, - { - "description": "Identify call for updating existing user with wootric end user id", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "title": "VP", - "gender": "Male" - }, - "externalId": [ - { - "type": "wootricEndUserId", - "id": "490635419" - } - ], - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.wootric.com/v1/end_users/490635419", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "last_surveyed": "1642685961", - "properties[Department]": "Marketing", - "properties[product_plan]": "Web", - "properties[revenue amount]": "5000", - "properties[title]": "VP", - "properties[gender]": "Male" - } - }, - "files": {} - } - }, - { - "description": "Identify call for updating existing user with (wootric externalId/ rudderstack userId)", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "title": "VP", - "gender": "Male" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.wootric.com/v1/end_users/486438462", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "last_surveyed": "1642685961", - "properties[title]": "VP", - "properties[gender]": "Male", - "properties[city]": "Mumbai", - "properties[name]": "Dummy User 1", - "properties[company]": "Rudderstack" - } - }, - "files": {} - } - }, - { - "description": "Identify call for updating user traits/properties", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Udaipur", - "name": "Dummy User 1 New", - "title": "SDE-2", - "gender": "Male", - "company": "Rudderstack" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.wootric.com/v1/end_users/486438462", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "last_surveyed": "1642685961", - "properties[city]": "Udaipur", - "properties[name]": "Dummy User 1 New", - "properties[title]": "SDE-2", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - } - }, - { - "description": "Track call with existing userId and event type as create response", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 7, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "email": "dummyUser1@gmail.com", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create response" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users/486438462/responses", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "score": 7, - "ip_address": "0.0.0.0", - "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "text": "Simple, Easy to use, Reliable, Affordable Product", - "created_at": "1611149961", - "end_user[properties][city]": "Mumbai", - "end_user[properties][name]": "Dummy User 1", - "end_user[properties][title]": "SDE", - "end_user[properties][gender]": "Male", - "end_user[properties][company]": "Rudderstack" - } - }, - "files": {} - } - }, - { - "description": "Track call with non-existing userId", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "properties": { - "feedbackScore": 7, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create response" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "No user found with userId : dummyId2", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - }, - { - "description": "Track call with non-existing wootricEndUserId", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "channel": "web", - "properties": { - "feedbackScore": 7, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "externalId": [{ "type": "wootricEndUserId", "id": "12345" }], - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create response" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "No user found with wootric end user Id : 12345", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - }, - { - "description": "Track call with existing userId and event type as create response and score out of bound", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 12, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create response" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "Invalid Score", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - }, - { - "description": "Track call with existing userId and event type as create decline", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 9, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create decline" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users/486438462/declines", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html" - } - }, - "files": {} - } - }, - { - "description": "Track call with non-existing userId and event type as create decline", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "properties": { - "feedbackScore": 9, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create decline" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "No user found with userId : dummyId2", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - }, - { - "description": "Track call with event type other than create response or decline", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 7, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "email": "dummyUser1@gmail.com", - "phone": "+19123456789", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "random" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "Event Type not supported", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - }, - { - "description": "Track call with missing event type in integration object", - "input": { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "wootric-1234" - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 3, - "feedbackText": "Too Slow!!!" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "email": "dummyUser1@gmail.com", - "phone": "+19123456789", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - "output": { - "statusCode": 400, - "error": "Event Type is missing from Integration object", - "statTags": { - "destination": "wootric", - "stage": "transform", - "scope": "exception" - } - } - } -] diff --git a/test/__tests__/data/wootric_router_input.json b/test/__tests__/data/wootric_router_input.json deleted file mode 100644 index 360c07afa5..0000000000 --- a/test/__tests__/data/wootric_router_input.json +++ /dev/null @@ -1,1076 +0,0 @@ -[ - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 1 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Bangalore", - "name": "Dummy User 2", - "email": "dummyUser2@gmail.com", - "phone": "+19123456777", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 2 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Bangalore", - "name": "Dummy User 2", - "phone": "+19123456777", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 3 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "dummyUser2@gmail.com", - "city": "Bangalore", - "name": "Dummy User 2", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 5 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 6 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 7 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "email": "dummyuser1_01@gmail.com" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 8 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "phone": "+19777777778" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 9 - }, - "message": { - "type": "identify", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Udaipur", - "name": "Dummy User 1 New", - "title": "SDE-2", - "gender": "Male", - "company": "Rudderstack" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 10 - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 7, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "email": "dummyUser1@gmail.com", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create response" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 11 - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "properties": { - "feedbackScore": 7, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create response" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 12 - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 12, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create response" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 13 - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 9, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create decline" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 14 - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId2", - "channel": "web", - "properties": { - "feedbackScore": 9, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "create decline" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 15 - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 7, - "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "email": "dummyUser1@gmail.com", - "phone": "+19123456789", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true, - "Wootric": { - "eventType": "random" - } - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": { - "jobId": 16 - }, - "message": { - "type": "track", - "sentAt": "2022-01-20T13:39:21.033Z", - "userId": "dummyId1", - "channel": "web", - "properties": { - "feedbackScore": 3, - "feedbackText": "Too Slow!!!" - }, - "context": { - "os": { - "name": "", - "version": "" - }, - "app": { - "name": "RudderLabs JavaScript SDK", - "build": "1.0.0", - "version": "1.2.20", - "namespace": "com.rudderlabs.javascript" - }, - "page": { - "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", - "title": "Document", - "search": "", - "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", - "initial_referrer": "$direct", - "referring_domain": "127.0.0.1:7307", - "initial_referring_domain": "" - }, - "locale": "en-US", - "ip": "0.0.0.0", - "screen": { - "width": 1440, - "height": 900, - "density": 2, - "innerWidth": 536, - "innerHeight": 689 - }, - "traits": { - "city": "Mumbai", - "name": "Dummy User 1", - "email": "dummyUser1@gmail.com", - "phone": "+19123456789", - "title": "SDE", - "gender": "Male", - "company": "Rudderstack", - "createdAt": "2021-01-20T13:39:21.032Z" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.2.20" - }, - "campaign": {}, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" - }, - "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", - "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", - "anonymousId": "bf412108-0357-4330-b119-7305e767823c", - "integrations": { - "All": true - }, - "originalTimestamp": "2022-01-20T13:39:21.032Z" - } - } -] diff --git a/test/__tests__/data/wootric_router_output.json b/test/__tests__/data/wootric_router_output.json deleted file mode 100644 index 4d23a783c8..0000000000 --- a/test/__tests__/data/wootric_router_output.json +++ /dev/null @@ -1,493 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "email": "dummyUser2@gmail.com", - "phone_number": "+19123456777", - "last_surveyed": "1642685961", - "external_created_at": "1611149961", - "external_id": "dummyId2", - "properties[city]": "Bangalore", - "properties[name]": "Dummy User 2", - "properties[title]": "SDE", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 1 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "phone_number": "+19123456777", - "last_surveyed": "1642685961", - "external_created_at": "1611149961", - "external_id": "dummyId2", - "properties[city]": "Bangalore", - "properties[name]": "Dummy User 2", - "properties[title]": "SDE", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 2 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "email": "dummyUser2@gmail.com", - "last_surveyed": "1642685961", - "external_created_at": "1611149961", - "external_id": "dummyId2", - "properties[city]": "Bangalore", - "properties[name]": "Dummy User 2", - "properties[title]": "SDE", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 3 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": [ - { - "jobId": 5 - } - ], - "batched": false, - "statusCode": 400, - "error": "email/phone number are missing. At least one parameter must be provided", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": [ - { - "jobId": 6 - } - ], - "batched": false, - "statusCode": 400, - "error": "email/phone number are missing. At least one parameter must be provided", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.wootric.com/v1/end_users/486438462", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "email": "dummyuser1_01@gmail.com", - "last_surveyed": "1642685961" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 7 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.wootric.com/v1/end_users/486438462", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "phone_number": "+19777777778", - "last_surveyed": "1642685961" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 8 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "PUT", - "endpoint": "https://api.wootric.com/v1/end_users/486438462", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "last_surveyed": "1642685961", - "properties[city]": "Udaipur", - "properties[name]": "Dummy User 1 New", - "properties[title]": "SDE-2", - "properties[gender]": "Male", - "properties[company]": "Rudderstack" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 9 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users/486438462/responses", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "score": 7, - "ip_address": "0.0.0.0", - "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", - "text": "Simple, Easy to use, Reliable, Affordable Product", - "created_at": "1611149961", - "end_user[properties][city]": "Mumbai", - "end_user[properties][name]": "Dummy User 1", - "end_user[properties][title]": "SDE", - "end_user[properties][gender]": "Male", - "end_user[properties][company]": "Rudderstack" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 10 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "metadata": [ - { - "jobId": 11 - } - ], - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "batched": false, - "statusCode": 400, - "error": "No user found with userId : dummyId2", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": [ - { - "jobId": 12 - } - ], - "batched": false, - "statusCode": 400, - "error": "Invalid Score", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - }, - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://api.wootric.com/v1/end_users/486438462/declines", - "headers": { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": {}, - "XML": {}, - "FORM": { - "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html" - } - }, - "files": {} - }, - "metadata": [ - { - "jobId": 13 - } - ], - "batched": false, - "statusCode": 200, - "destination": { - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - } - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": [ - { - "jobId": 14 - } - ], - "batched": false, - "statusCode": 400, - "error": "No user found with userId : dummyId2", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - }, - { - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "metadata": [ - { - "jobId": 15 - } - ], - "batched": false, - "statusCode": 400, - "error": "Event Type not supported", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - }, - { - "metadata": [ - { - "jobId": 16 - } - ], - "destination": { - "Config": { - "username": "wootricfakeuser@example.com", - "password": "password@123", - "accountToken": "NPS-dummyToken" - }, - "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" - }, - "batched": false, - "statusCode": 400, - "error": "Event Type is missing from Integration object", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "instrumentation" - } - } -] diff --git a/test/__tests__/hubspot.test.js b/test/__tests__/hubspot.test.js deleted file mode 100644 index 83f02f5a14..0000000000 --- a/test/__tests__/hubspot.test.js +++ /dev/null @@ -1,139 +0,0 @@ -jest.mock("axios"); - -const integration = "hs"; -const name = "Hubspot"; - -const fs = require("fs"); -const path = require("path"); - -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const inputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_input.json`) -); -const outputDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_output.json`) -); -const inputData = JSON.parse(inputDataFile); -const expectedData = JSON.parse(outputDataFile); - -// Router Legacy Test files -const inputLegacyRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input_legacy.json`) -); -const outputLegacyRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output_legacy.json`) -); -const inputLegacyRouterData = JSON.parse(inputLegacyRouterDataFile); -const expectedLegacyRouterData = JSON.parse(outputLegacyRouterDataFile); - -// Router Test files (New API) -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -// Router Test files for rETL sources -const inputRouterDataFilerETL = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_rETL_input.json`) -); -const outputRouterDataFilerETL = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_rETL_output.json`) -); -const inputRouterDatarETL = JSON.parse(inputRouterDataFilerETL); -const expectedRouterDatarETL = JSON.parse(outputRouterDataFilerETL); - -// Router Test files for rETL sources (legacy) -const inputRouterDataFilerETLLegacy = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_legacy_rETL_input.json`) -); -const outputRouterDataFilerETLLegacy = fs.readFileSync( - path.resolve( - __dirname, - `./data/${integration}_router_legacy_rETL_output.json` - ) -); -const inputRouterDatarETLLegacy = JSON.parse(inputRouterDataFilerETLLegacy); -const expectedRouterDatarETLLegacy = JSON.parse(outputRouterDataFilerETLLegacy); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - inputData.forEach(async (input, index) => { - it(`Payload - ${index}`, async () => { - try { - const output = await transformer.process(input); - expect(output).toEqual(expectedData[index]); - } catch (error) { - expect(error.message).toEqual(expectedData[index].error); - } - }); - }); - }); - - // Legacy API - // It has different test cases as this (NEW API) destination config can - // change in the middle of legacy batching causing issue with the existing flow - describe("Router Tests (Legacy API)", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest( - inputLegacyRouterData - ); - expect(routerOutput).toEqual(expectedLegacyRouterData); - }); - }); - - // New API - describe("Router Tests (New API)", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); - - describe("Router Tests for rETL sources", () => { - it("Payload", async () => { - const routerOutputrETL = await transformer.processRouterDest( - inputRouterDatarETL - ); - expect(routerOutputrETL).toEqual(expectedRouterDatarETL); - }); - - it("should transform association events", async () => { - const assocInput = JSON.parse( - fs.readFileSync( - path.resolve( - __dirname, - `data/${integration}_router_associations_rEtl_input.json` - ) - ) - ); - const assocExpectedOutput = JSON.parse( - fs.readFileSync( - path.resolve( - __dirname, - `data/${integration}_router_associations_rEtl_output.json` - ) - ) - ); - const actualOutput = await transformer.processRouterDest(assocInput); - - expect(actualOutput).toEqual(assocExpectedOutput); - }); - }); - // rETL Sources - describe("Router Tests for rETL sources (Legacy)", () => { - it("Payload", async () => { - const routerOutputrETLLegacy = await transformer.processRouterDest( - inputRouterDatarETLLegacy - ); - expect(routerOutputrETLLegacy).toEqual(expectedRouterDatarETLLegacy); - }); - }); -}); diff --git a/test/__tests__/wootric.test.js b/test/__tests__/wootric.test.js deleted file mode 100644 index 7e7e81cd49..0000000000 --- a/test/__tests__/wootric.test.js +++ /dev/null @@ -1,46 +0,0 @@ -const integration = "wootric"; -const name = "Wootric"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Processor Test files -const testDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}.json`) -); -const testData = JSON.parse(testDataFile); - -// Router Test files -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Processor", () => { - testData.forEach(async (dataPoint, index) => { - it(`${index}. ${integration} - ${dataPoint.description}`, async () => { - try { - const output = await transformer.process(dataPoint.input); - expect(output).toEqual(dataPoint.output); - } catch (error) { - expect(error.message).toEqual(dataPoint.output.error); - } - }); - }); - }); - - describe("Router", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -}); diff --git a/test/integrations/destinations/hs/network.ts b/test/integrations/destinations/hs/network.ts new file mode 100644 index 0000000000..e29cc27562 --- /dev/null +++ b/test/integrations/destinations/hs/network.ts @@ -0,0 +1,664 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.hubapi.com/properties/v1/contacts/properties?hapikey=dummy-apikey', + method: 'GET', + }, + httpRes: { + status: 200, + data: [ + { name: 'company_size', type: 'string' }, + { name: 'date_of_birth', type: 'string' }, + { name: 'days_to_close', type: 'number' }, + { + name: 'date_submitted', + type: 'date', + }, + { + name: 'days_create', + type: 'date', + }, + { + name: 'days_closed', + type: 'date', + }, + { name: 'degree', type: 'string' }, + { name: 'field_of_study', type: 'string' }, + { name: 'first_conversion_date', type: 'datetime' }, + { name: 'first_conversion_event_name', type: 'string' }, + { name: 'first_deal_created_date', type: 'datetime' }, + { name: 'gender', type: 'string' }, + { name: 'graduation_date', type: 'string' }, + { name: 'hs_additional_emails', type: 'enumeration' }, + { name: 'hs_all_contact_vids', type: 'enumeration' }, + { + name: 'hs_analytics_first_touch_converting_campaign', + type: 'string', + }, + { name: 'hs_analytics_last_touch_converting_campaign', type: 'string' }, + { name: 'hs_avatar_filemanager_key', type: 'string' }, + { name: 'hs_calculated_form_submissions', type: 'enumeration' }, + { name: 'hs_calculated_merged_vids', type: 'enumeration' }, + { name: 'hs_calculated_mobile_number', type: 'string' }, + { name: 'hs_calculated_phone_number', type: 'string' }, + { name: 'hs_calculated_phone_number_area_code', type: 'string' }, + { name: 'hs_calculated_phone_number_country_code', type: 'string' }, + { name: 'hs_calculated_phone_number_region_code', type: 'string' }, + { name: 'hs_content_membership_email_confirmed', type: 'bool' }, + { name: 'hs_content_membership_notes', type: 'string' }, + { name: 'hs_content_membership_registered_at', type: 'datetime' }, + { + name: 'hs_content_membership_registration_domain_sent_to', + type: 'string', + }, + { + name: 'hs_content_membership_registration_email_sent_at', + type: 'datetime', + }, + { name: 'hs_content_membership_status', type: 'enumeration' }, + { name: 'hs_conversations_visitor_email', type: 'string' }, + { name: 'hs_created_by_conversations', type: 'bool' }, + { name: 'hs_created_by_user_id', type: 'string' }, + { name: 'hs_createdate', type: 'datetime' }, + { name: 'hs_document_last_revisited', type: 'datetime' }, + { name: 'hs_email_domain', type: 'string' }, + { name: 'hs_email_quarantined', type: 'bool' }, + { name: 'hs_email_quarantined_reason', type: 'enumeration' }, + { name: 'hs_email_recipient_fatigue_recovery_time', type: 'datetime' }, + { name: 'hs_email_sends_since_last_engagement', type: 'number' }, + { name: 'hs_emailconfirmationstatus', type: 'enumeration' }, + { name: 'hs_facebook_ad_clicked', type: 'bool' }, + { name: 'hs_feedback_last_nps_follow_up', type: 'string' }, + { name: 'hs_feedback_last_nps_rating', type: 'enumeration' }, + { name: 'hs_feedback_last_survey_date', type: 'datetime' }, + { name: 'hs_feedback_show_nps_web_survey', type: 'bool' }, + { name: 'hs_google_click_id', type: 'string' }, + { name: 'hs_ip_timezone', type: 'string' }, + { name: 'hs_is_contact', type: 'bool' }, + { name: 'hs_last_sales_activity_date', type: 'datetime' }, + { name: 'hs_lastmodifieddate', type: 'datetime' }, + { name: 'hs_lead_status', type: 'enumeration' }, + { name: 'hs_legal_basis', type: 'enumeration' }, + { name: 'hs_merged_object_ids', type: 'enumeration' }, + { name: 'hs_object_id', type: 'number' }, + { name: 'hs_predictivecontactscore_v2', type: 'number' }, + { name: 'hs_predictivescoringtier', type: 'enumeration' }, + { name: 'hs_sales_email_last_clicked', type: 'datetime' }, + { name: 'hs_sales_email_last_opened', type: 'datetime' }, + { + name: 'hs_searchable_calculated_international_mobile_number', + type: 'phone_number', + }, + { + name: 'hs_searchable_calculated_international_phone_number', + type: 'phone_number', + }, + { + name: 'hs_searchable_calculated_mobile_number', + type: 'phone_number', + }, + { name: 'hs_searchable_calculated_phone_number', type: 'phone_number' }, + { name: 'hs_sequences_is_enrolled', type: 'bool' }, + { name: 'hs_updated_by_user_id', type: 'string' }, + { name: 'hubspot_owner_assigneddate', type: 'datetime' }, + { name: 'ip_city', type: 'string' }, + { name: 'ip_country', type: 'string' }, + { name: 'ip_country_code', type: 'string' }, + { name: 'ip_latlon', type: 'string' }, + { name: 'ip_state', type: 'string' }, + { name: 'ip_state_code', type: 'string' }, + { name: 'ip_zipcode', type: 'string' }, + { name: 'job_function', type: 'string' }, + { name: 'lastmodifieddate', type: 'datetime' }, + { name: 'marital_status', type: 'string' }, + { name: 'military_status', type: 'string' }, + { name: 'num_associated_deals', type: 'number' }, + { name: 'num_conversion_events', type: 'number' }, + { name: 'num_unique_conversion_events', type: 'number' }, + { name: 'recent_conversion_date', type: 'datetime' }, + { name: 'recent_conversion_event_name', type: 'string' }, + { name: 'recent_deal_amount', type: 'number' }, + { name: 'recent_deal_close_date', type: 'datetime' }, + { name: 'relationship_status', type: 'string' }, + { name: 'school', type: 'string' }, + { name: 'seniority', type: 'string' }, + { name: 'start_date', type: 'string' }, + { name: 'test_date', type: 'date' }, + { name: 'test_key', type: 'string' }, + { name: 'test_prop', type: 'string' }, + { name: 'test_property', type: 'string' }, + { name: 'total_revenue', type: 'number' }, + { name: 'work_email', type: 'string' }, + { name: 'firstname', type: 'string' }, + { name: 'hs_analytics_first_url', type: 'string' }, + { name: 'hs_email_delivered', type: 'number' }, + { name: 'hs_email_optout_7283808', type: 'enumeration' }, + { name: 'twitterhandle', type: 'string' }, + { name: 'currentlyinworkflow', type: 'enumeration' }, + { name: 'hs_analytics_last_url', type: 'string' }, + { name: 'hs_email_open', type: 'number' }, + { name: 'fax', type: 'string' }, + { name: 'hs_analytics_first_timestamp', type: 'datetime' }, + { name: 'hs_email_last_email_name', type: 'string' }, + { name: 'hs_email_last_send_date', type: 'datetime' }, + { name: 'address', type: 'string' }, + { name: 'engagements_last_meeting_booked', type: 'datetime' }, + { name: 'engagements_last_meeting_booked_campaign', type: 'string' }, + { name: 'engagements_last_meeting_booked_medium', type: 'string' }, + { name: 'engagements_last_meeting_booked_source', type: 'string' }, + { name: 'hs_analytics_first_visit_timestamp', type: 'datetime' }, + { name: 'hs_email_last_open_date', type: 'datetime' }, + { name: 'hs_sales_email_last_replied', type: 'datetime' }, + { name: 'hubspot_owner_id', type: 'enumeration' }, + { name: 'notes_last_contacted', type: 'datetime' }, + { name: 'notes_last_updated', type: 'datetime' }, + { name: 'notes_next_activity_date', type: 'datetime' }, + { name: 'num_contacted_notes', type: 'number' }, + { name: 'num_notes', type: 'number' }, + { name: 'surveymonkeyeventlastupdated', type: 'number' }, + { name: 'webinareventlastupdated', type: 'number' }, + { name: 'city', type: 'string' }, + { name: 'hs_analytics_last_timestamp', type: 'datetime' }, + { name: 'hs_email_last_click_date', type: 'datetime' }, + { name: 'hubspot_team_id', type: 'enumeration' }, + { name: 'hs_all_owner_ids', type: 'enumeration' }, + { name: 'hs_analytics_last_visit_timestamp', type: 'datetime' }, + { name: 'hs_email_first_send_date', type: 'datetime' }, + { name: 'state', type: 'string' }, + { name: 'hs_all_team_ids', type: 'enumeration' }, + { name: 'hs_analytics_source', type: 'enumeration' }, + { name: 'hs_email_first_open_date', type: 'datetime' }, + { name: 'zip', type: 'string' }, + { name: 'country', type: 'string' }, + { name: 'hs_all_accessible_team_ids', type: 'enumeration' }, + { name: 'hs_analytics_source_data_1', type: 'string' }, + { name: 'hs_email_first_click_date', type: 'datetime' }, + { name: 'hs_analytics_source_data_2', type: 'string' }, + { name: 'hs_email_is_ineligible', type: 'bool' }, + { name: 'hs_language', type: 'enumeration' }, + { name: 'hs_analytics_first_referrer', type: 'string' }, + { name: 'jobtitle', type: 'string' }, + { name: 'hs_analytics_last_referrer', type: 'string' }, + { name: 'message', type: 'string' }, + { name: 'closedate', type: 'datetime' }, + { name: 'hs_analytics_average_page_views', type: 'number' }, + { name: 'hs_analytics_revenue', type: 'number' }, + { name: 'hs_lifecyclestage_lead_date', type: 'datetime' }, + { + name: 'hs_lifecyclestage_marketingqualifiedlead_date', + type: 'datetime', + }, + { name: 'hs_lifecyclestage_opportunity_date', type: 'datetime' }, + { name: 'lifecyclestage', type: 'enumeration' }, + { name: 'hs_lifecyclestage_salesqualifiedlead_date', type: 'datetime' }, + { name: 'createdate', type: 'datetime' }, + { name: 'hs_lifecyclestage_evangelist_date', type: 'datetime' }, + { name: 'hs_lifecyclestage_customer_date', type: 'datetime' }, + { name: 'hubspotscore', type: 'number' }, + { name: 'company', type: 'string' }, + { name: 'hs_lifecyclestage_subscriber_date', type: 'datetime' }, + { name: 'hs_lifecyclestage_other_date', type: 'datetime' }, + { name: 'website', type: 'string' }, + { name: 'numemployees', type: 'enumeration' }, + { name: 'annualrevenue', type: 'string' }, + { name: 'industry', type: 'string' }, + { name: 'associatedcompanyid', type: 'number' }, + { name: 'associatedcompanylastupdated', type: 'number' }, + { name: 'hs_predictivecontactscorebucket', type: 'enumeration' }, + { name: 'hs_predictivecontactscore', type: 'number' }, + ], + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/properties/v1/contacts/properties', + method: 'GET', + }, + httpRes: { + status: 200, + data: [ + { name: 'company_size', type: 'string' }, + { name: 'date_of_birth', type: 'string' }, + { name: 'days_to_close', type: 'number' }, + { + name: 'date_submitted', + type: 'date', + }, + { + name: 'date_created', + type: 'date', + }, + { + name: 'date_closed', + type: 'date', + }, + { name: 'degree', type: 'string' }, + { name: 'field_of_study', type: 'string' }, + { name: 'first_conversion_date', type: 'datetime' }, + { name: 'first_conversion_event_name', type: 'string' }, + { name: 'first_deal_created_date', type: 'datetime' }, + { name: 'gender', type: 'string' }, + { name: 'graduation_date', type: 'string' }, + { name: 'hs_additional_emails', type: 'enumeration' }, + { name: 'hs_all_contact_vids', type: 'enumeration' }, + { + name: 'hs_analytics_first_touch_converting_campaign', + type: 'string', + }, + { name: 'hs_analytics_last_touch_converting_campaign', type: 'string' }, + { name: 'hs_avatar_filemanager_key', type: 'string' }, + { name: 'hs_calculated_form_submissions', type: 'enumeration' }, + { name: 'hs_calculated_merged_vids', type: 'enumeration' }, + { name: 'hs_calculated_mobile_number', type: 'string' }, + { name: 'hs_calculated_phone_number', type: 'string' }, + { name: 'hs_calculated_phone_number_area_code', type: 'string' }, + { name: 'hs_calculated_phone_number_country_code', type: 'string' }, + { name: 'hs_calculated_phone_number_region_code', type: 'string' }, + { name: 'hs_content_membership_email_confirmed', type: 'bool' }, + { name: 'hs_content_membership_notes', type: 'string' }, + { name: 'hs_content_membership_registered_at', type: 'datetime' }, + { + name: 'hs_content_membership_registration_domain_sent_to', + type: 'string', + }, + { + name: 'hs_content_membership_registration_email_sent_at', + type: 'datetime', + }, + { name: 'hs_content_membership_status', type: 'enumeration' }, + { name: 'hs_conversations_visitor_email', type: 'string' }, + { name: 'hs_created_by_conversations', type: 'bool' }, + { name: 'hs_created_by_user_id', type: 'string' }, + { name: 'hs_createdate', type: 'datetime' }, + { name: 'hs_document_last_revisited', type: 'datetime' }, + { name: 'hs_email_domain', type: 'string' }, + { name: 'hs_email_quarantined', type: 'bool' }, + { name: 'hs_email_quarantined_reason', type: 'enumeration' }, + { name: 'hs_email_recipient_fatigue_recovery_time', type: 'datetime' }, + { name: 'hs_email_sends_since_last_engagement', type: 'number' }, + { name: 'hs_emailconfirmationstatus', type: 'enumeration' }, + { name: 'hs_facebook_ad_clicked', type: 'bool' }, + { name: 'hs_feedback_last_nps_follow_up', type: 'string' }, + { name: 'hs_feedback_last_nps_rating', type: 'enumeration' }, + { name: 'hs_feedback_last_survey_date', type: 'datetime' }, + { name: 'hs_feedback_show_nps_web_survey', type: 'bool' }, + { name: 'hs_google_click_id', type: 'string' }, + { name: 'hs_ip_timezone', type: 'string' }, + { name: 'hs_is_contact', type: 'bool' }, + { name: 'hs_last_sales_activity_date', type: 'datetime' }, + { name: 'hs_lastmodifieddate', type: 'datetime' }, + { name: 'hs_lead_status', type: 'enumeration' }, + { name: 'hs_legal_basis', type: 'enumeration' }, + { name: 'hs_merged_object_ids', type: 'enumeration' }, + { name: 'hs_object_id', type: 'number' }, + { name: 'hs_predictivecontactscore_v2', type: 'number' }, + { name: 'hs_predictivescoringtier', type: 'enumeration' }, + { name: 'hs_sales_email_last_clicked', type: 'datetime' }, + { name: 'hs_sales_email_last_opened', type: 'datetime' }, + { + name: 'hs_searchable_calculated_international_mobile_number', + type: 'phone_number', + }, + { + name: 'hs_searchable_calculated_international_phone_number', + type: 'phone_number', + }, + { + name: 'hs_searchable_calculated_mobile_number', + type: 'phone_number', + }, + { name: 'hs_searchable_calculated_phone_number', type: 'phone_number' }, + { name: 'hs_sequences_is_enrolled', type: 'bool' }, + { name: 'hs_updated_by_user_id', type: 'string' }, + { name: 'hubspot_owner_assigneddate', type: 'datetime' }, + { name: 'ip_city', type: 'string' }, + { name: 'ip_country', type: 'string' }, + { name: 'ip_country_code', type: 'string' }, + { name: 'ip_latlon', type: 'string' }, + { name: 'ip_state', type: 'string' }, + { name: 'ip_state_code', type: 'string' }, + { name: 'ip_zipcode', type: 'string' }, + { name: 'job_function', type: 'string' }, + { name: 'lastmodifieddate', type: 'datetime' }, + { name: 'marital_status', type: 'string' }, + { name: 'military_status', type: 'string' }, + { name: 'num_associated_deals', type: 'number' }, + { name: 'num_conversion_events', type: 'number' }, + { name: 'num_unique_conversion_events', type: 'number' }, + { name: 'recent_conversion_date', type: 'datetime' }, + { name: 'recent_conversion_event_name', type: 'string' }, + { name: 'recent_deal_amount', type: 'number' }, + { name: 'recent_deal_close_date', type: 'datetime' }, + { name: 'relationship_status', type: 'string' }, + { name: 'school', type: 'string' }, + { name: 'seniority', type: 'string' }, + { name: 'start_date', type: 'string' }, + { name: 'test_date', type: 'date' }, + { name: 'test_key', type: 'string' }, + { name: 'test_prop', type: 'string' }, + { name: 'test_property', type: 'string' }, + { name: 'total_revenue', type: 'number' }, + { name: 'work_email', type: 'string' }, + { name: 'firstname', type: 'string' }, + { name: 'hs_analytics_first_url', type: 'string' }, + { name: 'hs_email_delivered', type: 'number' }, + { name: 'hs_email_optout_7283808', type: 'enumeration' }, + { name: 'twitterhandle', type: 'string' }, + { name: 'currentlyinworkflow', type: 'enumeration' }, + { name: 'hs_analytics_last_url', type: 'string' }, + { name: 'hs_email_open', type: 'number' }, + { name: 'fax', type: 'string' }, + { name: 'hs_analytics_first_timestamp', type: 'datetime' }, + { name: 'hs_email_last_email_name', type: 'string' }, + { name: 'hs_email_last_send_date', type: 'datetime' }, + { name: 'address', type: 'string' }, + { name: 'engagements_last_meeting_booked', type: 'datetime' }, + { name: 'engagements_last_meeting_booked_campaign', type: 'string' }, + { name: 'engagements_last_meeting_booked_medium', type: 'string' }, + { name: 'engagements_last_meeting_booked_source', type: 'string' }, + { name: 'hs_analytics_first_visit_timestamp', type: 'datetime' }, + { name: 'hs_email_last_open_date', type: 'datetime' }, + { name: 'hs_sales_email_last_replied', type: 'datetime' }, + { name: 'hubspot_owner_id', type: 'enumeration' }, + { name: 'notes_last_contacted', type: 'datetime' }, + { name: 'notes_last_updated', type: 'datetime' }, + { name: 'notes_next_activity_date', type: 'datetime' }, + { name: 'num_contacted_notes', type: 'number' }, + { name: 'num_notes', type: 'number' }, + { name: 'surveymonkeyeventlastupdated', type: 'number' }, + { name: 'webinareventlastupdated', type: 'number' }, + { name: 'city', type: 'string' }, + { name: 'hs_analytics_last_timestamp', type: 'datetime' }, + { name: 'hs_email_last_click_date', type: 'datetime' }, + { name: 'hubspot_team_id', type: 'enumeration' }, + { name: 'hs_all_owner_ids', type: 'enumeration' }, + { name: 'hs_analytics_last_visit_timestamp', type: 'datetime' }, + { name: 'hs_email_first_send_date', type: 'datetime' }, + { name: 'state', type: 'string' }, + { name: 'hs_all_team_ids', type: 'enumeration' }, + { name: 'hs_analytics_source', type: 'enumeration' }, + { name: 'hs_email_first_open_date', type: 'datetime' }, + { name: 'zip', type: 'string' }, + { name: 'country', type: 'string' }, + { name: 'hs_all_accessible_team_ids', type: 'enumeration' }, + { name: 'hs_analytics_source_data_1', type: 'string' }, + { name: 'hs_email_first_click_date', type: 'datetime' }, + { name: 'hs_analytics_source_data_2', type: 'string' }, + { name: 'hs_email_is_ineligible', type: 'bool' }, + { name: 'hs_language', type: 'enumeration' }, + { name: 'hs_analytics_first_referrer', type: 'string' }, + { name: 'jobtitle', type: 'string' }, + { name: 'hs_analytics_last_referrer', type: 'string' }, + { name: 'message', type: 'string' }, + { name: 'closedate', type: 'datetime' }, + { name: 'hs_analytics_average_page_views', type: 'number' }, + { name: 'hs_analytics_revenue', type: 'number' }, + { name: 'hs_lifecyclestage_lead_date', type: 'datetime' }, + { + name: 'hs_lifecyclestage_marketingqualifiedlead_date', + type: 'datetime', + }, + { name: 'hs_lifecyclestage_opportunity_date', type: 'datetime' }, + { name: 'lifecyclestage', type: 'enumeration' }, + { name: 'hs_lifecyclestage_salesqualifiedlead_date', type: 'datetime' }, + { name: 'createdate', type: 'datetime' }, + { name: 'hs_lifecyclestage_evangelist_date', type: 'datetime' }, + { name: 'hs_lifecyclestage_customer_date', type: 'datetime' }, + { name: 'hubspotscore', type: 'number' }, + { name: 'company', type: 'string' }, + { name: 'hs_lifecyclestage_subscriber_date', type: 'datetime' }, + { name: 'hs_lifecyclestage_other_date', type: 'datetime' }, + { name: 'website', type: 'string' }, + { name: 'numemployees', type: 'enumeration' }, + { name: 'annualrevenue', type: 'string' }, + { name: 'industry', type: 'string' }, + { name: 'associatedcompanyid', type: 'number' }, + { name: 'associatedcompanylastupdated', type: 'number' }, + { name: 'hs_predictivecontactscorebucket', type: 'enumeration' }, + { name: 'hs_predictivecontactscore', type: 'number' }, + ], + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', + method: 'POST', + headers: { + Authorization: 'Bearer dummy-access-token', + }, + }, + httpRes: { + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', + method: 'POST', + headers: { + Authorization: 'Bearer dummy-access-tokensuccess', + }, + }, + httpRes: { + data: { + total: 1, + results: [ + { + id: '103604', + properties: { + createdate: '2022-07-15T15:25:08.975Z', + email: 'testhubspot@email.com', + hs_object_id: '103604', + lastmodifieddate: '2022-07-15T15:26:49.590Z', + }, + createdAt: '2022-07-15T15:25:08.975Z', + updatedAt: '2022-07-15T15:26:49.590Z', + archived: false, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/contacts/search', + method: 'POST', + headers: { + Authorization: 'Bearer dummy-access-tokenmultiple', + }, + }, + httpRes: { + data: { + total: 2, + results: [ + { + id: '103604', + properties: { + createdate: '2022-07-15T15:25:08.975Z', + email: 'testhubspot@email.com', + hs_object_id: '103604', + lastmodifieddate: '2022-07-15T15:26:49.590Z', + }, + createdAt: '2022-07-15T15:25:08.975Z', + updatedAt: '2022-07-15T15:26:49.590Z', + archived: false, + }, + { + id: '103604', + properties: { + createdate: '2022-07-15T15:25:08.975Z', + email: 'testhubspot@email.com', + hs_object_id: '103604', + lastmodifieddate: '2022-07-15T15:26:49.590Z', + }, + createdAt: '2022-07-15T15:25:08.975Z', + updatedAt: '2022-07-15T15:26:49.590Z', + archived: false, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/lead/search', + method: 'POST', + }, + httpRes: { + status: 200, + data: { + total: 1, + results: [ + { + id: '103605', + properties: { + createdate: '2022-08-15T15:25:08.975Z', + email: 'testhubspot2@email.com', + hs_object_id: '103605', + lastmodifieddate: '2022-08-15T15:26:49.590Z', + }, + createdAt: '2022-08-15T15:25:08.975Z', + updatedAt: '2022-08-15T15:26:49.590Z', + archived: false, + }, + ], + }, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/lead/search?hapikey=dummy-apikey', + method: 'POST', + }, + httpRes: { + data: { + total: 1, + results: [ + { + id: '103605', + properties: { + createdate: '2022-08-15T15:25:08.975Z', + email: 'testhubspot2@email.com', + hs_object_id: '103605', + lastmodifieddate: '2022-08-15T15:26:49.590Z', + }, + createdAt: '2022-08-15T15:25:08.975Z', + updatedAt: '2022-08-15T15:26:49.590Z', + archived: false, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/lead/search?hapikey=rate-limit-id', + method: 'POST', + }, + httpRes: { + data: { + status: 'error', + message: 'Request Rate Limit reached', + correlationId: '4d39ff11-e121-4514-bcd8-132a9dd1ff50', + category: 'RATE-LIMIT_REACHED', + links: { + 'api key': 'https://app.hubspot.com/l/api-key/', + }, + }, + status: 429, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=dummy-apikey', + method: 'POST', + }, + httpRes: { + data: { + total: 1, + results: [ + { + id: '103604', + properties: { + createdate: '2022-07-15T15:25:08.975Z', + email: 'testhubspot@email.com', + hs_object_id: '103604', + lastmodifieddate: '2022-07-15T15:26:49.590Z', + }, + createdAt: '2022-07-15T15:25:08.975Z', + updatedAt: '2022-07-15T15:26:49.590Z', + archived: false, + }, + ], + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=dummy-apikeysuccess', + method: 'POST', + }, + httpRes: { + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/properties/v1/contacts/properties?hapikey=dummy-apikeysuccess', + method: 'GET', + }, + httpRes: { + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/properties/v1/contacts/properties?hapikey=rate-limit-id', + method: 'GET', + }, + httpRes: { + data: { + status: 'error', + message: 'Request Rate Limit reached', + correlationId: '4d39ff11-e121-4514-bcd8-132a9dd1ff50', + category: 'RATE-LIMIT_REACHED', + links: { + 'api key': 'https://app.hubspot.com/l/api-key/', + }, + }, + status: 429, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/properties/v1/contacts/properties?hapikey=invalid-api-key', + method: 'GET', + }, + httpRes: { + data: { + 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, + }, + }, + { + httpReq: { + url: 'https://api.hubapi.com/crm/v3/objects/association/search', + method: 'POST', + }, + httpRes: { + status: 200, + }, + }, +]; diff --git a/test/integrations/destinations/hs/processor/data.ts b/test/integrations/destinations/hs/processor/data.ts new file mode 100644 index 0000000000..5eaa109dc4 --- /dev/null +++ b/test/integrations/destinations/hs/processor/data.ts @@ -0,0 +1,5272 @@ +export const data = [ + { + name: 'hs', + description: 'Test 0', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot2@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot', + }, + ], + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 1', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'page', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2019-10-15T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message type page is not supported', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 2', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 3', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot2@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot', + }, + ], + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 4', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Identify without email is not supported.', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 5', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + properties: { + revenue: 4.99, + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + _m: 4.99, + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 6', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + properties: { + value: 4.99, + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + _m: 4.99, + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 7', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'invalid-api-key', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 2, + }, + 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}}', + statTags: { + destType: 'HS', + errorCategory: 'network', + errorType: 'aborted', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 401, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 8', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'rate-limit-id', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + metadata: { + jobId: 2, + }, + error: + '{"message":"Failed to get hubspot properties: {\\"status\\":\\"error\\",\\"message\\":\\"Request Rate Limit reached\\",\\"correlationId\\":\\"4d39ff11-e121-4514-bcd8-132a9dd1ff50\\",\\"category\\":\\"RATE-LIMIT_REACHED\\",\\"links\\":{\\"api key\\":\\"https://app.hubspot.com/l/api-key/\\"}}","destinationResponse":{"response":{"status":"error","message":"Request Rate Limit reached","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"RATE-LIMIT_REACHED","links":{"api key":"https://app.hubspot.com/l/api-key/"}},"status":429}}', + statTags: { + destType: 'HS', + errorCategory: 'network', + errorType: 'throttled', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 429, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 9', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (legacyApiKey): trigger update all objects endpoint for rETL source', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (legacyApiKey): trigger update all objects endpoint for rETL source', + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot2@email.com', + type: 'HS-lead', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'PATCH', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/103605', + source: 'rETL', + operation: 'updateObject', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + properties: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + email: 'testhubspot2@email.com', + }, + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (legacyApiKey): trigger create custom objects endpoint', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (legacyApiKey): trigger create custom objects endpoint', + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot@email.com', + type: 'HS-lead', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead', + source: 'rETL', + operation: 'createObject', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + properties: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + email: 'testhubspot@email.com', + }, + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (newApiKey): trigger create all objects endpoint for rETL source', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (newApiKey): trigger create all objects endpoint for rETL source', + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot@email.com', + type: 'HS-lead', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + userId: '', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead', + source: 'rETL', + operation: 'createObject', + headers: { + Authorization: 'Bearer dummy-access-token', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + properties: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + email: 'testhubspot@email.com', + }, + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (newApiKey): trigger update all objects endpoint for rETL source', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (newApiKey): trigger update all objects endpoint for rETL source', + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot2@email.com', + type: 'HS-lead', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'PATCH', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/103605', + source: 'rETL', + operation: 'updateObject', + headers: { + Authorization: 'Bearer dummy-access-token', + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + properties: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + email: 'testhubspot2@email.com', + }, + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 14', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: {}, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + sentAt: '2019-10-14T11:15:53.296Z', + properties: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 15', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: '[HS] (legacyApi): use (API Key) - check external id i.e hubspotId', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'hubspotId', + id: '6556', + }, + ], + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS 2', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS 2', + id: '6556', + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 16', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: '[HS] (legacyApi): use (API Key) - check HS common config mappings', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + externalId: [ + { + type: 'hubspotId', + id: '6556', + }, + ], + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS 2', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + address: { + street: '24. park', + }, + company: { + name: 'RudderStack', + }, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS 2', + id: '6556', + address: '24. park', + company: 'RudderStack', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 17', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: '[HS] (legacyApi): use (newPrivateAppApi) for contact endpoint', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + accessToken: 'dummy-access-token', + apiVersion: 'legacyApi', + lookupField: '', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot2@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 18', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: + '[HS] (newApi): get contact from hs with email (lookupField) exactly matching with one contact', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + lookupField: 'email', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-tokensuccess', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/103604', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-tokensuccess', + }, + params: {}, + operation: 'updateContacts', + body: { + JSON: { + properties: { + email: 'testhubspot@email.com', + firstname: 'Test Hubspot', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 19', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: + '[HS] (newApi): get contact from hs with email (lookupField) having no contacts', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'noname@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + lookupField: 'email', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + operation: 'createContacts', + body: { + JSON: { + properties: { + email: 'noname@email.com', + firstname: 'Test Hubspot', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 20', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: + '[HS] (newApi): get contact from hs with firstname (lookupField) having more than one result', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'nonamess@email.com', + firstname: 'Jhon', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-tokenmultiple', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'firstname', + hubspotEvents: [], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Unable to get single Hubspot contact. More than one contacts found. Retry with unique lookupPropertyName and lookupValue', + statTags: { + destType: 'HS', + errorCategory: 'network', + errorType: 'aborted', + feature: 'processor', + implementation: 'native', + meta: 'instrumentation', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 21', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: '[HS] (newApi): Track - validate properties of custom behavioral events', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'Purchase', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + Revenue: 100, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '1', + apiKey: '1', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + messageType: 'track', + endpoint: 'https://api.hubapi.com/events/v3/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + email: 'testhubspot2@email.com', + occurredAt: '2019-10-15T09:35:31.291Z', + eventName: 'pe22315509_rs_hub_test', + properties: { + value: 100, + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 22', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: + '[HS] (legacyApi): (legacyApiKey) Identify - testing legacy api with new destination config', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + accessToken: '', + apiVersion: 'legacyApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + whitelistedEvents: [ + { + eventName: '', + }, + ], + blacklistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot2@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot', + }, + ], + }, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 23', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: + '[HS] (legacyApi): (legacyApiKey) Track - testing legacy api with new destination config', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + accessToken: '', + apiVersion: 'legacyApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + whitelistedEvents: [ + { + eventName: '', + }, + ], + blacklistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: + '[HS] (New API v3) - (newPrivateAppApi) check for email in traits which is the deafult lookup field', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - (newPrivateAppApi) check for email in traits which is the deafult lookup field', + message: { + type: 'identify', + traits: {}, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + mappedToDestination: false, + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Identify:: email i.e a default lookup field for contact lookup not found in traits', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: + '[HS] (New API v3) - (newPrivateAppApi) email is present in traits as a default lookup field', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - (newPrivateAppApi) email is present in traits as a default lookup field', + message: { + type: 'identify', + traits: { + email: 'noname@email.com', + }, + context: { + mappedToDestination: false, + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + properties: { + email: 'noname@email.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + operation: 'createContacts', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (newPrivateAppApi) - rETL source - minimum config check', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - (newPrivateAppApi) - rETL source - minimum config check', + message: { + type: 'identify', + traits: {}, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + mappedToDestination: 'true', + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + properties: { + email: 'osvaldocostaferreira98@gmail.com', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + source: 'rETL', + operation: 'createObject', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: + '[HS] (New API v3) - (newPrivateAppApi) rETL - object type is not provided i.e externalId is empty', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - (newPrivateAppApi) rETL - object type is not provided i.e externalId is empty', + message: { + type: 'identify', + traits: {}, + context: { + mappedToDestination: 'true', + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'rETL - external Id not found.', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (newPrivateAppApi) sample track call for property check', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - (newPrivateAppApi) sample track call for property check', + message: { + type: 'track', + traits: {}, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + }, + event: 'Purchase', + properties: { + Revenue: 'name1', + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/events/v3/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + email: 'osvaldocostaferreira98@gmail.com', + eventName: 'pe22315509_rs_hub_test', + properties: { + value: 'name1', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + messageType: 'track', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (newPrivateAppApi) - check for accesstoken existence', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (newPrivateAppApi) - check for accesstoken existence', + message: { + type: 'identify', + traits: { + lookupField: 'firstname', + firstname: 'Test', + }, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + }, + event: 'Purchase', + properties: { + revenue: 'name1', + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: '', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Access Token not found. Aborting', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (legacyApiKey) - check for hubId existence', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (legacyApiKey) - check for hubId existence', + message: { + type: 'identify', + traits: { + lookupField: 'firstname', + firstname: 'Test', + }, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + }, + event: 'Purchase', + properties: { + revenue: 'name1', + }, + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: '', + apiKey: '', + accessToken: '', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Hub ID not found. Aborting', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (legacyApiKey) - check basic track call', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (legacyApiKey) - check basic track call', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'Purchase', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + address: { + city: 'kolkata', + country: 'India', + }, + objectId: '5005', + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + accessToken: '', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/events/v3/send?hapikey=dummy-apikey', + headers: { + 'Content-Type': 'application/json', + }, + params: {}, + body: { + JSON: { + occurredAt: '2019-10-15T09:35:31.291Z', + objectId: '5005', + eventName: 'pe22315509_rs_hub_test', + properties: { + hs_city: 'kolkata', + hs_country: 'India', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + messageType: 'track', + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: + '[HS] (New API v3) - (legacyApiKey) - either of email, utk or objectId must be present', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - (legacyApiKey) - either of email, utk or objectId must be present', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'Purchase', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + address: { + city: 'kolkata', + country: 'India', + }, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + accessToken: '', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Either of email, utk or objectId is required for custom behavioral events', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 33', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + description: '[HS] (newApi): check for legacyApiKey', + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'noname@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikeysuccess', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + userId: '', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikeysuccess', + }, + operation: 'createContacts', + body: { + JSON: { + properties: { + email: 'noname@email.com', + firstname: 'Test Hubspot', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (newPrivateAppApi) message type not present', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (newPrivateAppApi) message type not present', + message: { + traits: {}, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + }, + event: 'Purchase', + properties: { + revenue: 'name1', + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Message type is not present. Aborting message.', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (legacyApiKey) - check for api key existence', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (legacyApiKey) - check for api key existence', + message: { + type: 'identify', + traits: { + lookupField: 'firstname', + firstname: 'Test', + }, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + }, + event: 'Purchase', + properties: { + revenue: 'name1', + }, + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: 'dummy-hubId', + apiKey: '', + accessToken: '', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'API Key not found. Aborting', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (newPrivateAppApi) Identify: traits is not supplied', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (newPrivateAppApi) Identify: traits is not supplied', + message: { + type: 'identify', + context: { + mappedToDestination: false, + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'Identify - Invalid traits value for lookup field', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (legacyApiKey) - event not found', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (legacyApiKey) - event not found', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'Temp Event', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + address: { + city: 'kolkata', + country: 'India', + }, + objectId: '5005', + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + accessToken: '', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: "Event name 'temp event' mappings are not configured in the destination", + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'configuration', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: '[HS] (New API v3) - (legacyApiKey) - event name is required', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: '[HS] (New API v3) - (legacyApiKey) - event name is required', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + address: { + city: 'kolkata', + country: 'India', + }, + objectId: '5005', + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + authorizationType: 'legacyApiKey', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + accessToken: '', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'event name is required for track call', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: + '[HS] (Legacy API v1) - (newPrivateAppApi) rETL - object type is not provided i.e externalId is empty', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (Legacy API v1) - (newPrivateAppApi) rETL - object type is not provided i.e externalId is empty', + message: { + type: 'identify', + traits: {}, + context: { + mappedToDestination: 'true', + }, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + hubID: '', + apiKey: '', + accessToken: 'dummy-access-token', + apiVersion: 'legacyApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pe22315509_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pe22315509_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: 'rETL - external Id not found.', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: + '[HS] (Legacy API v1) - (newPrivateAppApi) - sample track call for legacy api with newPrivateAppApi', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (Legacy API v1) - (newPrivateAppApi) - sample track call for legacy api with newPrivateAppApi', + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + apiVersion: 'legacyApi', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + version: '1', + type: 'REST', + method: 'GET', + messageType: 'track', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + }, + body: { + JSON: {}, + XML: {}, + FORM: {}, + JSON_ARRAY: {}, + }, + files: {}, + userId: '', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 41', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot2@email.com', + type: 'HS-lead', + }, + ], + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'rate-limit-id', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + '{"message":"rETL - Error during searching object record. Request Rate Limit reached","destinationResponse":{"response":{"status":"error","message":"Request Rate Limit reached","correlationId":"4d39ff11-e121-4514-bcd8-132a9dd1ff50","category":"RATE-LIMIT_REACHED","links":{"api key":"https://app.hubspot.com/l/api-key/"}},"status":429}}', + metadata: { + jobId: 2, + }, + statTags: { + destType: 'HS', + errorCategory: 'network', + errorType: 'throttled', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 429, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 42', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + days_to_close: '29 days to close', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2023-04-11T09:35:31.288Z', + anonymousId: 'ea5cfab2-3961-4d8a-8187-3d1858c99090', + userId: 'user@1', + integrations: { + All: true, + }, + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + error: + 'Property days_to_close data type string is not matching with Hubspot property data type number', + statTags: { + destType: 'HS', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'processor', + implementation: 'native', + module: 'destination', + }, + statusCode: 400, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 43', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'identify', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2019-10-15T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: {}, + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot2@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + files: {}, + headers: { + 'Content-Type': 'application/json', + }, + method: 'POST', + params: { + hapikey: 'dummy-apikey', + }, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 44', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'identify', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2019-10-15T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot2@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + files: {}, + headers: { + 'Content-Type': 'application/json', + }, + method: 'POST', + params: { + hapikey: 'dummy-apikey', + }, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: 'Test 45', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot', + anonymousId: '12345', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'identify', + messageId: 'e8585d9a-7137-4223-b295-68ab1b17dad7', + originalTimestamp: '2019-10-15T09:35:31.289Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + properties: '', + integrations: { + All: true, + }, + name: 'ApplicationLoaded', + sentAt: '2019-10-14T11:15:53.296Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + Enabled: true, + }, + }, + ], + }, + }, + output: { + response: { + status: 200, + body: [ + { + output: { + body: { + FORM: {}, + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot2@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + }, + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + files: {}, + headers: { + 'Content-Type': 'application/json', + }, + method: 'POST', + params: { + hapikey: 'dummy-apikey', + }, + type: 'REST', + userId: '', + version: '1', + }, + statusCode: 200, + }, + ], + }, + }, + }, + { + name: 'hs', + description: + '[HS] (New API v3) - (newPrivateAppApi) sample track call when hubspotEvents is undefined', + feature: 'processor', + module: 'destination', + version: 'v0', + input: { + request: { + body: [ + { + description: + '[HS] (New API v3) - (newPrivateAppApi) sample track call when hubspotEvents is undefined', + message: { + type: 'track', + traits: {}, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + }, + event: 'Purchase', + properties: { + Revenue: 'name1', + }, + }, + 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: 'Event and property mappings are required for track call', + 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 new file mode 100644 index 0000000000..95d9d88212 --- /dev/null +++ b/test/integrations/destinations/hs/router/data.ts @@ -0,0 +1,2245 @@ +export const data = [ + { + name: 'hs', + description: 'router associated retl test', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + destination: { + ID: '123', + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'pat-123', + apiVersion: 'newApi', + }, + }, + message: { + type: 'identify', + sentAt: '2022-08-23T05:59:38.214Z', + traits: { + to: { + id: 1, + }, + from: { + id: 9405415215, + }, + }, + userId: '1', + channel: 'sources', + context: { + sources: { + job_id: '2DkDam0hJ8CXZA43zksWMdPAPRe/Syncher', + task_id: 'HUBSPOT_ASSOC_COMPANY_CONTACT', + version: 'v1.8.15', + batch_id: '8d566f29-5f9b-4fa7-ad0c-d8087ca52d6a', + job_run_id: 'cc26p35qhlpr6fd4jrmg', + task_run_id: 'cc26p35qhlpr6fd4jrn0', + }, + externalId: [ + { + id: 1, + type: 'HS-association', + toObjectType: 'contacts', + fromObjectType: 'companies', + identifierType: 'id', + associationTypeId: 'engineer', + }, + ], + mappedToDestination: 'true', + }, + recordId: '1', + rudderId: '3afcdbfe-b6ec-4bdd-8ba6-28696e3cc163', + messageId: 'e0c554aa-0a9a-4e24-9a9a-c951a71a0875', + timestamp: '2022-08-23T05:59:33.758Z', + receivedAt: '2022-08-23T05:59:33.759Z', + request_ip: '10.1.90.32', + originalTimestamp: '2022-08-23T05:59:38.214Z', + }, + metadata: { + jobId: 2, + }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://api.hubapi.com/crm/v3/associations/companies/contacts/batch/create', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer pat-123', + }, + params: {}, + body: { + JSON: { + inputs: [ + { + to: { + id: 1, + }, + from: { + id: 9405415215, + }, + type: 'engineer', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: true, + statusCode: 200, + destination: { + ID: '123', + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'pat-123', + apiVersion: 'newApi', + }, + }, + }, + ], + }, + }, + }, + }, + { + name: 'hs', + description: 'legacy router tests', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot1@email.com', + firstname: 'Test Hubspot1', + anonymousId: '1111', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot2', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + }, + type: 'track', + messageId: '08829772-d991-427c-b976-b4c4f4430b4e', + originalTimestamp: '2019-10-15T09:35:31.291Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + event: 'test track event HS', + properties: { + user_actual_role: 'system_admin, system_user', + user_actual_id: 12345, + }, + sentAt: '2019-10-14T11:15:53.296Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: + 'https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/testhubspot2@email.com', + headers: { + 'Content-Type': 'application/json', + }, + userId: '00000000000000000000000000', + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + properties: [ + { + property: 'email', + value: 'testhubspot3@email.com', + }, + { + property: 'firstname', + value: 'Test Hubspot3', + }, + ], + }, + XML: {}, + FORM: {}, + }, + files: {}, + statusCode: 200, + }, + metadata: { + jobId: 3, + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot4@email.com', + firstname: 'Test Hubspot4', + anonymousId: '4444', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 4, + }, + destination: { + Config: { + apiKey: 'rate-limit-id', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/contacts/v1/contact/batch/', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: {}, + JSON_ARRAY: { + batch: + '[{"email":"testhubspot3@email.com","properties":[{"property":"firstname","value":"Test Hubspot3"}]},{"email":"testhubspot1@email.com","properties":[{"property":"firstname","value":"Test Hubspot1"}]},{"email":"testhubspot4@email.com","properties":[{"property":"firstname","value":"Test Hubspot4"}]}]', + }, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 3, + }, + { + jobId: 1, + }, + { + jobId: 4, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'GET', + endpoint: 'https://track.hubspot.com/v1/event', + headers: { + 'Content-Type': 'application/json', + }, + params: { + _a: 'dummy-hubId', + _n: 'test track event HS', + email: 'testhubspot2@email.com', + firstname: 'Test Hubspot2', + }, + body: { + JSON: {}, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + }, + }, + { + name: 'hs', + description: 'legacy router retl tests', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot2@email.com', + type: 'HS-lead', + }, + ], + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 2, + }, + }, + { + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot@email.com', + type: 'HS-lead', + }, + ], + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot 1', + anonymousId: '123451', + country: 'India 1', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 3, + }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/create', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + inputs: [ + { + properties: { + firstname: 'Test Hubspot 1', + anonymousId: '123451', + country: 'India 1', + email: 'testhubspot@email.com', + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 3, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/update', + headers: { + 'Content-Type': 'application/json', + }, + params: { + hapikey: 'dummy-apikey', + }, + body: { + JSON: { + inputs: [ + { + properties: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + email: 'testhubspot2@email.com', + }, + id: '103605', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + apiKey: 'dummy-apikey', + hubID: 'dummy-hubId', + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + }, + }, + { + name: 'hs', + description: 'router retl tests', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot2@email.com', + type: 'HS-lead', + }, + ], + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 2, + }, + }, + { + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspot@email.com', + type: 'HS-lead', + }, + ], + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot 1', + anonymousId: '123451', + country: 'India 1', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 3, + }, + }, + { + message: { + channel: 'web', + context: { + mappedToDestination: true, + externalId: [ + { + identifierType: 'email', + id: 'testhubspotdatetime@email.com', + type: 'HS-lead', + }, + ], + sources: { + job_id: '24c5HJxHomh6YCngEOCgjS5r1KX/Syncher', + task_id: 'vw_rs_mailchimp_mocked_hg_data', + version: 'v1.8.1', + batch_id: 'f252c69d-c40d-450e-bcd2-2cf26cb62762', + job_run_id: 'c8el40l6e87v0c4hkbl0', + task_run_id: 'c8el40l6e87v0c4hkblg', + }, + }, + type: 'identify', + traits: { + firstname: 'Test Hubspot', + anonymousId: '123451', + country: 'India', + date_submitted: '2023-09-25T17:31:04.128251Z', + date_created: '2023-03-30T01:02:03.05Z', + date_closed: '2023-10-18T04:38:59.229347Z', + }, + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + metadata: { + jobId: 4, + }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/create', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + inputs: [ + { + properties: { + firstname: 'Test Hubspot 1', + anonymousId: '123451', + country: 'India 1', + email: 'testhubspot@email.com', + }, + }, + { + properties: { + firstname: 'Test Hubspot', + anonymousId: '123451', + country: 'India', + email: 'testhubspotdatetime@email.com', + date_closed: 1697587200000, + date_created: 1680134400000, + date_submitted: 1695600000000, + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 3, + }, + { + jobId: 4, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/lead/batch/update', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + inputs: [ + { + properties: { + firstname: 'Test Hubspot', + anonymousId: '12345', + country: 'India', + email: 'testhubspot2@email.com', + }, + id: '103605', + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 2, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + }, + }, + { + name: 'hs', + description: 'router tests', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'noname@email.com', + firstname: 'Test Hubspot22', + anonymousId: '4444', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 1, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'noname@email.com', + firstname: 'Test Hubspot44', + anonymousId: '4444', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 2, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + type: 'track', + traits: {}, + context: { + externalId: [ + { + id: 'osvaldocostaferreira98@gmail.com', + type: 'HS-contacts', + identifierType: 'email', + }, + ], + }, + event: 'Purchase', + properties: { + Revenue: 'name1', + }, + }, + metadata: { + jobId: 3, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'lookupField', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot@email.com', + firstname: 'Test Hubspot22', + anonymousId: '4444', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 4, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + message: { + channel: 'web', + context: { + app: { + build: '1.0.0', + name: 'RudderLabs JavaScript SDK', + namespace: 'com.rudderlabs.javascript', + version: '1.0.0', + }, + traits: { + email: 'testhubspot@email.com', + firstname: 'Test Hubspot44', + anonymousId: '4444', + }, + library: { + name: 'RudderLabs JavaScript SDK', + version: '1.0.0', + }, + userAgent: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', + locale: 'en-GB', + ip: '0.0.0.0', + os: { + name: '', + version: '', + }, + screen: { + density: 2, + }, + page: { + path: '', + referrer: '', + search: '', + title: '', + url: '', + }, + }, + type: 'identify', + messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5', + originalTimestamp: '2019-10-15T09:35:31.288Z', + anonymousId: '00000000000000000000000000', + userId: '12345', + integrations: { + All: true, + }, + sentAt: '2019-10-14T09:03:22.563Z', + }, + metadata: { + jobId: 5, + }, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + destType: 'hs', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/crm/v3/objects/contacts/batch/create', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + inputs: [ + { + properties: { + email: 'noname@email.com', + firstname: 'Test Hubspot44', + }, + }, + { + properties: { + email: 'testhubspot@email.com', + firstname: 'Test Hubspot44', + }, + }, + ], + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 1, + }, + { + jobId: 2, + }, + { + jobId: 4, + }, + { + jobId: 5, + }, + ], + batched: true, + statusCode: 200, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + { + batchedRequest: { + version: '1', + type: 'REST', + method: 'POST', + endpoint: 'https://api.hubapi.com/events/v3/send', + headers: { + 'Content-Type': 'application/json', + Authorization: 'Bearer dummy-access-token', + }, + params: {}, + body: { + JSON: { + email: 'osvaldocostaferreira98@gmail.com', + eventName: 'pedummy-hubId_rs_hub_test', + properties: { + value: 'name1', + }, + }, + JSON_ARRAY: {}, + XML: {}, + FORM: {}, + }, + files: {}, + }, + metadata: [ + { + jobId: 3, + }, + ], + batched: false, + statusCode: 200, + destination: { + Config: { + authorizationType: 'newPrivateAppApi', + accessToken: 'dummy-access-token', + hubID: 'dummy-hubId', + apiKey: 'dummy-apikey', + apiVersion: 'newApi', + lookupField: 'email', + hubspotEvents: [ + { + rsEventName: 'Purchase', + hubspotEventName: 'pedummy-hubId_rs_hub_test', + eventProperties: [ + { + from: 'Revenue', + to: 'value', + }, + { + from: 'Price', + to: 'cost', + }, + ], + }, + { + rsEventName: 'Order Complete', + hubspotEventName: 'pedummy-hubId_rs_hub_chair', + eventProperties: [ + { + from: 'firstName', + to: 'first_name', + }, + { + from: 'lastName', + to: 'last_name', + }, + ], + }, + ], + eventFilteringOption: 'disable', + blacklistedEvents: [ + { + eventName: '', + }, + ], + whitelistedEvents: [ + { + eventName: '', + }, + ], + }, + secretConfig: {}, + ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe', + name: 'Hubspot', + enabled: true, + workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd', + deleted: false, + createdAt: '2020-12-30T08:39:32.005Z', + updatedAt: '2021-02-03T16:22:31.374Z', + destinationDefinition: { + id: '1aIXqM806xAVm92nx07YwKbRrO9', + name: 'HS', + displayName: 'Hubspot', + createdAt: '2020-04-09T09:24:31.794Z', + updatedAt: '2021-01-11T11:03:28.103Z', + }, + transformations: [], + isConnectionEnabled: true, + isProcessorEnabled: true, + }, + }, + ], + }, + }, + }, + }, +]; diff --git a/test/integrations/destinations/marketo_bulk_upload/processor/data.ts b/test/integrations/destinations/marketo_bulk_upload/processor/data.ts new file mode 100644 index 0000000000..5c86afd372 --- /dev/null +++ b/test/integrations/destinations/marketo_bulk_upload/processor/data.ts @@ -0,0 +1,499 @@ +export const data = [ + { + "name": "marketo_bulk_upload", + "description": "Test 0", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "identify", + "traits": { + "name": "Carlo Lombard", + "plan": "Quarterly Team+ Plan for Enuffsaid Media", + "email": "carlo@enuffsaid.media" + }, + "userId": 476335, + "context": { + "ip": "14.0.2.238", + "page": { + "url": "enuffsaid.proposify.com", + "path": "/settings", + "method": "POST", + "referrer": "https://enuffsaid.proposify.com/login" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "786dfec9-jfh", + "messageId": "5d9bc6e2-ekjh" + }, + "destination": { + "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", + "Config": { + "munchkinId": "XXXX", + "clientId": "YYYY", + "clientSecret": "ZZZZ", + "columnFieldsMapping": [ + { + "to": "name__c", + "from": "name" + }, + { + "to": "email__c", + "from": "email" + }, + { + "to": "plan__c", + "from": "plan" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "/fileUpload", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "name__c": "Carlo Lombard", + "email__c": "carlo@enuffsaid.media", + "plan__c": "Quarterly Team+ Plan for Enuffsaid Media" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "marketo_bulk_upload", + "description": "Test 1", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "traits": { + "name": "Carlo Lombard", + "plan": "Quarterly Team+ Plan for Enuffsaid Media", + "email": "carlo@enuffsaid.media" + }, + "userId": 476335, + "context": { + "ip": "14.0.2.238", + "page": { + "url": "enuffsaid.proposify.com", + "path": "/settings", + "method": "POST", + "referrer": "https://enuffsaid.proposify.com/login" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "786dfec9-jfh", + "messageId": "5d9bc6e2-ekjh" + }, + "destination": { + "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", + "Config": { + "munchkinId": "XXXX", + "clientId": "YYYY", + "clientSecret": "ZZZZ", + "columnFieldsMapping": [ + { + "to": "name__c", + "from": "name" + }, + { + "to": "email__c", + "from": "email" + }, + { + "to": "plan__c", + "from": "plan" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Event type is required", + "statTags": { + "destType": "MARKETO_BULK_UPLOAD", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "marketo_bulk_upload", + "description": "Test 2", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "track", + "traits": { + "name": "Carlo Lombard", + "plan": "Quarterly Team+ Plan for Enuffsaid Media", + "email": "carlo@enuffsaid.media" + }, + "userId": 476335, + "context": { + "ip": "14.0.2.238", + "page": { + "url": "enuffsaid.proposify.com", + "path": "/settings", + "method": "POST", + "referrer": "https://enuffsaid.proposify.com/login" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "786dfec9-jfh", + "messageId": "5d9bc6e2-ekjh" + }, + "destination": { + "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", + "Config": { + "munchkinId": "XXXX", + "clientId": "YYYY", + "clientSecret": "ZZZZ", + "columnFieldsMapping": [ + { + "to": "name__c", + "from": "name" + }, + { + "to": "email__c", + "from": "email" + }, + { + "to": "plan__c", + "from": "plan" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Event type track is not supported", + "statTags": { + "destType": "MARKETO_BULK_UPLOAD", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "marketo_bulk_upload", + "description": "Test 3", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "identify", + "traits": { + "name": "Carlo Lombard", + "plan": "Quarterly Team+ Plan for Enuffsaid Media", + "email": "carlo@enuffsaid.media" + }, + "userId": 476335, + "context": { + "ip": "14.0.2.238", + "page": { + "url": "enuffsaid.proposify.com", + "path": "/settings", + "method": "POST", + "referrer": "https://enuffsaid.proposify.com/login" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "786dfec9-jfh", + "messageId": "5d9bc6e2-ekjh" + }, + "destination": { + "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", + "Config": { + "munchkinId": "XXXX", + "clientId": "YYYY", + "clientSecret": "ZZZZ", + "columnFieldsMapping": [ + { + "to": "name__c", + "from": "1" + }, + { + "to": "email__c", + "from": "email1" + }, + { + "to": "plan__c", + "from": "plan1" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "/fileUpload", + "headers": {}, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "marketo_bulk_upload", + "description": "Test 4", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "identify", + "traits": { + "name": "Carlo Lombard", + "plan": "Quarterly Team+ Plan for Enuffsaid Media", + "email": "carlo@enuffsaid.media" + }, + "userId": 476335, + "context": { + "ip": "14.0.2.238", + "page": { + "url": "enuffsaid.proposify.com", + "path": "/settings", + "method": "POST", + "referrer": "https://enuffsaid.proposify.com/login" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "786dfec9-jfh", + "messageId": "5d9bc6e2-ekjh" + }, + "destination": { + "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", + "Config": { + "munchkinId": "XXXX", + "clientId": "YYYY", + "clientSecret": "ZZZZ", + "columnFieldsMapping": [ + { + "to": "name__c", + "from": "name" + }, + { + "to": "email__c", + "from": "email1" + }, + { + "to": "plan__c", + "from": "plan1" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "/fileUpload", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "name__c": "Carlo Lombard" + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "marketo_bulk_upload", + "description": "Test 5", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "message": { + "type": "identify", + "traits": { + "name": "Carlo Lombard", + "plan": 1 + }, + "userId": 476335, + "context": { + "ip": "14.0.2.238", + "page": { + "url": "enuffsaid.proposify.com", + "path": "/settings", + "method": "POST", + "referrer": "https://enuffsaid.proposify.com/login" + }, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "786dfec9-jfh", + "messageId": "5d9bc6e2-ekjh" + }, + "destination": { + "ID": "1mMy5cqbtfuaKZv1IhVQKnBdVwe", + "Config": { + "munchkinId": "XXXX", + "clientId": "YYYY", + "clientSecret": "ZZZZ", + "columnFieldsMapping": [ + { + "to": "name__c", + "from": "name" + }, + { + "to": "email__c", + "from": "email" + }, + { + "to": "plan__c", + "from": "plan" + } + ] + } + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "/fileUpload", + "headers": {}, + "params": {}, + "body": { + "JSON": { + "name__c": "Carlo Lombard", + "plan__c": 1 + }, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": {} + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/wootric/network.ts b/test/integrations/destinations/wootric/network.ts new file mode 100644 index 0000000000..2407efa62b --- /dev/null +++ b/test/integrations/destinations/wootric/network.ts @@ -0,0 +1,183 @@ +export const networkCallsData = [ + { + httpReq: { + url: 'https://api.wootric.com/v1/end_users/dummyId1?lookup_by_external_id=true', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + "id": 486438462, + "created_at": "2022-08-10 11:39:50 -0700", + "updated_at": "2022-08-10 11:39:50 -0700", + "email": "dummyuser1@gmail.com", + "last_surveyed": "2022-01-20 05:39:21 -0800", + "external_created_at": 1611149961, + "last_seen_at": null, + "properties": { + "city": "Mumbai", + "name": "Dummy User 1", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack" + }, + "phone_number": "+19123456789", + "external_id": "dummyId1", + "last_response": null, + "settings": { + "email_nps": true, + "mobile_nps": true, + "web_nps": true, + "force_mobile_survey": null, + "force_web_survey": null, + "surveys_disabled_by_end_user": null + } + }, + }, + }, + { + httpReq: { + url: 'https://api.wootric.com/v1/end_users/exclueFunTestId?lookup_by_external_id=true', + method: 'GET', + }, + httpRes: { + status: 200, + data: { + "id": 486336190, + "created_at": "2022-08-10 07:30:50 -0700", + "updated_at": "2022-08-10 10:12:46 -0700", + "email": "excludeUser@gmail.com", + "last_surveyed": "2022-01-20 05:39:21 -0800", + "external_created_at": 1579755367, + "last_seen_at": null, + "properties": { + "city": "Mumbai", + "name": "exclude test user", + "email": "excludeUser@gmail.com", + "title": "AD", + "gender": "Male", + "company": "Rockstar" + }, + "phone_number": "+18324671283", + "external_id": "exclueFunTestId", + "last_response": null, + "settings": { + "email_nps": true, + "mobile_nps": true, + "web_nps": true, + "force_mobile_survey": null, + "force_web_survey": null, + "surveys_disabled_by_end_user": null + } + }, + }, + }, + { + httpReq: { + url: 'https://api.wootric.com/v1/end_users/my-external-id-1234?lookup_by_external_id=true', + method: 'POST', + + }, + httpRes: { + status: 200, + data: { + "type": "error_list", + "errors": [ + { + "status": "record_not_found", + "message": "The record could not be found", + "field": null + } + ] + } + }, + }, + { + httpReq: { + url: 'https://api.wootric.com/v1/end_users/490635419', + method: 'GET' + }, + httpRes: { + data: { + "id": 490635419, + "created_at": "2022-08-20 00:55:26 -0700", + "updated_at": "2022-08-22 11:17:05 -0700", + "email": "firstuser@gmail.com", + "last_surveyed": "2022-08-01 00:11:44 -0700", + "external_created_at": 1661002761, + "last_seen_at": null, + "properties": { + "Department": "Marketing", + "product_plan": "Web", + "revenue amount": "5000" + }, + "phone_number": "+8859133456781", + "external_id": "firstUserId123", + "last_response": { + "id": 101013218, + "score": 9, + "text": "Good !!!", + "survey": { + "channel": "web" + } + }, + "settings": { + "email_nps": true, + "mobile_nps": true, + "web_nps": true, + "force_mobile_survey": null, + "force_web_survey": null, + "surveys_disabled_by_end_user": null + } + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.wootric.com/oauth/token?account_token=NPS-dummyToken', + method: 'POST' + }, + httpRes: { + data: { + "access_token": "2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c", + "token_type": "Bearer", + "expires_in": 7200, + "refresh_token": "f4033a61742e84405a5ef8b2e09b82395dc041f0259fd5fb715fc196a1b9cd52", + "scope": "delete_account admin respond export read survey invalidate_response", + "created_at": 1660292389 + }, + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.wootric.com/v1/end_users/dummyId2?lookup_by_external_id=true', + method: 'GET' + }, + httpRes: { + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.wootric.com/v1/end_users/12345', + method: 'GET' + }, + httpRes: { + status: 200, + }, + }, + { + httpReq: { + url: 'https://api.wootric.com/oauth/token?account_token=NPS-dummyToken12', + method: 'POST' + }, + httpRes: { + data: { + error: "Not found", + status: 404 + } + }, + } +]; diff --git a/test/integrations/destinations/wootric/processor/data.ts b/test/integrations/destinations/wootric/processor/data.ts new file mode 100644 index 0000000000..cdff2f1079 --- /dev/null +++ b/test/integrations/destinations/wootric/processor/data.ts @@ -0,0 +1,1825 @@ +export const data = [ + { + "name": "wootric", + "description": "Wrong Account Token Passed", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken12" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": {}, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "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}}", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "network", + "errorType": "retryable", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 500 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for creating user", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Bangalore", + "name": "Dummy User 2", + "email": "dummyUser2@gmail.com", + "phone": "+19123456777", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "email": "dummyUser2@gmail.com", + "phone_number": "+19123456777", + "last_surveyed": "1642685961", + "external_created_at": "1611149961", + "external_id": "dummyId2", + "properties[city]": "Bangalore", + "properties[name]": "Dummy User 2", + "properties[title]": "SDE", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for creating user without-sending email and sending phone number", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Bangalore", + "name": "Dummy User 2", + "phone": "+19123456777", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "phone_number": "+19123456777", + "last_surveyed": "1642685961", + "external_created_at": "1611149961", + "external_id": "dummyId2", + "properties[city]": "Bangalore", + "properties[name]": "Dummy User 2", + "properties[title]": "SDE", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for creating user without-sending phone number and sending email", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "email": "dummyUser2@gmail.com", + "city": "Bangalore", + "name": "Dummy User 2", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "email": "dummyUser2@gmail.com", + "last_surveyed": "1642685961", + "external_created_at": "1611149961", + "external_id": "dummyId2", + "properties[city]": "Bangalore", + "properties[name]": "Dummy User 2", + "properties[title]": "SDE", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for creating user without sending traits", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "email/phone number are missing. At least one parameter must be provided", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for creating user without-sending (email and phone number)", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "email/phone number are missing. At least one parameter must be provided", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for updating existing user with wootric end user id", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "title": "VP", + "gender": "Male" + }, + "externalId": [ + { + "type": "wootricEndUserId", + "id": "490635419" + } + ], + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.wootric.com/v1/end_users/490635419", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "last_surveyed": "1642685961", + "properties[Department]": "Marketing", + "properties[product_plan]": "Web", + "properties[revenue amount]": "5000", + "properties[title]": "VP", + "properties[gender]": "Male" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for updating existing user with (wootric externalId/ rudderstack userId)", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "title": "VP", + "gender": "Male" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.wootric.com/v1/end_users/486438462", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "last_surveyed": "1642685961", + "properties[title]": "VP", + "properties[gender]": "Male", + "properties[city]": "Mumbai", + "properties[name]": "Dummy User 1", + "properties[company]": "Rudderstack" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Identify call for updating user traits/properties", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Udaipur", + "name": "Dummy User 1 New", + "title": "SDE-2", + "gender": "Male", + "company": "Rudderstack" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.wootric.com/v1/end_users/486438462", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "last_surveyed": "1642685961", + "properties[city]": "Udaipur", + "properties[name]": "Dummy User 1 New", + "properties[title]": "SDE-2", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with existing userId and event type as create response", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 7, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "email": "dummyUser1@gmail.com", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create response" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users/486438462/responses", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "score": 7, + "ip_address": "0.0.0.0", + "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "text": "Simple, Easy to use, Reliable, Affordable Product", + "created_at": "1611149961", + "end_user[properties][city]": "Mumbai", + "end_user[properties][name]": "Dummy User 1", + "end_user[properties][title]": "SDE", + "end_user[properties][gender]": "Male", + "end_user[properties][company]": "Rudderstack" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with non-existing userId", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "properties": { + "feedbackScore": 7, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create response" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "No user found with userId : dummyId2", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with non-existing wootricEndUserId", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "channel": "web", + "properties": { + "feedbackScore": 7, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "externalId": [ + { + "type": "wootricEndUserId", + "id": "12345" + } + ], + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create response" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "No user found with wootric end user Id : 12345", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with existing userId and event type as create response and score out of bound", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 12, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create response" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Invalid Score", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with existing userId and event type as create decline", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 9, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create decline" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "output": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users/486438462/declines", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html" + } + }, + "files": {}, + "userId": "" + }, + "statusCode": 200 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with non-existing userId and event type as create decline", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "properties": { + "feedbackScore": 9, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create decline" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "No user found with userId : dummyId2", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with event type other than create response or decline", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 7, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "email": "dummyUser1@gmail.com", + "phone": "+19123456789", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "random" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Event Type not supported", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + }, + { + "name": "wootric", + "description": "Track call with missing event type in integration object", + "feature": "processor", + "module": "destination", + "version": "v0", + "input": { + "request": { + "body": [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "wootric-1234" + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 3, + "feedbackText": "Too Slow!!!" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "email": "dummyUser1@gmail.com", + "phone": "+19123456789", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + } + }, + "output": { + "response": { + "status": 200, + "body": [ + { + "error": "Event Type is missing from Integration object", + "statTags": { + "destType": "WOOTRIC", + "errorCategory": "dataValidation", + "errorType": "instrumentation", + "feature": "processor", + "implementation": "native", + "module": "destination" + }, + "statusCode": 400 + } + ] + } + } + } +] \ No newline at end of file diff --git a/test/integrations/destinations/wootric/router/data.ts b/test/integrations/destinations/wootric/router/data.ts new file mode 100644 index 0000000000..724ba176f2 --- /dev/null +++ b/test/integrations/destinations/wootric/router/data.ts @@ -0,0 +1,1622 @@ +export const data = [ + { + name: 'wootric', + description: 'Succesfull Idenitfy Call', + feature: 'router', + module: 'destination', + version: 'v0', + input: { + request: { + body: { + input: [ + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 1 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Bangalore", + "name": "Dummy User 2", + "email": "dummyUser2@gmail.com", + "phone": "+19123456777", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 2 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Bangalore", + "name": "Dummy User 2", + "phone": "+19123456777", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 3 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "email": "dummyUser2@gmail.com", + "city": "Bangalore", + "name": "Dummy User 2", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 5 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 6 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 7 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "email": "dummyuser1_01@gmail.com" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 8 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "phone": "+19777777778" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 9 + }, + "message": { + "type": "identify", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Udaipur", + "name": "Dummy User 1 New", + "title": "SDE-2", + "gender": "Male", + "company": "Rudderstack" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 10 + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 7, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "email": "dummyUser1@gmail.com", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create response" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 11 + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "properties": { + "feedbackScore": 7, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create response" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 12 + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 12, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create response" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 13 + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 9, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create decline" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 14 + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId2", + "channel": "web", + "properties": { + "feedbackScore": 9, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "create decline" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 15 + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 7, + "feedbackText": "Simple, Easy to use, Reliable, Affordable Product" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "email": "dummyUser1@gmail.com", + "phone": "+19123456789", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true, + "Wootric": { + "eventType": "random" + } + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": { + "jobId": 16 + }, + "message": { + "type": "track", + "sentAt": "2022-01-20T13:39:21.033Z", + "userId": "dummyId1", + "channel": "web", + "properties": { + "feedbackScore": 3, + "feedbackText": "Too Slow!!!" + }, + "context": { + "os": { + "name": "", + "version": "" + }, + "app": { + "name": "RudderLabs JavaScript SDK", + "build": "1.0.0", + "version": "1.2.20", + "namespace": "com.rudderlabs.javascript" + }, + "page": { + "url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "path": "/Testing/App_for_LaunchDarkly/ourSdk.html", + "title": "Document", + "search": "", + "tab_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "referrer": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/", + "initial_referrer": "$direct", + "referring_domain": "127.0.0.1:7307", + "initial_referring_domain": "" + }, + "locale": "en-US", + "ip": "0.0.0.0", + "screen": { + "width": 1440, + "height": 900, + "density": 2, + "innerWidth": 536, + "innerHeight": 689 + }, + "traits": { + "city": "Mumbai", + "name": "Dummy User 1", + "email": "dummyUser1@gmail.com", + "phone": "+19123456789", + "title": "SDE", + "gender": "Male", + "company": "Rudderstack", + "createdAt": "2021-01-20T13:39:21.032Z" + }, + "library": { + "name": "RudderLabs JavaScript SDK", + "version": "1.2.20" + }, + "campaign": {}, + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" + }, + "rudderId": "553b5522-c575-40a7-8072-9741c5f9a647", + "messageId": "831f1fa5-de84-4f22-880a-4c3f23fc3f04", + "anonymousId": "bf412108-0357-4330-b119-7305e767823c", + "integrations": { + "All": true + }, + "originalTimestamp": "2022-01-20T13:39:21.032Z" + } + } + ] + , + destType: 'wootric', + }, + method: 'POST', + }, + }, + output: { + response: { + status: 200, + body: { + output: [ + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "email": "dummyUser2@gmail.com", + "phone_number": "+19123456777", + "last_surveyed": "1642685961", + "external_created_at": "1611149961", + "external_id": "dummyId2", + "properties[city]": "Bangalore", + "properties[name]": "Dummy User 2", + "properties[title]": "SDE", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 1 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "phone_number": "+19123456777", + "last_surveyed": "1642685961", + "external_created_at": "1611149961", + "external_id": "dummyId2", + "properties[city]": "Bangalore", + "properties[name]": "Dummy User 2", + "properties[title]": "SDE", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 2 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "email": "dummyUser2@gmail.com", + "last_surveyed": "1642685961", + "external_created_at": "1611149961", + "external_id": "dummyId2", + "properties[city]": "Bangalore", + "properties[name]": "Dummy User 2", + "properties[title]": "SDE", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 3 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": [ + { + "jobId": 5 + } + ], + "batched": false, + "statusCode": 400, + "error": "email/phone number are missing. At least one parameter must be provided", + "statTags": { + "destType": "WOOTRIC", + "feature": "router", + "implementation": "native", + "module": "destination", + "errorCategory": "dataValidation", + "errorType": "instrumentation" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": [ + { + "jobId": 6 + } + ], + "batched": false, + "statusCode": 400, + "error": "email/phone number are missing. At least one parameter must be provided", + "statTags": { + "destType": "WOOTRIC", + "feature": "router", + "implementation": "native", + "module": "destination", + "errorCategory": "dataValidation", + "errorType": "instrumentation" + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.wootric.com/v1/end_users/486438462", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "email": "dummyuser1_01@gmail.com", + "last_surveyed": "1642685961" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 7 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.wootric.com/v1/end_users/486438462", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "phone_number": "+19777777778", + "last_surveyed": "1642685961" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 8 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "PUT", + "endpoint": "https://api.wootric.com/v1/end_users/486438462", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "last_surveyed": "1642685961", + "properties[city]": "Udaipur", + "properties[name]": "Dummy User 1 New", + "properties[title]": "SDE-2", + "properties[gender]": "Male", + "properties[company]": "Rudderstack" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 9 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users/486438462/responses", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "score": 7, + "ip_address": "0.0.0.0", + "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html", + "text": "Simple, Easy to use, Reliable, Affordable Product", + "created_at": "1611149961", + "end_user[properties][city]": "Mumbai", + "end_user[properties][name]": "Dummy User 1", + "end_user[properties][title]": "SDE", + "end_user[properties][gender]": "Male", + "end_user[properties][company]": "Rudderstack" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 10 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "metadata": [ + { + "jobId": 11 + } + ], + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "batched": false, + "statusCode": 400, + "error": "No user found with userId : dummyId2", + "statTags": { + "destType": "WOOTRIC", + "feature": "router", + "implementation": "native", + "module": "destination", + "errorCategory": "dataValidation", + "errorType": "instrumentation" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": [ + { + "jobId": 12 + } + ], + "batched": false, + "statusCode": 400, + "error": "Invalid Score", + "statTags": { + "destType": "WOOTRIC", + "feature": "router", + "implementation": "native", + "module": "destination", + "errorCategory": "dataValidation", + "errorType": "instrumentation" + } + }, + { + "batchedRequest": { + "version": "1", + "type": "REST", + "method": "POST", + "endpoint": "https://api.wootric.com/v1/end_users/486438462/declines", + "headers": { + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": "Bearer 2fe581c1c72851e73d60f4191f720be93e5d3e8a6147e37c4e8e852b1a8f506c" + }, + "params": {}, + "body": { + "JSON": {}, + "JSON_ARRAY": {}, + "XML": {}, + "FORM": { + "origin_url": "http://127.0.0.1:7307/Testing/App_for_LaunchDarkly/ourSdk.html" + } + }, + "files": {} + }, + "metadata": [ + { + "jobId": 13 + } + ], + "batched": false, + "statusCode": 200, + "destination": { + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG", + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + } + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": [ + { + "jobId": 14 + } + ], + "batched": false, + "statusCode": 400, + "error": "No user found with userId : dummyId2", + "statTags": { + "destType": "WOOTRIC", + "feature": "router", + "implementation": "native", + "module": "destination", + "errorCategory": "dataValidation", + "errorType": "instrumentation" + } + }, + { + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "metadata": [ + { + "jobId": 15 + } + ], + "batched": false, + "statusCode": 400, + "error": "Event Type not supported", + "statTags": { + "destType": "WOOTRIC", + "feature": "router", + "implementation": "native", + "module": "destination", + "errorCategory": "dataValidation", + "errorType": "instrumentation" + } + }, + { + "metadata": [ + { + "jobId": 16 + } + ], + "destination": { + "Config": { + "username": "wootricfakeuser@example.com", + "password": "password@123", + "accountToken": "NPS-dummyToken" + }, + "ID": "2D7TqLto9tnkBuR1ciMrbiA4cbG" + }, + "batched": false, + "statusCode": 400, + "error": "Event Type is missing from Integration object", + "statTags": { + "destType": "WOOTRIC", + "feature": "router", + "implementation": "native", + "module": "destination", + "errorCategory": "dataValidation", + "errorType": "instrumentation" + } + } + ], + }, + }, + }, + } +];