' },
DestinationDefinition: {
DisplayName: 'Heap.io',
ID: '1WTbl0l5GjOQKOvfmcGwk0T49kV',
@@ -790,11 +594,7 @@ export const data = [
Name: 'heap test',
Transformations: [],
},
- metadata: [
- {
- jobId: 5,
- },
- ],
+ metadata: [{ jobId: 5, userId: 'u1' }],
batched: false,
statusCode: 400,
error: 'message type page not supported for heap',
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..3a30232f9f
--- /dev/null
+++ b/test/integrations/destinations/hs/router/data.ts
@@ -0,0 +1,1691 @@
+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, userId: 'u1' },
+ },
+ ],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ { jobId: 1, userId: 'u1' },
+ { jobId: 4, userId: 'u1' },
+ ],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' },
+ },
+ {
+ 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, userId: 'u1' },
+ },
+ ],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' },
+ },
+ {
+ 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, userId: 'u1' },
+ },
+ {
+ 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, userId: 'u1' },
+ },
+ ],
+ 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, userId: 'u1' },
+ { jobId: 4, userId: 'u1' },
+ ],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ { jobId: 2, userId: 'u1' },
+ { jobId: 4, userId: 'u1' },
+ { jobId: 5, userId: 'u1' },
+ ],
+ 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, userId: 'u1' }],
+ 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/impact/router/data.ts b/test/integrations/destinations/impact/router/data.ts
index 1e9cd9cc6e..e9120ae03d 100644
--- a/test/integrations/destinations/impact/router/data.ts
+++ b/test/integrations/destinations/impact/router/data.ts
@@ -18,18 +18,8 @@ export const data = [
impactAppId: '2323',
eventTypeId: '56446',
enableEmailHashing: true,
- rudderToImpactProperty: [
- {
- from: 'profit',
- to: 'Money1',
- },
- ],
- productsMapping: [
- {
- from: 'sku',
- to: 'ItemSku',
- },
- ],
+ rudderToImpactProperty: [{ from: 'profit', to: 'Money1' }],
+ productsMapping: [{ from: 'sku', to: 'ItemSku' }],
enableIdentifyEvents: true,
enablePageEvents: false,
enableScreenEvents: false,
@@ -37,40 +27,24 @@ export const data = [
installEventNames: [{ eventName: 'App Installed' }],
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
type: 'identify',
sentAt: '2021-01-03T17:02:53.195Z',
userId: 'user123',
channel: 'web',
context: {
- os: {
- name: 'android',
- version: '1.12.3',
- },
+ os: { name: 'android', version: '1.12.3' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
version: '1.1.11',
namespace: 'com.rudderlabs.javascript',
},
- traits: {
- email: 'user123@email.com',
- phone: '+917836362334',
- userId: 'user123',
- },
+ traits: { email: 'user123@email.com', phone: '+917836362334', userId: 'user123' },
locale: 'en-US',
- device: {
- token: 'token',
- id: 'id',
- type: 'ios',
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ device: { token: 'token', id: 'id', type: 'ios' },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
},
@@ -103,10 +77,7 @@ export const data = [
],
},
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -114,13 +85,8 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
},
locale: 'en-US',
- screen: {
- density: 2,
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
@@ -130,9 +96,7 @@ export const data = [
anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
originalTimestamp: 'NOW',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
accountSID: 'dfsgertrtff3erfc34rfwf',
@@ -141,18 +105,8 @@ export const data = [
impactAppId: '2323',
eventTypeId: '56446',
enableEmailHashing: true,
- rudderToImpactProperty: [
- {
- from: 'properties.profit',
- to: 'Money1',
- },
- ],
- productsMapping: [
- {
- from: 'variant',
- to: 'ItemCategory',
- },
- ],
+ rudderToImpactProperty: [{ from: 'properties.profit', to: 'Money1' }],
+ productsMapping: [{ from: 'variant', to: 'ItemCategory' }],
enableIdentifyEvents: false,
enablePageEvents: false,
enableScreenEvents: false,
@@ -208,11 +162,7 @@ export const data = [
version: '1',
endpoint: 'https://trkapi.impact.com/PageLoad',
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -223,18 +173,8 @@ export const data = [
impactAppId: '2323',
eventTypeId: '56446',
enableEmailHashing: true,
- rudderToImpactProperty: [
- {
- from: 'profit',
- to: 'Money1',
- },
- ],
- productsMapping: [
- {
- from: 'sku',
- to: 'ItemSku',
- },
- ],
+ rudderToImpactProperty: [{ from: 'profit', to: 'Money1' }],
+ productsMapping: [{ from: 'sku', to: 'ItemSku' }],
enableIdentifyEvents: true,
enablePageEvents: false,
enableScreenEvents: false,
@@ -287,11 +227,7 @@ export const data = [
endpoint: 'https://api.impact.com/Advertisers/dfsgertrtff3erfc34rfwf/Conversions',
},
],
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -302,18 +238,8 @@ export const data = [
impactAppId: '2323',
eventTypeId: '56446',
enableEmailHashing: true,
- rudderToImpactProperty: [
- {
- from: 'properties.profit',
- to: 'Money1',
- },
- ],
- productsMapping: [
- {
- from: 'variant',
- to: 'ItemCategory',
- },
- ],
+ rudderToImpactProperty: [{ from: 'properties.profit', to: 'Money1' }],
+ productsMapping: [{ from: 'variant', to: 'ItemCategory' }],
enableIdentifyEvents: false,
enablePageEvents: false,
enableScreenEvents: false,
diff --git a/test/integrations/destinations/indicative/router/data.ts b/test/integrations/destinations/indicative/router/data.ts
index 037d5d5c3d..88e0665e62 100644
--- a/test/integrations/destinations/indicative/router/data.ts
+++ b/test/integrations/destinations/indicative/router/data.ts
@@ -10,14 +10,8 @@ export const data = [
body: {
input: [
{
- destination: {
- Config: {
- apiKey: 'abcde',
- },
- },
- metadata: {
- jobId: 2,
- },
+ destination: { Config: { apiKey: 'abcde' } },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
@@ -27,25 +21,15 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: {
- AM: true,
- },
+ integrations: { AM: true },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -90,14 +74,8 @@ export const data = [
},
},
{
- destination: {
- Config: {
- apiKey: 'abcde',
- },
- },
- metadata: {
- jobId: 2,
- },
+ destination: { Config: { apiKey: 'abcde' } },
+ metadata: { jobId: 3, userId: 'u1' },
message: {
channel: 'web',
context: {
@@ -107,21 +85,13 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
locale: 'en-US',
ip: '0.0.0.0',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
},
messageId: '84e26acc-56a5-4835-8233-591137fca468',
session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
@@ -140,9 +110,7 @@ export const data = [
street: '',
},
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
sentAt: '2019-10-14T09:03:22.563Z',
},
},
@@ -220,18 +188,10 @@ export const data = [
userId: 'test_user_id',
},
],
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
- destination: {
- Config: {
- apiKey: 'abcde',
- },
- },
+ destination: { Config: { apiKey: 'abcde' } },
},
{
batchedRequest: [
@@ -280,11 +240,7 @@ export const data = [
},
params: {},
body: {
- JSON: {
- previousId: 'anon_id',
- newId: '123456',
- apiKey: 'abcde',
- },
+ JSON: { previousId: 'anon_id', newId: '123456', apiKey: 'abcde' },
XML: {},
JSON_ARRAY: {},
FORM: {},
@@ -293,18 +249,10 @@ export const data = [
userId: '123456',
},
],
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
statusCode: 200,
- destination: {
- Config: {
- apiKey: 'abcde',
- },
- },
+ destination: { Config: { apiKey: 'abcde' } },
},
],
},
diff --git a/test/integrations/destinations/intercom/dataDelivery/data.ts b/test/integrations/destinations/intercom/dataDelivery/data.ts
index 23bcdc6af2..6b0077ae0f 100644
--- a/test/integrations/destinations/intercom/dataDelivery/data.ts
+++ b/test/integrations/destinations/intercom/dataDelivery/data.ts
@@ -87,4 +87,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/intercom/processor/data.ts b/test/integrations/destinations/intercom/processor/data.ts
new file mode 100644
index 0000000000..14d1884ba2
--- /dev/null
+++ b/test/integrations/destinations/intercom/processor/data.ts
@@ -0,0 +1,2311 @@
+export const data = [
+ {
+ name: 'intercom',
+ description: 'Test 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ userId: 'test_user_id_1',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ address: {
+ city: 'Kolkata',
+ state: 'West Bengal',
+ },
+ originalArray: [
+ {
+ nested_field: 'nested value',
+ tags: ['tag_1', 'tag_2', 'tag_3'],
+ },
+ {
+ nested_field: 'nested value',
+ tags: ['tag_1'],
+ },
+ {
+ nested_field: 'nested value',
+ },
+ ],
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ user_id: 'test_user_id_1',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ name: 'Test Name',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ 'address.city': 'Kolkata',
+ 'address.state': 'West Bengal',
+ 'originalArray[0].nested_field': 'nested value',
+ 'originalArray[0].tags[0]': 'tag_1',
+ 'originalArray[0].tags[1]': 'tag_2',
+ 'originalArray[0].tags[2]': 'tag_3',
+ 'originalArray[1].nested_field': 'nested value',
+ 'originalArray[1].tags[0]': 'tag_1',
+ 'originalArray[2].nested_field': 'nested value',
+ },
+ update_last_request_at: true,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 1',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ update_last_request_at: true,
+ name: 'Test Name',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 2',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ update_last_request_at: true,
+ name: 'Name',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ firstName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ update_last_request_at: true,
+ name: 'Name',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 4: ERROR - Either of `email` or `userId` is required for Identify call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ firstName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Either of `email` or `userId` is required for Identify call',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'INTERCOM',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 5',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ company: {
+ name: 'Test Comp',
+ id: 'company_id',
+ industry: 'test industry',
+ key1: 'value1',
+ key2: {
+ a: 'a',
+ },
+ key3: [1, 2, 3],
+ },
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ update_last_request_at: true,
+ name: 'Name',
+ companies: [
+ {
+ company_id: 'company_id',
+ custom_attributes: {
+ key1: 'value1',
+ key2: '{"a":"a"}',
+ key3: '[1,2,3]',
+ },
+ name: 'Test Comp',
+ industry: 'test industry',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 6',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ company: {
+ name: 'Test Comp',
+ industry: 'test industry',
+ key1: 'value1',
+ key2: null,
+ key3: ['value1', 'value2'],
+ key4: {
+ foo: 'bar',
+ },
+ },
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ updateLastRequestAt: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ update_last_request_at: false,
+ name: 'Name',
+ companies: [
+ {
+ company_id: 'c0277b5c814453e5135f515f943d085a',
+ custom_attributes: {
+ key1: 'value1',
+ key3: '["value1","value2"]',
+ key4: '{"foo":"bar"}',
+ },
+ name: 'Test Comp',
+ industry: 'test industry',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 7',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ company: {
+ industry: 'test industry',
+ key1: 'value1',
+ key2: null,
+ },
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ update_last_request_at: true,
+ name: 'Name',
+ companies: [],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 8',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ userId: 'test_user_id_1',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ properties: {
+ property1: 1,
+ property2: 'test',
+ property3: true,
+ property4: '2020-10-05T09:09:03.731Z',
+ property5: {
+ property1: 1,
+ property2: 'test',
+ property3: {
+ subProp1: {
+ a: 'a',
+ b: 'b',
+ },
+ subProp2: ['a', 'b'],
+ },
+ },
+ properties6: null,
+ revenue: {
+ amount: 1232,
+ currency: 'inr',
+ test: 123,
+ },
+ price: {
+ amount: 3000,
+ currency: 'USD',
+ },
+ article: {
+ url: 'https://example.org/ab1de.html',
+ value: 'the dude abides',
+ },
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'track',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ user_id: 'test_user_id_1',
+ email: 'test_1@test.com',
+ event_name: 'Test Event 2',
+ created: 1601493061,
+ metadata: {
+ revenue: {
+ amount: 1232,
+ currency: 'inr',
+ test: 123,
+ },
+ price: {
+ amount: 3000,
+ currency: 'USD',
+ },
+ article: {
+ url: 'https://example.org/ab1de.html',
+ value: 'the dude abides',
+ },
+ property1: 1,
+ property2: 'test',
+ property3: true,
+ property4: '2020-10-05T09:09:03.731Z',
+ 'property5.property1': 1,
+ 'property5.property2': 'test',
+ 'property5.property3.subProp1.a': 'a',
+ 'property5.property3.subProp1.b': 'b',
+ 'property5.property3.subProp2[0]': 'a',
+ 'property5.property3.subProp2[1]': 'b',
+ properties6: null,
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 9',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'track',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ event_name: 'Test Event 2',
+ created: 1601493061,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 10: ERROR - Either of `email` or `userId` is required for Track call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'track',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Either of `email` or `userId` is required for Track call',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'INTERCOM',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 11',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ externalId: [
+ {
+ identifierType: 'email',
+ id: 'test@gmail.com',
+ },
+ ],
+ mappedToDestination: true,
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ phone: '9876543210',
+ key1: 'value1',
+ email: 'test@gmail.com',
+ update_last_request_at: true,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 12',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ sendAnonymousId: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ phone: '9876543210',
+ name: 'Test Name',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ user_id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ update_last_request_at: true,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 13: ERROR - Either of `email` or `userId` is required for Identify call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ sendAnonymousId: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Either of `email` or `userId` is required for Identify call',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'INTERCOM',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 14',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ groupId: 'test_company_id_wdasda',
+ traits: {
+ employees: 450,
+ plan: 'basic',
+ userId: 'sdfrsdfsdfsf',
+ email: 'test@test.com',
+ name: 'rudderUpdate',
+ size: '50',
+ industry: 'IT',
+ monthlySpend: '2131231',
+ remoteCreatedAt: '1683017572',
+ key1: 'val1',
+ },
+ anonymousId: 'sdfrsdfsdfsf',
+ integrations: {
+ All: true,
+ },
+ type: 'group',
+ userId: 'sdfrsdfsdfsf',
+ },
+ destination: {
+ Config: {
+ apiKey: 'abcd=',
+ appId: 'asdasdasd',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/companies',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer abcd=',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ company_id: 'test_company_id_wdasda',
+ name: 'rudderUpdate',
+ plan: 'basic',
+ size: 50,
+ industry: 'IT',
+ monthly_spend: 2131231,
+ remote_created_at: 1683017572,
+ custom_attributes: {
+ employees: 450,
+ email: 'test@test.com',
+ key1: 'val1',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'sdfrsdfsdfsf',
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer abcd=',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ user_id: 'sdfrsdfsdfsf',
+ companies: [
+ {
+ company_id: 'test_company_id_wdasda',
+ name: 'rudderUpdate',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'sdfrsdfsdfsf',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 15',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ groupId: 'test_company_id',
+ traits: {
+ plan: 'basic',
+ name: 'rudderUpdate',
+ size: 50,
+ industry: 'IT',
+ monthlySpend: '2131231',
+ email: 'comanyemail@abc.com',
+ },
+ anonymousId: '12312312',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: {
+ name: 'test-ios-library',
+ version: '1.0.7',
+ },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: {
+ name: 'iOS',
+ version: '14.0',
+ },
+ screen: {
+ density: 2,
+ height: 320,
+ width: 568,
+ },
+ timezone: 'Asia/Kolkata',
+ userAgent: 'unknown',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ type: 'group',
+ },
+ destination: {
+ Config: {
+ apiKey: 'abcd=',
+ appId: 'asdasdasd',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/companies',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer abcd=',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ company_id: 'test_company_id',
+ name: 'rudderUpdate',
+ plan: 'basic',
+ size: 50,
+ industry: 'IT',
+ monthly_spend: 2131231,
+ custom_attributes: {
+ email: 'comanyemail@abc.com',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '12312312',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 16',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ groupId: 'test_company_id_wdasda',
+ context: {
+ traits: {
+ email: 'testUser@test.com',
+ },
+ },
+ traits: {
+ employees: 450,
+ plan: 'basic',
+ email: 'test@test.com',
+ name: 'rudderUpdate',
+ size: '50',
+ industry: 'IT',
+ website: 'url',
+ monthlySpend: '2131231',
+ remoteCreatedAt: '1683017572',
+ key1: 'val1',
+ },
+ anonymousId: 'sdfrsdfsdfsf',
+ integrations: {
+ All: true,
+ },
+ type: 'group',
+ userId: 'sdfrsdfsdfsf',
+ },
+ destination: {
+ Config: {
+ apiKey: 'abcd=',
+ appId: 'asdasdasd',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/companies',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer abcd=',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ company_id: 'test_company_id_wdasda',
+ name: 'rudderUpdate',
+ plan: 'basic',
+ size: 50,
+ website: 'url',
+ industry: 'IT',
+ monthly_spend: 2131231,
+ remote_created_at: 1683017572,
+ custom_attributes: {
+ employees: 450,
+ email: 'test@test.com',
+ key1: 'val1',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'sdfrsdfsdfsf',
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer abcd=',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ user_id: 'sdfrsdfsdfsf',
+ email: 'testUser@test.com',
+ companies: [
+ {
+ company_id: 'test_company_id_wdasda',
+ name: 'rudderUpdate',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'sdfrsdfsdfsf',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'intercom',
+ description: 'Test 17',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ groupId: 'test_company_id_wdasda',
+ context: {
+ traits: {
+ email: 'testUser@test.com',
+ },
+ },
+ traits: {
+ employees: 450,
+ plan: 'basic',
+ email: 'test@test.com',
+ name: 'rudderUpdate',
+ size: '50',
+ industry: 'IT',
+ website: 'url',
+ monthlySpend: '2131231',
+ remoteCreatedAt: '1683017572',
+ key1: 'val1',
+ key2: {
+ a: 'a',
+ b: 'b',
+ },
+ key3: [1, 2, 3],
+ key4: null,
+ },
+ anonymousId: 'anonId',
+ integrations: {
+ All: true,
+ },
+ type: 'group',
+ },
+ destination: {
+ Config: {
+ apiKey: 'abcd=',
+ appId: 'asdasdasd',
+ collectContext: false,
+ sendAnonymousId: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/companies',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer abcd=',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ company_id: 'test_company_id_wdasda',
+ name: 'rudderUpdate',
+ plan: 'basic',
+ size: 50,
+ website: 'url',
+ industry: 'IT',
+ monthly_spend: 2131231,
+ remote_created_at: 1683017572,
+ custom_attributes: {
+ employees: 450,
+ email: 'test@test.com',
+ key1: 'val1',
+ 'key2.a': 'a',
+ 'key2.b': 'b',
+ 'key3[0]': 1,
+ 'key3[1]': 2,
+ 'key3[2]': 3,
+ key4: null,
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'anonId',
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer abcd=',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ user_id: 'anonId',
+ email: 'testUser@test.com',
+ companies: [
+ {
+ company_id: 'test_company_id_wdasda',
+ name: 'rudderUpdate',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'anonId',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/intercom/router/data.ts b/test/integrations/destinations/intercom/router/data.ts
new file mode 100644
index 0000000000..766161bac8
--- /dev/null
+++ b/test/integrations/destinations/intercom/router/data.ts
@@ -0,0 +1,236 @@
+export const data = [
+ {
+ name: 'intercom',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: { name: 'test-ios-library', version: '1.0.7' },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: { name: 'iOS', version: '14.0' },
+ screen: { density: 2, height: 320, width: 568 },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ name: 'Test Name',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ userId: 'test_user_id_1',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: { All: true },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1.0',
+ name: 'Test_Example',
+ namespace: 'com.example.testapp',
+ version: '1.0',
+ },
+ device: {
+ id: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ manufacturer: 'Apple',
+ model: 'iPhone',
+ name: 'iPod touch (7th generation)',
+ type: 'iOS',
+ },
+ library: { name: 'test-ios-library', version: '1.0.7' },
+ locale: 'en-US',
+ network: {
+ bluetooth: false,
+ carrier: 'unavailable',
+ cellular: false,
+ wifi: true,
+ },
+ os: { name: 'iOS', version: '14.0' },
+ screen: { density: 2, height: 320, width: 568 },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ firstName: 'Test',
+ lastName: 'Name',
+ createdAt: '2020-09-30T19:11:00.337Z',
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ key1: 'value1',
+ },
+ userAgent: 'unknown',
+ },
+ event: 'Test Event 2',
+ integrations: { All: true },
+ messageId: '1601493060-39010c49-e6e4-4626-a75c-0dbf1925c9e8',
+ originalTimestamp: '2020-09-30T19:11:00.337Z',
+ receivedAt: '2020-10-01T00:41:11.369+05:30',
+ request_ip: '2405:201:8005:9856:7911:25e7:5603:5e18',
+ sentAt: '2020-09-30T19:11:10.382Z',
+ timestamp: '2020-10-01T00:41:01.324+05:30',
+ type: 'identify',
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ destType: 'intercom',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ name: 'Test Name',
+ signed_up_at: 1601493060,
+ last_seen_user_agent: 'unknown',
+ update_last_request_at: true,
+ user_id: 'test_user_id_1',
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.intercom.io/users',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer intercomApiKey',
+ Accept: 'application/json',
+ 'Intercom-Version': '1.4',
+ },
+ params: {},
+ body: {
+ JSON: {
+ email: 'test_1@test.com',
+ phone: '9876543210',
+ signed_up_at: 1601493060,
+ name: 'Test Name',
+ last_seen_user_agent: 'unknown',
+ update_last_request_at: true,
+ custom_attributes: {
+ anonymousId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ key1: 'value1',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '58b21c2d-f8d5-4410-a2d0-b268a26b7e33',
+ },
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'intercomApiKey',
+ appId: '9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0',
+ collectContext: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/iterable/router/data.ts b/test/integrations/destinations/iterable/router/data.ts
index 7cd19381d6..09eedc8eb8 100644
--- a/test/integrations/destinations/iterable/router/data.ts
+++ b/test/integrations/destinations/iterable/router/data.ts
@@ -15,10 +15,7 @@ export const data = [
sentAt: '2022-09-27T11:13:03.777Z',
messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469',
originalTimestamp: '2022-09-27T11:13:03.777Z',
- traits: {
- ruchira: 'donaldbaker@ellis.com',
- new_field2: 'GB',
- },
+ traits: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' },
channel: 'sources',
rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e',
context: {
@@ -32,11 +29,7 @@ export const data = [
},
mappedToDestination: 'true',
externalId: [
- {
- id: 'Tiffany',
- type: 'ITERABLE-test-ruchira',
- identifierType: 'itemId',
- },
+ { id: 'Tiffany', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' },
],
},
timestamp: '2022-09-27T11:12:59.079Z',
@@ -45,14 +38,9 @@ export const data = [
recordId: '10',
request_ip: '10.1.86.248',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
- Config: {
- apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e',
- hubID: '22066036',
- },
+ Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' },
Enabled: true,
},
},
@@ -62,10 +50,7 @@ export const data = [
sentAt: '2022-09-27T11:13:03.777Z',
messageId: '9ad41366-8060-4c9f-b181-f6bea67d5469',
originalTimestamp: '2022-09-27T11:13:03.777Z',
- traits: {
- ruchira: 'abc@ellis.com',
- new_field2: 'GB1',
- },
+ traits: { ruchira: 'abc@ellis.com', new_field2: 'GB1' },
channel: 'sources',
rudderId: '3d51640c-ab09-42c1-b7b2-db6ab433b35e',
context: {
@@ -79,11 +64,7 @@ export const data = [
},
mappedToDestination: 'true',
externalId: [
- {
- id: 'ABC',
- type: 'ITERABLE-test-ruchira',
- identifierType: 'itemId',
- },
+ { id: 'ABC', type: 'ITERABLE-test-ruchira', identifierType: 'itemId' },
],
},
timestamp: '2022-09-27T11:12:59.079Z',
@@ -92,14 +73,9 @@ export const data = [
recordId: '10',
request_ip: '10.1.86.248',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
- Config: {
- apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e',
- hubID: '22066036',
- },
+ Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' },
Enabled: true,
},
},
@@ -127,14 +103,8 @@ export const data = [
body: {
JSON: {
documents: {
- Tiffany: {
- ruchira: 'donaldbaker@ellis.com',
- new_field2: 'GB',
- },
- ABC: {
- ruchira: 'abc@ellis.com',
- new_field2: 'GB1',
- },
+ Tiffany: { ruchira: 'donaldbaker@ellis.com', new_field2: 'GB' },
+ ABC: { ruchira: 'abc@ellis.com', new_field2: 'GB1' },
},
replaceUploadedFieldsOnly: true,
},
@@ -145,20 +115,13 @@ export const data = [
files: {},
},
metadata: [
- {
- jobId: 2,
- },
- {
- jobId: 2,
- },
+ { jobId: 2, userId: 'u1' },
+ { jobId: 2, userId: 'u1' },
],
batched: true,
statusCode: 200,
destination: {
- Config: {
- apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e',
- hubID: '22066036',
- },
+ Config: { apiKey: '583af2f8-15ba-49c0-8511-76383e7de07e', hubID: '22066036' },
Enabled: true,
},
},
@@ -182,15 +145,8 @@ export const data = [
type: 'track',
event: 'Email Opened',
sentAt: '2020-08-28T16:26:16.473Z',
- context: {
- library: {
- name: 'analytics-node',
- version: '0.0.3',
- },
- },
- _metadata: {
- nodeVersion: '10.22.0',
- },
+ context: { library: { name: 'analytics-node', version: '0.0.3' } },
+ _metadata: { nodeVersion: '10.22.0' },
messageId:
'node-570110489d3e99b234b18af9a9eca9d4-6009779e-82d7-469d-aaeb-5ccf162b0453',
properties: {
@@ -201,9 +157,7 @@ export const data = [
anonymousId: 'abcdeeeeeeeexxxx102',
originalTimestamp: '2020-08-28T16:26:06.468Z',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
apiKey: '62d12498c37c4fd8a1a546c2d35c2f60',
@@ -233,22 +187,15 @@ export const data = [
email: 'manashi@website.com',
country: 'India',
},
- library: {
- name: 'analytics-node',
- version: '0.0.3',
- },
- },
- _metadata: {
- nodeVersion: '10.22.0',
+ library: { name: 'analytics-node', version: '0.0.3' },
},
+ _metadata: { nodeVersion: '10.22.0' },
messageId:
'node-cc3ef811f686139ee527b806ee0129ef-163a3a88-266f-447e-8cce-34a8f42f8dcd',
anonymousId: 'abcdeeeeeeeexxxx102',
originalTimestamp: '2020-08-28T16:26:06.462Z',
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
destination: {
Config: {
apiKey: '62d12498c37c4fd8a1a546c2d35c2f60',
@@ -270,24 +217,14 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- traits: {
- email: 'sayan@gmail.com',
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ traits: { email: 'sayan@gmail.com' },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
locale: 'en-US',
ip: '0.0.0.0',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
},
type: 'page',
messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71',
@@ -302,15 +239,11 @@ export const data = [
url: '',
category: 'test-category',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
name: 'ApplicationLoaded',
sentAt: '2019-10-14T11:15:53.296Z',
},
- metadata: {
- jobId: 4,
- },
+ metadata: { jobId: 4, userId: 'u1' },
destination: {
Config: {
apiKey: '12345',
@@ -342,9 +275,7 @@ export const data = [
task_run_id: 'c5tar6cqgmgmcjvupdi0',
version: 'release.v1.6.8',
},
- device: {
- token: 54321,
- },
+ device: { token: 54321 },
},
messageId: '2f052f7c-f694-4849-a7ed-a432f7ffa0a4',
originalTimestamp: '2021-10-28T14:03:50.503Z',
@@ -365,9 +296,7 @@ export const data = [
type: 'identify',
userId: 'lynnanderson@smith.net',
},
- metadata: {
- jobId: 5,
- },
+ metadata: { jobId: 5, userId: 'u1' },
destination: {
ID: '1zia9wKshXt80YksLmUdJnr7IHI',
Name: 'test_iterable',
@@ -420,9 +349,7 @@ export const data = [
IsProcessorEnabled: true,
},
libraries: [],
- request: {
- query: {},
- },
+ request: { query: {} },
},
{
message: {
@@ -434,24 +361,14 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- traits: {
- email: 'sayan@gmail.com',
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ traits: { email: 'sayan@gmail.com' },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
locale: 'en-US',
ip: '0.0.0.0',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
},
event: 'product added',
type: 'track',
@@ -489,15 +406,11 @@ export const data = [
},
],
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
name: 'ApplicationLoaded',
sentAt: '2019-10-14T11:15:53.296Z',
},
- metadata: {
- jobId: 6,
- },
+ metadata: { jobId: 6, userId: 'u1' },
destination: {
Config: {
apiKey: '62d12498c37c4fd8a1a546c2d35c2f60',
@@ -513,15 +426,8 @@ export const data = [
message: {
type: 'page',
sentAt: '2020-08-28T16:26:16.473Z',
- context: {
- library: {
- name: 'analytics-node',
- version: '0.0.3',
- },
- },
- _metadata: {
- nodeVersion: '10.22.0',
- },
+ context: { library: { name: 'analytics-node', version: '0.0.3' } },
+ _metadata: { nodeVersion: '10.22.0' },
messageId:
'node-6f62b91e789a636929ca38aed01c5f6e-103c720d-81bd-4742-98d6-d45a65aed23e',
properties: {
@@ -532,9 +438,7 @@ export const data = [
anonymousId: 'abcdeeeeeeeexxxx102',
originalTimestamp: '2020-08-28T16:26:06.468Z',
},
- metadata: {
- jobId: 7,
- },
+ metadata: { jobId: 7, userId: 'u1' },
destination: {
Config: {
apiKey: '62d12498c37c4fd8a1a546c2d35c2f60',
@@ -550,15 +454,8 @@ export const data = [
message: {
type: 'alias',
sentAt: '2020-08-28T16:26:16.473Z',
- context: {
- library: {
- name: 'analytics-node',
- version: '0.0.3',
- },
- },
- _metadata: {
- nodeVersion: '10.22.0',
- },
+ context: { library: { name: 'analytics-node', version: '0.0.3' } },
+ _metadata: { nodeVersion: '10.22.0' },
messageId:
'node-6f62b91e789a636929ca38aed01c5f6e-103c720d-81bd-4742-98d6-d45a65aed23e',
properties: {
@@ -571,9 +468,7 @@ export const data = [
anonymousId: 'abcdeeeeeeeexxxx102',
originalTimestamp: '2020-08-28T16:26:06.468Z',
},
- metadata: {
- jobId: 8,
- },
+ metadata: { jobId: 8, userId: 'u1' },
destination: {
Config: {
apiKey: '62d12498c37c4fd8a1a546c2d35c2f60',
@@ -627,11 +522,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -679,11 +570,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -703,10 +590,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.iterable.com/api/events/trackBulk',
- headers: {
- 'Content-Type': 'application/json',
- api_key: '12345',
- },
+ headers: { 'Content-Type': 'application/json', api_key: '12345' },
params: {},
body: {
JSON: {
@@ -733,11 +617,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 4,
- },
- ],
+ metadata: [{ jobId: 4, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -766,9 +646,7 @@ export const data = [
JSON: {
user: {
email: 'sayan@gmail.com',
- dataFields: {
- email: 'sayan@gmail.com',
- },
+ dataFields: { email: 'sayan@gmail.com' },
userId: '12345',
preferUserId: true,
mergeNestedObjects: true,
@@ -802,11 +680,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 6,
- },
- ],
+ metadata: [{ jobId: 6, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -852,11 +726,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 7,
- },
- ],
+ metadata: [{ jobId: 7, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -882,21 +752,14 @@ export const data = [
},
params: {},
body: {
- JSON: {
- currentEmail: 'old@email.com',
- newEmail: 'new@email.com',
- },
+ JSON: { currentEmail: 'old@email.com', newEmail: 'new@email.com' },
JSON_ARRAY: {},
XML: {},
FORM: {},
},
files: {},
},
- metadata: [
- {
- jobId: 8,
- },
- ],
+ metadata: [{ jobId: 8, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -916,10 +779,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.iterable.com/api/users/bulkUpdate',
- headers: {
- 'Content-Type': 'application/json',
- api_key: '12345',
- },
+ headers: { 'Content-Type': 'application/json', api_key: '12345' },
params: {},
body: {
JSON: {
@@ -947,11 +807,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 5,
- },
- ],
+ metadata: [{ jobId: 5, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/june/router/data.ts b/test/integrations/destinations/june/router/data.ts
index cf8c4f0011..81e5c6eb5a 100644
--- a/test/integrations/destinations/june/router/data.ts
+++ b/test/integrations/destinations/june/router/data.ts
@@ -10,49 +10,29 @@ export const data = [
body: {
input: [
{
- destination: {
- Config: {
- apiKey: '93EMyDLvfpbRxxYn',
- },
- ID: 'june123',
- },
- metadata: {
- jobId: 1,
- },
+ destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
type: 'identify',
sentAt: '2022-01-20T13:39:21.033Z',
channel: 'web',
userId: '5136633649',
- context: {
- traits: {
- name: 'John Doe',
- email: 'johndoe@gmail.com',
- age: 25,
- },
- },
+ context: { traits: { name: 'John Doe', email: 'johndoe@gmail.com', age: 25 } },
rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
originalTimestamp: '2022-01-20T13:39:21.032Z',
},
},
{
- destination: {
- Config: {
- apiKey: '93EMyDLvfpbRxxYn',
- },
- ID: 'june123',
- },
- metadata: {
- jobId: 2,
- },
+ destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
type: 'track',
event: 'Product Reviewed',
properties: {
review_id: '12345',
product_id: '123',
- rating: 3.0,
+ rating: 3,
review_body: 'Average product, expected much more.',
groupId: '91Yb32830',
},
@@ -80,11 +60,7 @@ export const data = [
JSON: {
anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
timestamp: '2022-01-20T13:39:21.032Z',
- traits: {
- age: 25,
- email: 'johndoe@gmail.com',
- name: 'John Doe',
- },
+ traits: { age: 25, email: 'johndoe@gmail.com', name: 'John Doe' },
userId: '5136633649',
},
JSON_ARRAY: {},
@@ -101,33 +77,15 @@ export const data = [
type: 'REST',
version: '1',
},
- destination: {
- Config: {
- apiKey: '93EMyDLvfpbRxxYn',
- },
- ID: 'june123',
- },
- metadata: [
- {
- jobId: 1,
- },
- ],
+ destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' },
+ metadata: [{ jobId: 1, userId: 'u1' }],
statusCode: 200,
},
{
- destination: {
- Config: {
- apiKey: '93EMyDLvfpbRxxYn',
- },
- ID: 'june123',
- },
+ destination: { Config: { apiKey: '93EMyDLvfpbRxxYn' }, ID: 'june123' },
batched: false,
error: 'Missing required value from "userIdOnly"',
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
statTags: {
destType: 'JUNE',
errorCategory: 'dataValidation',
diff --git a/test/integrations/destinations/kafka/batch/data.ts b/test/integrations/destinations/kafka/batch/data.ts
index 0cc1d75c24..131833b23c 100644
--- a/test/integrations/destinations/kafka/batch/data.ts
+++ b/test/integrations/destinations/kafka/batch/data.ts
@@ -19,12 +19,8 @@ export const data = [
userId: 'user1',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: '6f27a4da-cefb-4800-acf1-f467e8aab91c',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -35,10 +31,7 @@ export const data = [
},
topic: 'new-topic',
},
- metadata: {
- rudderId: 'user1<<>>new-topic',
- jobId: 1,
- },
+ metadata: { rudderId: 'user1<<>>new-topic', jobId: 1, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -105,12 +98,8 @@ export const data = [
userId: 'user2',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: 'fe182d9e-e86e-4db5-ae12-f4b399555fcc',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -121,10 +110,7 @@ export const data = [
},
topic: 'new-topic',
},
- metadata: {
- rudderId: 'user2<<>>new-topic',
- jobId: 2,
- },
+ metadata: { rudderId: 'user2<<>>new-topic', jobId: 2, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -191,12 +177,8 @@ export const data = [
userId: 'user3',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: '2803e656-77ff-47ca-9606-90663f9aed38',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -207,10 +189,7 @@ export const data = [
},
topic: 'new-topic',
},
- metadata: {
- rudderId: 'user3<<>>new-topic',
- jobId: 3,
- },
+ metadata: { rudderId: 'user3<<>>new-topic', jobId: 3, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -277,12 +256,8 @@ export const data = [
userId: 'user4',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -293,10 +268,7 @@ export const data = [
},
topic: 'new-topic',
},
- metadata: {
- rudderId: 'user4<<>>new-topic',
- jobId: 4,
- },
+ metadata: { rudderId: 'user4<<>>new-topic', jobId: 4, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -363,19 +335,10 @@ export const data = [
userId: 'user5',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- schemaId: 'schema001',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { schemaId: 'schema001' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -386,10 +349,7 @@ export const data = [
schemaId: 'schema001',
topic: 'new-topic',
},
- metadata: {
- rudderId: 'user5<<>>new-topic',
- jobId: 5,
- },
+ metadata: { rudderId: 'user5<<>>new-topic', jobId: 5, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -456,19 +416,10 @@ export const data = [
userId: 'user6',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-1',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-1' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -478,10 +429,7 @@ export const data = [
},
topic: 'topic-1',
},
- metadata: {
- rudderId: 'user6<<>>topic-1',
- jobId: 6,
- },
+ metadata: { rudderId: 'user6<<>>topic-1', jobId: 6, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -548,19 +496,10 @@ export const data = [
userId: 'user7',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-1',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-1' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -570,10 +509,7 @@ export const data = [
},
topic: 'topic-1',
},
- metadata: {
- rudderId: 'user7<<>>topic-1',
- jobId: 7,
- },
+ metadata: { rudderId: 'user7<<>>topic-1', jobId: 7, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -640,19 +576,10 @@ export const data = [
userId: 'user8',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-2',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-2' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -662,10 +589,7 @@ export const data = [
},
topic: 'topic-2',
},
- metadata: {
- rudderId: 'user8<<>>topic-2',
- jobId: 8,
- },
+ metadata: { rudderId: 'user8<<>>topic-2', jobId: 8, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -732,19 +656,10 @@ export const data = [
userId: 'user8',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-2',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-2' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -754,10 +669,7 @@ export const data = [
},
topic: 'topic-2',
},
- metadata: {
- rudderId: 'user8<<>>topic-2',
- jobId: 9,
- },
+ metadata: { rudderId: 'user8<<>>topic-2', jobId: 9, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -824,19 +736,10 @@ export const data = [
userId: 'user8',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-3',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-3' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -846,10 +749,7 @@ export const data = [
},
topic: 'topic-3',
},
- metadata: {
- rudderId: 'user8<<>>topic-3',
- jobId: 10,
- },
+ metadata: { rudderId: 'user8<<>>topic-3', jobId: 10, userId: 'u1' },
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
@@ -927,12 +827,8 @@ export const data = [
userId: 'user1',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: '6f27a4da-cefb-4800-acf1-f467e8aab91c',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -951,12 +847,8 @@ export const data = [
userId: 'user2',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: 'fe182d9e-e86e-4db5-ae12-f4b399555fcc',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -975,12 +867,8 @@ export const data = [
userId: 'user3',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: '2803e656-77ff-47ca-9606-90663f9aed38',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -999,12 +887,8 @@ export const data = [
userId: 'user4',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -1023,19 +907,10 @@ export const data = [
userId: 'user5',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- schemaId: 'schema001',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { schemaId: 'schema001' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -1048,23 +923,11 @@ export const data = [
},
],
metadata: [
- { rudderId: 'user1<<>>new-topic', jobId: 1 },
- {
- rudderId: 'user2<<>>new-topic',
- jobId: 2,
- },
- {
- rudderId: 'user3<<>>new-topic',
- jobId: 3,
- },
- {
- rudderId: 'user4<<>>new-topic',
- jobId: 4,
- },
- {
- rudderId: 'user5<<>>new-topic',
- jobId: 5,
- },
+ { rudderId: 'user1<<>>new-topic', jobId: 1, userId: 'u1' },
+ { rudderId: 'user2<<>>new-topic', jobId: 2, userId: 'u1' },
+ { rudderId: 'user3<<>>new-topic', jobId: 3, userId: 'u1' },
+ { rudderId: 'user4<<>>new-topic', jobId: 4, userId: 'u1' },
+ { rudderId: 'user5<<>>new-topic', jobId: 5, userId: 'u1' },
],
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
@@ -1135,19 +998,10 @@ export const data = [
userId: 'user6',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-1',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-1' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -1165,19 +1019,10 @@ export const data = [
userId: 'user7',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-1',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-1' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -1189,14 +1034,8 @@ export const data = [
},
],
metadata: [
- {
- rudderId: 'user6<<>>topic-1',
- jobId: 6,
- },
- {
- rudderId: 'user7<<>>topic-1',
- jobId: 7,
- },
+ { rudderId: 'user6<<>>topic-1', jobId: 6, userId: 'u1' },
+ { rudderId: 'user7<<>>topic-1', jobId: 7, userId: 'u1' },
],
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
@@ -1267,19 +1106,10 @@ export const data = [
userId: 'user8',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-2',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-2' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -1297,19 +1127,10 @@ export const data = [
userId: 'user8',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-2',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-2' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -1321,14 +1142,8 @@ export const data = [
},
],
metadata: [
- {
- rudderId: 'user8<<>>topic-2',
- jobId: 8,
- },
- {
- rudderId: 'user8<<>>topic-2',
- jobId: 9,
- },
+ { rudderId: 'user8<<>>topic-2', jobId: 8, userId: 'u1' },
+ { rudderId: 'user8<<>>topic-2', jobId: 9, userId: 'u1' },
],
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
@@ -1399,19 +1214,10 @@ export const data = [
userId: 'user8',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
- },
- integrations: {
- All: true,
- KAFKA: {
- topic: 'topic-3',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
+ integrations: { All: true, KAFKA: { topic: 'topic-3' } },
messageId: '87c98fc2-561b-4631-8cd6-1d02cdd1429f',
timestamp: '2020-02-02T00:23:09.544Z',
receivedAt: '2021-07-08T02:45:06.851+05:30',
@@ -1422,12 +1228,7 @@ export const data = [
topic: 'topic-3',
},
],
- metadata: [
- {
- rudderId: 'user8<<>>topic-3',
- jobId: 10,
- },
- ],
+ metadata: [{ rudderId: 'user8<<>>topic-3', jobId: 10, userId: 'u1' }],
destination: {
ID: '1uzGR4rn915R6Xts9KRfWAzmgGL',
Name: 'local-kafka-test',
diff --git a/test/integrations/destinations/keen/router/data.ts b/test/integrations/destinations/keen/router/data.ts
index d46d2363e2..a88fc5dcce 100644
--- a/test/integrations/destinations/keen/router/data.ts
+++ b/test/integrations/destinations/keen/router/data.ts
@@ -19,24 +19,13 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- traits: {
- email: 'sayan@gmail.com',
- anonymousId: '12345',
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ traits: { email: 'sayan@gmail.com', anonymousId: '12345' },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
locale: 'en-US',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
},
type: 'track',
messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be',
@@ -51,18 +40,11 @@ export const data = [
user_actual_id: 12345,
user_time_spent: 50000,
},
- integrations: {
- All: true,
- },
- traits: {
- email: 'test@gmail.com',
- anonymousId: 'anon-id',
- },
+ integrations: { All: true },
+ traits: { email: 'test@gmail.com', anonymousId: 'anon-id' },
sentAt: '2019-10-14T11:15:53.296Z',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
projectID: 'abcde',
@@ -84,25 +66,14 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- traits: {
- email: 'sayan@gmail.com',
- anonymousId: '12345',
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ traits: { email: 'sayan@gmail.com', anonymousId: '12345' },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
locale: 'en-US',
ip: '0.0.0.0',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
},
type: 'page',
messageId: '5e10d13a-bf9a-44bf-b884-43a9e591ea71',
@@ -117,19 +88,12 @@ export const data = [
title: 'Test Page',
url: 'www.rudderlabs.com',
},
- traits: {
- email: 'test@gmail.com',
- anonymousId: 'anon-id',
- },
- integrations: {
- All: true,
- },
+ traits: { email: 'test@gmail.com', anonymousId: 'anon-id' },
+ integrations: { All: true },
name: 'ApplicationLoaded',
sentAt: '2019-10-14T11:15:53.296Z',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 3, userId: 'u1' },
destination: {
Config: {
projectID: 'abcde',
@@ -165,16 +129,12 @@ export const data = [
keen: {
addons: [
{
- input: {
- ip: 'request_ip',
- },
+ input: { ip: 'request_ip' },
name: 'keen:ip_to_geo',
output: 'ip_geo_info',
},
{
- input: {
- ua_string: 'user_agent',
- },
+ input: { ua_string: 'user_agent' },
name: 'keen:ua_parser',
output: 'parsed_user_agent',
},
@@ -182,10 +142,7 @@ export const data = [
},
anonymousId: '00000000000000000000000000',
user: {
- traits: {
- anonymousId: 'anon-id',
- email: 'test@gmail.com',
- },
+ traits: { anonymousId: 'anon-id', email: 'test@gmail.com' },
userId: '12345',
},
user_agent:
@@ -196,21 +153,14 @@ export const data = [
files: {},
endpoint: 'https://api.keen.io/3.0/projects/abcde/events/test track event',
userId: '12345',
- headers: {
- 'Content-Type': 'application/json',
- Authorization: 'xyz',
- },
+ headers: { 'Content-Type': 'application/json', Authorization: 'xyz' },
version: '1',
params: {},
type: 'REST',
method: 'POST',
statusCode: 200,
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -239,16 +189,12 @@ export const data = [
keen: {
addons: [
{
- input: {
- ip: 'request_ip',
- },
+ input: { ip: 'request_ip' },
name: 'keen:ip_to_geo',
output: 'ip_geo_info',
},
{
- input: {
- ua_string: 'user_agent',
- },
+ input: { ua_string: 'user_agent' },
name: 'keen:ua_parser',
output: 'parsed_user_agent',
},
@@ -256,10 +202,7 @@ export const data = [
},
anonymousId: '00000000000000000000000000',
user: {
- traits: {
- anonymousId: 'anon-id',
- email: 'test@gmail.com',
- },
+ traits: { anonymousId: 'anon-id', email: 'test@gmail.com' },
userId: '12345',
},
path: '/test',
@@ -272,21 +215,14 @@ export const data = [
endpoint:
'https://api.keen.io/3.0/projects/abcde/events/Viewed ApplicationLoaded page',
userId: '12345',
- headers: {
- 'Content-Type': 'application/json',
- Authorization: 'xyz',
- },
+ headers: { 'Content-Type': 'application/json', Authorization: 'xyz' },
version: '1',
params: {},
type: 'REST',
method: 'POST',
statusCode: 200,
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/kissmetrics/router/data.ts b/test/integrations/destinations/kissmetrics/router/data.ts
index bba00edf96..827a493ae5 100644
--- a/test/integrations/destinations/kissmetrics/router/data.ts
+++ b/test/integrations/destinations/kissmetrics/router/data.ts
@@ -37,25 +37,15 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312',
originalTimestamp: '2020-01-24T06:29:02.358Z',
properties: {
@@ -79,6 +69,7 @@ export const data = [
jobId: 1,
messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312',
sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY',
+ userId: 'u1',
},
},
{
@@ -109,18 +100,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {
city: 'Disney',
country: 'USA',
@@ -130,9 +113,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
traits: {
city: 'Disney-1',
country: 'India',
@@ -155,6 +136,7 @@ export const data = [
jobId: 2,
messageId: '2536eda4-d638-4c93-8014-8ffe3f083214',
sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY',
+ userId: 'u1',
},
},
],
@@ -187,12 +169,7 @@ export const data = [
_t: '1579847342',
_d: 1,
},
- body: {
- JSON: {},
- XML: {},
- JSON_ARRAY: {},
- FORM: {},
- },
+ body: { JSON: {}, XML: {}, JSON_ARRAY: {}, FORM: {} },
files: {},
userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
statusCode: 200,
@@ -206,6 +183,7 @@ export const data = [
jobId: 1,
messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312',
sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY',
+ userId: 'u1',
},
],
batched: false,
@@ -245,12 +223,7 @@ export const data = [
_t: '1579847342',
_d: 1,
},
- body: {
- JSON: {},
- XML: {},
- JSON_ARRAY: {},
- FORM: {},
- },
+ body: { JSON: {}, XML: {}, JSON_ARRAY: {}, FORM: {} },
files: {},
userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
statusCode: 200,
@@ -264,6 +237,7 @@ export const data = [
jobId: 2,
messageId: '2536eda4-d638-4c93-8014-8ffe3f083214',
sourceId: '1WjrlZIy1d41MCceOrFbDVPnOPY',
+ userId: 'u1',
},
],
batched: false,
diff --git a/test/integrations/destinations/klaviyo/network.ts b/test/integrations/destinations/klaviyo/network.ts
new file mode 100644
index 0000000000..aa788a60da
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/network.ts
@@ -0,0 +1,75 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://a.klaviyo.com/api/v2/list/XUepkK/subscribe',
+ method: 'GET',
+ },
+ httpRes: {
+ status: 200
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.klaviyo.com/api/v2/list/XUepkK/members',
+ method: 'GET',
+ },
+ httpRes: {
+ status: 200
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.klaviyo.com/api/profiles',
+ method: 'GET',
+ data: {
+ attributes: {
+ email: "test3@rudderstack.com"
+ }
+ }
+ },
+ httpRes: {
+ status: 409,
+ data: {
+ }
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.klaviyo.com/api/profiles',
+ method: 'GET',
+ },
+ httpRes: {
+ status: 201,
+ data: {
+ data: {
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ attributes: {}
+ },
+ }
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.klaviyo.com/api/profiles',
+ method: 'POST',
+ headers: { Authorization: 'Klaviyo-API-Key dummyPrivateApiKeyforfailure' }
+ },
+ httpRes: {
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.klaviyo.com/api/profiles',
+ method: 'POST',
+ },
+ httpRes: {
+ status: 201,
+ data: {
+ data: {
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ attributes: {}
+ },
+ }
+ },
+ }
+];
diff --git a/test/integrations/destinations/klaviyo/processor/data.ts b/test/integrations/destinations/klaviyo/processor/data.ts
new file mode 100644
index 0000000000..06c4a3e530
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/processor/data.ts
@@ -0,0 +1,15 @@
+import { ecomTestData } from './ecomTestData';
+import { groupTestData } from './groupTestData';
+import { identifyData } from './identifyTestData';
+import { screenTestData } from './screenTestData';
+import { trackTestData } from './trackTestData';
+import { validationTestData } from './validationTestData';
+
+export const data = [
+ ...identifyData,
+ ...trackTestData,
+ ...screenTestData,
+ ...groupTestData,
+ ...ecomTestData,
+ ...validationTestData,
+];
diff --git a/test/integrations/destinations/klaviyo/processor/ecomTestData.ts b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts
new file mode 100644
index 0000000000..fab4cf85ce
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/processor/ecomTestData.ts
@@ -0,0 +1,344 @@
+import { overrideDestination, transformResultBuilder } from '../../../testUtils';
+
+const destination = {
+ Config: {
+ publicApiKey: 'dummyPublicApiKey',
+ privateApiKey: 'dummyPrivateApiKey',
+ },
+};
+
+const commonTraits = {
+ id: 'user@1',
+ age: '22',
+ name: 'Test',
+ email: 'test@rudderstack.com',
+ phone: '9112340375',
+ anonymousId: '9c6bd77ea9da3e68',
+ description: 'Sample description',
+};
+
+const eventsEndpoint = 'https://a.klaviyo.com/api/events';
+
+const commonOutputHeaders = {
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ Accept: 'application/json',
+ revision: '2023-02-22',
+};
+
+export const ecomTestData = [
+ {
+ id: 'klaviyo-ecom-test-1',
+ name: 'klaviyo',
+ description: 'Track call with Ecom events (Viewed Product)',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only event payload and status code should be 200, for the event payload should contain contextual traits and properties in the payload the event name should be Viewed Product and the properties should be mapped to the Klaviyo event properties',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: {
+ type: 'track',
+ event: 'product viewed',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ channel: 'mobile',
+ context: {
+ traits: commonTraits,
+ },
+ properties: {
+ name: 'test product',
+ product_id: '1114',
+ sku: 'WINNIePuh12',
+ image_url: 'http://www.example.com/path/to/product/image.png',
+ url: 'http://www.example.com/path/to/product',
+ brand: 'Not for Kids',
+ price: 9.9,
+ categories: ['Fiction', 'Children'],
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ endpoint: eventsEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'event',
+ attributes: {
+ metric: {
+ name: 'Viewed Product',
+ },
+ profile: {
+ $email: 'test@rudderstack.com',
+ $phone_number: '9112340375',
+ $id: 'sajal12',
+ age: '22',
+ name: 'Test',
+ description: 'Sample description',
+ },
+ properties: {
+ ProductName: 'test product',
+ ProductID: '1114',
+ SKU: 'WINNIePuh12',
+ ImageURL: 'http://www.example.com/path/to/product/image.png',
+ URL: 'http://www.example.com/path/to/product',
+ Brand: 'Not for Kids',
+ Price: 9.9,
+ Categories: ['Fiction', 'Children'],
+ },
+ },
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-ecom-test-2',
+ name: 'klaviyo',
+ description: 'Track call with Ecom events (Checkout Started) with enabled flattenProperties',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only event payload and status code should be 200, for the event payload should contain contextual traits and properties in the payload the event name should be Started Checkout and the properties should be mapped to the Klaviyo event properties with flattened properties',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: overrideDestination(destination, { flattenProperties: true }),
+ message: {
+ type: 'track',
+ event: 'checkout started',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ channel: 'mobile',
+ context: {
+ traits: commonTraits,
+ },
+ properties: {
+ order_id: '1234',
+ affiliation: 'Apple Store',
+ value: 20,
+ revenue: 15,
+ shipping: 4,
+ tax: 1,
+ discount: 1.5,
+ coupon: 'ImagePro',
+ currency: 'USD',
+ products: [
+ {
+ product_id: '123',
+ sku: 'G-32',
+ name: 'Monopoly',
+ price: 14,
+ quantity: 1,
+ category: 'Games',
+ url: 'https://www.website.com/product/path',
+ image_url: 'https://www.website.com/product/path.jpg',
+ },
+ {
+ product_id: '345',
+ sku: 'F-32',
+ name: 'UNO',
+ price: 3.45,
+ quantity: 2,
+ category: 'Games',
+ },
+ ],
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ endpoint: eventsEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'event',
+ attributes: {
+ metric: {
+ name: 'Started Checkout',
+ },
+ properties: {
+ $event_id: '1234',
+ $value: 20,
+ 'items[0].ProductID': '123',
+ 'items[0].SKU': 'G-32',
+ 'items[0].ProductName': 'Monopoly',
+ 'items[0].Quantity': 1,
+ 'items[0].ItemPrice': 14,
+ 'items[0].ProductURL': 'https://www.website.com/product/path',
+ 'items[0].ImageURL': 'https://www.website.com/product/path.jpg',
+ 'items[1].ProductID': '345',
+ 'items[1].SKU': 'F-32',
+ 'items[1].ProductName': 'UNO',
+ 'items[1].Quantity': 2,
+ 'items[1].ItemPrice': 3.45,
+ },
+ profile: {
+ $email: 'test@rudderstack.com',
+ $phone_number: '9112340375',
+ $id: 'sajal12',
+ age: '22',
+ name: 'Test',
+ description: 'Sample description',
+ },
+ },
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-ecom-test-3',
+ name: 'klaviyo',
+ description: 'Track call with Ecom events (Added to Cart) with properties.products',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only event payload and status code should be 200, for the event payload should contain contextual traits and properties in the payload the event name should be Added to Cart and the properties should be mapped to the Klaviyo event properties with flattened properties and products array should be mapped to items array in the payload',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: {
+ type: 'track',
+ event: 'product added',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ channel: 'mobile',
+ context: {
+ traits: commonTraits,
+ },
+ rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c',
+ messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce',
+ properties: {
+ order_id: '1234',
+ value: 12.12,
+ categories: ['Fiction3', 'Children3'],
+ checkout_url: 'http://www.heythere.com',
+ item_names: ['book1', 'book2'],
+ products: [
+ {
+ product_id: 'b1pid',
+ sku: '123x',
+ name: 'book1',
+ url: 'heyther.com',
+ price: 12,
+ },
+ {
+ product_id: 'b2pid',
+ sku: '123x',
+ name: 'book2',
+ url: 'heyther2.com',
+ price: 14,
+ },
+ ],
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ endpoint: 'https://a.klaviyo.com/api/events',
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'event',
+ attributes: {
+ metric: {
+ name: 'Added to Cart',
+ },
+ profile: {
+ $email: 'test@rudderstack.com',
+ $phone_number: '9112340375',
+ $id: 'sajal12',
+ age: '22',
+ name: 'Test',
+ description: 'Sample description',
+ },
+ properties: {
+ $value: 12.12,
+ AddedItemCategories: ['Fiction3', 'Children3'],
+ ItemNames: ['book1', 'book2'],
+ CheckoutURL: 'http://www.heythere.com',
+ items: [
+ {
+ ProductID: 'b1pid',
+ SKU: '123x',
+ ProductName: 'book1',
+ ItemPrice: 12,
+ ProductURL: 'heyther.com',
+ },
+ {
+ ProductID: 'b2pid',
+ SKU: '123x',
+ ProductName: 'book2',
+ ItemPrice: 14,
+ ProductURL: 'heyther2.com',
+ },
+ ],
+ },
+ },
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/klaviyo/processor/groupTestData.ts b/test/integrations/destinations/klaviyo/processor/groupTestData.ts
new file mode 100644
index 0000000000..031c949c4b
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/processor/groupTestData.ts
@@ -0,0 +1,136 @@
+import { generateSimplifiedGroupPayload, transformResultBuilder } from '../../../testUtils';
+
+const destination = {
+ Config: {
+ publicApiKey: 'dummyPublicApiKey',
+ privateApiKey: 'dummyPrivateApiKey',
+ },
+};
+
+const headers = {
+ Accept: 'application/json',
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ revision: '2023-02-22',
+};
+
+const commonEndpoint = 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs';
+
+export const groupTestData = [
+ {
+ id: 'klaviyo-group-test-1',
+ name: 'klaviyo',
+ description: 'Simple group call',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only group payload and status code should be 200, for the group payload a subscription payload should be present in the final payload with email and phone',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: generateSimplifiedGroupPayload({
+ userId: 'user123',
+ groupId: 'XUepkK',
+ traits: {
+ subscribe: true,
+ },
+ context: {
+ traits: {
+ email: 'test@rudderstack.com',
+ phone: '+12 345 678 900',
+ consent: ['email'],
+ },
+ },
+ timestamp: '2020-01-21T00:21:34.208Z',
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ JSON: {
+ data: {
+ attributes: {
+ list_id: 'XUepkK',
+ subscriptions: [
+ { email: 'test@rudderstack.com', phone_number: '+12 345 678 900' },
+ ],
+ },
+ type: 'profile-subscription-bulk-create-job',
+ },
+ },
+ endpoint: commonEndpoint,
+ headers: headers,
+ method: 'POST',
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-group-test-2',
+ name: 'klaviyo',
+ description: 'Simple group call without groupId',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain error message and status code should be 400, as we are not sending groupId in the payload and groupId is a required field for group events',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: generateSimplifiedGroupPayload({
+ userId: 'user123',
+ groupId: '',
+ traits: {
+ subscribe: true,
+ },
+ context: {
+ traits: {
+ email: 'test@rudderstack.com',
+ phone: '+12 345 678 900',
+ consent: 'email',
+ },
+ },
+ timestamp: '2020-01-21T00:21:34.208Z',
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'groupId is a required field for group events',
+ statTags: {
+ destType: 'KLAVIYO',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/klaviyo/processor/identifyTestData.ts b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts
new file mode 100644
index 0000000000..8b5503fad9
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/processor/identifyTestData.ts
@@ -0,0 +1,551 @@
+import { removeUndefinedAndNullValues } from '@rudderstack/integrations-lib';
+import {
+ overrideDestination,
+ transformResultBuilder,
+ generateSimplifiedIdentifyPayload,
+} from '../../../testUtils';
+
+const destination = {
+ Config: {
+ publicApiKey: 'dummyPublicApiKey',
+ privateApiKey: 'dummyPrivateApiKey',
+ },
+};
+
+const commonTraits = {
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ email: 'test@rudderstack.com',
+ phone: '+12 345 578 900',
+ userId: 'user@1',
+ title: 'Developer',
+ organization: 'Rudder',
+ city: 'Tokyo',
+ region: 'Kanto',
+ country: 'JP',
+ zip: '100-0001',
+ Flagged: false,
+ Residence: 'Shibuya',
+ properties: {
+ listId: 'XUepkK',
+ subscribe: true,
+ consent: ['email', 'sms'],
+ },
+};
+
+const commonOutputUserProps = {
+ external_id: 'user@1',
+ email: 'test@rudderstack.com',
+ first_name: 'Test',
+ last_name: 'Rudderlabs',
+ phone_number: '+12 345 578 900',
+ title: 'Developer',
+ organization: 'Rudder',
+ location: {
+ city: 'Tokyo',
+ region: 'Kanto',
+ country: 'JP',
+ zip: '100-0001',
+ },
+ properties: {
+ Flagged: false,
+ Residence: 'Shibuya',
+ },
+};
+
+const commonOutputSubscriptionProps = {
+ list_id: 'XUepkK',
+ subscriptions: [
+ {
+ email: 'test@rudderstack.com',
+ phone_number: '+12 345 578 900',
+ channels: {
+ email: ['MARKETING'],
+ sms: ['MARKETING'],
+ },
+ },
+ ],
+};
+
+const commonOutputHeaders = {
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ Accept: 'application/json',
+ revision: '2023-02-22',
+};
+
+const anonymousId = '97c46c81-3140-456d-b2a9-690d70aaca35';
+const userId = 'user@1';
+const sentAt = '2021-01-03T17:02:53.195Z';
+const originalTimestamp = '2021-01-03T17:02:53.193Z';
+const commonUserUpdateEndpoint = 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX';
+const subscribeEndpoint = 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs';
+
+export const identifyData = [
+ {
+ id: 'klaviyo-identify-test-1',
+ name: 'klaviyo',
+ description:
+ 'Identify and Subscribe user where the user doesnot exists[mock] (without suppression status code feature from server)',
+ scenario: 'Business + Framework',
+ successCriteria:
+ 'Response should containt two payloads one for profile updation and other for subscription, response status code should be 200',
+ comment:
+ 'Reasoning: As suppression status code feature is not enabled from server, so we would expect 2 responses from transformer one for profile updation (deafult behaviour) and other for subscription',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: generateSimplifiedIdentifyPayload({
+ context: {
+ traits: commonTraits,
+ },
+ anonymousId,
+ userId,
+ sentAt,
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ userId: '',
+ method: 'PATCH',
+ endpoint: commonUserUpdateEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile',
+ attributes: commonOutputUserProps,
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ userId: '',
+ endpoint: subscribeEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile-subscription-bulk-create-job',
+ attributes: commonOutputSubscriptionProps,
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-identify-test-2',
+ name: 'klaviyo',
+ description: 'Identify call for with flattenProperties enabled in destination config',
+ scenario: 'Business',
+ successCriteria:
+ 'The profile updation response should contain the flattened properties of the friend object',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: overrideDestination(destination, { flattenProperties: true }),
+ message: generateSimplifiedIdentifyPayload({
+ sentAt,
+ userId,
+ context: {
+ traits: {
+ ...commonTraits,
+ friend: {
+ names: {
+ first: 'Alice',
+ last: 'Smith',
+ },
+ age: 25,
+ },
+ },
+ },
+ anonymousId,
+ originalTimestamp,
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ userId: '',
+ method: 'PATCH',
+ endpoint: commonUserUpdateEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile',
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ attributes: {
+ ...commonOutputUserProps,
+ properties: {
+ ...commonOutputUserProps.properties,
+ 'friend.age': 25,
+ 'friend.names.first': 'Alice',
+ 'friend.names.last': 'Smith',
+ },
+ },
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ {
+ output: transformResultBuilder({
+ userId: '',
+ method: 'POST',
+ endpoint: subscribeEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile-subscription-bulk-create-job',
+ attributes: commonOutputSubscriptionProps,
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-identify-test-3',
+ name: 'klaviyo',
+ description: 'Negative Test Case for Profile updation call and subcribe user',
+ scenario: 'Business + Framework',
+ successCriteria:
+ 'Response should contain error message and status code should be 500, as we are getting a network error from klaviyo',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ publicApiKey: 'dummyPublicApiKey',
+ privateApiKey: 'dummyPrivateApiKeyforfailure',
+ },
+ },
+ message: generateSimplifiedIdentifyPayload({
+ sentAt,
+ userId,
+ context: {
+ traits: {
+ ...commonTraits,
+ email: 'test3@rudderstack.com',
+ },
+ },
+ anonymousId,
+ originalTimestamp,
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ '{"message":"Failed to create user due to \\"\\"","destinationResponse":"\\"\\""}',
+ statTags: {
+ destType: 'KLAVIYO',
+ errorCategory: 'network',
+ errorType: 'retryable',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 500,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-identify-test-4',
+ name: 'klaviyo',
+ description: 'Profile create update without subscribing the user',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only profile update payload and status code should be 200 as subscribe is set to false in the payload',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: generateSimplifiedIdentifyPayload({
+ sentAt,
+ userId,
+ context: {
+ traits: {
+ ...commonTraits,
+ properties: { ...commonTraits.properties, subscribe: false },
+ },
+ },
+ anonymousId,
+ originalTimestamp,
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'PATCH',
+ endpoint: commonUserUpdateEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile',
+ attributes: commonOutputUserProps,
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-identify-test-5',
+ name: 'klaviyo',
+ description: 'Identify call with enforceEmailAsPrimary enabled in destination config',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain two payloads one for profile updation and other for subscription, response status code should be 200, for the profile updation payload there should be no external_id field in the payload as enforceEmailAsPrimary is set to true in the destination config and the userId should be mapped to _id field in the properties object',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: overrideDestination(destination, { enforceEmailAsPrimary: true }),
+ message: generateSimplifiedIdentifyPayload({
+ sentAt,
+ userId,
+ context: {
+ traits: commonTraits,
+ },
+ anonymousId,
+ originalTimestamp,
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ userId: '',
+ method: 'PATCH',
+ endpoint: commonUserUpdateEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile',
+ attributes: removeUndefinedAndNullValues({
+ ...commonOutputUserProps,
+ properties: {
+ ...commonOutputUserProps.properties,
+ _id: userId,
+ },
+ // remove external_id from the payload
+ external_id: undefined,
+ }),
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ {
+ output: transformResultBuilder({
+ userId: '',
+ method: 'POST',
+ endpoint: subscribeEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile-subscription-bulk-create-job',
+ attributes: commonOutputSubscriptionProps,
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-identify-test-6',
+ name: 'klaviyo',
+ description: 'Identify call without user custom Properties',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain two payloads one for profile updation and other for subscription, response status code should be 200, for the profile updation payload does not have any custom properties in the payload',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: destination,
+ message: generateSimplifiedIdentifyPayload({
+ sentAt,
+ userId,
+ context: {
+ traits: removeUndefinedAndNullValues({
+ ...commonTraits,
+ Flagged: undefined,
+ Residence: undefined,
+ }),
+ },
+ anonymousId,
+ originalTimestamp,
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ userId: '',
+ method: 'PATCH',
+ endpoint: commonUserUpdateEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile',
+ attributes: removeUndefinedAndNullValues({
+ ...commonOutputUserProps,
+ properties: undefined,
+ }),
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ {
+ output: transformResultBuilder({
+ userId: '',
+ method: 'POST',
+ endpoint: subscribeEndpoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'profile-subscription-bulk-create-job',
+ attributes: commonOutputSubscriptionProps,
+ },
+ },
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-identify-test-7',
+ name: 'klaviyo',
+ description: 'Identify call without email and phone & enforceEmailAsPrimary enabled from UI',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain error message and status code should be 400, as we are not sending email and phone in the payload and enforceEmailAsPrimary is enabled from UI',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: overrideDestination(destination, { enforceEmailAsPrimary: true }),
+ message: generateSimplifiedIdentifyPayload({
+ sentAt,
+ userId,
+ context: {
+ traits: removeUndefinedAndNullValues({
+ ...commonTraits,
+ email: undefined,
+ phone: undefined,
+ }),
+ },
+ anonymousId,
+ originalTimestamp,
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'None of email and phone are present in the payload',
+ statTags: {
+ destType: 'KLAVIYO',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/klaviyo/processor/screenTestData.ts b/test/integrations/destinations/klaviyo/processor/screenTestData.ts
new file mode 100644
index 0000000000..3779747a4e
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/processor/screenTestData.ts
@@ -0,0 +1,97 @@
+import { generateSimplifiedPageOrScreenPayload, transformResultBuilder } from '../../../testUtils';
+
+const destination = {
+ Config: {
+ publicApiKey: 'dummyPublicApiKey',
+ privateApiKey: 'dummyPrivateApiKey',
+ },
+};
+
+export const screenTestData = [
+ {
+ id: 'klaviyo-screen-test-1',
+ name: 'klaviyo',
+ description: 'Screen event call with properties and contextual traits',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only event payload and status code should be 200, for the event payload should contain properties and contextual traits in the payload',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: generateSimplifiedPageOrScreenPayload(
+ {
+ event: 'TestEven001',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ context: {
+ traits: {
+ id: 'user@1',
+ age: '22',
+ email: 'test@rudderstack.com',
+ phone: '9112340375',
+ anonymousId: '9c6bd77ea9da3e68',
+ },
+ },
+ properties: {
+ PreviouslyVicePresident: true,
+ YearElected: 1801,
+ VicePresidents: ['Aaron Burr', 'George Clinton'],
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ },
+ 'screen',
+ ),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ endpoint: 'https://a.klaviyo.com/api/events',
+ headers: {
+ Accept: 'application/json',
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ revision: '2023-02-22',
+ },
+ JSON: {
+ data: {
+ type: 'event',
+ attributes: {
+ metric: {
+ name: 'TestEven001',
+ },
+ properties: {
+ PreviouslyVicePresident: true,
+ YearElected: 1801,
+ VicePresidents: ['Aaron Burr', 'George Clinton'],
+ },
+ profile: {
+ $email: 'test@rudderstack.com',
+ $phone_number: '9112340375',
+ $id: 'sajal12',
+ age: '22',
+ },
+ },
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/klaviyo/processor/trackTestData.ts b/test/integrations/destinations/klaviyo/processor/trackTestData.ts
new file mode 100644
index 0000000000..f3bbfb96b9
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/processor/trackTestData.ts
@@ -0,0 +1,316 @@
+import {
+ generateSimplifiedTrackPayload,
+ generateTrackPayload,
+ overrideDestination,
+ transformResultBuilder,
+} from '../../../testUtils';
+
+const destination = {
+ Config: {
+ publicApiKey: 'dummyPublicApiKey',
+ privateApiKey: 'dummyPrivateApiKey',
+ },
+};
+
+const commonTraits = {
+ id: 'user@1',
+ age: '22',
+ anonymousId: '9c6bd77ea9da3e68',
+};
+
+const commonProps = {
+ PreviouslVicePresident: true,
+ YearElected: 1801,
+ VicePresidents: ['AaronBurr', 'GeorgeClinton'],
+};
+
+const commonOutputHeaders = {
+ Accept: 'application/json',
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ revision: '2023-02-22',
+};
+
+const eventEndPoint = 'https://a.klaviyo.com/api/events';
+
+export const trackTestData = [
+ {
+ id: 'klaviyo-track-test-1',
+ name: 'klaviyo',
+ description: 'Track event call with flatten properties enabled in destination config',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only event payload and status code should be 200, for the event payload should contain flattened properties in the payload',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: overrideDestination(destination, { flattenProperties: true }),
+ message: generateSimplifiedTrackPayload({
+ type: 'track',
+ event: 'TestEven001',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ context: {
+ traits: {
+ ...commonTraits,
+ email: 'test@rudderstack.com',
+ phone: '9112340375',
+ plan_details: {
+ plan_type: 'gold',
+ duration: '3 months',
+ },
+ },
+ },
+ properties: {
+ vicePresdentInfo: commonProps,
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ endpoint: eventEndPoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'event',
+ attributes: {
+ metric: {
+ name: 'TestEven001',
+ },
+ properties: {
+ 'vicePresdentInfo.PreviouslVicePresident': true,
+ 'vicePresdentInfo.VicePresidents': ['AaronBurr', 'GeorgeClinton'],
+ 'vicePresdentInfo.YearElected': 1801,
+ },
+ profile: {
+ $email: 'test@rudderstack.com',
+ $phone_number: '9112340375',
+ $id: 'sajal12',
+ age: '22',
+ 'plan_details.plan_type': 'gold',
+ 'plan_details.duration': '3 months',
+ },
+ },
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-track-test-2',
+ name: 'klaviyo',
+ description: 'Simple track event call',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only event payload and status code should be 200, for the event payload should contain contextual traits and properties in the payload',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination,
+ message: generateSimplifiedTrackPayload({
+ type: 'track',
+ event: 'TestEven002',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ context: {
+ traits: {
+ ...commonTraits,
+ name: 'Test',
+ email: 'test@rudderstack.com',
+ phone: '9112340375',
+ description: 'Sample description',
+ },
+ },
+ properties: {
+ ...commonProps,
+ revenue: 3000,
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ endpoint: eventEndPoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'event',
+ attributes: {
+ metric: {
+ name: 'TestEven002',
+ },
+ properties: commonProps,
+ profile: {
+ $email: 'test@rudderstack.com',
+ $phone_number: '9112340375',
+ $id: 'sajal12',
+ age: '22',
+ name: 'Test',
+ description: 'Sample description',
+ },
+ value: 3000,
+ },
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-track-test-3',
+ name: 'klaviyo',
+ description: 'Track event call, with make email or phone as primary identifier toggle on',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain only event payload and status code should be 200, for the event payload should contain contextual traits and properties in the payload, and email should be mapped to $email and userId should be mapped to _id',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: overrideDestination(destination, { enforceEmailAsPrimary: true }),
+ message: generateSimplifiedTrackPayload({
+ type: 'track',
+ event: 'TestEven001',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ context: {
+ traits: {
+ ...commonTraits,
+ email: 'test@rudderstack.com',
+ phone: '9112340375',
+ },
+ },
+ properties: commonProps,
+ anonymousId: '9c6bd77ea9da3e68',
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: transformResultBuilder({
+ method: 'POST',
+ endpoint: eventEndPoint,
+ headers: commonOutputHeaders,
+ JSON: {
+ data: {
+ type: 'event',
+ attributes: {
+ metric: {
+ name: 'TestEven001',
+ },
+ properties: commonProps,
+ profile: {
+ $email: 'test@rudderstack.com',
+ $phone_number: '9112340375',
+ age: '22',
+ _id: 'sajal12',
+ },
+ },
+ },
+ },
+ userId: '',
+ }),
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ id: 'klaviyo-track-test-4',
+ name: 'klaviyo',
+ description:
+ 'Track event call, without email and phone & with (make email or phone as primary identifier) toggle on',
+ scenario: 'Business',
+ successCriteria:
+ 'Response should contain error message and status code should be 400, as we are not sending email and phone in the payload and enforceEmailAsPrimary is enabled from UI',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: overrideDestination(destination, { enforceEmailAsPrimary: true }),
+ message: generateSimplifiedTrackPayload({
+ type: 'track',
+ event: 'TestEven001',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'sajal12',
+ context: {
+ traits: commonTraits,
+ },
+ properties: commonProps,
+ anonymousId: '9c6bd77ea9da3e68',
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ }),
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'None of email and phone are present in the payload',
+ statTags: {
+ destType: 'KLAVIYO',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/klaviyo/processor/validationTestData.ts b/test/integrations/destinations/klaviyo/processor/validationTestData.ts
new file mode 100644
index 0000000000..59556cfe5f
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/processor/validationTestData.ts
@@ -0,0 +1,62 @@
+export const validationTestData = [
+ {
+ id: 'klaviyo-validation-test-1',
+ name: 'klaviyo',
+ description: '[Error]: Check for unsupported message type',
+ scenario: 'Framework',
+ successCriteria:
+ 'Response should contain error message and status code should be 400, as we are sending a message type which is not supported by Klaviyo destination and the error message should be Event type random is not supported',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ publicApiKey: 'dummyPublicApiKey',
+ privateApiKey: 'dummyPrivateApiKey',
+ },
+ },
+ message: {
+ userId: 'user123',
+ type: 'random',
+ groupId: 'XUepkK',
+ traits: {
+ subscribe: true,
+ },
+ context: {
+ traits: {
+ email: 'test@rudderstack.com',
+ phone: '+12 345 678 900',
+ consent: 'email',
+ },
+ },
+ timestamp: '2020-01-21T00:21:34.208Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event type random is not supported',
+ statTags: {
+ destType: 'KLAVIYO',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/klaviyo/router/data.ts b/test/integrations/destinations/klaviyo/router/data.ts
new file mode 100644
index 0000000000..818089a722
--- /dev/null
+++ b/test/integrations/destinations/klaviyo/router/data.ts
@@ -0,0 +1,364 @@
+export const data = [
+ {
+ id: 'klaviyo-router-test-1',
+ name: 'klaviyo',
+ description: 'Basic Router Test to test multiple payloads',
+ scenario: 'Framework',
+ successCriteria: 'All the subscription events should be batched',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'test',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ email: 'test@rudderstack.com',
+ phone: '+12 345 578 900',
+ userId: 'Testc',
+ title: 'Developer',
+ organization: 'Rudder',
+ city: 'Tokyo',
+ region: 'Kanto',
+ country: 'JP',
+ zip: '100-0001',
+ Flagged: false,
+ Residence: 'Shibuya',
+ properties: { consent: ['email', 'sms'] },
+ },
+ locale: 'en-US',
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: { All: true },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ {
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'test',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ email: 'test@rudderstack.com',
+ phone: '+12 345 578 900',
+ userId: 'test',
+ title: 'Developer',
+ organization: 'Rudder',
+ city: 'Tokyo',
+ region: 'Kanto',
+ country: 'JP',
+ zip: '100-0001',
+ Flagged: false,
+ Residence: 'Shibuya',
+ properties: { listId: 'XUepkK', subscribe: true, consent: ['email', 'sms'] },
+ },
+ locale: 'en-US',
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: { All: true },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ {
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ message: {
+ userId: 'user123',
+ type: 'group',
+ groupId: 'XUepkK',
+ traits: { subscribe: true },
+ context: {
+ traits: {
+ email: 'test@rudderstack.com',
+ phone: '+12 345 678 900',
+ consent: ['email'],
+ },
+ ip: '14.5.67.21',
+ library: { name: 'http' },
+ },
+ timestamp: '2020-01-21T00:21:34.208Z',
+ },
+ },
+ {
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ metadata: { jobId: 4, userId: 'u1' },
+ message: {
+ userId: 'user123',
+ type: 'random',
+ groupId: 'XUepkK',
+ traits: { subscribe: true },
+ context: {
+ traits: {
+ email: 'test@rudderstack.com',
+ phone: '+12 345 678 900',
+ consent: 'email',
+ },
+ ip: '14.5.67.21',
+ library: { name: 'http' },
+ },
+ timestamp: '2020-01-21T00:21:34.208Z',
+ },
+ },
+ {
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ metadata: { jobId: 5, userId: 'u1' },
+ message: {
+ userId: 'user123',
+ type: 'group',
+ groupId: '',
+ traits: { subscribe: true },
+ context: {
+ traits: {
+ email: 'test@rudderstack.com',
+ phone: '+12 345 678 900',
+ consent: 'email',
+ },
+ ip: '14.5.67.21',
+ library: { name: 'http' },
+ },
+ timestamp: '2020-01-21T00:21:34.208Z',
+ },
+ },
+ ],
+ destType: 'klaviyo',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs',
+ headers: {
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ Accept: 'application/json',
+ revision: '2023-02-22',
+ },
+ params: {},
+ body: {
+ JSON: {
+ data: {
+ type: 'profile-subscription-bulk-create-job',
+ attributes: {
+ list_id: 'XUepkK',
+ subscriptions: [
+ { email: 'test@rudderstack.com', phone_number: '+12 345 678 900' },
+ {
+ email: 'test@rudderstack.com',
+ phone_number: '+12 345 578 900',
+ channels: { email: ['MARKETING'], sms: ['MARKETING'] },
+ },
+ ],
+ },
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ {
+ version: '1',
+ type: 'REST',
+ method: 'PATCH',
+ endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX',
+ headers: {
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ Accept: 'application/json',
+ revision: '2023-02-22',
+ },
+ params: {},
+ body: {
+ JSON: {
+ data: {
+ type: 'profile',
+ attributes: {
+ external_id: 'test',
+ email: 'test@rudderstack.com',
+ first_name: 'Test',
+ last_name: 'Rudderlabs',
+ phone_number: '+12 345 578 900',
+ title: 'Developer',
+ organization: 'Rudder',
+ location: {
+ city: 'Tokyo',
+ region: 'Kanto',
+ country: 'JP',
+ zip: '100-0001',
+ },
+ properties: { Flagged: false, Residence: 'Shibuya' },
+ },
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 3, userId: 'u1' },
+ { jobId: 2, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'PATCH',
+ endpoint: 'https://a.klaviyo.com/api/profiles/01GW3PHVY0MTCDGS0A1612HARX',
+ headers: {
+ Authorization: 'Klaviyo-API-Key dummyPrivateApiKey',
+ 'Content-Type': 'application/json',
+ Accept: 'application/json',
+ revision: '2023-02-22',
+ },
+ params: {},
+ body: {
+ JSON: {
+ data: {
+ type: 'profile',
+ attributes: {
+ external_id: 'test',
+ email: 'test@rudderstack.com',
+ first_name: 'Test',
+ last_name: 'Rudderlabs',
+ phone_number: '+12 345 578 900',
+ title: 'Developer',
+ organization: 'Rudder',
+ location: {
+ city: 'Tokyo',
+ region: 'Kanto',
+ country: 'JP',
+ zip: '100-0001',
+ },
+ properties: { Flagged: false, Residence: 'Shibuya' },
+ },
+ id: '01GW3PHVY0MTCDGS0A1612HARX',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ },
+ {
+ metadata: [{ jobId: 4, userId: 'u1' }],
+ batched: false,
+ statusCode: 400,
+ error: 'Event type random is not supported',
+ statTags: {
+ destType: 'KLAVIYO',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ },
+ {
+ metadata: [{ jobId: 5, userId: 'u1' }],
+ batched: false,
+ statusCode: 400,
+ error: 'groupId is a required field for group events',
+ statTags: {
+ destType: 'KLAVIYO',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ destination: {
+ Config: { publicApiKey: 'dummyPublicApiKey', privateApiKey: 'dummyPrivateApiKey' },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/kustomer/network.ts b/test/integrations/destinations/kustomer/network.ts
new file mode 100644
index 0000000000..527b47ce2f
--- /dev/null
+++ b/test/integrations/destinations/kustomer/network.ts
@@ -0,0 +1,423 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://api.kustomerapp.com/v1/customers/externalId=annodD',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ data: {
+ type: 'customer',
+ id: '58210c3db0f09110006b7953',
+ attributes: {
+ name: 'AnnoD',
+ displayName: 'AnnoD',
+ displayColor: 'yellow',
+ displayIcon: 'flower',
+ externalId: 'annodD',
+ externalIds: [
+ {
+ externalId: 'annodD',
+ verified: true,
+ id: null,
+ },
+ ],
+ sharedExternalIds: [],
+ signedUpAt: null,
+ avatarUrl: null,
+ username: null,
+ emails: [
+ {
+ email: 'annod@kustomer.com',
+ verified: true,
+ type: 'home',
+ id: null,
+ },
+ ],
+ sharedEmails: [
+ {
+ email: 'annod@kustomer.com',
+ verified: false,
+ type: 'home',
+ id: null,
+ },
+ ],
+ phones: [],
+ sharedPhones: [],
+ socials: [],
+ sharedSocials: [],
+ urls: [],
+ locations: [],
+ activeUsers: [],
+ watchers: [],
+ recentLocation: {
+ updatedAt: '2016-11-07T23:22:01.746Z',
+ },
+ locale: null,
+ timeZone: null,
+ birthdayAt: null,
+ gender: null,
+ presence: 'offline',
+ createdAt: '2016-11-07T23:20:29.080Z',
+ updatedAt: '2016-11-09T04:47:07.036Z',
+ modifiedAt: '2016-11-09T04:47:07.036Z',
+ lastSeenAt: '2016-11-07T23:23:51.582Z',
+ lastActivityAt: '2016-11-09T04:47:07.036Z',
+ lastCustomerActivityAt: '2016-11-07T23:23:51.582Z',
+ lastMessageIn: {
+ sentAt: '2016-11-07T23:22:02.281Z',
+ sentiment: null,
+ },
+ lastConversation: {
+ id: '58210c99b0f09110006b7969',
+ sentiment: {
+ confidence: 0.649023,
+ polarity: 1,
+ },
+ tags: [],
+ },
+ conversationCounts: {
+ all: 3,
+ snoozed: 0,
+ open: 2,
+ done: 1,
+ },
+ preview: {
+ previewAt: '2016-11-07T23:23:26.039Z',
+ type: 'message_out',
+ text: 'dfsd fsdsfdsfdsf',
+ subject: 'Hi, do you guys have an XXL hoodie',
+ },
+ tags: [],
+ sentiment: {
+ polarity: 1,
+ confidence: 0.649023,
+ },
+ progressiveStatus: 'open',
+ verified: true,
+ rev: 37,
+ },
+ relationships: {
+ org: {
+ links: {
+ self: '/v1/orgs/57f29863a1dbf61100e6aa92',
+ },
+ data: {
+ type: 'org',
+ id: '57f29863a1dbf61100e6aa92',
+ },
+ },
+ messages: {
+ links: {
+ self: '/v1/customers/58210c3db0f09110006b7953/messages',
+ },
+ },
+ modifiedBy: {
+ links: {
+ self: '/v1/users/58190b991f2932100010d683',
+ },
+ data: {
+ type: 'user',
+ id: '58190b991f2932100010d683',
+ },
+ },
+ },
+ links: {
+ self: '/v1/customers/58210c3db0f09110006b7953',
+ },
+ },
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.kustomerapp.com/v1/customers/externalId=58210c3db0f09110006b7953',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ data: {
+ type: 'customer',
+ id: '58210c3db0f09110006b7953',
+ attributes: {
+ name: 'AnnoD',
+ displayName: 'AnnoD',
+ displayColor: 'yellow',
+ displayIcon: 'flower',
+ externalId: 'annodD',
+ externalIds: [
+ {
+ externalId: 'annodD',
+ verified: true,
+ id: null,
+ },
+ ],
+ sharedExternalIds: [],
+ signedUpAt: null,
+ avatarUrl: null,
+ username: null,
+ emails: [
+ {
+ email: 'annod@kustomer.com',
+ verified: true,
+ type: 'home',
+ id: null,
+ },
+ ],
+ sharedEmails: [
+ {
+ email: 'annod@kustomer.com',
+ verified: false,
+ type: 'home',
+ id: null,
+ },
+ ],
+ phones: [],
+ sharedPhones: [],
+ socials: [],
+ sharedSocials: [],
+ urls: [],
+ locations: [],
+ activeUsers: [],
+ watchers: [],
+ recentLocation: {
+ updatedAt: '2016-11-07T23:22:01.746Z',
+ },
+ locale: null,
+ timeZone: null,
+ birthdayAt: null,
+ gender: null,
+ presence: 'offline',
+ createdAt: '2016-11-07T23:20:29.080Z',
+ updatedAt: '2016-11-09T04:47:07.036Z',
+ modifiedAt: '2016-11-09T04:47:07.036Z',
+ lastSeenAt: '2016-11-07T23:23:51.582Z',
+ lastActivityAt: '2016-11-09T04:47:07.036Z',
+ lastCustomerActivityAt: '2016-11-07T23:23:51.582Z',
+ lastMessageIn: {
+ sentAt: '2016-11-07T23:22:02.281Z',
+ sentiment: null,
+ },
+ lastConversation: {
+ id: '58210c99b0f09110006b7969',
+ sentiment: {
+ confidence: 0.649023,
+ polarity: 1,
+ },
+ tags: [],
+ },
+ conversationCounts: {
+ all: 3,
+ snoozed: 0,
+ open: 2,
+ done: 1,
+ },
+ preview: {
+ previewAt: '2016-11-07T23:23:26.039Z',
+ type: 'message_out',
+ text: 'dfsd fsdsfdsfdsf',
+ subject: 'Hi, do you guys have an XXL hoodie',
+ },
+ tags: [],
+ sentiment: {
+ polarity: 1,
+ confidence: 0.649023,
+ },
+ progressiveStatus: 'open',
+ verified: true,
+ rev: 37,
+ },
+ relationships: {
+ org: {
+ links: {
+ self: '/v1/orgs/57f29863a1dbf61100e6aa92',
+ },
+ data: {
+ type: 'org',
+ id: '57f29863a1dbf61100e6aa92',
+ },
+ },
+ messages: {
+ links: {
+ self: '/v1/customers/58210c3db0f09110006b7953/messages',
+ },
+ },
+ modifiedBy: {
+ links: {
+ self: '/v1/users/58190b991f2932100010d683',
+ },
+ data: {
+ type: 'user',
+ id: '58190b991f2932100010d683',
+ },
+ },
+ },
+ links: {
+ self: '/v1/customers/58210c3db0f09110006b7953',
+ },
+ },
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.prod2.kustomerapp.com/v1/customers/externalId=58210c3db0f09110006b7953',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ data: {
+ type: 'customer',
+ id: '58210c3db0f09110006b7953',
+ attributes: {
+ name: 'AnnoD',
+ displayName: 'AnnoD',
+ displayColor: 'yellow',
+ displayIcon: 'flower',
+ externalId: 'annodD',
+ externalIds: [
+ {
+ externalId: 'annodD',
+ verified: true,
+ id: null,
+ },
+ ],
+ sharedExternalIds: [],
+ signedUpAt: null,
+ avatarUrl: null,
+ username: null,
+ emails: [
+ {
+ email: 'annod@kustomer.com',
+ verified: true,
+ type: 'home',
+ id: null,
+ },
+ ],
+ sharedEmails: [
+ {
+ email: 'annod@kustomer.com',
+ verified: false,
+ type: 'home',
+ id: null,
+ },
+ ],
+ phones: [],
+ sharedPhones: [],
+ socials: [],
+ sharedSocials: [],
+ urls: [],
+ locations: [],
+ activeUsers: [],
+ watchers: [],
+ recentLocation: {
+ updatedAt: '2016-11-07T23:22:01.746Z',
+ },
+ locale: null,
+ timeZone: null,
+ birthdayAt: null,
+ gender: null,
+ presence: 'offline',
+ createdAt: '2016-11-07T23:20:29.080Z',
+ updatedAt: '2016-11-09T04:47:07.036Z',
+ modifiedAt: '2016-11-09T04:47:07.036Z',
+ lastSeenAt: '2016-11-07T23:23:51.582Z',
+ lastActivityAt: '2016-11-09T04:47:07.036Z',
+ lastCustomerActivityAt: '2016-11-07T23:23:51.582Z',
+ lastMessageIn: {
+ sentAt: '2016-11-07T23:22:02.281Z',
+ sentiment: null,
+ },
+ lastConversation: {
+ id: '58210c99b0f09110006b7969',
+ sentiment: {
+ confidence: 0.649023,
+ polarity: 1,
+ },
+ tags: [],
+ },
+ conversationCounts: {
+ all: 3,
+ snoozed: 0,
+ open: 2,
+ done: 1,
+ },
+ preview: {
+ previewAt: '2016-11-07T23:23:26.039Z',
+ type: 'message_out',
+ text: 'dfsd fsdsfdsfdsf',
+ subject: 'Hi, do you guys have an XXL hoodie',
+ },
+ tags: [],
+ sentiment: {
+ polarity: 1,
+ confidence: 0.649023,
+ },
+ progressiveStatus: 'open',
+ verified: true,
+ rev: 37,
+ },
+ relationships: {
+ org: {
+ links: {
+ self: '/v1/orgs/57f29863a1dbf61100e6aa92',
+ },
+ data: {
+ type: 'org',
+ id: '57f29863a1dbf61100e6aa92',
+ },
+ },
+ messages: {
+ links: {
+ self: '/v1/customers/58210c3db0f09110006b7953/messages',
+ },
+ },
+ modifiedBy: {
+ links: {
+ self: '/v1/users/58190b991f2932100010d683',
+ },
+ data: {
+ type: 'user',
+ id: '58190b991f2932100010d683',
+ },
+ },
+ },
+ links: {
+ self: '/v1/customers/58210c3db0f09110006b7953',
+ },
+ },
+ },
+ status: 204,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.kustomerapp.com/v1/customers/externalId=Testc',
+ method: 'GET',
+ },
+ httpRes: { error: 'Request failed', status: 404 },
+ },
+ {
+ httpReq: {
+ url: 'https://api.kustomerapp.com/v1/customers/email=test@rudderstack.com',
+ method: 'GET',
+ },
+ httpRes: { error: 'Request failed', status: 404 },
+ },
+ {
+ httpReq: {
+ url: 'https://api.kustomerapp.com/v1/customers/externalId=97c46c81-3140-456d-b2a9-690d70aaca35',
+ method: 'GET',
+ },
+ httpRes: { error: 'Request failed', status: 404 },
+ },
+ {
+ httpReq: {
+ url: 'https://api.kustomerapp.com/v1/customers/externalId=testc',
+ method: 'GET',
+ },
+ httpRes: { error: 'Request failed', status: 404 },
+ },
+];
diff --git a/test/integrations/destinations/kustomer/processor/data.ts b/test/integrations/destinations/kustomer/processor/data.ts
new file mode 100644
index 0000000000..ba8407baaf
--- /dev/null
+++ b/test/integrations/destinations/kustomer/processor/data.ts
@@ -0,0 +1,1901 @@
+export const data = [
+ {
+ name: 'kustomer',
+ description: 'Test 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'Testc',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ name: 'Test Rudderlabs',
+ email: 'test@rudderstack.com',
+ phone: '+12345578900',
+ birthday: '2005-01-01T23:28:56.782Z',
+ userId: 'Testc',
+ address: {
+ street: '24 Dovers Lane',
+ city: 'Miami',
+ state: 'Florida',
+ postalCode: '1890001',
+ },
+ userName: 'Testc47',
+ company: 'Rudderstack',
+ createdAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ website: 'www.mattertoast873.com',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/customers',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'Test Rudderlabs',
+ externalId: 'Testc',
+ username: 'Testc47',
+ company: 'Rudderstack',
+ signedUpAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ locale: 'en-US',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ birthdayAt: '2005-01-01T23:28:56.782Z',
+ emails: [
+ {
+ type: 'home',
+ email: 'test@rudderstack.com',
+ },
+ ],
+ phones: [
+ {
+ type: 'home',
+ phone: '+12345578900',
+ },
+ ],
+ urls: [
+ {
+ url: 'www.mattertoast873.com',
+ },
+ ],
+ locations: [
+ {
+ type: 'home',
+ address: '24 Dovers Lane Miami Florida 1890001',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 1',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ userId: '58210c3db0f09110006b7953',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ name: 'Ano Domeni',
+ phone: '+12345578000',
+ birthday: '2005-01-01T23:28:56.782Z',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint:
+ 'https://api.kustomerapp.com/v1/customers/58210c3db0f09110006b7953?replace=false',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'Ano Domeni',
+ externalId: '58210c3db0f09110006b7953',
+ locale: 'en-US',
+ birthdayAt: '2005-01-01T23:28:56.782Z',
+ phones: [
+ {
+ type: 'home',
+ phone: '+12345578000',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 2',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'screen',
+ event: 'Test-Event-Screen',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'Testc',
+ channel: 'mobile',
+ context: {
+ os: {
+ name: 'Android',
+ version: '10',
+ },
+ app: {
+ name: 'KlaviyoTest',
+ build: '1',
+ version: '1.0',
+ namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp',
+ },
+ device: {
+ id: '9c6bd77ea9da3e68',
+ name: 'raphaelin',
+ type: 'android',
+ model: 'Redmi K20 Pro',
+ manufacturer: 'Xiaomi',
+ },
+ locale: 'en-IN',
+ screen: {
+ width: 1080,
+ height: 2210,
+ density: 440,
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.2',
+ },
+ network: {
+ wifi: true,
+ carrier: 'airtel',
+ cellular: true,
+ bluetooth: false,
+ },
+ timezone: 'Asia/Kolkata',
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)',
+ },
+ rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c',
+ messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce',
+ properties: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ originalServing: '2021-01-25T15:32:56.409Z',
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'Testc',
+ },
+ event: {
+ name: 'Screen-Viewed-Test-Event-Screen',
+ meta: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ originalServing: '2021-01-25T15:32:56.409Z',
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ name: 'Cart-Viewed',
+ type: 'page',
+ sentAt: '2021-01-03T17:02:53.197Z',
+ userId: 'user@doe',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ referrer: 'morkey',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ traits: {
+ userId: 'userid',
+ profession: 'Student',
+ anonymousId: 'd80b66d5-b33d-412d-866f-r4fft5841af',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ category: 'Cart',
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '15129730-eb00-4db7-8db2-799566ccb2ef',
+ properties: {
+ url: 'http://morkey.in',
+ name: 'Cart Viewed',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ category: 'Cart',
+ referrer: 'morkey',
+ domain: 'morkey.com',
+ },
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.195Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'user@doe',
+ },
+ event: {
+ name: 'Web-Page-Viewed-Cart-Viewed',
+ meta: {
+ url: 'http://morkey.in',
+ name: 'Cart Viewed',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ category: 'Cart',
+ referrer: 'morkey',
+ domain: 'morkey.com',
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 4',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'page',
+ sentAt: '2021-01-03T17:02:53.197Z',
+ userId: 'user@doe',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ referrer: 'morkey',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ traits: {
+ userId: 'userid',
+ profession: 'Student',
+ anonymousId: 'd80b66d5-b33d-412d-866f-r4fft5841af',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ category: 'Cart',
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '15129730-eb00-4db7-8db2-799566ccb2ef',
+ properties: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ category: 'Cart',
+ referrer: 'morkey',
+ domain: 'morkey.com',
+ kustomerTrackingId: '829131sjad',
+ kustomerSessionId: 'hsad522',
+ },
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.195Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'user@doe',
+ },
+ event: {
+ name: 'Web-Page-Viewed',
+ sessionId: 'hsad522',
+ trackingId: '829131sjad',
+ meta: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ category: 'Cart',
+ referrer: 'morkey',
+ domain: 'morkey.com',
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 5',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'track',
+ event: 'Tracking-Weekender',
+ sentAt: '2021-01-03T17:02:53.197Z',
+ userId: 'user@doe',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ referrer: 'morkey',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '15129730-eb00-4db7-8db2-799566ccb2ef',
+ properties: {
+ YearServicedNum: 211,
+ region: 'strapis',
+ kustomerTrackingId: 'sahetwiac',
+ kustomerSessionId: '63nsa22',
+ },
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ locale: 'en-US',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.195Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'user@doe',
+ },
+ event: {
+ name: 'Tracking-Weekender',
+ sessionId: '63nsa22',
+ trackingId: 'sahetwiac',
+ meta: {
+ YearServicedNum: 211,
+ region: 'strapis',
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 6',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'track',
+ event: 'Tracking-Weekender2',
+ sentAt: '2021-01-03T17:02:53.197Z',
+ userId: 'user@doe',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ referrer: 'morkey',
+ },
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '15129730-eb00-4db7-8db2-799566ccb2ef',
+ properties: {
+ YearServicedNum: 211,
+ 'reg_8-821x': false,
+ kustomer_tracking_id: 'sahetwiac',
+ kustomer_session_id: '63nsa22',
+ },
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ locale: 'en-US',
+ originalTimestamp: '2021-01-03T17:02:53.195Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ FORM: {},
+ JSON: {
+ event: {
+ meta: {
+ YearServicedNum: 211,
+ 'reg_8-821x': false,
+ },
+ name: 'Tracking-Weekender2',
+ sessionId: '63nsa22',
+ trackingId: 'sahetwiac',
+ },
+ identity: {
+ externalId: 'user@doe',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 7',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ genericPage: true,
+ },
+ },
+ message: {
+ type: 'page',
+ name: 'Unfinished page',
+ sentAt: '2021-01-03T17:02:53.197Z',
+ userId: 'user@doe',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ referrer: 'morkey',
+ },
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '15129730-eb00-4db7-8db2-799566ccb2ef',
+ properties: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ category: 'Cart',
+ referrer: 'morkey',
+ domain: 'morkey.com',
+ },
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ locale: 'en-US',
+ originalTimestamp: '2021-01-03T17:02:53.195Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'user@doe',
+ },
+ event: {
+ name: 'Web-Page-Viewed',
+ meta: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ category: 'Cart',
+ referrer: 'morkey',
+ domain: 'morkey.com',
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 8',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ genericScreen: true,
+ },
+ },
+ message: {
+ type: 'screen',
+ event: 'Test-Event-Screen',
+ sentAt: '2021-01-25T16:12:02.048Z',
+ userId: 'Testc',
+ channel: 'mobile',
+ context: {
+ os: {
+ name: 'Android',
+ version: '10',
+ },
+ app: {
+ name: 'KlaviyoTest',
+ build: '1',
+ version: '1.0',
+ namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp',
+ },
+ device: {
+ id: '9c6bd77ea9da3e68',
+ name: 'raphaelin',
+ type: 'android',
+ model: 'Redmi K20 Pro',
+ manufacturer: 'Xiaomi',
+ },
+ locale: 'en-IN',
+ screen: {
+ width: 1080,
+ height: 2210,
+ density: 440,
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.2',
+ },
+ network: {
+ wifi: true,
+ carrier: 'airtel',
+ cellular: true,
+ bluetooth: false,
+ },
+ timezone: 'Asia/Kolkata',
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)',
+ },
+ rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c',
+ messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce',
+ properties: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ originalServing: '2021-01-25T15:32:56.409Z',
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-25T15:32:56.409Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'Testc',
+ },
+ event: {
+ name: 'Screen-Viewed',
+ meta: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ originalServing: '2021-01-25T15:32:56.409Z',
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 9',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'Testc',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ email: 'test@rudderstack.com',
+ phone: '+12345578900',
+ birthday: '2005-01-01T23:28:56.782Z',
+ userId: 'Testc',
+ address: {
+ street: '24 Dovers Lane',
+ city: 'Miami',
+ state: 'Florida',
+ postalCode: '1890001',
+ },
+ userName: 'Testc47',
+ company: 'Rudderstack',
+ createdAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ website: 'www.mattertoast873.com',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/customers',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'Test Rudderlabs',
+ externalId: 'Testc',
+ username: 'Testc47',
+ company: 'Rudderstack',
+ signedUpAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ locale: 'en-US',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ birthdayAt: '2005-01-01T23:28:56.782Z',
+ emails: [
+ {
+ type: 'home',
+ email: 'test@rudderstack.com',
+ },
+ ],
+ phones: [
+ {
+ type: 'home',
+ phone: '+12345578900',
+ },
+ ],
+ urls: [
+ {
+ url: 'www.mattertoast873.com',
+ },
+ ],
+ locations: [
+ {
+ type: 'home',
+ address: '24 Dovers Lane Miami Florida 1890001',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 10',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'Testc',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ emails: [
+ {
+ type: 'home',
+ email: 'test@rudderstack.com',
+ },
+ ],
+ phones: [
+ {
+ type: 'home',
+ phone: '+12345578900',
+ },
+ ],
+ birthday: '2005-01-01T23:28:56.782Z',
+ userId: 'Testc',
+ address: 'test address string',
+ userName: 'Testc47',
+ company: 'Rudderstack',
+ createdAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ website: 'www.mattertoast873.com',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/customers',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'Test Rudderlabs',
+ externalId: 'Testc',
+ username: 'Testc47',
+ company: 'Rudderstack',
+ signedUpAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ locale: 'en-US',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ birthdayAt: '2005-01-01T23:28:56.782Z',
+ emails: [
+ {
+ type: 'home',
+ email: 'test@rudderstack.com',
+ },
+ ],
+ phones: [
+ {
+ type: 'home',
+ phone: '+12345578900',
+ },
+ ],
+ urls: [
+ {
+ url: 'www.mattertoast873.com',
+ },
+ ],
+ locations: [
+ {
+ type: 'home',
+ address: 'test address string',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 11',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ },
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'Testc',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ emails: [
+ {
+ type: 'home',
+ email: 'test@rudderstack.com',
+ },
+ ],
+ phones: [
+ {
+ type: 'home',
+ phone: '+12345578900',
+ },
+ ],
+ birthday: '2005-01-01T23:28:56.782Z',
+ userId: 'Testc',
+ address: 'test address string',
+ userName: 'Testc47',
+ company: 'Rudderstack',
+ createdAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ website: 'www.mattertoast873.com',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ externalId: [
+ {
+ type: 'kustomerId',
+ id: 'abcd1234',
+ },
+ ],
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.kustomerapp.com/v1/customers/abcd1234?replace=false',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'Test Rudderlabs',
+ externalId: 'Testc',
+ username: 'Testc47',
+ company: 'Rudderstack',
+ signedUpAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ locale: 'en-US',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@Testc',
+ url: 'http://twitter.com/Testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'Testc',
+ url: 'http://facebook.com/Testc',
+ },
+ ],
+ birthdayAt: '2005-01-01T23:28:56.782Z',
+ emails: [
+ {
+ type: 'home',
+ email: 'test@rudderstack.com',
+ },
+ ],
+ phones: [
+ {
+ type: 'home',
+ phone: '+12345578900',
+ },
+ ],
+ urls: [
+ {
+ url: 'www.mattertoast873.com',
+ },
+ ],
+ locations: [
+ {
+ type: 'home',
+ address: 'test address string',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 12',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ genericScreen: true,
+ },
+ },
+ message: {
+ type: 'screen',
+ event: 'Test-Event-Screen',
+ userId: 'utsabc',
+ channel: 'mobile',
+ context: {
+ os: {
+ name: 'Android',
+ version: '10',
+ },
+ app: {
+ name: 'KlaviyoTest',
+ build: '1',
+ version: '1.0',
+ namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp',
+ },
+ device: {
+ id: '9c6bd77ea9da3e68',
+ name: 'raphaelin',
+ type: 'android',
+ model: 'Redmi K20 Pro',
+ manufacturer: 'Xiaomi',
+ },
+ locale: 'en-IN',
+ screen: {
+ width: 1080,
+ height: 2210,
+ density: 440,
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.2',
+ },
+ network: {
+ wifi: true,
+ carrier: 'airtel',
+ cellular: true,
+ bluetooth: false,
+ },
+ timezone: 'Asia/Kolkata',
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)',
+ sessionId: 'hsad522',
+ },
+ rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c',
+ messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce',
+ properties: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2023-01-10T15:32:56.409Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'utsabc',
+ },
+ event: {
+ name: 'Screen-Viewed',
+ sessionId: 'hsad522',
+ meta: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'kustomer',
+ description: 'Test 13',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ baseEndpoint: 'https://api.prod2.kustomerapp.com',
+ genericScreen: true,
+ },
+ },
+ message: {
+ type: 'screen',
+ event: 'Test-Event-Screen',
+ userId: 'Testc',
+ channel: 'mobile',
+ context: {
+ os: {
+ name: 'Android',
+ version: '10',
+ },
+ app: {
+ name: 'KlaviyoTest',
+ build: '1',
+ version: '1.0',
+ namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp',
+ },
+ device: {
+ id: '9c6bd77ea9da3e68',
+ name: 'raphaelin',
+ type: 'android',
+ model: 'Redmi K20 Pro',
+ manufacturer: 'Xiaomi',
+ },
+ locale: 'en-IN',
+ screen: {
+ width: 1080,
+ height: 2210,
+ density: 440,
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.2',
+ },
+ network: {
+ wifi: true,
+ carrier: 'airtel',
+ cellular: true,
+ bluetooth: false,
+ },
+ timezone: 'Asia/Kolkata',
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 10; Redmi K20 Pro MIUI/V12.0.4.0.QFKINXM)',
+ sessionId: 'hsad522',
+ },
+ rudderId: 'b7b24f86-f7bf-46d8-b2b4-ccafc080239c',
+ messageId: '1611588776408-ee5a3212-fbf9-4cbb-bbad-3ed0f7c6a2ce',
+ properties: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ },
+ anonymousId: '9c6bd77ea9da3e68',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2023-01-10T15:32:56.409Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: {
+ externalId: 'Testc',
+ },
+ event: {
+ name: 'Screen-Viewed',
+ sessionId: 'hsad522',
+ meta: {
+ hasAccount: 'true',
+ YearSelectedNum: 1801,
+ },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/kustomer/router/data.ts b/test/integrations/destinations/kustomer/router/data.ts
new file mode 100644
index 0000000000..06f6243cf2
--- /dev/null
+++ b/test/integrations/destinations/kustomer/router/data.ts
@@ -0,0 +1,330 @@
+export const data = [
+ {
+ name: 'kustomer',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'testc',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: {
+ name: 'test Rudderlabs',
+ email: 'test@rudderstack.com',
+ phone: '+12345578900',
+ birthday: '2005-01-01T23:28:56.782Z',
+ userId: 'testc',
+ address: {
+ street: '24 Dovers Lane',
+ city: 'Miami',
+ state: 'Florida',
+ postalCode: '1890001',
+ },
+ userName: 'testc47',
+ company: 'Rudderstack',
+ createdAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatar: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ website: 'www.mattertoast873.com',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@testc',
+ url: 'http://twitter.com/testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'testc',
+ url: 'http://facebook.com/testc',
+ },
+ ],
+ },
+ locale: 'en-US',
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ integrations: { All: true },
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ destination: {
+ Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false },
+ },
+ },
+ {
+ message: {
+ type: 'track',
+ event: 'Tracking-Weekender',
+ sentAt: '2021-01-03T17:02:53.197Z',
+ userId: 'user@doe',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ referrer: 'morkey',
+ },
+ locale: 'en-US',
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '15129730-eb00-4db7-8db2-799566ccb2ef',
+ properties: {
+ YearServicedNum: 211,
+ region: 'strapis',
+ kustomerTrackingId: 'sahetwiac',
+ kustomerSessionId: '63nsa22',
+ },
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ locale: 'en-US',
+ integrations: { All: true },
+ originalTimestamp: '2021-01-03T17:02:53.195Z',
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ destination: {
+ Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false },
+ },
+ },
+ {
+ message: {
+ type: 'track',
+ event: 'Tracking-Weekender',
+ sentAt: '2021-01-03T17:02:53.197Z',
+ userId: 'user@doe',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'http://morkey.in',
+ path: '/cart',
+ title: 'miphone',
+ search: 'MI',
+ referrer: 'morkey',
+ },
+ locale: 'en-US',
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '15129730-eb00-4db7-8db2-799566ccb2ef',
+ properties: {
+ YearServicedNum: 211,
+ region: 'strapis',
+ kustomerTrackingId: 'sahetwiac',
+ kustomerSessionId: '63nsa22',
+ },
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ locale: 'en-US',
+ integrations: { All: true },
+ originalTimestamp: '2021-01-03T17:02:53.195Z',
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ destination: {
+ Config: {
+ baseEndpoint: 'https://api.prod2.kustomerapp.com',
+ apiKey: 'dummyApiKey',
+ genericPage: false,
+ genericScreen: false,
+ },
+ },
+ },
+ ],
+ destType: 'kustomer',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/customers',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'test Rudderlabs',
+ externalId: 'testc',
+ username: 'testc47',
+ company: 'Rudderstack',
+ signedUpAt: '2015-04-17T12:37:42.146Z',
+ lastActivityAt: '2016-04-17T12:37:42.146Z',
+ lastCustomerActivityAt: '2017-04-17T12:37:42.146Z',
+ lastSeenAt: '2017-04-17T12:37:42.146Z',
+ avatarUrl: 'https://homepages.cae.wisc.edu/~ece533/images/boat.png',
+ gender: 'm',
+ tags: ['happy', 'satisfied'],
+ locale: 'en-US',
+ socials: [
+ {
+ verified: true,
+ userid: '100',
+ type: 'twitter',
+ username: '@testc',
+ url: 'http://twitter.com/testc',
+ },
+ {
+ verified: false,
+ userid: '200',
+ type: 'facebook',
+ username: 'testc',
+ url: 'http://facebook.com/testc',
+ },
+ ],
+ birthdayAt: '2005-01-01T23:28:56.782Z',
+ emails: [{ type: 'home', email: 'test@rudderstack.com' }],
+ phones: [{ type: 'home', phone: '+12345578900' }],
+ urls: [{ url: 'www.mattertoast873.com' }],
+ locations: [{ type: 'home', address: '24 Dovers Lane Miami Florida 1890001' }],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: { externalId: 'user@doe' },
+ event: {
+ name: 'Tracking-Weekender',
+ sessionId: '63nsa22',
+ trackingId: 'sahetwiac',
+ meta: { YearServicedNum: 211, region: 'strapis' },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: { apiKey: 'dummyApiKey', genericPage: false, genericScreen: false },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.prod2.kustomerapp.com/v1/tracking/identityEvent',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ identity: { externalId: 'user@doe' },
+ event: {
+ name: 'Tracking-Weekender',
+ sessionId: '63nsa22',
+ trackingId: 'sahetwiac',
+ meta: { YearServicedNum: 211, region: 'strapis' },
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 3, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ baseEndpoint: 'https://api.prod2.kustomerapp.com',
+ apiKey: 'dummyApiKey',
+ genericPage: false,
+ genericScreen: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/lambda/router/data.ts b/test/integrations/destinations/lambda/router/data.ts
index 37b13e4d2a..cba30e0974 100644
--- a/test/integrations/destinations/lambda/router/data.ts
+++ b/test/integrations/destinations/lambda/router/data.ts
@@ -8115,9 +8115,7 @@ export const data = [
],
trait1: 'new-val',
},
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
},
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: 'c864b4cd-8f07-4922-b3d0-82ef04c987d3',
@@ -16532,9 +16530,7 @@ export const data = [
],
trait1: 'new-val',
},
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
},
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: 'c864b4cd-8f07-4922-b3d0-82ef04c987d3',
@@ -16655,12 +16651,7 @@ export const data = [
event: 'Product Purchased new',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '9f8fb785-c720-4381-a009-bf22a13f4ced',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -20622,12 +20613,7 @@ export const data = [
event: 'Product Purchased new',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '9f8fb785-c720-4381-a009-bf22a13f4ced',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -24863,19 +24849,11 @@ export const data = [
type: 'page',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '5f58d1f7-cbd6-4bff-8571-9933be7210b1',
timestamp: '2020-02-02T00:23:09.544Z',
- properties: {
- path: '/',
- title: 'Home',
- },
+ properties: { path: '/', title: 'Home' },
receivedAt: '2022-08-18T08:43:13.521+05:30',
request_ip: '[::1]',
anonymousId: 'anon-id-new',
@@ -24906,19 +24884,11 @@ export const data = [
type: 'page',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '5f58d1f7-cbd6-4bff-8571-9933be7210b1',
timestamp: '2020-02-02T00:23:09.544Z',
- properties: {
- path: '/',
- title: 'Home',
- },
+ properties: { path: '/', title: 'Home' },
receivedAt: '2022-08-18T08:43:13.521+05:30',
request_ip: '[::1]',
anonymousId: 'anon-id-new',
@@ -25035,18 +25005,11 @@ export const data = [
type: 'screen',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '1b8ee4c3-ffad-4457-b453-31b32da1dfea',
timestamp: '2020-02-02T00:23:09.544Z',
- properties: {
- prop1: '5',
- },
+ properties: { prop1: '5' },
receivedAt: '2022-08-18T08:43:13.521+05:30',
request_ip: '[::1]',
anonymousId: 'anon-id-new',
@@ -25077,18 +25040,11 @@ export const data = [
type: 'screen',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '1b8ee4c3-ffad-4457-b453-31b32da1dfea',
timestamp: '2020-02-02T00:23:09.544Z',
- properties: {
- prop1: '5',
- },
+ properties: { prop1: '5' },
receivedAt: '2022-08-18T08:43:13.521+05:30',
request_ip: '[::1]',
anonymousId: 'anon-id-new',
@@ -25203,20 +25159,12 @@ export const data = [
message: {
type: 'group',
sentAt: '2022-08-18T08:43:15.539+05:30',
- traits: {
- name: 'Company',
- industry: 'Industry',
- employees: 123,
- },
+ traits: { name: 'Company', industry: 'Industry', employees: 123 },
userId: 'user123',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
groupId: 'group1',
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
@@ -25249,20 +25197,12 @@ export const data = [
EventPayload: {
type: 'group',
sentAt: '2022-08-18T08:43:15.539+05:30',
- traits: {
- name: 'Company',
- industry: 'Industry',
- employees: 123,
- },
+ traits: { name: 'Company', industry: 'Industry', employees: 123 },
userId: 'user123',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
groupId: 'group1',
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
@@ -25384,12 +25324,8 @@ export const data = [
userId: 'user123',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
messageId: '3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d',
@@ -25425,12 +25361,8 @@ export const data = [
userId: 'user123',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
messageId: '3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d',
@@ -25560,11 +25492,7 @@ export const data = [
batchedRequest: {
payload:
'[{"type":"track","event":"Product Purchased new","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"identified user id","context":{"ip":"14.5.67.21","library":{"name":"http"}},"rudderId":"daf823fb-e8d3-413a-8313-d34cd756f968","messageId":"9f8fb785-c720-4381-a009-bf22a13f4ced","timestamp":"2020-02-02T00:23:09.544Z","properties":{"data":[{"id":6104546,"url":"https://api.github.com/repos/mralexgray/-REPONAME","fork":false,"name":"-REPONAME","size":48,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/-REPONAME.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk2MTA0NTQ2","private":false,"ssh_url":"git@github.com:mralexgray/-REPONAME.git","svn_url":"https://github.com/mralexgray/-REPONAME","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/-REPONAME","keys_url":"https://api.github.com/repos/mralexgray/-REPONAME/keys{/key_id}","language":null,"tags_url":"https://api.github.com/repos/mralexgray/-REPONAME/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/-REPONAME/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/-REPONAME.git","forks_url":"https://api.github.com/repos/mralexgray/-REPONAME/forks","full_name":"mralexgray/-REPONAME","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/-REPONAME/hooks","pulls_url":"https://api.github.com/repos/mralexgray/-REPONAME/pulls{/number}","pushed_at":"2012-10-06T16:37:39Z","teams_url":"https://api.github.com/repos/mralexgray/-REPONAME/teams","trees_url":"https://api.github.com/repos/mralexgray/-REPONAME/git/trees{/sha}","created_at":"2012-10-06T16:37:39Z","events_url":"https://api.github.com/repos/mralexgray/-REPONAME/events","has_issues":true,"issues_url":"https://api.github.com/repos/mralexgray/-REPONAME/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/-REPONAME/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/-REPONAME/merges","mirror_url":null,"updated_at":"2013-01-12T13:39:30Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/-REPONAME/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/-REPONAME/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/-REPONAME/compare/{base}...{head}","description":null,"forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/-REPONAME/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/-REPONAME/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/-REPONAME/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/-REPONAME/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/-REPONAME/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/-REPONAME/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/-REPONAME/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/-REPONAME/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/-REPONAME/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/-REPONAME/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/-REPONAME/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/-REPONAME/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/-REPONAME/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/-REPONAME/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/-REPONAME/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/-REPONAME/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/-REPONAME/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/-REPONAME/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/-REPONAME/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/-REPONAME/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/-REPONAME/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":104510411,"url":"https://api.github.com/repos/mralexgray/...","fork":true,"name":"...","size":113,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/....git","license":{"key":"mit","url":"https://api.github.com/licenses/mit","name":"MIT License","node_id":"MDc6TGljZW5zZTEz","spdx_id":"MIT"},"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ1MTA0MTE=","private":false,"ssh_url":"git@github.com:mralexgray/....git","svn_url":"https://github.com/mralexgray/...","archived":false,"disabled":false,"has_wiki":false,"homepage":"https://driesvints.com/blog/getting-started-with-dotfiles","html_url":"https://github.com/mralexgray/...","keys_url":"https://api.github.com/repos/mralexgray/.../keys{/key_id}","language":"Shell","tags_url":"https://api.github.com/repos/mralexgray/.../tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/.../git/blobs{/sha}","clone_url":"https://github.com/mralexgray/....git","forks_url":"https://api.github.com/repos/mralexgray/.../forks","full_name":"mralexgray/...","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/.../hooks","pulls_url":"https://api.github.com/repos/mralexgray/.../pulls{/number}","pushed_at":"2017-09-15T08:27:32Z","teams_url":"https://api.github.com/repos/mralexgray/.../teams","trees_url":"https://api.github.com/repos/mralexgray/.../git/trees{/sha}","created_at":"2017-09-22T19:19:42Z","events_url":"https://api.github.com/repos/mralexgray/.../events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/.../issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/.../labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/.../merges","mirror_url":null,"updated_at":"2017-09-22T19:20:22Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/.../{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/.../commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/.../compare/{base}...{head}","description":":computer: Public repo for my personal dotfiles.","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/.../branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/.../comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/.../contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/.../git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/.../git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/.../releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/.../statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/.../assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/.../downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/.../languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/.../milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/.../stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/.../deployments","git_commits_url":"https://api.github.com/repos/mralexgray/.../git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/.../subscribers","contributors_url":"https://api.github.com/repos/mralexgray/.../contributors","issue_events_url":"https://api.github.com/repos/mralexgray/.../issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/.../subscription","collaborators_url":"https://api.github.com/repos/mralexgray/.../collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/.../issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/.../notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":58656723,"url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol","fork":true,"name":"2200087-Serial-Protocol","size":41,"forks":1,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/2200087-Serial-Protocol.git","license":{"key":"gpl-2.0","url":"https://api.github.com/licenses/gpl-2.0","name":"GNU General Public License v2.0","node_id":"MDc6TGljZW5zZTg=","spdx_id":"GPL-2.0"},"node_id":"MDEwOlJlcG9zaXRvcnk1ODY1NjcyMw==","private":false,"ssh_url":"git@github.com:mralexgray/2200087-Serial-Protocol.git","svn_url":"https://github.com/mralexgray/2200087-Serial-Protocol","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://daviddworken.com","html_url":"https://github.com/mralexgray/2200087-Serial-Protocol","keys_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/keys{/key_id}","language":"Python","tags_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/2200087-Serial-Protocol.git","forks_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/forks","full_name":"mralexgray/2200087-Serial-Protocol","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/hooks","pulls_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/pulls{/number}","pushed_at":"2016-05-12T16:07:24Z","teams_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/teams","trees_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/git/trees{/sha}","created_at":"2016-05-12T16:05:28Z","events_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/merges","mirror_url":null,"updated_at":"2016-05-12T16:05:30Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/compare/{base}...{head}","description":"A reverse engineered protocol description and accompanying code for Radioshack\'s 2200087 multimeter","forks_count":1,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/2200087-Serial-Protocol/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":13121042,"url":"https://api.github.com/repos/mralexgray/ace","fork":true,"name":"ace","size":21080,"forks":1,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/ace.git","license":{"key":"other","url":null,"name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION"},"node_id":"MDEwOlJlcG9zaXRvcnkxMzEyMTA0Mg==","private":false,"ssh_url":"git@github.com:mralexgray/ace.git","svn_url":"https://github.com/mralexgray/ace","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://ace.c9.io","html_url":"https://github.com/mralexgray/ace","keys_url":"https://api.github.com/repos/mralexgray/ace/keys{/key_id}","language":"JavaScript","tags_url":"https://api.github.com/repos/mralexgray/ace/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/ace/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/ace.git","forks_url":"https://api.github.com/repos/mralexgray/ace/forks","full_name":"mralexgray/ace","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/ace/hooks","pulls_url":"https://api.github.com/repos/mralexgray/ace/pulls{/number}","pushed_at":"2013-10-26T12:34:48Z","teams_url":"https://api.github.com/repos/mralexgray/ace/teams","trees_url":"https://api.github.com/repos/mralexgray/ace/git/trees{/sha}","created_at":"2013-09-26T11:58:10Z","events_url":"https://api.github.com/repos/mralexgray/ace/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/ace/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/ace/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/ace/merges","mirror_url":null,"updated_at":"2013-10-26T12:34:49Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/ace/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/ace/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/ace/compare/{base}...{head}","description":"Ace (Ajax.org Cloud9 Editor)","forks_count":1,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/ace/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/ace/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/ace/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/ace/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/ace/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/ace/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/ace/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/ace/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/ace/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/ace/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/ace/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/ace/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/ace/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/ace/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/ace/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/ace/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/ace/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/ace/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/ace/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/ace/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/ace/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":10791045,"url":"https://api.github.com/repos/mralexgray/ACEView","fork":true,"name":"ACEView","size":1733,"forks":1,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/ACEView.git","license":{"key":"other","url":null,"name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION"},"node_id":"MDEwOlJlcG9zaXRvcnkxMDc5MTA0NQ==","private":false,"ssh_url":"git@github.com:mralexgray/ACEView.git","svn_url":"https://github.com/mralexgray/ACEView","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/ACEView","keys_url":"https://api.github.com/repos/mralexgray/ACEView/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/ACEView/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/ACEView/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/ACEView.git","forks_url":"https://api.github.com/repos/mralexgray/ACEView/forks","full_name":"mralexgray/ACEView","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/ACEView/hooks","pulls_url":"https://api.github.com/repos/mralexgray/ACEView/pulls{/number}","pushed_at":"2014-05-09T01:36:23Z","teams_url":"https://api.github.com/repos/mralexgray/ACEView/teams","trees_url":"https://api.github.com/repos/mralexgray/ACEView/git/trees{/sha}","created_at":"2013-06-19T12:15:04Z","events_url":"https://api.github.com/repos/mralexgray/ACEView/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/ACEView/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/ACEView/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/ACEView/merges","mirror_url":null,"updated_at":"2015-11-24T01:14:10Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/ACEView/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/ACEView/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/ACEView/compare/{base}...{head}","description":"Use the wonderful ACE editor in your Cocoa applications","forks_count":1,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/ACEView/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/ACEView/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/ACEView/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/ACEView/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/ACEView/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/ACEView/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/ACEView/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/ACEView/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/ACEView/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/ACEView/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/ACEView/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/ACEView/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/ACEView/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/ACEView/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/ACEView/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/ACEView/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/ACEView/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/ACEView/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/ACEView/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/ACEView/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/ACEView/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":13623648,"url":"https://api.github.com/repos/mralexgray/ActiveLog","fork":true,"name":"ActiveLog","size":60,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/ActiveLog.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYyMzY0OA==","private":false,"ssh_url":"git@github.com:mralexgray/ActiveLog.git","svn_url":"https://github.com/mralexgray/ActiveLog","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://deepitpro.com/en/articles/ActiveLog/info/","html_url":"https://github.com/mralexgray/ActiveLog","keys_url":"https://api.github.com/repos/mralexgray/ActiveLog/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/ActiveLog/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/ActiveLog/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/ActiveLog.git","forks_url":"https://api.github.com/repos/mralexgray/ActiveLog/forks","full_name":"mralexgray/ActiveLog","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/ActiveLog/hooks","pulls_url":"https://api.github.com/repos/mralexgray/ActiveLog/pulls{/number}","pushed_at":"2011-07-03T06:28:59Z","teams_url":"https://api.github.com/repos/mralexgray/ActiveLog/teams","trees_url":"https://api.github.com/repos/mralexgray/ActiveLog/git/trees{/sha}","created_at":"2013-10-16T15:52:37Z","events_url":"https://api.github.com/repos/mralexgray/ActiveLog/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/ActiveLog/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/ActiveLog/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/ActiveLog/merges","mirror_url":null,"updated_at":"2013-10-16T15:52:37Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/ActiveLog/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/ActiveLog/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/ActiveLog/compare/{base}...{head}","description":"Shut up all logs with active filter.","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/ActiveLog/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/ActiveLog/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/ActiveLog/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/ActiveLog/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/ActiveLog/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/ActiveLog/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/ActiveLog/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/ActiveLog/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/ActiveLog/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/ActiveLog/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/ActiveLog/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/ActiveLog/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/ActiveLog/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/ActiveLog/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/ActiveLog/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/ActiveLog/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/ActiveLog/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/ActiveLog/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/ActiveLog/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/ActiveLog/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/ActiveLog/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":9716210,"url":"https://api.github.com/repos/mralexgray/adium","fork":false,"name":"adium","size":277719,"forks":37,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/adium.git","license":{"key":"other","url":null,"name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION"},"node_id":"MDEwOlJlcG9zaXRvcnk5NzE2MjEw","private":false,"ssh_url":"git@github.com:mralexgray/adium.git","svn_url":"https://github.com/mralexgray/adium","archived":false,"disabled":false,"has_wiki":false,"homepage":null,"html_url":"https://github.com/mralexgray/adium","keys_url":"https://api.github.com/repos/mralexgray/adium/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/adium/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/adium/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/adium.git","forks_url":"https://api.github.com/repos/mralexgray/adium/forks","full_name":"mralexgray/adium","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/adium/hooks","pulls_url":"https://api.github.com/repos/mralexgray/adium/pulls{/number}","pushed_at":"2013-04-26T16:43:53Z","teams_url":"https://api.github.com/repos/mralexgray/adium/teams","trees_url":"https://api.github.com/repos/mralexgray/adium/git/trees{/sha}","created_at":"2013-04-27T14:59:33Z","events_url":"https://api.github.com/repos/mralexgray/adium/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/adium/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/adium/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/adium/merges","mirror_url":null,"updated_at":"2019-12-11T06:51:45Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/adium/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/adium/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/adium/compare/{base}...{head}","description":"Official mirror of hg.adium.im","forks_count":37,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/adium/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/adium/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/adium/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/adium/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/adium/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/adium/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/adium/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/adium/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/adium/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/adium/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/adium/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/adium/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/adium/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/adium/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/adium/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/adium/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/adium/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/adium/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/adium/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/adium/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/adium/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":12752329,"url":"https://api.github.com/repos/mralexgray/ADLivelyTableView","fork":true,"name":"ADLivelyTableView","size":73,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/ADLivelyTableView.git","license":{"key":"other","url":null,"name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION"},"node_id":"MDEwOlJlcG9zaXRvcnkxMjc1MjMyOQ==","private":false,"ssh_url":"git@github.com:mralexgray/ADLivelyTableView.git","svn_url":"https://github.com/mralexgray/ADLivelyTableView","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://applidium.com/en/news/lively_uitableview/","html_url":"https://github.com/mralexgray/ADLivelyTableView","keys_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/ADLivelyTableView.git","forks_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/forks","full_name":"mralexgray/ADLivelyTableView","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/hooks","pulls_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/pulls{/number}","pushed_at":"2012-05-10T10:40:15Z","teams_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/teams","trees_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/git/trees{/sha}","created_at":"2013-09-11T09:18:01Z","events_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/merges","mirror_url":null,"updated_at":"2013-09-11T09:18:03Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/compare/{base}...{head}","description":"Lively UITableView","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/ADLivelyTableView/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":5697379,"url":"https://api.github.com/repos/mralexgray/AFIncrementalStore","fork":true,"name":"AFIncrementalStore","size":139,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AFIncrementalStore.git","license":{"key":"mit","url":"https://api.github.com/licenses/mit","name":"MIT License","node_id":"MDc6TGljZW5zZTEz","spdx_id":"MIT"},"node_id":"MDEwOlJlcG9zaXRvcnk1Njk3Mzc5","private":false,"ssh_url":"git@github.com:mralexgray/AFIncrementalStore.git","svn_url":"https://github.com/mralexgray/AFIncrementalStore","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/AFIncrementalStore","keys_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AFIncrementalStore.git","forks_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/forks","full_name":"mralexgray/AFIncrementalStore","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/pulls{/number}","pushed_at":"2012-09-01T22:46:25Z","teams_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/teams","trees_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/git/trees{/sha}","created_at":"2012-09-06T04:20:33Z","events_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/merges","mirror_url":null,"updated_at":"2013-01-12T03:15:29Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/compare/{base}...{head}","description":"Core Data Persistence with AFNetworking, Done Right","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AFIncrementalStore/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":6969621,"url":"https://api.github.com/repos/mralexgray/AFNetworking","fork":true,"name":"AFNetworking","size":4341,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AFNetworking.git","license":{"key":"mit","url":"https://api.github.com/licenses/mit","name":"MIT License","node_id":"MDc6TGljZW5zZTEz","spdx_id":"MIT"},"node_id":"MDEwOlJlcG9zaXRvcnk2OTY5NjIx","private":false,"ssh_url":"git@github.com:mralexgray/AFNetworking.git","svn_url":"https://github.com/mralexgray/AFNetworking","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://afnetworking.com","html_url":"https://github.com/mralexgray/AFNetworking","keys_url":"https://api.github.com/repos/mralexgray/AFNetworking/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AFNetworking/tags","watchers":2,"blobs_url":"https://api.github.com/repos/mralexgray/AFNetworking/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AFNetworking.git","forks_url":"https://api.github.com/repos/mralexgray/AFNetworking/forks","full_name":"mralexgray/AFNetworking","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AFNetworking/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AFNetworking/pulls{/number}","pushed_at":"2014-01-24T07:14:32Z","teams_url":"https://api.github.com/repos/mralexgray/AFNetworking/teams","trees_url":"https://api.github.com/repos/mralexgray/AFNetworking/git/trees{/sha}","created_at":"2012-12-02T17:00:04Z","events_url":"https://api.github.com/repos/mralexgray/AFNetworking/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AFNetworking/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AFNetworking/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AFNetworking/merges","mirror_url":null,"updated_at":"2014-01-24T07:14:33Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AFNetworking/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AFNetworking/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AFNetworking/compare/{base}...{head}","description":"A delightful iOS and OS X networking framework","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AFNetworking/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AFNetworking/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AFNetworking/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AFNetworking/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AFNetworking/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AFNetworking/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AFNetworking/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AFNetworking/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AFNetworking/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AFNetworking/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AFNetworking/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AFNetworking/stargazers","watchers_count":2,"deployments_url":"https://api.github.com/repos/mralexgray/AFNetworking/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AFNetworking/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AFNetworking/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AFNetworking/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AFNetworking/issues/events{/number}","stargazers_count":2,"subscription_url":"https://api.github.com/repos/mralexgray/AFNetworking/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AFNetworking/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AFNetworking/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AFNetworking/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":9485541,"url":"https://api.github.com/repos/mralexgray/AGNSSplitView","fork":true,"name":"AGNSSplitView","size":68,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AGNSSplitView.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk5NDg1NTQx","private":false,"ssh_url":"git@github.com:mralexgray/AGNSSplitView.git","svn_url":"https://github.com/mralexgray/AGNSSplitView","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/AGNSSplitView","keys_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AGNSSplitView.git","forks_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/forks","full_name":"mralexgray/AGNSSplitView","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/pulls{/number}","pushed_at":"2013-02-26T00:32:32Z","teams_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/teams","trees_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/git/trees{/sha}","created_at":"2013-04-17T00:10:13Z","events_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/merges","mirror_url":null,"updated_at":"2013-04-17T00:10:13Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/compare/{base}...{head}","description":"Simple NSSplitView additions.","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AGNSSplitView/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":12767784,"url":"https://api.github.com/repos/mralexgray/AGScopeBar","fork":true,"name":"AGScopeBar","size":64,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AGScopeBar.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc2Nzc4NA==","private":false,"ssh_url":"git@github.com:mralexgray/AGScopeBar.git","svn_url":"https://github.com/mralexgray/AGScopeBar","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/AGScopeBar","keys_url":"https://api.github.com/repos/mralexgray/AGScopeBar/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AGScopeBar/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AGScopeBar/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AGScopeBar.git","forks_url":"https://api.github.com/repos/mralexgray/AGScopeBar/forks","full_name":"mralexgray/AGScopeBar","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AGScopeBar/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AGScopeBar/pulls{/number}","pushed_at":"2013-05-07T03:35:29Z","teams_url":"https://api.github.com/repos/mralexgray/AGScopeBar/teams","trees_url":"https://api.github.com/repos/mralexgray/AGScopeBar/git/trees{/sha}","created_at":"2013-09-11T21:06:54Z","events_url":"https://api.github.com/repos/mralexgray/AGScopeBar/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AGScopeBar/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AGScopeBar/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AGScopeBar/merges","mirror_url":null,"updated_at":"2013-09-11T21:06:54Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AGScopeBar/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AGScopeBar/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AGScopeBar/compare/{base}...{head}","description":"Custom scope bar implementation for Cocoa","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AGScopeBar/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AGScopeBar/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AGScopeBar/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AGScopeBar/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AGScopeBar/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AGScopeBar/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AGScopeBar/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AGScopeBar/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AGScopeBar/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AGScopeBar/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AGScopeBar/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AGScopeBar/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AGScopeBar/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AGScopeBar/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AGScopeBar/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AGScopeBar/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AGScopeBar/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AGScopeBar/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AGScopeBar/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AGScopeBar/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AGScopeBar/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":31829499,"url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin","fork":true,"name":"agvtool-xcode-plugin","size":102,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/agvtool-xcode-plugin.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnkzMTgyOTQ5OQ==","private":false,"ssh_url":"git@github.com:mralexgray/agvtool-xcode-plugin.git","svn_url":"https://github.com/mralexgray/agvtool-xcode-plugin","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/agvtool-xcode-plugin","keys_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/agvtool-xcode-plugin.git","forks_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/forks","full_name":"mralexgray/agvtool-xcode-plugin","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/hooks","pulls_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/pulls{/number}","pushed_at":"2015-03-08T00:04:31Z","teams_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/teams","trees_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/git/trees{/sha}","created_at":"2015-03-07T22:15:38Z","events_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/merges","mirror_url":null,"updated_at":"2015-03-07T22:15:41Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/compare/{base}...{head}","description":"this is a plugin wrapper for agvtool for xcode.","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/agvtool-xcode-plugin/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":9227846,"url":"https://api.github.com/repos/mralexgray/AHContentBrowser","fork":true,"name":"AHContentBrowser","size":223,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AHContentBrowser.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk5MjI3ODQ2","private":false,"ssh_url":"git@github.com:mralexgray/AHContentBrowser.git","svn_url":"https://github.com/mralexgray/AHContentBrowser","archived":false,"disabled":false,"has_wiki":true,"homepage":"","html_url":"https://github.com/mralexgray/AHContentBrowser","keys_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AHContentBrowser.git","forks_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/forks","full_name":"mralexgray/AHContentBrowser","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/pulls{/number}","pushed_at":"2013-03-13T17:38:23Z","teams_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/teams","trees_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/git/trees{/sha}","created_at":"2013-04-04T20:56:16Z","events_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/merges","mirror_url":null,"updated_at":"2015-10-22T05:00:24Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/compare/{base}...{head}","description":"A Mac only webview that loads a fast readable version of the website if available.","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AHContentBrowser/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":37430328,"url":"https://api.github.com/repos/mralexgray/AHLaunchCtl","fork":true,"name":"AHLaunchCtl","size":592,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AHLaunchCtl.git","license":{"key":"mit","url":"https://api.github.com/licenses/mit","name":"MIT License","node_id":"MDc6TGljZW5zZTEz","spdx_id":"MIT"},"node_id":"MDEwOlJlcG9zaXRvcnkzNzQzMDMyOA==","private":false,"ssh_url":"git@github.com:mralexgray/AHLaunchCtl.git","svn_url":"https://github.com/mralexgray/AHLaunchCtl","archived":false,"disabled":false,"has_wiki":true,"homepage":"","html_url":"https://github.com/mralexgray/AHLaunchCtl","keys_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AHLaunchCtl.git","forks_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/forks","full_name":"mralexgray/AHLaunchCtl","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/pulls{/number}","pushed_at":"2015-05-26T18:50:48Z","teams_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/teams","trees_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/git/trees{/sha}","created_at":"2015-06-14T21:31:03Z","events_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/merges","mirror_url":null,"updated_at":"2015-06-14T21:31:04Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/compare/{base}...{head}","description":"LaunchD Framework for Cocoa Apps","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AHLaunchCtl/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":9167473,"url":"https://api.github.com/repos/mralexgray/AHLayout","fork":true,"name":"AHLayout","size":359,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AHLayout.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk5MTY3NDcz","private":false,"ssh_url":"git@github.com:mralexgray/AHLayout.git","svn_url":"https://github.com/mralexgray/AHLayout","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/AHLayout","keys_url":"https://api.github.com/repos/mralexgray/AHLayout/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AHLayout/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AHLayout/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AHLayout.git","forks_url":"https://api.github.com/repos/mralexgray/AHLayout/forks","full_name":"mralexgray/AHLayout","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AHLayout/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AHLayout/pulls{/number}","pushed_at":"2013-07-08T02:31:14Z","teams_url":"https://api.github.com/repos/mralexgray/AHLayout/teams","trees_url":"https://api.github.com/repos/mralexgray/AHLayout/git/trees{/sha}","created_at":"2013-04-02T10:10:30Z","events_url":"https://api.github.com/repos/mralexgray/AHLayout/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AHLayout/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AHLayout/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AHLayout/merges","mirror_url":null,"updated_at":"2013-07-08T02:31:17Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AHLayout/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AHLayout/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AHLayout/compare/{base}...{head}","description":"AHLayout","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AHLayout/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AHLayout/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AHLayout/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AHLayout/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AHLayout/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AHLayout/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AHLayout/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AHLayout/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AHLayout/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AHLayout/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AHLayout/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AHLayout/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AHLayout/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AHLayout/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AHLayout/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AHLayout/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AHLayout/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AHLayout/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AHLayout/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AHLayout/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AHLayout/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":18450201,"url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework","fork":true,"name":"Airmail-Plug-In-Framework","size":888,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/Airmail-Plug-In-Framework.git","license":{"key":"gpl-2.0","url":"https://api.github.com/licenses/gpl-2.0","name":"GNU General Public License v2.0","node_id":"MDc6TGljZW5zZTg=","spdx_id":"GPL-2.0"},"node_id":"MDEwOlJlcG9zaXRvcnkxODQ1MDIwMQ==","private":false,"ssh_url":"git@github.com:mralexgray/Airmail-Plug-In-Framework.git","svn_url":"https://github.com/mralexgray/Airmail-Plug-In-Framework","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/Airmail-Plug-In-Framework","keys_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/keys{/key_id}","language":null,"tags_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/Airmail-Plug-In-Framework.git","forks_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/forks","full_name":"mralexgray/Airmail-Plug-In-Framework","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/hooks","pulls_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/pulls{/number}","pushed_at":"2014-03-27T15:42:19Z","teams_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/teams","trees_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/git/trees{/sha}","created_at":"2014-04-04T19:33:54Z","events_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/merges","mirror_url":null,"updated_at":"2014-11-23T19:31:04Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/compare/{base}...{head}","description":null,"forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/Airmail-Plug-In-Framework/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":5203219,"url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API","fork":true,"name":"AJS-iTunes-API","size":103,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AJS-iTunes-API.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk1MjAzMjE5","private":false,"ssh_url":"git@github.com:mralexgray/AJS-iTunes-API.git","svn_url":"https://github.com/mralexgray/AJS-iTunes-API","archived":false,"disabled":false,"has_wiki":true,"homepage":"","html_url":"https://github.com/mralexgray/AJS-iTunes-API","keys_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/tags","watchers":2,"blobs_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AJS-iTunes-API.git","forks_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/forks","full_name":"mralexgray/AJS-iTunes-API","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/pulls{/number}","pushed_at":"2011-10-30T22:26:48Z","teams_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/teams","trees_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/git/trees{/sha}","created_at":"2012-07-27T10:20:58Z","events_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/merges","mirror_url":null,"updated_at":"2013-01-11T11:00:05Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/compare/{base}...{head}","description":"Cocoa wrapper for the iTunes search API - for iOS and Mac OSX projects","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/stargazers","watchers_count":2,"deployments_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/issues/events{/number}","stargazers_count":2,"subscription_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AJS-iTunes-API/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":10093801,"url":"https://api.github.com/repos/mralexgray/Alcatraz","fork":true,"name":"Alcatraz","size":3668,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/Alcatraz.git","license":{"key":"mit","url":"https://api.github.com/licenses/mit","name":"MIT License","node_id":"MDc6TGljZW5zZTEz","spdx_id":"MIT"},"node_id":"MDEwOlJlcG9zaXRvcnkxMDA5MzgwMQ==","private":false,"ssh_url":"git@github.com:mralexgray/Alcatraz.git","svn_url":"https://github.com/mralexgray/Alcatraz","archived":false,"disabled":false,"has_wiki":false,"homepage":"mneorr.github.com/Alcatraz","html_url":"https://github.com/mralexgray/Alcatraz","keys_url":"https://api.github.com/repos/mralexgray/Alcatraz/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/Alcatraz/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/Alcatraz/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/Alcatraz.git","forks_url":"https://api.github.com/repos/mralexgray/Alcatraz/forks","full_name":"mralexgray/Alcatraz","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/Alcatraz/hooks","pulls_url":"https://api.github.com/repos/mralexgray/Alcatraz/pulls{/number}","pushed_at":"2014-03-19T12:50:37Z","teams_url":"https://api.github.com/repos/mralexgray/Alcatraz/teams","trees_url":"https://api.github.com/repos/mralexgray/Alcatraz/git/trees{/sha}","created_at":"2013-05-16T04:41:13Z","events_url":"https://api.github.com/repos/mralexgray/Alcatraz/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/Alcatraz/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/Alcatraz/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/Alcatraz/merges","mirror_url":null,"updated_at":"2014-03-19T20:38:35Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/Alcatraz/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/Alcatraz/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/Alcatraz/compare/{base}...{head}","description":"The most awesome (and only) Xcode package manager!","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/Alcatraz/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/Alcatraz/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/Alcatraz/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/Alcatraz/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/Alcatraz/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/Alcatraz/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/Alcatraz/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/Alcatraz/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/Alcatraz/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/Alcatraz/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/Alcatraz/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/Alcatraz/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/Alcatraz/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/Alcatraz/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/Alcatraz/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/Alcatraz/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/Alcatraz/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/Alcatraz/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/Alcatraz/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/Alcatraz/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/Alcatraz/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":12916552,"url":"https://api.github.com/repos/mralexgray/alcatraz-packages","fork":true,"name":"alcatraz-packages","size":826,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/alcatraz-packages.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkxNjU1Mg==","private":false,"ssh_url":"git@github.com:mralexgray/alcatraz-packages.git","svn_url":"https://github.com/mralexgray/alcatraz-packages","archived":false,"disabled":false,"has_wiki":true,"homepage":"mneorr.github.com/Alcatraz","html_url":"https://github.com/mralexgray/alcatraz-packages","keys_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/keys{/key_id}","language":"Ruby","tags_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/alcatraz-packages.git","forks_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/forks","full_name":"mralexgray/alcatraz-packages","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/hooks","pulls_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/pulls{/number}","pushed_at":"2015-12-14T16:21:31Z","teams_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/teams","trees_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/git/trees{/sha}","created_at":"2013-09-18T07:15:24Z","events_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/merges","mirror_url":null,"updated_at":"2015-11-10T20:52:30Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/compare/{base}...{head}","description":"Package list repository for Alcatraz","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/alcatraz-packages/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":44278362,"url":"https://api.github.com/repos/mralexgray/alexicons","fork":true,"name":"alexicons","size":257,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/alexicons.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk0NDI3ODM2Mg==","private":false,"ssh_url":"git@github.com:mralexgray/alexicons.git","svn_url":"https://github.com/mralexgray/alexicons","archived":false,"disabled":false,"has_wiki":false,"homepage":null,"html_url":"https://github.com/mralexgray/alexicons","keys_url":"https://api.github.com/repos/mralexgray/alexicons/keys{/key_id}","language":"CoffeeScript","tags_url":"https://api.github.com/repos/mralexgray/alexicons/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/alexicons/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/alexicons.git","forks_url":"https://api.github.com/repos/mralexgray/alexicons/forks","full_name":"mralexgray/alexicons","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/alexicons/hooks","pulls_url":"https://api.github.com/repos/mralexgray/alexicons/pulls{/number}","pushed_at":"2015-10-16T03:57:51Z","teams_url":"https://api.github.com/repos/mralexgray/alexicons/teams","trees_url":"https://api.github.com/repos/mralexgray/alexicons/git/trees{/sha}","created_at":"2015-10-14T21:49:39Z","events_url":"https://api.github.com/repos/mralexgray/alexicons/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/alexicons/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/alexicons/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/alexicons/merges","mirror_url":null,"updated_at":"2015-10-15T06:20:08Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/alexicons/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/alexicons/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/alexicons/compare/{base}...{head}","description":"Get popular cat names","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/alexicons/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/alexicons/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/alexicons/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/alexicons/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/alexicons/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/alexicons/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/alexicons/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/alexicons/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/alexicons/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/alexicons/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/alexicons/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/alexicons/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/alexicons/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/alexicons/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/alexicons/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/alexicons/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/alexicons/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/alexicons/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/alexicons/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/alexicons/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/alexicons/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":10476467,"url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate","fork":true,"name":"Alfred-Google-Translate","size":103,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/Alfred-Google-Translate.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ3NjQ2Nw==","private":false,"ssh_url":"git@github.com:mralexgray/Alfred-Google-Translate.git","svn_url":"https://github.com/mralexgray/Alfred-Google-Translate","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/Alfred-Google-Translate","keys_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/keys{/key_id}","language":"Shell","tags_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/Alfred-Google-Translate.git","forks_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/forks","full_name":"mralexgray/Alfred-Google-Translate","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/hooks","pulls_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/pulls{/number}","pushed_at":"2013-01-12T19:39:03Z","teams_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/teams","trees_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/git/trees{/sha}","created_at":"2013-06-04T10:45:10Z","events_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/merges","mirror_url":null,"updated_at":"2013-06-04T10:45:10Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/compare/{base}...{head}","description":"Extension for Alfred that will do a Google translate for you","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/Alfred-Google-Translate/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":5524019,"url":"https://api.github.com/repos/mralexgray/Amber","fork":false,"name":"Amber","size":48,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/Amber.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk1NTI0MDE5","private":false,"ssh_url":"git@github.com:mralexgray/Amber.git","svn_url":"https://github.com/mralexgray/Amber","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/Amber","keys_url":"https://api.github.com/repos/mralexgray/Amber/keys{/key_id}","language":null,"tags_url":"https://api.github.com/repos/mralexgray/Amber/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/Amber/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/Amber.git","forks_url":"https://api.github.com/repos/mralexgray/Amber/forks","full_name":"mralexgray/Amber","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/Amber/hooks","pulls_url":"https://api.github.com/repos/mralexgray/Amber/pulls{/number}","pushed_at":"2012-08-23T10:38:25Z","teams_url":"https://api.github.com/repos/mralexgray/Amber/teams","trees_url":"https://api.github.com/repos/mralexgray/Amber/git/trees{/sha}","created_at":"2012-08-23T10:38:24Z","events_url":"https://api.github.com/repos/mralexgray/Amber/events","has_issues":true,"issues_url":"https://api.github.com/repos/mralexgray/Amber/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/Amber/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/Amber/merges","mirror_url":null,"updated_at":"2013-01-11T22:25:35Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/Amber/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/Amber/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/Amber/compare/{base}...{head}","description":"Fork of the difficult-to-deal-with Amber.framework","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/Amber/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/Amber/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/Amber/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/Amber/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/Amber/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/Amber/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/Amber/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/Amber/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/Amber/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/Amber/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/Amber/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/Amber/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/Amber/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/Amber/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/Amber/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/Amber/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/Amber/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/Amber/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/Amber/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/Amber/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/Amber/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":10809060,"url":"https://api.github.com/repos/mralexgray/Amethyst","fork":true,"name":"Amethyst","size":12623,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/Amethyst.git","license":{"key":"mit","url":"https://api.github.com/licenses/mit","name":"MIT License","node_id":"MDc6TGljZW5zZTEz","spdx_id":"MIT"},"node_id":"MDEwOlJlcG9zaXRvcnkxMDgwOTA2MA==","private":false,"ssh_url":"git@github.com:mralexgray/Amethyst.git","svn_url":"https://github.com/mralexgray/Amethyst","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://ianyh.github.io/Amethyst/","html_url":"https://github.com/mralexgray/Amethyst","keys_url":"https://api.github.com/repos/mralexgray/Amethyst/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/Amethyst/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/Amethyst/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/Amethyst.git","forks_url":"https://api.github.com/repos/mralexgray/Amethyst/forks","full_name":"mralexgray/Amethyst","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/Amethyst/hooks","pulls_url":"https://api.github.com/repos/mralexgray/Amethyst/pulls{/number}","pushed_at":"2013-06-18T02:54:11Z","teams_url":"https://api.github.com/repos/mralexgray/Amethyst/teams","trees_url":"https://api.github.com/repos/mralexgray/Amethyst/git/trees{/sha}","created_at":"2013-06-20T00:34:22Z","events_url":"https://api.github.com/repos/mralexgray/Amethyst/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/Amethyst/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/Amethyst/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/Amethyst/merges","mirror_url":null,"updated_at":"2013-06-20T00:34:22Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/Amethyst/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/Amethyst/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/Amethyst/compare/{base}...{head}","description":"Tiling window manager for OS X.","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/Amethyst/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/Amethyst/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/Amethyst/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/Amethyst/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/Amethyst/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/Amethyst/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/Amethyst/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/Amethyst/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/Amethyst/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/Amethyst/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/Amethyst/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/Amethyst/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/Amethyst/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/Amethyst/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/Amethyst/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/Amethyst/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/Amethyst/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/Amethyst/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/Amethyst/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/Amethyst/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/Amethyst/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":3684286,"url":"https://api.github.com/repos/mralexgray/Animated-Paths","fork":true,"name":"Animated-Paths","size":411,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/Animated-Paths.git","license":{"key":"other","url":null,"name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION"},"node_id":"MDEwOlJlcG9zaXRvcnkzNjg0Mjg2","private":false,"ssh_url":"git@github.com:mralexgray/Animated-Paths.git","svn_url":"https://github.com/mralexgray/Animated-Paths","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://oleb.net/blog/2010/12/animating-drawing-of-cgpath-with-cashapelayer/","html_url":"https://github.com/mralexgray/Animated-Paths","keys_url":"https://api.github.com/repos/mralexgray/Animated-Paths/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/Animated-Paths/tags","watchers":2,"blobs_url":"https://api.github.com/repos/mralexgray/Animated-Paths/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/Animated-Paths.git","forks_url":"https://api.github.com/repos/mralexgray/Animated-Paths/forks","full_name":"mralexgray/Animated-Paths","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/Animated-Paths/hooks","pulls_url":"https://api.github.com/repos/mralexgray/Animated-Paths/pulls{/number}","pushed_at":"2010-12-30T20:56:51Z","teams_url":"https://api.github.com/repos/mralexgray/Animated-Paths/teams","trees_url":"https://api.github.com/repos/mralexgray/Animated-Paths/git/trees{/sha}","created_at":"2012-03-11T02:56:38Z","events_url":"https://api.github.com/repos/mralexgray/Animated-Paths/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/Animated-Paths/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/Animated-Paths/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/Animated-Paths/merges","mirror_url":null,"updated_at":"2013-01-08T04:12:21Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/Animated-Paths/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/Animated-Paths/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/Animated-Paths/compare/{base}...{head}","description":"Demo project: Animating the drawing of a CGPath with CAShapeLayer.strokeEnd","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/Animated-Paths/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/Animated-Paths/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/Animated-Paths/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/Animated-Paths/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/Animated-Paths/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/Animated-Paths/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/Animated-Paths/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/Animated-Paths/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/Animated-Paths/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/Animated-Paths/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/Animated-Paths/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/Animated-Paths/stargazers","watchers_count":2,"deployments_url":"https://api.github.com/repos/mralexgray/Animated-Paths/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/Animated-Paths/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/Animated-Paths/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/Animated-Paths/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/Animated-Paths/issues/events{/number}","stargazers_count":2,"subscription_url":"https://api.github.com/repos/mralexgray/Animated-Paths/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/Animated-Paths/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/Animated-Paths/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/Animated-Paths/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":16662874,"url":"https://api.github.com/repos/mralexgray/AnsiLove.framework","fork":true,"name":"AnsiLove.framework","size":3780,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AnsiLove.framework.git","license":{"key":"other","url":null,"name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION"},"node_id":"MDEwOlJlcG9zaXRvcnkxNjY2Mjg3NA==","private":false,"ssh_url":"git@github.com:mralexgray/AnsiLove.framework.git","svn_url":"https://github.com/mralexgray/AnsiLove.framework","archived":false,"disabled":false,"has_wiki":false,"homepage":"http://byteproject.net","html_url":"https://github.com/mralexgray/AnsiLove.framework","keys_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/keys{/key_id}","language":"M","tags_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AnsiLove.framework.git","forks_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/forks","full_name":"mralexgray/AnsiLove.framework","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/pulls{/number}","pushed_at":"2013-10-04T14:08:38Z","teams_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/teams","trees_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/git/trees{/sha}","created_at":"2014-02-09T08:30:27Z","events_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/merges","mirror_url":null,"updated_at":"2015-01-13T20:41:46Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/compare/{base}...{head}","description":"Cocoa Framework for rendering ANSi / ASCII art","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AnsiLove.framework/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":5189563,"url":"https://api.github.com/repos/mralexgray/ANTrackBar","fork":true,"name":"ANTrackBar","size":94,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/ANTrackBar.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnk1MTg5NTYz","private":false,"ssh_url":"git@github.com:mralexgray/ANTrackBar.git","svn_url":"https://github.com/mralexgray/ANTrackBar","archived":false,"disabled":false,"has_wiki":true,"homepage":"","html_url":"https://github.com/mralexgray/ANTrackBar","keys_url":"https://api.github.com/repos/mralexgray/ANTrackBar/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/ANTrackBar/tags","watchers":2,"blobs_url":"https://api.github.com/repos/mralexgray/ANTrackBar/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/ANTrackBar.git","forks_url":"https://api.github.com/repos/mralexgray/ANTrackBar/forks","full_name":"mralexgray/ANTrackBar","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/ANTrackBar/hooks","pulls_url":"https://api.github.com/repos/mralexgray/ANTrackBar/pulls{/number}","pushed_at":"2012-03-09T01:40:02Z","teams_url":"https://api.github.com/repos/mralexgray/ANTrackBar/teams","trees_url":"https://api.github.com/repos/mralexgray/ANTrackBar/git/trees{/sha}","created_at":"2012-07-26T08:17:22Z","events_url":"https://api.github.com/repos/mralexgray/ANTrackBar/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/ANTrackBar/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/ANTrackBar/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/ANTrackBar/merges","mirror_url":null,"updated_at":"2013-01-11T10:29:56Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/ANTrackBar/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/ANTrackBar/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/ANTrackBar/compare/{base}...{head}","description":"An easy-to-use Cocoa seek bar with a pleasing appearance","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/ANTrackBar/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/ANTrackBar/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/ANTrackBar/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/ANTrackBar/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/ANTrackBar/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/ANTrackBar/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/ANTrackBar/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/ANTrackBar/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/ANTrackBar/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/ANTrackBar/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/ANTrackBar/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/ANTrackBar/stargazers","watchers_count":2,"deployments_url":"https://api.github.com/repos/mralexgray/ANTrackBar/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/ANTrackBar/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/ANTrackBar/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/ANTrackBar/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/ANTrackBar/issues/events{/number}","stargazers_count":2,"subscription_url":"https://api.github.com/repos/mralexgray/ANTrackBar/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/ANTrackBar/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/ANTrackBar/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/ANTrackBar/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":16240152,"url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C","fork":true,"name":"AOP-in-Objective-C","size":340,"forks":1,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/AOP-in-Objective-C.git","license":null,"node_id":"MDEwOlJlcG9zaXRvcnkxNjI0MDE1Mg==","private":false,"ssh_url":"git@github.com:mralexgray/AOP-in-Objective-C.git","svn_url":"https://github.com/mralexgray/AOP-in-Objective-C","archived":false,"disabled":false,"has_wiki":true,"homepage":"http://innoli.hu/en/opensource/","html_url":"https://github.com/mralexgray/AOP-in-Objective-C","keys_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/keys{/key_id}","language":"Objective-C","tags_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/AOP-in-Objective-C.git","forks_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/forks","full_name":"mralexgray/AOP-in-Objective-C","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/hooks","pulls_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/pulls{/number}","pushed_at":"2014-02-12T16:23:20Z","teams_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/teams","trees_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/git/trees{/sha}","created_at":"2014-01-25T21:18:04Z","events_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/merges","mirror_url":null,"updated_at":"2014-06-19T19:38:12Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/compare/{base}...{head}","description":"An NSProxy based library for easily enabling AOP like functionality in Objective-C.","forks_count":1,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/languages","default_branch":"travis-coveralls","milestones_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/AOP-in-Objective-C/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":13141936,"url":"https://api.github.com/repos/mralexgray/Apaxy","fork":true,"name":"Apaxy","size":113,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/Apaxy.git","license":{"key":"unlicense","url":"https://api.github.com/licenses/unlicense","name":"The Unlicense","node_id":"MDc6TGljZW5zZTE1","spdx_id":"Unlicense"},"node_id":"MDEwOlJlcG9zaXRvcnkxMzE0MTkzNg==","private":false,"ssh_url":"git@github.com:mralexgray/Apaxy.git","svn_url":"https://github.com/mralexgray/Apaxy","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/Apaxy","keys_url":"https://api.github.com/repos/mralexgray/Apaxy/keys{/key_id}","language":"CSS","tags_url":"https://api.github.com/repos/mralexgray/Apaxy/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/Apaxy/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/Apaxy.git","forks_url":"https://api.github.com/repos/mralexgray/Apaxy/forks","full_name":"mralexgray/Apaxy","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/Apaxy/hooks","pulls_url":"https://api.github.com/repos/mralexgray/Apaxy/pulls{/number}","pushed_at":"2013-08-02T16:01:32Z","teams_url":"https://api.github.com/repos/mralexgray/Apaxy/teams","trees_url":"https://api.github.com/repos/mralexgray/Apaxy/git/trees{/sha}","created_at":"2013-09-27T05:05:35Z","events_url":"https://api.github.com/repos/mralexgray/Apaxy/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/Apaxy/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/Apaxy/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/Apaxy/merges","mirror_url":null,"updated_at":"2018-02-16T21:40:24Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/Apaxy/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/Apaxy/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/Apaxy/compare/{base}...{head}","description":"A simple, customisable theme for your Apache directory listing.","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/Apaxy/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/Apaxy/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/Apaxy/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/Apaxy/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/Apaxy/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/Apaxy/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/Apaxy/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/Apaxy/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/Apaxy/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/Apaxy/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/Apaxy/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/Apaxy/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/Apaxy/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/Apaxy/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/Apaxy/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/Apaxy/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/Apaxy/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/Apaxy/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/Apaxy/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/Apaxy/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/Apaxy/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false},{"id":20027360,"url":"https://api.github.com/repos/mralexgray/app","fork":true,"name":"app","size":1890,"forks":0,"owner":{"id":262517,"url":"https://api.github.com/users/mralexgray","type":"User","login":"mralexgray","node_id":"MDQ6VXNlcjI2MjUxNw==","html_url":"https://github.com/mralexgray","gists_url":"https://api.github.com/users/mralexgray/gists{/gist_id}","repos_url":"https://api.github.com/users/mralexgray/repos","avatar_url":"https://avatars.githubusercontent.com/u/262517?v=4","events_url":"https://api.github.com/users/mralexgray/events{/privacy}","site_admin":false,"gravatar_id":"","starred_url":"https://api.github.com/users/mralexgray/starred{/owner}{/repo}","followers_url":"https://api.github.com/users/mralexgray/followers","following_url":"https://api.github.com/users/mralexgray/following{/other_user}","organizations_url":"https://api.github.com/users/mralexgray/orgs","subscriptions_url":"https://api.github.com/users/mralexgray/subscriptions","received_events_url":"https://api.github.com/users/mralexgray/received_events"},"topics":[],"git_url":"git://github.com/mralexgray/app.git","license":{"key":"other","url":null,"name":"Other","node_id":"MDc6TGljZW5zZTA=","spdx_id":"NOASSERTION"},"node_id":"MDEwOlJlcG9zaXRvcnkyMDAyNzM2MA==","private":false,"ssh_url":"git@github.com:mralexgray/app.git","svn_url":"https://github.com/mralexgray/app","archived":false,"disabled":false,"has_wiki":true,"homepage":null,"html_url":"https://github.com/mralexgray/app","keys_url":"https://api.github.com/repos/mralexgray/app/keys{/key_id}","language":"JavaScript","tags_url":"https://api.github.com/repos/mralexgray/app/tags","watchers":0,"blobs_url":"https://api.github.com/repos/mralexgray/app/git/blobs{/sha}","clone_url":"https://github.com/mralexgray/app.git","forks_url":"https://api.github.com/repos/mralexgray/app/forks","full_name":"mralexgray/app","has_pages":false,"hooks_url":"https://api.github.com/repos/mralexgray/app/hooks","pulls_url":"https://api.github.com/repos/mralexgray/app/pulls{/number}","pushed_at":"2014-05-20T19:51:38Z","teams_url":"https://api.github.com/repos/mralexgray/app/teams","trees_url":"https://api.github.com/repos/mralexgray/app/git/trees{/sha}","created_at":"2014-05-21T15:54:20Z","events_url":"https://api.github.com/repos/mralexgray/app/events","has_issues":false,"issues_url":"https://api.github.com/repos/mralexgray/app/issues{/number}","labels_url":"https://api.github.com/repos/mralexgray/app/labels{/name}","merges_url":"https://api.github.com/repos/mralexgray/app/merges","mirror_url":null,"updated_at":"2014-05-21T15:54:22Z","visibility":"public","archive_url":"https://api.github.com/repos/mralexgray/app/{archive_format}{/ref}","commits_url":"https://api.github.com/repos/mralexgray/app/commits{/sha}","compare_url":"https://api.github.com/repos/mralexgray/app/compare/{base}...{head}","description":"Instant mobile web app creation","forks_count":0,"is_template":false,"open_issues":0,"branches_url":"https://api.github.com/repos/mralexgray/app/branches{/branch}","comments_url":"https://api.github.com/repos/mralexgray/app/comments{/number}","contents_url":"https://api.github.com/repos/mralexgray/app/contents/{+path}","git_refs_url":"https://api.github.com/repos/mralexgray/app/git/refs{/sha}","git_tags_url":"https://api.github.com/repos/mralexgray/app/git/tags{/sha}","has_projects":true,"releases_url":"https://api.github.com/repos/mralexgray/app/releases{/id}","statuses_url":"https://api.github.com/repos/mralexgray/app/statuses/{sha}","allow_forking":true,"assignees_url":"https://api.github.com/repos/mralexgray/app/assignees{/user}","downloads_url":"https://api.github.com/repos/mralexgray/app/downloads","has_downloads":true,"languages_url":"https://api.github.com/repos/mralexgray/app/languages","default_branch":"master","milestones_url":"https://api.github.com/repos/mralexgray/app/milestones{/number}","stargazers_url":"https://api.github.com/repos/mralexgray/app/stargazers","watchers_count":0,"deployments_url":"https://api.github.com/repos/mralexgray/app/deployments","git_commits_url":"https://api.github.com/repos/mralexgray/app/git/commits{/sha}","subscribers_url":"https://api.github.com/repos/mralexgray/app/subscribers","contributors_url":"https://api.github.com/repos/mralexgray/app/contributors","issue_events_url":"https://api.github.com/repos/mralexgray/app/issues/events{/number}","stargazers_count":0,"subscription_url":"https://api.github.com/repos/mralexgray/app/subscription","collaborators_url":"https://api.github.com/repos/mralexgray/app/collaborators{/collaborator}","issue_comment_url":"https://api.github.com/repos/mralexgray/app/issues/comments{/number}","notifications_url":"https://api.github.com/repos/mralexgray/app/notifications{?since,all,participating}","open_issues_count":0,"web_commit_signoff_required":false}],"name":"Shirt","revenue":4.99},"receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","anonymousId":"anon-id-new","originalTimestamp":"2022-08-18T08:43:15.539+05:30"},{"name":"Page View","type":"page","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"identified user id","context":{"ip":"14.5.67.21","library":{"name":"http"}},"rudderId":"daf823fb-e8d3-413a-8313-d34cd756f968","messageId":"5f58d1f7-cbd6-4bff-8571-9933be7210b1","timestamp":"2020-02-02T00:23:09.544Z","properties":{"path":"/","title":"Home"},"receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","anonymousId":"anon-id-new","originalTimestamp":"2022-08-18T08:43:15.539+05:30"}]',
- destConfig: {
- clientContext: '',
- lambda: 'testFunction',
- invocationType: 'Event',
- },
+ destConfig: { clientContext: '', lambda: 'testFunction', invocationType: 'Event' },
},
metadata: [
{
@@ -25592,12 +25520,7 @@ export const data = [
event: 'Product Purchased new',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '9f8fb785-c720-4381-a009-bf22a13f4ced',
timestamp: '2020-02-02T00:23:09.544Z',
@@ -29859,19 +29782,11 @@ export const data = [
type: 'page',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '5f58d1f7-cbd6-4bff-8571-9933be7210b1',
timestamp: '2020-02-02T00:23:09.544Z',
- properties: {
- path: '/',
- title: 'Home',
- },
+ properties: { path: '/', title: 'Home' },
receivedAt: '2022-08-18T08:43:13.521+05:30',
request_ip: '[::1]',
anonymousId: 'anon-id-new',
@@ -29921,11 +29836,7 @@ export const data = [
batchedRequest: {
payload:
'[{"name":"Screen View","type":"screen","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"identified user id","context":{"ip":"14.5.67.21","library":{"name":"http"}},"rudderId":"daf823fb-e8d3-413a-8313-d34cd756f968","messageId":"1b8ee4c3-ffad-4457-b453-31b32da1dfea","timestamp":"2020-02-02T00:23:09.544Z","properties":{"prop1":"5"},"receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","anonymousId":"anon-id-new","originalTimestamp":"2022-08-18T08:43:15.539+05:30"},{"type":"group","sentAt":"2022-08-18T08:43:15.539+05:30","traits":{"name":"Company","industry":"Industry","employees":123},"userId":"user123","context":{"ip":"14.5.67.21","traits":{"trait1":"new-val"},"library":{"name":"http"}},"groupId":"group1","rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","messageId":"2c59b527-3235-4fc2-9680-f41ec52ebb51","timestamp":"2020-01-21T00:21:34.208Z","receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-18T08:43:15.539+05:30"}]',
- destConfig: {
- clientContext: '',
- lambda: 'testFunction',
- invocationType: 'Event',
- },
+ destConfig: { clientContext: '', lambda: 'testFunction', invocationType: 'Event' },
},
metadata: [
{
@@ -29953,18 +29864,11 @@ export const data = [
type: 'screen',
sentAt: '2022-08-18T08:43:15.539+05:30',
userId: 'identified user id',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: '1b8ee4c3-ffad-4457-b453-31b32da1dfea',
timestamp: '2020-02-02T00:23:09.544Z',
- properties: {
- prop1: '5',
- },
+ properties: { prop1: '5' },
receivedAt: '2022-08-18T08:43:13.521+05:30',
request_ip: '[::1]',
anonymousId: 'anon-id-new',
@@ -30029,20 +29933,12 @@ export const data = [
EventPayload: {
type: 'group',
sentAt: '2022-08-18T08:43:15.539+05:30',
- traits: {
- name: 'Company',
- industry: 'Industry',
- employees: 123,
- },
+ traits: { name: 'Company', industry: 'Industry', employees: 123 },
userId: 'user123',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
groupId: 'group1',
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
@@ -30096,11 +29992,7 @@ export const data = [
batchedRequest: {
payload:
'[{"type":"alias","sentAt":"2022-08-18T08:43:15.539+05:30","userId":"user123","context":{"ip":"14.5.67.21","traits":{"trait1":"new-val"},"library":{"name":"http"}},"rudderId":"bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5","messageId":"3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d","timestamp":"2020-01-21T00:21:34.208Z","previousId":"previd1","receivedAt":"2022-08-18T08:43:13.521+05:30","request_ip":"[::1]","originalTimestamp":"2022-08-18T08:43:15.539+05:30"}]',
- destConfig: {
- clientContext: '',
- lambda: 'testFunction',
- invocationType: 'Event',
- },
+ destConfig: { clientContext: '', lambda: 'testFunction', invocationType: 'Event' },
},
metadata: [
{
@@ -30129,12 +30021,8 @@ export const data = [
userId: 'user123',
context: {
ip: '14.5.67.21',
- traits: {
- trait1: 'new-val',
- },
- library: {
- name: 'http',
- },
+ traits: { trait1: 'new-val' },
+ library: { name: 'http' },
},
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
messageId: '3ff8d400-b6d4-43a4-a0ff-1bc7ae8b5f7d',
@@ -38727,9 +38615,7 @@ export const data = [
],
trait1: 'new-val',
},
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
},
rudderId: 'daf823fb-e8d3-413a-8313-d34cd756f968',
messageId: 'c864b4cd-8f07-4922-b3d0-82ef04c987d3',
diff --git a/test/integrations/destinations/launchdarkly_audience/processor/data.ts b/test/integrations/destinations/launchdarkly_audience/processor/data.ts
index b26cf60f4c..9f2370af7e 100644
--- a/test/integrations/destinations/launchdarkly_audience/processor/data.ts
+++ b/test/integrations/destinations/launchdarkly_audience/processor/data.ts
@@ -213,6 +213,74 @@ export const data = [
},
},
},
+ {
+ name: 'launchdarkly_audience',
+ description: 'List data is empty',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ userId: 'user123',
+ type: 'audiencelist',
+ properties: {
+ listData: {},
+ },
+ context: {
+ ip: '14.5.67.21',
+ library: {
+ name: 'http',
+ },
+ },
+ timestamp: '2020-02-02T00:23:09.544Z',
+ },
+ destination: {
+ Config: {
+ audienceId: 'test-audienceId',
+ audienceName: 'test-audienceName',
+ accessToken: 'test-accessToken',
+ clientSideId: 'test-clientSideId',
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
+ statusCode: 400,
+ error:
+ '`listData` is empty. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: `listData` is empty. Aborting message.',
+ statTags: {
+ destType: 'LAUNCHDARKLY_AUDIENCE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'cdkV2',
+ module: 'destination',
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ },
{
name: 'launchdarkly_audience',
description: 'Unsupported action type',
diff --git a/test/integrations/destinations/leanplum/router/data.ts b/test/integrations/destinations/leanplum/router/data.ts
index db75a7fdc4..29282c8b29 100644
--- a/test/integrations/destinations/leanplum/router/data.ts
+++ b/test/integrations/destinations/leanplum/router/data.ts
@@ -27,49 +27,25 @@ export const data = [
name: 'generic_x86',
type: 'android',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.1-beta.1',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'Android',
- version: '8.1.0',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'Android', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
- traits: {
- anonymousId: '5094f5704b9cf2b3',
- },
+ traits: { anonymousId: '5094f5704b9cf2b3' },
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
},
event: 'MainActivity',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'id1',
- properties: {
- name: 'MainActivity',
- automatic: true,
- },
+ properties: { name: 'MainActivity', automatic: true },
originalTimestamp: '2020-03-12T09:05:03.421Z',
type: 'screen',
sentAt: '2020-03-12T09:05:13.042Z',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
Config: {
applicationId: 'leanplum_application_id',
@@ -98,12 +74,8 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.leanplum.com/api',
- headers: {
- 'Content-Type': 'application/json',
- },
- params: {
- action: 'start',
- },
+ headers: { 'Content-Type': 'application/json' },
+ params: { action: 'start' },
body: {
JSON: {
appId: 'leanplum_application_id',
@@ -116,9 +88,7 @@ export const data = [
systemVersion: '8.1.0',
deviceName: 'generic_x86',
deviceModel: 'Android SDK built for x86',
- userAttributes: {
- anonymousId: '5094f5704b9cf2b3',
- },
+ userAttributes: { anonymousId: '5094f5704b9cf2b3' },
locale: 'en-US',
timezone: 'Asia/Kolkata',
time: 1584003903,
@@ -136,12 +106,8 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.leanplum.com/api',
- headers: {
- 'Content-Type': 'application/json',
- },
- params: {
- action: 'advance',
- },
+ headers: { 'Content-Type': 'application/json' },
+ params: { action: 'advance' },
body: {
JSON: {
appId: 'leanplum_application_id',
@@ -161,11 +127,7 @@ export const data = [
userId: '5094f5704b9cf2b3',
},
],
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -211,49 +173,25 @@ export const data = [
name: 'generic_x86',
type: 'android',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.1-beta.1',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'Android',
- version: '8.1.0',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'Android', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
- traits: {
- anonymousId: '5094f5704b9cf2b3',
- },
+ traits: { anonymousId: '5094f5704b9cf2b3' },
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
},
event: 'MainActivity',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'id2',
- properties: {
- name: 'MainActivity',
- automatic: true,
- },
+ properties: { name: 'MainActivity', automatic: true },
originalTimestamp: '2020-03-12T09:05:03.421Z',
type: 'screen',
sentAt: '2020-03-12T09:05:13.042Z',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
applicationId: 'leanplum_application_id',
@@ -282,12 +220,8 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.leanplum.com/api',
- headers: {
- 'Content-Type': 'application/json',
- },
- params: {
- action: 'start',
- },
+ headers: { 'Content-Type': 'application/json' },
+ params: { action: 'start' },
body: {
JSON: {
appId: 'leanplum_application_id',
@@ -300,9 +234,7 @@ export const data = [
systemVersion: '8.1.0',
deviceName: 'generic_x86',
deviceModel: 'Android SDK built for x86',
- userAttributes: {
- anonymousId: '5094f5704b9cf2b3',
- },
+ userAttributes: { anonymousId: '5094f5704b9cf2b3' },
locale: 'en-US',
timezone: 'Asia/Kolkata',
time: 1584003903,
@@ -320,12 +252,8 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.leanplum.com/api',
- headers: {
- 'Content-Type': 'application/json',
- },
- params: {
- action: 'advance',
- },
+ headers: { 'Content-Type': 'application/json' },
+ params: { action: 'advance' },
body: {
JSON: {
appId: 'leanplum_application_id',
@@ -345,11 +273,7 @@ export const data = [
userId: '5094f5704b9cf2b3',
},
],
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/lemnisk/router/data.ts b/test/integrations/destinations/lemnisk/router/data.ts
index 1a1b84f180..2f6364a0b0 100644
--- a/test/integrations/destinations/lemnisk/router/data.ts
+++ b/test/integrations/destinations/lemnisk/router/data.ts
@@ -12,12 +12,7 @@ export const data = [
{
message: {
anonymousId: 'anon-id-new',
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
type: 'identify',
},
destination: {
@@ -87,9 +82,7 @@ export const data = [
rootStore: null,
isProcessorEnabled: true,
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
},
{
message: {
@@ -102,10 +95,7 @@ export const data = [
event: 'Visited Home',
messageId: '1601322811899-d9c7dd00-50dc-4364-95c8-e89423eb3cfb',
originalTimestamp: '2020-09-29T14:50:29.907+05:30',
- traits: {
- name: 'Home | RudderStack',
- url: 'http://www.rudderstack.com',
- },
+ traits: { name: 'Home | RudderStack', url: 'http://www.rudderstack.com' },
receivedAt: '2020-09-29T14:50:43.005+05:30',
sentAt: '2020-09-28T19:53:44.998Z',
timestamp: '2020-09-29T14:50:29.907+05:30',
@@ -185,6 +175,7 @@ export const data = [
jobId: 123,
messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
},
{
@@ -192,39 +183,20 @@ export const data = [
anonymousId: 'anon-id-new',
channel: 'mobile',
context: {
- app: {
- build: '4',
- name: 'RuddCDN',
- },
- page: {
- referrer: 'google.com',
- },
- device: {
- id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a',
- name: 'generic_x86_arm',
- },
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.6',
- },
- os: {
- name: 'Android',
- version: '9',
- },
+ app: { build: '4', name: 'RuddCDN' },
+ page: { referrer: 'google.com' },
+ device: { id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', name: 'generic_x86_arm' },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.6' },
+ os: { name: 'Android', version: '9' },
timezone: 'Asia/Kolkata',
- traits: {
- customProp: 'customValue',
- },
+ traits: { customProp: 'customValue' },
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)',
},
event: 'Visited Home',
messageId: '1601322811899-d9c7dd00-50dc-4364-95c8-e89423eb3cfb',
originalTimestamp: '2020-09-28T19:53:31.900Z',
- properties: {
- title: 'Home | RudderStack',
- url: 'http://www.rudderstack.com',
- },
+ properties: { title: 'Home | RudderStack', url: 'http://www.rudderstack.com' },
receivedAt: '2020-09-29T14:50:43.005+05:30',
sentAt: '2020-09-28T19:53:44.998Z',
timestamp: '2020-09-29T14:50:29.907+05:30',
@@ -304,6 +276,7 @@ export const data = [
jobId: 129,
messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
},
],
@@ -385,11 +358,7 @@ export const data = [
rootStore: null,
isProcessorEnabled: true,
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
statTags: {
destType: 'LEMNISK',
feature: 'router',
@@ -408,9 +377,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'http://10.11.36.17:8080/analyze/analyze.php',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -512,6 +479,7 @@ export const data = [
jobId: 123,
messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
],
batched: false,
@@ -523,45 +491,27 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'http://10.11.36.17:8080/analyze/analyze.php',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
type: 'track',
context: {
- app: {
- build: '4',
- name: 'RuddCDN',
- },
- page: {
- referrer: 'google.com',
- },
+ app: { build: '4', name: 'RuddCDN' },
+ page: { referrer: 'google.com' },
device: {
id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a',
name: 'generic_x86_arm',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.6',
- },
- os: {
- name: 'Android',
- version: '9',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.6' },
+ os: { name: 'Android', version: '9' },
timezone: 'Asia/Kolkata',
- traits: {
- customProp: 'customValue',
- },
+ traits: { customProp: 'customValue' },
userAgent: {
ua: 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)',
},
},
- properties: {
- title: 'Home | RudderStack',
- url: 'http://www.rudderstack.com',
- },
+ properties: { title: 'Home | RudderStack', url: 'http://www.rudderstack.com' },
event: 'Visited Home',
id: 'anon-id-new',
userId: 'anon-id-new',
@@ -651,6 +601,7 @@ export const data = [
jobId: 129,
messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
],
batched: false,
diff --git a/test/integrations/destinations/lytics/router/data.ts b/test/integrations/destinations/lytics/router/data.ts
index 98aded20bf..e5d9adae5c 100644
--- a/test/integrations/destinations/lytics/router/data.ts
+++ b/test/integrations/destinations/lytics/router/data.ts
@@ -20,15 +20,9 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.1.6',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.6',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
page: {
path: '/testing/script-test.html',
referrer: '',
@@ -36,13 +30,9 @@ export const data = [
title: '',
url: 'http://localhost:3243/testing/script-test.html',
},
- screen: {
- density: 2,
- },
+ screen: { density: 2 },
traits: {
- company: {
- id: 'abc123',
- },
+ company: { id: 'abc123' },
createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)',
email: 'rudderTest@gmail.com',
name: 'Rudder Test',
@@ -52,9 +42,7 @@ export const data = [
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36',
},
event: 'Order Completed',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a',
timestamp: '2020-10-16T08:10:12.782Z',
properties: {
@@ -123,14 +111,9 @@ export const data = [
type: 'track',
userId: 'rudder123',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
- Config: {
- apiKey: 'dummyApiKey',
- stream: 'default',
- },
+ Config: { apiKey: 'dummyApiKey', stream: 'default' },
Enabled: true,
Transformations: [],
IsProcessorEnabled: true,
@@ -147,15 +130,9 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.1.6',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.6',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
page: {
path: '/testing/script-test.html',
referrer: '',
@@ -163,13 +140,9 @@ export const data = [
title: '',
url: 'http://localhost:3243/testing/script-test.html',
},
- screen: {
- density: 2,
- },
+ screen: { density: 2 },
traits: {
- company: {
- id: 'abc123',
- },
+ company: { id: 'abc123' },
createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)',
email: 'rudderTest@gmail.com',
name: 'Rudder Test',
@@ -178,9 +151,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'e108eb05-f6cd-4624-ba8c-568f2e2b3f92',
originalTimestamp: '2020-10-16T08:26:14.938Z',
receivedAt: '2020-10-16T13:56:14.945+05:30',
@@ -190,14 +161,9 @@ export const data = [
type: 'identify',
userId: 'rudder123',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
- Config: {
- apiKey: 'dummyApiKey',
- stream: 'default',
- },
+ Config: { apiKey: 'dummyApiKey', stream: 'default' },
Enabled: true,
Transformations: [],
IsProcessorEnabled: true,
@@ -220,9 +186,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -284,18 +248,11 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
- Config: {
- apiKey: 'dummyApiKey',
- stream: 'default',
- },
+ Config: { apiKey: 'dummyApiKey', stream: 'default' },
Enabled: true,
Transformations: [],
IsProcessorEnabled: true,
@@ -307,9 +264,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.lytics.io/collect/json/default?access_token=dummyApiKey',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -326,18 +281,11 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
- Config: {
- apiKey: 'dummyApiKey',
- stream: 'default',
- },
+ Config: { apiKey: 'dummyApiKey', stream: 'default' },
Enabled: true,
Transformations: [],
IsProcessorEnabled: true,
diff --git a/test/integrations/destinations/mailchimp/network.ts b/test/integrations/destinations/mailchimp/network.ts
new file mode 100644
index 0000000000..b036bf566c
--- /dev/null
+++ b/test/integrations/destinations/mailchimp/network.ts
@@ -0,0 +1,80 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://usXXX.api.mailchimp.com/3.0/lists/aud111/members/0b63fa319d113aede8b7b409e4fc6437',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ data: {
+ type: 'https://mailchimp.com/developer/marketing/docs/errors/',
+ title: 'Forbidden',
+ status: 403,
+ detail: "The API key provided is linked to datacenter 'us6'",
+ instance: 'ff092056-4d86-aa05-bbe9-9e9466108d81',
+ },
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ contact_id: 821932121,
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/b599284b872e06d29bb796a260ae7c1f',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ contact_id: 821932121,
+ },
+ status: 204,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud000',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ double_optin: false,
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud112',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ double_optin: false,
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://usXX.api.mailchimp.com/3.0/lists/aud002',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ double_optin: false,
+ },
+ status: 200,
+ },
+ },
+];
diff --git a/test/integrations/destinations/mailchimp/processor/data.ts b/test/integrations/destinations/mailchimp/processor/data.ts
new file mode 100644
index 0000000000..a0ee5de3d3
--- /dev/null
+++ b/test/integrations/destinations/mailchimp/processor/data.ts
@@ -0,0 +1,2259 @@
+export const data = [
+ {
+ name: 'mailchimp',
+ description: 'Test 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ firstName: 'Bob',
+ lastName: 'Dole',
+ zip: '123',
+ state: 'test',
+ city: 'test',
+ addressLine1: 'test',
+ birthday: '2000-05-06',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ merge_fields: {
+ ADDRESS: {
+ addr1: 'test',
+ city: 'test',
+ state: 'test',
+ zip: '123',
+ },
+ FNAME: 'Bob',
+ LNAME: 'Dole',
+ ANONYMOUSI: 'userId12345',
+ BIRTHDAY: '05/06',
+ },
+ email_address: 'bob.dole@initech.com',
+ status: 'subscribed',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 1',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ MailChimp: {
+ subscriptionStatus: 'subscribed',
+ },
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ status: 'subscribed',
+ email_address: 'bob.dole@initech.com',
+ merge_fields: {
+ ANONYMOUSI: 'userId12345',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 2',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'Titli Test',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apiKey-dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ type: 'identify',
+ sentAt: '2021-05-18T06:58:57.186Z',
+ userId: 'test.rudderlabs@yara.com',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.18',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'https://app.rudderstack.com/sources/1qHR2Qzd894ievNGc4aBHmjltLD',
+ path: '/sources/1qHR2Qzd894ievNGc4aBHmjltLD',
+ title: 'RudderStack',
+ search: '',
+ tab_url: 'https://app.rudderstack.com/sources/1qHR2Qzd894ievNGc4aBHmjltLD',
+ referrer: '$direct',
+ initial_referrer: 'https://www.google.com/',
+ referring_domain: '',
+ initial_referring_domain: 'www.google.com',
+ },
+ locale: 'en-US',
+ screen: {
+ width: 1792,
+ height: 1120,
+ density: 2,
+ },
+ traits: {
+ name: 'test rudderlabs',
+ email: 'test.rudderlabs@yara.com',
+ userId: '1sWVaQTxoVwjvShC0295E6OqMaP',
+ first_login: false,
+ workspaceId: '1jWrHYPjNGSHbvKwzow0ZFPIQll',
+ account_type: 'invited',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.18',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36',
+ },
+ rudderId: '6d612dda-9c8c-4062-9d09-af9425b846ce',
+ messageId: 'c6d49688-89f2-45cf-b061-0ae3c212a4e5',
+ timestamp: '2021-05-18T06:58:57.811Z',
+ receivedAt: '2021-05-18T06:58:57.812Z',
+ request_ip: '122.172.221.51',
+ anonymousId: '6914679f-fd34-45ef-86e0-4930e6e8b91a',
+ integrations: {
+ Salesforce: true,
+ },
+ originalTimestamp: '2021-05-18T06:58:57.185Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'User does not have access to the requested operation',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'network',
+ errorType: 'aborted',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'Titli Test',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ type: 'page',
+ sentAt: '2021-05-18T07:02:17.675Z',
+ userId: '',
+ channel: 'web',
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.18',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'https://app.rudderstack.com/signup?type=freetrial',
+ path: '/signup',
+ title: '',
+ search: '?type=freetrial',
+ tab_url: 'https://app.rudderstack.com/signup?type=freetrial',
+ referrer:
+ 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e',
+ initial_referrer:
+ 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e',
+ referring_domain: 'rudderstack.medium.com',
+ initial_referring_domain: 'rudderstack.medium.com',
+ },
+ locale: 'en-GB',
+ screen: {
+ density: 2,
+ },
+ traits: {},
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.18',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36',
+ },
+ rudderId: '4dbe224c-6aea-4d89-8da6-09d27c0d2908',
+ messageId: '72df8cb0-54ab-417c-8e87-e97e9d339feb',
+ timestamp: '2021-05-18T07:02:18.566Z',
+ properties: {
+ url: 'https://app.rudderstack.com/signup?type=freetrial',
+ path: '/signup',
+ title: '',
+ search: '?type=freetrial',
+ tab_url: 'https://app.rudderstack.com/signup?type=freetrial',
+ referrer:
+ 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e',
+ initial_referrer:
+ 'https://rudderstack.medium.com/kafka-vs-postgresql-how-we-implemented-our-queueing-system-using-postgresql-ec128650e3e',
+ referring_domain: 'rudderstack.medium.com',
+ initial_referring_domain: 'rudderstack.medium.com',
+ },
+ receivedAt: '2021-05-18T07:02:18.566Z',
+ request_ip: '162.44.150.11',
+ anonymousId: '58ec7b39-48f1-4d83-9d45-a48c64f96fa0',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2021-05-18T07:02:17.675Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'message type page is not supported',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 4',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ mappedToDestination: true,
+ externalId: [
+ {
+ identifierType: 'email_address',
+ id: 'bob.dole@initech.com',
+ type: 'audience',
+ },
+ ],
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ traits: {
+ merge_fields: {
+ FIRSTNAME: 'Bob',
+ },
+ status: 'subscribed',
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ merge_fields: {
+ FIRSTNAME: 'Bob',
+ },
+ status: 'subscribed',
+ email_address: 'bob.dole@initech.com',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 5',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ type: 'identify',
+ traits: {
+ status: 'subscri',
+ },
+ userId: 'emrichardson820+22822@gmail.com',
+ channel: 'sources',
+ context: {
+ 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',
+ },
+ externalId: [
+ {
+ id: 'emrichardson820+22822@gmail.com',
+ type: 'MAILCHIMP-92e1f1ad2c',
+ identifierType: 'email_address',
+ },
+ ],
+ mappedToDestination: 'true',
+ },
+ recordId: '1',
+ rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a',
+ messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 6',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Email is required for identify',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 7',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud112',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ email: 'jhon@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ XML: {},
+ FORM: {},
+ JSON: {
+ status: 'subscribed',
+ email_address: 'jhon@gmail.com',
+ },
+ JSON_ARRAY: {},
+ },
+ type: 'REST',
+ files: {},
+ method: 'PUT',
+ params: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ audienceId: 'aud112',
+ version: '1',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud112/members/7f3863b197eeff650876bb89eca08e57',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 8',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ email: 'bob.dole@initech.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ XML: {},
+ FORM: {},
+ JSON: {
+ email_address: 'bob.dole@initech.com',
+ status: 'subscribed',
+ },
+ JSON_ARRAY: {},
+ },
+ type: 'REST',
+ files: {},
+ method: 'PUT',
+ params: {},
+ audienceId: 'aud111',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ version: '1',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 9',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ MailChimp: {
+ subscriptionStatus: 'subscribed',
+ },
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ status: 'subscribed',
+ email_address: 'bob.dole@initech.com',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 10',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: '',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ anonymousId: 'test-rudderlabs',
+ email: 'test-rudderlabs-test@initech.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'API Key not found. Aborting',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 11',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ anonymousId: 'test-rudderlabs',
+ email: 'test-rudderlabs-test@initech.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Audience Id not found. Aborting',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 12',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: '',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ anonymousId: 'test-rudderlabs',
+ email: 'test-rudderlabs-test@initech.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'DataCenter Id not found. Aborting',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 13',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ anonymousId: 'test-rudderlabs',
+ email: 'test-rudderlabs-test@initech.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'group',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'message type group is not supported',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 14',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'local testing',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'local_testing',
+ occurred_at: '2019-11-15T10:26:53+00:00',
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 15',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ isSyncing: false,
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'local testing',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'local_testing',
+ occurred_at: '2019-11-15T10:26:53+00:00',
+ is_syncing: false,
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 16',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ },
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'local testing',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Email is required for track',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 17',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ isSyncing: false,
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Missing required value from "event"',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 18',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'local testing',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'local_testing',
+ occurred_at: '2019-11-15T10:26:53+00:00',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 19',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ isSyncing: false,
+ products: [
+ {
+ product_id: '123',
+ price: '14',
+ },
+ {
+ product_id: '123',
+ price: 14,
+ },
+ ],
+ purchased: false,
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'local testing',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'local_testing',
+ occurred_at: '2019-11-15T10:26:53+00:00',
+ is_syncing: false,
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]',
+ purchased: 'false',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 20',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ isSyncing: false,
+ products: [
+ {
+ product_id: '123',
+ price: '14',
+ },
+ {
+ product_id: '123',
+ price: 14,
+ },
+ ],
+ purchased: false,
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 22,
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmR1bW15QXBpS2V5',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: '22',
+ occurred_at: '2019-11-15T10:26:53+00:00',
+ is_syncing: false,
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ products: '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]',
+ purchased: 'false',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 21',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ isSyncing: false,
+ products: [
+ {
+ product_id: '123',
+ price: '14',
+ },
+ {
+ product_id: '123',
+ price: 14,
+ },
+ ],
+ purchased: false,
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'E',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event name should be between 2 and 30 characters',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'Test 22',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'dummyApiKey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ },
+ },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ isSyncing: false,
+ products: [
+ {
+ product_id: '123',
+ price: '14',
+ },
+ {
+ product_id: '123',
+ price: 14,
+ },
+ ],
+ purchased: false,
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'Event Name more than 30 characters abcdefghijklmno',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event name should be between 2 and 30 characters',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/mailchimp/router/data.ts b/test/integrations/destinations/mailchimp/router/data.ts
new file mode 100644
index 0000000000..93635e5369
--- /dev/null
+++ b/test/integrations/destinations/mailchimp/router/data.ts
@@ -0,0 +1,821 @@
+export const data = [
+ {
+ name: 'mailchimp',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
+ locale: 'en-US',
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ traits: {
+ anonymousId: 'userId12345',
+ email: 'bob.dole@initech.com',
+ firstName: 'Bob',
+ lastName: 'Dole',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: { All: true },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
+ locale: 'en-US',
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ traits: { anonymousId: 'userId12345', email: 'bob.dole@initech.com' },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: { MailChimp: { subscriptionStatus: 'subscribed' } },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 4, userId: 'u1' },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
+ locale: 'en-US',
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ traits: { anonymousId: 'userId12345', email: 'bob.dole@initech.com' },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: { MailChimp: { subscriptionStatus: 'subscrib' } },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 5, userId: 'u1' },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: { traits: { anonymousId: 'userId12345', email: 'bob.dole@initech.com' } },
+ properties: { brand: 'Aster', product: 'Garments' },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'local testing',
+ userId: 'userId12345',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 6, userId: 'u1' },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: { traits: { anonymousId: 'userId12345', email: 'bob.dole@initech.com' } },
+ properties: { brand: 'Aster', product: 'Garments', is_syncing: false },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ userId: 'userId12345',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 7, userId: 'u1' },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: { traits: { anonymousId: 'userId12345', email: 'bob.dole@initech.com' } },
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ isSyncing: false,
+ products: [
+ { product_id: '123', price: '14' },
+ { product_id: '123', price: 14 },
+ ],
+ purchased: false,
+ },
+ messageId: '6d1f3ca8-e2d0-4d34-9926-44596171af0c',
+ originalTimestamp: '2019-11-15T10:26:53Z',
+ receivedAt: '2019-11-15T15:56:58+05:30',
+ sentAt: '2019-11-15T10:26:58Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:56:53+05:30',
+ type: 'track',
+ event: 'local testing',
+ userId: 'userId12345',
+ },
+ },
+ ],
+ destType: 'mailchimp',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111?skip_merge_validation=true&skip_duplicate_check=false',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmFwaWtleQ==',
+ },
+ params: {},
+ body: {
+ JSON: {
+ members: [
+ {
+ email_address: 'bob.dole@initech.com',
+ merge_fields: { FNAME: 'Bob', LNAME: 'Dole', ANONYMOUSI: 'userId12345' },
+ status: 'subscribed',
+ },
+ {
+ email_address: 'bob.dole@initech.com',
+ merge_fields: { ANONYMOUSI: 'userId12345' },
+ status: 'subscribed',
+ },
+ ],
+ update_existing: true,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ { jobId: 2, userId: 'u1' },
+ { jobId: 3, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmFwaWtleQ==',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'local_testing',
+ occurred_at: '2019-11-15T10:26:53+00:00',
+ properties: { brand: 'Aster', product: 'Garments' },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ },
+ metadata: [{ jobId: 5, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://usXX.api.mailchimp.com/3.0/lists/aud111/members/48cd6232dc124497369f59c33d3eb4ab/events',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmFwaWtleQ==',
+ },
+ params: {},
+ body: {
+ JSON: {
+ name: 'local_testing',
+ occurred_at: '2019-11-15T10:26:53+00:00',
+ is_syncing: false,
+ properties: {
+ brand: 'Aster',
+ product: 'Garments',
+ products:
+ '[{"product_id":"123","price":"14"},{"product_id":"123","price":14}]',
+ purchased: 'false',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ audienceId: 'aud111',
+ },
+ metadata: [{ jobId: 7, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: [{ jobId: 6, userId: 'u1' }],
+ batched: false,
+ statusCode: 400,
+ error: 'Missing required value from "event"',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apikey',
+ audienceId: 'aud111',
+ datacenterId: 'usXX',
+ enableMergeFields: true,
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: [{ jobId: 4, userId: 'u1' }],
+ batched: false,
+ statusCode: 400,
+ error:
+ 'The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: 'mailchimp',
+ description: 'events batching',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apiKey-dummyApiKey',
+ audienceId: '1232yyqw22',
+ datacenterId: 'us20',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ message: {
+ anonymousId: 'userId12345',
+ channel: 'web',
+ context: {
+ mappedToDestination: true,
+ externalId: [
+ {
+ identifierType: 'email_address',
+ id: 'bob.dole@initech.com',
+ type: 'audience',
+ },
+ ],
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ ip: '0.0.0.0',
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
+ locale: 'en-US',
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36',
+ },
+ integrations: { All: true },
+ traits: { merge_fields: { FIRSTNAME: 'Bob' }, status: 'subscribed' },
+ messageId: '21e475b2-3694-477b-afb6-5b94a81aac21',
+ originalTimestamp: '2019-11-15T10:22:32Z',
+ receivedAt: '2019-11-15T15:52:37+05:30',
+ request_ip: '[::1]:62921',
+ sentAt: '2019-11-15T10:22:37Z',
+ source_id: '1TdhTcwsUVOeEMWyPUpQIgF3pYr',
+ timestamp: '2019-11-15T15:52:32+05:30',
+ type: 'identify',
+ userId: 'userId12345',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apiKey-dummyApiKey',
+ audienceId: '1232yyqw22',
+ datacenterId: 'us20',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ message: {
+ type: 'identify',
+ traits: { status: 'subscribed' },
+ userId: 'emrichardson820+22822@gmail.com',
+ channel: 'sources',
+ context: {
+ 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',
+ },
+ externalId: [
+ {
+ id: 'emrichardson820+22822@gmail.com',
+ type: 'MAILCHIMP-92e1f1ad2c',
+ identifierType: 'email_address',
+ },
+ ],
+ mappedToDestination: 'true',
+ },
+ recordId: '1',
+ rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a',
+ messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apiKey-dummyApiKey',
+ audienceId: '1232yyqw22',
+ datacenterId: 'us20',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 4, userId: 'u1' },
+ message: {
+ type: 'identify',
+ traits: { status: 'subscribed' },
+ userId: 'emrichardson820+22822@gmail.com',
+ channel: 'sources',
+ context: {
+ 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',
+ },
+ externalId: [
+ {
+ id: 'emrichardson820+22822@gmail.com',
+ type: 'MAILCHIMP-92e1f1ad2c',
+ identifierType: 'email_address',
+ },
+ ],
+ mappedToDestination: 'true',
+ },
+ recordId: '1',
+ rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a',
+ messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82',
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apiKey-dummyApiKey',
+ audienceId: '1232yyqw22',
+ datacenterId: 'us20',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { jobId: 5, userId: 'u1' },
+ message: {
+ type: 'identify',
+ traits: { status: 'subscrib' },
+ userId: 'emrichardson820+22822@gmail.com',
+ channel: 'sources',
+ context: {
+ 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',
+ },
+ externalId: [
+ {
+ id: 'emrichardson820+22822@gmail.com',
+ type: 'MAILCHIMP-92e1f1ad2c',
+ identifierType: 'email_address',
+ },
+ ],
+ mappedToDestination: 'true',
+ },
+ recordId: '1',
+ rudderId: '4d5d0ed0-9db8-41cc-9bb0-a032f6bfa97a',
+ messageId: 'b3bee036-fc26-4f6d-9867-c17f85708a82',
+ },
+ },
+ ],
+ destType: 'mailchimp',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://us20.api.mailchimp.com/3.0/lists/1232yyqw22?skip_merge_validation=false&skip_duplicate_check=false',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic YXBpS2V5OmFwaUtleS1kdW1teUFwaUtleQ==',
+ },
+ params: {},
+ body: {
+ JSON: {
+ members: [
+ {
+ merge_fields: { FIRSTNAME: 'Bob' },
+ status: 'subscribed',
+ email_address: 'bob.dole@initech.com',
+ },
+ { status: 'subscribed', email_address: 'emrichardson820+22822@gmail.com' },
+ { status: 'subscribed', email_address: 'emrichardson820+22822@gmail.com' },
+ ],
+ update_existing: true,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ { jobId: 2, userId: 'u1' },
+ { jobId: 3, userId: 'u1' },
+ { jobId: 4, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apiKey-dummyApiKey',
+ audienceId: '1232yyqw22',
+ datacenterId: 'us20',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ {
+ destination: {
+ ID: '1Tdi0lpXwSVwXG1lcdP2pXHKrJ6',
+ Name: 'test-mc',
+ DestinationDefinition: {
+ ID: '1SujZGrVEPqYmpUJcV4vSl9tfxn',
+ Name: 'MC',
+ DisplayName: 'MailChimp',
+ },
+ Config: {
+ apiKey: 'apiKey-dummyApiKey',
+ audienceId: '1232yyqw22',
+ datacenterId: 'us20',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: [{ jobId: 5, userId: 'u1' }],
+ batched: false,
+ statusCode: 400,
+ error:
+ 'The status must be one of [subscribed, unsubscribed, cleaned, pending, transactional]',
+ statTags: {
+ destType: 'MAILCHIMP',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/mailjet/router/data.ts b/test/integrations/destinations/mailjet/router/data.ts
index 85c96629ff..689e73ef2a 100644
--- a/test/integrations/destinations/mailjet/router/data.ts
+++ b/test/integrations/destinations/mailjet/router/data.ts
@@ -5,6 +5,94 @@ export const data = [
feature: 'router',
module: 'destination',
version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ message: {
+ userId: 'user@45',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ },
+ },
+ },
+ ],
+ destType: 'mailjet',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=',
+ },
+ params: {},
+ body: {
+ FORM: {},
+ JSON: {
+ Action: 'addnoforce',
+ Contacts: [{ email: 'test@user.com', properties: { country: 'india' } }],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: 'mailjet',
+ description: 'batching with 1 listId and 1 action',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
input: {
request: {
body: {
@@ -20,6 +108,7 @@ export const data = [
},
metadata: {
jobId: 1,
+ userId: 'u1',
},
message: {
userId: 'user@45',
@@ -80,6 +169,7 @@ export const data = [
metadata: [
{
jobId: 1,
+ userId: 'u1',
},
],
batched: true,
@@ -103,4 +193,586 @@ export const data = [
},
},
},
+ {
+ name: 'mailjet',
+ description: 'batching with multiple listId and multiple action combinations',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ message: {
+ userId: 'user@45',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ },
+ },
+ },
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ message: {
+ userId: 'user@46',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test2@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ externalId: [
+ {
+ type: 'listId',
+ id: '58570',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ mailjet: {
+ Action: 'unsub',
+ },
+ },
+ },
+ },
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: {
+ jobId: 3,
+ userId: 'u1',
+ },
+ message: {
+ userId: 'user@47',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test3@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ externalId: [
+ {
+ type: 'listId',
+ id: '58576',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ mailjet: {
+ Action: 'addforce',
+ },
+ },
+ },
+ },
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: {
+ jobId: 4,
+ userId: 'u1',
+ },
+ message: {
+ userId: 'user@48',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test4@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ externalId: [
+ {
+ type: 'listId',
+ id: '58576',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ mailjet: {
+ Action: 'unsub',
+ },
+ },
+ },
+ },
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: {
+ jobId: 5,
+ userId: 'u1',
+ },
+ message: {
+ userId: 'user@49',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test5@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ externalId: [
+ {
+ type: 'listId',
+ id: '585896',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ mailjet: {
+ Action: 'unsub',
+ },
+ },
+ },
+ },
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: {
+ jobId: 6,
+ userId: 'u1',
+ },
+ message: {
+ userId: 'user@49',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test5@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ externalId: [
+ {
+ type: 'listId',
+ id: '584896',
+ },
+ ],
+ },
+ },
+ },
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [{ from: 'userCountry', to: 'country' }],
+ },
+ },
+ metadata: {
+ jobId: 7,
+ userId: 'u1',
+ },
+ message: {
+ userId: 'user@50',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'test10@user.com',
+ phone: '7267286346802347827',
+ userId: 'sajal',
+ city: 'gondal',
+ userCountry: 'india',
+ lastName: 'dev',
+ username: 'Samle_putUserName',
+ firstName: 'rudderlabs',
+ },
+ },
+ },
+ },
+ ],
+ destType: 'mailjet',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58578/managemanycontacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=',
+ },
+ params: {},
+ body: {
+ JSON: {
+ Action: 'addnoforce',
+ Contacts: [
+ {
+ email: 'test@user.com',
+ properties: {
+ country: 'india',
+ },
+ },
+ {
+ email: 'test10@user.com',
+ properties: {
+ country: 'india',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ { jobId: 1, userId: 'u1' },
+ { jobId: 7, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [
+ {
+ from: 'userCountry',
+ to: 'country',
+ },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58570/managemanycontacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=',
+ },
+ params: {},
+ body: {
+ JSON: {
+ Action: 'unsub',
+ Contacts: [
+ {
+ email: 'test2@user.com',
+ properties: {
+ country: 'india',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [
+ {
+ from: 'userCountry',
+ to: 'country',
+ },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58576/managemanycontacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=',
+ },
+ params: {},
+ body: {
+ JSON: {
+ Action: 'addforce',
+ Contacts: [
+ {
+ email: 'test3@user.com',
+ properties: {
+ country: 'india',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 3, userId: 'u1' }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [
+ {
+ from: 'userCountry',
+ to: 'country',
+ },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/58576/managemanycontacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=',
+ },
+ params: {},
+ body: {
+ JSON: {
+ Action: 'unsub',
+ Contacts: [
+ {
+ email: 'test4@user.com',
+ properties: {
+ country: 'india',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 4, userId: 'u1' }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [
+ {
+ from: 'userCountry',
+ to: 'country',
+ },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/585896/managemanycontacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=',
+ },
+ params: {},
+ body: {
+ JSON: {
+ Action: 'unsub',
+ Contacts: [
+ {
+ email: 'test5@user.com',
+ properties: {
+ country: 'india',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 5, userId: 'u1' }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [
+ {
+ from: 'userCountry',
+ to: 'country',
+ },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mailjet.com/v3/REST/contactslist/584896/managemanycontacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic ZHVtbXlBcGlLZXk6ZHVtbXlBcGlTZWNyZXQ=',
+ },
+ params: {},
+ body: {
+ JSON: {
+ Action: 'addnoforce',
+ Contacts: [
+ {
+ email: 'test5@user.com',
+ properties: {
+ country: 'india',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 6, userId: 'u1' }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ apiSecret: 'dummyApiSecret',
+ listId: '58578',
+ contactPropertiesMapping: [
+ {
+ from: 'userCountry',
+ to: 'country',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
];
diff --git a/test/integrations/destinations/mailmodo/router/data.ts b/test/integrations/destinations/mailmodo/router/data.ts
index c341259bbe..3b492b0a82 100644
--- a/test/integrations/destinations/mailmodo/router/data.ts
+++ b/test/integrations/destinations/mailmodo/router/data.ts
@@ -14,15 +14,8 @@ export const data = [
type: 'identify',
event: 'Email Opened',
sentAt: '2020-08-28T16:26:16.473Z',
- context: {
- library: {
- name: 'analytics-node',
- version: '0.0.3',
- },
- },
- _metadata: {
- nodeVersion: '10.22.0',
- },
+ context: { library: { name: 'analytics-node', version: '0.0.3' } },
+ _metadata: { nodeVersion: '10.22.0' },
messageId:
'node-570110489d3e99b234b18af9a9eca9d4-6009779e-82d7-469d-aaeb-5ccf162b0453',
properties: {
@@ -34,31 +27,16 @@ export const data = [
anonymousId: 'abcdeeeeeeeexxxx102',
originalTimestamp: '2020-08-28T16:26:06.468Z',
},
- metadata: {
- jobId: 2,
- },
- destination: {
- Config: {
- apiKey: 'dummyApiKey',
- listName: 'abc',
- },
- Enabled: true,
- },
+ metadata: { jobId: 2, userId: 'u1' },
+ destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true },
},
{
message: {
type: 'track',
event: 'Email Opened',
sentAt: '2020-08-28T16:26:16.473Z',
- context: {
- library: {
- name: 'analytics-node',
- version: '0.0.3',
- },
- },
- _metadata: {
- nodeVersion: '10.22.0',
- },
+ context: { library: { name: 'analytics-node', version: '0.0.3' } },
+ _metadata: { nodeVersion: '10.22.0' },
messageId:
'node-570110489d3e99b234b18af9a9eca9d4-6009779e-82d7-469d-aaeb-5ccf162b0453',
properties: {
@@ -70,16 +48,8 @@ export const data = [
anonymousId: 'abcdeeeeeeeexxxx102',
originalTimestamp: '2020-08-28T16:26:06.468Z',
},
- metadata: {
- jobId: 3,
- },
- destination: {
- Config: {
- apiKey: 'dummyApiKey',
- listName: 'abc',
- },
- Enabled: true,
- },
+ metadata: { jobId: 3, userId: 'u1' },
+ destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true },
},
{
message: {
@@ -87,13 +57,9 @@ export const data = [
userId: 'identified user id',
anonymousId: 'anon-id-new',
context: {
- traits: {
- trait1: 'new-val',
- },
+ traits: { trait1: 'new-val' },
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
},
traits: {
email: 'test@abc.com',
@@ -105,31 +71,16 @@ export const data = [
},
timestamp: '2020-02-02T00:23:09.544Z',
},
- metadata: {
- jobId: 4,
- },
- destination: {
- Config: {
- apiKey: 'dummyApiKey',
- listName: 'abc',
- },
- Enabled: true,
- },
+ metadata: { jobId: 4, userId: 'u1' },
+ destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true },
},
{
message: {
type: 'identify',
event: 'Email Opened',
sentAt: '2020-08-28T16:26:16.473Z',
- context: {
- library: {
- name: 'analytics-node',
- version: '0.0.3',
- },
- },
- _metadata: {
- nodeVersion: '10.22.0',
- },
+ context: { library: { name: 'analytics-node', version: '0.0.3' } },
+ _metadata: { nodeVersion: '10.22.0' },
messageId:
'node-570110489d3e99b234b18af9a9eca9d4-6009779e-82d7-469d-aaeb-5ccf162b0453',
properties: {
@@ -140,16 +91,8 @@ export const data = [
anonymousId: 'abcdeeeeeeeexxxx102',
originalTimestamp: '2020-08-28T16:26:06.468Z',
},
- metadata: {
- jobId: 5,
- },
- destination: {
- Config: {
- apiKey: 'dummyApiKey',
- listName: '',
- },
- Enabled: true,
- },
+ metadata: { jobId: 5, userId: 'u1' },
+ destination: { Config: { apiKey: 'dummyApiKey', listName: '' }, Enabled: true },
},
],
destType: 'mailmodo',
@@ -171,9 +114,7 @@ export const data = [
JSON: {
listName: 'abc',
values: [
- {
- email: 'test@abc.com',
- },
+ { email: 'test@abc.com' },
{
email: 'test@abc.com',
data: {
@@ -192,30 +133,17 @@ export const data = [
files: {},
method: 'POST',
params: {},
- headers: {
- mmApiKey: 'dummyApiKey',
- 'Content-Type': 'application/json',
- },
+ headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' },
version: '1',
endpoint: 'https://api.mailmodo.com/api/v1/addToList/batch',
},
metadata: [
- {
- jobId: 2,
- },
- {
- jobId: 4,
- },
+ { jobId: 2, userId: 'u1' },
+ { jobId: 4, userId: 'u1' },
],
batched: true,
statusCode: 200,
- destination: {
- Config: {
- apiKey: 'dummyApiKey',
- listName: 'abc',
- },
- Enabled: true,
- },
+ destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true },
},
{
batchedRequest: {
@@ -238,37 +166,20 @@ export const data = [
files: {},
method: 'POST',
params: {},
- headers: {
- mmApiKey: 'dummyApiKey',
- 'Content-Type': 'application/json',
- },
+ headers: { mmApiKey: 'dummyApiKey', 'Content-Type': 'application/json' },
version: '1',
endpoint: 'https://api.mailmodo.com/api/v1/addEvent',
},
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
statusCode: 200,
- destination: {
- Config: {
- apiKey: 'dummyApiKey',
- listName: 'abc',
- },
- Enabled: true,
- },
+ destination: { Config: { apiKey: 'dummyApiKey', listName: 'abc' }, Enabled: true },
},
{
batched: false,
error:
'Missing required value from ["traits.email","context.traits.email","properties.email"]',
- metadata: [
- {
- jobId: 5,
- },
- ],
+ metadata: [{ jobId: 5, userId: 'u1' }],
statTags: {
destType: 'MAILMODO',
errorCategory: 'dataValidation',
@@ -278,13 +189,7 @@ export const data = [
module: 'destination',
},
statusCode: 400,
- destination: {
- Config: {
- apiKey: 'dummyApiKey',
- listName: '',
- },
- Enabled: true,
- },
+ destination: { Config: { apiKey: 'dummyApiKey', listName: '' }, Enabled: true },
},
],
},
diff --git a/test/integrations/destinations/marketo/network.ts b/test/integrations/destinations/marketo/network.ts
index b0c6174281..9c28a9aef1 100644
--- a/test/integrations/destinations/marketo/network.ts
+++ b/test/integrations/destinations/marketo/network.ts
@@ -241,4 +241,732 @@ export const networkCallsData = [
statusText: 'OK',
},
},
+ {
+ httpReq: {
+ url: 'https://marketo_acct_id_success.mktorest.com/identity/oauth/token',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'access_token_success',
+ expires_in: 3599,
+ scope: 'integrations@rudderstack.com',
+ token_type: 'bearer',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://marketo_acct_id_token_failure.mktorest.com/identity/oauth/token',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'access_token_expired',
+ expires_in: 0,
+ scope: 'integrations@rudderstack.com',
+ token_type: 'bearer',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json',
+ method: 'get',
+ },
+ httpRes: {
+ data: {
+ requestId: '7ab2#17672a46a99',
+ result: [
+ {
+ id: 4,
+ status: 'created',
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json?filterType=email&filterValues=arnab.compsc%40gmail.com',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '107#17672aeadba',
+ result: [],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json?filterType=userId&filterValues=test-user-6j55yr',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '12093#17672aeaee6',
+ result: [
+ {
+ createdAt: '2020-12-17T21:39:07Z',
+ email: null,
+ firstName: null,
+ id: 4,
+ lastName: null,
+ updatedAt: '2020-12-17T21:39:07Z',
+ userId: 'test-user-6j55yr',
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://marketo_acct_id_failed.mktorest.com/identity/oauth/token',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ success: false,
+ errors: [
+ {
+ code: '601',
+ message: 'Access Token Expired',
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=b&client_secret=clientSecret&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'test_acess',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://munchkinId.mktorest.com/identity/oauth/token?client_id=wrongClientId&client_secret=clientSecret&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'test_access_token',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://munchkinId.mktorest.com/rest/v1/leads/describe2.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '7fa1#17fd1da66fe',
+ result: [
+ {
+ name: 'API Lead',
+ searchableFields: [['email']],
+ fields: [
+ {
+ name: 'email',
+ displayName: 'Email Address',
+ dataType: 'email',
+ length: 255,
+ updateable: true,
+ crmManaged: false,
+ },
+ ],
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://munchkinId.mktorest.com/bulk/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '5bdd#17fd1ff88cd',
+ result: [
+ {
+ batchId: 2977,
+ importId: '2977',
+ status: 'Queued',
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'test_access_token',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.mktorest.com/identity/oauth/token?client_id=b&client_secret=forThrottle&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'test_access_token',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.mktorest.com/rest/v1/leads/describe2.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '7fa1#17fd1da66fe',
+ result: [
+ {
+ name: 'API Lead',
+ searchableFields: [['email']],
+ fields: [
+ {
+ name: 'email',
+ displayName: 'Email Address',
+ dataType: 'email',
+ length: 255,
+ updateable: true,
+ crmManaged: false,
+ },
+ ],
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin4.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'test_access_token',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin4.mktorest.com/bulk/v1/leads/batch/1234.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ errors: [
+ {
+ message: 'Any 400 error',
+ code: 1000,
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin3.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'test_access_token',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin500.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'test_access_token',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin500.mktorest.com/bulk/v1/leads/batch/1234.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ errors: [
+ {
+ message: 'Any 500 error',
+ code: 502,
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.mktorest.com/bulk/v1/leads/batch/12345/warnings.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: 'data \n data',
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://a.mktorest.com/bulk/v1/leads/batch/12345/failures.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: 'data \n data',
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin1.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'access_token_success',
+ expires_in: 3599,
+ scope: 'integrations@rudderstack.com',
+ token_type: 'bearer',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin1.mktorest.com/rest/v1/leads/describe2.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '7fa1#17fd1da66fe',
+ result: [
+ {
+ name: 'API Lead',
+ searchableFields: [['email']],
+ fields: [
+ {
+ name: 'email',
+ displayName: 'Email Address',
+ dataType: 'email',
+ length: 255,
+ updateable: true,
+ crmManaged: false,
+ },
+ ],
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin1.mktorest.com/bulk/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ success: false,
+ errors: [
+ {
+ code: 603,
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin2.mktorest.com/identity/oauth/token?client_id=b&client_secret=c&grant_type=client_credentials',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'access_token_success',
+ expires_in: 3599,
+ scope: 'integrations@rudderstack.com',
+ token_type: 'bearer',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin2.mktorest.com/rest/v1/leads/describe2.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '7fa1#17fd1da66fe',
+ result: [
+ {
+ name: 'API Lead',
+ searchableFields: [['email']],
+ fields: [
+ {
+ name: 'Email',
+ displayName: 'Email Address',
+ dataType: 'email',
+ length: 255,
+ updateable: true,
+ crmManaged: false,
+ },
+ ],
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin2.mktorest.com/bulk/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ success: false,
+ errors: [
+ {
+ message: 'There are 10 imports currently being processed. Please try again later',
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin3.mktorest.com/rest/v1/leads/describe2.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '7fa1#17fd1da66fe',
+ result: [
+ {
+ name: 'API Lead',
+ searchableFields: [['email']],
+ fields: [
+ {
+ name: 'Email',
+ displayName: 'Email Address',
+ dataType: 'email',
+ length: 255,
+ updateable: true,
+ crmManaged: false,
+ },
+ ],
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin3.mktorest.com/bulk/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ success: false,
+ errors: [
+ {
+ message: 'Empty file',
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin4.mktorest.com/rest/v1/leads/describe2.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '7fa1#17fd1da66fe',
+ result: [
+ {
+ name: 'API Lead',
+ searchableFields: [['email']],
+ fields: [
+ {
+ name: 'Email',
+ displayName: 'Email Address',
+ dataType: 'email',
+ length: 255,
+ updateable: true,
+ crmManaged: false,
+ },
+ ],
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://testMunchkin4.mktorest.com/bulk/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ success: false,
+ errors: [
+ {
+ message: 'Any other error',
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://valid_account_broken_event.mktorest.com/identity/oauth/token',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'access_token_success',
+ expires_in: 3599,
+ scope: 'integrations@rudderstack.com',
+ token_type: 'bearer',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://valid_account_broken_event.mktorest.com/rest/v1/leads.json?filterType=email&filterValues=0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '12093#17672aeaee6',
+ result: [],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://valid_account_broken_event.mktorest.com/rest/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '142e4#1835b117b76',
+ success: false,
+ errors: [
+ {
+ code: '1006',
+ message: "Lookup field 'userId' not found",
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://unhandled_status_code.mktorest.com/identity/oauth/token',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'access_token_success',
+ expires_in: 3599,
+ scope: 'integrations@rudderstack.com',
+ token_type: 'bearer',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://unhandled_status_code.mktorest.com/rest/v1/leads.json?filterType=email&filterValues=0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '12093#17672aeaee6',
+ result: [],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://unhandled_status_code.mktorest.com/rest/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '142e4#1835b117b76',
+ success: false,
+ errors: [
+ {
+ code: 'random_marketo_code',
+ message: 'some other problem',
+ },
+ ],
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://successful_identify_transformation.mktorest.com/identity/oauth/token',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ access_token: 'access_token_success',
+ expires_in: 3599,
+ scope: 'integrations@rudderstack.com',
+ token_type: 'bearer',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://successful_identify_transformation.mktorest.com/rest/v1/leads.json',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '7ab2#17672a46a99',
+ result: [
+ {
+ id: 4,
+ status: 'created',
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://successful_identify_transformation.mktorest.com/rest/v1/leads.json?filterType=email&filterValues=0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ requestId: '12093#17672aeaee6',
+ result: [
+ {
+ createdAt: '2022-09-17T21:39:07Z',
+ email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ firstName: 'random_first',
+ id: 4,
+ lastName: 'random_last',
+ updatedAt: '2022-09-20T21:48:07Z',
+ userId: 'test-user-957ue',
+ },
+ ],
+ success: true,
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
];
diff --git a/test/integrations/destinations/marketo/processor/data.ts b/test/integrations/destinations/marketo/processor/data.ts
new file mode 100644
index 0000000000..38201bd60d
--- /dev/null
+++ b/test/integrations/destinations/marketo/processor/data.ts
@@ -0,0 +1,1745 @@
+export const data = [
+ {
+ name: 'marketo',
+ description: 'Test 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ channel: 'sources',
+ context: {
+ externalId: [
+ {
+ id: 'lynnanderson@smith.net',
+ identifierType: 'email',
+ type: 'MARKETO-new_user',
+ },
+ ],
+ mappedToDestination: 'true',
+ sources: {
+ batch_id: 'f5f240d0-0acb-46e0-b043-57fb0aabbadd',
+ job_id: '1zAj94bEy8komdqnYtSoDp0VmGs/Syncher',
+ job_run_id: 'c5tar6cqgmgmcjvupdhg',
+ task_id: 'tt_10_rows_check',
+ task_run_id: 'c5tar6cqgmgmcjvupdi0',
+ version: 'release.v1.6.8',
+ },
+ },
+ messageId: '2f052f7c-f694-4849-a7ed-a432f7ffa0a4',
+ originalTimestamp: '2021-10-28T14:03:50.503Z',
+ receivedAt: '2021-10-28T14:03:46.567Z',
+ recordId: '8',
+ request_ip: '10.1.94.92',
+ rudderId: 'c0f6843e-e3d6-4946-9752-fa339fbadef2',
+ sentAt: '2021-10-28T14:03:50.503Z',
+ timestamp: '2021-10-28T14:03:46.566Z',
+ traits: {
+ marketoGUID: '23',
+ administrative_unit: 'Minnesota',
+ am_pm: 'AM',
+ boolean: true,
+ firstname: 'Jacqueline',
+ pPower: 'AM',
+ userId: 'Jacqueline',
+ },
+ type: 'identify',
+ userId: 'lynnanderson@smith.net',
+ },
+ destination: {
+ ID: '1zia9wKshXt80YksLmUdJnr7IHI',
+ Name: 'test_marketo',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ Config: {
+ destConfig: {
+ defaultConfig: [],
+ },
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ secretKeys: [],
+ supportedMessageTypes: ['identify', 'page', 'screen', 'track'],
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'warehouse',
+ 'reactnative',
+ 'flutter',
+ 'cordova',
+ ],
+ supportsVisualMapper: true,
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ ResponseRules: null,
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ rudderEventsMapping: [],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ libraries: [],
+ request: {
+ query: {},
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/customobjects/new_user.json',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ action: 'createOrUpdate',
+ dedupeBy: 'dedupeFields',
+ input: [
+ {
+ administrative_unit: 'Minnesota',
+ am_pm: 'AM',
+ boolean: true,
+ firstname: 'Jacqueline',
+ pPower: 'AM',
+ userId: 'Jacqueline',
+ email: 'lynnanderson@smith.net',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 1',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ customActivityPrimaryKeyMap: [
+ {
+ from: 'Product Clicked',
+ to: 'name',
+ },
+ ],
+ customActivityEventMap: [
+ {
+ from: 'Product Clicked',
+ to: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer access_token_success',
+ },
+ params: {},
+ body: {
+ JSON: {
+ input: [
+ {
+ activityDate: '2020-12-17T21:00:59.176Z',
+ activityTypeId: 100001,
+ attributes: [],
+ leadId: 4,
+ primaryAttributeValue: 'Test Product',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 2',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ name: 'Test Product',
+ product_id: 'prod_1',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-12-17T21:00:59.176Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ {
+ from: 'product_id',
+ to: 'productId',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer access_token_success',
+ },
+ params: {},
+ body: {
+ JSON: {
+ input: [
+ {
+ activityDate: '2020-12-17T21:00:59.176Z',
+ activityTypeId: 100001,
+ attributes: [
+ {
+ name: 'productId',
+ value: 'prod_1',
+ },
+ ],
+ leadId: 4,
+ primaryAttributeValue: 'Test Product',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ userId: 'user_id_success',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: false,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer access_token_success',
+ },
+ params: {},
+ body: {
+ JSON: {
+ input: [
+ {
+ activityDate: '2020-12-17T21:00:59.176Z',
+ activityTypeId: 100001,
+ attributes: [],
+ leadId: 4,
+ primaryAttributeValue: 'Test Product',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 4: ERROR - Request Failed for marketo, Access Token Expired',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ userId: 'user_id_success',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBerte',
+ Config: {
+ accountId: 'marketo_acct_id_token_failure',
+ clientId: 'marketo_acct_id_token_failure',
+ clientSecret: 'marketo_acct_id_token_failure',
+ trackAnonymousEvents: false,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 500,
+ error:
+ '{"message":"Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token","destinationResponse":{"access_token":"access_token_expired","expires_in":0,"scope":"integrations@rudderstack.com","token_type":"bearer"}}',
+ statTags: {
+ errorCategory: 'network',
+ errorType: 'retryable',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 5: ERROR - Request Failed for marketo, Access Token Expired',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ userId: 'user_id_success',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBerte',
+ Config: {
+ accountId: 'marketo_acct_id_failed',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: false,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 500,
+ error:
+ '{"message":"Request Failed for marketo, Access Token Expired (Retryable).During fetching auth token","destinationResponse":{"response":{"success":false,"errors":[{"code":"601","message":"Access Token Expired"}]},"status":200}}',
+ statTags: {
+ errorCategory: 'network',
+ errorType: 'retryable',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 6: ERROR - Invalid traits value for Marketo',
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ type: 'identify',
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '00000000000000000000000000',
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ {
+ from: 'product_id',
+ to: 'productId',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Invalid traits value for Marketo',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 7: ERROR - Anonymous event tracking is turned off and invalid userId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: false,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Anonymous event tracking is turned off and invalid userId',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 8: ERROR - Event is not mapped to Custom Activity',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Purchased',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Event is not mapped to Custom Activity',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 9: ERROR - Primary Key value is invalid for the event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ product_name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Primary Key value is invalid for the event',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 10: ERROR - Message Type is not present. Aborting message.',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ product_name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Message Type is not present. Aborting message.',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 11: ERROR - Message type not supported',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.1-beta.1',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '8.1.0',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ anonymousId: 'anon_id_success',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: {
+ All: true,
+ },
+ messageId: 'id1',
+ properties: {
+ product_name: 'Test Product',
+ },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'screen',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'leadScore',
+ to: 'customLeadScore',
+ },
+ ],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Message type not supported',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'MARKETO',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 12',
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ type: 'identify',
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '00000000000000000000000000',
+ integrations: {
+ All: true,
+ },
+ traits: {
+ score: '0.5',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ {
+ from: 'name',
+ to: 'productName',
+ },
+ {
+ from: 'product_id',
+ to: 'productId',
+ },
+ ],
+ leadTraitMapping: [
+ {
+ from: 'score',
+ to: 'customLeadScore',
+ },
+ ],
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ action: 'createOrUpdate',
+ input: [
+ {
+ customLeadScore: '0.5',
+ id: 4,
+ },
+ ],
+ lookupField: 'id',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'Test 13',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ channel: 'sources',
+ context: {
+ externalId: [
+ {
+ id: 'lynnanderson@smith.net',
+ identifierType: 'email',
+ type: 'MARKETO-new_user',
+ },
+ ],
+ traits: {
+ marketoGUID: '23',
+ administrative_unit: 'Minnesota',
+ am_pm: 'AM',
+ boolean: true,
+ firstname: 'Jacqueline',
+ pPower: 'AM',
+ userId: 'Jacqueline',
+ },
+ sources: {
+ batch_id: 'f5f240d0-0acb-46e0-b043-57fb0aabbadd',
+ job_id: '1zAj94bEy8komdqnYtSoDp0VmGs/Syncher',
+ job_run_id: 'c5tar6cqgmgmcjvupdhg',
+ task_id: 'tt_10_rows_check',
+ task_run_id: 'c5tar6cqgmgmcjvupdi0',
+ version: 'release.v1.6.8',
+ },
+ },
+ messageId: '2f052f7c-f694-4849-a7ed-a432f7ffa0a4',
+ originalTimestamp: '2021-10-28T14:03:50.503Z',
+ receivedAt: '2021-10-28T14:03:46.567Z',
+ recordId: '8',
+ request_ip: '10.1.94.92',
+ rudderId: 'c0f6843e-e3d6-4946-9752-fa339fbadef2',
+ sentAt: '2021-10-28T14:03:50.503Z',
+ timestamp: '2021-10-28T14:03:46.566Z',
+ type: 'identify',
+ userId: 'dummyMail@dummyDomain.com',
+ },
+ destination: {
+ ID: '1zia9wKshXt80YksLmUdJnr7IHI',
+ Name: 'test_marketo',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ Config: {
+ destConfig: {
+ defaultConfig: [],
+ },
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ secretKeys: [],
+ supportedMessageTypes: ['identify', 'page', 'screen', 'track'],
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'warehouse',
+ 'reactnative',
+ 'flutter',
+ 'cordova',
+ ],
+ supportsVisualMapper: true,
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ ResponseRules: null,
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ rudderEventsMapping: [],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ libraries: [],
+ request: {
+ query: {},
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint: 'https://marketo_acct_id_success.mktorest.com/rest/v1/leads.json',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ action: 'createOrUpdate',
+ input: [{ id: 4, userId: 'dummyMail@dummyDomain.com' }],
+ lookupField: 'id',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/marketo/router/data.ts b/test/integrations/destinations/marketo/router/data.ts
new file mode 100644
index 0000000000..d187792ea8
--- /dev/null
+++ b/test/integrations/destinations/marketo/router/data.ts
@@ -0,0 +1,1430 @@
+export const data = [
+ {
+ name: 'marketo',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
+ locale: 'en-US',
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'Android', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
+ timezone: 'Asia/Kolkata',
+ traits: { anonymousId: 'anon_id_success' },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: { All: true },
+ messageId: 'id1',
+ properties: { name: 'Test Product' },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-03-12T09:05:03.421Z',
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ destination: {
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [{ from: 'name', to: 'productName' }],
+ leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }],
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd',
+ deleted: false,
+ createdAt: '2020-12-30T08:39:32.005Z',
+ updatedAt: '2021-02-03T16:22:31.374Z',
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ },
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
+ locale: 'en-US',
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'Android', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
+ timezone: 'Asia/Kolkata',
+ traits: { anonymousId: 'anon_id_success' },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: { All: true },
+ messageId: 'id1',
+ properties: { name: 'Test Product', product_id: 'prod_1' },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-12-17T21:00:59.176Z',
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ destination: {
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [{ from: 'name', to: 'productName' }],
+ leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }],
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd',
+ deleted: false,
+ createdAt: '2020-12-30T08:39:32.005Z',
+ updatedAt: '2021-02-03T16:22:31.374Z',
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ },
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2022-09-19T10:34:02.002Z',
+ userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '2.12.1',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'https://accounts.app.t2.broken.com/home',
+ path: '/home',
+ title: 'Home',
+ search: '',
+ tab_url: 'https://accounts.app.t2.broken.com/home',
+ referrer: 'https://ts50-cvii.core.broken.org/',
+ initial_referrer: 'https://ts50-cvii.core.broken.org/',
+ referring_domain: 'ts50-cvii.core.broken.org',
+ initial_referring_domain: 'ts50-cvii.core.broken.org',
+ },
+ locale: 'en-IN',
+ screen: {
+ width: 1728,
+ height: 1117,
+ density: 2,
+ innerWidth: 1728,
+ innerHeight: 969,
+ },
+ traits: {
+ name: 'AM',
+ email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ lastName: 'M',
+ firstName: 'A',
+ accountName: 'MACDEV',
+ billingName: 'g g',
+ companyName: 'macDev',
+ currentTier: 'Webinar Pro 250',
+ billingCycle: 'Annually',
+ lastBillingDate: '2022-06-29T09:40:42.000Z',
+ nextBillingDate: '2023-09-09T04:00:00.000Z',
+ subscriptionType: 'Webinar Pro 250',
+ subscriptionStatus: 'ACTIVE',
+ lastWebinarEventDate: '2022-09-15T20:00:00.000Z',
+ nextWebinarEventDate: '2022-09-16T06:15:00.000Z',
+ },
+ library: { name: 'RudderLabs JavaScript SDK', version: '2.12.1' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
+ },
+ rudderId: '73dc83ef-587f-4077-90f3-c36083e64019',
+ messageId: '1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007',
+ timestamp: '2022-09-19T10:34:02.954Z',
+ receivedAt: '2022-09-19T10:34:02.956Z',
+ request_ip: '11.105.44.120',
+ anonymousId: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040',
+ integrations: { All: true },
+ originalTimestamp: '2022-09-19T10:34:02.000Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'valid_account_broken_event',
+ clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73',
+ clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd',
+ trackAnonymousEvents: false,
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ { event: 'acq_signup_completed', marketoActivityId: '100026' },
+ { event: 'act_createwebinarform_submit', marketoActivityId: '100025' },
+ { event: 'act_presentation_style', marketoActivityId: '100025' },
+ { event: 'act_webinar_view', marketoActivityId: '100025' },
+ { event: 'act_webinar_join', marketoActivityId: '100025' },
+ { event: 'act_presentation_addteammember', marketoActivityId: '100025' },
+ {
+ event: 'act_engagement_discussions_savediscussion',
+ marketoActivityId: '100025',
+ },
+ { event: 'act_engagement_networking_savetime', marketoActivityId: '100025' },
+ ],
+ },
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd',
+ deleted: false,
+ createdAt: '2022-02-10T08:39:32.005Z',
+ updatedAt: '2022-09-03T16:22:31.374Z',
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ },
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2022-09-19T10:34:02.002Z',
+ userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '2.12.1',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'https://accounts.app.t2.broken.com/home',
+ path: '/home',
+ title: 'Home',
+ search: '',
+ tab_url: 'https://accounts.app.t2.broken.com/home',
+ referrer: 'https://ts50-cvii.core.broken.org/',
+ initial_referrer: 'https://ts50-cvii.core.broken.org/',
+ referring_domain: 'ts50-cvii.core.broken.org',
+ initial_referring_domain: 'ts50-cvii.core.broken.org',
+ },
+ locale: 'en-IN',
+ screen: {
+ width: 1728,
+ height: 1117,
+ density: 2,
+ innerWidth: 1728,
+ innerHeight: 969,
+ },
+ traits: {
+ name: 'AM',
+ email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ lastName: 'M',
+ firstName: 'A',
+ accountName: 'MACDEV',
+ billingName: 'g g',
+ companyName: 'macDev',
+ currentTier: 'Webinar Pro 250',
+ billingCycle: 'Annually',
+ lastBillingDate: '2022-06-29T09:40:42.000Z',
+ nextBillingDate: '2023-09-09T04:00:00.000Z',
+ subscriptionType: 'Webinar Pro 250',
+ subscriptionStatus: 'ACTIVE',
+ lastWebinarEventDate: '2022-09-15T20:00:00.000Z',
+ nextWebinarEventDate: '2022-09-16T06:15:00.000Z',
+ },
+ library: { name: 'RudderLabs JavaScript SDK', version: '2.12.1' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
+ },
+ rudderId: '73dc83ef-587f-4077-90f3-c36083e64019',
+ messageId: '1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007',
+ timestamp: '2022-09-19T10:34:02.954Z',
+ receivedAt: '2022-09-19T10:34:02.956Z',
+ request_ip: '11.105.44.120',
+ anonymousId: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040',
+ integrations: { All: true },
+ originalTimestamp: '2022-09-19T10:34:02.000Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'unhandled_status_code',
+ clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73',
+ clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd',
+ trackAnonymousEvents: false,
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ { event: 'acq_signup_completed', marketoActivityId: '100026' },
+ { event: 'act_createwebinarform_submit', marketoActivityId: '100025' },
+ { event: 'act_presentation_style', marketoActivityId: '100025' },
+ { event: 'act_webinar_view', marketoActivityId: '100025' },
+ { event: 'act_webinar_join', marketoActivityId: '100025' },
+ { event: 'act_presentation_addteammember', marketoActivityId: '100025' },
+ {
+ event: 'act_engagement_discussions_savediscussion',
+ marketoActivityId: '100025',
+ },
+ { event: 'act_engagement_networking_savetime', marketoActivityId: '100025' },
+ ],
+ },
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd',
+ deleted: false,
+ createdAt: '2022-02-10T08:39:32.005Z',
+ updatedAt: '2022-09-03T16:22:31.374Z',
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ metadata: { jobId: 4, userId: 'u1' },
+ },
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2022-09-19T10:34:02.002Z',
+ userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704',
+ channel: 'web',
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '2.12.1',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ page: {
+ url: 'https://accounts.app.t2.broken.com/home',
+ path: '/home',
+ title: 'Home',
+ search: '',
+ tab_url: 'https://accounts.app.t2.broken.com/home',
+ referrer: 'https://ts50-cvii.core.broken.org/',
+ initial_referrer: 'https://ts50-cvii.core.broken.org/',
+ referring_domain: 'ts50-cvii.core.broken.org',
+ initial_referring_domain: 'ts50-cvii.core.broken.org',
+ },
+ locale: 'en-IN',
+ screen: {
+ width: 1728,
+ height: 1117,
+ density: 2,
+ innerWidth: 1728,
+ innerHeight: 969,
+ },
+ traits: {
+ name: 'AM',
+ email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ lastName: 'M',
+ firstName: 'A',
+ accountName: 'MACDEV',
+ billingName: 'g g',
+ companyName: 'macDev',
+ currentTier: 'Webinar Pro 250',
+ billingCycle: 'Annually',
+ lastBillingDate: '2022-06-29T09:40:42.000Z',
+ nextBillingDate: '2023-09-09T04:00:00.000Z',
+ subscriptionType: 'Webinar Pro 250',
+ subscriptionStatus: 'ACTIVE',
+ lastWebinarEventDate: '2022-09-15T20:00:00.000Z',
+ nextWebinarEventDate: '2022-09-16T06:15:00.000Z',
+ },
+ library: { name: 'RudderLabs JavaScript SDK', version: '2.12.1' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36',
+ },
+ rudderId: '73dc83ef-587f-4077-90f3-c36083e64019',
+ messageId: '1663583642000200-e3f31c4c-6361-4f99-b643-7755303a6007',
+ timestamp: '2022-09-19T10:34:02.954Z',
+ receivedAt: '2022-09-19T10:34:02.956Z',
+ request_ip: '11.105.44.120',
+ anonymousId: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040',
+ integrations: { All: true },
+ originalTimestamp: '2022-09-19T10:34:02.000Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'successful_identify_transformation',
+ clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73',
+ clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd',
+ trackAnonymousEvents: false,
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ { event: 'acq_signup_completed', marketoActivityId: '100026' },
+ { event: 'act_createwebinarform_submit', marketoActivityId: '100025' },
+ { event: 'act_presentation_style', marketoActivityId: '100025' },
+ { event: 'act_webinar_view', marketoActivityId: '100025' },
+ { event: 'act_webinar_join', marketoActivityId: '100025' },
+ { event: 'act_presentation_addteammember', marketoActivityId: '100025' },
+ {
+ event: 'act_engagement_discussions_savediscussion',
+ marketoActivityId: '100025',
+ },
+ { event: 'act_engagement_networking_savetime', marketoActivityId: '100025' },
+ ],
+ },
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd',
+ deleted: false,
+ createdAt: '2022-02-10T08:39:32.005Z',
+ updatedAt: '2022-09-03T16:22:31.374Z',
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ metadata: { jobId: 5, userId: 'u1' },
+ },
+ ],
+ destType: 'marketo',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer access_token_success',
+ },
+ params: {},
+ body: {
+ JSON: {
+ input: [
+ {
+ activityDate: '2020-12-17T21:00:59.176Z',
+ activityTypeId: 100001,
+ attributes: [],
+ leadId: 4,
+ primaryAttributeValue: 'Test Product',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ { destInfo: { authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVwe' }, jobId: 1, userId: 'u1' },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [{ from: 'name', to: 'productName' }],
+ leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }],
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd',
+ deleted: false,
+ createdAt: '2020-12-30T08:39:32.005Z',
+ updatedAt: '2021-02-03T16:22:31.374Z',
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ 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://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer access_token_success',
+ },
+ params: {},
+ body: {
+ JSON: {
+ input: [
+ {
+ activityDate: '2020-12-17T21:00:59.176Z',
+ activityTypeId: 100001,
+ attributes: [],
+ leadId: 4,
+ primaryAttributeValue: 'Test Product',
+ },
+ ],
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ { destInfo: { authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVwe' }, jobId: 2, userId: 'u1' },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [{ from: 'name', to: 'productName' }],
+ leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }],
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmLd',
+ deleted: false,
+ createdAt: '2020-12-30T08:39:32.005Z',
+ updatedAt: '2021-02-03T16:22:31.374Z',
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ },
+ {
+ batched: false,
+ statusCode: 400,
+ error:
+ '{"message":"Request Failed for marketo, Lookup field \'userId\' not found (Aborted).[Marketo Transformer]: During lead look up using email","destinationResponse":{"response":{"requestId":"142e4#1835b117b76","success":false,"errors":[{"code":"1006","message":"Lookup field \'userId\' not found"}]},"status":200}}',
+ statTags: { errorCategory: 'network', errorType: 'aborted' },
+ metadata: [
+ { destInfo: { authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVke' }, jobId: 3, userId: 'u1' },
+ ],
+ destination: {
+ Config: {
+ accountId: 'valid_account_broken_event',
+ clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73',
+ clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd',
+ trackAnonymousEvents: false,
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ { event: 'acq_signup_completed', marketoActivityId: '100026' },
+ { event: 'act_createwebinarform_submit', marketoActivityId: '100025' },
+ { event: 'act_presentation_style', marketoActivityId: '100025' },
+ { event: 'act_webinar_view', marketoActivityId: '100025' },
+ { event: 'act_webinar_join', marketoActivityId: '100025' },
+ { event: 'act_presentation_addteammember', marketoActivityId: '100025' },
+ {
+ event: 'act_engagement_discussions_savediscussion',
+ marketoActivityId: '100025',
+ },
+ { event: 'act_engagement_networking_savetime', marketoActivityId: '100025' },
+ ],
+ },
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd',
+ deleted: false,
+ createdAt: '2022-02-10T08:39:32.005Z',
+ updatedAt: '2022-09-03T16:22:31.374Z',
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ },
+ {
+ batched: false,
+ statusCode: 400,
+ error:
+ '{"message":"Error occurred [Marketo Transformer]: During lead look up using email -> some other problem","destinationResponse":{"response":{"requestId":"142e4#1835b117b76","success":false,"errors":[{"code":"random_marketo_code","message":"some other problem"}]},"status":200}}',
+ statTags: {
+ errorCategory: 'network',
+ errorType: 'aborted',
+ meta: 'unhandledStatusCode',
+ },
+ destination: {
+ Config: {
+ accountId: 'unhandled_status_code',
+ clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73',
+ clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd',
+ trackAnonymousEvents: false,
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ { event: 'acq_signup_completed', marketoActivityId: '100026' },
+ { event: 'act_createwebinarform_submit', marketoActivityId: '100025' },
+ { event: 'act_presentation_style', marketoActivityId: '100025' },
+ { event: 'act_webinar_view', marketoActivityId: '100025' },
+ { event: 'act_webinar_join', marketoActivityId: '100025' },
+ { event: 'act_presentation_addteammember', marketoActivityId: '100025' },
+ {
+ event: 'act_engagement_discussions_savediscussion',
+ marketoActivityId: '100025',
+ },
+ { event: 'act_engagement_networking_savetime', marketoActivityId: '100025' },
+ ],
+ },
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd',
+ deleted: false,
+ createdAt: '2022-02-10T08:39:32.005Z',
+ updatedAt: '2022-09-03T16:22:31.374Z',
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ metadata: [
+ { destInfo: { authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVke' }, jobId: 4, userId: 'u1' },
+ ],
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://successful_identify_transformation.mktorest.com/rest/v1/leads.json',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer access_token_success',
+ },
+ params: {},
+ body: {
+ JSON: {
+ action: 'createOrUpdate',
+ input: [
+ {
+ Email: '0c7b8b80-9c43-4f8e-b2d2-5e2448a25040@j.mail',
+ FirstName: 'A',
+ LastName: 'M',
+ id: 4,
+ userId: 'e17c5a5e-5e2f-430b-b497-fe3f1ea3a704',
+ },
+ ],
+ lookupField: 'id',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ { destInfo: { authKey: '1mMy5cqbtfuaKZv1IhVQKnBdVke' }, jobId: 5, userId: 'u1' },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accountId: 'successful_identify_transformation',
+ clientId: '504300cd-76b2-a7l4-bhle-90a07420nx73',
+ clientSecret: '3l3gJpzRsZagD6gu7tnTeKXz0bomLGnd',
+ trackAnonymousEvents: false,
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ { event: 'acq_signup_completed', marketoActivityId: '100026' },
+ { event: 'act_createwebinarform_submit', marketoActivityId: '100025' },
+ { event: 'act_presentation_style', marketoActivityId: '100025' },
+ { event: 'act_webinar_view', marketoActivityId: '100025' },
+ { event: 'act_webinar_join', marketoActivityId: '100025' },
+ { event: 'act_presentation_addteammember', marketoActivityId: '100025' },
+ {
+ event: 'act_engagement_discussions_savediscussion',
+ marketoActivityId: '100025',
+ },
+ { event: 'act_engagement_networking_savetime', marketoActivityId: '100025' },
+ ],
+ },
+ destinationDefinition: {
+ config: {
+ destConfig: {
+ defaultConfig: [
+ 'accountId',
+ 'clientId',
+ 'clientSecret',
+ 'trackAnonymousEvents',
+ 'rudderEventsMapping',
+ 'customActivityPropertyMap',
+ 'leadTraitMapping',
+ ],
+ },
+ secretKeys: ['clientSecret'],
+ excludeKeys: [],
+ includeKeys: [],
+ routerTransform: true,
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ responseRules: {
+ responseType: 'JSON',
+ rules: {
+ retryable: [
+ { success: 'false', 'errors.0.code': 600 },
+ { success: 'false', 'errors.0.code': 601 },
+ { success: 'false', 'errors.0.code': 602 },
+ { success: 'false', 'errors.0.code': 604 },
+ { success: 'false', 'errors.0.code': 606 },
+ { success: 'false', 'errors.0.code': 607 },
+ { success: 'false', 'errors.0.code': 608 },
+ { success: 'false', 'errors.0.code': 611 },
+ ],
+ abortable: [
+ { success: 'false', 'errors.0.code': 603 },
+ { success: 'false', 'errors.0.code': 605 },
+ { success: 'false', 'errors.0.code': 609 },
+ { success: 'false', 'errors.0.code': 610 },
+ ],
+ },
+ },
+ id: '1aIXqM806xAVm92nx07YwKbRrO9',
+ name: 'MARKETO',
+ displayName: 'Marketo',
+ createdAt: '2020-04-09T09:24:31.794Z',
+ updatedAt: '2021-01-11T11:03:28.103Z',
+ },
+ secretConfig: {},
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVke',
+ name: 'Marketo',
+ enabled: true,
+ workspaceId: '1TSN08muJTZwH8iCDmnnRt1pmMd',
+ deleted: false,
+ createdAt: '2022-02-10T08:39:32.005Z',
+ updatedAt: '2022-09-03T16:22:31.374Z',
+ transformations: [],
+ isConnectionEnabled: true,
+ isProcessorEnabled: true,
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: 'marketo',
+ description: 'processMetadataForRouter function specific test',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: 'anon_id_success',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'TestAppName',
+ namespace: 'com.android.sample',
+ version: '1.0',
+ },
+ device: {
+ id: 'anon_id_success',
+ manufacturer: 'Google',
+ model: 'Android SDK built for x86',
+ name: 'generic_x86',
+ type: 'android',
+ },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
+ locale: 'en-US',
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'Android', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
+ timezone: 'Asia/Kolkata',
+ traits: { anonymousId: 'anon_id_success' },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
+ },
+ event: 'Product Clicked',
+ integrations: { All: true },
+ messageId: 'id1',
+ properties: { name: 'Test Product', product_id: 'prod_1' },
+ originalTimestamp: '2020-12-17T21:00:59.176Z',
+ type: 'track',
+ sentAt: '2020-12-17T21:00:59.176Z',
+ },
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ { from: 'name', to: 'productName' },
+ { from: 'product_id', to: 'productId' },
+ ],
+ leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ metadata: [{ jobId: 1 }, { jobId: 1 }, { jobId: 1 }],
+ batched: false,
+ statusCode: 200,
+ },
+ ],
+ destType: 'marketo',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/activities/external.json',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ input: [
+ {
+ activityDate: '2020-12-17T21:00:59.176Z',
+ activityTypeId: 100001,
+ attributes: [{ name: 'productId', value: 'prod_1' }],
+ leadId: 4,
+ primaryAttributeValue: 'Test Product',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [[{ jobId: 1 }, { jobId: 1 }, { jobId: 1 }]],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ ID: '1mMy5cqbtfuaKZv1IhVQKnBdVwe',
+ Config: {
+ accountId: 'marketo_acct_id_success',
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ trackAnonymousEvents: true,
+ customActivityPropertyMap: [
+ { from: 'name', to: 'productName' },
+ { from: 'product_id', to: 'productId' },
+ ],
+ leadTraitMapping: [{ from: 'leadScore', to: 'customLeadScore' }],
+ createIfNotExist: true,
+ rudderEventsMapping: [
+ {
+ event: 'Product Clicked',
+ marketoPrimarykey: 'name',
+ marketoActivityId: '100001',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
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..5f3f2ccb58
--- /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
+ }
+ ]
+ }
+ }
+ }
+]
diff --git a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts
index e3deebca9b..0ac9123592 100644
--- a/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts
+++ b/test/integrations/destinations/marketo_static_list/dataDelivery/data.ts
@@ -365,4 +365,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/marketo_static_list/processor/data.ts b/test/integrations/destinations/marketo_static_list/processor/data.ts
index 51e4e87824..05fba54f6a 100644
--- a/test/integrations/destinations/marketo_static_list/processor/data.ts
+++ b/test/integrations/destinations/marketo_static_list/processor/data.ts
@@ -62,9 +62,9 @@ export const data = [
output: {
version: '1',
type: 'REST',
- method: 'POST',
+ method: 'DELETE',
endpoint:
- 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3',
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6',
headers: {
Authorization: 'Bearer access_token_success',
'Content-Type': 'application/json',
@@ -80,9 +80,9 @@ export const data = [
output: {
version: '1',
type: 'REST',
- method: 'DELETE',
+ method: 'POST',
endpoint:
- 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6',
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3',
headers: {
Authorization: 'Bearer access_token_success',
'Content-Type': 'application/json',
diff --git a/test/integrations/destinations/marketo_static_list/router/data.ts b/test/integrations/destinations/marketo_static_list/router/data.ts
index 23b2ea8ea3..6525f7419d 100644
--- a/test/integrations/destinations/marketo_static_list/router/data.ts
+++ b/test/integrations/destinations/marketo_static_list/router/data.ts
@@ -1,7 +1,8 @@
export const data = [
{
name: 'marketo_static_list',
- description: 'Test 0',
+ description:
+ 'Test 0: Test audiencelist event with add and remove: Test eventtype lowercase and uppercase',
feature: 'router',
module: 'destination',
version: 'v0',
@@ -37,42 +38,15 @@ export const data = [
type: 'audiencelist',
properties: {
listData: {
- add: [
- {
- id: 1,
- },
- {
- id: 2,
- },
- {
- id: 3,
- },
- ],
- remove: [
- {
- id: 4,
- },
- {
- id: 5,
- },
- {
- id: 6,
- },
- ],
+ add: [{ id: 1 }, { id: 2 }, { id: 3 }],
+ remove: [{ id: 4 }, { id: 5 }, { id: 6 }],
},
enablePartialFailure: true,
},
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
timestamp: '2020-02-02T00:23:09.544Z',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
},
{
destination: {
@@ -99,1122 +73,369 @@ export const data = [
userId: 'user 1',
anonymousId: 'anon-id-new',
event: 'event1',
- type: 'audiencelist',
+ type: 'audienceList',
properties: {
listData: {
add: [
- {
- id: 0,
- },
- {
- id: 1,
- },
- {
- id: 2,
- },
- {
- id: 3,
- },
- {
- id: 4,
- },
- {
- id: 5,
- },
- {
- id: 6,
- },
- {
- id: 7,
- },
- {
- id: 8,
- },
- {
- id: 9,
- },
- {
- id: 10,
- },
- {
- id: 11,
- },
- {
- id: 12,
- },
- {
- id: 13,
- },
- {
- id: 14,
- },
- {
- id: 15,
- },
- {
- id: 16,
- },
- {
- id: 17,
- },
- {
- id: 18,
- },
- {
- id: 19,
- },
- {
- id: 20,
- },
- {
- id: 21,
- },
- {
- id: 22,
- },
- {
- id: 23,
- },
- {
- id: 24,
- },
- {
- id: 25,
- },
- {
- id: 26,
- },
- {
- id: 27,
- },
- {
- id: 28,
- },
- {
- id: 29,
- },
- {
- id: 30,
- },
- {
- id: 31,
- },
- {
- id: 32,
- },
- {
- id: 33,
- },
- {
- id: 34,
- },
- {
- id: 35,
- },
- {
- id: 36,
- },
- {
- id: 37,
- },
- {
- id: 38,
- },
- {
- id: 39,
- },
- {
- id: 40,
- },
- {
- id: 41,
- },
- {
- id: 42,
- },
- {
- id: 43,
- },
- {
- id: 44,
- },
- {
- id: 45,
- },
- {
- id: 46,
- },
- {
- id: 47,
- },
- {
- id: 48,
- },
- {
- id: 49,
- },
- {
- id: 50,
- },
- {
- id: 51,
- },
- {
- id: 52,
- },
- {
- id: 53,
- },
- {
- id: 54,
- },
- {
- id: 55,
- },
- {
- id: 56,
- },
- {
- id: 57,
- },
- {
- id: 58,
- },
- {
- id: 59,
- },
- {
- id: 60,
- },
- {
- id: 61,
- },
- {
- id: 62,
- },
- {
- id: 63,
- },
- {
- id: 64,
- },
- {
- id: 65,
- },
- {
- id: 66,
- },
- {
- id: 67,
- },
- {
- id: 68,
- },
- {
- id: 69,
- },
- {
- id: 70,
- },
- {
- id: 71,
- },
- {
- id: 72,
- },
- {
- id: 73,
- },
- {
- id: 74,
- },
- {
- id: 75,
- },
- {
- id: 76,
- },
- {
- id: 77,
- },
- {
- id: 78,
- },
- {
- id: 79,
- },
- {
- id: 80,
- },
- {
- id: 81,
- },
- {
- id: 82,
- },
- {
- id: 83,
- },
- {
- id: 84,
- },
- {
- id: 85,
- },
- {
- id: 86,
- },
- {
- id: 87,
- },
- {
- id: 88,
- },
- {
- id: 89,
- },
- {
- id: 90,
- },
- {
- id: 91,
- },
- {
- id: 92,
- },
- {
- id: 93,
- },
- {
- id: 94,
- },
- {
- id: 95,
- },
- {
- id: 96,
- },
- {
- id: 97,
- },
- {
- id: 98,
- },
- {
- id: 99,
- },
- {
- id: 100,
- },
- {
- id: 101,
- },
- {
- id: 102,
- },
- {
- id: 103,
- },
- {
- id: 104,
- },
- {
- id: 105,
- },
- {
- id: 106,
- },
- {
- id: 107,
- },
- {
- id: 108,
- },
- {
- id: 109,
- },
- {
- id: 110,
- },
- {
- id: 111,
- },
- {
- id: 112,
- },
- {
- id: 113,
- },
- {
- id: 114,
- },
- {
- id: 115,
- },
- {
- id: 116,
- },
- {
- id: 117,
- },
- {
- id: 118,
- },
- {
- id: 119,
- },
- {
- id: 120,
- },
- {
- id: 121,
- },
- {
- id: 122,
- },
- {
- id: 123,
- },
- {
- id: 124,
- },
- {
- id: 125,
- },
- {
- id: 126,
- },
- {
- id: 127,
- },
- {
- id: 128,
- },
- {
- id: 129,
- },
- {
- id: 130,
- },
- {
- id: 131,
- },
- {
- id: 132,
- },
- {
- id: 133,
- },
- {
- id: 134,
- },
- {
- id: 135,
- },
- {
- id: 136,
- },
- {
- id: 137,
- },
- {
- id: 138,
- },
- {
- id: 139,
- },
- {
- id: 140,
- },
- {
- id: 141,
- },
- {
- id: 142,
- },
- {
- id: 143,
- },
- {
- id: 144,
- },
- {
- id: 145,
- },
- {
- id: 146,
- },
- {
- id: 147,
- },
- {
- id: 148,
- },
- {
- id: 149,
- },
- {
- id: 150,
- },
- {
- id: 151,
- },
- {
- id: 152,
- },
- {
- id: 153,
- },
- {
- id: 154,
- },
- {
- id: 155,
- },
- {
- id: 156,
- },
- {
- id: 157,
- },
- {
- id: 158,
- },
- {
- id: 159,
- },
- {
- id: 160,
- },
- {
- id: 161,
- },
- {
- id: 162,
- },
- {
- id: 163,
- },
- {
- id: 164,
- },
- {
- id: 165,
- },
- {
- id: 166,
- },
- {
- id: 167,
- },
- {
- id: 168,
- },
- {
- id: 169,
- },
- {
- id: 170,
- },
- {
- id: 171,
- },
- {
- id: 172,
- },
- {
- id: 173,
- },
- {
- id: 174,
- },
- {
- id: 175,
- },
- {
- id: 176,
- },
- {
- id: 177,
- },
- {
- id: 178,
- },
- {
- id: 179,
- },
- {
- id: 180,
- },
- {
- id: 181,
- },
- {
- id: 182,
- },
- {
- id: 183,
- },
- {
- id: 184,
- },
- {
- id: 185,
- },
- {
- id: 186,
- },
- {
- id: 187,
- },
- {
- id: 188,
- },
- {
- id: 189,
- },
- {
- id: 190,
- },
- {
- id: 191,
- },
- {
- id: 192,
- },
- {
- id: 193,
- },
- {
- id: 194,
- },
- {
- id: 195,
- },
- {
- id: 196,
- },
- {
- id: 197,
- },
- {
- id: 198,
- },
- {
- id: 199,
- },
- {
- id: 200,
- },
- {
- id: 201,
- },
- {
- id: 202,
- },
- {
- id: 203,
- },
- {
- id: 204,
- },
- {
- id: 205,
- },
- {
- id: 206,
- },
- {
- id: 207,
- },
- {
- id: 208,
- },
- {
- id: 209,
- },
- {
- id: 210,
- },
- {
- id: 211,
- },
- {
- id: 212,
- },
- {
- id: 213,
- },
- {
- id: 214,
- },
- {
- id: 215,
- },
- {
- id: 216,
- },
- {
- id: 217,
- },
- {
- id: 218,
- },
- {
- id: 219,
- },
- {
- id: 220,
- },
- {
- id: 221,
- },
- {
- id: 222,
- },
- {
- id: 223,
- },
- {
- id: 224,
- },
- {
- id: 225,
- },
- {
- id: 226,
- },
- {
- id: 227,
- },
- {
- id: 228,
- },
- {
- id: 229,
- },
- {
- id: 230,
- },
- {
- id: 231,
- },
- {
- id: 232,
- },
- {
- id: 233,
- },
- {
- id: 234,
- },
- {
- id: 235,
- },
- {
- id: 236,
- },
- {
- id: 237,
- },
- {
- id: 238,
- },
- {
- id: 239,
- },
- {
- id: 240,
- },
- {
- id: 241,
- },
- {
- id: 242,
- },
- {
- id: 243,
- },
- {
- id: 244,
- },
- {
- id: 245,
- },
- {
- id: 246,
- },
- {
- id: 247,
- },
- {
- id: 248,
- },
- {
- id: 249,
- },
- {
- id: 250,
- },
- {
- id: 251,
- },
- {
- id: 252,
- },
- {
- id: 253,
- },
- {
- id: 254,
- },
- {
- id: 255,
- },
- {
- id: 256,
- },
- {
- id: 257,
- },
- {
- id: 258,
- },
- {
- id: 259,
- },
- {
- id: 260,
- },
- {
- id: 261,
- },
- {
- id: 262,
- },
- {
- id: 263,
- },
- {
- id: 264,
- },
- {
- id: 265,
- },
- {
- id: 266,
- },
- {
- id: 267,
- },
- {
- id: 268,
- },
- {
- id: 269,
- },
- {
- id: 270,
- },
- {
- id: 271,
- },
- {
- id: 272,
- },
- {
- id: 273,
- },
- {
- id: 274,
- },
- {
- id: 275,
- },
- {
- id: 276,
- },
- {
- id: 277,
- },
- {
- id: 278,
- },
- {
- id: 279,
- },
- {
- id: 280,
- },
- {
- id: 281,
- },
- {
- id: 282,
- },
- {
- id: 283,
- },
- {
- id: 284,
- },
- {
- id: 285,
- },
- {
- id: 286,
- },
- {
- id: 287,
- },
- {
- id: 288,
- },
- {
- id: 289,
- },
- {
- id: 290,
- },
- {
- id: 291,
- },
- {
- id: 292,
- },
- {
- id: 293,
- },
- {
- id: 294,
- },
- {
- id: 295,
- },
- {
- id: 296,
- },
- {
- id: 297,
- },
- {
- id: 298,
- },
- {
- id: 299,
- },
- {
- id: 300,
- },
- {
- id: 301,
- },
- {
- id: 302,
- },
- {
- id: 303,
- },
- {
- id: 304,
- },
- {
- id: 305,
- },
- {
- id: 306,
- },
- {
- id: 307,
- },
- {
- id: 308,
- },
- {
- id: 309,
- },
- {
- id: 310,
- },
- {
- id: 311,
- },
- {
- id: 312,
- },
- {
- id: 313,
- },
- {
- id: 314,
- },
- {
- id: 315,
- },
- {
- id: 316,
- },
- {
- id: 317,
- },
- {
- id: 318,
- },
- {
- id: 319,
- },
- {
- id: 320,
- },
- {
- id: 321,
- },
- {
- id: 322,
- },
- {
- id: 323,
- },
- {
- id: 324,
- },
- {
- id: 325,
- },
- {
- id: 326,
- },
- {
- id: 327,
- },
- {
- id: 328,
- },
- {
- id: 329,
- },
- {
- id: 330,
- },
- {
- id: 331,
- },
- {
- id: 332,
- },
- {
- id: 333,
- },
- {
- id: 334,
- },
- {
- id: 335,
- },
- {
- id: 336,
- },
- {
- id: 337,
- },
- {
- id: 338,
- },
- {
- id: 339,
- },
- {
- id: 340,
- },
- {
- id: 341,
- },
- {
- id: 342,
- },
- {
- id: 343,
- },
- {
- id: 344,
- },
- {
- id: 345,
- },
- {
- id: 346,
- },
- {
- id: 347,
- },
- {
- id: 348,
- },
- {
- id: 349,
- },
- {
- id: 350,
- },
+ { id: 0 },
+ { id: 1 },
+ { id: 2 },
+ { id: 3 },
+ { id: 4 },
+ { id: 5 },
+ { id: 6 },
+ { id: 7 },
+ { id: 8 },
+ { id: 9 },
+ { id: 10 },
+ { id: 11 },
+ { id: 12 },
+ { id: 13 },
+ { id: 14 },
+ { id: 15 },
+ { id: 16 },
+ { id: 17 },
+ { id: 18 },
+ { id: 19 },
+ { id: 20 },
+ { id: 21 },
+ { id: 22 },
+ { id: 23 },
+ { id: 24 },
+ { id: 25 },
+ { id: 26 },
+ { id: 27 },
+ { id: 28 },
+ { id: 29 },
+ { id: 30 },
+ { id: 31 },
+ { id: 32 },
+ { id: 33 },
+ { id: 34 },
+ { id: 35 },
+ { id: 36 },
+ { id: 37 },
+ { id: 38 },
+ { id: 39 },
+ { id: 40 },
+ { id: 41 },
+ { id: 42 },
+ { id: 43 },
+ { id: 44 },
+ { id: 45 },
+ { id: 46 },
+ { id: 47 },
+ { id: 48 },
+ { id: 49 },
+ { id: 50 },
+ { id: 51 },
+ { id: 52 },
+ { id: 53 },
+ { id: 54 },
+ { id: 55 },
+ { id: 56 },
+ { id: 57 },
+ { id: 58 },
+ { id: 59 },
+ { id: 60 },
+ { id: 61 },
+ { id: 62 },
+ { id: 63 },
+ { id: 64 },
+ { id: 65 },
+ { id: 66 },
+ { id: 67 },
+ { id: 68 },
+ { id: 69 },
+ { id: 70 },
+ { id: 71 },
+ { id: 72 },
+ { id: 73 },
+ { id: 74 },
+ { id: 75 },
+ { id: 76 },
+ { id: 77 },
+ { id: 78 },
+ { id: 79 },
+ { id: 80 },
+ { id: 81 },
+ { id: 82 },
+ { id: 83 },
+ { id: 84 },
+ { id: 85 },
+ { id: 86 },
+ { id: 87 },
+ { id: 88 },
+ { id: 89 },
+ { id: 90 },
+ { id: 91 },
+ { id: 92 },
+ { id: 93 },
+ { id: 94 },
+ { id: 95 },
+ { id: 96 },
+ { id: 97 },
+ { id: 98 },
+ { id: 99 },
+ { id: 100 },
+ { id: 101 },
+ { id: 102 },
+ { id: 103 },
+ { id: 104 },
+ { id: 105 },
+ { id: 106 },
+ { id: 107 },
+ { id: 108 },
+ { id: 109 },
+ { id: 110 },
+ { id: 111 },
+ { id: 112 },
+ { id: 113 },
+ { id: 114 },
+ { id: 115 },
+ { id: 116 },
+ { id: 117 },
+ { id: 118 },
+ { id: 119 },
+ { id: 120 },
+ { id: 121 },
+ { id: 122 },
+ { id: 123 },
+ { id: 124 },
+ { id: 125 },
+ { id: 126 },
+ { id: 127 },
+ { id: 128 },
+ { id: 129 },
+ { id: 130 },
+ { id: 131 },
+ { id: 132 },
+ { id: 133 },
+ { id: 134 },
+ { id: 135 },
+ { id: 136 },
+ { id: 137 },
+ { id: 138 },
+ { id: 139 },
+ { id: 140 },
+ { id: 141 },
+ { id: 142 },
+ { id: 143 },
+ { id: 144 },
+ { id: 145 },
+ { id: 146 },
+ { id: 147 },
+ { id: 148 },
+ { id: 149 },
+ { id: 150 },
+ { id: 151 },
+ { id: 152 },
+ { id: 153 },
+ { id: 154 },
+ { id: 155 },
+ { id: 156 },
+ { id: 157 },
+ { id: 158 },
+ { id: 159 },
+ { id: 160 },
+ { id: 161 },
+ { id: 162 },
+ { id: 163 },
+ { id: 164 },
+ { id: 165 },
+ { id: 166 },
+ { id: 167 },
+ { id: 168 },
+ { id: 169 },
+ { id: 170 },
+ { id: 171 },
+ { id: 172 },
+ { id: 173 },
+ { id: 174 },
+ { id: 175 },
+ { id: 176 },
+ { id: 177 },
+ { id: 178 },
+ { id: 179 },
+ { id: 180 },
+ { id: 181 },
+ { id: 182 },
+ { id: 183 },
+ { id: 184 },
+ { id: 185 },
+ { id: 186 },
+ { id: 187 },
+ { id: 188 },
+ { id: 189 },
+ { id: 190 },
+ { id: 191 },
+ { id: 192 },
+ { id: 193 },
+ { id: 194 },
+ { id: 195 },
+ { id: 196 },
+ { id: 197 },
+ { id: 198 },
+ { id: 199 },
+ { id: 200 },
+ { id: 201 },
+ { id: 202 },
+ { id: 203 },
+ { id: 204 },
+ { id: 205 },
+ { id: 206 },
+ { id: 207 },
+ { id: 208 },
+ { id: 209 },
+ { id: 210 },
+ { id: 211 },
+ { id: 212 },
+ { id: 213 },
+ { id: 214 },
+ { id: 215 },
+ { id: 216 },
+ { id: 217 },
+ { id: 218 },
+ { id: 219 },
+ { id: 220 },
+ { id: 221 },
+ { id: 222 },
+ { id: 223 },
+ { id: 224 },
+ { id: 225 },
+ { id: 226 },
+ { id: 227 },
+ { id: 228 },
+ { id: 229 },
+ { id: 230 },
+ { id: 231 },
+ { id: 232 },
+ { id: 233 },
+ { id: 234 },
+ { id: 235 },
+ { id: 236 },
+ { id: 237 },
+ { id: 238 },
+ { id: 239 },
+ { id: 240 },
+ { id: 241 },
+ { id: 242 },
+ { id: 243 },
+ { id: 244 },
+ { id: 245 },
+ { id: 246 },
+ { id: 247 },
+ { id: 248 },
+ { id: 249 },
+ { id: 250 },
+ { id: 251 },
+ { id: 252 },
+ { id: 253 },
+ { id: 254 },
+ { id: 255 },
+ { id: 256 },
+ { id: 257 },
+ { id: 258 },
+ { id: 259 },
+ { id: 260 },
+ { id: 261 },
+ { id: 262 },
+ { id: 263 },
+ { id: 264 },
+ { id: 265 },
+ { id: 266 },
+ { id: 267 },
+ { id: 268 },
+ { id: 269 },
+ { id: 270 },
+ { id: 271 },
+ { id: 272 },
+ { id: 273 },
+ { id: 274 },
+ { id: 275 },
+ { id: 276 },
+ { id: 277 },
+ { id: 278 },
+ { id: 279 },
+ { id: 280 },
+ { id: 281 },
+ { id: 282 },
+ { id: 283 },
+ { id: 284 },
+ { id: 285 },
+ { id: 286 },
+ { id: 287 },
+ { id: 288 },
+ { id: 289 },
+ { id: 290 },
+ { id: 291 },
+ { id: 292 },
+ { id: 293 },
+ { id: 294 },
+ { id: 295 },
+ { id: 296 },
+ { id: 297 },
+ { id: 298 },
+ { id: 299 },
+ { id: 300 },
+ { id: 301 },
+ { id: 302 },
+ { id: 303 },
+ { id: 304 },
+ { id: 305 },
+ { id: 306 },
+ { id: 307 },
+ { id: 308 },
+ { id: 309 },
+ { id: 310 },
+ { id: 311 },
+ { id: 312 },
+ { id: 313 },
+ { id: 314 },
+ { id: 315 },
+ { id: 316 },
+ { id: 317 },
+ { id: 318 },
+ { id: 319 },
+ { id: 320 },
+ { id: 321 },
+ { id: 322 },
+ { id: 323 },
+ { id: 324 },
+ { id: 325 },
+ { id: 326 },
+ { id: 327 },
+ { id: 328 },
+ { id: 329 },
+ { id: 330 },
+ { id: 331 },
+ { id: 332 },
+ { id: 333 },
+ { id: 334 },
+ { id: 335 },
+ { id: 336 },
+ { id: 337 },
+ { id: 338 },
+ { id: 339 },
+ { id: 340 },
+ { id: 341 },
+ { id: 342 },
+ { id: 343 },
+ { id: 344 },
+ { id: 345 },
+ { id: 346 },
+ { id: 347 },
+ { id: 348 },
+ { id: 349 },
+ { id: 350 },
],
},
enablePartialFailure: true,
},
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
- timestamp: '2020-02-02T00:23:09.544Z',
- },
- metadata: {
- jobId: 2,
- },
- },
- {
- destination: {
- ID: '1zia9wKshXt80YksLmUdJnr7IHI',
- Name: 'test_marketo',
- DestinationDefinition: {
- ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
- Name: 'MARKETO',
- DisplayName: 'Marketo',
- transformAt: 'processor',
- transformAtV1: 'processor',
- },
- Config: {
- clientId: 'marketo_client_id_success',
- clientSecret: 'marketo_client_secret_success',
- accountId: 'marketo_acct_id_success',
- staticListId: 1234,
- },
- Enabled: true,
- Transformations: [],
- IsProcessorEnabled: true,
- },
- message: {
- userId: 'user 1',
- anonymousId: 'anon-id-new',
- event: 'event1',
- type: 'track',
- properties: {
- listData: {
- remove: [1],
- },
- enablePartialFailure: true,
- },
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
timestamp: '2020-02-02T00:23:09.544Z',
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 2, userId: 'u1' },
},
],
destType: 'marketo_static_list',
@@ -1232,49 +453,34 @@ export const data = [
{
version: '1',
type: 'REST',
- method: 'POST',
+ method: 'DELETE',
endpoint:
- 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3',
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6',
headers: {
Authorization: 'Bearer access_token_success',
'Content-Type': 'application/json',
},
params: {},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
{
version: '1',
type: 'REST',
- method: 'DELETE',
+ method: 'POST',
endpoint:
- 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6',
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=1&id=2&id=3',
headers: {
Authorization: 'Bearer access_token_success',
'Content-Type': 'application/json',
},
params: {},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
],
metadata: [
- {
- destInfo: {
- authKey: '1zia9wKshXt80YksLmUdJnr7IHI',
- },
- jobId: 1,
- },
+ { destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, jobId: 1, userId: 'u1' },
],
batched: false,
statusCode: 200,
@@ -1312,12 +518,7 @@ export const data = [
'Content-Type': 'application/json',
},
params: {},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
{
@@ -1331,22 +532,12 @@ export const data = [
'Content-Type': 'application/json',
},
params: {},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
],
metadata: [
- {
- destInfo: {
- authKey: '1zia9wKshXt80YksLmUdJnr7IHI',
- },
- jobId: 2,
- },
+ { destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, jobId: 2, userId: 'u1' },
],
batched: false,
statusCode: 200,
@@ -1371,18 +562,271 @@ export const data = [
IsProcessorEnabled: true,
},
},
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: 'marketo_static_list',
+ description: 'Test 1: Test record and audiencelist events in a single batch',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
{
- metadata: [
- {
- destInfo: {
- authKey: '1zia9wKshXt80YksLmUdJnr7IHI',
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: { id: 1001 },
+ channel: 'sources',
+ context: {
+ sources: {
+ job_id: '2VsZs4hyPpq7f1p8igrpmHsibHl',
+ version: 'feat.mirrorRetlEvent',
+ job_run_id: 'ck99nbd2kqiljdihhkh0',
+ task_run_id: 'ck99nbd2kqiljdihhkhg',
},
- jobId: 3,
+ externalId: [{ type: 'marketoStaticListId', identifierType: 'id' }],
+ destinationFields: 'id',
+ mappedToDestination: 'true',
},
- ],
+ recordId: '3',
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: { id: 1002 },
+ channel: 'sources',
+ context: {
+ sources: {
+ job_id: '2VsZs4hyPpq7f1p8igrpmHsibHl',
+ version: 'feat.mirrorRetlEvent',
+ job_run_id: 'ck99nbd2kqiljdihhkh0',
+ task_run_id: 'ck99nbd2kqiljdihhkhg',
+ },
+ externalId: [{ type: 'marketoStaticListId', identifierType: 'id' }],
+ destinationFields: 'id',
+ mappedToDestination: 'true',
+ },
+ recordId: '3',
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: { id: 1003 },
+ channel: 'sources',
+ context: {
+ sources: {
+ job_id: '2VsZs4hyPpq7f1p8igrpmHsibHl',
+ version: 'feat.mirrorRetlEvent',
+ job_run_id: 'ck99nbd2kqiljdihhkh0',
+ task_run_id: 'ck99nbd2kqiljdihhkhg',
+ },
+ externalId: [{ type: 'marketoStaticListId', identifierType: 'id' }],
+ destinationFields: 'id',
+ mappedToDestination: 'true',
+ },
+ recordId: '3',
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ action: 'delete',
+ context: {
+ destinationFields: 'id',
+ externalId: [{ identifierType: 'id', type: 'marketoStaticListId' }],
+ mappedToDestination: 'true',
+ sources: {
+ job_id: 'sf',
+ job_run_id: 'ck985bve58cvnti48120',
+ task_run_id: 'ck985bve58cvnti4812g',
+ version: '',
+ },
+ },
+ recordId: '2',
+ rudderId: '2',
+ fields: { id: '2001' },
+ type: 'record',
+ },
+ metadata: { jobId: 4, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ action: 'delete',
+ context: {
+ destinationFields: 'id',
+ externalId: [{ identifierType: 'id', type: 'marketoStaticListId' }],
+ mappedToDestination: 'true',
+ sources: {
+ job_id: 'sf',
+ job_run_id: 'ck985bve58cvnti48120',
+ task_run_id: 'ck985bve58cvnti4812g',
+ version: '',
+ },
+ },
+ recordId: '2',
+ rudderId: '2',
+ fields: { id: '2002' },
+ type: 'record',
+ },
+ metadata: { jobId: 5, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ action: 'delete',
+ context: {
+ destinationFields: 'id',
+ externalId: [{ identifierType: 'id', type: 'marketoStaticListId' }],
+ mappedToDestination: 'true',
+ sources: {
+ job_id: 'sf',
+ job_run_id: 'ck985bve58cvnti48120',
+ task_run_id: 'ck985bve58cvnti4812g',
+ version: '',
+ },
+ },
+ recordId: '2',
+ rudderId: '2',
+ fields: { id: '2003' },
+ type: 'record',
+ },
+ metadata: { jobId: 6, userId: 'u1' },
+ },
+ {
destination: {
ID: '1zia9wKshXt80YksLmUdJnr7IHI',
- Name: 'test_marketo',
+ Name: 'test_marketo_al',
DestinationDefinition: {
ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
Name: 'MARKETO',
@@ -1400,12 +844,1071 @@ export const data = [
Transformations: [],
IsProcessorEnabled: true,
},
- batched: false,
- statusCode: 400,
- error: 'Event type track is not supported',
- statTags: {
- errorCategory: 'dataValidation',
- errorType: 'instrumentation',
+ message: {
+ userId: 'user 1',
+ anonymousId: 'anon-id-new',
+ event: 'event1',
+ type: 'audiencelist',
+ properties: {
+ listData: {
+ add: [{ id: 101 }, { id: 102 }, { id: 103 }],
+ remove: [{ id: 4 }, { id: 5 }, { id: 6 }],
+ },
+ enablePartialFailure: true,
+ },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
+ timestamp: '2020-02-02T00:23:09.544Z',
+ },
+ metadata: { jobId: 7, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zia9wKshXt80YksLmUdJnr7IHI',
+ Name: 'test_marketo_al',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1234,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ userId: 'user 1',
+ anonymousId: 'anon-id-new',
+ event: 'event1',
+ type: 'audiencelist',
+ properties: {
+ listData: {
+ add: [
+ { id: 0 },
+ { id: 1 },
+ { id: 2 },
+ { id: 3 },
+ { id: 4 },
+ { id: 5 },
+ { id: 6 },
+ { id: 7 },
+ { id: 8 },
+ { id: 9 },
+ { id: 10 },
+ { id: 11 },
+ { id: 12 },
+ { id: 13 },
+ { id: 14 },
+ { id: 15 },
+ { id: 16 },
+ { id: 17 },
+ { id: 18 },
+ { id: 19 },
+ { id: 20 },
+ { id: 21 },
+ { id: 22 },
+ { id: 23 },
+ { id: 24 },
+ { id: 25 },
+ { id: 26 },
+ { id: 27 },
+ { id: 28 },
+ { id: 29 },
+ { id: 30 },
+ { id: 31 },
+ { id: 32 },
+ { id: 33 },
+ { id: 34 },
+ { id: 35 },
+ { id: 36 },
+ { id: 37 },
+ { id: 38 },
+ { id: 39 },
+ { id: 40 },
+ { id: 41 },
+ { id: 42 },
+ { id: 43 },
+ { id: 44 },
+ { id: 45 },
+ { id: 46 },
+ { id: 47 },
+ { id: 48 },
+ { id: 49 },
+ { id: 50 },
+ { id: 51 },
+ { id: 52 },
+ { id: 53 },
+ { id: 54 },
+ { id: 55 },
+ { id: 56 },
+ { id: 57 },
+ { id: 58 },
+ { id: 59 },
+ { id: 60 },
+ { id: 61 },
+ { id: 62 },
+ { id: 63 },
+ { id: 64 },
+ { id: 65 },
+ { id: 66 },
+ { id: 67 },
+ { id: 68 },
+ { id: 69 },
+ { id: 70 },
+ { id: 71 },
+ { id: 72 },
+ { id: 73 },
+ { id: 74 },
+ { id: 75 },
+ { id: 76 },
+ { id: 77 },
+ { id: 78 },
+ { id: 79 },
+ { id: 80 },
+ { id: 81 },
+ { id: 82 },
+ { id: 83 },
+ { id: 84 },
+ { id: 85 },
+ { id: 86 },
+ { id: 87 },
+ { id: 88 },
+ { id: 89 },
+ { id: 90 },
+ { id: 91 },
+ { id: 92 },
+ { id: 93 },
+ { id: 94 },
+ { id: 95 },
+ { id: 96 },
+ { id: 97 },
+ { id: 98 },
+ { id: 99 },
+ { id: 100 },
+ { id: 101 },
+ { id: 102 },
+ { id: 103 },
+ { id: 104 },
+ { id: 105 },
+ { id: 106 },
+ { id: 107 },
+ { id: 108 },
+ { id: 109 },
+ { id: 110 },
+ { id: 111 },
+ { id: 112 },
+ { id: 113 },
+ { id: 114 },
+ { id: 115 },
+ { id: 116 },
+ { id: 117 },
+ { id: 118 },
+ { id: 119 },
+ { id: 120 },
+ { id: 121 },
+ { id: 122 },
+ { id: 123 },
+ { id: 124 },
+ { id: 125 },
+ { id: 126 },
+ { id: 127 },
+ { id: 128 },
+ { id: 129 },
+ { id: 130 },
+ { id: 131 },
+ { id: 132 },
+ { id: 133 },
+ { id: 134 },
+ { id: 135 },
+ { id: 136 },
+ { id: 137 },
+ { id: 138 },
+ { id: 139 },
+ { id: 140 },
+ { id: 141 },
+ { id: 142 },
+ { id: 143 },
+ { id: 144 },
+ { id: 145 },
+ { id: 146 },
+ { id: 147 },
+ { id: 148 },
+ { id: 149 },
+ { id: 150 },
+ { id: 151 },
+ { id: 152 },
+ { id: 153 },
+ { id: 154 },
+ { id: 155 },
+ { id: 156 },
+ { id: 157 },
+ { id: 158 },
+ { id: 159 },
+ { id: 160 },
+ { id: 161 },
+ { id: 162 },
+ { id: 163 },
+ { id: 164 },
+ { id: 165 },
+ { id: 166 },
+ { id: 167 },
+ { id: 168 },
+ { id: 169 },
+ { id: 170 },
+ { id: 171 },
+ { id: 172 },
+ { id: 173 },
+ { id: 174 },
+ { id: 175 },
+ { id: 176 },
+ { id: 177 },
+ { id: 178 },
+ { id: 179 },
+ { id: 180 },
+ { id: 181 },
+ { id: 182 },
+ { id: 183 },
+ { id: 184 },
+ { id: 185 },
+ { id: 186 },
+ { id: 187 },
+ { id: 188 },
+ { id: 189 },
+ { id: 190 },
+ { id: 191 },
+ { id: 192 },
+ { id: 193 },
+ { id: 194 },
+ { id: 195 },
+ { id: 196 },
+ { id: 197 },
+ { id: 198 },
+ { id: 199 },
+ { id: 200 },
+ { id: 201 },
+ { id: 202 },
+ { id: 203 },
+ { id: 204 },
+ { id: 205 },
+ { id: 206 },
+ { id: 207 },
+ { id: 208 },
+ { id: 209 },
+ { id: 210 },
+ { id: 211 },
+ { id: 212 },
+ { id: 213 },
+ { id: 214 },
+ { id: 215 },
+ { id: 216 },
+ { id: 217 },
+ { id: 218 },
+ { id: 219 },
+ { id: 220 },
+ { id: 221 },
+ { id: 222 },
+ { id: 223 },
+ { id: 224 },
+ { id: 225 },
+ { id: 226 },
+ { id: 227 },
+ { id: 228 },
+ { id: 229 },
+ { id: 230 },
+ { id: 231 },
+ { id: 232 },
+ { id: 233 },
+ { id: 234 },
+ { id: 235 },
+ { id: 236 },
+ { id: 237 },
+ { id: 238 },
+ { id: 239 },
+ { id: 240 },
+ { id: 241 },
+ { id: 242 },
+ { id: 243 },
+ { id: 244 },
+ { id: 245 },
+ { id: 246 },
+ { id: 247 },
+ { id: 248 },
+ { id: 249 },
+ { id: 250 },
+ { id: 251 },
+ { id: 252 },
+ { id: 253 },
+ { id: 254 },
+ { id: 255 },
+ { id: 256 },
+ { id: 257 },
+ { id: 258 },
+ { id: 259 },
+ { id: 260 },
+ { id: 261 },
+ { id: 262 },
+ { id: 263 },
+ { id: 264 },
+ { id: 265 },
+ { id: 266 },
+ { id: 267 },
+ { id: 268 },
+ { id: 269 },
+ { id: 270 },
+ { id: 271 },
+ { id: 272 },
+ { id: 273 },
+ { id: 274 },
+ { id: 275 },
+ { id: 276 },
+ { id: 277 },
+ { id: 278 },
+ { id: 279 },
+ { id: 280 },
+ { id: 281 },
+ { id: 282 },
+ { id: 283 },
+ { id: 284 },
+ { id: 285 },
+ { id: 286 },
+ { id: 287 },
+ { id: 288 },
+ { id: 289 },
+ { id: 290 },
+ { id: 291 },
+ { id: 292 },
+ { id: 293 },
+ { id: 294 },
+ { id: 295 },
+ { id: 296 },
+ { id: 297 },
+ { id: 298 },
+ { id: 299 },
+ { id: 300 },
+ { id: 301 },
+ { id: 302 },
+ { id: 303 },
+ { id: 304 },
+ { id: 305 },
+ { id: 306 },
+ { id: 307 },
+ { id: 308 },
+ { id: 309 },
+ { id: 310 },
+ { id: 311 },
+ { id: 312 },
+ { id: 313 },
+ { id: 314 },
+ { id: 315 },
+ { id: 316 },
+ { id: 317 },
+ { id: 318 },
+ { id: 319 },
+ { id: 320 },
+ { id: 321 },
+ { id: 322 },
+ { id: 323 },
+ { id: 324 },
+ { id: 325 },
+ { id: 326 },
+ { id: 327 },
+ { id: 328 },
+ { id: 329 },
+ { id: 330 },
+ { id: 331 },
+ { id: 332 },
+ { id: 333 },
+ { id: 334 },
+ { id: 335 },
+ { id: 336 },
+ { id: 337 },
+ { id: 338 },
+ { id: 339 },
+ { id: 340 },
+ { id: 341 },
+ { id: 342 },
+ { id: 343 },
+ { id: 344 },
+ { id: 345 },
+ { id: 346 },
+ { id: 347 },
+ { id: 348 },
+ { id: 349 },
+ { id: 350 },
+ ],
+ },
+ enablePartialFailure: true,
+ },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
+ timestamp: '2020-02-02T00:23:09.544Z',
+ },
+ metadata: { jobId: 8, userId: 'u1' },
+ },
+ ],
+ destType: 'marketo_static_list',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'DELETE',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=2001&id=2002&id=2003',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 4, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ { jobId: 5, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ { jobId: 6, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1122/leads.json?id=1001&id=1002&id=1003',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 1, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ { jobId: 2, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ { jobId: 3, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'DELETE',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=4&id=5&id=6',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=101&id=102&id=103',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 7, destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, userId: 'u1' },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ ID: '1zia9wKshXt80YksLmUdJnr7IHI',
+ Name: 'test_marketo_al',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1234,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=0&id=1&id=2&id=3&id=4&id=5&id=6&id=7&id=8&id=9&id=10&id=11&id=12&id=13&id=14&id=15&id=16&id=17&id=18&id=19&id=20&id=21&id=22&id=23&id=24&id=25&id=26&id=27&id=28&id=29&id=30&id=31&id=32&id=33&id=34&id=35&id=36&id=37&id=38&id=39&id=40&id=41&id=42&id=43&id=44&id=45&id=46&id=47&id=48&id=49&id=50&id=51&id=52&id=53&id=54&id=55&id=56&id=57&id=58&id=59&id=60&id=61&id=62&id=63&id=64&id=65&id=66&id=67&id=68&id=69&id=70&id=71&id=72&id=73&id=74&id=75&id=76&id=77&id=78&id=79&id=80&id=81&id=82&id=83&id=84&id=85&id=86&id=87&id=88&id=89&id=90&id=91&id=92&id=93&id=94&id=95&id=96&id=97&id=98&id=99&id=100&id=101&id=102&id=103&id=104&id=105&id=106&id=107&id=108&id=109&id=110&id=111&id=112&id=113&id=114&id=115&id=116&id=117&id=118&id=119&id=120&id=121&id=122&id=123&id=124&id=125&id=126&id=127&id=128&id=129&id=130&id=131&id=132&id=133&id=134&id=135&id=136&id=137&id=138&id=139&id=140&id=141&id=142&id=143&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152&id=153&id=154&id=155&id=156&id=157&id=158&id=159&id=160&id=161&id=162&id=163&id=164&id=165&id=166&id=167&id=168&id=169&id=170&id=171&id=172&id=173&id=174&id=175&id=176&id=177&id=178&id=179&id=180&id=181&id=182&id=183&id=184&id=185&id=186&id=187&id=188&id=189&id=190&id=191&id=192&id=193&id=194&id=195&id=196&id=197&id=198&id=199&id=200&id=201&id=202&id=203&id=204&id=205&id=206&id=207&id=208&id=209&id=210&id=211&id=212&id=213&id=214&id=215&id=216&id=217&id=218&id=219&id=220&id=221&id=222&id=223&id=224&id=225&id=226&id=227&id=228&id=229&id=230&id=231&id=232&id=233&id=234&id=235&id=236&id=237&id=238&id=239&id=240&id=241&id=242&id=243&id=244&id=245&id=246&id=247&id=248&id=249&id=250&id=251&id=252&id=253&id=254&id=255&id=256&id=257&id=258&id=259&id=260&id=261&id=262&id=263&id=264&id=265&id=266&id=267&id=268&id=269&id=270&id=271&id=272&id=273&id=274&id=275&id=276&id=277&id=278&id=279&id=280&id=281&id=282&id=283&id=284&id=285&id=286&id=287&id=288&id=289&id=290&id=291&id=292&id=293&id=294&id=295&id=296&id=297&id=298&id=299',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/1234/leads.json?id=300&id=301&id=302&id=303&id=304&id=305&id=306&id=307&id=308&id=309&id=310&id=311&id=312&id=313&id=314&id=315&id=316&id=317&id=318&id=319&id=320&id=321&id=322&id=323&id=324&id=325&id=326&id=327&id=328&id=329&id=330&id=331&id=332&id=333&id=334&id=335&id=336&id=337&id=338&id=339&id=340&id=341&id=342&id=343&id=344&id=345&id=346&id=347&id=348&id=349&id=350',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 8, destInfo: { authKey: '1zia9wKshXt80YksLmUdJnr7IHI' }, userId: 'u1' },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ ID: '1zia9wKshXt80YksLmUdJnr7IHI',
+ Name: 'test_marketo_al',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1234,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: 'marketo_static_list',
+ description: 'Test 2: Test record evemts',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ destType: 'marketo_static_list',
+ input: [
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: { id: 1001 },
+ channel: 'sources',
+ context: {
+ sources: {
+ job_id: '2VsZs4hyPpq7f1p8igrpmHsibHl',
+ version: 'feat.mirrorRetlEvent',
+ job_run_id: 'ck99nbd2kqiljdihhkh0',
+ task_run_id: 'ck99nbd2kqiljdihhkhg',
+ },
+ externalId: [{ type: 'marketoStaticListId', id: 'id001' }],
+ destinationFields: 'id',
+ mappedToDestination: 'true',
+ },
+ recordId: '3',
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: { id: 1002 },
+ channel: 'sources',
+ context: {
+ sources: {
+ job_id: '2VsZs4hyPpq7f1p8igrpmHsibHl',
+ version: 'feat.mirrorRetlEvent',
+ job_run_id: 'ck99nbd2kqiljdihhkh0',
+ task_run_id: 'ck99nbd2kqiljdihhkhg',
+ },
+ externalId: [{ type: 'marketoStaticListId', id: 'id002' }],
+ destinationFields: 'id',
+ mappedToDestination: 'true',
+ },
+ recordId: '3',
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: { id: 1003 },
+ channel: 'sources',
+ context: {
+ sources: {
+ job_id: '2VsZs4hyPpq7f1p8igrpmHsibHl',
+ version: 'feat.mirrorRetlEvent',
+ job_run_id: 'ck99nbd2kqiljdihhkh0',
+ task_run_id: 'ck99nbd2kqiljdihhkhg',
+ },
+ externalId: [{ type: 'marketoStaticListId', id: 'id001' }],
+ destinationFields: 'id',
+ mappedToDestination: 'true',
+ },
+ recordId: '3',
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ action: 'delete',
+ context: {
+ destinationFields: 'id',
+ externalId: [{ id: 'id002', type: 'marketoStaticListId' }],
+ mappedToDestination: 'true',
+ sources: {
+ job_id: 'sf',
+ job_run_id: 'ck985bve58cvnti48120',
+ task_run_id: 'ck985bve58cvnti4812g',
+ version: '',
+ },
+ },
+ recordId: '2',
+ rudderId: '2',
+ fields: { id: '2001' },
+ type: 'record',
+ },
+ metadata: { jobId: 4, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ action: 'delete',
+ context: {
+ destinationFields: 'id',
+ externalId: [{ id: 'id001', type: 'marketoStaticListId' }],
+ mappedToDestination: 'true',
+ sources: {
+ job_id: 'sf',
+ job_run_id: 'ck985bve58cvnti48120',
+ task_run_id: 'ck985bve58cvnti4812g',
+ version: '',
+ },
+ },
+ recordId: '2',
+ rudderId: '2',
+ fields: { id: '2002' },
+ type: 'record',
+ },
+ metadata: { jobId: 5, userId: 'u1' },
+ },
+ {
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ action: 'delete',
+ context: {
+ destinationFields: 'id',
+ externalId: [{ id: 'id002', type: 'marketoStaticListId' }],
+ mappedToDestination: 'true',
+ sources: {
+ job_id: 'sf',
+ job_run_id: 'ck985bve58cvnti48120',
+ task_run_id: 'ck985bve58cvnti4812g',
+ version: '',
+ },
+ },
+ recordId: '2',
+ rudderId: '2',
+ fields: { id: '2003' },
+ type: 'record',
+ },
+ metadata: { jobId: 6, userId: 'u1' },
+ },
+ ],
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'DELETE',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=2002',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 5, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id001/leads.json?id=1001&id=1003',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 1, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ { jobId: 3, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'DELETE',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=2001&id=2003',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 4, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ { jobId: 6, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://marketo_acct_id_success.mktorest.com/rest/v1/lists/id002/leads.json?id=1002',
+ headers: {
+ Authorization: 'Bearer access_token_success',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
+ files: {},
+ },
+ ],
+ metadata: [
+ { jobId: 2, destInfo: { authKey: '1zwa1wKshSt81YksKmUdJnr4IOK' }, userId: 'u1' },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '1zwa1wKshSt81YksKmUdJnr4IOK',
+ Name: 'test_marketo_rc',
+ DestinationDefinition: {
+ ID: '1iVQvTRMsPPyJzwol0ifH93QTQ6',
+ Name: 'MARKETO',
+ DisplayName: 'Marketo',
+ transformAt: 'processor',
+ transformAtV1: 'processor',
+ },
+ Config: {
+ clientId: 'marketo_client_id_success',
+ clientSecret: 'marketo_client_secret_success',
+ accountId: 'marketo_acct_id_success',
+ staticListId: 1122,
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
},
},
],
diff --git a/test/integrations/destinations/mautic/router/data.ts b/test/integrations/destinations/mautic/router/data.ts
index 9ac6c8714f..e0924053f8 100644
--- a/test/integrations/destinations/mautic/router/data.ts
+++ b/test/integrations/destinations/mautic/router/data.ts
@@ -14,9 +14,7 @@ export const data = [
anonymousId: 'anon-id-new',
context: {
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
traits: {
firstName: 'Test',
lastName: 'Rudderlabs',
@@ -52,9 +50,7 @@ export const data = [
userName: 'TestRudderlabs45823@gmail.com',
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
},
],
destType: 'mautic',
@@ -105,11 +101,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -141,9 +133,7 @@ export const data = [
anonymousId: 'anon-id-new',
context: {
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
traits: {
firstName: 'Test',
lastName: 'Rudderlabs',
@@ -180,9 +170,7 @@ export const data = [
userName: 'abcdef',
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
},
],
destType: 'mautic',
@@ -196,11 +184,7 @@ export const data = [
body: {
output: [
{
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
statTags: {
errorCategory: 'dataValidation',
errorType: 'configuration',
@@ -241,17 +225,8 @@ export const data = [
message: {
userId: 'user123',
groupId: '17',
- context: {
- externalId: [
- {
- type: 'mauticContactId',
- id: '246',
- },
- ],
- },
- traits: {
- type: 'Segments',
- },
+ context: { externalId: [{ type: 'mauticContactId', id: '246' }] },
+ traits: { type: 'Segments' },
type: 'group',
},
destination: {
@@ -262,9 +237,7 @@ export const data = [
userName: 'TestRudderlabs45823@gmail.com',
},
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
},
],
destType: 'mautic',
@@ -289,19 +262,10 @@ export const data = [
'Basic VGVzdFJ1ZGRlcmxhYnM0NTgyM0BnbWFpbC5jb206ZHVtbXlQYXNzd29yZA==',
},
params: {},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/moengage/processor/data.ts b/test/integrations/destinations/moengage/processor/data.ts
index 50b0361381..1ce8705f53 100644
--- a/test/integrations/destinations/moengage/processor/data.ts
+++ b/test/integrations/destinations/moengage/processor/data.ts
@@ -2777,4 +2777,105 @@ export const data = [
},
},
},
+ {
+ name: 'moengage',
+ description:
+ 'when identify is sent without context, the event should not throw internal server error',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ event: 'identify',
+ sentAt: '2023-11-22T03:42:40.346Z',
+ userId: 'userId16',
+ channel: 'mobile',
+ rudderId: 'dummy-rudderId',
+ timestamp: '2023-11-22T03:42:31.470Z',
+ receivedAt: '2023-11-22T03:42:43.281Z',
+ request_ip: '114.122.233.48',
+ anonymousId: 'anon-dummyId-1',
+ integrations: {
+ All: true,
+ },
+ originalTimestamp: '2023-11-22T03:42:28.535Z',
+ },
+ destination: {
+ ID: '1iuTZs6eEZVMm6GjRBe6bNShaL3',
+ Name: 'MoEngage Testing',
+ DestinationDefinition: {
+ ID: '1iu4802Tx27kNC4KNYYou6D8jzL',
+ Name: 'MOENGAGE',
+ DisplayName: 'MoEngage',
+ Config: {
+ destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] },
+ excludeKeys: [],
+ includeKeys: [],
+ supportedSourceTypes: [
+ 'android',
+ 'ios',
+ 'web',
+ 'unity',
+ 'amp',
+ 'cloud',
+ 'reactnative',
+ ],
+ },
+ },
+ Config: {
+ apiId: 'W0ZHNMPI2O4KHJ48ZILZACRA',
+ apiKey: 'dummyApiKey',
+ eventDelivery: false,
+ eventDeliveryTS: 1602757086384,
+ region: 'US',
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ pathSuffix: '',
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ attributes: {},
+ customer_id: 'userId16',
+ type: 'customer',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api-01.moengage.com/v1/customer/W0ZHNMPI2O4KHJ48ZILZACRA',
+ files: {},
+ headers: {
+ Authorization: 'Basic VzBaSE5NUEkyTzRLSEo0OFpJTFpBQ1JBOmR1bW15QXBpS2V5',
+ 'Content-Type': 'application/json',
+ 'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ userId: 'anon-dummyId-1',
+ version: '1',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
];
diff --git a/test/integrations/destinations/moengage/router/data.ts b/test/integrations/destinations/moengage/router/data.ts
index a5664906e5..0f8a3de41b 100644
--- a/test/integrations/destinations/moengage/router/data.ts
+++ b/test/integrations/destinations/moengage/router/data.ts
@@ -21,15 +21,9 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.1.6',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.6',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
page: {
path: '/testing/script-test.html',
referrer: '',
@@ -37,13 +31,9 @@ export const data = [
title: '',
url: 'http://localhost:3243/testing/script-test.html',
},
- screen: {
- density: 2,
- },
+ screen: { density: 2 },
traits: {
- company: {
- id: 'abc123',
- },
+ company: { id: 'abc123' },
createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)',
email: 'rudderTest@gmail.com',
name: 'Rudder Test',
@@ -53,9 +43,7 @@ export const data = [
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36',
},
event: 'Order Completed',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'a0adfab9-baf7-4e09-a2ce-bbe2844c324a',
originalTimestamp: '2020-10-16T08:10:12.782Z',
properties: {
@@ -125,9 +113,7 @@ export const data = [
type: 'track',
userId: 'rudder123',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
ID: '1iuTZs6eEZVMm6GjRBe6bNShaL3',
Name: 'MoEngage Testing',
@@ -136,9 +122,7 @@ export const data = [
Name: 'MOENGAGE',
DisplayName: 'MoEngage',
Config: {
- destConfig: {
- defaultConfig: ['apiId', 'apiKey', 'region'],
- },
+ destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] },
excludeKeys: [],
includeKeys: [],
supportedSourceTypes: [
@@ -175,15 +159,9 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.1.6',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.6',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.6' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
page: {
path: '/testing/script-test.html',
referrer: '',
@@ -191,13 +169,9 @@ export const data = [
title: '',
url: 'http://localhost:3243/testing/script-test.html',
},
- screen: {
- density: 2,
- },
+ screen: { density: 2 },
traits: {
- company: {
- id: 'abc123',
- },
+ company: { id: 'abc123' },
createdAt: 'Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)',
email: 'rudderTest@gmail.com',
name: 'Rudder Test',
@@ -206,9 +180,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'e108eb05-f6cd-4624-ba8c-568f2e2b3f92',
originalTimestamp: '2020-10-16T08:26:14.938Z',
receivedAt: '2020-10-16T13:56:14.945+05:30',
@@ -218,9 +190,7 @@ export const data = [
type: 'identify',
userId: 'rudder123',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
ID: '1iuTZs6eEZVMm6GjRBe6bNShaL3',
Name: 'MoEngage Testing',
@@ -229,9 +199,7 @@ export const data = [
Name: 'MOENGAGE',
DisplayName: 'MoEngage',
Config: {
- destConfig: {
- defaultConfig: ['apiId', 'apiKey', 'region'],
- },
+ destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] },
excludeKeys: [],
includeKeys: [],
supportedSourceTypes: [
@@ -354,11 +322,7 @@ export const data = [
files: {},
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -369,9 +333,7 @@ export const data = [
Name: 'MOENGAGE',
DisplayName: 'MoEngage',
Config: {
- destConfig: {
- defaultConfig: ['apiId', 'apiKey', 'region'],
- },
+ destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] },
excludeKeys: [],
includeKeys: [],
supportedSourceTypes: [
@@ -429,11 +391,7 @@ export const data = [
files: {},
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -444,9 +402,7 @@ export const data = [
Name: 'MOENGAGE',
DisplayName: 'MoEngage',
Config: {
- destConfig: {
- defaultConfig: ['apiId', 'apiKey', 'region'],
- },
+ destConfig: { defaultConfig: ['apiId', 'apiKey', 'region'] },
excludeKeys: [],
includeKeys: [],
supportedSourceTypes: [
diff --git a/test/integrations/destinations/monday/network.ts b/test/integrations/destinations/monday/network.ts
new file mode 100644
index 0000000000..f23b9061f8
--- /dev/null
+++ b/test/integrations/destinations/monday/network.ts
@@ -0,0 +1,242 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://api.monday.com/v2',
+ method: 'POST',
+ headers: {
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ },
+ },
+ httpRes: {
+ data: {
+ data: {
+ boards: [
+ {
+ name: 'Planning',
+ columns: [
+ {
+ id: 'name',
+ title: 'Name',
+ type: 'name',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'subitems',
+ title: 'Subitems',
+ type: 'subtasks',
+ description: null,
+ settings_str:
+ '{"allowMultipleItems":true,"itemTypeName":"column.subtasks.title","displayType":"BOARD_INLINE","boardIds":[3160974974]}',
+ },
+ {
+ id: 'person',
+ title: 'Person',
+ type: 'multiple-person',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'status',
+ title: 'Status',
+ type: 'color',
+ description: null,
+ settings_str:
+ '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_positions_v2":{"0":0,"1":2,"2":1,"5":3},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}',
+ },
+ {
+ id: 'date4',
+ title: 'Date',
+ type: 'date',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'checkbox',
+ title: 'Checkbox',
+ type: 'boolean',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'connect_boards',
+ title: 'Connect boards',
+ type: 'board-relation',
+ description: null,
+ settings_str: '{"allowCreateReflectionColumn":false}',
+ },
+ {
+ id: 'status_1',
+ title: 'Other',
+ type: 'color',
+ description: null,
+ settings_str:
+ '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}',
+ },
+ {
+ id: 'date_1',
+ title: 'Date 1',
+ type: 'date',
+ description: null,
+ settings_str: '{"hide_footer":false}',
+ },
+ {
+ id: 'status_12',
+ title: 'new status',
+ type: 'color',
+ description: null,
+ settings_str:
+ '{"labels":{"0":"Working on it","1":"Done","2":"Stuck"},"labels_colors":{"0":{"color":"#fdab3d","border":"#E99729","var_name":"orange"},"1":{"color":"#00c875","border":"#00B461","var_name":"green-shadow"},"2":{"color":"#e2445c","border":"#CE3048","var_name":"red-shadow"}}}',
+ },
+ {
+ id: 'numbers',
+ title: 'Numbers',
+ type: 'numeric',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'text',
+ title: 'Name',
+ type: 'text',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'country',
+ title: 'Country',
+ type: 'country',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'dropdown',
+ title: 'Dropdown',
+ type: 'dropdown',
+ description: null,
+ settings_str:
+ '{"hide_footer":false,"labels":[{"id":1,"name":"dropdown"},{"id":2,"name":"dropup"}]}',
+ },
+ {
+ id: 'email',
+ title: 'Email',
+ type: 'email',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'location',
+ title: 'Location',
+ type: 'location',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'phone',
+ title: 'Phone',
+ type: 'phone',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'rating',
+ title: 'Rating',
+ type: 'rating',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'timeline',
+ title: 'Timeline',
+ type: 'timerange',
+ description: null,
+ settings_str: '{"hide_footer":false}',
+ },
+ {
+ id: 'dependent_on',
+ title: 'Dependent On',
+ type: 'dependency',
+ description:
+ 'Choose the item your task will be dependent on. If the “dependent on” item’s date is changing, the other dates will adjust automatically',
+ settings_str:
+ '{"boardIds":[3142482015],"dependencyNewInfra":true,"allowMultipleItems":true}',
+ },
+ {
+ id: 'long_text',
+ title: 'Long Text',
+ type: 'long-text',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'link',
+ title: 'Link',
+ type: 'link',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'tags',
+ title: 'Tags',
+ type: 'tag',
+ description: null,
+ settings_str: '{"hide_footer":false}',
+ },
+ {
+ id: 'label',
+ title: 'Label',
+ type: 'color',
+ description: '',
+ settings_str:
+ '{"done_colors":[1],"labels":{"3":"Label 2","105":"Label 1","156":"Label 3"},"labels_positions_v2":{"3":1,"5":3,"105":0,"156":2},"labels_colors":{"3":{"color":"#0086c0","border":"#3DB0DF","var_name":"blue-links"},"105":{"color":"#9AADBD","border":"#9AADBD","var_name":"winter"},"156":{"color":"#9D99B9","border":"#9D99B9","var_name":"purple_gray"}}}',
+ },
+ {
+ id: 'world_clock',
+ title: 'World Clock',
+ type: 'timezone',
+ description: null,
+ settings_str: '{}',
+ },
+ {
+ id: 'week',
+ title: 'Week',
+ type: 'week',
+ description: null,
+ settings_str: '{}',
+ },
+ ],
+ groups: [
+ {
+ id: 'topics',
+ title: 'This month',
+ },
+ {
+ id: 'group_title',
+ title: 'Next month',
+ },
+ ],
+ },
+ ],
+ },
+ account_id: 13215538,
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.monday.com/v2',
+ method: 'POST',
+ headers: {
+ Authorization: 'failedApiToken',
+ },
+ },
+ httpRes: {
+ data: {
+ boards: [],
+ },
+ status: 200,
+ },
+ },
+];
diff --git a/test/integrations/destinations/monday/processor/data.ts b/test/integrations/destinations/monday/processor/data.ts
new file mode 100644
index 0000000000..4e5280efcb
--- /dev/null
+++ b/test/integrations/destinations/monday/processor/data.ts
@@ -0,0 +1,1399 @@
+export const data = [
+ {
+ name: 'monday',
+ description: 'Track call with empty columnToPropertyMapping',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ query:
+ 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{}") {id}}',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.monday.com/v2',
+ files: {},
+ headers: {
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Track call with undefined columnToPropertyMapping',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ query:
+ 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{}") {id}}',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.monday.com/v2',
+ files: {},
+ headers: {
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Check Unsupported message type',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event type identify is not supported',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Check for empty message type',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: '',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event type is required',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Check for empty API Token',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken: '',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'ApiToken is a required field',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Check for empty board Id',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'boardId is a required field',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Check for event name',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: '',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event is a required field and should be a string',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Track call with columnToPropertyMapping and with empty groupTitle',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [
+ {
+ from: 'Status',
+ to: 'status',
+ },
+ {
+ from: 'Email',
+ to: 'emailId',
+ },
+ ],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.monday.com/v2',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ },
+ params: {},
+ body: {
+ JSON: {
+ query:
+ 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"}}") {id}}',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Track call with columnToPropertyMapping and with groupTitle',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: 'Next month',
+ columnToPropertyMapping: [
+ {
+ from: 'Status',
+ to: 'status',
+ },
+ {
+ from: 'Email',
+ to: 'emailId',
+ },
+ ],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.monday.com/v2',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ },
+ params: {},
+ body: {
+ JSON: {
+ query:
+ 'mutation { create_item (board_id: 339283933, group_id: group_title item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"}}") {id}}',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'Non-existing group title check',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: 'Next year',
+ columnToPropertyMapping: [
+ {
+ from: 'Status',
+ to: 'status',
+ },
+ {
+ from: 'Email',
+ to: 'emailId',
+ },
+ ],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: "Group Next year doesn't exist in the board",
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'check for item name',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: 'Next month',
+ columnToPropertyMapping: [
+ {
+ from: 'Status',
+ to: 'status',
+ },
+ {
+ from: 'Email',
+ to: 'emailId',
+ },
+ ],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: '',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Item name is required to create an item',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description:
+ 'Track call with columnToPropertyMapping and with groupTitle with all supported columns',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: 'Next month',
+ columnToPropertyMapping: [
+ {
+ from: 'Status',
+ to: 'status',
+ },
+ {
+ from: 'Email',
+ to: 'emailId',
+ },
+ {
+ from: 'Checkbox',
+ to: 'checked',
+ },
+ {
+ from: 'Numbers',
+ to: 'number',
+ },
+ {
+ from: 'Name',
+ to: 'textKey',
+ },
+ {
+ from: 'Country',
+ to: 'countryName',
+ },
+ {
+ from: 'Location',
+ to: 'address',
+ },
+ {
+ from: 'Phone',
+ to: 'phone',
+ },
+ {
+ from: 'Rating',
+ to: 'rating',
+ },
+ {
+ from: 'Link',
+ to: 'url',
+ },
+ {
+ from: 'Long Text',
+ to: 'description',
+ },
+ {
+ from: 'World Clock',
+ to: 'timezone',
+ },
+ ],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ countryCode: 'US',
+ latitude: '51.23',
+ longitude: '35.3',
+ rating: '3',
+ linkText: 'websiteLink',
+ checked: 'true',
+ number: '45',
+ textKey: 'texting',
+ countryName: 'Unites States',
+ countryShortName: 'US',
+ address: 'New York',
+ phone: '2626277272',
+ url: 'demo.com',
+ description: 'property description',
+ timezone: 'America/New_York',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.monday.com/v2',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ },
+ params: {},
+ body: {
+ JSON: {
+ query:
+ 'mutation { create_item (board_id: 339283933, group_id: group_title item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"},\\"checkbox\\":{\\"checked\\":true},\\"numbers\\":\\"45\\",\\"text\\":\\"texting\\",\\"country\\":{\\"countryName\\":\\"Unites States\\",\\"countryCode\\":\\"US\\"},\\"location\\":{\\"address\\":\\"New York\\",\\"lat\\":\\"51.23\\",\\"lng\\":\\"35.3\\"},\\"phone\\":{\\"phone\\":\\"2626277272\\",\\"countryShortName\\":\\"US\\"},\\"rating\\":3,\\"link\\":{\\"url\\":\\"demo.com\\",\\"text\\":\\"websiteLink\\"},\\"long_text\\":{\\"text\\":\\"property description\\"},\\"world_clock\\":{\\"timezone\\":\\"America/New_York\\"}}") {id}}',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'check for allowed event name from UI',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: 'Next month',
+ columnToPropertyMapping: [
+ {
+ from: 'Status',
+ to: 'status',
+ },
+ {
+ from: 'Email',
+ to: 'emailId',
+ },
+ ],
+ whitelistedEvents: [
+ {
+ eventName: '',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: '',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event Discarded. To allow this event, add this in Allowlist',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'monday',
+ description: 'check for deleted boards (configured boards are deleted)',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiToken: 'failedApiToken',
+ boardId: '339283934',
+ groupTitle: 'Next year',
+ columnToPropertyMapping: [
+ {
+ from: 'Status',
+ to: 'status',
+ },
+ {
+ from: 'Email',
+ to: 'emailId',
+ },
+ ],
+ whitelistedEvents: [
+ {
+ eventName: 'create an item',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ },
+ context: {
+ os: {
+ name: '',
+ version: '',
+ },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: {
+ density: 2,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.11',
+ },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'The board with boardId 339283934 does not exist',
+ statTags: {
+ destType: 'MONDAY',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/monday/router/data.ts b/test/integrations/destinations/monday/router/data.ts
new file mode 100644
index 0000000000..3be8b129c5
--- /dev/null
+++ b/test/integrations/destinations/monday/router/data.ts
@@ -0,0 +1,192 @@
+export const data = [
+ {
+ name: 'monday',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [{ eventName: 'create an item' }],
+ },
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: { name: 'Task 1' },
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ {
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: 'Next month',
+ columnToPropertyMapping: [
+ { from: 'Status', to: 'status' },
+ { from: 'Email', to: 'emailId' },
+ ],
+ whitelistedEvents: [{ eventName: 'create an item' }],
+ },
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ message: {
+ event: 'create an item',
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ userId: 'user@27',
+ channel: 'web',
+ properties: {
+ name: 'Task 1',
+ status: 'Done',
+ emailId: 'abc@email.com',
+ emailText: 'emailId',
+ },
+ context: {
+ os: { name: '', version: '' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ locale: 'en-US',
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ },
+ ],
+ destType: 'monday',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ body: {
+ FORM: {},
+ JSON: {
+ query:
+ 'mutation { create_item (board_id: 339283933, item_name: "Task 1", column_values: "{}") {id}}',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.monday.com/v2',
+ files: {},
+ headers: {
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ },
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: '',
+ columnToPropertyMapping: [],
+ whitelistedEvents: [{ eventName: 'create an item' }],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.monday.com/v2',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ },
+ params: {},
+ body: {
+ JSON: {
+ query:
+ 'mutation { create_item (board_id: 339283933, group_id: group_title item_name: "Task 1", column_values: "{\\"status\\":{\\"label\\":\\"Done\\"},\\"email\\":{\\"email\\":\\"abc@email.com\\",\\"text\\":\\"emailId\\"}}") {id}}',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiToken:
+ 'eywwakzdjiksjhriherniSFsjhnskdojsSDFhsdns.sSRSSREWdnfnsjshfjsjskshfiskskdS__Fskilhih',
+ boardId: '339283933',
+ groupTitle: 'Next month',
+ columnToPropertyMapping: [
+ { from: 'Status', to: 'status' },
+ { from: 'Email', to: 'emailId' },
+ ],
+ whitelistedEvents: [{ eventName: 'create an item' }],
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/monetate/router/data.ts b/test/integrations/destinations/monetate/router/data.ts
index 09a7f8073d..eff487bd73 100644
--- a/test/integrations/destinations/monetate/router/data.ts
+++ b/test/integrations/destinations/monetate/router/data.ts
@@ -13,54 +13,31 @@ export const data = [
message: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
- screen: {
- height: 22,
- width: 11,
- },
+ screen: { height: 22, width: 11 },
device: {
id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R',
manufacturer: 'Xiaomi',
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
ip: '0.0.0.0',
},
- traits: {
- address: {
- city: 'Kol',
- country: 'Ind',
- },
- },
+ traits: { address: { city: 'Kol', country: 'Ind' } },
event: 'Product Viewed',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
- properties: {
- monetateId: '1234',
- product_id: 'prodId',
- },
+ properties: { monetateId: '1234', product_id: 'prodId' },
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
userId: 'newUser',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
Config: {
monetateChannel: 'channel',
@@ -73,61 +50,34 @@ export const data = [
message: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
- screen: {
- height: 22,
- width: 11,
- },
+ screen: { height: 22, width: 11 },
device: {
id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R',
manufacturer: 'Xiaomi',
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
ip: '0.0.0.0',
},
- traits: {
- address: {
- city: 'Kol',
- country: 'Ind',
- },
- },
+ traits: { address: { city: 'Kol', country: 'Ind' } },
event: 'Product List Viewed',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
monetateId: '1234',
- products: [
- {
- product_id: 1,
- },
- {
- product_id: 2,
- },
- ],
+ products: [{ product_id: 1 }, { product_id: 2 }],
},
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
userId: 'newUser',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
monetateChannel: 'channel',
@@ -153,31 +103,17 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://engine.monetate.net/api/engine/v1/decide/retailer',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
monetateId: '1234',
events: [
- {
- eventType: 'monetate:context:IpAddress',
- ipAddress: '0.0.0.0',
- },
- {
- eventType: 'monetate:context:ScreenSize',
- height: 22,
- width: 11,
- },
+ { eventType: 'monetate:context:IpAddress', ipAddress: '0.0.0.0' },
+ { eventType: 'monetate:context:ScreenSize', height: 22, width: 11 },
{
eventType: 'monetate:context:ProductDetailView',
- products: [
- {
- productId: 'prodId',
- sku: '',
- },
- ],
+ products: [{ productId: 'prodId', sku: '' }],
},
],
customerId: 'newUser',
@@ -189,11 +125,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -210,27 +142,15 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://engine.monetate.net/api/engine/v1/decide/retailer',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
monetateId: '1234',
events: [
- {
- eventType: 'monetate:context:IpAddress',
- ipAddress: '0.0.0.0',
- },
- {
- eventType: 'monetate:context:ScreenSize',
- height: 22,
- width: 11,
- },
- {
- eventType: 'monetate:context:ProductThumbnailView',
- products: ['1', '2'],
- },
+ { eventType: 'monetate:context:IpAddress', ipAddress: '0.0.0.0' },
+ { eventType: 'monetate:context:ScreenSize', height: 22, width: 11 },
+ { eventType: 'monetate:context:ProductThumbnailView', products: ['1', '2'] },
],
customerId: 'newUser',
channel: 'channel',
@@ -241,11 +161,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/mp/common.ts b/test/integrations/destinations/mp/common.ts
index 1d4bbc0ac7..fbba162b98 100644
--- a/test/integrations/destinations/mp/common.ts
+++ b/test/integrations/destinations/mp/common.ts
@@ -20,4 +20,42 @@ const sampleDestination = {
Transformations: [],
};
-export { sampleDestination, defaultMockFns };
+const destinationWithSetOnceProperty = {
+ Config: {
+ apiSecret: 'dummySecret',
+ dataResidency: 'us',
+ identityMergeApi: 'simplified',
+ setOnceProperties: [
+ {
+ property: 'nationality',
+ },
+ {
+ property: 'firstName',
+ },
+ {
+ property: 'address.city',
+ },
+ ],
+ superProperties: [
+ {
+ property: 'random',
+ },
+ ],
+ token: 'dummyToken',
+ useNativeSDK: false,
+ useNewMapping: false,
+ userDeletionApi: 'engage',
+ whitelistedEvents: [],
+ },
+ DestinationDefinition: {
+ DisplayName: 'Kiss Metrics',
+ ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie',
+ Name: 'MIXPANEL',
+ },
+ Enabled: true,
+ ID: '1WhcOCGgj9asZu850HvugU2C3Aq',
+ Name: 'Kiss Metrics',
+ Transformations: [],
+};
+
+export { sampleDestination, defaultMockFns, destinationWithSetOnceProperty };
diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts
index badd12c245..9d3f4160ac 100644
--- a/test/integrations/destinations/mp/processor/data.ts
+++ b/test/integrations/destinations/mp/processor/data.ts
@@ -1,5 +1,5 @@
import { overrideDestination } from '../../../testUtils';
-import { sampleDestination, defaultMockFns } from '../common';
+import { sampleDestination, defaultMockFns, destinationWithSetOnceProperty } from '../common';
export const data = [
{
@@ -5043,7 +5043,8 @@ export const data = [
status: 200,
body: [
{
- error: 'Alias call is deprecated in `Simplified ID merge`',
+ error:
+ 'The use of the alias call in the context of the `Simplified ID merge` feature is not supported anymore.',
statTags: {
destType: 'MP',
errorCategory: 'dataValidation',
@@ -5915,4 +5916,273 @@ export const data = [
},
},
},
+ {
+ name: 'mp',
+ description: 'Test Set Once Property',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ description: 'Alias: with property beyond and within exclusion list',
+ destination: destinationWithSetOnceProperty,
+ message: {
+ anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.5',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.5',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ address: {
+ city: 'Disney',
+ },
+ country: 'USA',
+ email: 'TestSanity@disney.com',
+ firstName: 'Mickey test',
+ lastName: 'VarChange',
+ createdAt: '2020-01-23T08:54:02.362Z',
+ nationality: 'USA',
+ random: 'superProp',
+ },
+ page: {
+ path: '/destinations/mixpanel',
+ referrer: '',
+ search: '',
+ title: '',
+ url: 'https://docs.rudderstack.com/destinations/mixpanel',
+ category: 'destination',
+ initial_referrer: 'https://docs.rudderstack.com',
+ initial_referring_domain: 'docs.rudderstack.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ page: {
+ path: '/destinations/mixpanel',
+ referrer: '',
+ search: '',
+ title: '',
+ url: 'https://docs.rudderstack.com/destinations/mixpanel',
+ category: 'destination',
+ initial_referrer: 'https://docs.rudderstack.com',
+ initial_referring_domain: 'docs.rudderstack.com',
+ },
+ request_ip: '[::1]:53709',
+ type: 'identify',
+ userId: 'Santiy',
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ pathSuffix: '',
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mixpanel.com/engage/',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {
+ batch:
+ '[{"$set_once":{"$first_name":"Mickey test","$city":"Disney","nationality":"USA"},"$token":"dummyToken","$distinct_id":"Santiy"}]',
+ },
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'Santiy',
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mixpanel.com/engage/',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {
+ batch:
+ '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"TestSanity@disney.com","$country_code":"USA","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","random":"superProp","$lastName":"VarChange","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"dummyToken","$distinct_id":"Santiy","$ip":"0.0.0.0","$time":null}]',
+ },
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'Santiy',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'mp',
+ description: 'Test Set Once Property with anonymousId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ description: 'Alias: with property beyond and within exclusion list',
+ destination: destinationWithSetOnceProperty,
+ message: {
+ anonymousId: 'dummyAnnonymousId',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.5',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.5',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ address: {
+ city: 'Disney',
+ },
+ country: 'USA',
+ email: 'TestSanity@disney.com',
+ firstName: 'Mickey test',
+ lastName: 'VarChange',
+ createdAt: '2020-01-23T08:54:02.362Z',
+ nationality: 'USA',
+ random: 'superProp',
+ },
+ page: {
+ path: '/destinations/mixpanel',
+ referrer: '',
+ search: '',
+ title: '',
+ url: 'https://docs.rudderstack.com/destinations/mixpanel',
+ category: 'destination',
+ initial_referrer: 'https://docs.rudderstack.com',
+ initial_referring_domain: 'docs.rudderstack.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ page: {
+ path: '/destinations/mixpanel',
+ referrer: '',
+ search: '',
+ title: '',
+ url: 'https://docs.rudderstack.com/destinations/mixpanel',
+ category: 'destination',
+ initial_referrer: 'https://docs.rudderstack.com',
+ initial_referring_domain: 'docs.rudderstack.com',
+ },
+ request_ip: '[::1]:53709',
+ type: 'identify',
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ pathSuffix: '',
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mixpanel.com/engage/',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {
+ batch:
+ '[{"$set_once":{"$first_name":"Mickey test","$city":"Disney","nationality":"USA"},"$token":"dummyToken","$distinct_id":"$device:dummyAnnonymousId"}]',
+ },
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'dummyAnnonymousId',
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.mixpanel.com/engage/',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {
+ batch:
+ '[{"$set":{"$created":"2020-01-23T08:54:02.362Z","$email":"TestSanity@disney.com","$country_code":"USA","$initial_referrer":"https://docs.rudderstack.com","$initial_referring_domain":"docs.rudderstack.com","random":"superProp","$lastName":"VarChange","$browser":"Chrome","$browser_version":"79.0.3945.117"},"$token":"dummyToken","$distinct_id":"$device:dummyAnnonymousId","$ip":"0.0.0.0","$time":null}]',
+ },
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: 'dummyAnnonymousId',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
];
diff --git a/test/integrations/destinations/mp/router/data.ts b/test/integrations/destinations/mp/router/data.ts
index 4e65b4f883..a5757ac137 100644
--- a/test/integrations/destinations/mp/router/data.ts
+++ b/test/integrations/destinations/mp/router/data.ts
@@ -20,10 +20,7 @@ export const data = [
useOldMapping: true,
strictMode: true,
}),
- metadata: {
- jobId: 1,
- additionalProp: 1,
- },
+ metadata: { jobId: 1, additionalProp: 1, userId: 'u1' },
message: {
anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
channel: 'web',
@@ -36,18 +33,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {},
page: {
path: '/destinations/mixpanel',
@@ -62,9 +51,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312',
originalTimestamp: '2020-01-24T06:29:02.358Z',
page: {
@@ -94,10 +81,7 @@ export const data = [
identityMergeApi: 'simplified',
strictMode: true,
}),
- metadata: {
- jobId: 2,
- additionalProp: 2,
- },
+ metadata: { jobId: 2, additionalProp: 2, userId: 'u1' },
message: {
anonymousId: 'anonId01',
channel: 'mobile',
@@ -116,40 +100,20 @@ export const data = [
type: 'ios',
token: 'test_device_token',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.1-beta.1',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'iOS',
- version: '8.1.0',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'iOS', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
},
event: 'Product Viewed',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
userId: 'userId01',
messageId: 'id2',
- properties: {
- name: 'T-Shirt',
- revenue: 18.9,
- },
+ properties: { name: 'T-Shirt', revenue: 18.9 },
type: 'track',
originalTimestamp: '2020-01-24T06:29:02.362Z',
receivedAt: '2020-01-24T11:59:02.403+05:30',
@@ -165,10 +129,7 @@ export const data = [
useOldMapping: true,
strictMode: true,
}),
- metadata: {
- jobId: 3,
- additionalProp: 3,
- },
+ metadata: { jobId: 3, additionalProp: 3, userId: 'u1' },
message: {
anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
channel: 'web',
@@ -180,18 +141,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {
city: 'Disney',
country: 'USA',
@@ -211,9 +164,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -243,10 +194,7 @@ export const data = [
identityMergeApi: 'simplified',
strictMode: true,
}),
- metadata: {
- jobId: 4,
- additionalProp: 4,
- },
+ metadata: { jobId: 4, additionalProp: 4, userId: 'u1' },
message: {
anonymousId: 'anonId01',
channel: 'web',
@@ -258,18 +206,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {
city: 'Disney',
country: 'USA',
@@ -291,9 +231,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -320,10 +258,7 @@ export const data = [
token: 'test_api_token',
strictMode: true,
}),
- metadata: {
- jobId: 5,
- additionalProp: 5,
- },
+ metadata: { jobId: 5, additionalProp: 5, userId: 'u1' },
message: {
anonymousId: '5094f5704b9cf2b3',
channel: 'mobile',
@@ -342,44 +277,21 @@ export const data = [
type: 'ios',
token: 'test_device_token',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.1-beta.1',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'iOS',
- version: '8.1.0',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'iOS', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
- traits: {
- anonymousId: '5094f5704b9cf2b3',
- userId: 'test_user_id',
- },
+ traits: { anonymousId: '5094f5704b9cf2b3', userId: 'test_user_id' },
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
},
event: 'MainActivity',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
userId: 'test_user_id',
messageId: 'id2',
- properties: {
- name: 'MainActivity',
- automatic: true,
- },
+ properties: { name: 'MainActivity', automatic: true },
originalTimestamp: '2020-03-12T09:05:03.421Z',
type: 'identify',
sentAt: '2020-03-12T09:05:13.042Z',
@@ -397,10 +309,7 @@ export const data = [
],
strictMode: true,
}),
- metadata: {
- jobId: 6,
- additionalProp: 6,
- },
+ metadata: { jobId: 6, additionalProp: 6, userId: 'u1' },
message: {
anonymousId: 'anonId06',
channel: 'web',
@@ -412,18 +321,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -437,9 +338,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -450,9 +349,7 @@ export const data = [
initial_referrer: 'https://docs.rudderstack.com',
initial_referring_domain: 'docs.rudderstack.com',
},
- traits: {
- company: 'testComp',
- },
+ traits: { company: 'testComp' },
messageId: '2536eda4-d638-4c93-8014-8ffe3f083214',
originalTimestamp: '2020-01-24T06:29:02.362Z',
receivedAt: '2020-01-24T11:59:02.403+05:30',
@@ -475,10 +372,7 @@ export const data = [
],
strictMode: true,
}),
- metadata: {
- jobId: 7,
- additionalProp: 7,
- },
+ metadata: { jobId: 7, additionalProp: 7, userId: 'u1' },
message: {
anonymousId: 'anonId06',
channel: 'web',
@@ -490,18 +384,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -515,9 +401,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -542,9 +426,7 @@ export const data = [
destType: 'mp',
},
method: 'POST',
- headers: {
- 'X-Feature-Gzip-Support': '?1',
- },
+ headers: { 'X-Feature-Gzip-Support': '?1' },
},
},
output: {
@@ -562,9 +444,7 @@ export const data = [
'Content-Type': 'application/json',
Authorization: 'Basic dGVzdF9hcGlfdG9rZW46',
},
- params: {
- strict: 1,
- },
+ params: { strict: 1 },
body: {
JSON: {},
JSON_ARRAY: {},
@@ -577,12 +457,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- additionalProp: 1,
- },
- ],
+ metadata: [{ jobId: 1, additionalProp: 1, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -635,9 +510,7 @@ export const data = [
'Content-Type': 'application/json',
Authorization: 'Basic dGVzdF9hcGlfdG9rZW46',
},
- params: {
- strict: 1,
- },
+ params: { strict: 1 },
body: {
JSON: {},
JSON_ARRAY: {},
@@ -651,12 +524,7 @@ export const data = [
files: {},
},
],
- metadata: [
- {
- jobId: 2,
- additionalProp: 2,
- },
- ],
+ metadata: [{ jobId: 2, additionalProp: 2, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -709,9 +577,7 @@ export const data = [
'Content-Type': 'application/json',
Authorization: 'Basic dGVzdF9hcGlfdG9rZW46',
},
- params: {
- strict: 1,
- },
+ params: { strict: 1 },
body: {
JSON: {},
JSON_ARRAY: {},
@@ -726,18 +592,9 @@ export const data = [
},
],
metadata: [
- {
- jobId: 3,
- additionalProp: 3,
- },
- {
- jobId: 4,
- additionalProp: 4,
- },
- {
- jobId: 5,
- additionalProp: 5,
- },
+ { jobId: 3, additionalProp: 3, userId: 'u1' },
+ { jobId: 4, additionalProp: 4, userId: 'u1' },
+ { jobId: 5, additionalProp: 5, userId: 'u1' },
],
batched: true,
statusCode: 200,
@@ -801,12 +658,7 @@ export const data = [
files: {},
},
],
- metadata: [
- {
- jobId: 6,
- additionalProp: 6,
- },
- ],
+ metadata: [{ jobId: 6, additionalProp: 6, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -815,11 +667,7 @@ export const data = [
apiSecret: 'test_api_secret',
token: 'test_api_token',
prefixProperties: true,
- groupKeySettings: [
- {
- groupKey: 'company',
- },
- ],
+ groupKeySettings: [{ groupKey: 'company' }],
strictMode: true,
useNativeSDK: false,
},
@@ -835,12 +683,7 @@ export const data = [
},
},
{
- metadata: [
- {
- jobId: 7,
- additionalProp: 7,
- },
- ],
+ metadata: [{ jobId: 7, additionalProp: 7, userId: 'u1' }],
batched: false,
statusCode: 400,
error:
@@ -860,11 +703,7 @@ export const data = [
token: 'test_api_token',
prefixProperties: true,
useNativeSDK: false,
- groupKeySettings: [
- {
- groupKey: 'company',
- },
- ],
+ groupKeySettings: [{ groupKey: 'company' }],
strictMode: true,
},
DestinationDefinition: {
@@ -901,10 +740,7 @@ export const data = [
useOldMapping: true,
strictMode: true,
}),
- metadata: {
- jobId: 1,
- additionalProp: 1,
- },
+ metadata: { jobId: 1, additionalProp: 1, userId: 'u1' },
message: {
anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
channel: 'web',
@@ -917,18 +753,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {},
page: {
path: '/destinations/mixpanel',
@@ -943,9 +771,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'dd266c67-9199-4a52-ba32-f46ddde67312',
originalTimestamp: '2020-01-24T06:29:02.358Z',
page: {
@@ -975,10 +801,7 @@ export const data = [
identityMergeApi: 'simplified',
strictMode: true,
}),
- metadata: {
- jobId: 2,
- additionalProp: 2,
- },
+ metadata: { jobId: 2, additionalProp: 2, userId: 'u1' },
message: {
anonymousId: 'anonId01',
channel: 'mobile',
@@ -997,40 +820,20 @@ export const data = [
type: 'ios',
token: 'test_device_token',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.1-beta.1',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'iOS',
- version: '8.1.0',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'iOS', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
},
event: 'Product Viewed',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
userId: 'userId01',
messageId: 'id2',
- properties: {
- name: 'T-Shirt',
- revenue: 18.9,
- },
+ properties: { name: 'T-Shirt', revenue: 18.9 },
type: 'track',
originalTimestamp: '2020-01-24T06:29:02.362Z',
receivedAt: '2020-01-24T11:59:02.403+05:30',
@@ -1046,10 +849,7 @@ export const data = [
useOldMapping: true,
strictMode: true,
}),
- metadata: {
- jobId: 3,
- additionalProp: 3,
- },
+ metadata: { jobId: 3, additionalProp: 3, userId: 'u1' },
message: {
anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
channel: 'web',
@@ -1061,18 +861,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {
city: 'Disney',
country: 'USA',
@@ -1092,9 +884,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -1124,10 +914,7 @@ export const data = [
identityMergeApi: 'simplified',
strictMode: true,
}),
- metadata: {
- jobId: 4,
- additionalProp: 4,
- },
+ metadata: { jobId: 4, additionalProp: 4, userId: 'u1' },
message: {
anonymousId: 'anonId01',
channel: 'web',
@@ -1139,18 +926,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {
city: 'Disney',
country: 'USA',
@@ -1172,9 +951,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -1201,10 +978,7 @@ export const data = [
token: 'test_api_token',
strictMode: true,
}),
- metadata: {
- jobId: 5,
- additionalProp: 5,
- },
+ metadata: { jobId: 5, additionalProp: 5, userId: 'u1' },
message: {
anonymousId: '5094f5704b9cf2b3',
channel: 'mobile',
@@ -1223,44 +997,21 @@ export const data = [
type: 'ios',
token: 'test_device_token',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.1-beta.1',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'iOS',
- version: '8.1.0',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'iOS', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
- traits: {
- anonymousId: '5094f5704b9cf2b3',
- userId: 'test_user_id',
- },
+ traits: { anonymousId: '5094f5704b9cf2b3', userId: 'test_user_id' },
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
},
event: 'MainActivity',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
userId: 'test_user_id',
messageId: 'id2',
- properties: {
- name: 'MainActivity',
- automatic: true,
- },
+ properties: { name: 'MainActivity', automatic: true },
originalTimestamp: '2020-03-12T09:05:03.421Z',
type: 'identify',
sentAt: '2020-03-12T09:05:13.042Z',
@@ -1278,10 +1029,7 @@ export const data = [
],
strictMode: true,
}),
- metadata: {
- jobId: 6,
- additionalProp: 6,
- },
+ metadata: { jobId: 6, additionalProp: 6, userId: 'u1' },
message: {
anonymousId: 'anonId06',
channel: 'web',
@@ -1293,18 +1041,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -1318,9 +1058,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -1331,9 +1069,7 @@ export const data = [
initial_referrer: 'https://docs.rudderstack.com',
initial_referring_domain: 'docs.rudderstack.com',
},
- traits: {
- company: 'testComp',
- },
+ traits: { company: 'testComp' },
messageId: '2536eda4-d638-4c93-8014-8ffe3f083214',
originalTimestamp: '2020-01-24T06:29:02.362Z',
receivedAt: '2020-01-24T11:59:02.403+05:30',
@@ -1356,10 +1092,7 @@ export const data = [
],
strictMode: true,
}),
- metadata: {
- jobId: 7,
- additionalProp: 7,
- },
+ metadata: { jobId: 7, additionalProp: 7, userId: 'u1' },
message: {
anonymousId: 'anonId06',
channel: 'web',
@@ -1371,18 +1104,10 @@ export const data = [
version: '1.0.5',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.5',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.5' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -1396,9 +1121,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
page: {
path: '/destinations/mixpanel',
referrer: '',
@@ -1440,9 +1163,7 @@ export const data = [
'Content-Type': 'application/json',
Authorization: 'Basic dGVzdF9hcGlfdG9rZW46',
},
- params: {
- strict: 1,
- },
+ params: { strict: 1 },
body: {
JSON: {},
JSON_ARRAY: {
@@ -1454,12 +1175,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- additionalProp: 1,
- },
- ],
+ metadata: [{ jobId: 1, additionalProp: 1, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -1512,9 +1228,7 @@ export const data = [
'Content-Type': 'application/json',
Authorization: 'Basic dGVzdF9hcGlfdG9rZW46',
},
- params: {
- strict: 1,
- },
+ params: { strict: 1 },
body: {
JSON: {},
JSON_ARRAY: {
@@ -1527,12 +1241,7 @@ export const data = [
files: {},
},
],
- metadata: [
- {
- jobId: 2,
- additionalProp: 2,
- },
- ],
+ metadata: [{ jobId: 2, additionalProp: 2, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -1585,9 +1294,7 @@ export const data = [
'Content-Type': 'application/json',
Authorization: 'Basic dGVzdF9hcGlfdG9rZW46',
},
- params: {
- strict: 1,
- },
+ params: { strict: 1 },
body: {
JSON: {},
JSON_ARRAY: {
@@ -1601,18 +1308,9 @@ export const data = [
},
],
metadata: [
- {
- jobId: 3,
- additionalProp: 3,
- },
- {
- jobId: 4,
- additionalProp: 4,
- },
- {
- jobId: 5,
- additionalProp: 5,
- },
+ { jobId: 3, additionalProp: 3, userId: 'u1' },
+ { jobId: 4, additionalProp: 4, userId: 'u1' },
+ { jobId: 5, additionalProp: 5, userId: 'u1' },
],
batched: true,
statusCode: 200,
@@ -1676,12 +1374,7 @@ export const data = [
files: {},
},
],
- metadata: [
- {
- jobId: 6,
- additionalProp: 6,
- },
- ],
+ metadata: [{ jobId: 6, additionalProp: 6, userId: 'u1' }],
batched: true,
statusCode: 200,
destination: {
@@ -1690,11 +1383,7 @@ export const data = [
apiSecret: 'test_api_secret',
token: 'test_api_token',
prefixProperties: true,
- groupKeySettings: [
- {
- groupKey: 'company',
- },
- ],
+ groupKeySettings: [{ groupKey: 'company' }],
strictMode: true,
useNativeSDK: false,
},
@@ -1710,12 +1399,7 @@ export const data = [
},
},
{
- metadata: [
- {
- jobId: 7,
- additionalProp: 7,
- },
- ],
+ metadata: [{ jobId: 7, additionalProp: 7, userId: 'u1' }],
batched: false,
statusCode: 400,
error:
@@ -1735,11 +1419,7 @@ export const data = [
token: 'test_api_token',
prefixProperties: true,
useNativeSDK: false,
- groupKeySettings: [
- {
- groupKey: 'company',
- },
- ],
+ groupKeySettings: [{ groupKey: 'company' }],
strictMode: true,
},
DestinationDefinition: {
diff --git a/test/integrations/destinations/ometria/router/data.ts b/test/integrations/destinations/ometria/router/data.ts
index ef15eea586..58f3a91d87 100644
--- a/test/integrations/destinations/ometria/router/data.ts
+++ b/test/integrations/destinations/ometria/router/data.ts
@@ -16,10 +16,7 @@ export const data = [
userId: 'userId1',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -53,10 +50,7 @@ export const data = [
field1: 'val1',
ip: '0.0.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.2.1',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.2.1' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36',
@@ -67,14 +61,10 @@ export const data = [
receivedAt: '2021-10-25T15:10:08.889+05:30',
request_ip: '[::1]',
anonymousId: '7138f7d9-5dd2-4337-805d-ca17be59dc8e',
- integrations: {
- Ometria: {
- listingId: 'test1',
- },
- },
+ integrations: { Ometria: { listingId: 'test1' } },
originalTimestamp: '2021-10-25T09:40:08.879Z',
},
- metadata: { jobId: 1 },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
ID: '1zzHtStW2ZPlullmz6L7DGnmk9V',
Name: 'ometria-dev',
@@ -131,10 +121,7 @@ export const data = [
userId: 'userId1',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -168,10 +155,7 @@ export const data = [
field1: 'val1',
ip: '0.0.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.2.1',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.2.1' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36',
@@ -181,15 +165,10 @@ export const data = [
timestamp: '2021-10-25T15:10:08.888+05:30',
receivedAt: '2021-10-25T15:10:08.889+05:30',
request_ip: '[::1]',
- integrations: {
- Ometria: {
- listingId: 'updatedId1',
- allowMarketing: true,
- },
- },
+ integrations: { Ometria: { listingId: 'updatedId1', allowMarketing: true } },
originalTimestamp: '2021-10-25T09:40:08.879Z',
},
- metadata: { jobId: 2 },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
ID: '1zzHtStW2ZPlullmz6L7DGnmk9V',
Name: 'ometria-dev',
@@ -255,9 +234,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://api.ometria.com/v2/push',
- headers: {
- 'X-Ometria-Auth': 'dummyApiKey',
- },
+ headers: { 'X-Ometria-Auth': 'dummyApiKey' },
params: {},
body: {
JSON: {},
@@ -271,12 +248,8 @@ export const data = [
files: {},
},
metadata: [
- {
- jobId: 1,
- },
- {
- jobId: 2,
- },
+ { jobId: 1, userId: 'u1' },
+ { jobId: 2, userId: 'u1' },
],
batched: true,
statusCode: 200,
diff --git a/test/integrations/destinations/one_signal/router/data.ts b/test/integrations/destinations/one_signal/router/data.ts
index 5f45d2e624..fe8460e45d 100644
--- a/test/integrations/destinations/one_signal/router/data.ts
+++ b/test/integrations/destinations/one_signal/router/data.ts
@@ -19,19 +19,14 @@ export const data = [
allowedProperties: [],
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
type: 'identify',
sentAt: '2021-01-03T17:02:53.195Z',
userId: 'user@27',
channel: 'web',
context: {
- os: {
- name: '',
- version: '1.12.3',
- },
+ os: { name: '', version: '1.12.3' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -46,18 +41,9 @@ export const data = [
userId: 'user@27',
},
locale: 'en-US',
- device: {
- token: 'token',
- id: 'id',
- type: 'ios',
- },
- screen: {
- density: 2,
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ device: { token: 'token', id: 'id', type: 'ios' },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
@@ -75,34 +61,19 @@ export const data = [
emailDeviceType: false,
smsDeviceType: false,
eventAsTags: false,
- allowedProperties: [
- {
- propertyName: 'brand',
- },
- {
- propertyName: 'price',
- },
- ],
+ allowedProperties: [{ propertyName: 'brand' }, { propertyName: 'price' }],
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
event: 'add_to_Cart',
type: 'track',
sentAt: '2021-01-03T17:02:53.195Z',
userId: 'user@27',
channel: 'web',
- properties: {
- brand: 'Zara',
- price: '12000',
- },
+ properties: { brand: 'Zara', price: '12000' },
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -110,13 +81,8 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
},
locale: 'en-US',
- screen: {
- density: 2,
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
@@ -145,10 +111,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://onesignal.com/api/v1/players',
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json',
- },
+ headers: { Accept: 'application/json', 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -180,10 +143,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://onesignal.com/api/v1/players',
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json',
- },
+ headers: { Accept: 'application/json', 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -211,11 +171,7 @@ export const data = [
files: {},
},
],
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -233,32 +189,19 @@ export const data = [
body: {
XML: {},
FORM: {},
- JSON: {
- tags: {
- brand: 'Zara',
- price: '12000',
- add_to_Cart: true,
- },
- },
+ JSON: { tags: { brand: 'Zara', price: '12000', add_to_Cart: true } },
JSON_ARRAY: {},
},
type: 'REST',
files: {},
method: 'PUT',
params: {},
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json',
- },
+ headers: { Accept: 'application/json', 'Content-Type': 'application/json' },
version: '1',
endpoint:
'https://onesignal.com/api/v1/apps/random-818c-4a28-b98e-6cd8a994eb22/users/user@27',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -267,14 +210,7 @@ export const data = [
emailDeviceType: false,
smsDeviceType: false,
eventAsTags: false,
- allowedProperties: [
- {
- propertyName: 'brand',
- },
- {
- propertyName: 'price',
- },
- ],
+ allowedProperties: [{ propertyName: 'brand' }, { propertyName: 'price' }],
},
},
},
diff --git a/test/integrations/destinations/optimizely_fullstack/router/data.ts b/test/integrations/destinations/optimizely_fullstack/router/data.ts
index 1803881f30..270ac6873e 100644
--- a/test/integrations/destinations/optimizely_fullstack/router/data.ts
+++ b/test/integrations/destinations/optimizely_fullstack/router/data.ts
@@ -18,11 +18,7 @@ export const data = [
channel: 'web',
properties: {},
context: {
- traits: {
- organization: 'RudderStack',
- fullName: 'John Doe',
- country: 'US',
- },
+ traits: { organization: 'RudderStack', fullName: 'John Doe', country: 'US' },
sessionId: 1685626914716,
},
rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
@@ -32,17 +28,11 @@ export const data = [
userId: 'userId123',
integrations: {
All: true,
- optimizely_fullstack: {
- variationId: 'test_variation_id_1',
- },
+ optimizely_fullstack: { variationId: 'test_variation_id_1' },
},
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json',
accountId: 'test_account_id',
@@ -50,20 +40,12 @@ export const data = [
experimentId: 'test_experiment_id',
trackKnownUsers: true,
attributeMapping: [
- {
- from: 'organization',
- to: 'company',
- },
- {
- from: 'fullName',
- to: 'name',
- },
+ { from: 'organization', to: 'company' },
+ { from: 'fullName', to: 'name' },
],
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
},
{
message: {
@@ -72,34 +54,21 @@ export const data = [
userId: 'userId123',
channel: 'web',
context: {
- traits: {
- organization: 'RudderStack',
- fullName: 'John Doe',
- },
+ traits: { organization: 'RudderStack', fullName: 'John Doe' },
sessionId: 1685626914716,
},
rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d',
messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
timestamp: '2023-02-10T12:16:07.251Z',
- properties: {
- foo: 'bar',
- revenue: 123,
- quantity: 2,
- },
+ properties: { foo: 'bar', revenue: 123, quantity: 2 },
anonymousId: '856365b8-da4b-4c13-9098-84df18559446',
integrations: {
All: true,
- optimizely_fullstack: {
- variationId: 'test_variation_id_2',
- },
+ optimizely_fullstack: { variationId: 'test_variation_id_2' },
},
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json',
accountId: 'test_account_id',
@@ -108,30 +77,16 @@ export const data = [
trackKnownUsers: true,
anonymizeIp: true,
eventMapping: [
- {
- from: 'Product Searched',
- to: 'Searched',
- },
- {
- from: 'product_added',
- to: 'Product Added',
- },
+ { from: 'Product Searched', to: 'Searched' },
+ { from: 'product_added', to: 'Product Added' },
],
attributeMapping: [
- {
- from: 'organization',
- to: 'company',
- },
- {
- from: 'fullName',
- to: 'name',
- },
+ { from: 'organization', to: 'company' },
+ { from: 'fullName', to: 'name' },
],
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
},
{
message: {
@@ -139,33 +94,21 @@ export const data = [
userId: 'userId123',
channel: 'web',
context: {
- traits: {
- organization: 'RudderStack',
- fullName: 'John Doe',
- },
+ traits: { organization: 'RudderStack', fullName: 'John Doe' },
sessionId: 1685626914716,
},
rudderId: '5354b3f2-cb72-4355-a2b5-a298c3837c7d',
messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
timestamp: '2023-02-10T12:16:07.251Z',
- properties: {
- foo: 'bar',
- category: 'food',
- },
+ properties: { foo: 'bar', category: 'food' },
anonymousId: '856365b8-da4b-4c13-9098-84df18559446',
integrations: {
All: true,
- optimizely_fullstack: {
- variationId: 'test_variation_id_1',
- },
+ optimizely_fullstack: { variationId: 'test_variation_id_1' },
},
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json',
accountId: 'test_account_id',
@@ -176,20 +119,12 @@ export const data = [
trackCategorizedPages: true,
trackNamedPages: false,
pageMapping: [
- {
- from: 'meal',
- to: 'Viewed Meal Page',
- },
- {
- from: 'food',
- to: 'Product Added',
- },
+ { from: 'meal', to: 'Viewed Meal Page' },
+ { from: 'food', to: 'Product Added' },
],
},
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
},
{
message: {
@@ -201,19 +136,10 @@ export const data = [
rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
- integrations: {
- All: true,
- optimizely_fullstack: {
- variationId: '123',
- },
- },
+ integrations: { All: true, optimizely_fullstack: { variationId: '123' } },
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json',
accountId: 'test_account_id',
@@ -223,9 +149,7 @@ export const data = [
trackNamedPages: false,
},
},
- metadata: {
- jobId: 4,
- },
+ metadata: { jobId: 4, userId: 'u1' },
},
],
destType: 'optimizely_fullstack',
@@ -245,9 +169,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://logx.optimizely.com/v1/events',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -303,11 +225,7 @@ export const data = [
files: {},
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json',
accountId: 'test_account_id',
@@ -315,22 +233,12 @@ export const data = [
experimentId: 'test_experiment_id',
trackKnownUsers: true,
attributeMapping: [
- {
- from: 'organization',
- to: 'company',
- },
- {
- from: 'fullName',
- to: 'name',
- },
+ { from: 'organization', to: 'company' },
+ { from: 'fullName', to: 'name' },
],
},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
statusCode: 200,
},
{
@@ -340,9 +248,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://logx.optimizely.com/v1/events',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -379,9 +285,7 @@ export const data = [
uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
quantity: 2,
revenue: 12300,
- tags: {
- foo: 'bar',
- },
+ tags: { foo: 'bar' },
},
],
},
@@ -397,11 +301,7 @@ export const data = [
files: {},
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json',
accountId: 'test_account_id',
@@ -410,32 +310,16 @@ export const data = [
trackKnownUsers: true,
anonymizeIp: true,
eventMapping: [
- {
- from: 'Product Searched',
- to: 'Searched',
- },
- {
- from: 'product_added',
- to: 'Product Added',
- },
+ { from: 'Product Searched', to: 'Searched' },
+ { from: 'product_added', to: 'Product Added' },
],
attributeMapping: [
- {
- from: 'organization',
- to: 'company',
- },
- {
- from: 'fullName',
- to: 'name',
- },
+ { from: 'organization', to: 'company' },
+ { from: 'fullName', to: 'name' },
],
},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
statusCode: 200,
},
{
@@ -445,9 +329,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://logx.optimizely.com/v1/events',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -468,10 +350,7 @@ export const data = [
key: 'Product Added',
timestamp: 1676031367251,
uuid: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
- tags: {
- foo: 'bar',
- category: 'food',
- },
+ tags: { foo: 'bar', category: 'food' },
},
],
},
@@ -487,11 +366,7 @@ export const data = [
files: {},
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
dataFileUrl: 'https://cdn.optimizely.com/datafiles/abc.json',
accountId: 'test_account_id',
@@ -502,32 +377,18 @@ export const data = [
trackCategorizedPages: true,
trackNamedPages: false,
pageMapping: [
- {
- from: 'meal',
- to: 'Viewed Meal Page',
- },
- {
- from: 'food',
- to: 'Product Added',
- },
+ { from: 'meal', to: 'Viewed Meal Page' },
+ { from: 'food', to: 'Product Added' },
],
},
},
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
statusCode: 200,
},
{
batched: false,
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
accountId: 'test_account_id',
campaignId: 'test_campagin_id',
@@ -539,11 +400,7 @@ export const data = [
},
error:
"Both 'Track Categorized Pages' and 'Track Named Pages' toggles are disabled in webapp. Please enable at one of them to send page/screen events to Optimizely.",
- metadata: [
- {
- jobId: 4,
- },
- ],
+ metadata: [{ jobId: 4, userId: 'u1' }],
statTags: {
destType: 'OPTIMIZELY_FULLSTACK',
errorCategory: 'dataValidation',
diff --git a/test/integrations/destinations/ortto/processor/data.ts b/test/integrations/destinations/ortto/processor/data.ts
index e7c71c7355..715262e447 100644
--- a/test/integrations/destinations/ortto/processor/data.ts
+++ b/test/integrations/destinations/ortto/processor/data.ts
@@ -1068,6 +1068,220 @@ export const data = [
},
},
},
+ {
+ name: 'ortto',
+ description: 'Track call for updating activities with no phone provided',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'ORTTO',
+ Config: {
+ privateApiKey: 'dummyApiKey',
+ instanceRegion: 'other',
+ orttoEventsMapping: [
+ {
+ rsEventName: 'RudderEvent',
+ orttoEventName: 'Ortto Event',
+ eventProperties: [
+ {
+ rudderProperty: 'RudderProp',
+ orttoProperty: 'OrttoProp',
+ type: 'text',
+ },
+ {
+ rudderProperty: 'RudderProp',
+ orttoProperty: 'OrttoProp',
+ type: 'longText',
+ },
+ ],
+ },
+ ],
+ orttoPersonAttributes: [
+ {
+ rudderTraits: 'ruddertrait0',
+ orttoAttribute: 'ortto attirbute0',
+ type: 'email',
+ },
+ {
+ rudderTraits: 'ruddertrait1',
+ orttoAttribute: 'ortto attirbute1',
+ type: 'email',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 2 },
+ message: {
+ anonymousId: '8d872292709c6fbe',
+ channel: 'mobile',
+ context: {
+ app: {
+ build: '1',
+ name: 'AMTestProject',
+ namespace: 'com.rudderstack.android.rudderstack.sampleAndroidApp',
+ version: '1.0',
+ },
+ device: {
+ id: '8d872292709c6fbe',
+ manufacturer: 'Google',
+ model: 'AOSPonIAEmulator',
+ name: 'generic_x86_arm',
+ type: 'android',
+ },
+ library: {
+ name: 'com.rudderstack.android.sdk.core',
+ version: '1.0.2',
+ },
+ locale: 'en-US',
+ network: {
+ carrier: 'Android',
+ bluetooth: false,
+ cellular: true,
+ wifi: true,
+ },
+ os: {
+ name: 'Android',
+ version: '9',
+ },
+ screen: {
+ density: 420,
+ height: 1794,
+ width: 1080,
+ },
+ timezone: 'Asia/Kolkata',
+ traits: {
+ ruddertrait0: 'abc',
+ ruddertrait1: 'def',
+ address: {
+ city: 'Kolkata',
+ country: 'India',
+ postalcode: '700096',
+ state: 'West bengal',
+ street: 'Park Street',
+ },
+ age: '30',
+ anonymousId: '8d872292709c6fbe',
+ birthday: '2020-05-26',
+ createDate: '18th March 2020',
+ description: 'Premium User for 3 years',
+ email: 'identify@test.com',
+ firstname: 'John',
+ gdpr: false,
+ userId: 'sample_user_id',
+ lastname: 'Sparrow',
+ name: 'John Sparrow',
+ id: 'sample_user_id',
+ username: 'john_sparrow',
+ },
+ userAgent:
+ 'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)',
+ },
+ event: 'RudderEvent',
+ integrations: {
+ All: true,
+ },
+ messageId: '1590431830915-73bed370-5889-436d-9a9e-0c0e0c809d06',
+ properties: {
+ revenue: '30',
+ RudderProp: 'USD',
+ quantity: '5',
+ test_key_2: {
+ test_child_key_1: 'test_child_value_1',
+ },
+ price: '58.0',
+ },
+ originalTimestamp: '2020-05-25T18:37:10.917Z',
+ type: 'track',
+ userId: 'sample_user_id',
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ pathSuffix: '',
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.ap3api.com/v1/activities/create',
+ headers: {
+ 'X-Api-Key': 'dummyApiKey',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ activities: [
+ {
+ fields: {
+ 'str::first': 'John',
+ 'str::last': 'Sparrow',
+ 'str::email': 'identify@test.com',
+ 'geo::city': {
+ name: 'Kolkata',
+ },
+ 'geo::country': {},
+ 'geo::region': {},
+ 'dtz::b': {
+ day: 26,
+ month: 5,
+ year: 2020,
+ },
+ 'str::postal': '700096',
+ 'str::language': 'en-US',
+ 'str::ei': 'sample_user_id',
+ 'bol::gdpr': false,
+ 'bol::p': false,
+ 'bol::sp': false,
+ 'str:cm:ortto-attirbute0': 'abc',
+ 'str:cm:ortto-attirbute1': 'def',
+ },
+ activity_id: 'act:cm:ortto-event',
+ attributes: {
+ 'str:cm:orttoprop': 'USD',
+ 'txt:cm:orttoprop': 'USD',
+ },
+ location: {},
+ },
+ ],
+ merge_by: ['str::ei', 'str::email'],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ jobId: 2,
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
{
name: 'ortto',
description: 'Track call for updating activities',
diff --git a/test/integrations/destinations/ortto/router/data.ts b/test/integrations/destinations/ortto/router/data.ts
index 58a1dc3a5d..cf5731be80 100644
--- a/test/integrations/destinations/ortto/router/data.ts
+++ b/test/integrations/destinations/ortto/router/data.ts
@@ -55,7 +55,7 @@ export const data = [
Enabled: true,
Transformations: [],
},
- metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 1 },
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 1, userId: 'u1' },
message: {
anonymousId: '8d872292709c6fbe',
channel: 'mobile',
@@ -176,7 +176,7 @@ export const data = [
Enabled: true,
Transformations: [],
},
- metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 2 },
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 2, userId: 'u1' },
message: {
anonymousId: '8d872292709c6fbe',
channel: 'mobile',
@@ -327,6 +327,7 @@ export const data = [
{
destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
jobId: 1,
+ userId: 'u1',
},
],
batched: true,
@@ -438,6 +439,7 @@ export const data = [
{
destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
jobId: 2,
+ userId: 'u1',
},
],
batched: true,
diff --git a/test/integrations/destinations/pagerduty/router/data.ts b/test/integrations/destinations/pagerduty/router/data.ts
index 02fd53c629..87761656f9 100644
--- a/test/integrations/destinations/pagerduty/router/data.ts
+++ b/test/integrations/destinations/pagerduty/router/data.ts
@@ -18,10 +18,7 @@ export const data = [
userId: 'user@45',
properties: {
source: 'rudder-webapp',
- customDetails: {
- 'ping time': '1500ms',
- 'load avg': 0.75,
- },
+ customDetails: { 'ping time': '1500ms', 'load avg': 0.75 },
imageURLs: [
{
src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg',
@@ -31,9 +28,7 @@ export const data = [
src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1',
alt: 'second image',
},
- {
- alt: 'third image',
- },
+ { alt: 'third image' },
],
linkURLs: [
{
@@ -44,20 +39,12 @@ export const data = [
href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack',
text: 'Stack Overflow Error',
},
- {
- text: 'Destructure Error',
- },
+ { text: 'Destructure Error' },
],
},
- integrations: {
- pagerduty: {
- type: 'changeEvent',
- },
- },
- },
- metadata: {
- jobId: 1,
+ integrations: { pagerduty: { type: 'changeEvent' } },
},
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
Config: {
routingKey: '9552b56325dc490bd0139be85f7b8fac',
@@ -80,10 +67,7 @@ export const data = [
source: 'rudder-webapp',
group: 'destination',
class: 'connection settings',
- customDetails: {
- 'ping time': '1500ms',
- 'load avg': 0.75,
- },
+ customDetails: { 'ping time': '1500ms', 'load avg': 0.75 },
imageURLs: [
{
src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg',
@@ -93,9 +77,7 @@ export const data = [
src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1',
alt: 'second image',
},
- {
- alt: 'third image',
- },
+ { alt: 'third image' },
],
linkURLs: [
{
@@ -106,15 +88,11 @@ export const data = [
href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack',
text: 'Stack Overflow Error',
},
- {
- text: 'Destructure Error',
- },
+ { text: 'Destructure Error' },
],
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
routingKey: '9552b56325dc490bd0139be85f7b8fac',
@@ -138,10 +116,7 @@ export const data = [
source: 'rudder-webapp',
group: 'destination',
class: 'connection settings',
- customDetails: {
- 'ping time': '1500ms',
- 'load avg': 0.75,
- },
+ customDetails: { 'ping time': '1500ms', 'load avg': 0.75 },
imageURLs: [
{
src: 'https://static.s4be.cochrane.org/app/uploads/2017/04/shutterstock_531145954.jpg',
@@ -151,9 +126,7 @@ export const data = [
src: 'https://chart.googleapis.com/chart?chs=600x400&chd=t:6,2,9,5,2,5,7,4,8,2,1&cht=lc&chds=a&chxt=y&chm=D,0033FF,0,0,5,1',
alt: 'second image',
},
- {
- alt: 'third image',
- },
+ { alt: 'third image' },
],
linkURLs: [
{
@@ -164,15 +137,11 @@ export const data = [
href: 'https://www.techtarget.com/whatis/definition/stack-overflow#:~:text=A%20stack%20overflow%20is%20a,been%20allocated%20to%20that%20stack',
text: 'Stack Overflow Error',
},
- {
- text: 'Destructure Error',
- },
+ { text: 'Destructure Error' },
],
},
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
destination: {
Config: {
routingKey: '9552b56325dc490bd0139be85f7b8fac',
@@ -221,10 +190,7 @@ export const data = [
payload: {
source: 'rudder-webapp',
summary: 'Github CI/CD Triggered',
- custom_details: {
- 'load avg': 0.75,
- 'ping time': '1500ms',
- },
+ custom_details: { 'load avg': 0.75, 'ping time': '1500ms' },
},
routing_key: '9552b56325dc490bd0139be85f7b8fac',
},
@@ -234,9 +200,7 @@ export const data = [
files: {},
method: 'POST',
params: {},
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
version: '1',
endpoint: 'https://events.pagerduty.com/v2/change/enqueue',
},
@@ -246,7 +210,7 @@ export const data = [
dedupKeyFieldIdentifier: 'properties.dedupKey',
},
},
- metadata: [{ jobId: 1 }],
+ metadata: [{ jobId: 1, userId: 'u1' }],
statusCode: 200,
},
{
@@ -266,9 +230,7 @@ export const data = [
files: {},
method: 'POST',
params: {},
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
version: '1',
endpoint: 'https://events.pagerduty.com/v2/enqueue',
},
@@ -278,13 +240,13 @@ export const data = [
dedupKeyFieldIdentifier: 'properties.dedupKey',
},
},
- metadata: [{ jobId: 2 }],
+ metadata: [{ jobId: 2, userId: 'u1' }],
statusCode: 200,
},
{
batched: false,
error: 'Events must be sent within ninety days of their occurrence',
- metadata: [{ jobId: 3 }],
+ metadata: [{ jobId: 3, userId: 'u1' }],
statusCode: 400,
statTags: {
destType: 'PAGERDUTY',
diff --git a/test/integrations/destinations/pardot/router/data.ts b/test/integrations/destinations/pardot/router/data.ts
index 7c2a2a11e3..0862666bba 100644
--- a/test/integrations/destinations/pardot/router/data.ts
+++ b/test/integrations/destinations/pardot/router/data.ts
@@ -5,7 +5,7 @@ export const data = [
name: 'pardot',
description: 'Test 0',
feature: 'router',
- module: 'destination',
+ module: MODULES.DESTINATION,
version: 'v0',
input: {
request: {
@@ -25,9 +25,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -58,10 +56,8 @@ export const data = [
},
metadata: {
jobId: 1,
- secret: {
- access_token: 'myToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
message: {
type: 'identify',
@@ -70,10 +66,7 @@ export const data = [
userId: 'user12345',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -100,19 +93,11 @@ export const data = [
innerHeight: 776,
},
traits: {},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.18',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36',
- externalId: [
- {
- type: 'pardotId',
- id: 123435,
- },
- ],
+ externalId: [{ type: 'pardotId', id: 123435 }],
},
rudderId: 'fa2994a5-2a81-45fd-9919-fcf5596ad380',
messageId: 'e2d1a383-d9a2-4e03-a9dc-131d153c4d95',
@@ -121,9 +106,7 @@ export const data = [
receivedAt: '2021-11-15T14:06:42.497+05:30',
request_ip: '[::1]',
anonymousId: 'd8b2ed61-7fa5-4ef8-bd92-6a506157c0cf',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2021-09-08T11:10:45.466Z',
traits: {
email: 'Roger12@waltair.io',
@@ -149,9 +132,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -182,10 +163,8 @@ export const data = [
},
metadata: {
jobId: 2,
- secret: {
- access_token: 'myToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
message: {
type: 'identify',
@@ -194,10 +173,7 @@ export const data = [
userId: 'user12345',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -224,10 +200,7 @@ export const data = [
innerHeight: 776,
},
traits: {},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.18',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36',
@@ -239,9 +212,7 @@ export const data = [
receivedAt: '2021-11-15T14:06:42.497+05:30',
request_ip: '[::1]',
anonymousId: 'd8b2ed61-7fa5-4ef8-bd92-6a506157c0cf',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2021-09-08T11:10:45.466Z',
traits: {
email: 'Roger_12@waltair.io',
@@ -267,9 +238,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -300,10 +269,8 @@ export const data = [
},
metadata: {
jobId: 3,
- secret: {
- access_token: 'myToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
message: {
type: 'identify',
@@ -312,10 +279,7 @@ export const data = [
userId: 'user12345',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -342,19 +306,11 @@ export const data = [
innerHeight: 776,
},
traits: {},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.18',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36',
- externalId: [
- {
- type: 'crmfid',
- id: '00Q6r000002LKhTPVR',
- },
- ],
+ externalId: [{ type: 'crmfid', id: '00Q6r000002LKhTPVR' }],
},
rudderId: 'fa2994a5-2a81-45fd-9919-fcf5596ad380',
messageId: 'e2d1a383-d9a2-4e03-a9dc-131d153c4d95',
@@ -363,9 +319,7 @@ export const data = [
receivedAt: '2021-11-15T14:06:42.497+05:30',
request_ip: '[::1]',
anonymousId: 'd8b2ed61-7fa5-4ef8-bd92-6a506157c0cf',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2021-09-08T11:10:45.466Z',
traits: {
email: 'nick_kyrgios@waltair.io',
@@ -391,9 +345,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -424,10 +376,8 @@ export const data = [
},
metadata: {
jobId: 4,
- secret: {
- access_token: 'myExpiredToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myExpiredToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
message: {
type: 'identify',
@@ -436,10 +386,7 @@ export const data = [
userId: 'user12345',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -466,10 +413,7 @@ export const data = [
innerHeight: 776,
},
traits: {},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.18',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36',
@@ -481,9 +425,7 @@ export const data = [
receivedAt: '2021-11-15T14:06:42.497+05:30',
request_ip: '[::1]',
anonymousId: 'd8b2ed61-7fa5-4ef8-bd92-6a506157c0cf',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2021-09-08T11:10:45.466Z',
traits: {
email: 'rolex_waltair@mywebsite.io',
@@ -509,9 +451,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -540,10 +480,7 @@ export const data = [
Name: 'test destination',
Transformations: [],
},
- metadata: {
- jobId: 5,
- secret: null,
- },
+ metadata: { jobId: 5, secret: null, userId: 'u1' },
message: {
type: 'identify',
event: 'navigated user',
@@ -551,10 +488,7 @@ export const data = [
userId: 'user12345',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -581,10 +515,7 @@ export const data = [
innerHeight: 776,
},
traits: {},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.18',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36',
@@ -596,9 +527,7 @@ export const data = [
receivedAt: '2021-11-15T14:06:42.497+05:30',
request_ip: '[::1]',
anonymousId: 'd8b2ed61-7fa5-4ef8-bd92-6a506157c0cf',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2021-09-08T11:10:45.466Z',
traits: {
email: 'rolex_waltair@mywebsite.io',
@@ -649,10 +578,8 @@ export const data = [
metadata: [
{
jobId: 1,
- secret: {
- access_token: 'myToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
],
batched: false,
@@ -670,9 +597,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -731,10 +656,8 @@ export const data = [
metadata: [
{
jobId: 2,
- secret: {
- access_token: 'myToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
],
batched: false,
@@ -752,9 +675,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -813,10 +734,8 @@ export const data = [
metadata: [
{
jobId: 3,
- secret: {
- access_token: 'myToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
],
batched: false,
@@ -834,9 +753,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -895,10 +812,8 @@ export const data = [
metadata: [
{
jobId: 4,
- secret: {
- access_token: 'myExpiredToken',
- refresh_token: 'myRefreshToken',
- },
+ secret: { access_token: 'myExpiredToken', refresh_token: 'myRefreshToken' },
+ userId: 'u1',
},
],
batched: false,
@@ -916,9 +831,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -962,9 +875,7 @@ export const data = [
name: 'PARDOT',
displayName: 'Pardot',
config: {
- auth: {
- type: 'OAuth',
- },
+ auth: { type: 'OAuth' },
transformAt: 'router',
transformAtV1: 'router',
saveDestinationResponse: true,
@@ -993,12 +904,7 @@ export const data = [
Name: 'test destination',
Transformations: [],
},
- metadata: [
- {
- jobId: 5,
- secret: null,
- },
- ],
+ metadata: [{ jobId: 5, secret: null, userId: 'u1' }],
batched: false,
statusCode: 500,
error: 'OAuth - access token not found',
@@ -1046,9 +952,7 @@ export const data = [
},
},
files: {},
- params: {
- destination: 'pardot',
- },
+ params: { destination: 'pardot' },
},
method: 'POST',
},
@@ -1062,10 +966,7 @@ export const data = [
status: 200,
destinationResponse: {
response: {
- '@attributes': {
- stat: 'ok',
- version: 1,
- },
+ '@attributes': { stat: 'ok', version: 1 },
prospect: {
id: 123435,
campaign_id: 42213,
@@ -1112,11 +1013,7 @@ export const data = [
is_starred: null,
created_at: '2022-01-21 18:21:46',
updated_at: '2022-01-21 18:48:41',
- campaign: {
- id: 42113,
- name: 'Test',
- crm_fid: '7012y000000MNOCLL4',
- },
+ campaign: { id: 42113, name: 'Test', crm_fid: '7012y000000MNOCLL4' },
assigned_to: {
user: {
id: 38443703,
@@ -1142,26 +1039,10 @@ export const data = [
id: 304,
name: 'Default',
profile_criteria: [
- {
- id: 1500,
- name: 'Shipping Volume',
- matches: 'Unknown',
- },
- {
- id: 1502,
- name: 'Industry',
- matches: 'Unknown',
- },
- {
- id: 1506,
- name: 'Job Title',
- matches: 'Unknown',
- },
- {
- id: 1508,
- name: 'Department',
- matches: 'Unknown',
- },
+ { id: 1500, name: 'Shipping Volume', matches: 'Unknown' },
+ { id: 1502, name: 'Industry', matches: 'Unknown' },
+ { id: 1506, name: 'Job Title', matches: 'Unknown' },
+ { id: 1508, name: 'Department', matches: 'Unknown' },
],
},
visitors: null,
@@ -1207,9 +1088,7 @@ export const data = [
},
},
files: {},
- params: {
- destination: 'pardot',
- },
+ params: { destination: 'pardot' },
},
method: 'POST',
},
@@ -1223,10 +1102,7 @@ export const data = [
status: 201,
destinationResponse: {
response: {
- '@attributes': {
- stat: 'ok',
- version: 1,
- },
+ '@attributes': { stat: 'ok', version: 1 },
prospect: {
id: 123435,
campaign_id: 42213,
@@ -1273,11 +1149,7 @@ export const data = [
is_starred: null,
created_at: '2022-01-21 18:21:46',
updated_at: '2022-01-21 18:48:41',
- campaign: {
- id: 42113,
- name: 'Test',
- crm_fid: '7012y000000MNOCLL4',
- },
+ campaign: { id: 42113, name: 'Test', crm_fid: '7012y000000MNOCLL4' },
assigned_to: {
user: {
id: 38443703,
@@ -1303,26 +1175,10 @@ export const data = [
id: 304,
name: 'Default',
profile_criteria: [
- {
- id: 1500,
- name: 'Shipping Volume',
- matches: 'Unknown',
- },
- {
- id: 1502,
- name: 'Industry',
- matches: 'Unknown',
- },
- {
- id: 1506,
- name: 'Job Title',
- matches: 'Unknown',
- },
- {
- id: 1508,
- name: 'Department',
- matches: 'Unknown',
- },
+ { id: 1500, name: 'Shipping Volume', matches: 'Unknown' },
+ { id: 1502, name: 'Industry', matches: 'Unknown' },
+ { id: 1506, name: 'Job Title', matches: 'Unknown' },
+ { id: 1508, name: 'Department', matches: 'Unknown' },
],
},
visitors: null,
@@ -1367,9 +1223,7 @@ export const data = [
},
},
files: {},
- params: {
- destination: 'pardot',
- },
+ params: { destination: 'pardot' },
},
method: 'POST',
},
@@ -1383,10 +1237,7 @@ export const data = [
status: 200,
destinationResponse: {
response: {
- '@attributes': {
- stat: 'ok',
- version: 1,
- },
+ '@attributes': { stat: 'ok', version: 1 },
prospect: {
id: 123435,
campaign_id: 42213,
@@ -1433,11 +1284,7 @@ export const data = [
is_starred: null,
created_at: '2022-01-21 18:21:46',
updated_at: '2022-01-21 18:48:41',
- campaign: {
- id: 42113,
- name: 'Test',
- crm_fid: '7012y000000MNOCLL4',
- },
+ campaign: { id: 42113, name: 'Test', crm_fid: '7012y000000MNOCLL4' },
assigned_to: {
user: {
id: 38443703,
@@ -1463,26 +1310,10 @@ export const data = [
id: 304,
name: 'Default',
profile_criteria: [
- {
- id: 1500,
- name: 'Shipping Volume',
- matches: 'Unknown',
- },
- {
- id: 1502,
- name: 'Industry',
- matches: 'Unknown',
- },
- {
- id: 1506,
- name: 'Job Title',
- matches: 'Unknown',
- },
- {
- id: 1508,
- name: 'Department',
- matches: 'Unknown',
- },
+ { id: 1500, name: 'Shipping Volume', matches: 'Unknown' },
+ { id: 1502, name: 'Industry', matches: 'Unknown' },
+ { id: 1506, name: 'Job Title', matches: 'Unknown' },
+ { id: 1508, name: 'Department', matches: 'Unknown' },
],
},
visitors: null,
@@ -1528,9 +1359,7 @@ export const data = [
},
},
files: {},
- params: {
- destination: 'pardot',
- },
+ params: { destination: 'pardot' },
},
method: 'POST',
},
@@ -1545,11 +1374,7 @@ export const data = [
status: 500,
authErrorCategory: 'REFRESH_TOKEN',
destinationResponse: {
- '@attributes': {
- stat: 'fail',
- version: 1,
- err_code: 184,
- },
+ '@attributes': { stat: 'fail', version: 1, err_code: 184 },
err: 'access_token is invalid, unknown, or malformed: Inactive token',
},
statTags: {
@@ -1558,7 +1383,7 @@ export const data = [
destinationId: 'Non-determininable',
workspaceId: 'Non-determininable',
errorType: 'retryable',
- feature: 'dataDelivery',
+ feature: FEATURES.DATA_DELIVERY,
implementation: 'native',
module: 'destination',
},
diff --git a/test/integrations/destinations/persistiq/router/data.ts b/test/integrations/destinations/persistiq/router/data.ts
index 051a8a4bca..ddb39b9028 100644
--- a/test/integrations/destinations/persistiq/router/data.ts
+++ b/test/integrations/destinations/persistiq/router/data.ts
@@ -26,33 +26,22 @@ export const data = [
Snippet: 'extra value',
extra: 'extraVal',
},
- externalId: [
- {
- type: 'persistIqLeadId',
- id: 'lel1c5u1wuk8',
- },
- ],
+ externalId: [{ type: 'persistIqLeadId', id: 'lel1c5u1wuk8' }],
},
traits: {
linkedinUrl: 'www.google.com',
dup: 'update',
status: 'open',
- company: {
- name: 'abc123',
- },
+ company: { name: 'abc123' },
},
},
destination: {
Config: {
apiKey: 'dummyApiKey',
- persistIqAttributesMapping: [
- {
- from: 'useroccupation',
- to: 'occupation',
- },
- ],
+ persistIqAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }],
},
},
+ metadata: { jobId: 1, userId: 'u1' },
},
],
destType: 'persistiq',
@@ -102,7 +91,7 @@ export const data = [
persistIqAttributesMapping: [{ from: 'useroccupation', to: 'occupation' }],
},
},
- metadata: [null],
+ metadata: [{ jobId: 1, userId: 'u1' }],
statusCode: 200,
},
],
diff --git a/test/integrations/destinations/pinterest_tag/processor/data.ts b/test/integrations/destinations/pinterest_tag/processor/data.ts
index 17ab83b2e9..65b33e7740 100644
--- a/test/integrations/destinations/pinterest_tag/processor/data.ts
+++ b/test/integrations/destinations/pinterest_tag/processor/data.ts
@@ -3569,4 +3569,129 @@ export const data = [
},
},
},
+ {
+ name: 'pinterest_tag',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ description: 'Any other format of event except string should be aborted',
+ message: {
+ type: 'track',
+ event: [1, 2, 3],
+ sentAt: '2020-08-14T05:30:30.118Z',
+ channel: 'web',
+ context: {
+ source: 'test',
+ userAgent: 'chrome',
+ traits: {
+ anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
+ email: 'abc@gmail.com',
+ phone: '+1234589947',
+ ge: 'male',
+ db: '19950715',
+ lastname: 'Rudderlabs',
+ firstName: 'Test',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
+ },
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
+ },
+ messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
+ timestamp: '2020-08-14T05:30:30.118Z',
+ properties: {
+ tax: 2,
+ total: 27.5,
+ coupon: 'hasbros',
+ revenue: 48,
+ price: 25,
+ quantity: 2,
+ currency: 'USD',
+ discount: 2.5,
+ order_id: '50314b8e9bcf000000000000',
+ requestIP: '123.0.0.0',
+ optOutType: 'LDP',
+ products: [
+ {
+ sku: '45790-32',
+ url: 'https://www.example.com/product/path',
+ name: 'Monopoly: 3rd Edition',
+ price: 19,
+ category: 'Games',
+ quantity: 1,
+ image_url: 'https:///www.example.com/product/path.jpg',
+ product_id: '507f1f77bcf86cd799439011',
+ },
+ {
+ sku: '46493-32',
+ name: 'Uno Card Game',
+ price: 3,
+ category: 'Games',
+ quantity: 2,
+ product_id: '505bd76785ebb509fc183733',
+ },
+ ],
+ shipping: 3,
+ subtotal: 22.5,
+ affiliation: 'Google Store',
+ checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
+ },
+ anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
+ integrations: { All: true },
+ },
+ destination: {
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'PINTEREST_TAG',
+ Config: {
+ sendAsTestEvent: false,
+ tagId: '123456789',
+ apiVersion: 'newApi',
+ adAccountId: 'accountId123',
+ conversionToken: 'conversionToken123',
+ appId: '429047995',
+ enhancedMatch: true,
+ enableDeduplication: true,
+ deduplicationKey: 'messageId',
+ sendingUnHashedData: true,
+ sendExternalId: true,
+ customProperties: [{ properties: 'presentclass' }, { properties: 'presentgrade' }],
+ eventsMapping: [{ from: 'ABC Searched', to: 'WatchVideo' }],
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' },
+ },
+ ],
+ method: 'POST',
+ },
+ pathSuffix: '',
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'Event is a required field and should be a string: Workflow: procWorkflow, Step: eventNames, ChildStep: undefined, OriginalError: Event is a required field and should be a string',
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq' },
+ statTags: {
+ destType: 'PINTEREST_TAG',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'cdkV2',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
];
diff --git a/test/integrations/destinations/pinterest_tag/router/data.ts b/test/integrations/destinations/pinterest_tag/router/data.ts
index e004be25f0..c02b1781e3 100644
--- a/test/integrations/destinations/pinterest_tag/router/data.ts
+++ b/test/integrations/destinations/pinterest_tag/router/data.ts
@@ -26,20 +26,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -81,14 +71,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 1,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 1, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -103,30 +88,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -150,20 +119,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -204,14 +163,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 2,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 2, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -226,30 +180,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -273,20 +211,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -308,14 +236,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 3,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 3, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -330,30 +253,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -377,20 +284,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -431,14 +328,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 4,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 4, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -453,30 +345,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -500,20 +376,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -554,14 +420,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 5,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 5, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -576,30 +437,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -623,20 +468,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -677,14 +512,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 6,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 6, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -699,30 +529,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -736,9 +550,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://ct.pinterest.com/events/v3',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -769,14 +581,8 @@ export const data = [
num_items: 3,
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -786,10 +592,7 @@ export const data = [
},
files: {},
},
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 7,
- },
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 7, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -804,30 +607,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -851,9 +638,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://ct.pinterest.com/events/v3',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -889,14 +674,8 @@ export const data = [
opt_out_type: 'LDP',
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -931,14 +710,8 @@ export const data = [
opt_out_type: 'LDP',
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -972,14 +745,8 @@ export const data = [
num_items: 3,
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1012,12 +779,7 @@ export const data = [
order_id: '50314b8e9bcf000000000000',
num_items: 2,
content_ids: ['123'],
- contents: [
- {
- quantity: 2,
- item_price: '25',
- },
- ],
+ contents: [{ quantity: 2, item_price: '25' }],
},
},
{
@@ -1050,14 +812,8 @@ export const data = [
num_items: 3,
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1091,14 +847,8 @@ export const data = [
num_items: 3,
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1132,14 +882,8 @@ export const data = [
num_items: 3,
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1152,30 +896,12 @@ export const data = [
files: {},
},
metadata: [
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 1,
- },
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 2,
- },
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 3,
- },
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 4,
- },
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 6,
- },
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 7,
- },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 1, userId: 'u1' },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 2, userId: 'u1' },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 3, userId: 'u1' },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 4, userId: 'u1' },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 6, userId: 'u1' },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 7, userId: 'u1' },
],
batched: true,
statusCode: 200,
@@ -1193,30 +919,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -1224,12 +934,7 @@ export const data = [
},
},
{
- metadata: [
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 5,
- },
- ],
+ metadata: [{ destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 5, userId: 'u1' }],
statTags: {
destType: 'PINTEREST_TAG',
feature: 'router',
@@ -1255,30 +960,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -1317,20 +1006,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -1372,14 +1051,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 8,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 8, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -1396,30 +1070,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -1443,20 +1101,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -1497,14 +1145,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 9,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 9, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -1521,30 +1164,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -1568,20 +1195,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -1622,14 +1239,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 10,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 10, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -1647,30 +1259,14 @@ export const data = [
enhancedMatch: true,
sendAsCustomEvent: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -1732,14 +1328,8 @@ export const data = [
opt_out_type: 'LDP',
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1773,14 +1363,8 @@ export const data = [
opt_out_type: 'LDP',
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1813,14 +1397,8 @@ export const data = [
num_items: 3,
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1853,14 +1431,8 @@ export const data = [
num_items: 3,
content_ids: ['507f1f77bcf86cd799439011', '505bd76785ebb509fc183733'],
contents: [
- {
- quantity: 1,
- item_price: '19',
- },
- {
- quantity: 2,
- item_price: '3',
- },
+ { quantity: 1, item_price: '19' },
+ { quantity: 2, item_price: '3' },
],
},
},
@@ -1873,18 +1445,9 @@ export const data = [
files: {},
},
metadata: [
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 8,
- },
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 9,
- },
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 10,
- },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 8, userId: 'u1' },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 9, userId: 'u1' },
+ { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 10, userId: 'u1' },
],
batched: true,
statusCode: 200,
@@ -1904,30 +1467,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'WatchVideo',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'WatchVideo' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -1966,20 +1513,10 @@ export const data = [
db: '19950715',
lastname: 'Rudderlabs',
firstName: 'Test',
- address: {
- city: 'Kolkata',
- state: 'WB',
- zip: '700114',
- country: 'IN',
- },
- },
- device: {
- advertisingId: 'abc123',
- },
- library: {
- name: 'rudder-sdk-ruby-sync',
- version: '1.0.6',
+ address: { city: 'Kolkata', state: 'WB', zip: '700114', country: 'IN' },
},
+ device: { advertisingId: 'abc123' },
+ library: { name: 'rudder-sdk-ruby-sync', version: '1.0.6' },
},
messageId: '7208bbb6-2c4e-45bb-bf5b-ad426f3593e9',
timestamp: '2020-08-14T05:30:30.118Z',
@@ -2020,14 +1557,9 @@ export const data = [
checkout_id: 'fksdjfsdjfisjf9sdfjsd9f',
},
anonymousId: '50be5c78-6c3f-4b60-be84-97805a316fb1',
- integrations: {
- All: true,
- },
- },
- metadata: {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 5,
+ integrations: { All: true },
},
+ metadata: { destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 5, userId: 'u1' },
destination: {
DestinationDefinition: { Config: { cdkV2Enabled: true } },
ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
@@ -2042,30 +1574,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'Watch Video',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'Watch Video' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
@@ -2084,12 +1600,7 @@ export const data = [
body: {
output: [
{
- metadata: [
- {
- destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
- jobId: 5,
- },
- ],
+ metadata: [{ destintionId: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq', jobId: 5, userId: 'u1' }],
batched: false,
statusCode: 400,
error: 'message type identify is not supported',
@@ -2115,30 +1626,14 @@ export const data = [
deduplicationKey: 'messageId',
enhancedMatch: true,
customProperties: [
- {
- properties: 'presentclass',
- },
- {
- properties: 'presentgrade',
- },
+ { properties: 'presentclass' },
+ { properties: 'presentgrade' },
],
eventsMapping: [
- {
- from: 'ABC Searched',
- to: 'Watch Video',
- },
- {
- from: 'ABC Searched',
- to: 'Signup',
- },
- {
- from: 'User Signup',
- to: 'Signup',
- },
- {
- from: 'User Created',
- to: 'Signup',
- },
+ { from: 'ABC Searched', to: 'Watch Video' },
+ { from: 'ABC Searched', to: 'Signup' },
+ { from: 'User Signup', to: 'Signup' },
+ { from: 'User Created', to: 'Signup' },
],
},
Enabled: true,
diff --git a/test/integrations/destinations/pipedream/router/data.ts b/test/integrations/destinations/pipedream/router/data.ts
index fa71e6a592..3e05ad9551 100644
--- a/test/integrations/destinations/pipedream/router/data.ts
+++ b/test/integrations/destinations/pipedream/router/data.ts
@@ -19,25 +19,15 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -100,21 +90,13 @@ export const data = [
versionSessionCount: 2,
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
pipedreamUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- {
- from: '',
- to: '',
- },
- {
- from: 'test2',
- to: 'value2',
- },
+ { from: '', to: '' },
+ { from: 'test2', to: 'value2' },
],
},
},
@@ -157,9 +139,7 @@ export const data = [
versionSessionCount: 2,
game_name: 'FireEagleSlots',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
event: 'spin_result',
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
@@ -172,18 +152,10 @@ export const data = [
},
traits: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
- },
- os: {
- version: '8.1.0',
- name: 'android',
- },
- network: {
- carrier: 'Banglalink',
+ address: { city: 'Dhaka', country: 'Bangladesh' },
},
+ os: { version: '8.1.0', name: 'android' },
+ network: { carrier: 'Banglalink' },
},
type: 'track',
properties: {
@@ -230,34 +202,21 @@ export const data = [
files: {},
endpoint: 'http://6b0e6a60.ngrok.io',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: {
- 'content-type': 'application/json',
- test2: 'value2',
- },
+ headers: { 'content-type': 'application/json', test2: 'value2' },
version: '1',
params: {},
type: 'REST',
method: 'POST',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
Config: {
pipedreamUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- {
- from: '',
- to: '',
- },
- {
- from: 'test2',
- to: 'value2',
- },
+ { from: '', to: '' },
+ { from: 'test2', to: 'value2' },
],
},
},
@@ -287,25 +246,15 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -368,14 +317,8 @@ export const data = [
versionSessionCount: 2,
},
},
- metadata: {
- jobId: 2,
- },
- destination: {
- Config: {
- pipedreamUrl: 'https://6b0e6a60.ngrok.io/n',
- },
- },
+ metadata: { jobId: 2, userId: 'u1' },
+ destination: { Config: { pipedreamUrl: 'https://6b0e6a60.ngrok.io/n' } },
},
],
destType: 'pipedream',
@@ -415,9 +358,7 @@ export const data = [
versionSessionCount: 2,
game_name: 'FireEagleSlots',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
event: 'spin_result',
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
@@ -430,18 +371,10 @@ export const data = [
},
traits: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
- },
- os: {
- version: '8.1.0',
- name: 'android',
- },
- network: {
- carrier: 'Banglalink',
+ address: { city: 'Dhaka', country: 'Bangladesh' },
},
+ os: { version: '8.1.0', name: 'android' },
+ network: { carrier: 'Banglalink' },
},
type: 'track',
properties: {
@@ -488,26 +421,16 @@ export const data = [
files: {},
endpoint: 'https://6b0e6a60.ngrok.io/n',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: {
- 'content-type': 'application/json',
- },
+ headers: { 'content-type': 'application/json' },
version: '1',
params: {},
type: 'REST',
method: 'POST',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
- destination: {
- Config: {
- pipedreamUrl: 'https://6b0e6a60.ngrok.io/n',
- },
- },
+ destination: { Config: { pipedreamUrl: 'https://6b0e6a60.ngrok.io/n' } },
},
],
},
diff --git a/test/integrations/destinations/posthog/router/data.ts b/test/integrations/destinations/posthog/router/data.ts
index f69b4bfbdd..dab8ba8b1c 100644
--- a/test/integrations/destinations/posthog/router/data.ts
+++ b/test/integrations/destinations/posthog/router/data.ts
@@ -16,9 +16,7 @@ export const data = [
yourInstance: 'https://app.posthog.com/',
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
event: 'event-alias',
context: {
@@ -29,13 +27,8 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
app: {
build: '1.0.0',
name: 'RudderLabs JavaScript SDK',
@@ -43,10 +36,7 @@ export const data = [
version: '1.1.7',
},
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
@@ -74,18 +64,13 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://app.posthog.com/batch',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
properties: {
$set: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
$os: 'android',
@@ -117,11 +102,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -148,13 +129,9 @@ export const data = [
input: [
{
destination: {
- Config: {
- teamApiKey: 'K_HlByO3IE73-Tz4ch1LNDs0JGdwbknNGolFc4HdoAE',
- },
- },
- metadata: {
- jobId: 2,
+ Config: { teamApiKey: 'K_HlByO3IE73-Tz4ch1LNDs0JGdwbknNGolFc4HdoAE' },
},
+ metadata: { jobId: 2, userId: 'u1' },
message: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
event: 'Product Brought',
@@ -166,18 +143,10 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
@@ -241,9 +210,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://app.posthog.com/batch',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -252,10 +219,7 @@ export const data = [
messageId: 'e4408cb8-16dd-41e9-a313-a7a9cdc4bac5',
properties: {
$set: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
$os: 'android',
@@ -316,17 +280,11 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
- Config: {
- teamApiKey: 'K_HlByO3IE73-Tz4ch1LNDs0JGdwbknNGolFc4HdoAE',
- },
+ Config: { teamApiKey: 'K_HlByO3IE73-Tz4ch1LNDs0JGdwbknNGolFc4HdoAE' },
},
},
],
diff --git a/test/integrations/destinations/profitwell/network.ts b/test/integrations/destinations/profitwell/network.ts
new file mode 100644
index 0000000000..e4e7247c74
--- /dev/null
+++ b/test/integrations/destinations/profitwell/network.ts
@@ -0,0 +1,94 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/pwu_Oea7HXV3bnTP/',
+ method: 'GET',
+ },
+ httpRes: {
+ data: [
+ {
+ user_id: 'pwu_Oea7HXV3bnTP',
+ subscription_id: 'pws_FecTCEyo17rV',
+ user_alias: 'spiderman_1a',
+ subscription_alias: 'spiderman_sub_1a',
+ email: 'spiderman@profitwell.com',
+ plan_id: 'web_plan',
+ plan_interval: 'month',
+ plan_currency: 'usd',
+ status: 'active',
+ value: 5000,
+ effective_date: 1514764800,
+ meta: {},
+ },
+ ],
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/spiderman_1a/',
+ method: 'GET',
+ },
+ httpRes: {
+ data: [
+ {
+ user_id: 'pwu_Oea7HXV3bnTP',
+ subscription_id: 'pws_FecTCEyo17rV',
+ user_alias: 'spiderman_1a',
+ subscription_alias: 'spiderman_sub_1a',
+ email: 'spiderman@profitwell.com',
+ plan_id: 'web_plan',
+ plan_interval: 'month',
+ plan_currency: 'usd',
+ status: 'active',
+ value: 5000,
+ effective_date: 1514764800,
+ meta: {},
+ },
+ ],
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/23453/',
+ method: 'GET',
+ },
+ httpRes: {
+ status: 404,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/sp_245/',
+ method: 'GET',
+ },
+ httpRes: {
+ message: 'Request failed with status code 404',
+ status: 404,
+ statusText: 'Not Found',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/1234/',
+ method: 'GET',
+ },
+ httpRes: {
+ message: 'Request failed with status code 404',
+ status: 404,
+ statusText: 'Not Found',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/samual/',
+ method: 'GET',
+ },
+ httpRes: {
+ message: 'Request failed with status code 404',
+ status: 404,
+ statusText: 'Not Found',
+ },
+ },
+];
diff --git a/test/integrations/destinations/profitwell/processor/data.ts b/test/integrations/destinations/profitwell/processor/data.ts
new file mode 100644
index 0000000000..58bd2ed35f
--- /dev/null
+++ b/test/integrations/destinations/profitwell/processor/data.ts
@@ -0,0 +1,1241 @@
+export const data = [
+ {
+ name: 'profitwell',
+ description: 'Test 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'userId or userAlias is required for identify',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 1',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ context: {
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: '23453',
+ },
+ ],
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'No user found for profitwell user_id',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 2',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.profitwell.com/v2/subscriptions/',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ params: {},
+ body: {
+ JSON: {
+ subscription_alias: 'samual',
+ email: 'sample@sample.com',
+ plan_id: '23',
+ plan_interval: 'month',
+ plan_currency: 'usd',
+ status: 'active',
+ value: '23',
+ user_alias: 'sp_245',
+ effective_date: 1630917906,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ status: 'active',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'subscriptionId or subscriptionAlias is required for identify',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 4',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: '1234',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'No user found for profitwell user_id',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 5',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: 'pwu_Oea7HXV3bnTP',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.profitwell.com/v2/subscriptions/',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ params: {},
+ body: {
+ JSON: {
+ subscription_alias: 'samual',
+ email: 'sample@sample.com',
+ plan_id: '23',
+ plan_interval: 'month',
+ plan_currency: 'usd',
+ status: 'active',
+ value: '23',
+ user_id: 'pwu_Oea7HXV3bnTP',
+ user_alias: 'sp_245',
+ effective_date: 1630917906,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 6',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: 'pwu_Oea7HXV3bnTP',
+ },
+ {
+ type: 'profitwellSubscriptionId',
+ id: 'pws_FecTCEyo17rV',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'Missing required value from ["traits.effectiveDate","context.traits.effectiveDate"]',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 7',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: 'pwu_Oea7HXV3bnTP',
+ },
+ {
+ type: 'profitwellSubscriptionId',
+ id: 'pws_FecTCEyo17rV',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ effectiveDate: '1609748705',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ params: {},
+ body: {
+ JSON: {
+ plan_id: '23',
+ plan_interval: 'month',
+ value: '23',
+ status: 'active',
+ effective_date: 1609748705,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 8',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: 'pwu_Oea7HXV3bnTP',
+ },
+ {
+ type: 'profitwellSubscriptionId',
+ id: 'pws_FecTCEyo17rV',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'monthly',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ effectiveDate: '1609748705',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'invalid format for planInterval. Aborting',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 9',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: 'pwu_Oea7HXV3bnTP',
+ },
+ {
+ type: 'profitwellSubscriptionId',
+ id: 'pws_FecTCEyo17rV',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'activate',
+ effectiveDate: '1609748705',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.profitwell.com/v2/subscriptions/pws_FecTCEyo17rV/',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ params: {},
+ body: {
+ JSON: {
+ plan_id: '23',
+ plan_interval: 'month',
+ value: '23',
+ effective_date: 1609748705,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 10',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {},
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: 'pwu_Oea7HXV3bnTP',
+ },
+ {
+ type: 'profitwellSubscriptionId',
+ id: 'pws_FecTCEyo17rV',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ effectiveDate: '1609748705',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Private API Key not found. Aborting.',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 11',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'profitwellUserId',
+ id: 'pwu_Oea7HXV3bnTP',
+ },
+ {
+ type: 'profitwellSubscriptionId',
+ id: 'pws_FecTCEyo17',
+ },
+ ],
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ effectiveDate: '1609748705',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Profitwell subscription_id not found',
+ statTags: {
+ destType: 'PROFITWELL',
+ errorCategory: 'network',
+ errorType: 'aborted',
+ feature: 'processor',
+ implementation: 'native',
+ meta: 'instrumentation',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'profitwell',
+ description: 'Test 12',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ },
+ message: {
+ channel: 'web',
+ userId: 'sp_245',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.9',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.9',
+ },
+ locale: 'en-GB',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ effectiveDate: 1609748705,
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
+ },
+ messageId: '6a5f38c0-4e75-4268-a066-2b73fbcad01f',
+ originalTimestamp: '2021-01-04T08:25:04.780Z',
+ receivedAt: '2021-01-04T13:55:04.799+05:30',
+ request_ip: '[::1]',
+ rudderId: '79881a62-980a-4d76-89ca-7099440f8c13',
+ sentAt: '2021-01-04T08:25:04.781Z',
+ timestamp: '2021-09-06T14:15:06.798+05:30',
+ type: 'identify',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.profitwell.com/v2/subscriptions/',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ params: {},
+ body: {
+ JSON: {
+ subscription_alias: 'samual',
+ email: 'sample@sample.com',
+ plan_id: '23',
+ plan_interval: 'month',
+ plan_currency: 'usd',
+ status: 'active',
+ value: '23',
+ effective_date: 1609748705,
+ user_alias: 'sp_245',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/profitwell/router/data.ts b/test/integrations/destinations/profitwell/router/data.ts
new file mode 100644
index 0000000000..b308155dae
--- /dev/null
+++ b/test/integrations/destinations/profitwell/router/data.ts
@@ -0,0 +1,99 @@
+export const data = [
+ {
+ name: 'profitwell',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: { Config: { privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62' } },
+ metadata: { jobId: 2, userId: 'u1' },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'identify',
+ userId: 'samual',
+ traits: {
+ email: 'sample@sample.com',
+ planId: '23',
+ planInterval: 'month',
+ planCurrency: 'usd',
+ value: '23',
+ subscriptionAlias: 'samual',
+ status: 'active',
+ },
+ integrations: { All: true },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ destType: 'profitwell',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ body: {
+ XML: {},
+ FORM: {},
+ JSON: {
+ subscription_alias: 'samual',
+ email: 'sample@sample.com',
+ plan_id: '23',
+ plan_interval: 'month',
+ plan_currency: 'usd',
+ status: 'active',
+ value: '23',
+ user_alias: 'samual',
+ effective_date: 1571043797,
+ },
+ JSON_ARRAY: {},
+ },
+ type: 'REST',
+ files: {},
+ method: 'POST',
+ params: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: '9270161a8e5abaa0e56efddfd9dbcb62',
+ },
+ version: '1',
+ endpoint: 'https://api.profitwell.com/v2/subscriptions/',
+ },
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: { Config: { privateApiKey: '9270161a8e5abaa0e56efddfd9dbcb62' } },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/reddit/delivery/data.ts b/test/integrations/destinations/reddit/delivery/data.ts
new file mode 100644
index 0000000000..66c1e2863f
--- /dev/null
+++ b/test/integrations/destinations/reddit/delivery/data.ts
@@ -0,0 +1,174 @@
+export const data = [
+ {
+ name: 'reddit',
+ description: 'Test 0',
+ feature: 'dataDelivery',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'Purchase',
+ },
+ user: {
+ aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a',
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id: '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address: 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 3,
+ products: [
+ {
+ id: '123',
+ name: 'Monopoly',
+ category: 'Games',
+ },
+ {
+ id: '345',
+ name: 'UNO',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: {
+ destResp: {
+ response: {
+ message: 'Successfully processed 1 conversion events.',
+ },
+ status: 200,
+ },
+ message: 'Request Processed Successfully',
+ status: 200,
+ },
+ },
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Test 1',
+ feature: 'dataDelivery',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_gsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'ViewContent',
+ },
+ user: {
+ aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a',
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id: '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address: 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 3,
+ products: [
+ {
+ id: '123',
+ name: 'Monopoly',
+ category: 'Games',
+ },
+ {
+ id: '345',
+ name: 'UNO',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 500,
+ body: {
+ output: {
+ authErrorCategory: 'REFRESH_TOKEN',
+ destinationResponse: {
+ response: 'Authorization Required',
+ status: 401,
+ },
+ message:
+ "Request failed due to Authorization Required 'during reddit response transformation'",
+ statTags: {
+ destType: 'REDDIT',
+ destinationId: 'Non-determininable',
+ errorCategory: 'network',
+ errorType: 'retryable',
+ feature: 'dataDelivery',
+ implementation: 'native',
+ module: 'destination',
+ workspaceId: 'Non-determininable',
+ },
+ status: 500,
+ },
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/reddit/network.ts b/test/integrations/destinations/reddit/network.ts
new file mode 100644
index 0000000000..7c436e8fb8
--- /dev/null
+++ b/test/integrations/destinations/reddit/network.ts
@@ -0,0 +1,100 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ data: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'Purchase',
+ },
+ user: {
+ aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a',
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id: '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address: 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 3,
+ products: [
+ {
+ id: '123',
+ name: 'Monopoly',
+ category: 'Games',
+ },
+ {
+ id: '345',
+ name: 'UNO',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ params: { destination: 'reddit' },
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ },
+ httpRes: {
+ data: {
+ message: 'Successfully processed 1 conversion events.',
+ },
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_gsddXXXfsfd',
+ data: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'ViewContent',
+ },
+ user: {
+ aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a',
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id: '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address: 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 3,
+ products: [
+ {
+ id: '123',
+ name: 'Monopoly',
+ category: 'Games',
+ },
+ {
+ id: '345',
+ name: 'UNO',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ params: { destination: 'reddit' },
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ },
+ httpRes: { data: 'Authorization Required', status: 401, statusText: 'Unauthorized' },
+ },
+];
diff --git a/test/integrations/destinations/reddit/processor/data.ts b/test/integrations/destinations/reddit/processor/data.ts
new file mode 100644
index 0000000000..91da5fbe67
--- /dev/null
+++ b/test/integrations/destinations/reddit/processor/data.ts
@@ -0,0 +1,1532 @@
+export const data = [
+ {
+ name: 'reddit',
+ description: 'Track call with order completed event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ device: {
+ advertisingId: 'asfds7fdsihf734b34j43f',
+ },
+ os: {
+ name: 'android',
+ },
+ },
+ type: 'track',
+ session_id: '16733896350494',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Order Completed',
+ userId: 'testuserId1',
+ properties: {
+ checkout_id: '12345',
+ order_id: '1234',
+ affiliation: 'Apple Store',
+ total: 20,
+ revenue: 15,
+ shipping: 4,
+ tax: 1,
+ discount: 1.5,
+ coupon: 'ImagePro',
+ currency: 'USD',
+ products: [
+ {
+ product_id: '123',
+ sku: 'G-32',
+ name: 'Monopoly',
+ price: 14,
+ quantity: 1,
+ category: 'Games',
+ url: 'https://www.website.com/product/path',
+ image_url: 'https://www.website.com/product/path.jpg',
+ },
+ {
+ product_id: '345',
+ sku: 'F-32',
+ name: 'UNO',
+ price: 3.45,
+ quantity: 2,
+ category: 'Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'Purchase',
+ },
+ user: {
+ aaid: 'c12d34889302d3c656b5699fa9190b51c50d6f62fce57e13bd56b503d66c487a',
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 3,
+ products: [
+ {
+ id: '123',
+ name: 'Monopoly',
+ category: 'Games',
+ },
+ {
+ id: '345',
+ name: 'UNO',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with product list viewed event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Product List Viewed',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: false,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'ViewContent',
+ },
+ user: {
+ email: 'testone@gmail.com',
+ external_id: 'testuserId1',
+ ip_address: '54.100.200.255',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 0,
+ products: [
+ {
+ id: '017c6f5d5cf86a4b22432066',
+ name: 'Just Another Game',
+ category: 'Games and Entertainment',
+ },
+ {
+ id: '89ac6f5d5cf86a4b64eac145',
+ name: 'Wrestling Trump Cards',
+ category: 'Card Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with product added event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'PRoduct Added ',
+ userId: 'testuserId1',
+ properties: {
+ product_id: '622c6f5d5cf86a4c77358033',
+ sku: '8472-998-0112',
+ category: 'Games',
+ name: 'Cones of Dunshire',
+ brand: 'Wyatt Games',
+ variant: 'exapansion pack',
+ price: 49.99,
+ quantity: 5,
+ coupon: 'PREORDER15',
+ position: 1,
+ url: 'https://www.website.com/product/path',
+ image_url: 'https://www.website.com/product/path.webp',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'AddToCart',
+ },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 5,
+ products: [
+ {
+ id: '622c6f5d5cf86a4c77358033',
+ name: 'Cones of Dunshire',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with products searched event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'products searched',
+ userId: 'testuserId1',
+ properties: {
+ product_id: '622c6f5d5cf86a4c77358033',
+ sku: '8472-998-0112',
+ category: 'Games',
+ name: 'Cones of Dunshire',
+ brand: 'Wyatt Games',
+ variant: 'exapansion pack',
+ price: 49.99,
+ quantity: 5,
+ coupon: 'PREORDER15',
+ position: 1,
+ url: 'https://www.website.com/product/path',
+ image_url: 'https://www.website.com/product/path.webp',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'Search',
+ },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 5,
+ products: [
+ {
+ id: '622c6f5d5cf86a4c77358033',
+ name: 'Cones of Dunshire',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with products Searched event mapped in UI',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Products Searched',
+ userId: 'testuserId1',
+ properties: {
+ product_id: '622c6f5d5cf86a4c77358033',
+ sku: '8472-998-0112',
+ category: 'Games',
+ name: 'Cones of Dunshire',
+ brand: 'Wyatt Games',
+ variant: 'exapansion pack',
+ price: 49.99,
+ quantity: 5,
+ coupon: 'PREORDER15',
+ position: 1,
+ url: 'https://www.website.com/product/path',
+ image_url: 'https://www.website.com/product/path.webp',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Products Searched',
+ to: 'ViewContent',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'ViewContent',
+ },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 5,
+ products: [
+ {
+ id: '622c6f5d5cf86a4c77358033',
+ name: 'Cones of Dunshire',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with product added to wishlist event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'product added to wishlist',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ tracking_type: 'AddToWishlist',
+ },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 0,
+ products: [
+ {
+ id: '017c6f5d5cf86a4b22432066',
+ name: 'Just Another Game',
+ category: 'Games and Entertainment',
+ },
+ {
+ id: '89ac6f5d5cf86a4b64eac145',
+ name: 'Wrestling Trump Cards',
+ category: 'Card Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with non-standard non-mapped event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Watch Items',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: {
+ custom_event_name: 'Watch Items',
+ tracking_type: 'Custom',
+ },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 0,
+ products: [
+ {
+ id: '017c6f5d5cf86a4b22432066',
+ name: 'Just Another Game',
+ category: 'Games and Entertainment',
+ },
+ {
+ id: '89ac6f5d5cf86a4b64eac145',
+ name: 'Wrestling Trump Cards',
+ category: 'Card Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with no accountId in Config',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Watch Items',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'Account is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Account is not present. Aborting message.',
+ statusCode: 400,
+ statTags: {
+ destType: 'REDDIT',
+ destinationId: 'destId',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'cdkV2',
+ module: 'destination',
+ workspaceId: 'wspId',
+ },
+ metadata: {
+ destinationId: 'destId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with no messageType',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Watch Items',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'message Type is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message Type is not present. Aborting message.',
+ statusCode: 400,
+ statTags: {
+ destType: 'REDDIT',
+ destinationId: 'destId',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'cdkV2',
+ module: 'destination',
+ workspaceId: 'wspId',
+ },
+ metadata: {
+ destinationId: 'destId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with no event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ type: 'track',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'Event is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Event is not present. Aborting message.',
+ statusCode: 400,
+ statTags: {
+ destType: 'REDDIT',
+ destinationId: 'destId',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'cdkV2',
+ module: 'destination',
+ workspaceId: 'wspId',
+ },
+ metadata: {
+ destinationId: 'destId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with no timestamp',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ anonymousId: '123456',
+ type: 'track',
+ event: 'Watch Items',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'Timestamp is not present. Aborting message.: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: Timestamp is not present. Aborting message.',
+ statusCode: 400,
+ statTags: {
+ destType: 'REDDIT',
+ destinationId: 'destId',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'cdkV2',
+ module: 'destination',
+ workspaceId: 'wspId',
+ },
+ metadata: {
+ destinationId: 'destId',
+ secret: {
+ accessToken: 'dummyAccessToken',
+ },
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track call with no accessToken in secret in metadata',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ traits: {
+ email: 'testone@gmail.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ anonymousId: '123456',
+ type: 'track',
+ event: 'Watch Items',
+ userId: 'testuserId1',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [
+ {
+ from: 'Order Completed',
+ to: 'Purchase',
+ },
+ ],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: {},
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'Secret or accessToken is not present in the metadata: Workflow: procWorkflow, Step: buildResponseForProcessTransformation, ChildStep: undefined, OriginalError: Secret or accessToken is not present in the metadata',
+ statusCode: 500,
+ statTags: {
+ destType: 'REDDIT',
+ destinationId: 'destId',
+ errorCategory: 'platform',
+ errorType: 'oAuthSecret',
+ feature: 'processor',
+ implementation: 'cdkV2',
+ module: 'destination',
+ workspaceId: 'wspId',
+ },
+ metadata: {
+ destinationId: 'destId',
+ secret: {},
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/reddit/router/data.ts b/test/integrations/destinations/reddit/router/data.ts
new file mode 100644
index 0000000000..2f96e27ef7
--- /dev/null
+++ b/test/integrations/destinations/reddit/router/data.ts
@@ -0,0 +1,434 @@
+export const data = [
+ {
+ name: 'reddit',
+ description: 'Track Events',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ context: {
+ traits: { email: 'testone@gmail.com' },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ session_id: '16733896350494',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Order Completed',
+ userId: 'testuserId1',
+ properties: {
+ checkout_id: '12345',
+ order_id: '1234',
+ affiliation: 'Apple Store',
+ total: 20,
+ revenue: 15,
+ shipping: 4,
+ tax: 1,
+ discount: 1.5,
+ coupon: 'ImagePro',
+ currency: 'USD',
+ products: [
+ {
+ product_id: '123',
+ sku: 'G-32',
+ name: 'Monopoly',
+ price: 14,
+ quantity: 1,
+ category: 'Games',
+ url: 'https://www.website.com/product/path',
+ image_url: 'https://www.website.com/product/path.jpg',
+ },
+ {
+ product_id: '345',
+ sku: 'F-32',
+ name: 'UNO',
+ price: 3.45,
+ quantity: 2,
+ category: 'Games',
+ },
+ ],
+ },
+ integrations: { All: true },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [{ from: 'Order Completed', to: 'Purchase' }],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ {
+ message: {
+ context: {
+ traits: { email: 'testone@gmail.com' },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'Product List Viewed',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: { All: true },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [{ from: 'Order Completed', to: 'Purchase' }],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 2,
+ userId: 'u1',
+ },
+ },
+ {
+ message: {
+ context: {
+ traits: { email: 'testone@gmail.com' },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ type: 'track',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ event: 'PRoduct Added ',
+ userId: 'testuserId1',
+ properties: {
+ product_id: '622c6f5d5cf86a4c77358033',
+ sku: '8472-998-0112',
+ category: 'Games',
+ name: 'Cones of Dunshire',
+ brand: 'Wyatt Games',
+ variant: 'exapansion pack',
+ price: 49.99,
+ quantity: 5,
+ coupon: 'PREORDER15',
+ position: 1,
+ url: 'https://www.website.com/product/path',
+ image_url: 'https://www.website.com/product/path.webp',
+ },
+ integrations: { All: true },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [{ from: 'Order Completed', to: 'Purchase' }],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 3,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType: 'reddit',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ body: {
+ JSON: {
+ events: [
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: { tracking_type: 'Purchase' },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 3,
+ products: [
+ { id: '123', name: 'Monopoly', category: 'Games' },
+ { id: '345', name: 'UNO', category: 'Games' },
+ ],
+ },
+ },
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: { tracking_type: 'ViewContent' },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 0,
+ products: [
+ {
+ id: '017c6f5d5cf86a4b22432066',
+ name: 'Just Another Game',
+ category: 'Games and Entertainment',
+ },
+ {
+ id: '89ac6f5d5cf86a4b64eac145',
+ name: 'Wrestling Trump Cards',
+ category: 'Card Games',
+ },
+ ],
+ },
+ },
+ {
+ event_at: '2019-10-14T09:03:17.562Z',
+ event_type: { tracking_type: 'AddToCart' },
+ user: {
+ email: 'ac144532d9e4efeab19475d9253a879173ea12a3d2238d1cb8a332a7b3a105f2',
+ external_id:
+ '7b023241a3132b792a5a33915a5afb3133cbb1e13d72879689bf6504de3b036d',
+ ip_address:
+ 'e80bd55a3834b7c2a34ade23c7ecb54d2a49838227080f50716151e765a619db',
+ user_agent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ screen_dimensions: {},
+ },
+ event_metadata: {
+ item_count: 5,
+ products: [
+ {
+ id: '622c6f5d5cf86a4c77358033',
+ name: 'Cones of Dunshire',
+ category: 'Games',
+ },
+ ],
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://ads-api.reddit.com/api/v2.0/conversions/events/a2_fsddXXXfsfd',
+ headers: {
+ Authorization: 'Bearer dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: [
+ {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 1,
+ userId: 'u1',
+ },
+ {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 2,
+ userId: 'u1',
+ },
+ {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 3,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ hashData: true,
+ eventsMapping: [{ from: 'Order Completed', to: 'Purchase' }],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: 'reddit',
+ description: 'Track Events with no event name',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ context: {
+ traits: { email: 'testone@gmail.com' },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ ip: '54.100.200.255',
+ },
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ type: 'track',
+ userId: 'testuserId1',
+ properties: {
+ list_id: 'list1',
+ category: "What's New",
+ products: [
+ {
+ product_id: '017c6f5d5cf86a4b22432066',
+ sku: '8732-98',
+ name: 'Just Another Game',
+ price: 22,
+ position: 2,
+ category: 'Games and Entertainment',
+ url: 'https://www.myecommercewebsite.com/product',
+ image_url: 'https://www.myecommercewebsite.com/product/path.jpg',
+ },
+ {
+ product_id: '89ac6f5d5cf86a4b64eac145',
+ sku: '1267-01',
+ name: 'Wrestling Trump Cards',
+ price: 4,
+ position: 21,
+ category: 'Card Games',
+ },
+ ],
+ },
+ integrations: { All: true },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ eventsMapping: [{ from: 'Order Completed', to: 'Purchase' }],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType: 'reddit',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ metadata: [
+ {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ secret: { accessToken: 'dummyAccessToken' },
+ jobId: 1,
+ userId: 'u1',
+ },
+ ],
+ destination: {
+ Config: {
+ accountId: 'a2_fsddXXXfsfd',
+ eventsMapping: [{ from: 'Order Completed', to: 'Purchase' }],
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+ },
+ batched: false,
+ statusCode: 400,
+ error: 'Event is not present. Aborting message.',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'REDDIT',
+ module: 'destination',
+ implementation: 'cdkV2',
+ feature: 'router',
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/refiner/router/data.ts b/test/integrations/destinations/refiner/router/data.ts
index bea4d3ddcc..0ff75120d6 100644
--- a/test/integrations/destinations/refiner/router/data.ts
+++ b/test/integrations/destinations/refiner/router/data.ts
@@ -21,10 +21,7 @@ export const data = [
city: 'Banglore',
email: 'test@user.com',
phone: '7267286346802347827',
- address: {
- city: 'ahmedabad',
- state: 'india',
- },
+ address: { city: 'ahmedabad', state: 'india' },
lastName: 'user',
username: 'testUser',
firstName: 'test',
@@ -38,9 +35,7 @@ export const data = [
request_ip: '[::1]',
originalTimestamp: '2022-10-11T13:10:54.877+05:30',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
Config: {
apiKey: 'dummyApiKey',
@@ -75,10 +70,7 @@ export const data = [
firstName: 'test',
lastName: 'user',
phone: '7267286346802347827',
- userAddress: {
- city: 'ahmedabad',
- state: 'india',
- },
+ userAddress: { city: 'ahmedabad', state: 'india' },
userCountry: 'india',
userId: 'user@45',
username: 'testUser',
@@ -109,7 +101,7 @@ export const data = [
whitelistedEvents: [{ eventName: '' }],
},
},
- metadata: [{ jobId: 1 }],
+ metadata: [{ jobId: 1, userId: 'u1' }],
statusCode: 200,
},
],
@@ -161,10 +153,7 @@ export const data = [
firstName: 'test',
userCountry: 'india',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.2',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.2' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36',
},
@@ -176,30 +165,16 @@ export const data = [
currency: 'IND',
order_id: '5241735',
products: [
- {
- id: 'product-bacon-jam',
- category: 'Merch',
- brand: '',
- },
- {
- id: 'product-t-shirt',
- category: 'Merch',
- brand: 'Levis',
- },
- {
- id: 'offer-t-shirt',
- category: 'Merch',
- brand: 'Levis',
- },
+ { id: 'product-bacon-jam', category: 'Merch', brand: '' },
+ { id: 'product-t-shirt', category: 'Merch', brand: 'Levis' },
+ { id: 'offer-t-shirt', category: 'Merch', brand: 'Levis' },
],
},
receivedAt: '2022-10-11T13:38:29.178+05:30',
request_ip: '[::1]',
originalTimestamp: '2022-10-11T13:38:31.827+05:30',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
apiKey: 'dummyApiKey',
@@ -227,11 +202,7 @@ export const data = [
batched: false,
batchedRequest: {
body: {
- FORM: {
- email: 'test@user.com',
- event: 'Product Searched',
- id: 'user@45',
- },
+ FORM: { email: 'test@user.com', event: 'Product Searched', id: 'user@45' },
JSON: {},
JSON_ARRAY: {},
XML: {},
@@ -258,7 +229,7 @@ export const data = [
whitelistedEvents: [{ eventName: '' }],
},
},
- metadata: [{ jobId: 2 }],
+ metadata: [{ jobId: 2, userId: 'u1' }],
statusCode: 200,
},
],
@@ -280,10 +251,7 @@ export const data = [
message: {
type: 'group',
sentAt: '2015-02-23T22:28:55.111Z',
- traits: {
- name: 'rudder ventures',
- email: 'business@rudderstack.com',
- },
+ traits: { name: 'rudder ventures', email: 'business@rudderstack.com' },
userId: 'test@12',
channel: 'browser',
context: {
@@ -297,9 +265,7 @@ export const data = [
integrations: { All: true },
originalTimestamp: '2022-10-11T13:51:00.906+05:30',
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
destination: {
Config: {
accountAttributesMapping: [{ from: 'email', to: 'businessEmail' }],
@@ -361,7 +327,7 @@ export const data = [
whitelistedEvents: [{ eventName: '' }],
},
},
- metadata: [{ jobId: 3 }],
+ metadata: [{ jobId: 3, userId: 'u1' }],
statusCode: 200,
},
],
diff --git a/test/integrations/destinations/revenue_cat/processor/data.ts b/test/integrations/destinations/revenue_cat/processor/data.ts
index 45ff5d8499..4ebfe2f8a5 100644
--- a/test/integrations/destinations/revenue_cat/processor/data.ts
+++ b/test/integrations/destinations/revenue_cat/processor/data.ts
@@ -1076,4 +1076,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/rockerbox/processor/data.ts b/test/integrations/destinations/rockerbox/processor/data.ts
index ff8f6d4620..efb74d2e6e 100644
--- a/test/integrations/destinations/rockerbox/processor/data.ts
+++ b/test/integrations/destinations/rockerbox/processor/data.ts
@@ -746,4 +746,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/rockerbox/router/data.ts b/test/integrations/destinations/rockerbox/router/data.ts
index caa8f1ba08..af943d7e6b 100644
--- a/test/integrations/destinations/rockerbox/router/data.ts
+++ b/test/integrations/destinations/rockerbox/router/data.ts
@@ -14,46 +14,19 @@ export const data = [
Config: {
advertiserId: 'test id',
eventFilteringOption: 'disable',
- whitelistedEvents: [
- {
- eventName: '',
- },
- ],
- blacklistedEvents: [
- {
- eventName: '',
- },
- ],
- eventsMap: [
- {
- from: 'Product Added',
- to: 'conv.add_to_cart',
- },
- ],
- useNativeSDK: {
- web: false,
- },
- clientAuthId: {
- web: 'test-client-auth-id',
- },
+ whitelistedEvents: [{ eventName: '' }],
+ blacklistedEvents: [{ eventName: '' }],
+ eventsMap: [{ from: 'Product Added', to: 'conv.add_to_cart' }],
+ useNativeSDK: { web: false },
+ clientAuthId: { web: 'test-client-auth-id' },
oneTrustCookieCategories: {
- web: [
- {
- oneTrustCookieCategory: 'Marketing Sample',
- },
- ],
- },
- customDomain: {
- web: 'https://cookiedomain.com',
- },
- enableCookieSync: {
- web: true,
+ web: [{ oneTrustCookieCategory: 'Marketing Sample' }],
},
+ customDomain: { web: 'https://cookiedomain.com' },
+ enableCookieSync: { web: true },
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
type: 'track',
event: 'Product Added',
@@ -61,10 +34,7 @@ export const data = [
userId: 'userSampleX138',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
locale: 'en-IN',
traits: {
email: 'userSampleX120@gmail.com',
@@ -84,9 +54,7 @@ export const data = [
product_name: 'Red T-shirt',
},
anonymousId: '5f093403-1457-4a2c-b4e4-c61ec3bacf56',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2022-08-07T20:02:19.347Z',
},
writeKey: '2D0yaayoBD7bp8uFomnBONdedcA',
@@ -147,7 +115,7 @@ export const data = [
whitelistedEvents: [{ eventName: '' }],
},
},
- metadata: [{ jobId: 1 }],
+ metadata: [{ jobId: 1, userId: 'u1' }],
statusCode: 200,
},
],
@@ -170,46 +138,19 @@ export const data = [
Config: {
advertiserId: 'test id',
eventFilteringOption: 'disable',
- whitelistedEvents: [
- {
- eventName: '',
- },
- ],
- blacklistedEvents: [
- {
- eventName: '',
- },
- ],
- eventsMap: [
- {
- from: 'Product Viewed',
- to: 'conv.add_to_cart',
- },
- ],
- useNativeSDK: {
- web: false,
- },
- clientAuthId: {
- web: 'test-client-auth-id',
- },
+ whitelistedEvents: [{ eventName: '' }],
+ blacklistedEvents: [{ eventName: '' }],
+ eventsMap: [{ from: 'Product Viewed', to: 'conv.add_to_cart' }],
+ useNativeSDK: { web: false },
+ clientAuthId: { web: 'test-client-auth-id' },
oneTrustCookieCategories: {
- web: [
- {
- oneTrustCookieCategory: 'Marketing Sample',
- },
- ],
- },
- customDomain: {
- web: 'https://cookiedomain.com',
- },
- enableCookieSync: {
- web: true,
+ web: [{ oneTrustCookieCategory: 'Marketing Sample' }],
},
+ customDomain: { web: 'https://cookiedomain.com' },
+ enableCookieSync: { web: true },
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
type: 'track',
event: 'Product Viewed',
@@ -217,10 +158,7 @@ export const data = [
userId: 'userSampleX138',
channel: 'web',
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
locale: 'en-IN',
traits: {
email: 'userSampleX120@gmail.com',
@@ -240,9 +178,7 @@ export const data = [
product_name: 'Red T-shirt',
},
anonymousId: '5f093403-1457-4a2c-b4e4-c61ec3bacf56',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2022-08-07T20:02:19.347Z',
},
writeKey: '2D0yaayoBD7bp8uFomnBONdedcA',
@@ -303,7 +239,7 @@ export const data = [
whitelistedEvents: [{ eventName: '' }],
},
},
- metadata: [{ jobId: 2 }],
+ metadata: [{ jobId: 2, userId: 'u1' }],
statusCode: 200,
},
],
diff --git a/test/integrations/destinations/salesforce/dataDelivery/data.ts b/test/integrations/destinations/salesforce/dataDelivery/data.ts
index c53ce58f9e..2f1e04815b 100644
--- a/test/integrations/destinations/salesforce/dataDelivery/data.ts
+++ b/test/integrations/destinations/salesforce/dataDelivery/data.ts
@@ -119,7 +119,6 @@ export const data = [
body: {
output: {
status: 500,
- authErrorCategory: 'REFRESH_TOKEN',
message:
'Salesforce Request Failed - due to "INVALID_SESSION_ID", (Retryable) during Salesforce Response Handling',
destinationResponse: {
diff --git a/test/integrations/destinations/salesforce/router/data.ts b/test/integrations/destinations/salesforce/router/data.ts
index 8c36d3a785..4a37f7ed40 100644
--- a/test/integrations/destinations/salesforce/router/data.ts
+++ b/test/integrations/destinations/salesforce/router/data.ts
@@ -1,10 +1,8 @@
-import { FEATURES } from '../../../../../src/v0/util/tags';
-
export const data = [
{
name: 'salesforce',
description: 'Test 0',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -23,18 +21,10 @@ export const data = [
version: '1.0.0',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
locale: 'en-US',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {
anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76',
company: 'Initech',
@@ -54,9 +44,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8',
originalTimestamp: '2020-01-27T12:20:55.301Z',
receivedAt: '2020-01-27T17:50:58.657+05:30',
@@ -66,9 +54,7 @@ export const data = [
type: 'identify',
userId: '1e7673da-9473-49c6-97f7-da848ecafa76',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
Config: {
initialAccessToken: 'dummyInitialAccessToken',
@@ -133,12 +119,7 @@ export const data = [
},
],
metadata: [
- {
- destInfo: {
- authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y',
- },
- jobId: 1,
- },
+ { destInfo: { authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y' }, jobId: 1, userId: 'u1' },
],
batched: false,
statusCode: 200,
@@ -167,7 +148,7 @@ export const data = [
{
name: 'salesforce',
description: 'Test 1',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -186,18 +167,10 @@ export const data = [
version: '1.0.0',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
locale: 'en-US',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
traits: {
anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76',
company: 'Initech',
@@ -217,9 +190,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'f19c35da-e9de-4c6e-b6e5-9e60cccc12c8',
originalTimestamp: '2020-01-27T12:20:55.301Z',
receivedAt: '2020-01-27T17:50:58.657+05:30',
@@ -229,9 +200,7 @@ export const data = [
type: 'identify',
userId: '1e7673da-9473-49c6-97f7-da848ecafa76',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
initialAccessToken: 'dummyInitialAccessToken',
@@ -297,12 +266,7 @@ export const data = [
},
],
metadata: [
- {
- destInfo: {
- authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y',
- },
- jobId: 2,
- },
+ { destInfo: { authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y' }, jobId: 2, userId: 'u1' },
],
batched: false,
statusCode: 200,
@@ -331,7 +295,7 @@ export const data = [
{
name: 'salesforce',
description: 'Test 2',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -350,24 +314,14 @@ export const data = [
version: '1.0.0',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
locale: 'en-US',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
traits: {
anonymousId: '1e7673da-9473-49c6-97f7-da848ecafa76',
company: 'Initech',
@@ -393,9 +347,7 @@ export const data = [
type: 'identify',
userId: '1e7673da-9473-49c6-97f7-da848ecafa76',
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
destination: {
Config: {
initialAccessToken: 'dummyInitialAccessToken',
@@ -460,12 +412,7 @@ export const data = [
},
],
metadata: [
- {
- destInfo: {
- authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y',
- },
- jobId: 3,
- },
+ { destInfo: { authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y' }, jobId: 3, userId: 'u1' },
],
batched: false,
statusCode: 200,
@@ -494,7 +441,7 @@ export const data = [
{
name: 'salesforce',
description: 'Test 3',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -535,9 +482,7 @@ export const data = [
files: {},
statusCode: 200,
},
- metadata: {
- jobId: 4,
- },
+ metadata: { jobId: 4, userId: 'u1' },
destination: {
Config: {
initialAccessToken: 'dummyInitialAccessToken',
@@ -601,12 +546,7 @@ export const data = [
statusCode: 200,
},
metadata: [
- {
- destInfo: {
- authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y',
- },
- jobId: 4,
- },
+ { destInfo: { authKey: '1WqFFH5esuVPnUgHkvEoYxDcX3y' }, jobId: 4, userId: 'u1' },
],
batched: false,
statusCode: 200,
diff --git a/test/integrations/destinations/segment/processor/data.ts b/test/integrations/destinations/segment/processor/data.ts
index 0a140e2b99..b2b8c679a5 100644
--- a/test/integrations/destinations/segment/processor/data.ts
+++ b/test/integrations/destinations/segment/processor/data.ts
@@ -667,4 +667,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/sendgrid/network.ts b/test/integrations/destinations/sendgrid/network.ts
index 18a8a8d34d..29cfbf8446 100644
--- a/test/integrations/destinations/sendgrid/network.ts
+++ b/test/integrations/destinations/sendgrid/network.ts
@@ -106,5 +106,165 @@ const deleteNwData = [
},
},
},
+ {
+ httpReq: {
+ method: 'get',
+ url: 'https://api.sendgrid.com/v3/marketing/field_definitions',
+ headers: {
+ Authorization: 'Bearer apikey',
+ 'Content-Type': 'application/json',
+ },
+ },
+ httpRes: {
+ status: 200,
+ statusText: 'OK',
+ data: {
+ custom_fields: [
+ {
+ id: 'w1_T',
+ name: 'user_name',
+ field_type: 'Text',
+ _metadata: {
+ self: 'https://api.sendgrid.com/v3/marketing/field_definitions/w1_T',
+ },
+ },
+ ],
+ reserved_fields: [
+ {
+ id: '_rf0_T',
+ name: 'first_name',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf1_T',
+ name: 'last_name',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf2_T',
+ name: 'email',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf3_T',
+ name: 'alternate_emails',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf4_T',
+ name: 'address_line_1',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf5_T',
+ name: 'address_line_2',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf6_T',
+ name: 'city',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf7_T',
+ name: 'state_province_region',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf8_T',
+ name: 'postal_code',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf9_T',
+ name: 'country',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf10_T',
+ name: 'phone_number',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf11_T',
+ name: 'whatsapp',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf12_T',
+ name: 'line',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf13_T',
+ name: 'facebook',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf14_T',
+ name: 'unique_name',
+ field_type: 'Text',
+ },
+ {
+ id: '_rf15_T',
+ name: 'email_domains',
+ field_type: 'Text',
+ read_only: true,
+ },
+ {
+ id: '_rf16_D',
+ name: 'last_clicked',
+ field_type: 'Date',
+ read_only: true,
+ },
+ {
+ id: '_rf17_D',
+ name: 'last_opened',
+ field_type: 'Date',
+ read_only: true,
+ },
+ {
+ id: '_rf18_D',
+ name: 'last_emailed',
+ field_type: 'Date',
+ read_only: true,
+ },
+ {
+ id: '_rf19_T',
+ name: 'singlesend_id',
+ field_type: 'Text',
+ read_only: true,
+ },
+ {
+ id: '_rf20_T',
+ name: 'automation_id',
+ field_type: 'Text',
+ read_only: true,
+ },
+ {
+ id: '_rf21_D',
+ name: 'created_at',
+ field_type: 'Date',
+ read_only: true,
+ },
+ {
+ id: '_rf22_D',
+ name: 'updated_at',
+ field_type: 'Date',
+ read_only: true,
+ },
+ {
+ id: '_rf23_T',
+ name: 'contact_id',
+ field_type: 'Text',
+ read_only: true,
+ },
+ ],
+ _metadata: {
+ self: 'https://api.sendgrid.com/v3/marketing/field_definitions',
+ },
+ },
+ },
+ },
];
export const networkCallsData = [...deleteNwData];
diff --git a/test/integrations/destinations/sendgrid/processor/data.ts b/test/integrations/destinations/sendgrid/processor/data.ts
new file mode 100644
index 0000000000..b1550787b5
--- /dev/null
+++ b/test/integrations/destinations/sendgrid/processor/data.ts
@@ -0,0 +1,1544 @@
+export const data = [
+ {
+ name: 'sendgrid',
+ description: 'Identify call without an email',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [
+ {
+ event: 'open',
+ },
+ ],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [
+ {
+ groupId: '',
+ },
+ ],
+ html: '',
+ listId: 'list111',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ type: 'identify',
+ userId: 'user@1',
+ context: {
+ traits: {
+ age: '25',
+ city: 'Surat',
+ phone: '+91 9876543210',
+ lastName: 'test',
+ firstName: 'rudder',
+ state: 'Gujarat',
+ },
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Parameter mail is required',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SENDGRID',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Identify call with list_id configured from web-app',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [
+ {
+ event: 'open',
+ },
+ ],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [
+ {
+ groupId: '',
+ },
+ ],
+ html: '',
+ listId: 'list111',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ type: 'identify',
+ userId: 'user@1',
+ context: {
+ traits: {
+ age: '25',
+ city: 'Surat',
+ email: 'test@rudderstack.com',
+ phone: '+91 9876543210',
+ lastName: 'test',
+ firstName: 'rudder',
+ state: 'Gujarat',
+ },
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ contactDetails: {
+ email: 'test@rudderstack.com',
+ phone_number: '+91 9876543210',
+ first_name: 'rudder',
+ last_name: 'test',
+ custom_fields: {},
+ },
+ contactListIds: 'list111',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Identify call with no list-id given',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [
+ {
+ from: 'name',
+ to: 'user_name',
+ },
+ ],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [
+ {
+ event: 'open',
+ },
+ ],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [
+ {
+ groupId: '',
+ },
+ ],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ type: 'identify',
+ userId: 'user@1',
+ context: {
+ traits: {
+ age: '25',
+ city: 'Surat',
+ name: 'rudder test',
+ email: 'test@rudderstack.com',
+ phone: '+91 9876543210',
+ lastName: 'test',
+ firstName: 'rudder',
+ state: 'Gujarat',
+ },
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ XML: {},
+ FORM: {},
+ JSON: {
+ contactDetails: {
+ email: 'test@rudderstack.com',
+ last_name: 'test',
+ first_name: 'rudder',
+ unique_name: 'rudder test',
+ phone_number: '+91 9876543210',
+ custom_fields: {
+ w1_T: 'rudder test',
+ },
+ },
+ contactListIds: '',
+ },
+ JSON_ARRAY: {},
+ },
+ type: 'REST',
+ userId: '',
+ files: {},
+ method: 'PUT',
+ params: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ version: '1',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Track Call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [
+ {
+ event: 'testing',
+ },
+ {
+ event: 'clicked',
+ },
+ ],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ text: null,
+ utmContent: null,
+ },
+ },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'testing',
+ properties: {
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ {
+ name: 'hello',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.sendgrid.com/v3/mail/send',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ content: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ subject: 'A sample subject',
+ reply_to: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Track Call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [
+ {
+ event: 'testing',
+ },
+ {
+ event: 'clicked',
+ },
+ ],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ footerText: 'some text',
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ },
+ },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'testing',
+ properties: {
+ replyTo: {
+ email: 'testing@gmail.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ {
+ name: 'hello',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.sendgrid.com/v3/mail/send',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ reply_to: {
+ email: 'testing@gmail.com',
+ },
+ content: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ subject: 'A sample subject',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Track Call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [
+ {
+ event: 'testing',
+ },
+ {
+ event: 'clicked',
+ },
+ ],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ footerText: 'some text',
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ group: '12345',
+ groupsToDisplay: [
+ {
+ groupId: '12345',
+ },
+ {
+ groupId: 'abc',
+ },
+ {
+ groupId: '12346',
+ },
+ ],
+ },
+ },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'testing',
+ properties: {
+ replyTo: {
+ email: 'testing@gmail.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ {
+ name: 'hello',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.sendgrid.com/v3/mail/send',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ reply_to: {
+ email: 'testing@gmail.com',
+ },
+ content: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ subject: 'A sample subject',
+ asm: {
+ group_id: 12345,
+ groups_to_display: [12345, 12346],
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Track call without an event name',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [
+ {
+ event: 'testing',
+ },
+ {
+ event: 'clicked',
+ },
+ ],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ footerText: 'some text',
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ group: '12345',
+ groupsToDisplay: [
+ {
+ groupId: '12345',
+ },
+ {
+ groupId: 'abc',
+ },
+ {
+ groupId: '12346',
+ },
+ ],
+ },
+ },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'new event',
+ properties: {
+ replyTo: {
+ email: 'testing@gmail.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ {
+ name: 'hello',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Event not configured on dashboard',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'SENDGRID',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Track Call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [
+ {
+ event: 'testing',
+ },
+ {
+ event: 'clicked',
+ },
+ ],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ footerText: 'some text',
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ group: '12345',
+ groupsToDisplay: [
+ {
+ groupId: '12345',
+ },
+ {
+ groupId: 'abc',
+ },
+ {
+ groupId: '12346',
+ },
+ ],
+ attachments: [
+ {
+ content: 'YXNkZ2FmZ3FlcmRxZ2Iua2puYWRrbGpuYWtqc2Rmbg==',
+ filename: 'index.html',
+ },
+ ],
+ },
+ },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'testing',
+ properties: {
+ replyTo: {
+ email: 'testing@gmail.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ {
+ name: 'hello',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.sendgrid.com/v3/mail/send',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ reply_to: {
+ email: 'testing@gmail.com',
+ },
+ attachments: [
+ {
+ content: 'YXNkZ2FmZ3FlcmRxZ2Iua2puYWRrbGpuYWtqc2Rmbg==',
+ filename: 'index.html',
+ },
+ ],
+ content: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ subject: 'A sample subject',
+ asm: {
+ group_id: 12345,
+ groups_to_display: [12345, 12346],
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Track Call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [
+ {
+ event: 'testing',
+ },
+ {
+ event: 'clicked',
+ },
+ ],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ footerText: 'some text',
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ group: '12345',
+ groupsToDisplay: [
+ {
+ groupId: '12345',
+ },
+ {
+ groupId: 'abc',
+ },
+ {
+ groupId: '12346',
+ },
+ ],
+ attachments: [
+ {
+ content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=',
+ filename: 'index.html',
+ },
+ {
+ content: 'bGFqa3NtZGZrZ2hxaWVybmtsYSBmZGtvamx3bWVGTC5NQW5kcy5rbmtmYWtkZg==',
+ },
+ ],
+ },
+ },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'testing',
+ properties: {
+ replyTo: {
+ email: 'testing@gmail.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ {
+ name: 'hello',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.sendgrid.com/v3/mail/send',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ reply_to: {
+ email: 'testing@gmail.com',
+ },
+ attachments: [
+ {
+ content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=',
+ filename: 'index.html',
+ },
+ ],
+ content: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ subject: 'A sample subject',
+ asm: {
+ group_id: 12345,
+ groups_to_display: [12345, 12346],
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Track Call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [
+ {
+ event: 'testing',
+ },
+ {
+ event: 'clicked',
+ },
+ ],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ footerText: 'some text',
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ group: '12345',
+ groupsToDisplay: [
+ {
+ groupId: '12345',
+ },
+ {
+ groupId: 'abc',
+ },
+ {
+ groupId: '12346',
+ },
+ ],
+ attachments: [
+ {
+ content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=',
+ filename: 'index.html',
+ },
+ {
+ content: 'bGFqa3NtZGZrZ2hxaWVybmtsYSBmZGtvamx3bWVGTC5NQW5kcy5rbmtmYWtkZg==',
+ },
+ ],
+ },
+ },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'testing',
+ properties: {
+ replyTo: {
+ email: 'testing@gmail.com',
+ },
+ mailSettings: {
+ bypassListManagement: true,
+ footer: true,
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ {
+ name: 'hello',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://api.sendgrid.com/v3/mail/send',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ from: {
+ email: 'ankit@rudderstack.com',
+ },
+ personalizations: [
+ {
+ to: [
+ {
+ email: 'a@g.com',
+ },
+ ],
+ subject: 'hey there',
+ },
+ ],
+ reply_to: {
+ email: 'testing@gmail.com',
+ },
+ attachments: [
+ {
+ content: 'YXNkZ21hcyxkLm1mO29xd2llbGpmbWwuYWRrbXMuLGFtZHM=',
+ filename: 'index.html',
+ },
+ ],
+ content: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ subject: 'A sample subject',
+ asm: {
+ group_id: 12345,
+ groups_to_display: [12345, 12346],
+ },
+ mail_settings: {
+ bypass_list_management: {
+ enable: true,
+ },
+ footer: {
+ enable: true,
+ text: 'some text',
+ },
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/sendgrid/router/data.ts b/test/integrations/destinations/sendgrid/router/data.ts
new file mode 100644
index 0000000000..e9ef671226
--- /dev/null
+++ b/test/integrations/destinations/sendgrid/router/data.ts
@@ -0,0 +1,1110 @@
+export const data = [
+ {
+ name: 'sendgrid',
+ description: 'Router Test Case',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ },
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ type: 'track',
+ event: 'testing',
+ properties: {
+ personalizations: [
+ { to: [{ email: 'a@g.com' }, { name: 'hello' }], subject: 'hey there' },
+ ],
+ from: { email: 'ankit@rudderstack.com' },
+ },
+ integrations: { All: true },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ },
+ ],
+ destType: 'sendgrid',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ body: {
+ XML: {},
+ FORM: {},
+ JSON_ARRAY: {},
+ JSON: {
+ personalizations: [{ to: [{ email: 'a@g.com' }], subject: 'hey there' }],
+ from: { email: 'ankit@rudderstack.com' },
+ reply_to: { email: 'ankit@rudderstack.com' },
+ subject: 'A sample subject',
+ content: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ },
+ },
+ type: 'REST',
+ files: {},
+ method: 'POST',
+ params: {},
+ headers: { Authorization: 'Bearer apikey', 'Content-Type': 'application/json' },
+ version: '1',
+ endpoint: 'https://api.sendgrid.com/v3/mail/send',
+ },
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ apiKey: 'apikey',
+ eventNamesSettings: [{ event: 'testing' }, { event: 'clicked' }],
+ subject: 'A sample subject',
+ replyToEmail: 'ankit@rudderstack.com',
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ footer: false,
+ bypassListManagement: false,
+ sandboxMode: false,
+ clickTracking: false,
+ openTracking: false,
+ ganalytics: false,
+ subscriptionTracking: false,
+ clickTrackingEnableText: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: 'sendgrid',
+ description: 'Identify call batching with multiple listIds',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ userId: 'user@3',
+ type: 'identify',
+ context: {
+ traits: {
+ age: '30',
+ email: 'user3@rudderlabs.com',
+ phone: '+91 9876543210',
+ city: 'Ahmedabad',
+ state: 'Gujarat',
+ lastName: 'gupta',
+ firstName: 'aman',
+ name: 'aman gupta',
+ },
+ externalId: [
+ {
+ type: 'listIds',
+ id: ['476b736e-24a4-4089-8392-66a6bf6aa14d'],
+ },
+ ],
+ },
+ },
+ metadata: {
+ jobId: 1,
+ },
+ },
+ {
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ userId: 'user@4',
+ type: 'identify',
+ context: {
+ traits: {
+ email: 'user4@rudderlabs.com',
+ phone: '+91 9876543210',
+ userId: 'sajal',
+ city: 'Bombey',
+ state: 'Maharastra',
+ lastName: 'gupta',
+ username: 'suresh gupta',
+ firstName: 'suresh',
+ },
+ externalId: [
+ {
+ type: 'listIds',
+ id: '737ae8d4-25b4-496e-adff-2fded15fd0c6',
+ },
+ ],
+ },
+ },
+ metadata: {
+ jobId: 2,
+ },
+ },
+ {
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ userId: 'user@5',
+ type: 'identify',
+ context: {
+ traits: {
+ email: 'user5@rudderlabs.com',
+ phone: '+91 9876543210',
+ city: 'Banglore',
+ lastName: 'bhatt',
+ username: 'kiran bhatt',
+ firstName: 'kiran',
+ },
+ externalId: [
+ {
+ type: 'listIds',
+ id: [
+ '737ae8d4-25b4-496e-adff-2fded15fd0c6',
+ 'a4ac8a69-d8cb-4cf1-9d85-3d60e4007ab1',
+ ],
+ },
+ ],
+ },
+ },
+ metadata: {
+ jobId: 3,
+ },
+ },
+ {
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ userId: 'user@6',
+ type: 'identify',
+ context: {
+ traits: {
+ email: 'user6@rudderlabs.com',
+ phone: '+91 9876543210',
+ city: 'Los Angeles',
+ lastName: 'doe',
+ name: 'john doe',
+ state: 'California',
+ firstName: 'john',
+ },
+ externalId: [
+ {
+ type: 'listIds',
+ id: [
+ 'bc9b7ff4-f1d4-4c7c-b9a8-3051107c8d1e',
+ 'cb7f13a1-b77b-4fb3-8440-56f6524716d3',
+ ],
+ },
+ ],
+ },
+ },
+ metadata: {
+ jobId: 4,
+ },
+ },
+ {
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ userId: 'user@7',
+ type: 'identify',
+ context: {
+ traits: {
+ email: 'user7@rudderlabs.com',
+ phone: '+91 9876543210',
+ city: 'Chicago',
+ lastName: 'patel',
+ name: 'reshma patel',
+ state: 'Illinois',
+ firstName: 'reshma',
+ },
+ },
+ },
+ metadata: {
+ jobId: 5,
+ },
+ },
+ {
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ message: {
+ userId: 'user@8',
+ type: 'identify',
+ context: {
+ traits: {
+ email: 'user8@rudderlabs.com',
+ phone: '+91 9876543210',
+ city: 'Chicago',
+ lastName: 'patel',
+ name: 'karishma patel',
+ state: 'Illinois',
+ firstName: 'karishma',
+ },
+ externalId: [
+ {
+ type: 'listIds',
+ id: [
+ '737ae8d4-25b4-496e-adff-2fded15fd0c6',
+ 'a4ac8a69-d8cb-4cf1-9d85-3d60e4007ab1',
+ 'bc9b7ff4-f1d4-4c7c-b9a8-3051107c8d1e',
+ 'cb7f13a1-b77b-4fb3-8440-56f6524716d3',
+ ],
+ },
+ ],
+ },
+ },
+ metadata: {
+ jobId: 6,
+ },
+ },
+ ],
+ destType: 'sendgrid',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ list_ids: ['476b736e-24a4-4089-8392-66a6bf6aa14d'],
+ contacts: [
+ {
+ email: 'user3@rudderlabs.com',
+ phone_number: '+91 9876543210',
+ first_name: 'aman',
+ last_name: 'gupta',
+ unique_name: 'aman gupta',
+ custom_fields: { w1_T: 'aman gupta' },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 1 }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ list_ids: ['737ae8d4-25b4-496e-adff-2fded15fd0c6'],
+ contacts: [
+ {
+ email: 'user4@rudderlabs.com',
+ phone_number: '+91 9876543210',
+ first_name: 'suresh',
+ last_name: 'gupta',
+ custom_fields: {},
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 2 }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ list_ids: [
+ '737ae8d4-25b4-496e-adff-2fded15fd0c6',
+ 'a4ac8a69-d8cb-4cf1-9d85-3d60e4007ab1',
+ ],
+ contacts: [
+ {
+ email: 'user5@rudderlabs.com',
+ phone_number: '+91 9876543210',
+ first_name: 'kiran',
+ last_name: 'bhatt',
+ custom_fields: {},
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 3 }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ list_ids: [
+ 'bc9b7ff4-f1d4-4c7c-b9a8-3051107c8d1e',
+ 'cb7f13a1-b77b-4fb3-8440-56f6524716d3',
+ ],
+ contacts: [
+ {
+ email: 'user6@rudderlabs.com',
+ phone_number: '+91 9876543210',
+ first_name: 'john',
+ last_name: 'doe',
+ unique_name: 'john doe',
+ custom_fields: { w1_T: 'john doe' },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 4 }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ contacts: [
+ {
+ email: 'user7@rudderlabs.com',
+ phone_number: '+91 9876543210',
+ first_name: 'reshma',
+ last_name: 'patel',
+ unique_name: 'reshma patel',
+ custom_fields: { w1_T: 'reshma patel' },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 5 }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint: 'https://api.sendgrid.com/v3/marketing/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer apikey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ list_ids: [
+ '737ae8d4-25b4-496e-adff-2fded15fd0c6',
+ 'a4ac8a69-d8cb-4cf1-9d85-3d60e4007ab1',
+ 'bc9b7ff4-f1d4-4c7c-b9a8-3051107c8d1e',
+ 'cb7f13a1-b77b-4fb3-8440-56f6524716d3',
+ ],
+ contacts: [
+ {
+ email: 'user8@rudderlabs.com',
+ phone_number: '+91 9876543210',
+ first_name: 'karishma',
+ last_name: 'patel',
+ unique_name: 'karishma patel',
+ custom_fields: { w1_T: 'karishma patel' },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [{ jobId: 6 }],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ ID: '2HOQOO6wWKaKjeQrEABXgiH6cmU',
+ Config: {
+ IPPoolName: '',
+ apiKey: 'apikey',
+ attachments: [
+ {
+ content: '',
+ contentId: '',
+ disposition: '',
+ filename: '',
+ type: '',
+ },
+ ],
+ clickTracking: true,
+ clickTrackingEnableText: true,
+ contents: [
+ {
+ type: 'text/html',
+ value:
+ 'Hello from Twilio SendGrid!
Sending with the email service trusted by developers and marketers for time-savings, scalability, and delivery expertise.
%open-track%
',
+ },
+ ],
+ customFieldsMapping: [{ from: 'name', to: 'user_name' }],
+ eventDelivery: false,
+ eventDeliveryTS: 1668424218224,
+ eventNamesSettings: [{ event: 'open' }],
+ footer: false,
+ fromEmail: 'a@g.com',
+ fromName: '',
+ ganalytics: false,
+ group: '',
+ groupsToDisplay: [{ groupId: '' }],
+ html: '',
+ mailFromTraits: false,
+ openTracking: false,
+ openTrackingSubstitutionTag: '',
+ replyToEmail: '',
+ replyToName: '',
+ sandboxMode: false,
+ subject: 'hello there from webflow',
+ subscriptionTracking: false,
+ substitutionTag: '',
+ templateId: '',
+ text: '',
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/sendinblue/network.ts b/test/integrations/destinations/sendinblue/network.ts
new file mode 100644
index 0000000000..f4f7e84fa7
--- /dev/null
+++ b/test/integrations/destinations/sendinblue/network.ts
@@ -0,0 +1,92 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://api.sendinblue.com/v3/contacts/gordon_pittman%40example.com',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ email: 'gordon_pittman@example.com',
+ id: 42,
+ emailBlacklisted: false,
+ smsBlacklisted: false,
+ createdAt: '2022-12-04T18:22:48.384+05:30',
+ modifiedAt: '2022-12-18T14:06:20.515+05:30',
+ attributes: {
+ LASTNAME: 'Pittman',
+ FIRSTNAME: 'Gordon',
+ AGE: 33,
+ },
+ listIds: [5],
+ statistics: {},
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.sendinblue.com/v3/contacts/42',
+ method: 'GET',
+ },
+ httpRes: {
+ data: {
+ email: 'gordon_pittman@example.com',
+ id: 42,
+ emailBlacklisted: false,
+ smsBlacklisted: false,
+ createdAt: '2022-12-04T18:22:48.384+05:30',
+ modifiedAt: '2022-12-18T14:06:20.515+05:30',
+ attributes: {
+ LASTNAME: 'Pittman',
+ FIRSTNAME: 'Gordon',
+ AGE: 33,
+ },
+ listIds: [5],
+ statistics: {},
+ },
+ status: 200,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.sendinblue.com/v3/contacts/john_doe%40example.com',
+ method: 'GET',
+ },
+ httpRes: {
+ status: 404,
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/sp_245/',
+ method: 'GET',
+ },
+ httpRes: {
+ message: 'Request failed with status code 404',
+ status: 404,
+ statusText: 'Not Found',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/1234/',
+ method: 'GET',
+ },
+ httpRes: {
+ message: 'Request failed with status code 404',
+ status: 404,
+ statusText: 'Not Found',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://api.profitwell.com/v2/users/samual/',
+ method: 'GET',
+ },
+ httpRes: {
+ message: 'Request failed with status code 404',
+ status: 404,
+ statusText: 'Not Found',
+ },
+ },
+];
diff --git a/test/integrations/destinations/sendinblue/processor/data.ts b/test/integrations/destinations/sendinblue/processor/data.ts
new file mode 100644
index 0000000000..e50bb9c003
--- /dev/null
+++ b/test/integrations/destinations/sendinblue/processor/data.ts
@@ -0,0 +1,1722 @@
+export const data = [
+ {
+ name: 'sendinblue',
+ description: 'Page call without email or phone',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'page',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ name: 'New Page',
+ properties: {
+ url: 'https://www.google.com/',
+ title: 'Google home',
+ },
+ context: {
+ traits: {},
+ page: {
+ url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html',
+ path: '/Testing/test/ourSdk.html',
+ title: 'Document',
+ search: '',
+ tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html',
+ referrer: 'http://127.0.0.1:7307/Testing/test/',
+ initial_referrer: '$direct',
+ referring_domain: '127.0.0.1:7307',
+ initial_referring_domain: '',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'At least one of `email` or `phone` is required',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Page call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'page',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ name: 'New Page',
+ properties: {
+ url: 'https://www.google.com/',
+ title: 'Google home',
+ },
+ context: {
+ traits: {
+ email: 'john_doe@example.com',
+ },
+ page: {
+ url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html',
+ path: '/Testing/test/ourSdk.html',
+ title: 'Document',
+ search: '',
+ tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html',
+ referrer: 'http://127.0.0.1:7307/Testing/test/',
+ initial_referrer: '$direct',
+ referring_domain: '127.0.0.1:7307',
+ initial_referring_domain: '',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: false,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: 'john_doe@example.com',
+ page: 'https://www.google.com/',
+ properties: {
+ ma_path: '/Testing/test/ourSdk.html',
+ ma_referrer: 'http://127.0.0.1:7307/Testing/test/',
+ ma_title: 'Google home',
+ sib_name: 'New Page',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackPage',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'ma-key': 'clientKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track call without email or phone',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'Order Completed',
+ properties: {},
+ context: {
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'At least one of `email` or `phone` is required',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track call without event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ properties: {},
+ context: {},
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event name is required',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track events with sendTraitsInTrack flag set to true',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'Order Completed',
+ properties: {},
+ context: {
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ sendTraitsInTrack: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: 'john_doe@example.com',
+ event: 'Order Completed',
+ eventdata: {},
+ properties: {
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ SMS: '+919876543210',
+ age: 19,
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'ma-key': 'clientKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track events with contactAttributeMapping provided in webapp',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'Order Completed',
+ properties: {},
+ context: {
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ contactAttributeMapping: [
+ {
+ from: 'location',
+ to: 'LOCATION',
+ },
+ ],
+ sendTraitsInTrack: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: 'john_doe@example.com',
+ event: 'Order Completed',
+ eventdata: {},
+ properties: {
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ LOCATION: 'Mumbai',
+ SMS: '+919876543210',
+ age: 19,
+ role: 'SDE',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'ma-key': 'clientKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track events with propertiesIdKey provided in integration object',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'Order Completed',
+ properties: {
+ orderId: '1341394-3812392190',
+ products: [
+ {
+ product_id: 1234,
+ product_name: 'Track Pants',
+ amount: 1,
+ price: 220,
+ },
+ {
+ product_id: 5768,
+ product_name: 'T-Shirt',
+ amount: 5,
+ price: 1058,
+ },
+ ],
+ },
+ context: {
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ },
+ integrations: {
+ All: true,
+ sendinblue: {
+ propertiesIdKey: 'orderId',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ contactAttributeMapping: [
+ {
+ from: 'location',
+ to: 'LOCATION',
+ },
+ ],
+ sendTraitsInTrack: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: 'john_doe@example.com',
+ event: 'Order Completed',
+ eventdata: {
+ data: {
+ orderId: '1341394-3812392190',
+ products: [
+ {
+ amount: 1,
+ price: 220,
+ product_id: 1234,
+ product_name: 'Track Pants',
+ },
+ {
+ amount: 5,
+ price: 1058,
+ product_id: 5768,
+ product_name: 'T-Shirt',
+ },
+ ],
+ },
+ id: '1341394-3812392190',
+ },
+ properties: {
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ LOCATION: 'Mumbai',
+ SMS: '+919876543210',
+ age: 19,
+ role: 'SDE',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'ma-key': 'clientKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track events with eventdata.id taken from messageId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'Order Completed',
+ properties: {
+ orderId: '1341394-3812392190',
+ products: [
+ {
+ product_id: 1234,
+ product_name: 'Track Pants',
+ amount: 1,
+ price: 220,
+ },
+ {
+ product_id: 5768,
+ product_name: 'T-Shirt',
+ amount: 5,
+ price: 1058,
+ },
+ ],
+ },
+ context: {
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ contactAttributeMapping: [
+ {
+ from: 'location',
+ to: 'LOCATION',
+ },
+ ],
+ sendTraitsInTrack: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: 'john_doe@example.com',
+ event: 'Order Completed',
+ eventdata: {
+ data: {
+ orderId: '1341394-3812392190',
+ products: [
+ {
+ amount: 1,
+ price: 220,
+ product_id: 1234,
+ product_name: 'Track Pants',
+ },
+ {
+ amount: 5,
+ price: 1058,
+ product_id: 5768,
+ product_name: 'T-Shirt',
+ },
+ ],
+ },
+ id: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ },
+ properties: {
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ LOCATION: 'Mumbai',
+ SMS: '+919876543210',
+ age: 19,
+ role: 'SDE',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'ma-key': 'clientKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track link without email or phone',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'trackLink',
+ properties: {
+ link: 'https://www.google.com/gmail/',
+ emailCount: 19,
+ },
+ context: {
+ traits: {},
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'At least one of `email` or `phone` is required',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track link without link',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'trackLink',
+ properties: {},
+ context: {
+ traits: {
+ phone: '+919507545089',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Missing required value from "properties.link"',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Track link',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'trackLink',
+ properties: {
+ link: 'https://www.google.com/gmail/',
+ emailCount: 19,
+ },
+ context: {
+ traits: {
+ phone: '+919507545089',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: '919507545089@mailin-sms.com',
+ link: 'https://www.google.com/gmail/',
+ properties: {
+ emailCount: 19,
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackLink',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'ma-key': 'clientKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call with invalid email',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ email: 'abc.com',
+ },
+ context: {},
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'The provided email is invalid',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call with invalid phone number',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ phone: '99999999',
+ },
+ context: {},
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'The provided phone number is invalid',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call to create or update a contact without email or phone',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ context: {},
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'At least one of `email` or `phone` is required',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call to create or update a contact',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ newEmail: 'alex_root@example.com',
+ role: 'SDE',
+ },
+ context: {
+ externalId: [
+ {
+ type: 'sendinblueIncludeListIds',
+ id: [1, 2],
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ sendinblue: {
+ emailBlacklisted: true,
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ contactAttributeMapping: [
+ {
+ from: 'location',
+ to: 'LOCATION',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ attributes: {
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ LOCATION: 'Mumbai',
+ SMS: '+919876543210',
+ EMAIL: 'alex_root@example.com',
+ age: 19,
+ role: 'SDE',
+ },
+ email: 'john_doe@example.com',
+ emailBlacklisted: true,
+ listIds: [1, 2],
+ updateEnabled: true,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.sendinblue.com/v3/contacts',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'api-key': 'apiKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call to create DOI contact with templatedId from externalId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ context: {
+ externalId: [
+ {
+ type: 'sendinblueIncludeListIds',
+ id: [1, 2],
+ },
+ {
+ type: 'sendinblueUnlinkListIds',
+ id: [5],
+ },
+ {
+ type: 'sendinblueTemplateId',
+ id: 2,
+ },
+ ],
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ attributes: {
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ SMS: '+919876543210',
+ age: 19,
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ email: 'john_doe@example.com',
+ includeListIds: [1, 2],
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ templateId: 3,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.sendinblue.com/v3/contacts/doubleOptinConfirmation',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'api-key': 'apiKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call to create DOI contact without include list Ids',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ context: {},
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'sendinblueIncludeListIds is required to create a contact using DOI',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call to create DOI contact without template Id',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ context: {},
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'templateId is required to create a contact using DOI',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call to update a DOI contact without an email or contact ID',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ first_name: 'Gordon',
+ lastName: 'Pittman',
+ age: 19,
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ context: {},
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'At least one of `email` or `contactId` is required to update the contact using DOI',
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description:
+ 'Identify call to update a DOI contact using contactId as an Identifier and without include list Ids',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ age: 36,
+ location: 'Mumbai',
+ role: 'SDE 2',
+ },
+ context: {
+ externalId: [
+ {
+ type: 'sendinblueContactId',
+ id: 42,
+ },
+ ],
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ attributes: {
+ age: 36,
+ location: 'Mumbai',
+ role: 'SDE 2',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.sendinblue.com/v3/contacts/42',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'api-key': 'apiKey123',
+ },
+ method: 'PUT',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description:
+ 'Identify call to update a DOI contact using email as an Identifier and without include list Ids',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ age: 36,
+ location: 'Mumbai',
+ role: 'SDE 2',
+ phone: '+918888888888',
+ email: 'gordon_pittman@example.com',
+ newEmail: 'gordon_pittman007@example.com',
+ },
+ context: {
+ externalId: [
+ {
+ type: 'sendinblueIncludeListIds',
+ id: [1],
+ },
+ {
+ type: 'sendinblueUnlinkListIds',
+ id: [2],
+ },
+ ],
+ },
+ integrations: {
+ All: true,
+ sendinblue: {
+ emailBlacklisted: true,
+ smsBlacklisted: false,
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ attributes: {
+ age: 36,
+ location: 'Mumbai',
+ role: 'SDE 2',
+ SMS: '+918888888888',
+ EMAIL: 'gordon_pittman007@example.com',
+ },
+ emailBlacklisted: true,
+ smsBlacklisted: false,
+ listIds: [1],
+ unlinkListIds: [2],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.sendinblue.com/v3/contacts/gordon_pittman%40example.com',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'api-key': 'apiKey123',
+ },
+ method: 'PUT',
+ params: {},
+ type: 'REST',
+ version: '1',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sendinblue',
+ description: 'Identify call to unlink a contact from given lists',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ email: 'eric_kim@example.com',
+ },
+ context: {
+ externalId: [
+ {
+ type: 'sendinblueUnlinkListIds',
+ id: [2, 5],
+ },
+ ],
+ },
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ emails: ['eric_kim@example.com'],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.sendinblue.com/v3/contacts/lists/2/contacts/remove',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'api-key': 'apiKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ userId: '',
+ version: '1',
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ body: {
+ FORM: {},
+ JSON: {
+ emails: ['eric_kim@example.com'],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.sendinblue.com/v3/contacts/lists/5/contacts/remove',
+ files: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ 'api-key': 'apiKey123',
+ },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ userId: '',
+ version: '1',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/sendinblue/router/data.ts b/test/integrations/destinations/sendinblue/router/data.ts
new file mode 100644
index 0000000000..ef96b3f55f
--- /dev/null
+++ b/test/integrations/destinations/sendinblue/router/data.ts
@@ -0,0 +1,320 @@
+export const data = [
+ {
+ name: 'sendinblue',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'track',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ event: 'Order Completed',
+ properties: {
+ orderId: '1341394-3812392190',
+ products: [
+ { product_id: 1234, product_name: 'Track Pants', amount: 1, price: 220 },
+ { product_id: 5768, product_name: 'T-Shirt', amount: 5, price: 1058 },
+ ],
+ },
+ context: {
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ metadata: { jobId: 1, userId: 'u1' },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ contactAttributeMapping: [{ from: 'location', to: 'LOCATION' }],
+ sendTraitsInTrack: true,
+ },
+ },
+ },
+ {
+ message: {
+ type: 'page',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ name: 'New Page',
+ properties: { url: 'https://www.google.com/', title: 'Google home' },
+ context: {
+ traits: { email: 'john_doe@example.com' },
+ page: {
+ url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html',
+ path: '/Testing/test/ourSdk.html',
+ title: 'Document',
+ search: '',
+ tab_url: 'http://127.0.0.1:7307/Testing/test/ourSdk.html',
+ referrer: 'http://127.0.0.1:7307/Testing/test/',
+ initial_referrer: '$direct',
+ referring_domain: '127.0.0.1:7307',
+ initial_referring_domain: '',
+ },
+ },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ metadata: { jobId: 2, userId: 'u1' },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: false,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ newEmail: 'alex_root@example.com',
+ role: 'SDE',
+ },
+ context: { externalId: [{ type: 'sendinblueIncludeListIds', id: [1, 2] }] },
+ integrations: { All: true, sendinblue: { emailBlacklisted: true } },
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ metadata: { jobId: 3, userId: 'u1' },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ contactAttributeMapping: [{ from: 'location', to: 'LOCATION' }],
+ },
+ },
+ },
+ {
+ message: {
+ type: 'identify',
+ sentAt: '2021-01-03T17:02:53.195Z',
+ channel: 'web',
+ traits: {
+ first_name: 'John',
+ lastName: 'Doe',
+ age: 19,
+ email: 'john_doe@example.com',
+ phone: '+919876543210',
+ location: 'Mumbai',
+ role: 'SDE',
+ },
+ context: {},
+ rudderId: '8f8fa6b5-8e24-489c-8e22-61f23f2e364f',
+ messageId: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ anonymousId: '97c46c81-3140-456d-b2a9-690d70aaca35',
+ originalTimestamp: '2021-01-03T17:02:53.193Z',
+ },
+ metadata: { jobId: 4, userId: 'u1' },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ destType: 'sendinblue',
+ },
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batched: false,
+ batchedRequest: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: 'john_doe@example.com',
+ event: 'Order Completed',
+ eventdata: {
+ data: {
+ orderId: '1341394-3812392190',
+ products: [
+ { amount: 1, price: 220, product_id: 1234, product_name: 'Track Pants' },
+ { amount: 5, price: 1058, product_id: 5768, product_name: 'T-Shirt' },
+ ],
+ },
+ id: '2116ef8c-efc3-4ca4-851b-02ee60dad6ff',
+ },
+ properties: {
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ LOCATION: 'Mumbai',
+ SMS: '+919876543210',
+ age: 19,
+ role: 'SDE',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackEvent',
+ files: {},
+ headers: { 'Content-Type': 'application/json', 'ma-key': 'clientKey123' },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ contactAttributeMapping: [{ from: 'location', to: 'LOCATION' }],
+ doi: false,
+ sendTraitsInTrack: true,
+ },
+ },
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ statusCode: 200,
+ },
+ {
+ batched: false,
+ batchedRequest: {
+ body: {
+ FORM: {},
+ JSON: {
+ email: 'john_doe@example.com',
+ page: 'https://www.google.com/',
+ properties: {
+ ma_path: '/Testing/test/ourSdk.html',
+ ma_referrer: 'http://127.0.0.1:7307/Testing/test/',
+ ma_title: 'Google home',
+ sib_name: 'New Page',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://in-automate.sendinblue.com/api/v2/trackPage',
+ files: {},
+ headers: { 'Content-Type': 'application/json', 'ma-key': 'clientKey123' },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ doi: false,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ templateId: 3,
+ },
+ },
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ statusCode: 200,
+ },
+ {
+ batched: false,
+ batchedRequest: {
+ body: {
+ FORM: {},
+ JSON: {
+ attributes: {
+ EMAIL: 'alex_root@example.com',
+ FIRSTNAME: 'John',
+ LASTNAME: 'Doe',
+ LOCATION: 'Mumbai',
+ SMS: '+919876543210',
+ age: 19,
+ role: 'SDE',
+ },
+ email: 'john_doe@example.com',
+ emailBlacklisted: true,
+ listIds: [1, 2],
+ updateEnabled: true,
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://api.sendinblue.com/v3/contacts',
+ files: {},
+ headers: { 'Content-Type': 'application/json', 'api-key': 'apiKey123' },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ },
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ contactAttributeMapping: [{ from: 'location', to: 'LOCATION' }],
+ doi: false,
+ },
+ },
+ metadata: [{ jobId: 3, userId: 'u1' }],
+ statusCode: 200,
+ },
+ {
+ batched: false,
+ error: 'sendinblueIncludeListIds is required to create a contact using DOI',
+ metadata: [{ jobId: 4, userId: 'u1' }],
+ statTags: {
+ destType: 'SENDINBLUE',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ destination: {
+ Config: {
+ apiKey: 'apiKey123',
+ clientKey: 'clientKey123',
+ templateId: 3,
+ doi: true,
+ redirectionUrl: 'https://app.sendinblue.com/marketing-dashboard',
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/serenytics/router/data.ts b/test/integrations/destinations/serenytics/router/data.ts
index 2edbe58257..1e0226eab0 100644
--- a/test/integrations/destinations/serenytics/router/data.ts
+++ b/test/integrations/destinations/serenytics/router/data.ts
@@ -26,24 +26,15 @@ export const data = [
'https://api.serenytics.com/api/data_source/5dc8508e-0946-47fc-8ed8-f67307c407f1/push/997877c6358621beb1f86dc320ac822b9f069760',
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
event: 'New Alert',
type: 'track',
sentAt: '2021-01-03T17:02:53.195Z',
channel: 'web',
- properties: {
- message: 'Please check the alert',
- brand: 'Zara',
- price: '12000',
- },
+ properties: { message: 'Please check the alert', brand: 'Zara', price: '12000' },
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -51,13 +42,8 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
},
locale: 'en-US',
- screen: {
- density: 2,
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
@@ -108,11 +94,7 @@ export const data = [
files: {},
},
],
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -178,24 +160,15 @@ export const data = [
],
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
event: 'Order Completed',
type: 'track',
sentAt: '2021-01-03T17:02:53.195Z',
channel: 'web',
- properties: {
- message: 'Please check the alert',
- brand: 'Zara',
- price: '12000',
- },
+ properties: { message: 'Please check the alert', brand: 'Zara', price: '12000' },
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -203,13 +176,8 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
},
locale: 'en-US',
- screen: {
- density: 2,
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
@@ -312,11 +280,7 @@ export const data = [
files: {},
},
],
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -396,9 +360,7 @@ export const data = [
],
},
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
message: {
messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be',
originalTimestamp: '2022-06-22T10:57:58Z',
@@ -419,18 +381,10 @@ export const data = [
type: 'ios',
attTrackingStatus: 3,
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
locale: 'en-US',
- os: {
- name: 'iOS',
- version: '14.4.1',
- },
- screen: {
- density: 2,
- },
+ os: { name: 'iOS', version: '14.4.1' },
+ screen: { density: 2 },
},
traits: {
email: 'testuser@google.com',
@@ -485,11 +439,7 @@ export const data = [
endpoint:
'https://api.serenytics.com/api/data_source/5dc8508e-0946-47fc-8ed8-f67307c407f1/push/997877c6358621beb1f86dc320ac822b9f069760',
},
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/sfmc/network.ts b/test/integrations/destinations/sfmc/network.ts
new file mode 100644
index 0000000000..7564d8c6d5
--- /dev/null
+++ b/test/integrations/destinations/sfmc/network.ts
@@ -0,0 +1,14 @@
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://vcn7AQ2W9GGIAZSsN6Mfq.auth.marketingcloudapis.com/v2/token',
+ method: 'POST',
+ },
+ httpRes: {
+ status: 200,
+ data: {
+ access_token: 'yourAuthToken',
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/sfmc/processor/data.ts b/test/integrations/destinations/sfmc/processor/data.ts
new file mode 100644
index 0000000000..406ed82ace
--- /dev/null
+++ b/test/integrations/destinations/sfmc/processor/data.ts
@@ -0,0 +1,1735 @@
+export const data = [
+ {
+ name: 'sfmc',
+ description: 'Test 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'identify',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: true,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error:
+ 'Creating or updating contacts is disabled. To enable this feature set "Do Not Create or Update Contacts" to false',
+ statTags: {
+ destType: 'SFMC',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 1',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'identify',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ params: {},
+ body: {
+ JSON: {
+ attributeSets: [],
+ contactKey: '12345',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'PUT',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ params: {},
+ body: {
+ JSON: {
+ values: {
+ 'Contact Key': '12345',
+ 'App Name': 'RudderLabs JavaScript SDK',
+ 'App Version': '1.0.0',
+ 'App Build': '1.0.0',
+ 'UTM Campaign': 'Demo Campaign',
+ 'UTM Source': 'facebook',
+ 'UTM Medium': 'online',
+ 'UTM Term': 'Demo terms',
+ 'UTM Content': 'Demo content',
+ Locale: 'en-GB',
+ 'User Agent':
+ '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',
+ 'IP Address': '0.0.0.0',
+ 'Screen Density': 2,
+ 'Screen Height': 860,
+ 'Screen Width': 1280,
+ Email: 'tonmoy@rudderstack.com',
+ Name: 'Tonmoy Labs',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 2',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'identify',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Either userId or email is required',
+ statTags: {
+ destType: 'SFMC',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ userId: 12345,
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event type is required',
+ statTags: {
+ destType: 'SFMC',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 4',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'revenue',
+ userId: 12345,
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event type revenue is not supported',
+ statTags: {
+ destType: 'SFMC',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 5',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ device: {
+ adTrackingEnabled: true,
+ type: 'iOS',
+ manufacturer: 'Apple',
+ model: 'iPhone XR',
+ name: 'Apple iPhone XR',
+ },
+ network: {
+ bluetooth: 'off',
+ wifi: 'connceted',
+ cellular: 'active',
+ carrier: 'Verizon',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'identify',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'POST',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ params: {},
+ body: {
+ JSON: {
+ attributeSets: [],
+ contactKey: '12345',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ userId: '',
+ method: 'PUT',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ params: {},
+ body: {
+ JSON: {
+ values: {
+ Name: 'Tonmoy Labs',
+ Email: 'tonmoy@rudderstack.com',
+ Locale: 'en-GB',
+ 'App Name': 'RudderLabs JavaScript SDK',
+ 'UTM Term': 'Demo terms',
+ 'App Build': '1.0.0',
+ 'IP Address': '0.0.0.0',
+ 'UTM Medium': 'online',
+ 'UTM Source': 'facebook',
+ 'User Agent':
+ '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',
+ 'App Version': '1.0.0',
+ 'Contact Key': '12345',
+ 'Device Name': 'Apple iPhone XR',
+ 'Device Type': 'iOS',
+ 'UTM Content': 'Demo content',
+ 'Device-model': 'iPhone XR',
+ 'Screen Width': 1280,
+ 'UTM Campaign': 'Demo Campaign',
+ 'Wifi Enabled': 'connceted',
+ 'Screen Height': 860,
+ 'Screen Density': 2,
+ 'Network Carrier': 'Verizon',
+ 'Cellular Enabled': 'active',
+ 'Bluetooth Enabled': 'off',
+ 'Ad Tracking Enabled': true,
+ 'Device Manufacturer': 'Apple',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 6',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ event: 'Event Name',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'track',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ properties: {
+ Plan: 'plan value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToExternalKey: [
+ {
+ from: 'Event Name',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ ],
+ eventToPrimaryKey: [
+ {
+ from: 'userId',
+ to: 'Contact Key',
+ },
+ ],
+ eventToUUID: [
+ {
+ event: '',
+ uuid: false,
+ },
+ ],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:C500FD37-155C-49BD-A21B-AFCEF3D1A9CB/rows/Contact Key:12345',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ params: {},
+ body: {
+ JSON: {
+ values: {
+ Plan: 'plan value',
+ Locale: 'en-GB',
+ 'App Name': 'RudderLabs JavaScript SDK',
+ 'UTM Term': 'Demo terms',
+ 'App Build': '1.0.0',
+ 'IP Address': '0.0.0.0',
+ 'UTM Medium': 'online',
+ 'UTM Source': 'facebook',
+ 'User Agent':
+ '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',
+ 'App Version': '1.0.0',
+ 'Contact Key': '12345',
+ 'UTM Content': 'Demo content',
+ 'Screen Width': 1280,
+ 'UTM Campaign': 'Demo Campaign',
+ 'Screen Height': 860,
+ 'Screen Density': 2,
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 7',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ event: 'Event Name',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ device: {
+ adTrackingEnabled: true,
+ type: 'iOS',
+ manufacturer: 'Apple',
+ model: 'iPhone XR',
+ name: 'Apple iPhone XR',
+ },
+ network: {
+ bluetooth: 'off',
+ wifi: 'connceted',
+ cellular: 'active',
+ carrier: 'Verizon',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'track',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ properties: {
+ Plan: 'plan value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToExternalKey: [
+ {
+ from: 'Event Name',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ ],
+ eventToPrimaryKey: [
+ {
+ from: 'userId',
+ to: 'Contact Key',
+ },
+ ],
+ eventToUUID: [
+ {
+ event: 'Event Name',
+ uuid: true,
+ },
+ ],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ JSON: {
+ values: {
+ Plan: 'plan value',
+ Uuid: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ Locale: 'en-GB',
+ 'App Name': 'RudderLabs JavaScript SDK',
+ 'UTM Term': 'Demo terms',
+ 'App Build': '1.0.0',
+ 'IP Address': '0.0.0.0',
+ 'UTM Medium': 'online',
+ 'UTM Source': 'facebook',
+ 'User Agent':
+ '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',
+ 'App Version': '1.0.0',
+ 'Device Name': 'Apple iPhone XR',
+ 'Device Type': 'iOS',
+ 'UTM Content': 'Demo content',
+ 'Device-model': 'iPhone XR',
+ 'Screen Width': 1280,
+ 'UTM Campaign': 'Demo Campaign',
+ 'Wifi Enabled': 'connceted',
+ 'Screen Height': 860,
+ 'Screen Density': 2,
+ 'Network Carrier': 'Verizon',
+ 'Cellular Enabled': 'active',
+ 'Bluetooth Enabled': 'off',
+ 'Ad Tracking Enabled': true,
+ 'Device Manufacturer': 'Apple',
+ },
+ },
+ },
+ type: 'REST',
+ files: {},
+ method: 'PUT',
+ params: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ version: '1',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:C500FD37-155C-49BD-A21B-AFCEF3D1A9CB/rows/Uuid:50360b9c-ea8d-409c-b672-c9230f91cce5',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 8',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ event: 'Purchase Event',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ device: {
+ adTrackingEnabled: true,
+ type: 'iOS',
+ manufacturer: 'Apple',
+ model: 'iPhone XR',
+ name: 'Apple iPhone XR',
+ },
+ network: {
+ bluetooth: 'off',
+ wifi: 'connceted',
+ cellular: 'active',
+ carrier: 'Verizon',
+ },
+ traits: {
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'track',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ properties: {
+ Plan: 'plan value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToExternalKey: [
+ {
+ from: 'Event Name',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ ],
+ eventToPrimaryKey: [
+ {
+ from: 'userId',
+ to: 'Contact Key',
+ },
+ ],
+ eventToUUID: [
+ {
+ event: 'Event Name',
+ uuid: true,
+ },
+ ],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Event not mapped for this track call',
+ statTags: {
+ destType: 'SFMC',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 9',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ event: 'Event Name',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ device: {
+ adTrackingEnabled: true,
+ type: 'iOS',
+ manufacturer: 'Apple',
+ model: 'iPhone XR',
+ name: 'Apple iPhone XR',
+ },
+ network: {
+ bluetooth: 'off',
+ wifi: 'connceted',
+ cellular: 'active',
+ carrier: 'Verizon',
+ },
+ traits: {
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'track',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ properties: {
+ Plan: 'plan value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToExternalKey: [
+ {
+ from: 'Event Name',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ ],
+ eventToPrimaryKey: [
+ {
+ from: 'userId',
+ to: 'Contact Key',
+ },
+ ],
+ eventToUUID: [
+ {
+ event: 'Event Name',
+ uuid: true,
+ },
+ ],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ error: 'Either userId or email is required',
+ statTags: {
+ destType: 'SFMC',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'processor',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 10',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ event: 'Watch',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'track',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ properties: {
+ Plan: 'plan value',
+ 'Price Key': 29.99,
+ 'Guest Key': '2323-34343-3434',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToExternalKey: [
+ {
+ from: 'Event Name',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ {
+ from: 'Watch',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ ],
+ eventToPrimaryKey: [
+ {
+ from: 'userId',
+ to: 'User Key',
+ },
+ {
+ from: 'watch',
+ to: 'Guest Key',
+ },
+ ],
+ eventToUUID: [
+ {
+ event: 'Event Name',
+ uuid: true,
+ },
+ ],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ JSON: {
+ values: {
+ Plan: 'plan value',
+ Locale: 'en-GB',
+ 'App Name': 'RudderLabs JavaScript SDK',
+ 'UTM Term': 'Demo terms',
+ 'App Build': '1.0.0',
+ 'Price Key': 29.99,
+ 'Guest Key': '2323-34343-3434',
+ 'IP Address': '0.0.0.0',
+ 'UTM Medium': 'online',
+ 'UTM Source': 'facebook',
+ 'User Agent':
+ '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',
+ 'App Version': '1.0.0',
+ 'UTM Content': 'Demo content',
+ 'Screen Width': 1280,
+ 'UTM Campaign': 'Demo Campaign',
+ 'Screen Height': 860,
+ 'Screen Density': 2,
+ },
+ },
+ },
+ type: 'REST',
+ files: {},
+ method: 'PUT',
+ params: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ version: '1',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:C500FD37-155C-49BD-A21B-AFCEF3D1A9CB/rows/Guest Key:2323-34343-3434',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sfmc',
+ description: 'Test 11',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ event: 'Watch',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'track',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ properties: {
+ Plan: 'plan value',
+ 'Price Key': 29.99,
+ 'Contact Key': 12345,
+ 'Guest Key': '2323-34343-3434',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToExternalKey: [
+ {
+ from: 'Event Name',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ {
+ from: 'Watch',
+ to: 'C500FD37-155C-49BD-A21B-AFCEF3D1A9CB',
+ },
+ ],
+ eventToPrimaryKey: [
+ {
+ from: 'userId',
+ to: 'User Key',
+ },
+ {
+ from: 'watch',
+ to: 'Guest Key, Contact Key',
+ },
+ ],
+ eventToUUID: [
+ {
+ event: 'Event Name',
+ uuid: true,
+ },
+ ],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ body: {
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ JSON: {
+ values: {
+ Plan: 'plan value',
+ Locale: 'en-GB',
+ 'App Name': 'RudderLabs JavaScript SDK',
+ 'UTM Term': 'Demo terms',
+ 'App Build': '1.0.0',
+ 'Price Key': 29.99,
+ 'Contact Key': 12345,
+ 'Guest Key': '2323-34343-3434',
+ 'IP Address': '0.0.0.0',
+ 'UTM Medium': 'online',
+ 'UTM Source': 'facebook',
+ 'User Agent':
+ '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',
+ 'App Version': '1.0.0',
+ 'UTM Content': 'Demo content',
+ 'Screen Width': 1280,
+ 'UTM Campaign': 'Demo Campaign',
+ 'Screen Height': 860,
+ 'Screen Density': 2,
+ },
+ },
+ },
+ type: 'REST',
+ files: {},
+ method: 'PUT',
+ params: {},
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ version: '1',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:C500FD37-155C-49BD-A21B-AFCEF3D1A9CB/rows/Guest Key:2323-34343-3434,Contact Key:12345',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/sfmc/router/data.ts b/test/integrations/destinations/sfmc/router/data.ts
new file mode 100644
index 0000000000..7707e709f4
--- /dev/null
+++ b/test/integrations/destinations/sfmc/router/data.ts
@@ -0,0 +1,338 @@
+export const data = [
+ {
+ name: 'sfmc',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'identify',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ metadata: {
+ jobId: 1,
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: true,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ {
+ message: {
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ campaign: {
+ name: 'Demo Campaign',
+ source: 'facebook',
+ medium: 'online',
+ term: 'Demo terms',
+ content: 'Demo content',
+ },
+ traits: {
+ email: 'tonmoy@rudderstack.com',
+ name: 'Tonmoy Labs',
+ },
+ 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',
+ screen: {
+ density: 2,
+ height: 860,
+ width: 1280,
+ },
+ },
+ type: 'identify',
+ messageId: '50360b9c-ea8d-409c-b672-c9230f91cce5',
+ originalTimestamp: '2019-10-15T09:35:31.288Z',
+ userId: '12345',
+ userProperties: {
+ test_key: 'test value',
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ integrations: {
+ All: true,
+ },
+ },
+ metadata: {
+ jobId: 2,
+ },
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ destType: 'sfmc',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ metadata: [
+ {
+ jobId: 1,
+ },
+ ],
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: true,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: true,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ batched: false,
+ statusCode: 400,
+ error:
+ 'Creating or updating contacts is disabled. To enable this feature set "Do Not Create or Update Contacts" to false',
+ statTags: {
+ destType: 'SFMC',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/contacts/v1/contacts',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ params: {},
+ body: {
+ JSON: {
+ attributeSets: [],
+ contactKey: '12345',
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ {
+ version: '1',
+ type: 'REST',
+ method: 'PUT',
+ endpoint:
+ 'https://vcn7AQ2W9GGIAZSsN6Mfq.rest.marketingcloudapis.com/hub/v1/dataevents/key:f3ffa19b-e0b3-4967-829f-549b781080e6/rows/Contact Key:12345',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Bearer yourAuthToken',
+ },
+ params: {},
+ body: {
+ JSON: {
+ values: {
+ 'Contact Key': '12345',
+ 'App Name': 'RudderLabs JavaScript SDK',
+ 'App Version': '1.0.0',
+ 'App Build': '1.0.0',
+ 'UTM Campaign': 'Demo Campaign',
+ 'UTM Source': 'facebook',
+ 'UTM Medium': 'online',
+ 'UTM Term': 'Demo terms',
+ 'UTM Content': 'Demo content',
+ Locale: 'en-GB',
+ 'User Agent':
+ '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',
+ 'IP Address': '0.0.0.0',
+ 'Screen Density': 2,
+ 'Screen Height': 860,
+ 'Screen Width': 1280,
+ Email: 'tonmoy@rudderstack.com',
+ Name: 'Tonmoy Labs',
+ },
+ },
+ XML: {},
+ JSON_ARRAY: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 2,
+ },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ ID: '1pYpzzvcn7AQ2W9GGIAZSsN6Mfq',
+ Name: 'SFMC',
+ DestinationDefinition: {
+ ID: '1pYpYSeQd8OeN6xPdw6VGDzqUd1',
+ Name: 'SFMC',
+ DisplayName: 'Salesforce Marketing Cloud',
+ Config: {
+ destConfig: [],
+ excludeKeys: [],
+ includeKeys: [],
+ saveDestinationResponse: false,
+ supportedSourceTypes: [],
+ transformAt: 'processor',
+ },
+ ResponseRules: {},
+ },
+ Config: {
+ clientId: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ clientSecret: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ createOrUpdateContacts: false,
+ eventDelivery: true,
+ eventDeliveryTS: 1615371070621,
+ eventToUUID: [],
+ externalKey: 'f3ffa19b-e0b3-4967-829f-549b781080e6',
+ subDomain: 'vcn7AQ2W9GGIAZSsN6Mfq',
+ },
+ Enabled: true,
+ Transformations: [],
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/signl4/router/data.ts b/test/integrations/destinations/signl4/router/data.ts
index 582c02e26d..0fcf55d046 100644
--- a/test/integrations/destinations/signl4/router/data.ts
+++ b/test/integrations/destinations/signl4/router/data.ts
@@ -27,24 +27,15 @@ export const data = [
eventToTitleMapping: [],
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
event: 'New Alert',
type: 'track',
sentAt: '2021-01-03T17:02:53.195Z',
channel: 'web',
- properties: {
- message: 'Please check the alert',
- brand: 'Zara',
- price: '12000',
- },
+ properties: { message: 'Please check the alert', brand: 'Zara', price: '12000' },
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -52,13 +43,8 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
},
locale: 'en-US',
- screen: {
- density: 2,
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
@@ -86,9 +72,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://connect.signl4.com/webhook/dummyApiKey',
- headers: {
- 'Content-Type': 'application/json',
- },
+ headers: { 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -108,11 +92,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -163,32 +143,18 @@ export const data = [
s4StatusValue: 'new',
s4StatusProperty: '',
s4Filter: false,
- eventToTitleMapping: [
- {
- from: 'New Alert',
- to: 'Alert Created',
- },
- ],
+ eventToTitleMapping: [{ from: 'New Alert', to: 'Alert Created' }],
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
event: 'New Alert',
type: 'identify',
sentAt: '2021-01-03T17:02:53.195Z',
channel: 'web',
- properties: {
- message: 'Please check the alert',
- brand: 'Zara',
- price: '12000',
- },
+ properties: { message: 'Please check the alert', brand: 'Zara', price: '12000' },
context: {
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
app: {
name: 'RudderLabs JavaScript SDK',
build: '1.0.0',
@@ -196,13 +162,8 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
},
locale: 'en-US',
- screen: {
- density: 2,
- },
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.11',
- },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
campaign: {},
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
@@ -239,19 +200,10 @@ export const data = [
s4StatusValue: 'new',
s4StatusProperty: '',
s4Filter: false,
- eventToTitleMapping: [
- {
- from: 'New Alert',
- to: 'Alert Created',
- },
- ],
+ eventToTitleMapping: [{ from: 'New Alert', to: 'Alert Created' }],
},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
statTags: {
errorCategory: 'dataValidation',
destType: 'SIGNL4',
diff --git a/test/integrations/destinations/singular/router/data.ts b/test/integrations/destinations/singular/router/data.ts
index d9c9f7a8cb..9074ef2fdc 100644
--- a/test/integrations/destinations/singular/router/data.ts
+++ b/test/integrations/destinations/singular/router/data.ts
@@ -14,21 +14,13 @@ export const data = [
Config: {
apiKey: 'dummyApiKey',
sessionEventList: [
- {
- sessionEventName: 'mysessionevent',
- },
- {
- sessionEventName: 'randomuser',
- },
- {
- sessionEventName: 'titanium',
- },
+ { sessionEventName: 'mysessionevent' },
+ { sessionEventName: 'randomuser' },
+ { sessionEventName: 'titanium' },
],
},
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
type: 'track',
event: 'mysessionevent',
@@ -52,32 +44,17 @@ export const data = [
adTrackingEnabled: 'true',
token: 'testDeviceToken',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '0.1.4',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '0.1.4' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
campaign: {
source: 'google',
medium: 'medium',
term: 'keyword',
content: 'some content',
},
- os: {
- name: 'Android',
- version: '9',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ os: { name: 'Android', version: '9' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Mumbai',
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)',
@@ -93,7 +70,7 @@ export const data = [
receipt_signature: '1234dfghnh',
referring_application: '2134dfg',
total: 20,
- revenue: 15.0,
+ revenue: 15,
shipping: 22,
tax: 1,
discount: 1.5,
@@ -112,13 +89,7 @@ export const data = [
url: 'https://www.website.com/product/path',
image_url: 'https://www.website.com/product/path.jpg',
},
- {
- sku: 'F-32',
- name: 'UNO',
- price: 3.45,
- quantity: 2,
- category: 'Games',
- },
+ { sku: 'F-32', name: 'UNO', price: 3.45, quantity: 2, category: 'Games' },
],
},
timestamp: '2021-09-01T15:46:51.000Z',
@@ -171,34 +142,19 @@ export const data = [
c: 'wifi',
a: 'dummyApiKey',
},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
Config: {
apiKey: 'dummyApiKey',
sessionEventList: [
- {
- sessionEventName: 'mysessionevent',
- },
- {
- sessionEventName: 'randomuser',
- },
- {
- sessionEventName: 'titanium',
- },
+ { sessionEventName: 'mysessionevent' },
+ { sessionEventName: 'randomuser' },
+ { sessionEventName: 'titanium' },
],
},
},
@@ -223,21 +179,13 @@ export const data = [
Config: {
apiKey: 'dummyApiKey',
sessionEventList: [
- {
- sessionEventName: 'mysessionevent',
- },
- {
- sessionEventName: 'randomuser',
- },
- {
- sessionEventName: 'titanium',
- },
+ { sessionEventName: 'mysessionevent' },
+ { sessionEventName: 'randomuser' },
+ { sessionEventName: 'titanium' },
],
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
type: 'track',
event: 'mysessionevent',
@@ -261,32 +209,17 @@ export const data = [
adTrackingEnabled: 'true',
token: 'testDeviceToken',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '0.1.4',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '0.1.4' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
campaign: {
source: 'google',
medium: 'medium',
term: 'keyword',
content: 'some content',
},
- os: {
- name: 'Android',
- version: '9',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ os: { name: 'Android', version: '9' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Mumbai',
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)',
@@ -302,7 +235,7 @@ export const data = [
receipt_signature: '1234dfghnh',
referring_application: '2134dfg',
total: 20,
- revenue: 15.0,
+ revenue: 15,
shipping: 22,
tax: 1,
discount: 1.5,
@@ -321,13 +254,7 @@ export const data = [
url: 'https://www.website.com/product/path',
image_url: 'https://www.website.com/product/path.jpg',
},
- {
- sku: 'F-32',
- name: 'UNO',
- price: 3.45,
- quantity: 2,
- category: 'Games',
- },
+ { sku: 'F-32', name: 'UNO', price: 3.45, quantity: 2, category: 'Games' },
],
},
timestamp: '2021-09-01T15:46:51.000Z',
@@ -380,34 +307,19 @@ export const data = [
c: 'wifi',
a: 'dummyApiKey',
},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
Config: {
apiKey: 'dummyApiKey',
sessionEventList: [
- {
- sessionEventName: 'mysessionevent',
- },
- {
- sessionEventName: 'randomuser',
- },
- {
- sessionEventName: 'titanium',
- },
+ { sessionEventName: 'mysessionevent' },
+ { sessionEventName: 'randomuser' },
+ { sessionEventName: 'titanium' },
],
},
},
@@ -432,21 +344,13 @@ export const data = [
Config: {
apiKey: 'dummyApiKey',
sessionEventList: [
- {
- sessionEventName: 'mysessionevent',
- },
- {
- sessionEventName: 'randomuser',
- },
- {
- sessionEventName: 'titanium',
- },
+ { sessionEventName: 'mysessionevent' },
+ { sessionEventName: 'randomuser' },
+ { sessionEventName: 'titanium' },
],
},
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
message: {
type: 'track',
event: 'mysessionevent',
@@ -470,32 +374,17 @@ export const data = [
adTrackingEnabled: 'true',
token: 'testDeviceToken',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '0.1.4',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '0.1.4' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
campaign: {
source: 'google',
medium: 'medium',
term: 'keyword',
content: 'some content',
},
- os: {
- name: 'Android',
- version: '9',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ os: { name: 'Android', version: '9' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Mumbai',
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075)',
@@ -511,7 +400,7 @@ export const data = [
receipt_signature: '1234dfghnh',
referring_application: '2134dfg',
total: 20,
- revenue: 15.0,
+ revenue: 15,
shipping: 22,
tax: 1,
discount: 1.5,
@@ -530,13 +419,7 @@ export const data = [
url: 'https://www.website.com/product/path',
image_url: 'https://www.website.com/product/path.jpg',
},
- {
- sku: 'F-32',
- name: 'UNO',
- price: 3.45,
- quantity: 2,
- category: 'Games',
- },
+ { sku: 'F-32', name: 'UNO', price: 3.45, quantity: 2, category: 'Games' },
],
},
timestamp: '2021-09-01T15:46:51.000Z',
@@ -589,34 +472,19 @@ export const data = [
c: 'wifi',
a: 'dummyApiKey',
},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
Config: {
apiKey: 'dummyApiKey',
sessionEventList: [
- {
- sessionEventName: 'mysessionevent',
- },
- {
- sessionEventName: 'randomuser',
- },
- {
- sessionEventName: 'titanium',
- },
+ { sessionEventName: 'mysessionevent' },
+ { sessionEventName: 'randomuser' },
+ { sessionEventName: 'titanium' },
],
},
},
@@ -644,15 +512,8 @@ export const data = [
userId: '68e214f1-ac84-4241-b27d-78a18f59f21e',
channel: 'mobile',
context: {
- os: {
- name: 'iOS',
- version: '16.2',
- },
- app: {
- build: '5013',
- version: '0.5.13',
- namespace: 'com.yabimoney',
- },
+ os: { name: 'iOS', version: '16.2' },
+ app: { build: '5013', version: '0.5.13', namespace: 'com.yabimoney' },
device: {
id: 'cc06ff5e-838b-4e33-9d90-4ab5a6068bec',
name: 'iPhone',
@@ -664,11 +525,7 @@ export const data = [
attTrackingStatus: 0,
},
locale: 'en-AE',
- screen: {
- width: 844,
- height: 390,
- density: 3,
- },
+ screen: { width: 844, height: 390, density: 3 },
traits: {
phone: '',
userId: '68e214f1-ac84-4241-b27d-78a18f59f21e',
@@ -677,15 +534,8 @@ export const data = [
yabi_user_id: 'uCh5IS8p',
subscription_type: '',
},
- library: {
- name: 'rudder-ios-library',
- version: '1.8.0',
- },
- network: {
- wifi: true,
- carrier: 'etisalat',
- cellular: false,
- },
+ library: { name: 'rudder-ios-library', version: '1.8.0' },
+ network: { wifi: true, carrier: 'etisalat', cellular: false },
timezone: 'Asia/Dubai',
sessionId: 1674138119,
},
@@ -695,9 +545,7 @@ export const data = [
receivedAt: '2023-01-19T14:25:25.465Z',
request_ip: '87.201.98.151',
anonymousId: 'cc06ff5e-838b-4e33-9d90-4ab5a6068bec',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
originalTimestamp: '2023-01-19T14:25:06.301Z',
},
destination: {
@@ -705,29 +553,14 @@ export const data = [
Config: {
apiKey: 'apiKey',
apiSecret: 'dummyApiSecret',
- sessionEventList: [
- {
- sessionEventName: 'test_event',
- },
- ],
- blacklistedEvents: [
- {
- eventName: '',
- },
- ],
- whitelistedEvents: [
- {
- eventName: '',
- },
- ],
+ sessionEventList: [{ sessionEventName: 'test_event' }],
+ blacklistedEvents: [{ eventName: '' }],
+ whitelistedEvents: [{ eventName: '' }],
eventFilteringOption: 'whitelistedEvents',
eventDelivery: false,
eventDeliveryTS: 1663919255086,
},
- liveEventsConfig: {
- eventDelivery: false,
- eventDeliveryTS: 1663919255086,
- },
+ liveEventsConfig: { eventDelivery: false, eventDeliveryTS: 1663919255086 },
ID: '2EhlBrBduwN2NX4pJ7nrVDHAz6C',
workspaceId: '1sUXvPs0hYgjBxSfjG4gqnRFNoP',
DestinationDefinition: {
@@ -821,6 +654,7 @@ export const data = [
eventType: 'track',
sourceDefinitionId: '1TW48i2bIzEl1HPf825cEznfIM8',
destinationDefinitionId: '',
+ userId: 'u1',
},
},
],
@@ -856,12 +690,7 @@ export const data = [
a: 'apiKey',
e: {},
},
- body: {
- JSON: {},
- JSON_ARRAY: {},
- XML: {},
- FORM: {},
- },
+ body: { JSON: {}, JSON_ARRAY: {}, XML: {}, FORM: {} },
files: {},
},
metadata: [
@@ -895,6 +724,7 @@ export const data = [
eventType: 'track',
sourceDefinitionId: '1TW48i2bIzEl1HPf825cEznfIM8',
destinationDefinitionId: '',
+ userId: 'u1',
},
],
batched: false,
@@ -904,29 +734,14 @@ export const data = [
Config: {
apiKey: 'apiKey',
apiSecret: 'dummyApiSecret',
- sessionEventList: [
- {
- sessionEventName: 'test_event',
- },
- ],
- blacklistedEvents: [
- {
- eventName: '',
- },
- ],
- whitelistedEvents: [
- {
- eventName: '',
- },
- ],
+ sessionEventList: [{ sessionEventName: 'test_event' }],
+ blacklistedEvents: [{ eventName: '' }],
+ whitelistedEvents: [{ eventName: '' }],
eventFilteringOption: 'whitelistedEvents',
eventDelivery: false,
eventDeliveryTS: 1663919255086,
},
- liveEventsConfig: {
- eventDelivery: false,
- eventDeliveryTS: 1663919255086,
- },
+ liveEventsConfig: { eventDelivery: false, eventDeliveryTS: 1663919255086 },
ID: '2EhlBrBduwN2NX4pJ7nrVDHAz6C',
workspaceId: '1sUXvPs0hYgjBxSfjG4gqnRFNoP',
DestinationDefinition: {
diff --git a/test/integrations/destinations/slack/processor/data.ts b/test/integrations/destinations/slack/processor/data.ts
index be05a13ab5..7deb555fa9 100644
--- a/test/integrations/destinations/slack/processor/data.ts
+++ b/test/integrations/destinations/slack/processor/data.ts
@@ -1,1982 +1,2020 @@
export const data = [
- {
- "name": "slack",
- "description": "Test 0",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "integrations": {
- "All": true
- },
- "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780",
- "originalTimestamp": "2020-03-23T03:46:30.916Z",
- "properties": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "receivedAt": "2020-03-23T09:16:31.041+05:30",
- "request_ip": "[::1]:52056",
- "sentAt": "2020-03-23T03:46:30.916Z",
- "timestamp": "2020-03-23T09:16:31.041+05:30",
- "type": "identify",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 126,
- "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"text\":\"Identified my-namehiji: hulala \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 126,
- "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 1",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ],
- "denyListOfEvents": [
- {
- "eventName": "black_event"
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "integrations": {
- "All": true
- },
- "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780",
- "originalTimestamp": "2020-03-23T03:46:30.916Z",
- "properties": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "receivedAt": "2020-03-23T09:16:31.041+05:30",
- "request_ip": "[::1]:52056",
- "sentAt": "2020-03-23T03:46:30.916Z",
- "timestamp": "2020-03-23T09:16:31.041+05:30",
- "type": "page",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 126,
- "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "metadata": {
- "anonymousId": "4de817fb-7f8e-4e23-b9be-f6736dbda20f",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 126,
- "messageId": "9ecc0183-89ed-48bd-87eb-b2d8e1ca6780",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 400,
- "error": "Event type page is not supported",
- "statTags": {
- "errorCategory": "dataValidation",
- "errorType": "instrumentation",
- "destType": "SLACK",
- "module": "destination",
- "implementation": "native",
- "feature": "processor",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL"
- }
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 2",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "12345",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "",
- "referrer": "",
- "search": "",
- "title": "",
- "url": ""
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "traits": {
- "country": "USA",
- "email": "test@domain.com",
- "hiji": "hulala-1",
- "name": "my-name-1"
- },
- "integrations": {
- "All": true
- },
- "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777",
- "originalTimestamp": "2020-03-23T03:41:46.122Z",
- "receivedAt": "2020-03-23T09:11:46.244+05:30",
- "request_ip": "[::1]:52055",
- "sentAt": "2020-03-23T03:41:46.123Z",
- "timestamp": "2020-03-23T09:11:46.243+05:30",
- "type": "identify",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "12345",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 123,
- "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"text\":\"identified my-name-1 with hiji: hulala-1 \",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "12345",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 123,
- "messageId": "4aaecff2-a513-4bbf-9824-c471f4ac9777",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 3",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "incomingWebhooksType": "modern",
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo",
- "eventName": "is",
- "eventRegex": true
- },
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ],
- "denyListOfEvents": [
- {
- "eventName": "black_event"
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "event": "test_isent1",
- "integrations": {
- "All": true
- },
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "originalTimestamp": "2020-03-23T03:46:30.921Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52057",
- "sentAt": "2020-03-23T03:46:30.921Z",
- "timestamp": "2020-03-23T09:16:31.064+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 128,
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/id1/id2/demo",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 128,
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 4",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "incomingWebhooksType": "modern",
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example",
- "eventName": "is",
- "eventChannel": "example_channel",
- "eventRegex": true
- },
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1",
- "eventName": "is",
- "eventChannel": "example_channel",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ],
- "denyListOfEvents": [
- {
- "eventName": "black_event"
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "event": "test_eventing_testis",
- "integrations": {
- "All": true
- },
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "originalTimestamp": "2020-03-23T03:46:30.922Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52054",
- "sentAt": "2020-03-23T03:46:30.923Z",
- "timestamp": "2020-03-23T09:16:31.063+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/id1/id2/example",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 5",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "incomingWebhooksType": "modern",
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example",
- "eventName": "test_eventing_test",
- "eventChannel": "example_channel",
- "eventRegex": false
- },
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1",
- "eventName": "",
- "eventChannel": "example_channel",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ],
- "denyListOfEvents": [
- {
- "eventName": "black_event"
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "event": "test_eventing_test",
- "integrations": {
- "All": true
- },
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "originalTimestamp": "2020-03-23T03:46:30.922Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52054",
- "sentAt": "2020-03-23T03:46:30.923Z",
- "timestamp": "2020-03-23T09:16:31.063+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/id1/id2/example",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"text\":\"my-name did test_eventing_test\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 6",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "incomingWebhooksType": "legacy",
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/demo",
- "eventName": "is",
- "eventRegex": true
- },
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ],
- "denyListOfEvents": [
- {
- "eventName": "black_event"
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "event": "test_isent1",
- "integrations": {
- "All": true
- },
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "originalTimestamp": "2020-03-23T03:46:30.921Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52057",
- "sentAt": "2020-03-23T03:46:30.921Z",
- "timestamp": "2020-03-23T09:16:31.064+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 128,
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"text\":\"my-name performed test_isent1 with test_val1 test_val2 and traits hulala\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 128,
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 7",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "incomingWebhooksType": "legacy",
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example",
- "eventName": "is",
- "eventRegex": true
- },
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/id1/id2/example+1",
- "eventChannel": "example-of-legacy",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ],
- "denyListOfEvents": [
- {
- "eventName": "black_event"
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "event": "test_eventing_testis",
- "integrations": {
- "All": true
- },
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "originalTimestamp": "2020-03-23T03:46:30.922Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52054",
- "sentAt": "2020-03-23T03:46:30.923Z",
- "timestamp": "2020-03-23T09:16:31.063+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"channel\":\"example-of-legacy\",\"text\":\"my-name performed test_eventing_testis with test_val1 test_val2\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 8",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "event": "test_eventing_testis",
- "integrations": {
- "All": true
- },
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "originalTimestamp": "2020-03-23T03:46:30.922Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52054",
- "sentAt": "2020-03-23T03:46:30.923Z",
- "timestamp": "2020-03-23T09:16:31.063+05:30",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 400,
- "error": "Event type is required",
- "statTags": {
- "errorCategory": "dataValidation",
- "errorType": "instrumentation",
- "destType": "SLACK",
- "module": "destination",
- "implementation": "native",
- "feature": "processor",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL"
- }
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 9",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "integrations": {
- "All": true
- },
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "originalTimestamp": "2020-03-23T03:46:30.922Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52054",
- "sentAt": "2020-03-23T03:46:30.923Z",
- "timestamp": "2020-03-23T09:16:31.063+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 400,
- "error": "Event name is required",
- "statTags": {
- "errorCategory": "dataValidation",
- "errorType": "instrumentation",
- "destType": "SLACK",
- "module": "destination",
- "implementation": "native",
- "feature": "processor",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL"
- }
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 10",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "identifyTemplate": "identified {{name}} with {{traits}}",
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {
- "app": {
- "build": "1.0.0",
- "name": "RudderLabs JavaScript SDK",
- "namespace": "com.rudderlabs.javascript",
- "version": "1.1.1-rc.1"
- },
- "ip": "0.0.0.0",
- "library": {
- "name": "RudderLabs JavaScript SDK",
- "version": "1.1.1-rc.1"
- },
- "locale": "en-US",
- "os": {
- "name": "",
- "version": ""
- },
- "page": {
- "path": "/tests/html/script-test.html",
- "referrer": "http://localhost:1111/tests/html/",
- "search": "",
- "title": "",
- "url": "http://localhost:1111/tests/html/script-test.html"
- },
- "screen": {
- "density": 1.7999999523162842
- },
- "traits": {
- "country": "India",
- "email": "name@domain.com",
- "hiji": "hulala",
- "name": "my-name"
- },
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
- },
- "event": "test_isent1",
- "integrations": {
- "All": true
- },
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "originalTimestamp": "2020-03-23T03:46:30.921Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52057",
- "sentAt": "2020-03-23T03:46:30.921Z",
- "timestamp": "2020-03-23T09:16:31.064+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 128,
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 128,
- "messageId": "78102118-56ac-4c5a-a495-8cd7c8f71cc2",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 400,
- "error": "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'",
- "statTags": {
- "errorCategory": "dataValidation",
- "errorType": "configuration",
- "destType": "SLACK",
- "module": "destination",
- "implementation": "native",
- "feature": "processor",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL"
- }
- }
- ]
- }
- }
- },
- {
- "name": "slack",
- "description": "Test 11",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "ID": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "Name": "test-slack",
- "DestinationDefinition": {
- "ID": "1ZQUiJVMlmF7lfsdfXg7KXQnlLV",
- "Name": "SLACK",
- "DisplayName": "Slack",
- "Config": {
- "excludeKeys": [],
- "includeKeys": []
- }
- },
- "Config": {
- "eventChannelSettings": [
- {
- "eventChannelWebhook": "https://hooks.slack.com/services/example/test/demo",
- "eventName": "is",
- "eventRegex": true
- }
- ],
- "eventTemplateSettings": [
- {
- "eventName": "is",
- "eventRegex": true,
- "eventTemplate": "{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}"
- },
- {
- "eventName": "",
- "eventRegex": false,
- "eventTemplate": ""
- }
- ],
- "webhookUrl": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "whitelistedTraitsSettings": [
- {
- "trait": "hiji"
- },
- {
- "trait": ""
- }
- ]
- },
- "Enabled": true,
- "Transformations": [],
- "IsProcessorEnabled": true
- },
- "message": {
- "anonymousId": "00000000000000000000000000",
- "channel": "web",
- "context": {},
- "event": "black_event",
- "integrations": {
- "All": true
- },
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "originalTimestamp": "2020-03-23T03:46:30.922Z",
- "properties": {
- "currency": "USD",
- "key1": "test_val1",
- "key2": "test_val2",
- "revenue": 30,
- "user_actual_id": 12345
- },
- "receivedAt": "2020-03-23T09:16:31.064+05:30",
- "request_ip": "[::1]:52054",
- "sentAt": "2020-03-23T03:46:30.923Z",
- "timestamp": "2020-03-23T09:16:31.063+05:30",
- "type": "track",
- "userId": "12345"
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo",
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded"
- },
- "params": {},
- "body": {
- "JSON": {},
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {
- "payload": "{\"text\":\"User 12345 did black_event\",\"username\":\"RudderStack\",\"icon_url\":\"https://cdn.rudderlabs.com/rudderstack.png\"}"
- }
- },
- "files": {},
- "userId": "12345",
- "statusCode": 200
- },
- "metadata": {
- "anonymousId": "00000000000000000000000000",
- "destinationId": "1ZQVSU9SXNg6KYgZALaqjAO3PIL",
- "destinationType": "SLACK",
- "jobId": 129,
- "messageId": "8b8d5937-09bc-49dc-a35e-8cd6370575f8",
- "sourceId": "1YhwKyDcKstudlGxkeN5p2wgsrp"
- },
- "statusCode": 200
- }
- ]
- }
- }
- }
-]
\ No newline at end of file
+ {
+ name: 'slack',
+ description:
+ 'Test 0-> Identify -> Default template with some whiteListed traits and some of them are with a space in between',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/example/test/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: 'favorite color',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ 'favorite color': 'black',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
+ originalTimestamp: '2020-03-23T03:46:30.916Z',
+ properties: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ receivedAt: '2020-03-23T09:16:31.041+05:30',
+ request_ip: '[::1]:52056',
+ sentAt: '2020-03-23T03:46:30.916Z',
+ timestamp: '2020-03-23T09:16:31.041+05:30',
+ type: 'identify',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 126,
+ messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload:
+ '{"text":"Identified my-namehiji: hulala favorite color: black ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 126,
+ messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description: 'Test 1-> Unsupported event type',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/example/test/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ denyListOfEvents: [
+ {
+ eventName: 'black_event',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
+ originalTimestamp: '2020-03-23T03:46:30.916Z',
+ properties: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ receivedAt: '2020-03-23T09:16:31.041+05:30',
+ request_ip: '[::1]:52056',
+ sentAt: '2020-03-23T03:46:30.916Z',
+ timestamp: '2020-03-23T09:16:31.041+05:30',
+ type: 'page',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 126,
+ messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ anonymousId: '4de817fb-7f8e-4e23-b9be-f6736dbda20f',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 126,
+ messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 400,
+ error: 'Event type page is not supported',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SLACK',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description: 'Test 2 -> Identify call with custom template',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '12345',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '',
+ referrer: '',
+ search: '',
+ title: '',
+ url: '',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ traits: {
+ country: 'USA',
+ email: 'test@domain.com',
+ hiji: 'hulala-1',
+ name: 'my-name-1',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
+ originalTimestamp: '2020-03-23T03:41:46.122Z',
+ receivedAt: '2020-03-23T09:11:46.244+05:30',
+ request_ip: '[::1]:52055',
+ sentAt: '2020-03-23T03:41:46.123Z',
+ timestamp: '2020-03-23T09:11:46.243+05:30',
+ type: 'identify',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '12345',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 123,
+ messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload:
+ '{"text":"identified my-name-1 with hiji: hulala-1 ","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '12345',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 123,
+ messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description: 'Test 3 -> Track with modern webhook and with custom template including a trait',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ incomingWebhooksType: 'modern',
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example+1',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ denyListOfEvents: [
+ {
+ eventName: 'black_event',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ event: 'test_isent1',
+ integrations: {
+ All: true,
+ },
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ originalTimestamp: '2020-03-23T03:46:30.921Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52057',
+ sentAt: '2020-03-23T03:46:30.921Z',
+ timestamp: '2020-03-23T09:16:31.064+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 128,
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/id1/id2/demo',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload:
+ '{"text":"my-name performed test_isent1 with test_val1 test_val2 and traits hulala"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 128,
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description:
+ 'Test 4 -> Track call with custom template with no trait and only properties and modern webhook',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ incomingWebhooksType: 'modern',
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example',
+ eventName: 'is',
+ eventChannel: 'example_channel',
+ eventRegex: true,
+ },
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example+1',
+ eventName: 'is',
+ eventChannel: 'example_channel',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ denyListOfEvents: [
+ {
+ eventName: 'black_event',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ event: 'test_eventing_testis',
+ integrations: {
+ All: true,
+ },
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ originalTimestamp: '2020-03-23T03:46:30.922Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52054',
+ sentAt: '2020-03-23T03:46:30.923Z',
+ timestamp: '2020-03-23T09:16:31.063+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/id1/id2/example',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload:
+ '{"text":"my-name performed test_eventing_testis with test_val1 test_val2"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description:
+ 'Test 5 -> Track call with default template and an extra empty event to template mapping containg blank string as event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ incomingWebhooksType: 'modern',
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example',
+ eventName: 'test_eventing_test',
+ eventChannel: 'example_channel',
+ eventRegex: false,
+ },
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example+1',
+ eventName: '',
+ eventChannel: 'example_channel',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ denyListOfEvents: [
+ {
+ eventName: 'black_event',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ event: 'test_eventing_test',
+ integrations: {
+ All: true,
+ },
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ originalTimestamp: '2020-03-23T03:46:30.922Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52054',
+ sentAt: '2020-03-23T03:46:30.923Z',
+ timestamp: '2020-03-23T09:16:31.063+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/id1/id2/example',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload: '{"text":"my-name did test_eventing_test"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description:
+ 'Test 6 -> Track call with legacy webhook and custom template with properties and traits',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ incomingWebhooksType: 'legacy',
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example+1',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}} and traits {{traitsList.hiji}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ denyListOfEvents: [
+ {
+ eventName: 'black_event',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ event: 'test_isent1',
+ integrations: {
+ All: true,
+ },
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ originalTimestamp: '2020-03-23T03:46:30.921Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52057',
+ sentAt: '2020-03-23T03:46:30.921Z',
+ timestamp: '2020-03-23T09:16:31.064+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 128,
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload:
+ '{"text":"my-name performed test_isent1 with test_val1 test_val2 and traits hulala","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 128,
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description:
+ 'Test 7 -> Track call with legacy webhook and custom template with properties and custom channel from mapping',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ incomingWebhooksType: 'legacy',
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/id1/id2/example+1',
+ eventChannel: 'example-of-legacy',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ denyListOfEvents: [
+ {
+ eventName: 'black_event',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ event: 'test_eventing_testis',
+ integrations: {
+ All: true,
+ },
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ originalTimestamp: '2020-03-23T03:46:30.922Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52054',
+ sentAt: '2020-03-23T03:46:30.923Z',
+ timestamp: '2020-03-23T09:16:31.063+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload:
+ '{"channel":"example-of-legacy","text":"my-name performed test_eventing_testis with test_val1 test_val2","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description: 'Test 8 -> No Event Type',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/example/test/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ event: 'test_eventing_testis',
+ integrations: {
+ All: true,
+ },
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ originalTimestamp: '2020-03-23T03:46:30.922Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52054',
+ sentAt: '2020-03-23T03:46:30.923Z',
+ timestamp: '2020-03-23T09:16:31.063+05:30',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 400,
+ error: 'Event type is required',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SLACK',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description: 'Test 9 -> Track call with no Event name',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/example/test/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ integrations: {
+ All: true,
+ },
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ originalTimestamp: '2020-03-23T03:46:30.922Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52054',
+ sentAt: '2020-03-23T03:46:30.923Z',
+ timestamp: '2020-03-23T09:16:31.063+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 400,
+ error: 'Event name is required',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SLACK',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description:
+ 'Test 10-> Track call with custom template but template is wrong ( space in `{{properties. key1}}` )',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/example/test/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ identifyTemplate: 'identified {{name}} with {{traits}}',
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.1.1-rc.1',
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.1.1-rc.1',
+ },
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ page: {
+ path: '/tests/html/script-test.html',
+ referrer: 'http://localhost:1111/tests/html/',
+ search: '',
+ title: '',
+ url: 'http://localhost:1111/tests/html/script-test.html',
+ },
+ screen: {
+ density: 1.7999999523162842,
+ },
+ traits: {
+ country: 'India',
+ email: 'name@domain.com',
+ hiji: 'hulala',
+ name: 'my-name',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
+ },
+ event: 'test_isent1',
+ integrations: {
+ All: true,
+ },
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ originalTimestamp: '2020-03-23T03:46:30.921Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52057',
+ sentAt: '2020-03-23T03:46:30.921Z',
+ timestamp: '2020-03-23T09:16:31.064+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 128,
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 128,
+ messageId: '78102118-56ac-4c5a-a495-8cd7c8f71cc2',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 400,
+ error:
+ "Something is wrong with the event template: '{{name}} performed {{event}} with {{properties. key1}} {{properties.key2}} and traits {{traitsList.hiji}}'",
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'SLACK',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'slack',
+ description: 'Test 11 -> Track call with default template',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ ID: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ Name: 'test-slack',
+ DestinationDefinition: {
+ ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
+ Name: 'SLACK',
+ DisplayName: 'Slack',
+ Config: {
+ excludeKeys: [],
+ includeKeys: [],
+ },
+ },
+ Config: {
+ eventChannelSettings: [
+ {
+ eventChannelWebhook: 'https://hooks.slack.com/services/example/test/demo',
+ eventName: 'is',
+ eventRegex: true,
+ },
+ ],
+ eventTemplateSettings: [
+ {
+ eventName: 'is',
+ eventRegex: true,
+ eventTemplate:
+ '{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
+ },
+ {
+ eventName: '',
+ eventRegex: false,
+ eventTemplate: '',
+ },
+ ],
+ webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ whitelistedTraitsSettings: [
+ {
+ trait: 'hiji',
+ },
+ {
+ trait: '',
+ },
+ ],
+ },
+ Enabled: true,
+ Transformations: [],
+ IsProcessorEnabled: true,
+ },
+ message: {
+ anonymousId: '00000000000000000000000000',
+ channel: 'web',
+ context: {},
+ event: 'black_event',
+ integrations: {
+ All: true,
+ },
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ originalTimestamp: '2020-03-23T03:46:30.922Z',
+ properties: {
+ currency: 'USD',
+ key1: 'test_val1',
+ key2: 'test_val2',
+ revenue: 30,
+ user_actual_id: 12345,
+ },
+ receivedAt: '2020-03-23T09:16:31.064+05:30',
+ request_ip: '[::1]:52054',
+ sentAt: '2020-03-23T03:46:30.923Z',
+ timestamp: '2020-03-23T09:16:31.063+05:30',
+ type: 'track',
+ userId: '12345',
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ },
+ params: {},
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {
+ payload:
+ '{"text":"User 12345 did black_event","username":"RudderStack","icon_url":"https://cdn.rudderlabs.com/rudderstack.png"}',
+ },
+ },
+ files: {},
+ userId: '12345',
+ statusCode: 200,
+ },
+ metadata: {
+ anonymousId: '00000000000000000000000000',
+ destinationId: '1ZQVSU9SXNg6KYgZALaqjAO3PIL',
+ destinationType: 'SLACK',
+ jobId: 129,
+ messageId: '8b8d5937-09bc-49dc-a35e-8cd6370575f8',
+ sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/slack/router/data.ts b/test/integrations/destinations/slack/router/data.ts
index 87b1fe3b22..349b1a486f 100644
--- a/test/integrations/destinations/slack/router/data.ts
+++ b/test/integrations/destinations/slack/router/data.ts
@@ -17,28 +17,13 @@ export const data = [
ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
Name: 'SLACK',
DisplayName: 'Slack',
- Config: {
- excludeKeys: [],
- includeKeys: [],
- },
+ Config: { excludeKeys: [], includeKeys: [] },
},
Config: {
eventChannelSettings: [
- {
- eventChannel: '#slack_integration',
- eventName: 'is',
- eventRegex: true,
- },
- {
- eventChannel: '',
- eventName: '',
- eventRegex: false,
- },
- {
- eventChannel: '',
- eventName: '',
- eventRegex: false,
- },
+ { eventChannel: '#slack_integration', eventName: 'is', eventRegex: true },
+ { eventChannel: '', eventName: '', eventRegex: false },
+ { eventChannel: '', eventName: '', eventRegex: false },
],
eventTemplateSettings: [
{
@@ -47,22 +32,11 @@ export const data = [
eventTemplate:
'{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
},
- {
- eventName: '',
- eventRegex: false,
- eventTemplate: '',
- },
+ { eventName: '', eventRegex: false, eventTemplate: '' },
],
identifyTemplate: 'identified {{name}} with {{traits}}',
webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
- whitelistedTraitsSettings: [
- {
- trait: 'hiji',
- },
- {
- trait: '',
- },
- ],
+ whitelistedTraitsSettings: [{ trait: 'hiji' }, { trait: '' }],
},
Enabled: true,
Transformations: [],
@@ -78,15 +52,9 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.1.1-rc.1',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.1-rc.1',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.1-rc.1' },
locale: 'en-US',
- os: {
- name: '',
- version: '',
- },
+ os: { name: '', version: '' },
page: {
path: '/tests/html/script-test.html',
referrer: 'http://localhost:1111/tests/html/',
@@ -94,9 +62,7 @@ export const data = [
title: '',
url: 'http://localhost:1111/tests/html/script-test.html',
},
- screen: {
- density: 1.7999999523162842,
- },
+ screen: { density: 1.7999999523162842 },
traits: {
country: 'India',
email: 'name@domain.com',
@@ -106,9 +72,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
originalTimestamp: '2020-03-23T03:46:30.916Z',
properties: {
@@ -132,6 +96,7 @@ export const data = [
jobId: 126,
messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
},
],
@@ -187,6 +152,7 @@ export const data = [
jobId: 126,
messageId: '9ecc0183-89ed-48bd-87eb-b2d8e1ca6780',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
],
statTags: {
@@ -223,28 +189,13 @@ export const data = [
ID: '1ZQUiJVMlmF7lfsdfXg7KXQnlLV',
Name: 'SLACK',
DisplayName: 'Slack',
- Config: {
- excludeKeys: [],
- includeKeys: [],
- },
+ Config: { excludeKeys: [], includeKeys: [] },
},
Config: {
eventChannelSettings: [
- {
- eventChannel: '#slack_integration',
- eventName: 'is',
- eventRegex: true,
- },
- {
- eventChannel: '',
- eventName: '',
- eventRegex: false,
- },
- {
- eventChannel: '',
- eventName: '',
- eventRegex: false,
- },
+ { eventChannel: '#slack_integration', eventName: 'is', eventRegex: true },
+ { eventChannel: '', eventName: '', eventRegex: false },
+ { eventChannel: '', eventName: '', eventRegex: false },
],
eventTemplateSettings: [
{
@@ -253,22 +204,11 @@ export const data = [
eventTemplate:
'{{name}} performed {{event}} with {{properties.key1}} {{properties.key2}}',
},
- {
- eventName: '',
- eventRegex: false,
- eventTemplate: '',
- },
+ { eventName: '', eventRegex: false, eventTemplate: '' },
],
identifyTemplate: 'identified {{name}} with {{traits}}',
webhookUrl: 'https://hooks.slack.com/services/THZM86VSS/BV9HZ2UN6/demo',
- whitelistedTraitsSettings: [
- {
- trait: 'hiji',
- },
- {
- trait: '',
- },
- ],
+ whitelistedTraitsSettings: [{ trait: 'hiji' }, { trait: '' }],
},
Enabled: true,
Transformations: [],
@@ -284,25 +224,11 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.1.1-rc.1',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.1-rc.1',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.1-rc.1' },
locale: 'en-US',
- os: {
- name: '',
- version: '',
- },
- page: {
- path: '',
- referrer: '',
- search: '',
- title: '',
- url: '',
- },
- screen: {
- density: 1.7999999523162842,
- },
+ os: { name: '', version: '' },
+ page: { path: '', referrer: '', search: '', title: '', url: '' },
+ screen: { density: 1.7999999523162842 },
traits: {
country: 'India',
email: 'name@domain.com',
@@ -318,9 +244,7 @@ export const data = [
hiji: 'hulala-1',
name: 'my-name-1',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
originalTimestamp: '2020-03-23T03:41:46.122Z',
receivedAt: '2020-03-23T09:11:46.244+05:30',
@@ -337,6 +261,7 @@ export const data = [
jobId: 123,
messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
},
],
@@ -413,6 +338,7 @@ export const data = [
jobId: 123,
messageId: '4aaecff2-a513-4bbf-9824-c471f4ac9777',
sourceId: '1YhwKyDcKstudlGxkeN5p2wgsrp',
+ userId: 'u1',
},
],
statusCode: 200,
diff --git a/test/integrations/destinations/snapchat_conversion/processor/data.ts b/test/integrations/destinations/snapchat_conversion/processor/data.ts
index baa2b2b99e..b0d14208cc 100644
--- a/test/integrations/destinations/snapchat_conversion/processor/data.ts
+++ b/test/integrations/destinations/snapchat_conversion/processor/data.ts
@@ -4344,7 +4344,7 @@ export const data = [
},
],
userAgent:
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
},
type: 'track',
event: 'Order Completed',
@@ -4362,7 +4362,7 @@ export const data = [
quantity: 3,
},
],
- category: 'shoes'
+ category: 'shoes',
},
integrations: {
All: true,
@@ -4417,16 +4417,16 @@ export const data = [
event_type: 'PURCHASE',
item_ids: ['123', '124'],
brands: ['brand01', 'brand02'],
- item_category: "shoes",
+ item_category: 'shoes',
price: '56',
hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2',
hashed_phone_number:
- 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492',
+ 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492',
hashed_mobile_ad_id:
- 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2',
+ 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2',
hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f',
user_agent:
- 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36',
+ 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36',
timestamp: '1650625078',
event_conversion_type: 'MOBILE_APP',
snap_app_id: 'hfhdhfd',
@@ -4498,7 +4498,7 @@ export const data = [
},
],
userAgent:
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
},
type: 'track',
event: 'Order Completed',
@@ -4517,7 +4517,7 @@ export const data = [
},
],
category: 'shoes',
- item_category: 'glass'
+ item_category: 'glass',
},
integrations: {
All: true,
@@ -4572,16 +4572,16 @@ export const data = [
event_type: 'PURCHASE',
item_ids: ['123', '124'],
brands: ['brand01', 'brand02'],
- item_category: "glass",
+ item_category: 'glass',
price: '56',
hashed_email: '73062d872926c2a556f17b36f50e328ddf9bff9d403939bd14b6c3b7f5a33fc2',
hashed_phone_number:
- 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492',
+ 'bc77d64d7045fe44795ed926df37231a0cfb6ec6b74588c512790e9f143cc492',
hashed_mobile_ad_id:
- 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2',
+ 'f9779d734aaee50f16ee0011260bae7048f1d9a128c62b6a661077875701edd2',
hashed_idfv: '54bd0b26a3d39dad90f5149db49b9fd9ba885f8e35d1d94cae69273f5e657b9f',
user_agent:
- 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36',
+ 'mozilla/5.0 (macintosh; intel mac os x 10_15_2) applewebkit/537.36 (khtml, like gecko) chrome/79.0.3945.88 safari/537.36',
timestamp: '1650625078',
event_conversion_type: 'MOBILE_APP',
snap_app_id: 'hfhdhfd',
@@ -4599,7 +4599,7 @@ export const data = [
],
},
},
- }
+ },
].map((tc) => ({
...tc,
mockFns: (_) => {
diff --git a/test/integrations/destinations/snapchat_conversion/router/data.ts b/test/integrations/destinations/snapchat_conversion/router/data.ts
index bfa9acd4d2..685ed2e5b4 100644
--- a/test/integrations/destinations/snapchat_conversion/router/data.ts
+++ b/test/integrations/destinations/snapchat_conversion/router/data.ts
@@ -69,6 +69,7 @@ export const data = [
},
metadata: {
jobId: 1,
+ userId: 'u1',
},
destination: {
Config: {
@@ -135,6 +136,7 @@ export const data = [
},
metadata: {
jobId: 2,
+ userId: 'u1',
},
destination: {
Config: {
@@ -201,6 +203,7 @@ export const data = [
},
metadata: {
jobId: 3,
+ userId: 'u1',
},
destination: {
Config: {
@@ -244,12 +247,15 @@ export const data = [
metadata: [
{
jobId: 1,
+ userId: 'u1',
},
{
jobId: 2,
+ userId: 'u1',
},
{
jobId: 3,
+ userId: 'u1',
},
],
batched: true,
@@ -381,6 +387,7 @@ export const data = [
},
metadata: {
jobId: 4,
+ userId: 'u1',
},
destination: {
Config: {
@@ -412,6 +419,7 @@ export const data = [
metadata: [
{
jobId: 4,
+ userId: 'u1',
},
],
batched: false,
diff --git a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts
index 2ed5625fe8..1903938660 100644
--- a/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts
+++ b/test/integrations/destinations/snapchat_custom_audience/dataDelivery/data.ts
@@ -219,4 +219,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts
index 9ad6106c7e..a73a959699 100644
--- a/test/integrations/destinations/snapchat_custom_audience/processor/data.ts
+++ b/test/integrations/destinations/snapchat_custom_audience/processor/data.ts
@@ -1401,4 +1401,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/snapchat_custom_audience/router/data.ts b/test/integrations/destinations/snapchat_custom_audience/router/data.ts
index 2807201e73..44fdb4b47b 100644
--- a/test/integrations/destinations/snapchat_custom_audience/router/data.ts
+++ b/test/integrations/destinations/snapchat_custom_audience/router/data.ts
@@ -1,13 +1,9 @@
-import { FEATURES, MODULES } from '../../../../../src/v0/util/tags';
-
-const DEST_TYPE = 'snapchat_custom_audience';
-
export const data = [
{
- name: DEST_TYPE,
+ name: 'snapchat_custom_audience',
description: 'Test 0',
- feature: FEATURES.ROUTER,
- module: MODULES.DESTINATION,
+ feature: 'router',
+ module: 'destination',
version: 'v0',
input: {
request: {
@@ -20,14 +16,9 @@ export const data = [
refresh_token: 'dummyRefreshToken',
developer_token: 'dummyDeveloperToken',
},
+ userId: 'u1',
},
- destination: {
- Config: {
- segmentId: '123',
- disableHashing: false,
- schema: 'email',
- },
- },
+ destination: { Config: { segmentId: '123', disableHashing: false, schema: 'email' } },
message: {
userId: 'user 1',
anonymousId: 'anon-id-new',
@@ -48,17 +39,12 @@ export const data = [
},
enablePartialFailure: true,
},
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
timestamp: '2020-02-02T00:23:09.544Z',
},
},
],
- destType: DEST_TYPE,
+ destType: 'snapchat_custom_audience',
},
},
},
@@ -104,17 +90,12 @@ export const data = [
developer_token: 'dummyDeveloperToken',
refresh_token: 'dummyRefreshToken',
},
+ userId: 'u1',
},
],
batched: false,
statusCode: 200,
- destination: {
- Config: {
- disableHashing: false,
- schema: 'email',
- segmentId: '123',
- },
- },
+ destination: { Config: { disableHashing: false, schema: 'email', segmentId: '123' } },
},
],
},
diff --git a/test/integrations/destinations/splitio/processor/data.ts b/test/integrations/destinations/splitio/processor/data.ts
index 6f77c6f562..20ffa00fc2 100644
--- a/test/integrations/destinations/splitio/processor/data.ts
+++ b/test/integrations/destinations/splitio/processor/data.ts
@@ -912,4 +912,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/splitio/router/data.ts b/test/integrations/destinations/splitio/router/data.ts
index 1004756812..47f8ad5cff 100644
--- a/test/integrations/destinations/splitio/router/data.ts
+++ b/test/integrations/destinations/splitio/router/data.ts
@@ -1,10 +1,8 @@
-import { FEATURES } from '../../../../../src/v0/util/tags';
-
export const data = [
{
name: 'splitio',
description: 'Test 0',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -14,7 +12,7 @@ export const data = [
{
message: {
traits: {
- martin: 21.565000000000001,
+ martin: 21.565,
trafficTypeName: 'user',
vertical: 'restaurant',
eventTypeId: 'page_load end to end',
@@ -26,14 +24,8 @@ export const data = [
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
context: {
ip: '14.5.67.21',
- traits: {
- abc: 'new-val',
- key: 'key_user_0',
- value: '0.93',
- },
- library: {
- name: 'http',
- },
+ traits: { abc: 'new-val', key: 'key_user_0', value: '0.93' },
+ library: { name: 'http' },
},
type: 'group',
groupId: 'group1',
@@ -42,15 +34,9 @@ export const data = [
receivedAt: '2021-04-19T14:53:18.215+05:30',
requestIP: '[::1]',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
- Config: {
- apiKey: 'abcde',
- environment: 'staging',
- trafficType: 'user',
- },
+ Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' },
},
},
],
@@ -70,10 +56,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://events.split.io/api/events',
- headers: {
- 'Content-Type': 'application/json',
- Authorization: 'Bearer abcde',
- },
+ headers: { 'Content-Type': 'application/json', Authorization: 'Bearer abcde' },
params: {},
body: {
JSON: {
@@ -82,11 +65,7 @@ export const data = [
timestamp: 1579566094208,
environmentName: 'staging',
trafficTypeName: 'user',
- properties: {
- martin: 21.565,
- vertical: 'restaurant',
- GMV: false,
- },
+ properties: { martin: 21.565, vertical: 'restaurant', GMV: false },
},
XML: {},
JSON_ARRAY: {},
@@ -94,19 +73,11 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
- Config: {
- apiKey: 'abcde',
- environment: 'staging',
- trafficType: 'user',
- },
+ Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' },
},
},
],
@@ -117,7 +88,7 @@ export const data = [
{
name: 'splitio',
description: 'Test 1',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -127,7 +98,7 @@ export const data = [
{
message: {
traits: {
- martin: 21.565000000000001,
+ martin: 21.565,
trafficTypeName: 'user',
eventTypeId: 'page_load end to end',
timestamp: 1513357833000,
@@ -137,13 +108,8 @@ export const data = [
rudderId: 'bda76e3e-87eb-4153-9d1e-e9c2ed48b7a5',
context: {
ip: '14.5.67.21',
- traits: {
- abc: 'new-val',
- key: 'key_user_0',
- },
- library: {
- name: 'http',
- },
+ traits: { abc: 'new-val', key: 'key_user_0' },
+ library: { name: 'http' },
},
type: 'identify',
timestamp: '2020-01-21T00:21:34.208Z',
@@ -151,15 +117,9 @@ export const data = [
receivedAt: '2021-04-19T14:53:18.215+05:30',
requestIP: '[::1]',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
- Config: {
- apiKey: 'abcde',
- environment: 'staging',
- trafficType: 'user',
- },
+ Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' },
},
},
],
@@ -179,10 +139,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://events.split.io/api/events',
- headers: {
- 'Content-Type': 'application/json',
- Authorization: 'Bearer abcde',
- },
+ headers: { 'Content-Type': 'application/json', Authorization: 'Bearer abcde' },
params: {},
body: {
JSON: {
@@ -191,9 +148,7 @@ export const data = [
timestamp: 1579566094208,
environmentName: 'staging',
trafficTypeName: 'user',
- properties: {
- martin: 21.565,
- },
+ properties: { martin: 21.565 },
},
XML: {},
JSON_ARRAY: {},
@@ -201,19 +156,11 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
- Config: {
- apiKey: 'abcde',
- environment: 'staging',
- trafficType: 'user',
- },
+ Config: { apiKey: 'abcde', environment: 'staging', trafficType: 'user' },
},
},
],
diff --git a/test/integrations/destinations/sprig/deleteUsers/data.ts b/test/integrations/destinations/sprig/deleteUsers/data.ts
new file mode 100644
index 0000000000..7ab5620e66
--- /dev/null
+++ b/test/integrations/destinations/sprig/deleteUsers/data.ts
@@ -0,0 +1,217 @@
+export const data = [
+ {
+ name: 'sprig',
+ description: 'Missing api key',
+ feature: 'userDeletion',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destType: 'SPRIG',
+ userAttributes: [
+ {
+ userId: '1',
+ },
+ {
+ userId: '2',
+ },
+ ],
+ config: {
+ apiKey: undefined,
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 400,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Api Key is required for user deletion',
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Invalid api key',
+ feature: 'userDeletion',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destType: 'SPRIG',
+ userAttributes: [
+ {
+ userId: '1',
+ },
+ {
+ userId: '2',
+ },
+ ],
+ config: {
+ apiKey: 'invalidApiKey',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 403,
+ body: [
+ {
+ statusCode: 403,
+ error: 'User deletion request failed',
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Too many requests',
+ feature: 'userDeletion',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destType: 'SPRIG',
+ userAttributes: [
+ {
+ userId: '1',
+ },
+ {
+ userId: '2',
+ },
+ {
+ userId: '3',
+ },
+ {
+ userId: '4',
+ },
+ {
+ userId: '5',
+ },
+ {
+ userId: '6',
+ },
+ {
+ userId: '7',
+ },
+ {
+ userId: '8',
+ },
+ {
+ userId: '9',
+ },
+ {
+ userId: '10',
+ },
+ ],
+ config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 429,
+ body: [
+ {
+ statusCode: 429,
+ error: 'User deletion request failed',
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Given userId is not present for user deletion',
+ feature: 'userDeletion',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destType: 'SPRIG',
+ userAttributes: [
+ {
+ userId: '9',
+ },
+ ],
+ config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 200,
+ status: 'successful',
+ },
+ ,
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Successful user deletion',
+ feature: 'userDeletion',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destType: 'SPRIG',
+ userAttributes: [
+ {
+ userId: '1',
+ },
+ {
+ userId: '2',
+ },
+ {
+ userId: '3',
+ },
+ ],
+ config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 200,
+ status: 'successful',
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/sprig/network.ts b/test/integrations/destinations/sprig/network.ts
new file mode 100644
index 0000000000..e5f2ff23b1
--- /dev/null
+++ b/test/integrations/destinations/sprig/network.ts
@@ -0,0 +1,79 @@
+const deleteNwData = [
+ {
+ httpReq: {
+ method: 'post',
+ url: 'https://api.sprig.com/v2/purge/visitors',
+ data: {
+ userIds: ['1', '2'],
+ },
+ headers: {
+ Accept: 'application/json',
+ Authorization: 'API-Key invalidApiKey',
+ 'Content-Type': 'application/json',
+ },
+ },
+ httpRes: {
+ data: 'Forbidden',
+ status: 403,
+ },
+ },
+ {
+ httpReq: {
+ method: 'post',
+ url: 'https://api.sprig.com/v2/purge/visitors',
+ data: {
+ userIds: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
+ },
+ headers: {
+ Accept: 'application/json',
+ Authorization: 'API-Key testApiKey',
+ 'Content-Type': 'application/json',
+ },
+ },
+ httpRes: {
+ data: 'Your application has made too many requests in too short a time.',
+ status: 429,
+ },
+ },
+ {
+ httpReq: {
+ method: 'post',
+ url: 'https://api.sprig.com/v2/purge/visitors',
+ data: {
+ userIds: ['9'],
+ },
+ headers: {
+ Accept: 'application/json',
+ Authorization: 'API-Key testApiKey',
+ 'Content-Type': 'application/json',
+ },
+ },
+ httpRes: {
+ data: {
+ error: 'User deletion request failed',
+ },
+ status: 400,
+ },
+ },
+ {
+ httpReq: {
+ method: 'post',
+ url: 'https://api.sprig.com/v2/purge/visitors',
+ data: {
+ userIds: ['1', '2', '3'],
+ },
+ headers: {
+ Accept: 'application/json',
+ Authorization: 'API-Key testApiKey',
+ 'Content-Type': 'application/json',
+ },
+ },
+ httpRes: {
+ data: {
+ requestId: 'request_1',
+ },
+ status: 200,
+ },
+ },
+];
+export const networkCallsData = [...deleteNwData];
diff --git a/test/integrations/destinations/sprig/processor/data.ts b/test/integrations/destinations/sprig/processor/data.ts
new file mode 100644
index 0000000000..6b99e5e13b
--- /dev/null
+++ b/test/integrations/destinations/sprig/processor/data.ts
@@ -0,0 +1,504 @@
+export const data = [
+ {
+ name: 'sprig',
+ description: 'No message type',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ userId: 'user@1',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Ruddelabs',
+ },
+ },
+ originalTimestamp: '2023-11-10T14:42:44.724Z',
+ timestamp: '2023-11-22T10:12:44.75705:30',
+ },
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ Config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ metadata: {
+ jobId: 1,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ jobId: 1,
+ },
+ statusCode: 400,
+ error:
+ 'message Type is not present. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message Type is not present. Aborting',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SPRIG',
+ module: 'destination',
+ implementation: 'cdkV2',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Unsupported message type',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ userId: 'user@1',
+ groupId: 'group@1',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Rudderstack',
+ },
+ },
+ traits: {},
+ type: 'group',
+ originalTimestamp: '2023-11-10T14:42:44.724Z',
+ timestamp: '2023-11-22T10:12:44.75705:30',
+ },
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ Config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ metadata: {
+ jobId: 2,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ jobId: 2,
+ },
+ statusCode: 400,
+ error:
+ 'message type group is not supported: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: message type group is not supported',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SPRIG',
+ module: 'destination',
+ implementation: 'cdkV2',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Missing config',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ userId: 'user@1',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Rudderstack',
+ },
+ },
+ type: 'identify',
+ originalTimestamp: '2023-11-10T14:42:44.724Z',
+ timestamp: '2023-11-22T10:12:44.75705:30',
+ },
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ Config: {},
+ },
+ metadata: {
+ jobId: 3,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ jobId: 3,
+ },
+ statusCode: 400,
+ error:
+ 'API Key is not present. Aborting: Workflow: procWorkflow, Step: validateInput, ChildStep: undefined, OriginalError: API Key is not present. Aborting',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'SPRIG',
+ module: 'destination',
+ implementation: 'cdkV2',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Identify call without userId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ channel: 'web',
+ anonymousId: 'anon@1',
+ context: {
+ traits: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ },
+ type: 'identify',
+ originalTimestamp: '2023-11-10T14:42:44.724Z',
+ timestamp: '2023-11-22T10:12:44.75705:30',
+ },
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ Config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ metadata: {
+ jobId: 4,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ jobId: 4,
+ },
+ statusCode: 400,
+ error:
+ 'userId is required: Workflow: procWorkflow, Step: validateIdentifyPayload, ChildStep: undefined, OriginalError: userId is required',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SPRIG',
+ module: 'destination',
+ implementation: 'cdkV2',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Successful identify call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ channel: 'web',
+ userId: 'user@1',
+ context: {
+ traits: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ },
+ type: 'identify',
+ originalTimestamp: '2023-11-10T14:42:44.724Z',
+ timestamp: '2023-11-22T10:12:44.75705:30',
+ },
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ Config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ metadata: {
+ jobId: 5,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ jobId: 5,
+ },
+ output: {
+ method: 'POST',
+ endpoint: 'https://api.sprig.com/v2/users',
+ headers: {
+ accept: 'application/json',
+ authorization: 'API-Key testApiKey',
+ 'content-type': 'application/json',
+ },
+ body: {
+ JSON: {
+ attributes: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ emailAddress: 'test@gmail.com',
+ userId: 'user@1',
+ },
+ XML: {},
+ FORM: {},
+ JSON_ARRAY: {},
+ },
+ files: {},
+ params: {},
+ type: 'REST',
+ userId: '',
+ version: '1',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Track call with empty event name',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ channel: 'web',
+ userId: 'user@1',
+ context: {
+ traits: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ },
+ properties: {},
+ type: 'track',
+ event: '',
+ originalTimestamp: '2020-11-29T19:11:00.337Z',
+ timestamp: '2023-11-29T19:11:00.337Z',
+ },
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ Config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ metadata: {
+ jobId: 6,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ jobId: 6,
+ },
+ statusCode: 400,
+ error:
+ 'event name is required: Workflow: procWorkflow, Step: validateTrackPayload, ChildStep: undefined, OriginalError: event name is required',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'SPRIG',
+ module: 'destination',
+ implementation: 'cdkV2',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'sprig',
+ description: 'Successful track call',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ channel: 'web',
+ userId: 'user@1',
+ context: {
+ traits: {
+ email: 'test@gmail.com',
+ firstName: 'Test',
+ lastName: 'Rudderlabs',
+ },
+ },
+ properties: {},
+ type: 'track',
+ event: 'signup',
+ originalTimestamp: '2020-11-29T19:11:00.337Z',
+ timestamp: '2023-11-29T19:11:00.337Z',
+ },
+ destination: {
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ Config: {
+ apiKey: 'testApiKey',
+ },
+ },
+ metadata: {
+ jobId: 7,
+ },
+ },
+ ],
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ metadata: {
+ jobId: 7,
+ },
+ output: {
+ method: 'POST',
+ endpoint: 'https://api.sprig.com/v2/users',
+ headers: {
+ accept: 'application/json',
+ authorization: 'API-Key testApiKey',
+ 'content-type': 'application/json',
+ },
+ body: {
+ JSON: {
+ emailAddress: 'test@gmail.com',
+ userId: 'user@1',
+ events: [
+ {
+ event: 'signup',
+ timestamp: 1701285060337,
+ },
+ ],
+ },
+ XML: {},
+ FORM: {},
+ JSON_ARRAY: {},
+ },
+ files: {},
+ params: {},
+ type: 'REST',
+ userId: '',
+ version: '1',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/stormly/processor/data.ts b/test/integrations/destinations/stormly/processor/data.ts
new file mode 100644
index 0000000000..52356ba9e0
--- /dev/null
+++ b/test/integrations/destinations/stormly/processor/data.ts
@@ -0,0 +1,566 @@
+export const data = [
+ {
+ name: 'stormly',
+ description: 'Identify call without userId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'identify',
+ context: {
+ traits: {
+ name: 'John Doe',
+ email: 'johndoe@gmail.com',
+ age: 25,
+ },
+ },
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Missing required value from "userIdOnly"',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'STORMLY',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'stormly',
+ description: 'Identify call with userId, traits',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'identify',
+ sentAt: '2022-01-20T13:39:21.033Z',
+ channel: 'web',
+ userId: '5136633649',
+ context: {
+ traits: {
+ name: 'John Doe',
+ email: 'johndoe@gmail.com',
+ age: 25,
+ },
+ },
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ userId: '5136633649',
+ timestamp: '2022-01-20T13:39:21.032Z',
+ traits: {
+ name: 'John Doe',
+ email: 'johndoe@gmail.com',
+ age: 25,
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'stormly',
+ description: 'Track call without userId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'track',
+ event: 'Product Reviewed',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ groupId: '91Yb32830',
+ },
+ context: {},
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Missing required value from "userIdOnly"',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'STORMLY',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'stormly',
+ description: 'Track call without groupId',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'track',
+ event: 'Product Reviewed',
+ userId: '5136633649',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ },
+ context: {},
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ userId: '5136633649',
+ event: 'Product Reviewed',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ },
+ timestamp: '2022-01-20T13:39:21.032Z',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'stormly',
+ description: 'Track call without properties',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'track',
+ event: 'Product Reviewed',
+ userId: '5136633649',
+ context: {},
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ userId: '5136633649',
+ event: 'Product Reviewed',
+ timestamp: '2022-01-20T13:39:21.032Z',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'stormly',
+ description: 'Track call with userId, groupId and properties',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'track',
+ event: 'Product Reviewed',
+ userId: '5136633649',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ groupId: '91Yb32830',
+ },
+ context: {},
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ userId: '5136633649',
+ event: 'Product Reviewed',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ },
+ timestamp: '2022-01-20T13:39:21.032Z',
+ context: {
+ groupId: '91Yb32830',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'stormly',
+ description: 'Track call with userId, groupId (from externalId) and properties',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'track',
+ event: 'Product Reviewed',
+ userId: '5136633649',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ groupId: 'test-12345',
+ },
+ context: {
+ externalId: [
+ {
+ type: 'stormlyGroupId',
+ id: '91Yb32830',
+ },
+ ],
+ },
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/track',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ userId: '5136633649',
+ event: 'Product Reviewed',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ },
+ timestamp: '2022-01-20T13:39:21.032Z',
+ context: {
+ groupId: '91Yb32830',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'stormly',
+ description: 'Group call with userId, groupId and traits',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ apiKey: 'dummyApiKey',
+ },
+ ID: 'stormly123',
+ },
+ message: {
+ type: 'group',
+ userId: '5136633649',
+ traits: {
+ name: 'Initech',
+ employees: 500,
+ headquarters: 'Redwood City, California, United States',
+ ceo: 'John Doe',
+ revenue: 70000000,
+ currency: 'USD',
+ groupId: '9230AUbd2138h',
+ },
+ context: {},
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/group',
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: 'Basic dummyApiKey',
+ },
+ params: {},
+ body: {
+ JSON: {
+ userId: '5136633649',
+ groupId: '9230AUbd2138h',
+ timestamp: '2022-01-20T13:39:21.032Z',
+ traits: {
+ name: 'Initech',
+ employees: 500,
+ headquarters: 'Redwood City, California, United States',
+ ceo: 'John Doe',
+ revenue: 70000000,
+ currency: 'USD',
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/stormly/router/data.ts b/test/integrations/destinations/stormly/router/data.ts
new file mode 100644
index 0000000000..1973173795
--- /dev/null
+++ b/test/integrations/destinations/stormly/router/data.ts
@@ -0,0 +1,101 @@
+export const data = [
+ {
+ name: 'stormly',
+ description: 'Test 0',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' },
+ metadata: { jobId: 1, userId: 'u1' },
+ message: {
+ type: 'identify',
+ sentAt: '2022-01-20T13:39:21.033Z',
+ channel: 'web',
+ userId: '5136633649',
+ context: { traits: { name: 'John Doe', email: 'johndoe@gmail.com', age: 25 } },
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ {
+ destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' },
+ metadata: { jobId: 2, userId: 'u1' },
+ message: {
+ type: 'track',
+ event: 'Product Reviewed',
+ properties: {
+ review_id: '12345',
+ product_id: '123',
+ rating: 3,
+ review_body: 'Average product, expected much more.',
+ groupId: '91Yb32830',
+ },
+ context: {},
+ rudderId: '553b5522-c575-40a7-8072-9741c5f9a647',
+ anonymousId: 'bf412108-0357-4330-b119-7305e767823c',
+ originalTimestamp: '2022-01-20T13:39:21.032Z',
+ },
+ },
+ ],
+ destType: 'stormly',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batched: false,
+ batchedRequest: {
+ body: {
+ FORM: {},
+ JSON: {
+ timestamp: '2022-01-20T13:39:21.032Z',
+ traits: { age: 25, email: 'johndoe@gmail.com', name: 'John Doe' },
+ userId: '5136633649',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ },
+ endpoint: 'https://rudderstack.t.stormly.com/webhook/rudderstack/identify',
+ files: {},
+ headers: { Authorization: 'Basic dummyApiKey', 'Content-Type': 'application/json' },
+ method: 'POST',
+ params: {},
+ type: 'REST',
+ version: '1',
+ },
+ destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' },
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ statusCode: 200,
+ },
+ {
+ destination: { Config: { apiKey: 'dummyApiKey' }, ID: 'stormly123' },
+ batched: false,
+ error: 'Missing required value from "userIdOnly"',
+ metadata: [{ jobId: 2, userId: 'u1' }],
+ statTags: {
+ destType: 'STORMLY',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/the_trade_desk/common.ts b/test/integrations/destinations/the_trade_desk/common.ts
new file mode 100644
index 0000000000..d792c7faae
--- /dev/null
+++ b/test/integrations/destinations/the_trade_desk/common.ts
@@ -0,0 +1,44 @@
+const destType = 'the_trade_desk';
+const destTypeInUpperCase = 'THE_TRADE_DESK';
+const advertiserId = 'test-advertiser-id';
+const dataProviderId = 'rudderstack';
+const segmentName = 'test-segment';
+const sampleDestination = {
+ Config: {
+ advertiserId,
+ advertiserSecretKey: 'test-advertiser-secret-key',
+ dataServer: 'apac',
+ ttlInDays: 30,
+ audienceId: segmentName,
+ },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
+};
+
+const sampleSource = {
+ job_id: 'test-job-id',
+ job_run_id: 'test-job-run-id',
+ task_run_id: 'test-task-run-id',
+ version: 'v1.40.4',
+};
+
+const sampleContext = {
+ destinationFields: 'daid, uid2',
+ externalId: [
+ {
+ identifierType: 'tdid',
+ type: 'THE_TRADE_DESK-test-segment',
+ },
+ ],
+ mappedToDestination: 'true',
+ sources: sampleSource,
+};
+
+export {
+ destType,
+ destTypeInUpperCase,
+ advertiserId,
+ dataProviderId,
+ segmentName,
+ sampleDestination,
+ sampleContext,
+};
diff --git a/test/integrations/destinations/the_trade_desk/delivery/data.ts b/test/integrations/destinations/the_trade_desk/delivery/data.ts
new file mode 100644
index 0000000000..320eb6dcfe
--- /dev/null
+++ b/test/integrations/destinations/the_trade_desk/delivery/data.ts
@@ -0,0 +1,248 @@
+import {
+ destType,
+ destTypeInUpperCase,
+ advertiserId,
+ dataProviderId,
+ segmentName,
+ sampleDestination,
+} from '../common';
+
+beforeAll(() => {
+ process.env.THE_TRADE_DESK_DATA_PROVIDER_SECRET_KEY = 'mockedDataProviderSecretKey';
+});
+
+afterAll(() => {
+ delete process.env.THE_TRADE_DESK_DATA_PROVIDER_SECRET_KEY;
+});
+
+export const data = [
+ {
+ name: destType,
+ description: 'Successful delivery of Add/Remove IDs to/from Trade Desk',
+ feature: 'dataDelivery',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ destinationConfig: sampleDestination.Config,
+ body: {
+ JSON: {
+ AdvertiserId: advertiserId,
+ DataProviderId: dataProviderId,
+ Items: [
+ {
+ DAID: 'test-daid-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ UID2: 'test-uid2-1',
+ },
+ {
+ DAID: 'test-daid-2',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 0,
+ },
+ ],
+ },
+ {
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 0,
+ },
+ ],
+ UID2: 'test-uid2-2',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: {
+ destinationResponse: {
+ response: {},
+ status: 200,
+ },
+ message: 'Request Processed Successfully',
+ status: 200,
+ },
+ },
+ },
+ },
+ },
+ {
+ name: destType,
+ description: 'Error response from The Trade Desk due to invalid IDs',
+ feature: 'dataDelivery',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ destinationConfig: sampleDestination.Config,
+ body: {
+ JSON: {
+ AdvertiserId: advertiserId,
+ DataProviderId: dataProviderId,
+ Items: [
+ {
+ DAID: 'test-daid',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ UID2: 'test-invalid-uid2',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 400,
+ body: {
+ output: {
+ destinationResponse: {
+ response: {
+ FailedLines: [{ ErrorCode: 'MissingUserId', Message: 'Invalid UID2, item #2' }],
+ },
+ status: 200,
+ },
+ message:
+ 'Request failed with status: 200 due to {"FailedLines":[{"ErrorCode":"MissingUserId","Message":"Invalid UID2, item #2"}]}',
+ statTags: {
+ destType: destTypeInUpperCase,
+ destinationId: 'Non-determininable',
+ errorCategory: 'network',
+ errorType: 'aborted',
+ feature: 'dataDelivery',
+ implementation: 'native',
+ module: 'destination',
+ workspaceId: 'Non-determininable',
+ },
+ status: 400,
+ },
+ },
+ },
+ },
+ },
+ {
+ name: destType,
+ description:
+ 'Missing advertiser secret key in destination config from proxy request from server',
+ feature: 'dataDelivery',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {
+ AdvertiserId: advertiserId,
+ DataProviderId: dataProviderId,
+ Items: [
+ {
+ DAID: 'test-daid-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 400,
+ body: {
+ output: {
+ destinationResponse: '',
+ message: 'Advertiser secret key is missing in destination config. Aborting',
+ statTags: {
+ destType: destTypeInUpperCase,
+ destinationId: 'Non-determininable',
+ errorCategory: 'platform',
+ feature: 'dataDelivery',
+ implementation: 'native',
+ module: 'destination',
+ workspaceId: 'Non-determininable',
+ },
+ status: 400,
+ },
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/the_trade_desk/mocks.ts b/test/integrations/destinations/the_trade_desk/mocks.ts
new file mode 100644
index 0000000000..ddcbebae88
--- /dev/null
+++ b/test/integrations/destinations/the_trade_desk/mocks.ts
@@ -0,0 +1,5 @@
+import config from '../../../../src/cdk/v2/destinations/the_trade_desk/config';
+
+export const defaultMockFns = () => {
+ jest.replaceProperty(config, 'MAX_REQUEST_SIZE_IN_BYTES', 250);
+};
diff --git a/test/integrations/destinations/the_trade_desk/network.ts b/test/integrations/destinations/the_trade_desk/network.ts
new file mode 100644
index 0000000000..ed6bdf4c7d
--- /dev/null
+++ b/test/integrations/destinations/the_trade_desk/network.ts
@@ -0,0 +1,106 @@
+import { destType, advertiserId, dataProviderId, segmentName } from './common';
+
+export const networkCallsData = [
+ {
+ httpReq: {
+ url: 'https://sin-data.adsrvr.org/data/advertiser',
+ data: {
+ AdvertiserId: advertiserId,
+ DataProviderId: dataProviderId,
+ Items: [
+ {
+ DAID: 'test-daid-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ UID2: 'test-uid2-1',
+ },
+ {
+ DAID: 'test-daid-2',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 0,
+ },
+ ],
+ },
+ {
+ Data: [
+ {
+ Name: 'test-segment',
+ TTLInMinutes: 0,
+ },
+ ],
+ UID2: 'test-uid2-2',
+ },
+ ],
+ },
+ params: { destination: destType },
+ headers: {
+ TtdSignature: '8LqGha6I7e3duvhngEvhXoTden0=',
+ 'TtdSignature-dp': 'tLpf4t5xebsr9Xcqp9PjhOJX7p0=',
+ 'Content-Type': 'application/json',
+ 'User-Agent': 'RudderLabs',
+ },
+ method: 'POST',
+ },
+ httpRes: {
+ data: {},
+ status: 200,
+ statusText: 'OK',
+ },
+ },
+ {
+ httpReq: {
+ url: 'https://sin-data.adsrvr.org/data/advertiser',
+ data: {
+ AdvertiserId: advertiserId,
+ DataProviderId: dataProviderId,
+ Items: [
+ {
+ DAID: 'test-daid',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ UID2: 'test-invalid-uid2',
+ },
+ ],
+ },
+ params: { destination: destType },
+ headers: {
+ TtdSignature: '9EIeoIGkRkV5oJHfGtoq1lwQl+M=',
+ 'TtdSignature-dp': 'ZpHWNd1uGvQAv/QW685SQT8tl1I=',
+ 'Content-Type': 'application/json',
+ 'User-Agent': 'RudderLabs',
+ },
+ method: 'POST',
+ },
+ httpRes: {
+ data: { FailedLines: [{ ErrorCode: 'MissingUserId', Message: 'Invalid UID2, item #2' }] },
+ status: 200,
+ statusText: 'Ok',
+ },
+ },
+];
diff --git a/test/integrations/destinations/the_trade_desk/router/data.ts b/test/integrations/destinations/the_trade_desk/router/data.ts
new file mode 100644
index 0000000000..b02a80f563
--- /dev/null
+++ b/test/integrations/destinations/the_trade_desk/router/data.ts
@@ -0,0 +1,846 @@
+import { overrideDestination } from '../../../testUtils';
+import { defaultMockFns } from '../mocks';
+import {
+ destType,
+ destTypeInUpperCase,
+ advertiserId,
+ dataProviderId,
+ segmentName,
+ sampleDestination,
+ sampleContext,
+} from '../common';
+
+export const data = [
+ {
+ name: destType,
+ description: 'Add IDs to the segment',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ UID2: 'test-uid2-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-2',
+ UID2: null,
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '2',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {
+ DataProviderId: dataProviderId,
+ AdvertiserId: advertiserId,
+ Items: [
+ {
+ DAID: 'test-daid-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ UID2: 'test-uid2-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ DAID: 'test-daid-2',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 1,
+ userId: 'u1',
+ },
+ {
+ jobId: 2,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: sampleDestination,
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: destType,
+ description:
+ 'Add/Remove IDs to/from the segment and split into multiple requests based on size',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ UID2: 'test-uid2-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ {
+ message: {
+ type: 'record',
+ action: 'delete',
+ fields: {
+ DAID: 'test-daid-2',
+ UID2: 'test-uid2-2',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '2',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {
+ DataProviderId: dataProviderId,
+ AdvertiserId: advertiserId,
+ Items: [
+ {
+ DAID: 'test-daid-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ UID2: 'test-uid2-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ DAID: 'test-daid-2',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 0,
+ },
+ ],
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {
+ DataProviderId: dataProviderId,
+ AdvertiserId: advertiserId,
+ Items: [
+ {
+ UID2: 'test-uid2-2',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 0,
+ },
+ ],
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 1,
+ userId: 'u1',
+ },
+ {
+ jobId: 2,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: sampleDestination,
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: destType,
+ description:
+ 'Missing segment name (audienceId) in the config (segment name will be populated from vdm)',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ UID2: 'test-uid2-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: overrideDestination(sampleDestination, { audienceId: '' }),
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-2',
+ UID2: 'test-uid2-2',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '2',
+ },
+ destination: overrideDestination(sampleDestination, { audienceId: '' }),
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batched: false,
+ metadata: [
+ { jobId: 1, userId: 'u1' },
+ { jobId: 2, userId: 'u1' },
+ ],
+ statusCode: 400,
+ error: 'Segment name is not present. Aborting',
+ statTags: {
+ destType: destTypeInUpperCase,
+ implementation: 'cdkV2',
+ feature: 'router',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: destType,
+ description: 'Missing advertiser ID in the config',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ UID2: 'test-uid2-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: overrideDestination(sampleDestination, { advertiserId: '' }),
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batched: false,
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ statusCode: 400,
+ error: 'Advertiser ID is not present. Aborting',
+ statTags: {
+ destType: destTypeInUpperCase,
+ implementation: 'cdkV2',
+ feature: 'router',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: destType,
+ description: 'Missing advertiser secret key in the config',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ UID2: 'test-uid2-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: overrideDestination(sampleDestination, { advertiserSecretKey: '' }),
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batched: false,
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ statusCode: 400,
+ error: 'Advertiser Secret Key is not present. Aborting',
+ statTags: {
+ destType: destTypeInUpperCase,
+ implementation: 'cdkV2',
+ feature: 'router',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: destType,
+ description: 'TTL is out of range',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ UID2: 'test-uid2-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: overrideDestination(sampleDestination, { ttlInDays: 190 }),
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batched: false,
+ metadata: [{ jobId: 1, userId: 'u1' }],
+ statusCode: 400,
+ error: 'TTL is out of range. Allowed values are 0 to 180 days',
+ statTags: {
+ destType: destTypeInUpperCase,
+ implementation: 'cdkV2',
+ feature: 'router',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+ {
+ name: destType,
+ description: 'Invalid action type',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ UID2: 'test-uid2-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 1,
+ },
+ },
+ {
+ message: {
+ type: 'record',
+ action: 'update',
+ fields: {
+ DAID: 'test-daid-2',
+ UID2: null,
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '2',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 2,
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {
+ DataProviderId: dataProviderId,
+ AdvertiserId: advertiserId,
+ Items: [
+ {
+ DAID: 'test-daid-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ {
+ UID2: 'test-uid2-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 1,
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: sampleDestination,
+ },
+ {
+ batched: false,
+ metadata: [{ jobId: 2 }],
+ statusCode: 400,
+ error: 'Invalid action type',
+ statTags: {
+ destType: destTypeInUpperCase,
+ implementation: 'cdkV2',
+ feature: 'router',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ },
+ destination: sampleDestination,
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: destType,
+ description: 'Empty fields in the message',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {},
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 1,
+ },
+ },
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ fields: {
+ DAID: 'test-daid-1',
+ },
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '2',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 2,
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://sin-data.adsrvr.org/data/advertiser',
+ headers: {},
+ params: {},
+ body: {
+ JSON: {
+ DataProviderId: dataProviderId,
+ AdvertiserId: advertiserId,
+ Items: [
+ {
+ DAID: 'test-daid-1',
+ Data: [
+ {
+ Name: segmentName,
+ TTLInMinutes: 43200,
+ },
+ ],
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 2,
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: sampleDestination,
+ },
+ {
+ batched: false,
+ metadata: [{ jobId: 1 }],
+ statusCode: 400,
+ error: 'Fields cannot be empty',
+ statTags: {
+ destType: destTypeInUpperCase,
+ implementation: 'cdkV2',
+ feature: 'router',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ },
+ destination: sampleDestination,
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: destType,
+ description: '`fields` is missing',
+ feature: 'router',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ type: 'record',
+ action: 'insert',
+ channel: 'sources',
+ context: sampleContext,
+ recordId: '1',
+ },
+ destination: sampleDestination,
+ metadata: {
+ jobId: 1,
+ },
+ },
+ ],
+ destType,
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batched: false,
+ metadata: [{ jobId: 1 }],
+ statusCode: 400,
+ error: 'Fields cannot be empty',
+ statTags: {
+ destType: destTypeInUpperCase,
+ implementation: 'cdkV2',
+ feature: 'router',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ },
+ destination: sampleDestination,
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+];
diff --git a/test/integrations/destinations/tiktok_ads/mocks.ts b/test/integrations/destinations/tiktok_ads/mocks.ts
new file mode 100644
index 0000000000..a5d8fc4a63
--- /dev/null
+++ b/test/integrations/destinations/tiktok_ads/mocks.ts
@@ -0,0 +1,5 @@
+import config from '../../../../src/v0/destinations/tiktok_ads/config';
+
+export const defaultMockFns = () => {
+ jest.replaceProperty(config, 'maxBatchSizeV2', 3);
+};
diff --git a/test/integrations/destinations/tiktok_ads/processor/data.ts b/test/integrations/destinations/tiktok_ads/processor/data.ts
index 453a875af2..9d7c3a8d10 100644
--- a/test/integrations/destinations/tiktok_ads/processor/data.ts
+++ b/test/integrations/destinations/tiktok_ads/processor/data.ts
@@ -89,7 +89,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -114,7 +114,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'CompletePayment',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -256,7 +256,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -281,7 +281,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'InitiateCheckout',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -418,7 +418,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -443,7 +443,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'AddToWishlist',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -581,7 +581,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -697,7 +697,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -722,7 +722,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'AddToWishlist',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -863,7 +863,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -888,7 +888,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'AddToWishlist',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -1028,7 +1028,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: true,
},
},
@@ -1053,7 +1053,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'Subscribe',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -1192,7 +1192,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -1217,7 +1217,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'AddPaymentInfo',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -1355,7 +1355,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -1467,7 +1467,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -1580,7 +1580,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -1605,7 +1605,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'AddPaymentInfo',
event_id: '1616318632825_357',
properties: {
@@ -1743,7 +1743,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -1768,7 +1768,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'SubmitForm',
event_id: '16163186328257',
timestamp: '2020-09-17T19:49:27Z',
@@ -1894,7 +1894,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -1919,7 +1919,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'SubmitForm',
event_id: '16163186328257',
timestamp: '2020-09-17T19:49:27Z',
@@ -2040,7 +2040,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -2065,7 +2065,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'Contact',
event_id: '16163186328257',
timestamp: '2020-09-17T19:49:27Z',
@@ -2204,7 +2204,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -2318,7 +2318,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -2343,7 +2343,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'CompletePayment',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -2482,7 +2482,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -2507,7 +2507,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'PlaceAnOrder',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -2650,7 +2650,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: true,
},
},
@@ -2675,7 +2675,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'Subscribe',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -2819,7 +2819,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: true,
},
},
@@ -2844,7 +2844,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'Subscribe',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -2984,7 +2984,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -3009,7 +3009,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'CompletePayment',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -3148,7 +3148,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
eventsToStandard: [
{
@@ -3187,7 +3187,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'download',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -3249,7 +3249,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'search',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -3388,7 +3388,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
eventsToStandard: [
{
@@ -3508,7 +3508,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
eventsToStandard: [
{
@@ -3543,7 +3543,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'download',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -3681,7 +3681,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: true,
eventsToStandard: [
{
@@ -3716,7 +3716,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'download',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -3854,7 +3854,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: true,
eventsToStandard: [
{
@@ -3889,7 +3889,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'download',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -4048,7 +4048,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -4073,7 +4073,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'CompletePayment',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -4219,7 +4219,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -4244,7 +4244,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'CompletePayment',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -4394,7 +4394,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -4419,7 +4419,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'CompletePayment',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -4541,6 +4541,7 @@ export const data = [
category: 'Games',
url: 'https://www.website.com/product/path',
image_url: 'https://www.website.com/product/path.jpg',
+ brand: 'brand_name',
},
{
product_id: '345',
@@ -4573,7 +4574,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: '{{PIXEL-CODE}}',
hashUserProperties: false,
},
},
@@ -4598,7 +4599,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: '{{PIXEL-CODE}}',
event: 'CompletePayment',
event_id: '1616318632825_357',
timestamp: '2020-09-17T19:49:27Z',
@@ -4660,4 +4661,2213 @@ export const data = [
},
},
},
+ {
+ name: 'tiktok_ads',
+ description: 'Test 29 -> custom_event Pass',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ 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 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'custom_event',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ context: {
+ ad: {
+ callback: '123ATXSfe',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/pixel/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ pixel_code: '{{PIXEL-CODE}}',
+ event: 'custom_event',
+ event_id: '1616318632825_357',
+ timestamp: '2020-09-17T19:49:27Z',
+ properties: {
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ context: {
+ ad: {
+ callback: 'dummyclickId',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ partner_name: 'RudderStack',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 30 -> custom_event Failure case for flag set as false',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ 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 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'custom_event',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ context: {
+ ad: {
+ callback: '123ATXSfe',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error:
+ 'Event name (custom_event) is not valid, must be mapped to one of standard events',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'TIKTOK_ADS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 31 -> Camel Case Custom Event Pass',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ 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 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'customEvent',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ context: {
+ ad: {
+ callback: '123ATXSfe',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/pixel/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ pixel_code: '{{PIXEL-CODE}}',
+ event: 'customEvent',
+ event_id: '1616318632825_357',
+ timestamp: '2020-09-17T19:49:27Z',
+ properties: {
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ context: {
+ ad: {
+ callback: 'dummyclickId',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ partner_name: 'RudderStack',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 32 -> V2 -> Camel Case Custom Event Pass',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'customEvent',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ url: 'http://demo.mywebsite.com/purchase',
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ version: 'v2',
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: true,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source: 'web',
+ event_source_id: '{{PIXEL-CODE}}',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event: 'customEvent',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description:
+ 'Test 33 -> V2 -> Event mapped to one standard event with contents present as it is in properties',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'addToCart',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ version: 'v2',
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: true,
+ eventsToStandard: [
+ {
+ from: 'addToCart',
+ to: 'download',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source: 'web',
+ event_source_id: '{{PIXEL-CODE}}',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event: 'download',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 34 -> V2 -> Event mapped to multiple standard events and no phone',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'addToCart',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ version: 'v2',
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: true,
+ eventsToStandard: [
+ {
+ from: 'addToCart',
+ to: 'download',
+ },
+ {
+ from: 'AddToCart',
+ to: 'AddToWishlist',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source: 'web',
+ event_source_id: '{{PIXEL-CODE}}',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event: 'download',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ {
+ event: 'AddToWishlist',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 35 -> V2 -> array of external_id and phone number',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: [
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b5',
+ '1f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ],
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'addToCart',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ phone: ['+12345432', '+134234325'],
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ version: 'v2',
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: true,
+ eventsToStandard: [
+ {
+ from: 'addToCart',
+ to: 'download',
+ },
+ {
+ from: 'AddToCart',
+ to: 'AddToWishlist',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source: 'web',
+ event_source_id: '{{PIXEL-CODE}}',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event: 'download',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone: ['+12345432', '+134234325'],
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id: [
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b5',
+ '1f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ],
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ {
+ event: 'AddToWishlist',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone: ['+12345432', '+134234325'],
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id: [
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b5',
+ '1f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ],
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 36-> V2 -> Event not standard and no custom events allowed',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ 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 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ locale: 'en-US',
+ ip: '13.57.97.131',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'Product Added to Wishlist1',
+ properties: {
+ eventId: '1616318632825_357',
+ testEventCode: 'sample rudder test_event_code',
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ },
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error:
+ 'Event name (product added to wishlist1) is not valid, must be mapped to one of standard events',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'TIKTOK_ADS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 37-> V2 -> No Message type',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ event: 'Product Added to Wishlist1',
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Event type is required',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'TIKTOK_ADS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 38-> V2 -> Event not found',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Event name is required',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'TIKTOK_ADS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 39-> V2 -> Access Token not found',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ pixelCode: 'configuration',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Access Token not found. Aborting',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'TIKTOK_ADS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 40-> V2 -> Pixel Code not found. Aborting',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Pixel Code not found. Aborting',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'TIKTOK_ADS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 41 -> V2 -> One of standard event',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'abc@xyz.com',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: [
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b5',
+ '1f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ],
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'viewcontent',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ phone: ['+12345432', '+134234325'],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ version: 'v2',
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: true,
+ sendCustomEvents: false,
+ eventsToStandard: [
+ {
+ from: 'addToCart',
+ to: 'download',
+ },
+ {
+ from: 'AddToCart',
+ to: 'AddToWishlist',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source: 'web',
+ event_source_id: '{{PIXEL-CODE}}',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event: 'ViewContent',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ email: 'ee278943de84e5d6243578ee1a1057bcce0e50daad9755f45dfa64b60b13bc5d',
+ external_id: [
+ '3e0c7a51acd326b87f29596e38c22cbeb732df37bc5c8f5f524c14b55d3472db',
+ 'f8be04e62f5a3eba31c8b9380843666f28f3ab5f44a380f47fac04e9ce7b2168',
+ ],
+ ip: '13.57.97.131',
+ phone: [
+ '49a15e38bdc2572d362a924c2ddd100baed0fe29db44270d3700fcef03b18c39',
+ '5a6a7a09b18278e220312ce26d711ff7c8263d0965ee3b1d26b1b6f0ac7e71b3',
+ ],
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 42 -> V2 -> One of standard event and contents from products',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'abc@xyz.com',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: [
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b5',
+ '1f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ],
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'viewcontent',
+ properties: {
+ order_id: 1234,
+ shop_id: 4567,
+ description: 'Viewed games',
+ query: 'New age games',
+ contentType: 'product_group',
+ eventId: '1616318632825_357',
+ products: [
+ {
+ product_id: 123,
+ sku: 'G-32',
+ name: 'Monopoly',
+ price: 14,
+ quantity: 1,
+ contentType: 'product_group',
+ category: 'Games',
+ brand: 'adidas',
+ image_url: 'https://www.website.com/product/path.jpg',
+ },
+ {
+ product_id: 345,
+ sku: 'F-32',
+ name: 'UNO',
+ price: 3.45,
+ contentType: 'product_group',
+ quantity: 2,
+ },
+ ],
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ phone: ['+12345432', '+134234325'],
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ version: 'v2',
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: true,
+ sendCustomEvents: false,
+ eventsToStandard: [
+ {
+ from: 'addToCart',
+ to: 'download',
+ },
+ {
+ from: 'AddToCart',
+ to: 'AddToWishlist',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source: 'web',
+ event_source_id: '{{PIXEL-CODE}}',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event: 'ViewContent',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ order_id: '1234',
+ shop_id: '4567',
+ description: 'Viewed games',
+ query: 'New age games',
+ content_type: 'product_group',
+ contents: [
+ {
+ price: 14,
+ quantity: 1,
+ content_category: 'Games',
+ content_id: '123',
+ content_name: 'Monopoly',
+ },
+ {
+ price: 3.45,
+ quantity: 2,
+ content_id: '345',
+ content_name: 'UNO',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ email: 'ee278943de84e5d6243578ee1a1057bcce0e50daad9755f45dfa64b60b13bc5d',
+ external_id: [
+ '3e0c7a51acd326b87f29596e38c22cbeb732df37bc5c8f5f524c14b55d3472db',
+ 'f8be04e62f5a3eba31c8b9380843666f28f3ab5f44a380f47fac04e9ce7b2168',
+ ],
+ ip: '13.57.97.131',
+ phone: [
+ '49a15e38bdc2572d362a924c2ddd100baed0fe29db44270d3700fcef03b18c39',
+ '5a6a7a09b18278e220312ce26d711ff7c8263d0965ee3b1d26b1b6f0ac7e71b3',
+ ],
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 43 -> V2 -> Contents present as object in properties',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ traits: {
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'addToCart',
+ properties: {
+ eventId: '1616318632825_357',
+ contents: {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ clickId: 'dummyclickId',
+ currency: 'USD',
+ value: 46,
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ version: 'v2',
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ sendCustomEvents: true,
+ eventsToStandard: [
+ {
+ from: 'addToCart',
+ to: 'download',
+ },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source: 'web',
+ event_source_id: '{{PIXEL-CODE}}',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event: 'download',
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ content_type: 'product',
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ ],
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 44 -> Events 2.0 Event type identify not suported',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'identify',
+ event: 'contact',
+ properties: {},
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Event type identify is not supported',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'TIKTOK_ADS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads',
+ description:
+ 'Test 45-> events 1.0 build contents from properties.product.$ where length of prodicts is 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ 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 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ externalId: [
+ {
+ type: 'tiktokExternalId',
+ id: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ products: [],
+ currency: 'USD',
+ value: 46,
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ },
+ },
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: '{{PIXEL-CODE}}',
+ hashUserProperties: false,
+ },
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/pixel/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ pixel_code: '{{PIXEL-CODE}}',
+ event: 'CompletePayment',
+ event_id: '1616318632825_357',
+ timestamp: '2020-09-17T19:49:27Z',
+ properties: {
+ currency: 'USD',
+ value: 46,
+ contents: [],
+ },
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ phone_number:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'dd6ff77f54e2106661089bae4d40cdb600979bf7edc9eb65c0942ba55c7c2d7f',
+ external_id:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ },
+ partner_name: 'RudderStack',
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
];
diff --git a/test/integrations/destinations/tiktok_ads/router/data.ts b/test/integrations/destinations/tiktok_ads/router/data.ts
index a8c233c7a8..7246b8c04a 100644
--- a/test/integrations/destinations/tiktok_ads/router/data.ts
+++ b/test/integrations/destinations/tiktok_ads/router/data.ts
@@ -1,9 +1,9 @@
import { FEATURES } from '../../../../../src/v0/util/tags';
-
+import { defaultMockFns } from '../mocks';
export const data = [
{
name: 'tiktok_ads',
- description: 'Test 0',
+ description: 'Test 0 -> Events 1.0 Multiple events in single batch',
feature: FEATURES.ROUTER,
module: 'destination',
version: 'v0',
@@ -22,21 +22,13 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
ip: '13.57.97.131',
locale: 'en-US',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
externalId: [
{
type: 'tiktokExternalId',
@@ -54,18 +46,8 @@ export const data = [
eventId: '1616318632825_357',
clickId: 'dummyClickId',
contents: [
- {
- price: 8,
- quantity: 2,
- content_type: 'socks',
- content_id: '1077218',
- },
- {
- price: 30,
- quantity: 1,
- content_type: 'dress',
- content_id: '1197218',
- },
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
],
currency: 'USD',
value: 46.0,
@@ -87,12 +69,13 @@ export const data = [
sentAt: '2019-10-14T09:03:22.563Z',
},
metadata: {
- jobId: 5,
+ jobId: 1,
+ userId: 'u1',
},
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: 'dummyPixelCode',
hashUserProperties: false,
},
},
@@ -108,21 +91,13 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
locale: 'en-US',
ip: '13.57.97.131',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
externalId: [
{
type: 'tiktokExternalId',
@@ -150,18 +125,8 @@ export const data = [
},
},
contents: [
- {
- price: 8,
- quantity: 2,
- content_type: 'socks',
- content_id: '1077218',
- },
- {
- price: 30,
- quantity: 1,
- content_type: 'dress',
- content_id: '1197218',
- },
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
],
currency: 'USD',
value: 46.0,
@@ -172,12 +137,13 @@ export const data = [
sentAt: '2019-10-14T09:03:22.563Z',
},
metadata: {
- jobId: 1,
+ jobId: 2,
+ userId: 'u1',
},
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: 'dummyPixelCode',
hashUserProperties: false,
},
},
@@ -193,21 +159,13 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
locale: 'en-US',
ip: '13.57.97.131',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
externalId: [
{
type: 'tiktokExternalId',
@@ -238,18 +196,8 @@ export const data = [
ip: '13.57.97.131',
},
contents: [
- {
- price: 8,
- quantity: 2,
- content_type: 'socks',
- content_id: '1077218',
- },
- {
- price: 30,
- quantity: 1,
- content_type: 'dress',
- content_id: '1197218',
- },
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
],
currency: 'USD',
value: 46.0,
@@ -260,12 +208,13 @@ export const data = [
sentAt: '2019-10-14T09:03:22.563Z',
},
metadata: {
- jobId: 2,
+ jobId: 3,
+ userId: 'u1',
},
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: 'dummyPixelCode',
hashUserProperties: false,
},
},
@@ -281,21 +230,13 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
locale: 'en-US',
ip: '13.57.97.131',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
externalId: [
{
type: 'tiktokExternalId',
@@ -326,18 +267,8 @@ export const data = [
ip: '13.57.97.131',
},
contents: [
- {
- price: 8,
- quantity: 2,
- content_type: 'socks',
- content_id: '1077218',
- },
- {
- price: 30,
- quantity: 1,
- content_type: 'dress',
- content_id: '1197218',
- },
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
],
currency: 'USD',
value: 46.0,
@@ -349,11 +280,12 @@ export const data = [
},
metadata: {
jobId: 4,
+ userId: 'u1',
},
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: 'dummyPixelCode',
hashUserProperties: false,
},
},
@@ -382,7 +314,7 @@ export const data = [
params: {},
body: {
JSON: {
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: 'dummyPixelCode',
partner_name: 'RudderStack',
batch: [
{
@@ -392,12 +324,7 @@ export const data = [
timestamp: '2020-09-17T19:49:27Z',
properties: {
contents: [
- {
- price: 8,
- quantity: 2,
- content_type: 'socks',
- content_id: '1077218',
- },
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
{
price: 30,
quantity: 1,
@@ -409,9 +336,7 @@ export const data = [
value: 46,
},
context: {
- ad: {
- callback: 'dummyClickId',
- },
+ ad: { callback: 'dummyClickId' },
page: {
url: 'http://demo.mywebsite.com/purchase',
referrer: 'http://demo.mywebsite.com',
@@ -454,12 +379,7 @@ export const data = [
properties: {
value: 46,
contents: [
- {
- price: 8,
- quantity: 2,
- content_id: '1077218',
- content_type: 'socks',
- },
+ { price: 8, quantity: 2, content_id: '1077218', content_type: 'socks' },
{
price: 30,
quantity: 1,
@@ -495,12 +415,7 @@ export const data = [
properties: {
value: 46,
contents: [
- {
- price: 8,
- quantity: 2,
- content_id: '1077218',
- content_type: 'socks',
- },
+ { price: 8, quantity: 2, content_id: '1077218', content_type: 'socks' },
{
price: 30,
quantity: 1,
@@ -536,12 +451,7 @@ export const data = [
properties: {
value: 46,
contents: [
- {
- price: 8,
- quantity: 2,
- content_id: '1077218',
- content_type: 'socks',
- },
+ { price: 8, quantity: 2, content_id: '1077218', content_type: 'socks' },
{
price: 30,
quantity: 1,
@@ -561,17 +471,21 @@ export const data = [
files: {},
},
metadata: [
- {
- jobId: 5,
- },
{
jobId: 1,
+ userId: 'u1',
},
{
jobId: 2,
+ userId: 'u1',
+ },
+ {
+ jobId: 3,
+ userId: 'u1',
},
{
jobId: 4,
+ userId: 'u1',
},
],
batched: true,
@@ -579,7 +493,7 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: 'dummyPixelCode',
hashUserProperties: false,
},
},
@@ -591,7 +505,7 @@ export const data = [
},
{
name: 'tiktok_ads',
- description: 'Test 1',
+ description: 'Test 1 -> Events 1.0 Single Event inside batch',
feature: FEATURES.ROUTER,
module: 'destination',
version: 'v0',
@@ -610,27 +524,14 @@ export const data = [
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.0.0',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
locale: 'en-US',
ip: '13.57.97.131',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
- externalId: [
- {
- type: 'tiktokExternalId',
- id: '1234',
- },
- ],
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ externalId: [{ type: 'tiktokExternalId', id: '1234' }],
},
messageId: '84e26acc-56a5-4835-8233-591137fca468',
session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
@@ -646,27 +547,14 @@ export const data = [
url: 'http://demo.mywebsite.com/purchase',
referrer: 'http://demo.mywebsite.com',
},
- user: {
- phone_number: '+858987675687',
- email: 'sample@sample.com',
- },
+ user: { phone_number: '+858987675687', email: 'sample@sample.com' },
userAgent:
'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
ip: '13.57.97.131',
},
contents: [
- {
- price: 8,
- quantity: 2,
- content_type: 'socks',
- content_id: '1077218',
- },
- {
- price: 30,
- quantity: 1,
- content_type: 'dress',
- content_id: '1197218',
- },
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
],
currency: 'USD',
value: 46.0,
@@ -678,11 +566,12 @@ export const data = [
},
metadata: {
jobId: 3,
+ userId: 'u1',
},
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: 'dummyPixelCode',
hashUserProperties: true,
},
},
@@ -723,22 +612,12 @@ export const data = [
},
event: 'AddToWishlist',
event_id: '1616318632825_357',
- pixel_code: 'A1T8T4UYGVIQA8ORZMX9',
+ pixel_code: 'dummyPixelCode',
partner_name: 'RudderStack',
properties: {
contents: [
- {
- content_id: '1077218',
- content_type: 'socks',
- price: 8,
- quantity: 2,
- },
- {
- content_id: '1197218',
- content_type: 'dress',
- price: 30,
- quantity: 1,
- },
+ { content_id: '1077218', content_type: 'socks', price: 8, quantity: 2 },
+ { content_id: '1197218', content_type: 'dress', price: 30, quantity: 1 },
],
currency: 'USD',
value: 46,
@@ -764,13 +643,14 @@ export const data = [
destination: {
Config: {
accessToken: 'dummyAccessToken',
- pixelCode: 'A1T8T4UYGVIQA8ORZMX9',
+ pixelCode: 'dummyPixelCode',
hashUserProperties: true,
},
},
metadata: [
{
jobId: 3,
+ userId: 'u1',
},
],
statusCode: 200,
@@ -780,4 +660,2144 @@ export const data = [
},
},
},
+ {
+ name: 'tiktok_ads',
+ description:
+ 'Test 2 -> Events 2.0 Single event is mapped to multiple tiktok event in config and exceeding max batch size',
+ feature: FEATURES.ROUTER,
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id5' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id1' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'addToCart',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id2' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 3,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id4' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 4,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ destType: 'tiktok_ads',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id5',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id1',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id1',
+ },
+ event: 'download',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ {
+ jobId: 1,
+ userId: 'u1',
+ },
+ {
+ jobId: 2,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id2',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id4',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ {
+ jobId: 3,
+ userId: 'u1',
+ },
+ {
+ jobId: 4,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: 'tiktok_ads',
+ description:
+ 'Test 3 -> Events 2.0 Single event is mapped to single tiktok event in config and over the max batch limit',
+ feature: FEATURES.ROUTER,
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id5' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id1' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id2' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 3,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id4' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 4,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ destType: 'tiktok_ads',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id5',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id1',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id2',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ {
+ jobId: 1,
+ userId: 'u1',
+ },
+ {
+ jobId: 2,
+ userId: 'u1',
+ },
+ {
+ jobId: 3,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id4',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ {
+ jobId: 4,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 4 -> One input event is invalid with one event to multiple events',
+ feature: FEATURES.ROUTER,
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id5' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id1' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'abc',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id2' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 3,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id4' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 4,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ destType: 'tiktok_ads',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id5',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id2',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id4',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ {
+ jobId: 1,
+ userId: 'u1',
+ },
+ {
+ jobId: 3,
+ userId: 'u1',
+ },
+ {
+ jobId: 4,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ batched: false,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ hashUserProperties: false,
+ pixelCode: 'dummyPixelCode',
+ version: 'v2',
+ },
+ },
+ error: 'Event name (abc) is not valid, must be mapped to one of standard events',
+ metadata: [
+ {
+ jobId: 2,
+ userId: 'u1',
+ },
+ ],
+ statTags: {
+ destType: 'TIKTOK_ADS',
+ feature: 'router',
+ implementation: 'native',
+ module: 'destination',
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ },
+ statusCode: 400,
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 5 -> Some input events are test events with one event to multiple events',
+ feature: FEATURES.ROUTER,
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id5' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id1' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'addToCart',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id2' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ testEventCode: 'Some test event code for testing setup',
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 3,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id4' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 4,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ destType: 'tiktok_ads',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: {
+ url: 'http://demo.mywebsite.com/purchase',
+ referrer: 'http://demo.mywebsite.com',
+ },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id5',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id1',
+ },
+ event: 'CompletePayment',
+ },
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id1',
+ },
+ event: 'download',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ {
+ jobId: 1,
+ userId: 'u1',
+ },
+ {
+ jobId: 2,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id4',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ metadata: [
+ {
+ jobId: 4,
+ userId: 'u1',
+ },
+ ],
+ batched: true,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ test_event_code: 'Some test event code for testing setup',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id2',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 3,
+ userId: 'u1',
+ },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
+ {
+ name: 'tiktok_ads',
+ description: 'Test 6 -> All input events are test events',
+ feature: FEATURES.ROUTER,
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: {
+ input: [
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id5' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ testEventCode: 'TEST_EVENT_CODE',
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 1,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ message: {
+ anonymousId: '21e13f4bc7ceddad',
+ channel: 'web',
+ context: {
+ userAgent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ ip: '13.57.97.131',
+ locale: 'en-US',
+ externalId: [{ type: 'tiktokExternalId', id: 'id2' }],
+ },
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ session_id: '3049dc4c-5a95-4ccd-a3e7-d74a7e411f22',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ timestamp: '2020-09-17T19:49:27Z',
+ type: 'track',
+ event: 'checkout step completed',
+ properties: {
+ testEventCode: 'TEST_EVENT_CODE',
+ eventId: '1616318632825_357',
+ clickId: 'dummyClickId',
+ contents: [
+ { price: 8, quantity: 2, content_type: 'socks', content_id: '1077218' },
+ { price: 30, quantity: 1, content_type: 'dress', content_id: '1197218' },
+ ],
+ currency: 'USD',
+ value: 46,
+ url: 'http://demo.mywebsite.com/purchase',
+ phone: '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ email: 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 2,
+ userId: 'u1',
+ },
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ destType: 'tiktok_ads',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ test_event_code: 'TEST_EVENT_CODE',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id5',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 1,
+ userId: 'u1',
+ },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ eventsToStandard: [
+ { from: 'addToCart', to: 'CompletePayment' },
+ { from: 'addToCart', to: 'download' },
+ ],
+ },
+ },
+ },
+ {
+ batchedRequest: [
+ {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/event/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_source_id: 'dummyPixelCode',
+ event_source: 'web',
+ partner_name: 'RudderStack',
+ test_event_code: 'TEST_EVENT_CODE',
+ data: [
+ {
+ event_id: '1616318632825_357',
+ event_time: 1600372167,
+ properties: {
+ contents: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'socks',
+ content_id: '1077218',
+ },
+ {
+ price: 30,
+ quantity: 1,
+ content_type: 'dress',
+ content_id: '1197218',
+ },
+ ],
+ content_type: 'product',
+ currency: 'USD',
+ value: 46,
+ },
+ page: { url: 'http://demo.mywebsite.com/purchase' },
+ user: {
+ locale: 'en-US',
+ email:
+ 'f0e388f53921a51f0bb0fc8a2944109ec188b59172935d8f23020b1614cc44bc',
+ phone:
+ '2f9d2b4df907e5c9a7b3434351b55700167b998a83dc479b825096486ffcf4ea',
+ ip: '13.57.97.131',
+ user_agent:
+ 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion',
+ external_id: 'id2',
+ },
+ event: 'CompletePayment',
+ },
+ ],
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ },
+ ],
+ metadata: [
+ {
+ jobId: 2,
+ userId: 'u1',
+ },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ pixelCode: 'dummyPixelCode',
+ hashUserProperties: false,
+ version: 'v2',
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ mockFns: defaultMockFns,
+ },
];
diff --git a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts
index a4ff796f37..2b9341b851 100644
--- a/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts
+++ b/test/integrations/destinations/tiktok_ads_offline_events/processor/data.ts
@@ -1,618 +1,617 @@
export const data = [
- {
- "name": "tiktok_ads_offline_events",
- "description": "Test 0",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "Config": {
- "accessToken": "dummyAccessToken",
- "hashUserProperties": true
- }
- },
- "message": {
- "type": "Identify",
- "userId": "yash001",
- "originalTimestamp": "2019-10-14T09:03:17.562Z"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "statusCode": 400,
- "error": "Event type identify is not supported",
- "statTags": {
- "errorCategory": "dataValidation",
- "errorType": "instrumentation",
- "destType": "TIKTOK_ADS_OFFLINE_EVENTS",
- "module": "destination",
- "implementation": "native",
- "feature": "processor"
- }
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_ads_offline_events",
- "description": "Test 1",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "Config": {
- "accessToken": "dummyAccessToken",
- "hashUserProperties": false
- }
- },
- "message": {
- "event": "subscribe",
- "context": {
- "traits": {
- "phone": "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646"
- },
- "channel": "web"
- },
- "properties": {
- "eventSetId": "7181537436256731137",
- "eventId": "1616318632825_352",
- "order_id": "abc_xyz",
- "shop_id": "123abc",
- "currency": "USD",
- "value": 46,
- "price": 8,
- "quantity": 2,
- "content_type": "product1234",
- "product_id": "1077218",
- "name": "socks",
- "category": "Men's cloth"
- },
- "type": "track",
- "userId": "eventIdn01",
- "timestamp": "2023-01-03"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "event_set_id": "7181537436256731137",
- "event_id": "1616318632825_352",
- "timestamp": "2023-01-03",
- "properties": {
- "order_id": "abc_xyz",
- "shop_id": "123abc",
- "currency": "USD",
- "value": 46,
- "event_channel": "web",
- "contents": [
- {
- "content_name": "socks",
- "content_type": "product1234",
- "content_category": "Men's cloth",
- "content_id": "1077218",
- "price": 8,
- "quantity": 2
- }
- ]
- },
- "event": "Subscribe",
- "partner_name": "RudderStack",
- "context": {
- "user": {
- "phone_numbers": [
- "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646"
- ]
- }
- }
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "event_set_id": "7181537436256731137",
- "userId": ""
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_ads_offline_events",
- "description": "Test 2",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "Config": {
- "accessToken": "dummyAccessToken",
- "hashUserProperties": true
- }
- },
- "message": {
- "event": "subscribe",
- "context": {
- "traits": {
- "phone": "1234567890"
- },
- "channel": "web"
- },
- "properties": {
- "eventSetId": "7181537436256731137",
- "eventId": "1616318632825_352",
- "prop1": "val1"
- },
- "type": "track",
- "userId": "eventIdn01",
- "timestamp": "2023-01-03"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "event_set_id": "7181537436256731137",
- "event_id": "1616318632825_352",
- "timestamp": "2023-01-03",
- "properties": {
- "event_channel": "web"
- },
- "event": "Subscribe",
- "partner_name": "RudderStack",
- "context": {
- "user": {
- "phone_numbers": [
- "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646"
- ]
- }
- }
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "event_set_id": "7181537436256731137",
- "userId": ""
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_ads_offline_events",
- "description": "Test 3",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "Config": {
- "accessToken": "dummyAccessToken",
- "hashUserProperties": true,
- "eventsToStandard": [
- {
- "from": "RandomEvent",
- "to": "SubmitForm"
- }
- ]
- }
- },
- "message": {
- "event": "RandomEvent",
- "context": {
- "traits": {
- "phone": "1234567890"
- },
- "channel": "web"
- },
- "properties": {
- "eventSetId": "7185009018564395009",
- "eventId": "1616318632003_004",
- "prop1": "val1"
- },
- "userId": "eventIdn01",
- "timestamp": "2023-01-03",
- "type": "track"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "event_set_id": "7185009018564395009",
- "event_id": "1616318632003_004",
- "timestamp": "2023-01-03",
- "properties": {
- "event_channel": "web"
- },
- "event": "SubmitForm",
- "partner_name": "RudderStack",
- "context": {
- "user": {
- "phone_numbers": [
- "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646"
- ]
- }
- }
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "event_set_id": "7185009018564395009",
- "userId": ""
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_ads_offline_events",
- "description": "Test 4",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "Config": {
- "hashUserProperties": true
- }
- },
- "message": {
- "type": "track",
- "userId": "yash001",
- "originalTimestamp": "2019-10-14T09:03:17.562Z"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "statusCode": 400,
- "error": "Access Token not found",
- "statTags": {
- "errorCategory": "dataValidation",
- "errorType": "configuration",
- "destType": "TIKTOK_ADS_OFFLINE_EVENTS",
- "module": "destination",
- "implementation": "native",
- "feature": "processor"
- }
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_ads_offline_events",
- "description": "Test 5",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "Config": {
- "accessToken": "dummyAccessToken",
- "hashUserProperties": true
- }
- },
- "message": {
- "event": "subscribe",
- "context": {
- "traits": {
- "phone": "1234567890",
- "email": "random@mail.com"
- },
- "channel": "web"
- },
- "properties": {
- "eventSetId": "7181537436256731137",
- "eventId": "1616318632825_352",
- "products": [
- {
- "price": 8,
- "quantity": 2,
- "content_type": "product1",
- "product_id": "1077218",
- "name": "socks",
- "category": "Men's cloth"
- },
- {
- "price": 18,
- "quantity": 12,
- "content_type": "product2",
- "product_id": "1077219",
- "name": "socks1",
- "category": "Men's cloth1"
- }
- ]
- },
- "type": "track",
- "userId": "eventIdn01",
- "timestamp": "2023-01-03"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "event_set_id": "7181537436256731137",
- "event_id": "1616318632825_352",
- "timestamp": "2023-01-03",
- "properties": {
- "event_channel": "web",
- "contents": [
- {
- "content_name": "socks",
- "content_type": "product1",
- "content_category": "Men's cloth",
- "content_id": "1077218",
- "price": 8,
- "quantity": 2
- },
- {
- "content_name": "socks1",
- "content_type": "product2",
- "content_category": "Men's cloth1",
- "content_id": "1077219",
- "price": 18,
- "quantity": 12
- }
- ]
- },
- "event": "Subscribe",
- "partner_name": "RudderStack",
- "context": {
- "user": {
- "emails": [
- "d9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16"
- ],
- "phone_numbers": [
- "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646"
- ]
- }
- }
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "event_set_id": "7181537436256731137",
- "userId": ""
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_ads_offline_events",
- "description": "Test 6",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "destination": {
- "Config": {
- "accessToken": "dummyAccessToken",
- "hashUserProperties": true,
- "eventsToStandard": [
- {
- "from": "CompletePayment",
- "to": "Purchase"
- }
- ]
- }
- },
- "message": {
- "type": "track",
- "event": "CompletePayment",
- "sentAt": "2023-03-22T00:02:33.802Z",
- "traits": {
- "email": [
- "efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900",
- "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f"
- ],
- "phone": [
- "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05",
- "078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f"
- ]
- },
- "userId": "60241286212",
- "channel": "sources",
- "context": {
- "sources": {
- "job_id": "2N4WuoNQpGYmCPASUvnV86QyhY4/Syncher",
- "version": "v1.20.0",
- "job_run_id": "cgd4a063b2fn2e1j0q90",
- "task_run_id": "cgd4a063b2fn2e1j0qa0"
- }
- },
- "recordId": "16322",
- "rudderId": "5b4ed73f-69aa-4198-88d1-3d4d509acbf1",
- "messageId": "cgd4b663b2fn2e1j8th0",
- "timestamp": "2023-03-22T00:02:33.170Z",
- "properties": {
- "phone": "c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05",
- "value": 32.839999999999996,
- "emails": "[\"efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900\",\"078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]",
- "eventId": "8965fb56-090f-47a5-aa7f-bbab22d9ec90",
- "currency": "USD",
- "order_id": 60241286212,
- "eventSetId": "7211223771099742210",
- "event_name": "CompletePayment"
- },
- "receivedAt": "2023-03-22T00:02:33.171Z",
- "request_ip": "10.7.78.187",
- "anonymousId": "60241286212",
- "originalTimestamp": "2023-03-22T00:02:33.802Z"
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/offline/track/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "event_set_id": "7211223771099742210",
- "event_id": "8965fb56-090f-47a5-aa7f-bbab22d9ec90",
- "timestamp": "2023-03-22T00:02:33.170Z",
- "properties": {
- "order_id": 60241286212,
- "currency": "USD",
- "value": 32.839999999999996
- },
- "event": "Purchase",
- "partner_name": "RudderStack",
- "context": {
- "user": {
- "emails": [
- "4dc75b075057df6f6b729e74a9feed1244dcf8ceb7903eaba13203f3268ae4b9",
- "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68"
- ],
- "phone_numbers": [
- "28b7b205c2936d2ded022d2587fb2677a76e560e921b3ad615b739b0238baa5d",
- "77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68"
- ]
- }
- }
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "event_set_id": "7211223771099742210",
- "userId": ""
- },
- "statusCode": 200
- }
- ]
- }
- }
- }
-]
\ No newline at end of file
+ {
+ name: 'tiktok_ads_offline_events',
+ description: 'Test 0',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ hashUserProperties: true,
+ },
+ },
+ message: {
+ type: 'Identify',
+ userId: 'yash001',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Event type identify is not supported',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'instrumentation',
+ destType: 'TIKTOK_ADS_OFFLINE_EVENTS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads_offline_events',
+ description: 'Test 1',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ hashUserProperties: false,
+ },
+ },
+ message: {
+ event: 'subscribe',
+ context: {
+ traits: {
+ phone: 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646',
+ },
+ channel: 'web',
+ },
+ properties: {
+ eventSetId: '7181537436256731137',
+ eventId: '1616318632825_352',
+ order_id: 'abc_xyz',
+ shop_id: '123abc',
+ currency: 'USD',
+ value: 46,
+ price: 8,
+ quantity: 2,
+ content_type: 'product1234',
+ product_id: '1077218',
+ name: 'socks',
+ category: "Men's cloth",
+ },
+ type: 'track',
+ userId: 'eventIdn01',
+ timestamp: '2023-01-03',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_set_id: '7181537436256731137',
+ event_id: '1616318632825_352',
+ timestamp: '2023-01-03',
+ properties: {
+ order_id: 'abc_xyz',
+ shop_id: '123abc',
+ currency: 'USD',
+ value: 46,
+ event_channel: 'web',
+ contents: [
+ {
+ content_name: 'socks',
+ content_type: 'product1234',
+ content_category: "Men's cloth",
+ content_id: '1077218',
+ price: 8,
+ quantity: 2,
+ },
+ ],
+ },
+ event: 'Subscribe',
+ partner_name: 'RudderStack',
+ context: {
+ user: {
+ phone_numbers: [
+ 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646',
+ ],
+ },
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ event_set_id: '7181537436256731137',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads_offline_events',
+ description: 'Test 2',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ hashUserProperties: true,
+ },
+ },
+ message: {
+ event: 'subscribe',
+ context: {
+ traits: {
+ phone: '1234567890',
+ },
+ channel: 'web',
+ },
+ properties: {
+ eventSetId: '7181537436256731137',
+ eventId: '1616318632825_352',
+ prop1: 'val1',
+ },
+ type: 'track',
+ userId: 'eventIdn01',
+ timestamp: '2023-01-03',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_set_id: '7181537436256731137',
+ event_id: '1616318632825_352',
+ timestamp: '2023-01-03',
+ properties: {
+ event_channel: 'web',
+ },
+ event: 'Subscribe',
+ partner_name: 'RudderStack',
+ context: {
+ user: {
+ phone_numbers: [
+ 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646',
+ ],
+ },
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ event_set_id: '7181537436256731137',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads_offline_events',
+ description: 'Test 3',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ hashUserProperties: true,
+ eventsToStandard: [
+ {
+ from: 'RandomEvent',
+ to: 'SubmitForm',
+ },
+ ],
+ },
+ },
+ message: {
+ event: 'RandomEvent',
+ context: {
+ traits: {
+ phone: '1234567890',
+ },
+ channel: 'web',
+ },
+ properties: {
+ eventSetId: '7185009018564395009',
+ eventId: '1616318632003_004',
+ prop1: 'val1',
+ },
+ userId: 'eventIdn01',
+ timestamp: '2023-01-03',
+ type: 'track',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_set_id: '7185009018564395009',
+ event_id: '1616318632003_004',
+ timestamp: '2023-01-03',
+ properties: {
+ event_channel: 'web',
+ },
+ event: 'SubmitForm',
+ partner_name: 'RudderStack',
+ context: {
+ user: {
+ phone_numbers: [
+ 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646',
+ ],
+ },
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ event_set_id: '7185009018564395009',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads_offline_events',
+ description: 'Test 4',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ hashUserProperties: true,
+ },
+ },
+ message: {
+ type: 'track',
+ userId: 'yash001',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ statusCode: 400,
+ error: 'Access Token not found',
+ statTags: {
+ errorCategory: 'dataValidation',
+ errorType: 'configuration',
+ destType: 'TIKTOK_ADS_OFFLINE_EVENTS',
+ module: 'destination',
+ implementation: 'native',
+ feature: 'processor',
+ },
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads_offline_events',
+ description: 'Test 5',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ hashUserProperties: true,
+ },
+ },
+ message: {
+ event: 'subscribe',
+ context: {
+ traits: {
+ phone: '1234567890',
+ email: 'random@mail.com',
+ },
+ channel: 'web',
+ },
+ properties: {
+ eventSetId: '7181537436256731137',
+ eventId: '1616318632825_352',
+ products: [
+ {
+ price: 8,
+ quantity: 2,
+ content_type: 'product1',
+ product_id: '1077218',
+ name: 'socks',
+ category: "Men's cloth",
+ },
+ {
+ price: 18,
+ quantity: 12,
+ content_type: 'product2',
+ product_id: '1077219',
+ name: 'socks1',
+ category: "Men's cloth1",
+ },
+ ],
+ },
+ type: 'track',
+ userId: 'eventIdn01',
+ timestamp: '2023-01-03',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_set_id: '7181537436256731137',
+ event_id: '1616318632825_352',
+ timestamp: '2023-01-03',
+ properties: {
+ event_channel: 'web',
+ contents: [
+ {
+ content_name: 'socks',
+ content_type: 'product1',
+ content_category: "Men's cloth",
+ content_id: '1077218',
+ price: 8,
+ quantity: 2,
+ },
+ {
+ content_name: 'socks1',
+ content_type: 'product2',
+ content_category: "Men's cloth1",
+ content_id: '1077219',
+ price: 18,
+ quantity: 12,
+ },
+ ],
+ },
+ event: 'Subscribe',
+ partner_name: 'RudderStack',
+ context: {
+ user: {
+ emails: ['d9fcca64ec1b250da4261a3f89a8e0f7749c4e0f5a1a918e5397194c8b5a9f16'],
+ phone_numbers: [
+ 'c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646',
+ ],
+ },
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ event_set_id: '7181537436256731137',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+ {
+ name: 'tiktok_ads_offline_events',
+ description: 'Test 6',
+ feature: 'processor',
+ module: 'destination',
+ version: 'v0',
+ input: {
+ request: {
+ body: [
+ {
+ destination: {
+ Config: {
+ accessToken: 'dummyAccessToken',
+ hashUserProperties: true,
+ eventsToStandard: [
+ {
+ from: 'CompletePayment',
+ to: 'Purchase',
+ },
+ ],
+ },
+ },
+ message: {
+ type: 'track',
+ event: 'CompletePayment',
+ sentAt: '2023-03-22T00:02:33.802Z',
+ traits: {
+ email: [
+ 'efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900',
+ '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f',
+ ],
+ phone: [
+ 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05',
+ '078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f',
+ ],
+ },
+ userId: '60241286212',
+ channel: 'sources',
+ context: {
+ sources: {
+ job_id: '2N4WuoNQpGYmCPASUvnV86QyhY4/Syncher',
+ version: 'v1.20.0',
+ job_run_id: 'cgd4a063b2fn2e1j0q90',
+ task_run_id: 'cgd4a063b2fn2e1j0qa0',
+ },
+ },
+ recordId: '16322',
+ rudderId: '5b4ed73f-69aa-4198-88d1-3d4d509acbf1',
+ messageId: 'cgd4b663b2fn2e1j8th0',
+ timestamp: '2023-03-22T00:02:33.170Z',
+ properties: {
+ phone: 'c4994d14e724936f1169147dddf1673a09af69b55cc54bc695dbe246bd093b05',
+ value: 32.839999999999996,
+ emails:
+ '["efaaf5c8803af4fbf305d7a110c832673d89ed40983770329092fd04b0ba7900","078d6c8e19f24093368d1712d7801970467f59216f7ccc087bf81b91e0e1f68f","","","","","","","",""]',
+ eventId: '8965fb56-090f-47a5-aa7f-bbab22d9ec90',
+ currency: 'USD',
+ order_id: 60241286212,
+ eventSetId: '7211223771099742210',
+ event_name: 'CompletePayment',
+ },
+ receivedAt: '2023-03-22T00:02:33.171Z',
+ request_ip: '10.7.78.187',
+ anonymousId: '60241286212',
+ originalTimestamp: '2023-03-22T00:02:33.802Z',
+ },
+ },
+ ],
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: [
+ {
+ output: {
+ version: '1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/track/',
+ headers: {
+ 'Access-Token': 'dummyAccessToken',
+ 'Content-Type': 'application/json',
+ },
+ params: {},
+ body: {
+ JSON: {
+ event_set_id: '7211223771099742210',
+ event_id: '8965fb56-090f-47a5-aa7f-bbab22d9ec90',
+ timestamp: '2023-03-22T00:02:33.170Z',
+ properties: {
+ order_id: 60241286212,
+ currency: 'USD',
+ value: 32.839999999999996,
+ },
+ event: 'Purchase',
+ partner_name: 'RudderStack',
+ context: {
+ user: {
+ emails: [
+ '4dc75b075057df6f6b729e74a9feed1244dcf8ceb7903eaba13203f3268ae4b9',
+ '77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68',
+ ],
+ phone_numbers: [
+ '28b7b205c2936d2ded022d2587fb2677a76e560e921b3ad615b739b0238baa5d',
+ '77b639edeb3cd6c801ea05176b8acbfa38d5f38490b764cd0c80756d0cf9ec68',
+ ],
+ },
+ },
+ },
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
+ files: {},
+ event_set_id: '7211223771099742210',
+ userId: '',
+ },
+ statusCode: 200,
+ },
+ ],
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts b/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts
index c479da741b..15b5f6674d 100644
--- a/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts
+++ b/test/integrations/destinations/tiktok_ads_offline_events/router/data.ts
@@ -1,10 +1,8 @@
-import { FEATURES } from '../../../../../src/v0/util/tags';
-
export const data = [
{
name: 'tiktok_ads_offline_events',
description: 'Test 0',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -12,30 +10,20 @@ export const data = [
body: {
input: [
{
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
- Config: {
- accessToken: 'dummyAccessToken',
- hashUserProperties: true,
- },
+ Config: { accessToken: 'dummyAccessToken', hashUserProperties: true },
},
message: {
event: 'subscribe',
- context: {
- traits: {
- phone: '1234567890',
- },
- channel: 'web',
- },
+ context: { traits: { phone: '1234567890' }, channel: 'web' },
properties: {
eventSetId: '7181537436256731137',
eventId: '1616318632825_352',
order_id: 'abc_xyz',
shop_id: '123abc',
currency: 'USD',
- value: 46.0,
+ value: 46,
price: 8,
quantity: 2,
content_type: 'product1234',
@@ -49,22 +37,14 @@ export const data = [
},
},
{
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
- Config: {
- accessToken: 'dummyAccessToken',
- hashUserProperties: true,
- },
+ Config: { accessToken: 'dummyAccessToken', hashUserProperties: true },
},
message: {
event: 'subscribe',
context: {
- traits: {
- phone: '1234567890',
- email: 'random@mail.com',
- },
+ traits: { phone: '1234567890', email: 'random@mail.com' },
channel: 'web',
},
properties: {
@@ -111,10 +91,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/batch/',
- headers: {
- 'Access-Token': 'dummyAccessToken',
- 'Content-Type': 'application/json',
- },
+ headers: { 'Access-Token': 'dummyAccessToken', 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -149,7 +126,7 @@ export const data = [
],
event_channel: 'web',
currency: 'USD',
- value: 46.0,
+ value: 46,
},
},
{
@@ -199,18 +176,11 @@ export const data = [
files: {},
},
destination: {
- Config: {
- accessToken: 'dummyAccessToken',
- hashUserProperties: true,
- },
+ Config: { accessToken: 'dummyAccessToken', hashUserProperties: true },
},
metadata: [
- {
- jobId: 1,
- },
- {
- jobId: 2,
- },
+ { jobId: 1, userId: 'u1' },
+ { jobId: 2, userId: 'u1' },
],
statusCode: 200,
},
@@ -222,7 +192,7 @@ export const data = [
{
name: 'tiktok_ads_offline_events',
description: 'Test 1',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -230,28 +200,18 @@ export const data = [
body: {
input: [
{
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
destination: {
- Config: {
- accessToken: 'dummyAccessToken',
- hashUserProperties: true,
- },
+ Config: { accessToken: 'dummyAccessToken', hashUserProperties: true },
},
message: {
event: 'subscribe',
- context: {
- traits: {
- phone: '1234567890',
- },
- channel: 'web',
- },
+ context: { traits: { phone: '1234567890' }, channel: 'web' },
properties: {
eventSetId: '6071537445256731123',
eventId: '1616318632825_352',
currency: 'USD',
- value: 46.0,
+ value: 46,
price: 8,
content_type: 'product1234',
},
@@ -277,10 +237,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://business-api.tiktok.com/open_api/v1.3/offline/batch/',
- headers: {
- 'Access-Token': 'dummyAccessToken',
- 'Content-Type': 'application/json',
- },
+ headers: { 'Access-Token': 'dummyAccessToken', 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -301,15 +258,10 @@ export const data = [
},
},
properties: {
- contents: [
- {
- price: 8,
- content_type: 'product1234',
- },
- ],
+ contents: [{ price: 8, content_type: 'product1234' }],
event_channel: 'web',
currency: 'USD',
- value: 46.0,
+ value: 46,
},
},
],
@@ -321,16 +273,9 @@ export const data = [
files: {},
},
destination: {
- Config: {
- accessToken: 'dummyAccessToken',
- hashUserProperties: true,
- },
+ Config: { accessToken: 'dummyAccessToken', hashUserProperties: true },
},
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
statusCode: 200,
},
],
@@ -341,7 +286,7 @@ export const data = [
{
name: 'tiktok_ads_offline_events',
description: 'Test 2',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -349,26 +294,13 @@ export const data = [
body: {
input: [
{
- metadata: {
- jobId: 4,
- },
+ metadata: { jobId: 4, userId: 'u1' },
destination: {
- Config: {
- accessToken: 'dummyAccessToken',
- hashUserProperties: true,
- },
+ Config: { accessToken: 'dummyAccessToken', hashUserProperties: true },
},
message: {
- context: {
- traits: {
- phone: '1234567890',
- },
- channel: 'web',
- },
- properties: {
- eventSetId: '2345676543',
- eventId: '1616318632825_352',
- },
+ context: { traits: { phone: '1234567890' }, channel: 'web' },
+ properties: { eventSetId: '2345676543', eventId: '1616318632825_352' },
type: 'track',
userId: 'eventIdn01',
timestamp: '2023-01-03',
@@ -386,18 +318,11 @@ export const data = [
output: [
{
destination: {
- Config: {
- accessToken: 'dummyAccessToken',
- hashUserProperties: true,
- },
+ Config: { accessToken: 'dummyAccessToken', hashUserProperties: true },
},
batched: false,
error: 'Event name is required',
- metadata: [
- {
- jobId: 4,
- },
- ],
+ metadata: [{ jobId: 4, userId: 'u1' }],
statTags: {
errorCategory: 'dataValidation',
errorType: 'instrumentation',
diff --git a/test/integrations/destinations/tiktok_audience/processor/data.ts b/test/integrations/destinations/tiktok_audience/processor/data.ts
index a715aa2f72..42f235c1a4 100644
--- a/test/integrations/destinations/tiktok_audience/processor/data.ts
+++ b/test/integrations/destinations/tiktok_audience/processor/data.ts
@@ -1,854 +1,854 @@
export const data = [
- {
- "name": "tiktok_audience",
- "description": "Test 1: Containing SHA256 traits only",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "message": {
- "userId": "user 1",
- "type": "audiencelist",
- "properties": {
- "listData": {
- "add": [
- {
- "EMAIL_SHA256": "alex@email.com"
- },
- {
- "EMAIL_SHA256": "amy@abc.com"
- },
- {
- "EMAIL_SHA256": "van@abc.com"
- }
- ],
- "remove": [
- {
- "EMAIL_SHA256": "alex@email.com"
- },
- {
- "EMAIL_SHA256": "amy@abc.com"
- },
- {
- "EMAIL_SHA256": "van@abc.com"
- }
- ]
- }
- },
- "context": {
- "ip": "14.5.67.21",
- "library": {
- "name": "http"
- },
- "externalId": [
- {
- "type": "TIKTOK_AUDIENCE-23856594064540489",
- "identifierType": "EMAIL_SHA256"
- }
- ],
- "destinationFields": "EMAIL_SHA256"
- },
- "timestamp": "2020-02-02T00:23:09.544Z"
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "destination": {
- "DestinationDefinition": {
- "Config": {
- "cdkV2Enabled": true
- }
- },
- "Config": {
- "isHashRequired": true,
- "registerDeviceOrBrowserApiKey": true,
- "apiKey": "intercomApiKey",
- "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
- "collectContext": false
- }
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "batch_data": [
- [
- {
- "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ]
- ],
- "id_schema": [
- "EMAIL_SHA256"
- ],
- "advertiser_ids": [
- "dummyAdverTiserID"
- ],
- "action": "add"
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "userId": ""
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "statusCode": 200
- },
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "batch_data": [
- [
- {
- "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ]
- ],
- "id_schema": [
- "EMAIL_SHA256"
- ],
- "advertiser_ids": [
- "dummyAdverTiserID"
- ],
- "action": "delete"
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "userId": ""
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_audience",
- "description": "Test 2: Containing SHA256 and MD5 traits",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "message": {
- "userId": "user 1",
- "type": "audiencelist",
- "properties": {
- "listData": {
- "add": [
- {
- "EMAIL_SHA256": "alex@email.com",
- "AAID_MD5": "1234567"
- },
- {
- "EMAIL_SHA256": "amy@abc.com",
- "AAID_MD5": "1234568"
- },
- {
- "EMAIL_SHA256": "van@abc.com",
- "AAID_MD5": "1234569"
- }
- ],
- "remove": [
- {
- "EMAIL_SHA256": "alex@email.com",
- "AAID_MD5": "1234570"
- },
- {
- "EMAIL_SHA256": "amy@abc.com",
- "AAID_MD5": "1234571"
- },
- {
- "EMAIL_SHA256": "van@abc.com",
- "AAID_MD5": "1234572"
- }
- ]
- }
- },
- "context": {
- "ip": "14.5.67.21",
- "library": {
- "name": "http"
- },
- "externalId": [
- {
- "type": "TIKTOK_AUDIENCE-23856594064540489",
- "identifierType": "EMAIL_SHA256"
- }
- ],
- "destinationFields": "EMAIL_SHA256, AAID_MD5"
- },
- "timestamp": "2020-02-02T00:23:09.544Z"
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "destination": {
- "DestinationDefinition": {
- "Config": {
- "cdkV2Enabled": true
- }
- },
- "Config": {
- "isHashRequired": true,
- "registerDeviceOrBrowserApiKey": true,
- "apiKey": "intercomApiKey",
- "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
- "collectContext": false
- }
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "batch_data": [
- [
- {
- "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "fcea920f7412b5da7be0cf42b8c93759",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "fe743d8d97aa7dfc6c93ccdc2e749513",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "e36a2f90240e9e84483504fd4a704452",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ]
- ],
- "id_schema": [
- "EMAIL_SHA256",
- "AAID_MD5"
- ],
- "advertiser_ids": [
- "dummyAdverTiserID"
- ],
- "action": "add"
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "userId": ""
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "statusCode": 200
- },
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "batch_data": [
- [
- {
- "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "c1abd65fea29d573ddef1bce925e3276",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "7298110702a080dfc6903f13333eb04a",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "d9cb68b1fd3b9d32abc5f4cab8b42b68",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ]
- ],
- "id_schema": [
- "EMAIL_SHA256",
- "AAID_MD5"
- ],
- "advertiser_ids": [
- "dummyAdverTiserID"
- ],
- "action": "delete"
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "userId": ""
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_audience",
- "description": "Test 3: Containing all possible traits",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "message": {
- "userId": "user 1",
- "type": "audiencelist",
- "properties": {
- "listData": {
- "add": [
- {
- "EMAIL_SHA256": "alex@email.com",
- "PHONE_SHA256": "+129988776655",
- "IDFA_SHA256": "1234lkasfjdalj12321",
- "AAID_SHA256": "000999OOOQQQQ",
- "AAID_MD5": "000999OOOQQQQ",
- "IDFA_MD5": "1234lkasfjdalj12321"
- },
- {
- "EMAIL_SHA256": "amy@abc.com",
- "PHONE_SHA256": "+129988776677",
- "IDFA_SHA256": "1234lkasfjdalj114455",
- "AAID_SHA256": "000999OOOPPPP",
- "AAID_MD5": "000999OOOPPPP",
- "IDFA_MD5": "1234lkasfjdalj114455"
- }
- ]
- }
- },
- "context": {
- "ip": "14.5.67.21",
- "library": {
- "name": "http"
- },
- "externalId": [
- {
- "type": "TIKTOK_AUDIENCE-23856594064540489",
- "identifierType": "EMAIL_SHA256"
- }
- ],
- "destinationFields": "EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, AAID_SHA256, AAID_MD, IDFA_MD5"
- },
- "timestamp": "2020-02-02T00:23:09.544Z"
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "destination": {
- "DestinationDefinition": {
- "Config": {
- "cdkV2Enabled": true
- }
- },
- "Config": {
- "isHashRequired": true,
- "registerDeviceOrBrowserApiKey": true,
- "apiKey": "intercomApiKey",
- "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
- "collectContext": false
- }
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "batch_data": [
- [
- {
- "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "31e78a3bf9ce2b43316f64fe883a531d6266938091e94e2f2480272481163dee",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "0259f595f7172c8dd692a5c37b4d296939555f862aae8adb964391bdb65006ab",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "b06fbe7a29f33576a792ba3df3c9bf838cd26ea88cf574285fa60dc0234a8485",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {},
- {
- "id": "32ee3d063320815a13e0058c2498ff76",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "fb40adc7debbf40e7b45b0a4a91886785dff1a28809276f95f1c44f7045f9b4d",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "e6bbdf34c5f3472f31b2923a26811560a599233f3dea4c9971595c3bb7b1e8dc",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "661125f7d337811256c5b55996b22c89047804dcec494db72659e4be71e03091",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {},
- {
- "id": "94162773066d6ae88b2658dc58ca2317",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ]
- ],
- "id_schema": [
- "EMAIL_SHA256",
- "PHONE_SHA256",
- "IDFA_SHA256",
- "AAID_SHA256",
- "AAID_MD",
- "IDFA_MD5"
- ],
- "advertiser_ids": [
- "dummyAdverTiserID"
- ],
- "action": "add"
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "userId": ""
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "statusCode": 200
- }
- ]
- }
- }
- },
- {
- "name": "tiktok_audience",
- "description": "Test 4: Considering some null values",
- "feature": "processor",
- "module": "destination",
- "version": "v0",
- "input": {
- "request": {
- "body": [
- {
- "message": {
- "userId": "user 1",
- "type": "audiencelist",
- "properties": {
- "listData": {
- "add": [
- {
- "EMAIL_SHA256": "alex@email.com",
- "PHONE_SHA256": "+129988776655",
- "AAID_MD5": "000999OOOQQQQ",
- "IDFA_MD5": "1234lkasfjdalj12321"
- },
- {
- "EMAIL_SHA256": "amy@abc.com",
- "AAID_SHA256": "000999OOOPPPP",
- "AAID_MD5": "000999OOOPPPP",
- "IDFA_MD5": "1234lkasfjdalj114455"
- }
- ]
- }
- },
- "context": {
- "ip": "14.5.67.21",
- "library": {
- "name": "http"
- },
- "externalId": [
- {
- "type": "TIKTOK_AUDIENCE-23856594064540489",
- "identifierType": "EMAIL_SHA256"
- }
- ],
- "destinationFields": "EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, AAID_SHA256, AAID_MD, IDFA_MD5"
- },
- "timestamp": "2020-02-02T00:23:09.544Z"
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "destination": {
- "DestinationDefinition": {
- "Config": {
- "cdkV2Enabled": true
- }
- },
- "Config": {
- "isHashRequired": true,
- "registerDeviceOrBrowserApiKey": true,
- "apiKey": "intercomApiKey",
- "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
- "collectContext": false
- }
- }
- }
- ]
- }
- },
- "output": {
- "response": {
- "status": 200,
- "body": [
- {
- "output": {
- "version": "1",
- "type": "REST",
- "method": "POST",
- "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
- "headers": {
- "Access-Token": "dummyAccessToken",
- "Content-Type": "application/json"
- },
- "params": {},
- "body": {
- "JSON": {
- "batch_data": [
- [
- {
- "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {
- "id": "31e78a3bf9ce2b43316f64fe883a531d6266938091e94e2f2480272481163dee",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {},
- {},
- {},
- {
- "id": "32ee3d063320815a13e0058c2498ff76",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ],
- [
- {
- "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {},
- {},
- {
- "id": "661125f7d337811256c5b55996b22c89047804dcec494db72659e4be71e03091",
- "audience_ids": [
- "23856594064540489"
- ]
- },
- {},
- {
- "id": "94162773066d6ae88b2658dc58ca2317",
- "audience_ids": [
- "23856594064540489"
- ]
- }
- ]
- ],
- "id_schema": [
- "EMAIL_SHA256",
- "PHONE_SHA256",
- "IDFA_SHA256",
- "AAID_SHA256",
- "AAID_MD",
- "IDFA_MD5"
- ],
- "advertiser_ids": [
- "dummyAdverTiserID"
- ],
- "action": "add"
- },
- "JSON_ARRAY": {},
- "XML": {},
- "FORM": {}
- },
- "files": {},
- "userId": ""
- },
- "metadata": {
- "jobId": 1,
- "secret": {
- "accessToken": "dummyAccessToken",
- "advertiserIds": [
- "dummyAdverTiserID"
- ]
- }
- },
- "statusCode": 200
- }
- ]
- }
- }
- }
-]
\ No newline at end of file
+ {
+ "name": "tiktok_audience",
+ "description": "Test 1: Containing SHA256 traits only",
+ "feature": "processor",
+ "module": "destination",
+ "version": "v0",
+ "input": {
+ "request": {
+ "body": [
+ {
+ "message": {
+ "userId": "user 1",
+ "type": "audiencelist",
+ "properties": {
+ "listData": {
+ "add": [
+ {
+ "EMAIL_SHA256": "alex@email.com"
+ },
+ {
+ "EMAIL_SHA256": "amy@abc.com"
+ },
+ {
+ "EMAIL_SHA256": "van@abc.com"
+ }
+ ],
+ "remove": [
+ {
+ "EMAIL_SHA256": "alex@email.com"
+ },
+ {
+ "EMAIL_SHA256": "amy@abc.com"
+ },
+ {
+ "EMAIL_SHA256": "van@abc.com"
+ }
+ ]
+ }
+ },
+ "context": {
+ "ip": "14.5.67.21",
+ "library": {
+ "name": "http"
+ },
+ "externalId": [
+ {
+ "type": "TIKTOK_AUDIENCE-23856594064540489",
+ "identifierType": "EMAIL_SHA256"
+ }
+ ],
+ "destinationFields": "EMAIL_SHA256"
+ },
+ "timestamp": "2020-02-02T00:23:09.544Z"
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "destination": {
+ "DestinationDefinition": {
+ "Config": {
+ "cdkV2Enabled": true
+ }
+ },
+ "Config": {
+ "isHashRequired": true,
+ "registerDeviceOrBrowserApiKey": true,
+ "apiKey": "intercomApiKey",
+ "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
+ "collectContext": false
+ }
+ }
+ }
+ ]
+ }
+ },
+ "output": {
+ "response": {
+ "status": 200,
+ "body": [
+ {
+ "output": {
+ "version": "1",
+ "type": "REST",
+ "method": "POST",
+ "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
+ "headers": {
+ "Access-Token": "dummyAccessToken",
+ "Content-Type": "application/json"
+ },
+ "params": {},
+ "body": {
+ "JSON": {
+ "batch_data": [
+ [
+ {
+ "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ]
+ ],
+ "id_schema": [
+ "EMAIL_SHA256"
+ ],
+ "advertiser_ids": [
+ "dummyAdverTiserID"
+ ],
+ "action": "add"
+ },
+ "JSON_ARRAY": {},
+ "XML": {},
+ "FORM": {}
+ },
+ "files": {},
+ "userId": ""
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "statusCode": 200
+ },
+ {
+ "output": {
+ "version": "1",
+ "type": "REST",
+ "method": "POST",
+ "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
+ "headers": {
+ "Access-Token": "dummyAccessToken",
+ "Content-Type": "application/json"
+ },
+ "params": {},
+ "body": {
+ "JSON": {
+ "batch_data": [
+ [
+ {
+ "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ]
+ ],
+ "id_schema": [
+ "EMAIL_SHA256"
+ ],
+ "advertiser_ids": [
+ "dummyAdverTiserID"
+ ],
+ "action": "delete"
+ },
+ "JSON_ARRAY": {},
+ "XML": {},
+ "FORM": {}
+ },
+ "files": {},
+ "userId": ""
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "statusCode": 200
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "tiktok_audience",
+ "description": "Test 2: Containing SHA256 and MD5 traits",
+ "feature": "processor",
+ "module": "destination",
+ "version": "v0",
+ "input": {
+ "request": {
+ "body": [
+ {
+ "message": {
+ "userId": "user 1",
+ "type": "audiencelist",
+ "properties": {
+ "listData": {
+ "add": [
+ {
+ "EMAIL_SHA256": "alex@email.com",
+ "AAID_MD5": "1234567"
+ },
+ {
+ "EMAIL_SHA256": "amy@abc.com",
+ "AAID_MD5": "1234568"
+ },
+ {
+ "EMAIL_SHA256": "van@abc.com",
+ "AAID_MD5": "1234569"
+ }
+ ],
+ "remove": [
+ {
+ "EMAIL_SHA256": "alex@email.com",
+ "AAID_MD5": "1234570"
+ },
+ {
+ "EMAIL_SHA256": "amy@abc.com",
+ "AAID_MD5": "1234571"
+ },
+ {
+ "EMAIL_SHA256": "van@abc.com",
+ "AAID_MD5": "1234572"
+ }
+ ]
+ }
+ },
+ "context": {
+ "ip": "14.5.67.21",
+ "library": {
+ "name": "http"
+ },
+ "externalId": [
+ {
+ "type": "TIKTOK_AUDIENCE-23856594064540489",
+ "identifierType": "EMAIL_SHA256"
+ }
+ ],
+ "destinationFields": "EMAIL_SHA256, AAID_MD5"
+ },
+ "timestamp": "2020-02-02T00:23:09.544Z"
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "destination": {
+ "DestinationDefinition": {
+ "Config": {
+ "cdkV2Enabled": true
+ }
+ },
+ "Config": {
+ "isHashRequired": true,
+ "registerDeviceOrBrowserApiKey": true,
+ "apiKey": "intercomApiKey",
+ "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
+ "collectContext": false
+ }
+ }
+ }
+ ]
+ }
+ },
+ "output": {
+ "response": {
+ "status": 200,
+ "body": [
+ {
+ "output": {
+ "version": "1",
+ "type": "REST",
+ "method": "POST",
+ "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
+ "headers": {
+ "Access-Token": "dummyAccessToken",
+ "Content-Type": "application/json"
+ },
+ "params": {},
+ "body": {
+ "JSON": {
+ "batch_data": [
+ [
+ {
+ "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "fcea920f7412b5da7be0cf42b8c93759",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "fe743d8d97aa7dfc6c93ccdc2e749513",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "e36a2f90240e9e84483504fd4a704452",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ]
+ ],
+ "id_schema": [
+ "EMAIL_SHA256",
+ "AAID_MD5"
+ ],
+ "advertiser_ids": [
+ "dummyAdverTiserID"
+ ],
+ "action": "add"
+ },
+ "JSON_ARRAY": {},
+ "XML": {},
+ "FORM": {}
+ },
+ "files": {},
+ "userId": ""
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "statusCode": 200
+ },
+ {
+ "output": {
+ "version": "1",
+ "type": "REST",
+ "method": "POST",
+ "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
+ "headers": {
+ "Access-Token": "dummyAccessToken",
+ "Content-Type": "application/json"
+ },
+ "params": {},
+ "body": {
+ "JSON": {
+ "batch_data": [
+ [
+ {
+ "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "c1abd65fea29d573ddef1bce925e3276",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "7298110702a080dfc6903f13333eb04a",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "2048acfa84a01121060ca2fc8a673a76d427176dc37224d4408c21973bd90e5c",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "d9cb68b1fd3b9d32abc5f4cab8b42b68",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ]
+ ],
+ "id_schema": [
+ "EMAIL_SHA256",
+ "AAID_MD5"
+ ],
+ "advertiser_ids": [
+ "dummyAdverTiserID"
+ ],
+ "action": "delete"
+ },
+ "JSON_ARRAY": {},
+ "XML": {},
+ "FORM": {}
+ },
+ "files": {},
+ "userId": ""
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "statusCode": 200
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "tiktok_audience",
+ "description": "Test 3: Containing all possible traits",
+ "feature": "processor",
+ "module": "destination",
+ "version": "v0",
+ "input": {
+ "request": {
+ "body": [
+ {
+ "message": {
+ "userId": "user 1",
+ "type": "audiencelist",
+ "properties": {
+ "listData": {
+ "add": [
+ {
+ "EMAIL_SHA256": "alex@email.com",
+ "PHONE_SHA256": "+129988776655",
+ "IDFA_SHA256": "1234lkasfjdalj12321",
+ "AAID_SHA256": "000999OOOQQQQ",
+ "AAID_MD5": "000999OOOQQQQ",
+ "IDFA_MD5": "1234lkasfjdalj12321"
+ },
+ {
+ "EMAIL_SHA256": "amy@abc.com",
+ "PHONE_SHA256": "+129988776677",
+ "IDFA_SHA256": "1234lkasfjdalj114455",
+ "AAID_SHA256": "000999OOOPPPP",
+ "AAID_MD5": "000999OOOPPPP",
+ "IDFA_MD5": "1234lkasfjdalj114455"
+ }
+ ]
+ }
+ },
+ "context": {
+ "ip": "14.5.67.21",
+ "library": {
+ "name": "http"
+ },
+ "externalId": [
+ {
+ "type": "TIKTOK_AUDIENCE-23856594064540489",
+ "identifierType": "EMAIL_SHA256"
+ }
+ ],
+ "destinationFields": "EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, AAID_SHA256, AAID_MD, IDFA_MD5"
+ },
+ "timestamp": "2020-02-02T00:23:09.544Z"
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "destination": {
+ "DestinationDefinition": {
+ "Config": {
+ "cdkV2Enabled": true
+ }
+ },
+ "Config": {
+ "isHashRequired": true,
+ "registerDeviceOrBrowserApiKey": true,
+ "apiKey": "intercomApiKey",
+ "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
+ "collectContext": false
+ }
+ }
+ }
+ ]
+ }
+ },
+ "output": {
+ "response": {
+ "status": 200,
+ "body": [
+ {
+ "output": {
+ "version": "1",
+ "type": "REST",
+ "method": "POST",
+ "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
+ "headers": {
+ "Access-Token": "dummyAccessToken",
+ "Content-Type": "application/json"
+ },
+ "params": {},
+ "body": {
+ "JSON": {
+ "batch_data": [
+ [
+ {
+ "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "31e78a3bf9ce2b43316f64fe883a531d6266938091e94e2f2480272481163dee",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "0259f595f7172c8dd692a5c37b4d296939555f862aae8adb964391bdb65006ab",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "b06fbe7a29f33576a792ba3df3c9bf838cd26ea88cf574285fa60dc0234a8485",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {},
+ {
+ "id": "32ee3d063320815a13e0058c2498ff76",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "fb40adc7debbf40e7b45b0a4a91886785dff1a28809276f95f1c44f7045f9b4d",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "e6bbdf34c5f3472f31b2923a26811560a599233f3dea4c9971595c3bb7b1e8dc",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "661125f7d337811256c5b55996b22c89047804dcec494db72659e4be71e03091",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {},
+ {
+ "id": "94162773066d6ae88b2658dc58ca2317",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ]
+ ],
+ "id_schema": [
+ "EMAIL_SHA256",
+ "PHONE_SHA256",
+ "IDFA_SHA256",
+ "AAID_SHA256",
+ "AAID_MD",
+ "IDFA_MD5"
+ ],
+ "advertiser_ids": [
+ "dummyAdverTiserID"
+ ],
+ "action": "add"
+ },
+ "JSON_ARRAY": {},
+ "XML": {},
+ "FORM": {}
+ },
+ "files": {},
+ "userId": ""
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "statusCode": 200
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "tiktok_audience",
+ "description": "Test 4: Considering some null values",
+ "feature": "processor",
+ "module": "destination",
+ "version": "v0",
+ "input": {
+ "request": {
+ "body": [
+ {
+ "message": {
+ "userId": "user 1",
+ "type": "audiencelist",
+ "properties": {
+ "listData": {
+ "add": [
+ {
+ "EMAIL_SHA256": "alex@email.com",
+ "PHONE_SHA256": "+129988776655",
+ "AAID_MD5": "000999OOOQQQQ",
+ "IDFA_MD5": "1234lkasfjdalj12321"
+ },
+ {
+ "EMAIL_SHA256": "amy@abc.com",
+ "AAID_SHA256": "000999OOOPPPP",
+ "AAID_MD5": "000999OOOPPPP",
+ "IDFA_MD5": "1234lkasfjdalj114455"
+ }
+ ]
+ }
+ },
+ "context": {
+ "ip": "14.5.67.21",
+ "library": {
+ "name": "http"
+ },
+ "externalId": [
+ {
+ "type": "TIKTOK_AUDIENCE-23856594064540489",
+ "identifierType": "EMAIL_SHA256"
+ }
+ ],
+ "destinationFields": "EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, AAID_SHA256, AAID_MD, IDFA_MD5"
+ },
+ "timestamp": "2020-02-02T00:23:09.544Z"
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "destination": {
+ "DestinationDefinition": {
+ "Config": {
+ "cdkV2Enabled": true
+ }
+ },
+ "Config": {
+ "isHashRequired": true,
+ "registerDeviceOrBrowserApiKey": true,
+ "apiKey": "intercomApiKey",
+ "appId": "9e9cdea1-78fa-4829-a9b2-5d7f7e96d1a0",
+ "collectContext": false
+ }
+ }
+ }
+ ]
+ }
+ },
+ "output": {
+ "response": {
+ "status": 200,
+ "body": [
+ {
+ "output": {
+ "version": "1",
+ "type": "REST",
+ "method": "POST",
+ "endpoint": "https://business-api.tiktok.com/open_api/v1.3/segment/mapping/",
+ "headers": {
+ "Access-Token": "dummyAccessToken",
+ "Content-Type": "application/json"
+ },
+ "params": {},
+ "body": {
+ "JSON": {
+ "batch_data": [
+ [
+ {
+ "id": "ac0f1baec38a9ef3cfcb56db981df7d9bab2568c7f53ef3776d1c059ec58e72b",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {
+ "id": "31e78a3bf9ce2b43316f64fe883a531d6266938091e94e2f2480272481163dee",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {},
+ {},
+ {},
+ {
+ "id": "32ee3d063320815a13e0058c2498ff76",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ],
+ [
+ {
+ "id": "49eaeca26c878f268ad33af8cfa8194ca5b8b8e448b1c775bf9153a2de734579",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {},
+ {},
+ {
+ "id": "661125f7d337811256c5b55996b22c89047804dcec494db72659e4be71e03091",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ },
+ {},
+ {
+ "id": "94162773066d6ae88b2658dc58ca2317",
+ "audience_ids": [
+ "23856594064540489"
+ ]
+ }
+ ]
+ ],
+ "id_schema": [
+ "EMAIL_SHA256",
+ "PHONE_SHA256",
+ "IDFA_SHA256",
+ "AAID_SHA256",
+ "AAID_MD",
+ "IDFA_MD5"
+ ],
+ "advertiser_ids": [
+ "dummyAdverTiserID"
+ ],
+ "action": "add"
+ },
+ "JSON_ARRAY": {},
+ "XML": {},
+ "FORM": {}
+ },
+ "files": {},
+ "userId": ""
+ },
+ "metadata": {
+ "jobId": 1,
+ "secret": {
+ "accessToken": "dummyAccessToken",
+ "advertiserIds": [
+ "dummyAdverTiserID"
+ ]
+ }
+ },
+ "statusCode": 200
+ }
+ ]
+ }
+ }
+ }
+]
diff --git a/test/integrations/destinations/tiktok_audience/router/data.ts b/test/integrations/destinations/tiktok_audience/router/data.ts
index c8a8b93d30..71e7038269 100644
--- a/test/integrations/destinations/tiktok_audience/router/data.ts
+++ b/test/integrations/destinations/tiktok_audience/router/data.ts
@@ -16,39 +16,22 @@ export const data = [
properties: {
listData: {
add: [
- {
- EMAIL_SHA256: 'alex@email.com',
- },
- {
- EMAIL_SHA256: 'amy@abc.com',
- },
- {
- EMAIL_SHA256: 'van@abc.com',
- },
+ { EMAIL_SHA256: 'alex@email.com' },
+ { EMAIL_SHA256: 'amy@abc.com' },
+ { EMAIL_SHA256: 'van@abc.com' },
],
remove: [
- {
- EMAIL_SHA256: 'alex@email.com',
- },
- {
- EMAIL_SHA256: 'amy@abc.com',
- },
- {
- EMAIL_SHA256: 'van@abc.com',
- },
+ { EMAIL_SHA256: 'alex@email.com' },
+ { EMAIL_SHA256: 'amy@abc.com' },
+ { EMAIL_SHA256: 'van@abc.com' },
],
},
},
context: {
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
externalId: [
- {
- type: 'TIKTOK_AUDIENCE-23856594064540489',
- identifierType: 'EMAIL_SHA256',
- },
+ { type: 'TIKTOK_AUDIENCE-23856594064540489', identifierType: 'EMAIL_SHA256' },
],
destinationFields: 'EMAIL_SHA256',
},
@@ -56,17 +39,11 @@ export const data = [
},
metadata: {
jobId: 1,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -83,45 +60,22 @@ export const data = [
properties: {
listData: {
add: [
- {
- EMAIL_SHA256: 'alex@email.com',
- AAID_MD5: '1234567',
- },
- {
- EMAIL_SHA256: 'amy@abc.com',
- AAID_MD5: '1234568',
- },
- {
- EMAIL_SHA256: 'van@abc.com',
- AAID_MD5: '1234569',
- },
+ { EMAIL_SHA256: 'alex@email.com', AAID_MD5: '1234567' },
+ { EMAIL_SHA256: 'amy@abc.com', AAID_MD5: '1234568' },
+ { EMAIL_SHA256: 'van@abc.com', AAID_MD5: '1234569' },
],
remove: [
- {
- EMAIL_SHA256: 'alex@email.com',
- AAID_MD5: '1234570',
- },
- {
- EMAIL_SHA256: 'amy@abc.com',
- AAID_MD5: '1234571',
- },
- {
- EMAIL_SHA256: 'van@abc.com',
- AAID_MD5: '1234572',
- },
+ { EMAIL_SHA256: 'alex@email.com', AAID_MD5: '1234570' },
+ { EMAIL_SHA256: 'amy@abc.com', AAID_MD5: '1234571' },
+ { EMAIL_SHA256: 'van@abc.com', AAID_MD5: '1234572' },
],
},
},
context: {
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
externalId: [
- {
- type: 'TIKTOK_AUDIENCE-23856594064540489',
- identifierType: 'EMAIL_SHA256',
- },
+ { type: 'TIKTOK_AUDIENCE-23856594064540489', identifierType: 'EMAIL_SHA256' },
],
destinationFields: 'EMAIL_SHA256, AAID_MD5',
},
@@ -129,17 +83,11 @@ export const data = [
},
metadata: {
jobId: 2,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -177,14 +125,9 @@ export const data = [
},
context: {
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
externalId: [
- {
- type: 'TIKTOK_AUDIENCE-23856594064540489',
- identifierType: 'EMAIL_SHA256',
- },
+ { type: 'TIKTOK_AUDIENCE-23856594064540489', identifierType: 'EMAIL_SHA256' },
],
destinationFields:
'EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, AAID_SHA256, AAID_MD, IDFA_MD5',
@@ -193,17 +136,11 @@ export const data = [
},
metadata: {
jobId: 3,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -237,14 +174,9 @@ export const data = [
},
context: {
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
externalId: [
- {
- type: 'TIKTOK_AUDIENCE-23856594064540489',
- identifierType: 'EMAIL_SHA256',
- },
+ { type: 'TIKTOK_AUDIENCE-23856594064540489', identifierType: 'EMAIL_SHA256' },
],
destinationFields:
'EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, AAID_SHA256, AAID_MD, IDFA_MD5',
@@ -253,17 +185,11 @@ export const data = [
},
metadata: {
jobId: 4,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -296,14 +222,9 @@ export const data = [
},
context: {
ip: '14.5.67.21',
- library: {
- name: 'http',
- },
+ library: { name: 'http' },
externalId: [
- {
- type: 'TIKTOK_AUDIENCE-23856594064540489',
- identifierType: 'EMAIL_SHA256',
- },
+ { type: 'TIKTOK_AUDIENCE-23856594064540489', identifierType: 'EMAIL_SHA256' },
],
destinationFields:
'EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, AAID_SHA256, AAID_MD, IDFA_MD5',
@@ -312,17 +233,11 @@ export const data = [
},
metadata: {
jobId: 1524545,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -347,11 +262,7 @@ export const data = [
error: 'message Type is not present. Aborting message.',
batched: false,
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -363,10 +274,8 @@ export const data = [
metadata: [
{
jobId: 1524545,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
],
statTags: {
@@ -468,11 +377,7 @@ export const data = [
],
batched: true,
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -484,10 +389,8 @@ export const data = [
metadata: [
{
jobId: 1,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
],
statusCode: 200,
@@ -605,11 +508,7 @@ export const data = [
],
batched: true,
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -621,10 +520,8 @@ export const data = [
metadata: [
{
jobId: 2,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
],
statusCode: 200,
@@ -635,10 +532,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://business-api.tiktok.com/open_api/v1.3/segment/mapping/',
- headers: {
- 'Access-Token': 'dummyAccessToken',
- 'Content-Type': 'application/json',
- },
+ headers: { 'Access-Token': 'dummyAccessToken', 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -709,11 +603,7 @@ export const data = [
},
batched: true,
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -725,10 +615,8 @@ export const data = [
metadata: [
{
jobId: 3,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
],
statusCode: 200,
@@ -739,10 +627,7 @@ export const data = [
type: 'REST',
method: 'POST',
endpoint: 'https://business-api.tiktok.com/open_api/v1.3/segment/mapping/',
- headers: {
- 'Access-Token': 'dummyAccessToken',
- 'Content-Type': 'application/json',
- },
+ headers: { 'Access-Token': 'dummyAccessToken', 'Content-Type': 'application/json' },
params: {},
body: {
JSON: {
@@ -801,11 +686,7 @@ export const data = [
},
batched: true,
destination: {
- DestinationDefinition: {
- Config: {
- cdkV2Enabled: true,
- },
- },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
Config: {
isHashRequired: true,
registerDeviceOrBrowserApiKey: true,
@@ -817,10 +698,8 @@ export const data = [
metadata: [
{
jobId: 4,
- secret: {
- accessToken: 'dummyAccessToken',
- advertiserIds: ['dummyAdverTiserID'],
- },
+ secret: { accessToken: 'dummyAccessToken', advertiserIds: ['dummyAdverTiserID'] },
+ userId: 'u1',
},
],
statusCode: 200,
diff --git a/test/integrations/destinations/trengo/router/data.ts b/test/integrations/destinations/trengo/router/data.ts
index eeefb053a8..f7b5022036 100644
--- a/test/integrations/destinations/trengo/router/data.ts
+++ b/test/integrations/destinations/trengo/router/data.ts
@@ -27,49 +27,25 @@ export const data = [
name: 'generic_x86',
type: 'android',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.1-beta.1',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.1-beta.1' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'Android',
- version: '8.1.0',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'Android', version: '8.1.0' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
- traits: {
- anonymousId: 'anon_id_success',
- },
+ traits: { anonymousId: 'anon_id_success' },
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 8.1.0; Android SDK built for x86 Build/OSM1.180201.007)',
},
event: 'Product Purchased',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: 'id1',
- properties: {
- name: 'Test Product',
- phone: '9830311521',
- },
+ properties: { name: 'Test Product', phone: '9830311521' },
originalTimestamp: '2020-12-17T21:00:59.176Z',
type: 'track',
sentAt: '2020-03-12T09:05:03.421Z',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
apiToken: 'trengo_integration_test_api_token',
@@ -77,29 +53,12 @@ export const data = [
channelIdentifier: 'phone',
enableDedup: true,
eventTemplateMap: [
- {
- from: 'Product Purchased',
- to: '{{event}} from Rudderstack',
- },
- {
- from: 'checkedOut',
- to: 'Total cart value {{value}} shipped',
- },
- {
- from: 'Order Completed',
- to: 'Completed Order',
- },
- {
- from: 'Stress Test',
- },
- {
- from: 'Stress test2',
- to: '',
- },
- {
- from: 'Stress test3',
- to: '{event} Stress test',
- },
+ { from: 'Product Purchased', to: '{{event}} from Rudderstack' },
+ { from: 'checkedOut', to: 'Total cart value {{value}} shipped' },
+ { from: 'Order Completed', to: 'Completed Order' },
+ { from: 'Stress Test' },
+ { from: 'Stress test2', to: '' },
+ { from: 'Stress test3', to: '{event} Stress test' },
],
},
secretConfig: {},
@@ -170,21 +129,14 @@ export const data = [
},
params: {},
body: {
- JSON: {
- contact_id: 90002431001,
- channel_id: 'trengo_phone_channel',
- },
+ JSON: { contact_id: 90002431001, channel_id: 'trengo_phone_channel' },
XML: {},
JSON_ARRAY: {},
FORM: {},
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -194,29 +146,12 @@ export const data = [
channelIdentifier: 'phone',
enableDedup: true,
eventTemplateMap: [
- {
- from: 'Product Purchased',
- to: '{{event}} from Rudderstack',
- },
- {
- from: 'checkedOut',
- to: 'Total cart value {{value}} shipped',
- },
- {
- from: 'Order Completed',
- to: 'Completed Order',
- },
- {
- from: 'Stress Test',
- },
- {
- from: 'Stress test2',
- to: '',
- },
- {
- from: 'Stress test3',
- to: '{event} Stress test',
- },
+ { from: 'Product Purchased', to: '{{event}} from Rudderstack' },
+ { from: 'checkedOut', to: 'Total cart value {{value}} shipped' },
+ { from: 'Order Completed', to: 'Completed Order' },
+ { from: 'Stress Test' },
+ { from: 'Stress test2', to: '' },
+ { from: 'Stress test3', to: '{event} Stress test' },
],
},
secretConfig: {},
@@ -283,10 +218,7 @@ export const data = [
userId: 'randomUserId',
type: 'identify',
context: {
- traits: {
- name: 'Jimothy Halpert',
- email: 'j@d.com',
- },
+ traits: { name: 'Jimothy Halpert', email: 'j@d.com' },
ip: '14.5.67.21',
app: {
build: '1',
@@ -301,33 +233,16 @@ export const data = [
name: 'generic_x86',
type: 'android',
},
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '0.1.4',
- },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '0.1.4' },
locale: 'en-US',
- network: {
- carrier: 'Android',
- bluetooth: false,
- cellular: true,
- wifi: true,
- },
- os: {
- name: 'Android',
- version: '9',
- },
- screen: {
- density: 420,
- height: 1794,
- width: 1080,
- },
+ network: { carrier: 'Android', bluetooth: false, cellular: true, wifi: true },
+ os: { name: 'Android', version: '9' },
+ screen: { density: 420, height: 1794, width: 1080 },
timezone: 'Asia/Kolkata',
},
timestamp: '2020-02-02T00:23:09.544Z',
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
apiToken: 'trengo_integration_test_api_token',
@@ -335,29 +250,12 @@ export const data = [
channelIdentifier: 'email',
enableDedup: true,
eventTemplateMap: [
- {
- from: 'Product Purchased',
- to: '{{event}} from Rudderstack',
- },
- {
- from: 'checkedOut',
- to: 'Total cart value {{value}} shipped',
- },
- {
- from: 'Order Completed',
- to: 'Completed Order',
- },
- {
- from: 'Stress Test',
- },
- {
- from: 'Stress test2',
- to: '',
- },
- {
- from: 'Stress test3',
- to: '{event} Stress test',
- },
+ { from: 'Product Purchased', to: '{{event}} from Rudderstack' },
+ { from: 'checkedOut', to: 'Total cart value {{value}} shipped' },
+ { from: 'Order Completed', to: 'Completed Order' },
+ { from: 'Stress Test' },
+ { from: 'Stress test2', to: '' },
+ { from: 'Stress test3', to: '{event} Stress test' },
],
},
secretConfig: {},
@@ -439,11 +337,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -453,29 +347,12 @@ export const data = [
channelIdentifier: 'email',
enableDedup: true,
eventTemplateMap: [
- {
- from: 'Product Purchased',
- to: '{{event}} from Rudderstack',
- },
- {
- from: 'checkedOut',
- to: 'Total cart value {{value}} shipped',
- },
- {
- from: 'Order Completed',
- to: 'Completed Order',
- },
- {
- from: 'Stress Test',
- },
- {
- from: 'Stress test2',
- to: '',
- },
- {
- from: 'Stress test3',
- to: '{event} Stress test',
- },
+ { from: 'Product Purchased', to: '{{event}} from Rudderstack' },
+ { from: 'checkedOut', to: 'Total cart value {{value}} shipped' },
+ { from: 'Order Completed', to: 'Completed Order' },
+ { from: 'Stress Test' },
+ { from: 'Stress test2', to: '' },
+ { from: 'Stress test3', to: '{event} Stress test' },
],
},
secretConfig: {},
diff --git a/test/integrations/destinations/user/router/data.ts b/test/integrations/destinations/user/router/data.ts
index 30bcdf2688..acdb5c953e 100644
--- a/test/integrations/destinations/user/router/data.ts
+++ b/test/integrations/destinations/user/router/data.ts
@@ -16,9 +16,7 @@ export const data = [
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
userId: 'user@123',
groupId: 'group@795',
messageId: '022bb90c-bbac-11e4-8dfc-aa07a5b093db',
@@ -39,9 +37,7 @@ export const data = [
},
type: 'group',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
destination: {
Config: {
apiKey: 'dummyApiKey',
@@ -77,10 +73,7 @@ export const data = [
body: {
XML: {},
FORM: {},
- JSON: {
- user_id: 52,
- user_custom_id: 'user@123',
- },
+ JSON: { user_id: 52, user_custom_id: 'user@123' },
JSON_ARRAY: {},
},
type: 'REST',
@@ -95,11 +88,7 @@ export const data = [
version: '1',
endpoint: 'https://commander.user.com/api/public/companies/21/add_member/',
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -154,19 +143,10 @@ export const data = [
useroccupation: 'mechanical engineer',
},
},
- traits: {
- googleUrl: 'www.google.com',
- },
- integrations: {
- All: true,
- user: {
- lookup: 'email',
- },
- },
- },
- metadata: {
- jobId: 2,
+ traits: { googleUrl: 'www.google.com' },
+ integrations: { All: true, user: { lookup: 'email' } },
},
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
apiKey: 'dummyApiKey',
@@ -229,11 +209,7 @@ export const data = [
version: '1',
endpoint: 'https://commander.user.com/api/public/users/59/',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/userlist/router/data.ts b/test/integrations/destinations/userlist/router/data.ts
new file mode 100644
index 0000000000..2f2d027865
--- /dev/null
+++ b/test/integrations/destinations/userlist/router/data.ts
@@ -0,0 +1,330 @@
+import { FEATURES } from '../../../../../src/v0/util/tags';
+
+export const data = [
+ {
+ name: 'userlist',
+ description: 'Test 0',
+ feature: FEATURES.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: {
+ anonymousId: '123456',
+ email: 'test@rudderstack.com',
+ address: {
+ city: 'kolkata',
+ country: 'India',
+ postalCode: 712136,
+ state: 'WB',
+ street: '',
+ },
+ ip: '0.0.0.0',
+ age: 26,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ user_properties: {
+ prop1: 'val1',
+ prop2: 'val2',
+ },
+ type: 'identify',
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ userId: '123456',
+ integrations: {
+ All: true,
+ },
+ traits: {
+ anonymousId: 'anon-id',
+ email: 'test@gmail.com',
+ address: {
+ city: 'NY',
+ country: 'USA',
+ postalCode: 712136,
+ state: 'CA',
+ street: '',
+ },
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ metadata: {
+ jobId: 1,
+ },
+ destination: {
+ Config: {
+ pushKey: 'userlist-push-key',
+ },
+ },
+ },
+ {
+ message: {
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ traits: {
+ email: 'test@rudderstack.com',
+ anonymousId: '12345',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ type: 'track',
+ messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be',
+ originalTimestamp: '2019-10-14T11:15:18.300Z',
+ anonymousId: '00000000000000000000000000',
+ userId: '12345',
+ event: 'test track event',
+ properties: {
+ user_actual_role: 'system_admin',
+ user_actual_id: 12345,
+ user_time_spent: 50000,
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T11:15:53.296Z',
+ },
+ metadata: {
+ jobId: 2,
+ },
+ destination: {
+ Config: {
+ pushKey: 'userlist-push-key',
+ },
+ },
+ },
+ ],
+ destType: 'userlist',
+ },
+ method: 'POST',
+ },
+ },
+ output: {
+ response: {
+ status: 200,
+ body: {
+ output: [
+ {
+ batchedRequest: {
+ body: {
+ XML: {},
+ JSON_ARRAY: {},
+ JSON: {
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ traits: {
+ anonymousId: '123456',
+ email: 'test@rudderstack.com',
+ address: {
+ city: 'kolkata',
+ country: 'India',
+ postalCode: 712136,
+ state: 'WB',
+ street: '',
+ },
+ ip: '0.0.0.0',
+ age: 26,
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ user_properties: {
+ prop1: 'val1',
+ prop2: 'val2',
+ },
+ type: 'identify',
+ messageId: '84e26acc-56a5-4835-8233-591137fca468',
+ originalTimestamp: '2019-10-14T09:03:17.562Z',
+ anonymousId: '123456',
+ userId: '123456',
+ integrations: {
+ All: true,
+ },
+ traits: {
+ anonymousId: 'anon-id',
+ email: 'test@gmail.com',
+ address: {
+ city: 'NY',
+ country: 'USA',
+ postalCode: 712136,
+ state: 'CA',
+ street: '',
+ },
+ },
+ sentAt: '2019-10-14T09:03:22.563Z',
+ },
+ FORM: {},
+ },
+ files: {},
+ endpoint: 'https://incoming.userlist.com/rudderstack/events',
+ headers: {
+ Authorization: 'Push userlist-push-key',
+ 'Content-Type': 'application/json',
+ },
+ version: '1',
+ params: {},
+ type: 'REST',
+ method: 'POST',
+ statusCode: 200,
+ },
+ metadata: [
+ {
+ jobId: 1,
+ },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ pushKey: 'userlist-push-key',
+ },
+ },
+ },
+ {
+ batchedRequest: {
+ body: {
+ XML: {},
+ JSON_ARRAY: {},
+ JSON: {
+ channel: 'web',
+ context: {
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ traits: {
+ email: 'test@rudderstack.com',
+ anonymousId: '12345',
+ },
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ },
+ type: 'track',
+ messageId: 'ec5481b6-a926-4d2e-b293-0b3a77c4d3be',
+ originalTimestamp: '2019-10-14T11:15:18.300Z',
+ anonymousId: '00000000000000000000000000',
+ userId: '12345',
+ event: 'test track event',
+ properties: {
+ user_actual_role: 'system_admin',
+ user_actual_id: 12345,
+ user_time_spent: 50000,
+ },
+ integrations: {
+ All: true,
+ },
+ sentAt: '2019-10-14T11:15:53.296Z',
+ },
+ FORM: {},
+ },
+ files: {},
+ endpoint: 'https://incoming.userlist.com/rudderstack/events',
+ headers: {
+ Authorization: 'Push userlist-push-key',
+ 'Content-Type': 'application/json',
+ },
+ version: '1',
+ params: {},
+ type: 'REST',
+ method: 'POST',
+ statusCode: 200,
+ },
+ metadata: [
+ {
+ jobId: 2,
+ },
+ ],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ Config: {
+ pushKey: 'userlist-push-key',
+ },
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/vero/processor/data.ts b/test/integrations/destinations/vero/processor/data.ts
index 7834f0a541..3f8c750da6 100644
--- a/test/integrations/destinations/vero/processor/data.ts
+++ b/test/integrations/destinations/vero/processor/data.ts
@@ -815,4 +815,4 @@ export const data = [
}
}
}
-]
\ No newline at end of file
+]
diff --git a/test/integrations/destinations/vero/router/data.ts b/test/integrations/destinations/vero/router/data.ts
index 17aba359d1..ca23f22feb 100644
--- a/test/integrations/destinations/vero/router/data.ts
+++ b/test/integrations/destinations/vero/router/data.ts
@@ -1,10 +1,8 @@
-import { FEATURES } from '../../../../../src/v0/util/tags';
-
export const data = [
{
name: 'vero',
description: 'Test 0',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -12,20 +10,10 @@ export const data = [
body: {
input: [
{
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: {
- jobId: 1,
- },
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
- context: {
- traits: {
- email: 'user001@tech.com',
- },
- },
+ context: { traits: { email: 'user001@tech.com' } },
type: 'Identify',
userId: 'user001',
},
@@ -65,16 +53,8 @@ export const data = [
files: {},
},
],
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: [
- {
- jobId: 1,
- },
- ],
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: [{ jobId: 1, userId: 'u1' }],
statusCode: 200,
},
],
@@ -85,7 +65,7 @@ export const data = [
{
name: 'vero',
description: 'Test 1',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -93,20 +73,10 @@ export const data = [
body: {
input: [
{
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: {
- jobId: 2,
- },
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
- context: {
- traits: {
- email: 'user002@tech.com',
- },
- },
+ context: { traits: { email: 'user002@tech.com' } },
type: 'Identify',
anonymousId: 'b4ffheww8eisndbdjgdewifewfgerwibderv',
},
@@ -146,16 +116,8 @@ export const data = [
files: {},
},
],
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: [
- {
- jobId: 2,
- },
- ],
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: [{ jobId: 2, userId: 'u1' }],
statusCode: 200,
},
],
@@ -166,7 +128,7 @@ export const data = [
{
name: 'vero',
description: 'Test 2',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -174,14 +136,8 @@ export const data = [
body: {
input: [
{
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: {
- jobId: 3,
- },
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: { jobId: 3, userId: 'u1' },
message: {
context: {
traits: {
@@ -190,13 +146,7 @@ export const data = [
email: 'user005@tech.com',
},
},
- integrations: {
- vero: {
- tags: {
- add: ['a', 'b'],
- },
- },
- },
+ integrations: { vero: { tags: { add: ['a', 'b'] } } },
type: 'Identify',
userId: 'fprediruser001',
},
@@ -226,10 +176,7 @@ export const data = [
JSON: {
id: 'fprediruser001',
email: 'user005@tech.com',
- data: {
- address: 'Caravela Beach Goa',
- homwTown: 'Mawsynram',
- },
+ data: { address: 'Caravela Beach Goa', homwTown: 'Mawsynram' },
auth_token: 'testAuthToken',
},
JSON_ARRAY: {},
@@ -246,11 +193,7 @@ export const data = [
headers: {},
params: {},
body: {
- JSON: {
- auth_token: 'testAuthToken',
- id: 'fprediruser001',
- add: ['a', 'b'],
- },
+ JSON: { auth_token: 'testAuthToken', id: 'fprediruser001', add: ['a', 'b'] },
JSON_ARRAY: {},
XML: {},
FORM: {},
@@ -258,16 +201,8 @@ export const data = [
files: {},
},
],
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: [
- {
- jobId: 3,
- },
- ],
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: [{ jobId: 3, userId: 'u1' }],
statusCode: 200,
},
],
@@ -278,7 +213,7 @@ export const data = [
{
name: 'vero',
description: 'Test 3',
- feature: FEATURES.ROUTER,
+ feature: 'router',
module: 'destination',
version: 'v0',
input: {
@@ -286,21 +221,11 @@ export const data = [
body: {
input: [
{
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: {
- jobId: 4,
- },
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: { jobId: 4, userId: 'u1' },
message: {
event: 'Random event with nonexisting userId and email',
- properties: {
- movieWatched: 3,
- gamesPlayed: 4,
- email: 'eventIdn02@sample.com',
- },
+ properties: { movieWatched: 3, gamesPlayed: 4, email: 'eventIdn02@sample.com' },
type: 'track',
userId: 'eventIdn01',
},
@@ -328,16 +253,9 @@ export const data = [
params: {},
body: {
JSON: {
- identity: {
- id: 'eventIdn01',
- email: 'eventIdn02@sample.com',
- },
+ identity: { id: 'eventIdn01', email: 'eventIdn02@sample.com' },
event_name: 'Random event with nonexisting userId and email',
- data: {
- movieWatched: 3,
- gamesPlayed: 4,
- email: 'eventIdn02@sample.com',
- },
+ data: { movieWatched: 3, gamesPlayed: 4, email: 'eventIdn02@sample.com' },
auth_token: 'testAuthToken',
},
JSON_ARRAY: {},
@@ -347,16 +265,8 @@ export const data = [
files: {},
},
],
- destination: {
- Config: {
- authToken: 'testAuthToken',
- },
- },
- metadata: [
- {
- jobId: 4,
- },
- ],
+ destination: { Config: { authToken: 'testAuthToken' } },
+ metadata: [{ jobId: 4, userId: 'u1' }],
statusCode: 200,
},
],
diff --git a/test/integrations/destinations/webhook/processor/data.ts b/test/integrations/destinations/webhook/processor/data.ts
index d02fa58227..dbe83a79a5 100644
--- a/test/integrations/destinations/webhook/processor/data.ts
+++ b/test/integrations/destinations/webhook/processor/data.ts
@@ -18,15 +18,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -93,14 +103,28 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- { from: '', to: '' },
- { from: 'test2', to: 'value2' },
+ {
+ from: '',
+ to: '',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -110,98 +134,115 @@ export const data = [
{
output: {
body: {
- XML: {},
- JSON_ARRAY: {},
JSON: {
- timestamp: '2019-09-01T15:46:51.693229+05:30',
- user_properties: {
- total_payments: 0,
- internetReachability: 'ReachableViaLocalAreaNetwork',
- level: 6,
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- coin_balance: 9466052,
- player_total_shields: 0,
- isLowEndDevice: false,
- game_fps: 30,
- idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
- graphicsQuality: 'HD',
- current_module_name: 'CasinoGameModule',
- player_total_battles: 0,
- lifetime_gem_balance: 0,
- gem_balance: 0,
- fb_profile: '0',
- start_date: '2019-08-01',
- versionSessionCount: 2,
- game_name: 'FireEagleSlots',
- },
- integrations: { All: true },
- event: 'spin_result',
- message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
device: {
- model: 'Redmi 6',
- manufacturer: 'Xiaomi',
id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R',
+ manufacturer: 'Xiaomi',
+ model: 'Redmi 6',
name: 'xiaomi',
},
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- address: { city: 'Dhaka', country: 'Bangladesh' },
},
- os: { version: '8.1.0', name: 'android' },
- network: { carrier: 'Banglalink' },
},
- type: 'track',
+ event: 'spin_result',
+ integrations: {
+ All: true,
+ },
+ message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- jackpot_win_type: 'Silver',
- coin_balance: 9466052,
- bet_level: 1,
- ishighroller: 'False',
- tournament_id: 'T1561970819',
+ additional_bet_index: 0,
battle_id: 'N/A',
bet_amount: 9,
- fb_profile: '0',
- player_total_shields: 0,
- is_turbo: 'False',
- player_total_battles: 0,
+ bet_level: 1,
bet_multiplier: 1,
- start_date: '2019-08-01',
- versionSessionCount: 2,
- graphicsQuality: 'HD',
- is_auto_spin: 'False',
+ coin_balance: 9466052,
+ current_module_name: 'CasinoGameModule',
days_in_game: 0,
- additional_bet_index: 0,
- isLowEndDevice: 'False',
- game_fps: 30,
extra_param: 'N/A',
- idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
- current_module_name: 'CasinoGameModule',
- game_id: 'fireEagleBase',
+ fb_profile: '0',
featureGameType: 'N/A',
+ game_fps: 30,
+ game_id: 'fireEagleBase',
+ game_name: 'FireEagleSlots',
gem_balance: 0,
+ graphicsQuality: 'HD',
+ idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
internetReachability: 'ReachableViaLocalAreaNetwork',
- total_payments: 0,
+ isLowEndDevice: 'False',
+ is_auto_spin: 'False',
+ is_turbo: 'False',
+ isf: 'False',
+ ishighroller: 'False',
+ jackpot_win_amount: 90,
+ jackpot_win_type: 'Silver',
level: 6,
- win_amount: 0,
+ lifetime_gem_balance: 0,
no_of_spin: 1,
+ player_total_battles: 0,
+ player_total_shields: 0,
+ start_date: '2019-08-01',
+ total_payments: 0,
+ tournament_id: 'T1561970819',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ versionSessionCount: 2,
+ win_amount: 0,
+ },
+ timestamp: '2019-09-01T15:46:51.693229+05:30',
+ type: 'track',
+ user_properties: {
+ coin_balance: 9466052,
+ current_module_name: 'CasinoGameModule',
+ fb_profile: '0',
+ game_fps: 30,
game_name: 'FireEagleSlots',
- jackpot_win_amount: 90,
+ gem_balance: 0,
+ graphicsQuality: 'HD',
+ idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
+ internetReachability: 'ReachableViaLocalAreaNetwork',
+ isLowEndDevice: false,
+ level: 6,
lifetime_gem_balance: 0,
- isf: 'False',
+ player_total_battles: 0,
+ player_total_shields: 0,
+ start_date: '2019-08-01',
+ total_payments: 0,
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ versionSessionCount: 2,
},
},
+ JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
- endpoint: 'http://6b0e6a60.ngrok.io',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: { 'content-type': 'application/json', test2: 'value2' },
version: '1',
- params: {},
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'POST',
+ endpoint: 'http://6b0e6a60.ngrok.io',
+ headers: {
+ 'content-type': 'application/json',
+ test2: 'value2',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -228,15 +269,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -299,10 +350,22 @@ export const data = [
versionSessionCount: 2,
},
},
- destination: { Config: { webhookUrl: 'https://6b0e6a60.ngrok.io/n' } },
+ destination: {
+ Config: {
+ webhookUrl: 'https://6b0e6a60.ngrok.io/n',
+ },
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
},
],
- method: 'POST',
},
},
output: {
@@ -312,98 +375,114 @@ export const data = [
{
output: {
body: {
- XML: {},
- JSON_ARRAY: {},
JSON: {
- timestamp: '2019-09-01T15:46:51.693229+05:30',
- user_properties: {
- total_payments: 0,
- internetReachability: 'ReachableViaLocalAreaNetwork',
- level: 6,
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- coin_balance: 9466052,
- player_total_shields: 0,
- isLowEndDevice: false,
- game_fps: 30,
- idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
- graphicsQuality: 'HD',
- current_module_name: 'CasinoGameModule',
- player_total_battles: 0,
- lifetime_gem_balance: 0,
- gem_balance: 0,
- fb_profile: '0',
- start_date: '2019-08-01',
- versionSessionCount: 2,
- game_name: 'FireEagleSlots',
- },
- integrations: { All: true },
- event: 'spin_result',
- message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
device: {
- model: 'Redmi 6',
- manufacturer: 'Xiaomi',
id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R',
+ manufacturer: 'Xiaomi',
+ model: 'Redmi 6',
name: 'xiaomi',
},
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- address: { city: 'Dhaka', country: 'Bangladesh' },
},
- os: { version: '8.1.0', name: 'android' },
- network: { carrier: 'Banglalink' },
},
- type: 'track',
+ event: 'spin_result',
+ integrations: {
+ All: true,
+ },
+ message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- jackpot_win_type: 'Silver',
- coin_balance: 9466052,
- bet_level: 1,
- ishighroller: 'False',
- tournament_id: 'T1561970819',
+ additional_bet_index: 0,
battle_id: 'N/A',
bet_amount: 9,
- fb_profile: '0',
- player_total_shields: 0,
- is_turbo: 'False',
- player_total_battles: 0,
+ bet_level: 1,
bet_multiplier: 1,
- start_date: '2019-08-01',
- versionSessionCount: 2,
- graphicsQuality: 'HD',
- is_auto_spin: 'False',
+ coin_balance: 9466052,
+ current_module_name: 'CasinoGameModule',
days_in_game: 0,
- additional_bet_index: 0,
- isLowEndDevice: 'False',
- game_fps: 30,
extra_param: 'N/A',
- idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
- current_module_name: 'CasinoGameModule',
- game_id: 'fireEagleBase',
+ fb_profile: '0',
featureGameType: 'N/A',
+ game_fps: 30,
+ game_id: 'fireEagleBase',
+ game_name: 'FireEagleSlots',
gem_balance: 0,
+ graphicsQuality: 'HD',
+ idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
internetReachability: 'ReachableViaLocalAreaNetwork',
- total_payments: 0,
+ isLowEndDevice: 'False',
+ is_auto_spin: 'False',
+ is_turbo: 'False',
+ isf: 'False',
+ ishighroller: 'False',
+ jackpot_win_amount: 90,
+ jackpot_win_type: 'Silver',
level: 6,
- win_amount: 0,
+ lifetime_gem_balance: 0,
no_of_spin: 1,
+ player_total_battles: 0,
+ player_total_shields: 0,
+ start_date: '2019-08-01',
+ total_payments: 0,
+ tournament_id: 'T1561970819',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ versionSessionCount: 2,
+ win_amount: 0,
+ },
+ timestamp: '2019-09-01T15:46:51.693229+05:30',
+ type: 'track',
+ user_properties: {
+ coin_balance: 9466052,
+ current_module_name: 'CasinoGameModule',
+ fb_profile: '0',
+ game_fps: 30,
game_name: 'FireEagleSlots',
- jackpot_win_amount: 90,
+ gem_balance: 0,
+ graphicsQuality: 'HD',
+ idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
+ internetReachability: 'ReachableViaLocalAreaNetwork',
+ isLowEndDevice: false,
+ level: 6,
lifetime_gem_balance: 0,
- isf: 'False',
+ player_total_battles: 0,
+ player_total_shields: 0,
+ start_date: '2019-08-01',
+ total_payments: 0,
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ versionSessionCount: 2,
},
},
+ JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
- endpoint: 'https://6b0e6a60.ngrok.io/n',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: { 'content-type': 'application/json' },
version: '1',
- params: {},
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'POST',
+ endpoint: 'https://6b0e6a60.ngrok.io/n',
+ headers: {
+ 'content-type': 'application/json',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -430,15 +509,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -501,10 +590,22 @@ export const data = [
versionSessionCount: 2,
},
},
- destination: { Config: { webhookUrl: 'https://6b0e6a60.' } },
+ destination: {
+ Config: {
+ webhookUrl: 'https://6b0e6a60.',
+ },
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
},
],
- method: 'POST',
},
},
output: {
@@ -514,98 +615,114 @@ export const data = [
{
output: {
body: {
- XML: {},
- JSON_ARRAY: {},
JSON: {
- timestamp: '2019-09-01T15:46:51.693229+05:30',
- user_properties: {
- total_payments: 0,
- internetReachability: 'ReachableViaLocalAreaNetwork',
- level: 6,
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- coin_balance: 9466052,
- player_total_shields: 0,
- isLowEndDevice: false,
- game_fps: 30,
- idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
- graphicsQuality: 'HD',
- current_module_name: 'CasinoGameModule',
- player_total_battles: 0,
- lifetime_gem_balance: 0,
- gem_balance: 0,
- fb_profile: '0',
- start_date: '2019-08-01',
- versionSessionCount: 2,
- game_name: 'FireEagleSlots',
- },
- integrations: { All: true },
- event: 'spin_result',
- message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
device: {
- model: 'Redmi 6',
- manufacturer: 'Xiaomi',
id: 'df16bffa-5c3d-4fbb-9bce-3bab098129a7R',
+ manufacturer: 'Xiaomi',
+ model: 'Redmi 6',
name: 'xiaomi',
},
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- address: { city: 'Dhaka', country: 'Bangladesh' },
},
- os: { version: '8.1.0', name: 'android' },
- network: { carrier: 'Banglalink' },
},
- type: 'track',
+ event: 'spin_result',
+ integrations: {
+ All: true,
+ },
+ message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- jackpot_win_type: 'Silver',
- coin_balance: 9466052,
- bet_level: 1,
- ishighroller: 'False',
- tournament_id: 'T1561970819',
+ additional_bet_index: 0,
battle_id: 'N/A',
bet_amount: 9,
- fb_profile: '0',
- player_total_shields: 0,
- is_turbo: 'False',
- player_total_battles: 0,
+ bet_level: 1,
bet_multiplier: 1,
- start_date: '2019-08-01',
- versionSessionCount: 2,
- graphicsQuality: 'HD',
- is_auto_spin: 'False',
+ coin_balance: 9466052,
+ current_module_name: 'CasinoGameModule',
days_in_game: 0,
- additional_bet_index: 0,
- isLowEndDevice: 'False',
- game_fps: 30,
extra_param: 'N/A',
- idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
- current_module_name: 'CasinoGameModule',
- game_id: 'fireEagleBase',
+ fb_profile: '0',
featureGameType: 'N/A',
+ game_fps: 30,
+ game_id: 'fireEagleBase',
+ game_name: 'FireEagleSlots',
gem_balance: 0,
+ graphicsQuality: 'HD',
+ idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
internetReachability: 'ReachableViaLocalAreaNetwork',
- total_payments: 0,
+ isLowEndDevice: 'False',
+ is_auto_spin: 'False',
+ is_turbo: 'False',
+ isf: 'False',
+ ishighroller: 'False',
+ jackpot_win_amount: 90,
+ jackpot_win_type: 'Silver',
level: 6,
- win_amount: 0,
+ lifetime_gem_balance: 0,
no_of_spin: 1,
+ player_total_battles: 0,
+ player_total_shields: 0,
+ start_date: '2019-08-01',
+ total_payments: 0,
+ tournament_id: 'T1561970819',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ versionSessionCount: 2,
+ win_amount: 0,
+ },
+ timestamp: '2019-09-01T15:46:51.693229+05:30',
+ type: 'track',
+ user_properties: {
+ coin_balance: 9466052,
+ current_module_name: 'CasinoGameModule',
+ fb_profile: '0',
+ game_fps: 30,
game_name: 'FireEagleSlots',
- jackpot_win_amount: 90,
+ gem_balance: 0,
+ graphicsQuality: 'HD',
+ idfa: '2bf99787-33d2-4ae2-a76a-c49672f97252',
+ internetReachability: 'ReachableViaLocalAreaNetwork',
+ isLowEndDevice: false,
+ level: 6,
lifetime_gem_balance: 0,
- isf: 'False',
+ player_total_battles: 0,
+ player_total_shields: 0,
+ start_date: '2019-08-01',
+ total_payments: 0,
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ versionSessionCount: 2,
},
},
+ JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
- endpoint: 'https://6b0e6a60.',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: { 'content-type': 'application/json' },
version: '1',
- params: {},
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'POST',
+ endpoint: 'https://6b0e6a60.',
+ headers: {
+ 'content-type': 'application/json',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -632,17 +749,35 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
- properties: { k1: 'v1', k2: { k3: 'c3', k4: { k5: 'c5' } } },
+ properties: {
+ k1: 'v1',
+ k2: {
+ k3: 'c3',
+ k4: {
+ k5: 'c5',
+ },
+ },
+ },
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
},
@@ -650,12 +785,25 @@ export const data = [
Config: {
webhookUrl: 'https://6b0e6a60.',
webhookMethod: 'GET',
- headers: [{ from: 'X-customHeader', to: 'customHeaderVal' }],
+ headers: [
+ {
+ from: 'X-customHeader',
+ to: 'customHeaderVal',
+ },
+ ],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -664,15 +812,30 @@ export const data = [
body: [
{
output: {
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
version: '1',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'GET',
endpoint: 'https://6b0e6a60.',
- headers: { 'x-customheader': 'customHeaderVal' },
- params: { k1: 'v1', 'k2.k3': 'c3', 'k2.k4.k5': 'c5' },
- body: { JSON: {}, XML: {}, JSON_ARRAY: {}, FORM: {} },
+ headers: {
+ 'x-customheader': 'customHeaderVal',
+ },
+ params: {
+ k1: 'v1',
+ 'k2.k3': 'c3',
+ 'k2.k4.k5': 'c5',
+ },
files: {},
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -699,24 +862,55 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
- properties: { k1: 'v1', k2: { k3: 'c3', k4: { k5: 'c5' } } },
+ properties: {
+ k1: 'v1',
+ k2: {
+ k3: 'c3',
+ k4: {
+ k5: 'c5',
+ },
+ },
+ },
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
},
- destination: { Config: { webhookUrl: 'https://6b0e6a60.', webhookMethod: 'GET' } },
+ destination: {
+ Config: {
+ webhookUrl: 'https://6b0e6a60.',
+ webhookMethod: 'GET',
+ },
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
},
],
- method: 'POST',
},
},
output: {
@@ -725,15 +919,28 @@ export const data = [
body: [
{
output: {
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
version: '1',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'GET',
endpoint: 'https://6b0e6a60.',
headers: {},
- params: { k1: 'v1', 'k2.k3': 'c3', 'k2.k4.k5': 'c5' },
- body: { JSON: {}, XML: {}, JSON_ARRAY: {}, FORM: {} },
+ params: {
+ k1: 'v1',
+ 'k2.k3': 'c3',
+ 'k2.k4.k5': 'c5',
+ },
files: {},
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -760,15 +967,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -816,14 +1033,28 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
header: [
- { from: 'test1', to: 'value1' },
- { from: 'test2', to: 'value2' },
+ {
+ from: 'test1',
+ to: 'value1',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -832,12 +1063,6 @@ export const data = [
body: [
{
output: {
- version: '1',
- type: 'REST',
- method: 'POST',
- endpoint: 'http://6b0e6a60.ngrok.io',
- headers: { 'content-type': 'application/json' },
- params: {},
body: {
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
@@ -848,16 +1073,26 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
ip: '127.0.0.1',
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -901,12 +1136,24 @@ export const data = [
type: 'track',
request_ip: '127.0.0.1',
},
- XML: {},
JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
+ version: '1',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'http://6b0e6a60.ngrok.io',
+ headers: {
+ 'content-type': 'application/json',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -933,15 +1180,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -989,14 +1246,28 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- { from: 'Content-Type', to: 'application/xml' },
- { from: 'test2', to: 'value2' },
+ {
+ from: 'Content-Type',
+ to: 'application/xml',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -1005,12 +1276,6 @@ export const data = [
body: [
{
output: {
- version: '1',
- type: 'REST',
- method: 'POST',
- endpoint: 'http://6b0e6a60.ngrok.io',
- headers: { 'content-type': 'application/xml', test2: 'value2' },
- params: {},
body: {
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
@@ -1021,16 +1286,26 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
ip: '127.0.0.1',
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1074,12 +1349,25 @@ export const data = [
type: 'track',
request_ip: '127.0.0.1',
},
- XML: {},
JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
+ version: '1',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'http://6b0e6a60.ngrok.io',
+ headers: {
+ 'content-type': 'application/xml',
+ test2: 'value2',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1100,7 +1388,9 @@ export const data = [
message: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1147,14 +1437,28 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- { from: 'Content-Type', to: 'application/xml' },
- { from: 'test2', to: 'value2' },
+ {
+ from: 'Content-Type',
+ to: 'application/xml',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -1163,17 +1467,13 @@ export const data = [
body: [
{
output: {
- version: '1',
- type: 'REST',
- method: 'POST',
- endpoint: 'http://6b0e6a60.ngrok.io',
- headers: { 'content-type': 'application/xml', test2: 'value2' },
- params: {},
body: {
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1216,12 +1516,25 @@ export const data = [
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
},
- XML: {},
JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
+ version: '1',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'http://6b0e6a60.ngrok.io',
+ headers: {
+ 'content-type': 'application/xml',
+ test2: 'value2',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1248,15 +1561,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1269,7 +1592,9 @@ export const data = [
header: {
dynamic_header_key_string: 'dynamic_header_value_string',
dynamic_header_key_num: 10,
- dynamic_header_key_object: { k1: 'v1' },
+ dynamic_header_key_object: {
+ k1: 'v1',
+ },
},
appendPath: '/product/search?string=value',
},
@@ -1277,14 +1602,28 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- { from: '', to: '' },
- { from: 'test2', to: 'value2' },
+ {
+ from: '',
+ to: '',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -1294,8 +1633,6 @@ export const data = [
{
output: {
body: {
- XML: {},
- JSON_ARRAY: {},
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
@@ -1305,15 +1642,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1324,20 +1671,26 @@ export const data = [
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
},
+ JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
- endpoint: 'http://6b0e6a60.ngrok.io/product/search?string=value',
+ version: '1',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ type: 'REST',
+ method: 'POST',
+ endpoint: 'http://6b0e6a60.ngrok.io/product/search?string=value',
headers: {
'content-type': 'application/json',
test2: 'value2',
dynamic_header_key_string: 'dynamic_header_value_string',
},
- version: '1',
params: {},
- type: 'REST',
- method: 'POST',
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1364,15 +1717,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1388,14 +1751,28 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- { from: '', to: '' },
- { from: 'test2', to: 'value2' },
+ {
+ from: '',
+ to: '',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -1405,8 +1782,6 @@ export const data = [
{
output: {
body: {
- XML: {},
- JSON_ARRAY: {},
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
@@ -1416,15 +1791,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1435,16 +1820,25 @@ export const data = [
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
},
+ JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
- endpoint: 'https://www.google.com',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: { 'content-type': 'application/json', test2: 'value2' },
version: '1',
- params: {},
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'POST',
+ endpoint: 'https://www.google.com',
+ headers: {
+ 'content-type': 'application/json',
+ test2: 'value2',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1471,15 +1865,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1496,14 +1900,28 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- { from: '', to: '' },
- { from: 'test2', to: 'value2' },
+ {
+ from: '',
+ to: '',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -1513,8 +1931,6 @@ export const data = [
{
output: {
body: {
- XML: {},
- JSON_ARRAY: {},
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
@@ -1524,15 +1940,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1543,16 +1969,25 @@ export const data = [
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
},
+ JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
- endpoint: 'https://www.google.com/?searchTerms=cats',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: { 'content-type': 'application/json', test2: 'value2' },
version: '1',
- params: {},
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'POST',
+ endpoint: 'https://www.google.com/?searchTerms=cats',
+ headers: {
+ 'content-type': 'application/json',
+ test2: 'value2',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1579,15 +2014,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1605,14 +2050,28 @@ export const data = [
webhookUrl: 'http://6b0e6a60.ngrok.io',
webhookMethod: 'PUT',
headers: [
- { from: '', to: '' },
- { from: 'test2', to: 'value2' },
+ {
+ from: '',
+ to: '',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -1622,8 +2081,6 @@ export const data = [
{
output: {
body: {
- XML: {},
- JSON_ARRAY: {},
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
@@ -1633,15 +2090,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1652,16 +2119,25 @@ export const data = [
timestamp: '2019-09-01T15:46:51.693229+05:30',
type: 'track',
},
+ JSON_ARRAY: {},
+ XML: {},
FORM: {},
},
- files: {},
- endpoint: 'https://www.google.com/?searchTerms=cats',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: { 'content-type': 'application/json', test2: 'value2' },
version: '1',
- params: {},
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
type: 'REST',
method: 'PUT',
+ endpoint: 'https://www.google.com/?searchTerms=cats',
+ headers: {
+ 'content-type': 'application/json',
+ test2: 'value2',
+ },
+ params: {},
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1688,15 +2164,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1714,14 +2200,28 @@ export const data = [
webhookUrl: 'http://6b0e6a60.ngrok.io',
webhookMethod: 'DELETE',
headers: [
- { from: '', to: '' },
- { from: 'test2', to: 'value2' },
+ {
+ from: '',
+ to: '',
+ },
+ {
+ from: 'test2',
+ to: 'value2',
+ },
],
},
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
+ },
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
},
],
- method: 'POST',
},
},
output: {
@@ -1730,20 +2230,31 @@ export const data = [
body: [
{
output: {
- body: { XML: {}, JSON_ARRAY: {}, JSON: {}, FORM: {} },
- files: {},
- endpoint: 'https://www.google.com/?searchTerms=cats',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: { test2: 'value2' },
+ body: {
+ JSON: {},
+ JSON_ARRAY: {},
+ XML: {},
+ FORM: {},
+ },
version: '1',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ type: 'REST',
+ method: 'DELETE',
+ endpoint: 'https://www.google.com/?searchTerms=cats',
+ headers: {
+ test2: 'value2',
+ },
params: {
additional_bet_index: 0,
battle_id: 'N/A',
featureGameType: 'N/A',
win_amount: 0,
},
- type: 'REST',
- method: 'DELETE',
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1770,15 +2281,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1845,12 +2366,25 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
webhookMethod: 'POST',
- headers: [{ from: 'test2', to: 'value2' }],
+ headers: [
+ {
+ from: 'test2',
+ to: 'value2',
+ },
+ ],
+ },
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
},
},
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
},
],
- method: 'POST',
},
},
output: {
@@ -1860,7 +2394,6 @@ export const data = [
{
output: {
body: {
- FORM: {},
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
@@ -1870,15 +2403,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -1943,15 +2486,23 @@ export const data = [
},
JSON_ARRAY: {},
XML: {},
+ FORM: {},
},
- endpoint: 'http://6b0e6a60.ngrok.io',
- files: {},
- headers: { 'content-type': 'application/json', test2: 'value2' },
+ version: '1',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ type: 'REST',
method: 'POST',
+ endpoint: 'http://6b0e6a60.ngrok.io',
+ headers: {
+ 'content-type': 'application/json',
+ test2: 'value2',
+ },
params: {},
- type: 'REST',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- version: '1',
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
@@ -1978,15 +2529,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -2053,12 +2614,25 @@ export const data = [
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
webhookMethod: 'PATCH',
- headers: [{ from: 'test2', to: 'value2' }],
+ headers: [
+ {
+ from: 'test2',
+ to: 'value2',
+ },
+ ],
+ },
+ DestinationDefinition: {
+ Config: {
+ cdkV2Enabled: true,
+ },
},
},
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
+ },
},
],
- method: 'POST',
},
},
output: {
@@ -2068,7 +2642,6 @@ export const data = [
{
output: {
body: {
- FORM: {},
JSON: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
context: {
@@ -2078,15 +2651,25 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: { carrier: 'Banglalink' },
- os: { name: 'android', version: '8.1.0' },
+ network: {
+ carrier: 'Banglalink',
+ },
+ os: {
+ name: 'android',
+ version: '8.1.0',
+ },
traits: {
- address: { city: 'Dhaka', country: 'Bangladesh' },
+ address: {
+ city: 'Dhaka',
+ country: 'Bangladesh',
+ },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: { All: true },
+ integrations: {
+ All: true,
+ },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -2151,15 +2734,23 @@ export const data = [
},
JSON_ARRAY: {},
XML: {},
+ FORM: {},
},
- endpoint: 'http://6b0e6a60.ngrok.io',
- files: {},
- headers: { 'content-type': 'application/json', test2: 'value2' },
+ version: '1',
+ userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
+ type: 'REST',
method: 'PATCH',
+ endpoint: 'http://6b0e6a60.ngrok.io',
+ headers: {
+ 'content-type': 'application/json',
+ test2: 'value2',
+ },
params: {},
- type: 'REST',
- userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- version: '1',
+ files: {},
+ },
+ metadata: {
+ destinationId: 'destId',
+ workspaceId: 'wspId',
},
statusCode: 200,
},
diff --git a/test/integrations/destinations/webhook/router/data.ts b/test/integrations/destinations/webhook/router/data.ts
index e9c4f8701a..a082eb12f1 100644
--- a/test/integrations/destinations/webhook/router/data.ts
+++ b/test/integrations/destinations/webhook/router/data.ts
@@ -19,25 +19,15 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -100,23 +90,16 @@ export const data = [
versionSessionCount: 2,
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
destination: {
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- {
- from: '',
- to: '',
- },
- {
- from: 'test2',
- to: 'value2',
- },
+ { from: '', to: '' },
+ { from: 'test2', to: 'value2' },
],
},
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
},
},
{
@@ -129,25 +112,15 @@ export const data = [
model: 'Redmi 6',
name: 'xiaomi',
},
- network: {
- carrier: 'Banglalink',
- },
- os: {
- name: 'android',
- version: '8.1.0',
- },
+ network: { carrier: 'Banglalink' },
+ os: { name: 'android', version: '8.1.0' },
traits: {
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
+ address: { city: 'Dhaka', country: 'Bangladesh' },
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
},
},
event: 'spin_result',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
properties: {
additional_bet_index: 0,
@@ -210,13 +183,10 @@ export const data = [
versionSessionCount: 2,
},
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 3, userId: 'u1' },
destination: {
- Config: {
- webhookUrl: 'https://6b0e6a60.ngrok.io/n',
- },
+ Config: { webhookUrl: 'https://6b0e6a60.ngrok.io/n' },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
},
},
],
@@ -257,9 +227,7 @@ export const data = [
versionSessionCount: 2,
game_name: 'FireEagleSlots',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
event: 'spin_result',
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
@@ -272,18 +240,10 @@ export const data = [
},
traits: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
- },
- os: {
- version: '8.1.0',
- name: 'android',
- },
- network: {
- carrier: 'Banglalink',
+ address: { city: 'Dhaka', country: 'Bangladesh' },
},
+ os: { version: '8.1.0', name: 'android' },
+ network: { carrier: 'Banglalink' },
},
type: 'track',
properties: {
@@ -330,36 +290,24 @@ export const data = [
files: {},
endpoint: 'http://6b0e6a60.ngrok.io',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: {
- 'content-type': 'application/json',
- test2: 'value2',
- },
+ headers: { 'content-type': 'application/json', test2: 'value2' },
version: '1',
params: {},
type: 'REST',
method: 'POST',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
Config: {
webhookUrl: 'http://6b0e6a60.ngrok.io',
headers: [
- {
- from: '',
- to: '',
- },
- {
- from: 'test2',
- to: 'value2',
- },
+ { from: '', to: '' },
+ { from: 'test2', to: 'value2' },
],
},
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
},
},
{
@@ -389,9 +337,7 @@ export const data = [
versionSessionCount: 2,
game_name: 'FireEagleSlots',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
event: 'spin_result',
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
@@ -404,18 +350,10 @@ export const data = [
},
traits: {
anonymousId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- address: {
- city: 'Dhaka',
- country: 'Bangladesh',
- },
- },
- os: {
- version: '8.1.0',
- name: 'android',
- },
- network: {
- carrier: 'Banglalink',
+ address: { city: 'Dhaka', country: 'Bangladesh' },
},
+ os: { version: '8.1.0', name: 'android' },
+ network: { carrier: 'Banglalink' },
},
type: 'track',
properties: {
@@ -462,25 +400,18 @@ export const data = [
files: {},
endpoint: 'https://6b0e6a60.ngrok.io/n',
userId: 'c82cbdff-e5be-4009-ac78-cdeea09ab4b1',
- headers: {
- 'content-type': 'application/json',
- },
+ headers: { 'content-type': 'application/json' },
version: '1',
params: {},
type: 'REST',
method: 'POST',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
- Config: {
- webhookUrl: 'https://6b0e6a60.ngrok.io/n',
- },
+ Config: { webhookUrl: 'https://6b0e6a60.ngrok.io/n' },
+ DestinationDefinition: { Config: { cdkV2Enabled: true } },
},
},
],
diff --git a/test/integrations/destinations/woopra/router/data.ts b/test/integrations/destinations/woopra/router/data.ts
index 5a3b20bea6..941f69c2fe 100644
--- a/test/integrations/destinations/woopra/router/data.ts
+++ b/test/integrations/destinations/woopra/router/data.ts
@@ -13,30 +13,15 @@ export const data = [
message: {
anonymousId: '21e13f4bc7ceddad',
context: {
- app: {
- build: '4',
- name: 'RuddCDN',
- },
- device: {
- id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a',
- name: 'generic_x86_arm',
- },
- os: {
- name: 'Android',
- version: '9',
- },
+ app: { build: '4', name: 'RuddCDN' },
+ device: { id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', name: 'generic_x86_arm' },
+ os: { name: 'Android', version: '9' },
timezone: 'Asia/Kolkata',
- traits: {
- anonymousId: '21e13f4bc7ceddad',
- },
+ traits: { anonymousId: '21e13f4bc7ceddad' },
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)',
},
- integrations: {
- woopra: {
- projectName: 'abc.com',
- },
- },
+ integrations: { woopra: { projectName: 'abc.com' } },
messageId: '1601322811899-d9c7dd00-50dc-4364-95c8-e89423eb3cfb',
originalTimestamp: '2020-09-28T19:53:31.900Z',
traits: {
@@ -52,14 +37,8 @@ export const data = [
timestamp: '2020-09-29T14:50:29.907+05:30',
type: 'identify',
},
- destination: {
- Config: {
- projectName: 'int.com',
- },
- },
- metadata: {
- jobId: 1,
- },
+ destination: { Config: { projectName: 'int.com' } },
+ metadata: { jobId: 1, userId: 'u1' },
},
],
destType: 'woopra',
@@ -74,12 +53,7 @@ export const data = [
output: [
{
batchedRequest: {
- body: {
- XML: {},
- FORM: {},
- JSON: {},
- JSON_ARRAY: {},
- },
+ body: { XML: {}, FORM: {}, JSON: {}, JSON_ARRAY: {} },
type: 'REST',
files: {},
method: 'GET',
@@ -100,16 +74,8 @@ export const data = [
version: '1',
endpoint: 'https://www.woopra.com/track/identify',
},
- destination: {
- Config: {
- projectName: 'int.com',
- },
- },
- metadata: [
- {
- jobId: 1,
- },
- ],
+ destination: { Config: { projectName: 'int.com' } },
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
},
@@ -133,49 +99,26 @@ export const data = [
anonymousId: '21e13f4bc7ceddad',
channel: 'mobile',
context: {
- app: {
- build: '4',
- name: 'RuddCDN',
- },
- device: {
- id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a',
- name: 'generic_x86_arm',
- },
- library: {
- name: 'com.rudderstack.android.sdk.core',
- version: '1.0.6',
- },
- os: {
- name: 'Android',
- version: '9',
- },
+ app: { build: '4', name: 'RuddCDN' },
+ device: { id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a', name: 'generic_x86_arm' },
+ library: { name: 'com.rudderstack.android.sdk.core', version: '1.0.6' },
+ os: { name: 'Android', version: '9' },
timezone: 'Asia/Kolkata',
userAgent:
'Dalvik/2.1.0 (Linux; U; Android 9; AOSP on IA Emulator Build/PSR1.180720.117)',
},
event: 'First Investment',
- integrations: {
- woopra: 'int.com',
- },
+ integrations: { woopra: 'int.com' },
messageId: '1601322811899-d9c7dd00-50dc-4364-95c8-e89423eb3cfb',
originalTimestamp: '2020-09-28T19:53:31.900Z',
- properties: {
- currency: 'EUR',
- revenue: 20.37566,
- },
+ properties: { currency: 'EUR', revenue: 20.37566 },
receivedAt: '2020-09-29T14:50:43.005+05:30',
sentAt: '2020-09-28T19:53:44.998Z',
timestamp: '2020-09-29T14:50:29.907+05:30',
type: 'track',
},
- destination: {
- Config: {
- projectName: 'int.com',
- },
- },
- metadata: {
- jobId: 2,
- },
+ destination: { Config: { projectName: 'int.com' } },
+ metadata: { jobId: 2, userId: 'u1' },
},
],
destType: 'woopra',
@@ -190,12 +133,7 @@ export const data = [
output: [
{
batchedRequest: {
- body: {
- XML: {},
- FORM: {},
- JSON: {},
- JSON_ARRAY: {},
- },
+ body: { XML: {}, FORM: {}, JSON: {}, JSON_ARRAY: {} },
type: 'REST',
files: {},
method: 'GET',
@@ -213,16 +151,8 @@ export const data = [
version: '1',
endpoint: 'https://www.woopra.com/track/ce',
},
- destination: {
- Config: {
- projectName: 'int.com',
- },
- },
- metadata: [
- {
- jobId: 2,
- },
- ],
+ destination: { Config: { projectName: 'int.com' } },
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
},
@@ -246,19 +176,11 @@ export const data = [
anonymousId: '21e13f4bc7ceddad',
channel: 'mobile',
event: 'First Investment',
- integrations: {
- woopra: 'int.com',
- },
+ integrations: { woopra: 'int.com' },
type: 'group',
},
- destination: {
- Config: {
- projectName: 'int.com',
- },
- },
- metadata: {
- jobId: 3,
- },
+ destination: { Config: { projectName: 'int.com' } },
+ metadata: { jobId: 3, userId: 'u1' },
},
],
destType: 'woopra',
@@ -272,16 +194,8 @@ export const data = [
body: {
output: [
{
- destination: {
- Config: {
- projectName: 'int.com',
- },
- },
- metadata: [
- {
- jobId: 3,
- },
- ],
+ destination: { Config: { projectName: 'int.com' } },
+ metadata: [{ jobId: 3, userId: 'u1' }],
statTags: {
errorCategory: 'dataValidation',
implementation: 'native',
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..d94901fe80
--- /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
+ }
+ ]
+ }
+ }
+ }
+]
diff --git a/test/integrations/destinations/wootric/router/data.ts b/test/integrations/destinations/wootric/router/data.ts
new file mode 100644
index 0000000000..9af28f4f48
--- /dev/null
+++ b/test/integrations/destinations/wootric/router/data.ts
@@ -0,0 +1,1403 @@
+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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' },
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ batched: false,
+ statusCode: 200,
+ destination: {
+ ID: '2D7TqLto9tnkBuR1ciMrbiA4cbG',
+ Config: {
+ username: 'wootricfakeuser@example.com',
+ password: 'password@123',
+ accountToken: 'NPS-dummyToken',
+ },
+ },
+ },
+ {
+ metadata: [{ jobId: 11, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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, userId: 'u1' }],
+ 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',
+ },
+ },
+ ],
+ },
+ },
+ },
+ },
+];
diff --git a/test/integrations/destinations/yahoo_dsp/router/data.ts b/test/integrations/destinations/yahoo_dsp/router/data.ts
index 59c71b300c..61b1b728a5 100644
--- a/test/integrations/destinations/yahoo_dsp/router/data.ts
+++ b/test/integrations/destinations/yahoo_dsp/router/data.ts
@@ -23,9 +23,7 @@ export const data = [
},
ID: 'iwehr83843',
},
- metadata: {
- jobId: 1,
- },
+ metadata: { jobId: 1, userId: 'u1' },
message: {
userId: 'user 1',
type: 'audiencelist',
@@ -75,12 +73,7 @@ export const data = [
},
enablePartialFailure: true,
},
- context: {
- ip: '14.5.67.21',
- library: {
- name: 'http',
- },
- },
+ context: { ip: '14.5.67.21', library: { name: 'http' } },
timestamp: '2020-02-02T00:23:09.544Z',
},
},
@@ -123,11 +116,7 @@ export const data = [
},
files: {},
},
- metadata: [
- {
- jobId: 1,
- },
- ],
+ metadata: [{ jobId: 1, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
diff --git a/test/integrations/destinations/zendesk/router/data.ts b/test/integrations/destinations/zendesk/router/data.ts
index d99ca6df03..4e7aacd1d1 100644
--- a/test/integrations/destinations/zendesk/router/data.ts
+++ b/test/integrations/destinations/zendesk/router/data.ts
@@ -30,9 +30,7 @@ export const data = [
Name: 'zendesk',
Transformations: [],
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
anonymousId: '297b0750-934b-4411-b66c-9b418cdbc0c9',
channel: 'web',
@@ -44,28 +42,15 @@ export const data = [
version: '1.1.0-beta.2',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.0-beta.2',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
- traits: {
- email: 'example124@email.com',
- name: 'abcd124',
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ traits: { email: 'example124@email.com', name: 'abcd124' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
},
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: '0bab70e8-bf2f-449a-a19b-ca6e3bfed9b7',
originalTimestamp: '2020-03-23T18:27:28.98Z',
receivedAt: '2020-03-23T23:57:29.022+05:30',
@@ -108,9 +93,7 @@ export const data = [
email: 'example124@email.com',
name: 'abcd124',
external_id: 'abcd-124',
- user_fields: {
- id: 'abcd-124',
- },
+ user_fields: { id: 'abcd-124' },
verified: true,
},
},
@@ -122,11 +105,7 @@ export const data = [
userId: '297b0750-934b-4411-b66c-9b418cdbc0c9',
},
],
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -186,9 +165,7 @@ export const data = [
Name: 'zendesk',
Transformations: [],
},
- metadata: {
- jobId: 2,
- },
+ metadata: { jobId: 2, userId: 'u1' },
message: {
anonymousId: '297b0750-934b-4411-b66c-9b418cdbc0c9',
channel: 'web',
@@ -200,29 +177,16 @@ export const data = [
version: '1.1.0-beta.2',
},
ip: '0.0.0.0',
- library: {
- name: 'RudderLabs JavaScript SDK',
- version: '1.1.0-beta.2',
- },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.0-beta.2' },
locale: 'en-GB',
- os: {
- name: '',
- version: '',
- },
- screen: {
- density: 2,
- },
- traits: {
- email: 'example124@email.com',
- name: 'abcd124',
- },
+ os: { name: '', version: '' },
+ screen: { density: 2 },
+ traits: { email: 'example124@email.com', name: 'abcd124' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
},
groupId: 'group-124',
- integrations: {
- All: true,
- },
+ integrations: { All: true },
messageId: '2d54ba80-ce5f-4bcb-b1d7-7587e7a865fc',
originalTimestamp: '2020-03-23T18:27:28.983Z',
receivedAt: '2020-03-23T23:57:29.022+05:30',
@@ -277,11 +241,7 @@ export const data = [
files: {},
userId: '297b0750-934b-4411-b66c-9b418cdbc0c9',
},
- metadata: [
- {
- jobId: 2,
- },
- ],
+ metadata: [{ jobId: 2, userId: 'u1' }],
batched: false,
statusCode: 200,
destination: {
@@ -340,9 +300,7 @@ export const data = [
Name: 'zendesk',
Transformations: [],
},
- metadata: {
- jobId: 3,
- },
+ metadata: { jobId: 3, userId: 'u1' },
message: {
anonymousId: '223b5f40-9543-4456-a7aa-945c43048185',
channel: 'web',
@@ -393,11 +351,7 @@ export const data = [
module: 'destination',
},
statusCode: 400,
- metadata: [
- {
- jobId: 3,
- },
- ],
+ metadata: [{ jobId: 3, userId: 'u1' }],
batched: false,
destination: {
Config: {
diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts
index f5be8107ed..09f3a82d40 100644
--- a/test/integrations/testUtils.ts
+++ b/test/integrations/testUtils.ts
@@ -4,7 +4,10 @@ import { MockHttpCallsData, TestCaseData } from './testTypes';
import MockAdapter from 'axios-mock-adapter';
import isMatch from 'lodash/isMatch';
import { OptionValues } from 'commander';
+import { removeUndefinedAndNullValues } from '@rudderstack/integrations-lib';
+const generateAlphanumericId = (size = 36) =>
+ [...Array(size)].map(() => ((Math.random() * size) | 0).toString(size)).join('');
export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): string[] => {
const globPattern = join(dirPath, '**', 'data.ts');
let testFilePaths = globSync(globPattern);
@@ -74,3 +77,290 @@ export const overrideDestination = (destination, overrideConfigValues) => {
Config: { ...destination.Config, ...overrideConfigValues },
});
};
+
+export const generateIndentifyPayload = (parametersOverride: any) => {
+ const payload = {
+ type: 'identify',
+ sentAt: parametersOverride.sentAt || '2021-01-03T17:02:53.195Z',
+ userId: parametersOverride.userId || 'default-userId',
+ channel: 'web',
+ context: removeUndefinedAndNullValues({
+ externalId: parametersOverride.externalId,
+ os: { name: '', version: '1.12.3' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: parametersOverride.context.traits,
+ locale: 'en-US',
+ device: { token: 'token', id: 'id', type: 'ios' },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ }),
+ traits: parametersOverride.traits,
+ integrations: parametersOverride.integrations,
+ rudderId: parametersOverride.rudderId || generateAlphanumericId(36),
+ messageId: parametersOverride.messageId || generateAlphanumericId(36),
+ anonymousId: parametersOverride.anonymousId || 'default-anonymousId',
+ originalTimestamp: parametersOverride.originalTimestamp || '2021-01-03T17:02:53.193Z',
+ };
+
+ return removeUndefinedAndNullValues(payload);
+};
+
+export const generateSimplifiedIdentifyPayload = (parametersOverride: any) => {
+ return removeUndefinedAndNullValues({
+ type: 'identify',
+ sentAt: parametersOverride.sentAt || '2021-01-03T17:02:53.195Z',
+ userId: parametersOverride.userId || 'default-userId',
+ traits: parametersOverride.traits,
+ integrations: parametersOverride.integrations,
+ rudderId: parametersOverride.rudderId || generateAlphanumericId(36),
+ messageId: parametersOverride.messageId || generateAlphanumericId(36),
+ context: {
+ externalId: parametersOverride.externalId,
+ traits: parametersOverride.context.traits,
+ },
+ anonymousId: parametersOverride.anonymousId || 'default-anonymousId',
+ originalTimestamp: parametersOverride.originalTimestamp || '2021-01-03T17:02:53.193Z',
+ });
+};
+
+export const generateTrackPayload = (parametersOverride: any) => {
+ const payload = {
+ type: 'track',
+ sentAt: parametersOverride.sentAt || '2021-01-03T17:02:53.195Z',
+ userId: parametersOverride.userId || 'default-user-id',
+ channel: 'web',
+ context: removeUndefinedAndNullValues({
+ externalId: parametersOverride.externalId,
+ os: { name: '', version: '1.12.3' },
+ app: {
+ name: 'RudderLabs JavaScript SDK',
+ build: '1.0.0',
+ version: '1.1.11',
+ namespace: 'com.rudderlabs.javascript',
+ },
+ traits: parametersOverride.context.traits,
+ locale: 'en-US',
+ device: { token: 'token', id: 'id', type: 'ios' },
+ screen: { density: 2 },
+ library: { name: 'RudderLabs JavaScript SDK', version: '1.1.11' },
+ campaign: {},
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0',
+ }),
+ rudderId: parametersOverride.rudderId || generateAlphanumericId(36),
+ messageId: parametersOverride.messageId || generateAlphanumericId(36),
+ anonymousId: parametersOverride.anonymousId || 'default-anonymousId',
+ originalTimestamp: parametersOverride.originalTimestamp || '2021-01-03T17:02:53.193Z',
+ timestamp: parametersOverride.timestamp,
+ event: parametersOverride.event || 'test-event',
+ integrations: parametersOverride.integrations,
+ properties: parametersOverride.properties,
+ };
+ return removeUndefinedAndNullValues(payload);
+};
+
+export const generateSimplifiedTrackPayload = (parametersOverride: any) => {
+ return removeUndefinedAndNullValues({
+ type: 'track',
+ sentAt: parametersOverride.sentAt || '2021-01-03T17:02:53.195Z',
+ userId: parametersOverride.userId || 'default-user-id',
+ event: parametersOverride.event || 'test-event',
+ properties: parametersOverride.properties,
+ integrations: parametersOverride.integrations,
+ rudderId: parametersOverride.rudderId || generateAlphanumericId(36),
+ messageId: parametersOverride.messageId || generateAlphanumericId(36),
+ context: removeUndefinedAndNullValues({
+ externalId: parametersOverride.externalId,
+ traits: parametersOverride.context.traits,
+ }),
+ anonymousId: parametersOverride.anonymousId || 'default-anonymousId',
+ originalTimestamp: parametersOverride.originalTimestamp || '2021-01-03T17:02:53.193Z',
+ });
+};
+
+export const generatePageOrScreenPayload = (parametersOverride: any, eventType: string) => {
+ const payload = {
+ channel: 'web',
+ userId: parametersOverride.userId || 'default-userId',
+ rudderId: parametersOverride.rudderId || generateAlphanumericId(36),
+ originalTimestamp: parametersOverride.originalTimestamp || '2022-04-26T05:17:09Z',
+ timestamp: parametersOverride.timestamp,
+ context: removeUndefinedAndNullValues({
+ app: {
+ build: '1.0.0',
+ name: 'RudderLabs JavaScript SDK',
+ namespace: 'com.rudderlabs.javascript',
+ version: '1.0.0',
+ },
+ device: {
+ adTrackingEnabled: 'false',
+ advertisingId: 'T0T0T072-5e28-45a1-9eda-ce22a3e36d1a',
+ id: '3f034872-5e28-45a1-9eda-ce22a3e36d1a',
+ manufacturer: 'Google',
+ model: 'AOSP on IA Emulator',
+ name: 'generic_x86_arm',
+ type: 'ios',
+ attTrackingStatus: 3,
+ },
+ ip: '0.0.0.0',
+ library: {
+ name: 'RudderLabs JavaScript SDK',
+ version: '1.0.0',
+ },
+ locale: 'en-US',
+ os: {
+ name: 'iOS',
+ version: '14.4.1',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: parametersOverride.context.traits,
+ externalId: parametersOverride.externalId,
+ userAgent:
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36',
+ }),
+ event: parametersOverride.event,
+ anonymousId: parametersOverride.anonymousId || 'default-anonymousId',
+ properties: parametersOverride.properties,
+ type: eventType || 'page',
+ integrations: parametersOverride.integrations,
+ sentAt: '2022-04-20T15:20:57Z',
+ };
+
+ return removeUndefinedAndNullValues(payload);
+};
+
+export const generateSimplifiedPageOrScreenPayload = (
+ parametersOverride: any,
+ eventType: string,
+) => {
+ return removeUndefinedAndNullValues({
+ channel: 'web',
+ userId: parametersOverride.userId || 'default-userId',
+ type: eventType || 'page',
+ event: parametersOverride.event,
+ properties: parametersOverride.properties,
+ integrations: parametersOverride.integrations,
+ rudderId: parametersOverride.rudderId || generateAlphanumericId(36),
+ context: removeUndefinedAndNullValues({
+ externalId: parametersOverride.externalId,
+ traits: parametersOverride.context.traits,
+ }),
+ timestamp: parametersOverride.timestamp,
+ anonymousId: parametersOverride.anonymousId || 'default-anonymousId',
+ originalTimestamp: parametersOverride.originalTimestamp || '2022-04-26T05:17:09Z',
+ });
+};
+
+export const generateGroupPayload = (parametersOverride: any) => {
+ const payload = {
+ channel: 'web',
+ context: removeUndefinedAndNullValues({
+ 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_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
+ locale: 'en-US',
+ ip: '0.0.0.0',
+ os: {
+ name: '',
+ version: '',
+ },
+ screen: {
+ density: 2,
+ },
+ traits: parametersOverride.context.traits,
+ externalId: parametersOverride.externalId,
+ }),
+ messageId: parametersOverride.messageId || generateAlphanumericId(36),
+ session_id: parametersOverride.session_id || generateAlphanumericId(36),
+ originalTimestamp: parametersOverride.originalTimestamp || '2019-10-14T09:03:17.562Z',
+ timestamp: parametersOverride.timestamp,
+ anonymousId: parametersOverride.anonymousId || generateAlphanumericId(36),
+ userId: parametersOverride.userId || 'default-user-id',
+ type: 'group',
+ groupId: parametersOverride.groupId,
+ traits: parametersOverride.traits,
+ integrations: parametersOverride.integrations,
+ sentAt: parametersOverride.sentAt || '2019-10-14T09:03:22.563Z',
+ };
+ return removeUndefinedAndNullValues(payload);
+};
+
+export const generateSimplifiedGroupPayload = (parametersOverride: any) => {
+ return removeUndefinedAndNullValues({
+ channel: 'web',
+ userId: parametersOverride.userId || 'default-userId',
+ type: 'group',
+ groupId: parametersOverride.groupId,
+ traits: parametersOverride.traits,
+ integrations: parametersOverride.integrations,
+ context: removeUndefinedAndNullValues({
+ externalId: parametersOverride.externalId,
+ traits: parametersOverride.context.traits,
+ }),
+ timestamp: parametersOverride.timestamp,
+ anonymousId: parametersOverride.anonymousId || generateAlphanumericId(36),
+ originalTimestamp: parametersOverride.originalTimestamp || '2019-10-14T09:03:17.562Z',
+ });
+};
+
+export const transformResultBuilder = (matchData) => {
+ return removeUndefinedAndNullValues({
+ version: '1',
+ type: 'REST',
+ userId: matchData.userId,
+ method: matchData.method || 'POST',
+ endpoint: matchData.endpoint || '',
+ headers: matchData.headers || {},
+ params: matchData.params || {},
+ body: {
+ JSON: matchData.JSON || {},
+ JSON_ARRAY: matchData.JSON_ARRAY || {},
+ XML: matchData.XML || {},
+ FORM: matchData.FORM || {},
+ },
+ files: matchData.files || {},
+ });
+};
+
+export const compareObjects = (obj1, obj2, logPrefix = '', differences: string[] = []) => {
+ for (const key in obj1) {
+ if (obj1.hasOwnProperty(key)) {
+ const fullKey = logPrefix ? `${logPrefix}.${key}` : key;
+
+ if (typeof obj1[key] === 'object' && typeof obj2[key] === 'object') {
+ compareObjects(obj1[key], obj2[key], fullKey, differences);
+ } else if (obj1[key] !== obj2[key]) {
+ differences.push(fullKey);
+ }
+ }
+ }
+
+ // Check for keys in obj2 that are not present in obj1
+ for (const key in obj2) {
+ if (obj2.hasOwnProperty(key) && !obj1.hasOwnProperty(key)) {
+ const fullKey = logPrefix ? `${logPrefix}.${key}` : key;
+ differences.push(fullKey);
+ }
+ }
+
+ return differences;
+};
diff --git a/test/testHelper.js b/test/testHelper.js
index 5fe97fed67..f0297c0574 100644
--- a/test/testHelper.js
+++ b/test/testHelper.js
@@ -15,11 +15,71 @@ const setResponsesForMockAxiosAdapter = ({url, method, data, options}, {response
if (data) {
reqObj.data = data
}
- responses.push(`{httpReq: ${JSON.stringify(reqObj)},httpRes: ${JSON.stringify(response)}},`)
+ responses.push(`{httpReq: ${JSON.stringify(reqObj)},httpRes: ${JSON.stringify(response)}},`)
}
}
+
+const assertRouterOutput = (output, input) => {
+ if (!Array.isArray(output) || !Array.isArray(input)) {
+ return
+ }
+
+ const returnedJobids = {};
+ output.forEach((outEvent) => {
+ //Assert that metadata is present and is an array
+ const metadata = outEvent.metadata;
+ expect(Array.isArray(metadata)).toEqual(true);
+
+ //Assert that statusCode is present and is a number between 200 and 600
+ const statusCode = outEvent.statusCode;
+ expect(statusCode).toBeDefined();
+ expect(typeof statusCode === 'number').toEqual(true);
+ const validStatusCode = statusCode >= 200 && statusCode < 600;
+ expect(validStatusCode).toEqual(true);
+
+ //Assert that every job_id in the input is present in the output one and only one time.
+ metadata.forEach((meta) => {
+ const jobId = meta.jobId;
+ expect(returnedJobids[jobId]).toBeUndefined();
+ returnedJobids[jobId] = true;
+ });
+ });
+
+ const inputJobids = {};
+ input.forEach((input) => {
+ const jobId = input.metadata.jobId;
+ inputJobids[jobId] = true;
+ });
+
+ expect(returnedJobids).toEqual(inputJobids);
+
+ let userIdJobIdMap = {};
+ output.forEach((outEvent) => {
+ //Events with statusCode 400-499 are skipped. They are not sent to the destination.
+ if (outEvent.statusCode < 400 || outEvent.statusCode > 499) {
+ const metadata = outEvent.metadata;
+ metadata.forEach((meta) => {
+ const jobId = meta.jobId;
+ const userId = meta.userId;
+ let arr = userIdJobIdMap[userId] || [];
+ arr.push(jobId);
+ userIdJobIdMap[userId] = arr;
+ });
+ }
+ });
+
+ //The jobids for a user should be in order. If not, there is an issue.
+ Object.keys(userIdJobIdMap).forEach((userId) => {
+ const jobIds = userIdJobIdMap[userId];
+ for (let i = 0; i < jobIds.length - 1; i++) {
+ expect(jobIds[i] < jobIds[i + 1]).toEqual(true);
+ }
+ });
+};
+
module.exports = {
getFuncTestData,
responses,
- setResponsesForMockAxiosAdapter
+ setResponsesForMockAxiosAdapter,
+ assertRouterOutput
};
diff --git a/test/test_reporter/reporter.ts b/test/test_reporter/reporter.ts
new file mode 100644
index 0000000000..135f980398
--- /dev/null
+++ b/test/test_reporter/reporter.ts
@@ -0,0 +1,133 @@
+import fs from 'fs';
+import { compareObjects } from '../integrations/testUtils';
+
+// Step 1: Generate the template HTML
+const generateHTMLTemplate = () => `
+
+
+
+
+
+ Test Report
+
+
+
+
+
+ Test Report
+
+
+ Integration Name |
+ Id |
+ Description |
+ Success Criteria |
+ Scenario |
+ Module |
+ Feature |
+ API Version |
+ Test Input |
+ Test Output |
+ Expected Output |
+ Diff Keys |
+ Test Status |
+
+
+
+
+
+
+`;
+
+// Step 2: Iterate through each test data element and add it to the HTML template
+const generateHTMLContent = (testData, expectedData, testStatus) => {
+ let htmlContent = '';
+ let diffKeys: string[] = [];
+ diffKeys = compareObjects(testData.output.response.body, expectedData);
+ htmlContent += `
+
+ ${testData.name} |
+ ${testData.id} |
+ ${testData.description} |
+ ${testData.successCriteria} |
+ ${testData.scenario} |
+ ${testData.module} |
+ ${testData.feature} |
+ ${testData.version} |
+ ${JSON.stringify(testData.input.request.body)} |
+ ${JSON.stringify(testData.output.response.body)} |
+ ${JSON.stringify(expectedData)} |
+ ${JSON.stringify(diffKeys)} |
+ ${testStatus} |
+
+
+ `;
+
+ return htmlContent;
+};
+
+// Step 3: Write the HTML report to a file
+export const generateTestReport = (testData, output, result) => {
+ fs.readFile('test_reports/test-report.html', 'utf8', (err, htmlTemplate) => {
+ if (err) {
+ console.error(err);
+ return;
+ }
+
+ const htmlContent = generateHTMLContent(testData, output, result);
+ const finalHTML = htmlTemplate.replace('', htmlContent);
+ fs.writeFileSync('test_reports/test-report.html', finalHTML);
+ });
+};
+
+export const initaliseReport = () => {
+ const htmlTemplate = generateHTMLTemplate();
+ if (!fs.existsSync('test_reports')){
+ fs.mkdirSync('test_reports');
+}
+ fs.writeFileSync('test_reports/test-report.html', htmlTemplate);
+ console.log('Report initialised');
+};
diff --git a/tsconfig.json b/tsconfig.json
index 3d91523d78..9db40dd0e1 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -102,6 +102,6 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
- "exclude": ["./src/**/*.test.js", "./src/**/*.test.ts"],
+ "exclude": ["./src/**/*.test.js", "./src/**/*.test.ts", "./test"],
"include": ["./src", "./src/**/*.json"]
}