diff --git a/license.spec.js b/license.spec.js index 8a5e3c4a6..c805906a1 100644 --- a/license.spec.js +++ b/license.spec.js @@ -3,7 +3,7 @@ /** * Dependencies */ -const fs = require("fs"); +const fs = require('fs'); /** * Tests @@ -11,7 +11,7 @@ const fs = require("fs"); describe('LICENSE', () => { it('should contain the current year as the end year of the license', () => { const license = fs.readFileSync(`${process.cwd()}/LICENSE.md`, 'utf8'); - const currentYear= (new Date()).getFullYear(); + const currentYear = (new Date()).getFullYear(); return expect(license.indexOf(`-${currentYear}`)).to.not.equal(-1); }); }); diff --git a/packages/client/src/client.spec.js b/packages/client/src/client.spec.js index 3a2c1218b..a8503c1af 100644 --- a/packages/client/src/client.spec.js +++ b/packages/client/src/client.spec.js @@ -7,8 +7,8 @@ const baseUrl = 'http://localhost:4010/'; describe('test_access_settings_activity_get', () => { const request = {}; const queryParams = { - 'limit': 1 -}; + 'limit': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/access_settings/activity'; @@ -28,18 +28,18 @@ describe('test_access_settings_activity_get', () => { describe('test_access_settings_whitelist_post', () => { const request = {}; const data = { - "ips": [ - { - "ip": "192.168.1.1" - }, - { - "ip": "192.*.*.*" - }, - { - "ip": "192.168.1.3/32" - } - ] -}; + 'ips': [ + { + 'ip': '192.168.1.1', + }, + { + 'ip': '192.*.*.*', + }, + { + 'ip': '192.168.1.3/32', + }, + ], + }; request.body = data; request.method = 'POST'; request.url = '/v3/access_settings/whitelist'; @@ -59,12 +59,12 @@ describe('test_access_settings_whitelist_post', () => { describe('test_access_settings_whitelist_delete', () => { const request = {}; const data = { - "ids": [ - 1, - 2, - 3 - ] -}; + 'ids': [ + 1, + 2, + 3, + ], + }; request.body = data; request.method = 'DELETE'; request.url = '/v3/access_settings/whitelist'; @@ -135,10 +135,10 @@ describe('test_access_settings_whitelist__rule_id__get', () => { describe('test_alerts_post', () => { const request = {}; const data = { - "email_to": "example@example.com", - "frequency": "daily", - "type": "stats_notification" -}; + 'email_to': 'example@example.com', + 'frequency': 'daily', + 'type': 'stats_notification', + }; request.body = data; request.method = 'POST'; request.url = '/v3/alerts'; @@ -175,8 +175,8 @@ describe('test_alerts_get', () => { describe('test_alerts__alert_id__patch', () => { const request = {}; const data = { - "email_to": "example@example.com" -}; + 'email_to': 'example@example.com', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/alerts/{alert_id}'; @@ -230,14 +230,14 @@ describe('test_alerts__alert_id__get', () => { describe('test_api_keys_post', () => { const request = {}; const data = { - "name": "My API Key", - "sample": "data", - "scopes": [ - "mail.send", - "alerts.create", - "alerts.read" - ] -}; + 'name': 'My API Key', + 'sample': 'data', + 'scopes': [ + 'mail.send', + 'alerts.create', + 'alerts.read', + ], + }; request.body = data; request.method = 'POST'; request.url = '/v3/api_keys'; @@ -257,8 +257,8 @@ describe('test_api_keys_post', () => { describe('test_api_keys_get', () => { const request = {}; const queryParams = { - 'limit': 1 -}; + 'limit': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/api_keys'; @@ -278,12 +278,12 @@ describe('test_api_keys_get', () => { describe('test_api_keys__api_key_id__put', () => { const request = {}; const data = { - "name": "A New Hope", - "scopes": [ - "user.profile.read", - "user.profile.update" - ] -}; + 'name': 'A New Hope', + 'scopes': [ + 'user.profile.read', + 'user.profile.update', + ], + }; request.body = data; request.method = 'PUT'; request.url = '/v3/api_keys/{api_key_id}'; @@ -303,8 +303,8 @@ describe('test_api_keys__api_key_id__put', () => { describe('test_api_keys__api_key_id__patch', () => { const request = {}; const data = { - "name": "A New Hope" -}; + 'name': 'A New Hope', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/api_keys/{api_key_id}'; @@ -358,10 +358,10 @@ describe('test_api_keys__api_key_id__get', () => { describe('test_asm_groups_post', () => { const request = {}; const data = { - "description": "Suggestions for products our users might like.", - "is_default": true, - "name": "Product Suggestions" -}; + 'description': 'Suggestions for products our users might like.', + 'is_default': true, + 'name': 'Product Suggestions', + }; request.body = data; request.method = 'POST'; request.url = '/v3/asm/groups'; @@ -381,8 +381,8 @@ describe('test_asm_groups_post', () => { describe('test_asm_groups_get', () => { const request = {}; const queryParams = { - 'id': 1 -}; + 'id': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/asm/groups'; @@ -419,10 +419,10 @@ describe('test_asm_groups__group_id__delete', () => { describe('test_asm_groups__group_id__patch', () => { const request = {}; const data = { - "description": "Suggestions for items our users might like.", - "id": 103, - "name": "Item Suggestions" -}; + 'description': 'Suggestions for items our users might like.', + 'id': 103, + 'name': 'Item Suggestions', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/asm/groups/{group_id}'; @@ -459,11 +459,11 @@ describe('test_asm_groups__group_id__get', () => { describe('test_asm_groups__group_id__suppressions_post', () => { const request = {}; const data = { - "recipient_emails": [ - "test1@example.com", - "test2@example.com" - ] -}; + 'recipient_emails': [ + 'test1@example.com', + 'test2@example.com', + ], + }; request.body = data; request.method = 'POST'; request.url = '/v3/asm/groups/{group_id}/suppressions'; @@ -500,12 +500,12 @@ describe('test_asm_groups__group_id__suppressions_get', () => { describe('test_asm_groups__group_id__suppressions_search_post', () => { const request = {}; const data = { - "recipient_emails": [ - "exists1@example.com", - "exists2@example.com", - "doesnotexists@example.com" - ] -}; + 'recipient_emails': [ + 'exists1@example.com', + 'exists2@example.com', + 'doesnotexists@example.com', + ], + }; request.body = data; request.method = 'POST'; request.url = '/v3/asm/groups/{group_id}/suppressions/search'; @@ -559,11 +559,11 @@ describe('test_asm_suppressions_get', () => { describe('test_asm_suppressions_global_post', () => { const request = {}; const data = { - "recipient_emails": [ - "test1@example.com", - "test2@example.com" - ] -}; + 'recipient_emails': [ + 'test1@example.com', + 'test2@example.com', + ], + }; request.body = data; request.method = 'POST'; request.url = '/v3/asm/suppressions/global'; @@ -634,13 +634,13 @@ describe('test_asm_suppressions__email__get', () => { describe('test_browsers_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'browsers': 'test_string', - 'end_date': '2016-04-01', - 'limit': 'test_string', - 'offset': 'test_string', - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'browsers': 'test_string', + 'end_date': '2016-04-01', + 'limit': 'test_string', + 'offset': 'test_string', + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/browsers/stats'; @@ -660,25 +660,25 @@ describe('test_browsers_stats_get', () => { describe('test_campaigns_post', () => { const request = {}; const data = { - "categories": [ - "spring line" - ], - "custom_unsubscribe_url": "", - "html_content": "
Check out our spring line!
", - "ip_pool": "marketing", - "list_ids": [ - 110, - 124 - ], - "plain_content": "Check out our spring line!", - "segment_ids": [ - 110 - ], - "sender_id": 124451, - "subject": "New Products for Spring!", - "suppression_group_id": 42, - "title": "March Newsletter" -}; + 'categories': [ + 'spring line', + ], + 'custom_unsubscribe_url': '', + 'html_content': 'Check out our spring line!
', + 'ip_pool': 'marketing', + 'list_ids': [ + 110, + 124, + ], + 'plain_content': 'Check out our spring line!', + 'segment_ids': [ + 110, + ], + 'sender_id': 124451, + 'subject': 'New Products for Spring!', + 'suppression_group_id': 42, + 'title': 'March Newsletter', + }; request.body = data; request.method = 'POST'; request.url = '/v3/campaigns'; @@ -698,9 +698,9 @@ describe('test_campaigns_post', () => { describe('test_campaigns_get', () => { const request = {}; const queryParams = { - 'limit': 1, - 'offset': 1 -}; + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/campaigns'; @@ -720,14 +720,14 @@ describe('test_campaigns_get', () => { describe('test_campaigns__campaign_id__patch', () => { const request = {}; const data = { - "categories": [ - "summer line" - ], - "html_content": "Check out our summer line!
", - "plain_content": "Check out our summer line!", - "subject": "New Products for Summer!", - "title": "May Newsletter" -}; + 'categories': [ + 'summer line', + ], + 'html_content': 'Check out our summer line!
', + 'plain_content': 'Check out our summer line!', + 'subject': 'New Products for Summer!', + 'title': 'May Newsletter', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/campaigns/{campaign_id}'; @@ -798,8 +798,8 @@ describe('test_campaigns__campaign_id__schedules_delete', () => { describe('test_campaigns__campaign_id__schedules_post', () => { const request = {}; const data = { - "send_at": 1489771528 -}; + 'send_at': 1489771528, + }; request.body = data; request.method = 'POST'; request.url = '/v3/campaigns/{campaign_id}/schedules'; @@ -836,8 +836,8 @@ describe('test_campaigns__campaign_id__schedules_get', () => { describe('test_campaigns__campaign_id__schedules_patch', () => { const request = {}; const data = { - "send_at": 1489451436 -}; + 'send_at': 1489451436, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/campaigns/{campaign_id}/schedules'; @@ -874,8 +874,8 @@ describe('test_campaigns__campaign_id__schedules_now_post', () => { describe('test_campaigns__campaign_id__schedules_test_post', () => { const request = {}; const data = { - "to": "your.email@example.com" -}; + 'to': 'your.email@example.com', + }; request.body = data; request.method = 'POST'; request.url = '/v3/campaigns/{campaign_id}/schedules/test'; @@ -895,10 +895,10 @@ describe('test_campaigns__campaign_id__schedules_test_post', () => { describe('test_categories_get', () => { const request = {}; const queryParams = { - 'category': 'test_string', - 'limit': 1, - 'offset': 1 -}; + 'category': 'test_string', + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/categories'; @@ -918,13 +918,13 @@ describe('test_categories_get', () => { describe('test_categories_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'categories': 'test_string', - 'end_date': '2016-04-01', - 'limit': 1, - 'offset': 1, - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'categories': 'test_string', + 'end_date': '2016-04-01', + 'limit': 1, + 'offset': 1, + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/categories/stats'; @@ -944,14 +944,14 @@ describe('test_categories_stats_get', () => { describe('test_categories_stats_sums_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'limit': 1, - 'offset': 1, - 'sort_by_direction': 'asc', - 'sort_by_metric': 'test_string', - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 1, + 'offset': 1, + 'sort_by_direction': 'asc', + 'sort_by_metric': 'test_string', + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/categories/stats/sums'; @@ -971,10 +971,10 @@ describe('test_categories_stats_sums_get', () => { describe('test_clients_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/clients/stats'; @@ -994,10 +994,10 @@ describe('test_clients_stats_get', () => { describe('test_clients__client_type__stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/clients/{client_type}/stats'; @@ -1017,9 +1017,9 @@ describe('test_clients__client_type__stats_get', () => { describe('test_contactdb_custom_fields_post', () => { const request = {}; const data = { - "name": "pet", - "type": "text" -}; + 'name': 'pet', + 'type': 'text', + }; request.body = data; request.method = 'POST'; request.url = '/v3/contactdb/custom_fields'; @@ -1090,8 +1090,8 @@ describe('test_contactdb_custom_fields__custom_field_id__get', () => { describe('test_contactdb_lists_post', () => { const request = {}; const data = { - "name": "your list name" -}; + 'name': 'your list name', + }; request.body = data; request.method = 'POST'; request.url = '/v3/contactdb/lists'; @@ -1111,11 +1111,11 @@ describe('test_contactdb_lists_post', () => { describe('test_contactdb_lists_delete', () => { const request = {}; const data = [ - 1, - 2, - 3, - 4 -]; + 1, + 2, + 3, + 4, + ]; request.body = data; request.method = 'DELETE'; request.url = '/v3/contactdb/lists'; @@ -1152,8 +1152,8 @@ describe('test_contactdb_lists_get', () => { describe('test_contactdb_lists__list_id__delete', () => { const request = {}; const queryParams = { - 'delete_contacts': 'true' -}; + 'delete_contacts': 'true', + }; request.qs = queryParams; request.method = 'DELETE'; request.url = '/v3/contactdb/lists/{list_id}'; @@ -1173,12 +1173,12 @@ describe('test_contactdb_lists__list_id__delete', () => { describe('test_contactdb_lists__list_id__patch', () => { const request = {}; const data = { - "name": "newlistname" -}; + 'name': 'newlistname', + }; request.body = data; const queryParams = { - 'list_id': 1 -}; + 'list_id': 1, + }; request.qs = queryParams; request.method = 'PATCH'; request.url = '/v3/contactdb/lists/{list_id}'; @@ -1198,8 +1198,8 @@ describe('test_contactdb_lists__list_id__patch', () => { describe('test_contactdb_lists__list_id__get', () => { const request = {}; const queryParams = { - 'list_id': 1 -}; + 'list_id': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/contactdb/lists/{list_id}'; @@ -1219,9 +1219,9 @@ describe('test_contactdb_lists__list_id__get', () => { describe('test_contactdb_lists__list_id__recipients_post', () => { const request = {}; const data = [ - "recipient_id1", - "recipient_id2" -]; + 'recipient_id1', + 'recipient_id2', + ]; request.body = data; request.method = 'POST'; request.url = '/v3/contactdb/lists/{list_id}/recipients'; @@ -1241,10 +1241,10 @@ describe('test_contactdb_lists__list_id__recipients_post', () => { describe('test_contactdb_lists__list_id__recipients_get', () => { const request = {}; const queryParams = { - 'list_id': 1, - 'page': 1, - 'page_size': 1 -}; + 'list_id': 1, + 'page': 1, + 'page_size': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/contactdb/lists/{list_id}/recipients'; @@ -1281,9 +1281,9 @@ describe('test_contactdb_lists__list_id__recipients__recipient_id__post', () => describe('test_contactdb_lists__list_id__recipients__recipient_id__delete', () => { const request = {}; const queryParams = { - 'list_id': 1, - 'recipient_id': 1 -}; + 'list_id': 1, + 'recipient_id': 1, + }; request.qs = queryParams; request.method = 'DELETE'; request.url = '/v3/contactdb/lists/{list_id}/recipients/{recipient_id}'; @@ -1303,19 +1303,19 @@ describe('test_contactdb_lists__list_id__recipients__recipient_id__delete', () = describe('test_contactdb_recipients_post', () => { const request = {}; const data = [ - { - "age": 25, - "email": "example@example.com", - "first_name": "", - "last_name": "User" - }, - { - "age": 25, - "email": "example2@example.com", - "first_name": "Example", - "last_name": "User" - } -]; + { + 'age': 25, + 'email': 'example@example.com', + 'first_name': '', + 'last_name': 'User', + }, + { + 'age': 25, + 'email': 'example2@example.com', + 'first_name': 'Example', + 'last_name': 'User', + }, + ]; request.body = data; request.method = 'POST'; request.url = '/v3/contactdb/recipients'; @@ -1335,9 +1335,9 @@ describe('test_contactdb_recipients_post', () => { describe('test_contactdb_recipients_delete', () => { const request = {}; const data = [ - "recipient_id1", - "recipient_id2" -]; + 'recipient_id1', + 'recipient_id2', + ]; request.body = data; request.method = 'DELETE'; request.url = '/v3/contactdb/recipients'; @@ -1357,9 +1357,9 @@ describe('test_contactdb_recipients_delete', () => { describe('test_contactdb_recipients_get', () => { const request = {}; const queryParams = { - 'page': 1, - 'page_size': 1 -}; + 'page': 1, + 'page_size': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/contactdb/recipients'; @@ -1379,12 +1379,12 @@ describe('test_contactdb_recipients_get', () => { describe('test_contactdb_recipients_patch', () => { const request = {}; const data = [ - { - "email": "jones@example.com", - "first_name": "Guy", - "last_name": "Jones" - } -]; + { + 'email': 'jones@example.com', + 'first_name': 'Guy', + 'last_name': 'Jones', + }, + ]; request.body = data; request.method = 'PATCH'; request.url = '/v3/contactdb/recipients'; @@ -1438,8 +1438,8 @@ describe('test_contactdb_recipients_count_get', () => { describe('test_contactdb_recipients_search_get', () => { const request = {}; const queryParams = { - '{field_name}': 'test_string' -}; + '{field_name}': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/contactdb/recipients/search'; @@ -1527,29 +1527,29 @@ describe('test_contactdb_reserved_fields_get', () => { describe('test_contactdb_segments_post', () => { const request = {}; const data = { - "conditions": [ - { - "and_or": "", - "field": "last_name", - "operator": "eq", - "value": "Miller" - }, - { - "and_or": "and", - "field": "last_clicked", - "operator": "gt", - "value": "01/02/2015" - }, - { - "and_or": "or", - "field": "clicks.campaign_identifier", - "operator": "eq", - "value": "513" - } - ], - "list_id": 4, - "name": "Last Name Miller" -}; + 'conditions': [ + { + 'and_or': '', + 'field': 'last_name', + 'operator': 'eq', + 'value': 'Miller', + }, + { + 'and_or': 'and', + 'field': 'last_clicked', + 'operator': 'gt', + 'value': '01/02/2015', + }, + { + 'and_or': 'or', + 'field': 'clicks.campaign_identifier', + 'operator': 'eq', + 'value': '513', + }, + ], + 'list_id': 4, + 'name': 'Last Name Miller', + }; request.body = data; request.method = 'POST'; request.url = '/v3/contactdb/segments'; @@ -1586,8 +1586,8 @@ describe('test_contactdb_segments_get', () => { describe('test_contactdb_segments__segment_id__delete', () => { const request = {}; const queryParams = { - 'delete_contacts': 'true' -}; + 'delete_contacts': 'true', + }; request.qs = queryParams; request.method = 'DELETE'; request.url = '/v3/contactdb/segments/{segment_id}'; @@ -1607,21 +1607,21 @@ describe('test_contactdb_segments__segment_id__delete', () => { describe('test_contactdb_segments__segment_id__patch', () => { const request = {}; const data = { - "conditions": [ - { - "and_or": "", - "field": "last_name", - "operator": "eq", - "value": "Miller" - } - ], - "list_id": 5, - "name": "The Millers" -}; + 'conditions': [ + { + 'and_or': '', + 'field': 'last_name', + 'operator': 'eq', + 'value': 'Miller', + }, + ], + 'list_id': 5, + 'name': 'The Millers', + }; request.body = data; const queryParams = { - 'segment_id': 'test_string' -}; + 'segment_id': 'test_string', + }; request.qs = queryParams; request.method = 'PATCH'; request.url = '/v3/contactdb/segments/{segment_id}'; @@ -1641,8 +1641,8 @@ describe('test_contactdb_segments__segment_id__patch', () => { describe('test_contactdb_segments__segment_id__get', () => { const request = {}; const queryParams = { - 'segment_id': 1 -}; + 'segment_id': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/contactdb/segments/{segment_id}'; @@ -1662,9 +1662,9 @@ describe('test_contactdb_segments__segment_id__get', () => { describe('test_contactdb_segments__segment_id__recipients_get', () => { const request = {}; const queryParams = { - 'page': 1, - 'page_size': 1 -}; + 'page': 1, + 'page_size': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/contactdb/segments/{segment_id}/recipients'; @@ -1701,12 +1701,12 @@ describe('test_contactdb_status_get', () => { describe('test_devices_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'limit': 1, - 'offset': 1, - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 1, + 'offset': 1, + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/devices/stats'; @@ -1726,13 +1726,13 @@ describe('test_devices_stats_get', () => { describe('test_geo_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'country': 'US', - 'end_date': '2016-04-01', - 'limit': 1, - 'offset': 1, - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'country': 'US', + 'end_date': '2016-04-01', + 'limit': 1, + 'offset': 1, + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/geo/stats'; @@ -1752,14 +1752,14 @@ describe('test_geo_stats_get', () => { describe('test_ips_post', () => { const request = {}; const data = { - "count": 90323478, - "subusers": [ - "subuser1", - "subuser2" - ], - "user_can_send": true, - "warmup": true -}; + 'count': 90323478, + 'subusers': [ + 'subuser1', + 'subuser2', + ], + 'user_can_send': true, + 'warmup': true, + }; request.body = data; request.method = 'POST'; request.url = '/v3/ips'; @@ -1779,13 +1779,13 @@ describe('test_ips_post', () => { describe('test_ips_get', () => { const request = {}; const queryParams = { - 'exclude_whitelabels': 'true', - 'ip': 'test_string', - 'limit': 1, - 'offset': 1, - 'sort_by_direction': 'asc', - 'subuser': 'test_string' -}; + 'exclude_whitelabels': 'true', + 'ip': 'test_string', + 'limit': 1, + 'offset': 1, + 'sort_by_direction': 'asc', + 'subuser': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/ips'; @@ -1822,8 +1822,8 @@ describe('test_ips_assigned_get', () => { describe('test_ips_pools_post', () => { const request = {}; const data = { - "name": "marketing" -}; + 'name': 'marketing', + }; request.body = data; request.method = 'POST'; request.url = '/v3/ips/pools'; @@ -1860,8 +1860,8 @@ describe('test_ips_pools_get', () => { describe('test_ips_pools__pool_name__put', () => { const request = {}; const data = { - "name": "new_pool_name" -}; + 'name': 'new_pool_name', + }; request.body = data; request.method = 'PUT'; request.url = '/v3/ips/pools/{pool_name}'; @@ -1915,8 +1915,8 @@ describe('test_ips_pools__pool_name__get', () => { describe('test_ips_pools__pool_name__ips_post', () => { const request = {}; const data = { - "ip": "0.0.0.0" -}; + 'ip': '0.0.0.0', + }; request.body = data; request.method = 'POST'; request.url = '/v3/ips/pools/{pool_name}/ips'; @@ -1970,8 +1970,8 @@ describe('test_ips_remaining_get', () => { describe('test_ips_warmup_post', () => { const request = {}; const data = { - "ip": "0.0.0.0" -}; + 'ip': '0.0.0.0', + }; request.body = data; request.method = 'POST'; request.url = '/v3/ips/warmup'; @@ -2093,33 +2093,33 @@ describe('test_mail_batch__batch_id__get', () => { describe('test_mail_send_post', () => { const request = {}; const data = { - "content": [ - { - "type": "text/html", - "value": "Hello, world!
" - } - ], - "from": { - "email": "sam.smith@example.com", - "name": "Sam Smith" - }, - "personalizations": [ - { - "subject": "Hello, World!", - "to": [ - { - "email": "john.doe@example.com", - "name": "John Doe" - } - ] - } - ], - "reply_to": { - "email": "sam.smith@example.com", - "name": "Sam Smith" - }, - "subject": "Hello, World!" -}; + 'content': [ + { + 'type': 'text/html', + 'value': 'Hello, world!
', + }, + ], + 'from': { + 'email': 'sam.smith@example.com', + 'name': 'Sam Smith', + }, + 'personalizations': [ + { + 'subject': 'Hello, World!', + 'to': [ + { + 'email': 'john.doe@example.com', + 'name': 'John Doe', + }, + ], + }, + ], + 'reply_to': { + 'email': 'sam.smith@example.com', + 'name': 'Sam Smith', + }, + 'subject': 'Hello, World!', + }; request.body = data; request.method = 'POST'; request.url = '/v3/mail/send'; @@ -2139,9 +2139,9 @@ describe('test_mail_send_post', () => { describe('test_mail_settings_get', () => { const request = {}; const queryParams = { - 'limit': 1, - 'offset': 1 -}; + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/mail_settings'; @@ -2161,12 +2161,12 @@ describe('test_mail_settings_get', () => { describe('test_mail_settings_address_whitelist_patch', () => { const request = {}; const data = { - "enabled": true, - "list": [ - "email1@example.com", - "example.com" - ] -}; + 'enabled': true, + 'list': [ + 'email1@example.com', + 'example.com', + ], + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/address_whitelist'; @@ -2203,9 +2203,9 @@ describe('test_mail_settings_address_whitelist_get', () => { describe('test_mail_settings_bcc_patch', () => { const request = {}; const data = { - "email": "email@example.com", - "enabled": false -}; + 'email': 'email@example.com', + 'enabled': false, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/bcc'; @@ -2242,10 +2242,10 @@ describe('test_mail_settings_bcc_get', () => { describe('test_mail_settings_bounce_purge_patch', () => { const request = {}; const data = { - "enabled": true, - "hard_bounces": 5, - "soft_bounces": 5 -}; + 'enabled': true, + 'hard_bounces': 5, + 'soft_bounces': 5, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/bounce_purge'; @@ -2282,10 +2282,10 @@ describe('test_mail_settings_bounce_purge_get', () => { describe('test_mail_settings_footer_patch', () => { const request = {}; const data = { - "enabled": true, - "html_content": "...", - "plain_content": "..." -}; + 'enabled': true, + 'html_content': '...', + 'plain_content': '...', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/footer'; @@ -2322,9 +2322,9 @@ describe('test_mail_settings_footer_get', () => { describe('test_mail_settings_forward_bounce_patch', () => { const request = {}; const data = { - "email": "example@example.com", - "enabled": true -}; + 'email': 'example@example.com', + 'enabled': true, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/forward_bounce'; @@ -2361,9 +2361,9 @@ describe('test_mail_settings_forward_bounce_get', () => { describe('test_mail_settings_forward_spam_patch', () => { const request = {}; const data = { - "email": "", - "enabled": false -}; + 'email': '', + 'enabled': false, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/forward_spam'; @@ -2400,8 +2400,8 @@ describe('test_mail_settings_forward_spam_get', () => { describe('test_mail_settings_plain_content_patch', () => { const request = {}; const data = { - "enabled": false -}; + 'enabled': false, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/plain_content'; @@ -2438,10 +2438,10 @@ describe('test_mail_settings_plain_content_get', () => { describe('test_mail_settings_spam_check_patch', () => { const request = {}; const data = { - "enabled": true, - "max_score": 5, - "url": "url" -}; + 'enabled': true, + 'max_score': 5, + 'url': 'url', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/spam_check'; @@ -2478,9 +2478,9 @@ describe('test_mail_settings_spam_check_get', () => { describe('test_mail_settings_template_patch', () => { const request = {}; const data = { - "enabled": true, - "html_content": "<% body %>" -}; + 'enabled': true, + 'html_content': '<% body %>', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/mail_settings/template'; @@ -2517,13 +2517,13 @@ describe('test_mail_settings_template_get', () => { describe('test_mailbox_providers_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'limit': 1, - 'mailbox_providers': 'test_string', - 'offset': 1, - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 1, + 'mailbox_providers': 'test_string', + 'offset': 1, + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/mailbox_providers/stats'; @@ -2543,9 +2543,9 @@ describe('test_mailbox_providers_stats_get', () => { describe('test_partner_settings_get', () => { const request = {}; const queryParams = { - 'limit': 1, - 'offset': 1 -}; + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/partner_settings'; @@ -2565,10 +2565,10 @@ describe('test_partner_settings_get', () => { describe('test_partner_settings_new_relic_patch', () => { const request = {}; const data = { - "enable_subuser_statistics": true, - "enabled": true, - "license_key": "" -}; + 'enable_subuser_statistics': true, + 'enabled': true, + 'license_key': '', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/partner_settings/new_relic'; @@ -2622,9 +2622,9 @@ describe('test_scopes_get', () => { describe('test_scopes_requests_get', () => { const request = {}; const queryParams = { - 'limit': 1, - 'offset': 1 -}; + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/scopes/requests'; @@ -2678,22 +2678,22 @@ describe('test_scopes_requests__request_id__approve_patch', () => { describe('test_senders_post', () => { const request = {}; const data = { - "address": "123 Elm St.", - "address_2": "Apt. 456", - "city": "Denver", - "country": "United States", - "from": { - "email": "from@example.com", - "name": "Example INC" - }, - "nickname": "My Sender ID", - "reply_to": { - "email": "replyto@example.com", - "name": "Example INC" - }, - "state": "Colorado", - "zip": "80202" -}; + 'address': '123 Elm St.', + 'address_2': 'Apt. 456', + 'city': 'Denver', + 'country': 'United States', + 'from': { + 'email': 'from@example.com', + 'name': 'Example INC', + }, + 'nickname': 'My Sender ID', + 'reply_to': { + 'email': 'replyto@example.com', + 'name': 'Example INC', + }, + 'state': 'Colorado', + 'zip': '80202', + }; request.body = data; request.method = 'POST'; request.url = '/v3/senders'; @@ -2764,22 +2764,22 @@ describe('test_senders__sender_id__delete', () => { describe('test_senders__sender_id__patch', () => { const request = {}; const data = { - "address": "123 Elm St.", - "address_2": "Apt. 456", - "city": "Denver", - "country": "United States", - "from": { - "email": "from@example.com", - "name": "Example INC" - }, - "nickname": "My Sender ID", - "reply_to": { - "email": "replyto@example.com", - "name": "Example INC" - }, - "state": "Colorado", - "zip": "80202" -}; + 'address': '123 Elm St.', + 'address_2': 'Apt. 456', + 'city': 'Denver', + 'country': 'United States', + 'from': { + 'email': 'from@example.com', + 'name': 'Example INC', + }, + 'nickname': 'My Sender ID', + 'reply_to': { + 'email': 'replyto@example.com', + 'name': 'Example INC', + }, + 'state': 'Colorado', + 'zip': '80202', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/senders/{sender_id}'; @@ -2816,12 +2816,12 @@ describe('test_senders__sender_id__resend_verification_post', () => { describe('test_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'limit': 1, - 'offset': 1, - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 1, + 'offset': 1, + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/stats'; @@ -2841,14 +2841,14 @@ describe('test_stats_get', () => { describe('test_subusers_post', () => { const request = {}; const data = { - "email": "John@example.com", - "ips": [ - "1.1.1.1", - "2.2.2.2" - ], - "password": "johns_password", - "username": "John@example.com" -}; + 'email': 'John@example.com', + 'ips': [ + '1.1.1.1', + '2.2.2.2', + ], + 'password': 'johns_password', + 'username': 'John@example.com', + }; request.body = data; request.method = 'POST'; request.url = '/v3/subusers'; @@ -2868,10 +2868,10 @@ describe('test_subusers_post', () => { describe('test_subusers_get', () => { const request = {}; const queryParams = { - 'limit': 1, - 'offset': 1, - 'username': 'test_string' -}; + 'limit': 1, + 'offset': 1, + 'username': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/subusers'; @@ -2891,8 +2891,8 @@ describe('test_subusers_get', () => { describe('test_subusers_reputations_get', () => { const request = {}; const queryParams = { - 'usernames': 'test_string' -}; + 'usernames': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/subusers/reputations'; @@ -2912,13 +2912,13 @@ describe('test_subusers_reputations_get', () => { describe('test_subusers_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'limit': 1, - 'offset': 1, - 'start_date': '2016-01-01', - 'subusers': 'test_string' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 1, + 'offset': 1, + 'start_date': '2016-01-01', + 'subusers': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/subusers/stats'; @@ -2938,13 +2938,13 @@ describe('test_subusers_stats_get', () => { describe('test_subusers_stats_monthly_get', () => { const request = {}; const queryParams = { - 'date': 'test_string', - 'limit': 1, - 'offset': 1, - 'sort_by_direction': 'asc', - 'sort_by_metric': 'test_string', - 'subuser': 'test_string' -}; + 'date': 'test_string', + 'limit': 1, + 'offset': 1, + 'sort_by_direction': 'asc', + 'sort_by_metric': 'test_string', + 'subuser': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/subusers/stats/monthly'; @@ -2964,14 +2964,14 @@ describe('test_subusers_stats_monthly_get', () => { describe('test_subusers_stats_sums_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'limit': 1, - 'offset': 1, - 'sort_by_direction': 'asc', - 'sort_by_metric': 'test_string', - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 1, + 'offset': 1, + 'sort_by_direction': 'asc', + 'sort_by_metric': 'test_string', + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/subusers/stats/sums'; @@ -3008,8 +3008,8 @@ describe('test_subusers__subuser_name__delete', () => { describe('test_subusers__subuser_name__patch', () => { const request = {}; const data = { - "disabled": false -}; + 'disabled': false, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/subusers/{subuser_name}'; @@ -3029,8 +3029,8 @@ describe('test_subusers__subuser_name__patch', () => { describe('test_subusers__subuser_name__ips_put', () => { const request = {}; const data = [ - "127.0.0.1" -]; + '127.0.0.1', + ]; request.body = data; request.method = 'PUT'; request.url = '/v3/subusers/{subuser_name}/ips'; @@ -3050,9 +3050,9 @@ describe('test_subusers__subuser_name__ips_put', () => { describe('test_subusers__subuser_name__monitor_put', () => { const request = {}; const data = { - "email": "example@example.com", - "frequency": 500 -}; + 'email': 'example@example.com', + 'frequency': 500, + }; request.body = data; request.method = 'PUT'; request.url = '/v3/subusers/{subuser_name}/monitor'; @@ -3072,9 +3072,9 @@ describe('test_subusers__subuser_name__monitor_put', () => { describe('test_subusers__subuser_name__monitor_post', () => { const request = {}; const data = { - "email": "example@example.com", - "frequency": 50000 -}; + 'email': 'example@example.com', + 'frequency': 50000, + }; request.body = data; request.method = 'POST'; request.url = '/v3/subusers/{subuser_name}/monitor'; @@ -3128,12 +3128,12 @@ describe('test_subusers__subuser_name__monitor_get', () => { describe('test_subusers__subuser_name__stats_monthly_get', () => { const request = {}; const queryParams = { - 'date': 'test_string', - 'limit': 1, - 'offset': 1, - 'sort_by_direction': 'asc', - 'sort_by_metric': 'test_string' -}; + 'date': 'test_string', + 'limit': 1, + 'offset': 1, + 'sort_by_direction': 'asc', + 'sort_by_metric': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/subusers/{subuser_name}/stats/monthly'; @@ -3153,12 +3153,12 @@ describe('test_subusers__subuser_name__stats_monthly_get', () => { describe('test_suppression_blocks_delete', () => { const request = {}; const data = { - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}; + 'delete_all': false, + 'emails': [ + 'example1@example.com', + 'example2@example.com', + ], + }; request.body = data; request.method = 'DELETE'; request.url = '/v3/suppression/blocks'; @@ -3178,11 +3178,11 @@ describe('test_suppression_blocks_delete', () => { describe('test_suppression_blocks_get', () => { const request = {}; const queryParams = { - 'end_time': 1, - 'limit': 1, - 'offset': 1, - 'start_time': 1 -}; + 'end_time': 1, + 'limit': 1, + 'offset': 1, + 'start_time': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/suppression/blocks'; @@ -3236,12 +3236,12 @@ describe('test_suppression_blocks__email__get', () => { describe('test_suppression_bounces_delete', () => { const request = {}; const data = { - "delete_all": true, - "emails": [ - "example@example.com", - "example2@example.com" - ] -}; + 'delete_all': true, + 'emails': [ + 'example@example.com', + 'example2@example.com', + ], + }; request.body = data; request.method = 'DELETE'; request.url = '/v3/suppression/bounces'; @@ -3261,9 +3261,9 @@ describe('test_suppression_bounces_delete', () => { describe('test_suppression_bounces_get', () => { const request = {}; const queryParams = { - 'end_time': 1, - 'start_time': 1 -}; + 'end_time': 1, + 'start_time': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/suppression/bounces'; @@ -3283,8 +3283,8 @@ describe('test_suppression_bounces_get', () => { describe('test_suppression_bounces__email__delete', () => { const request = {}; const queryParams = { - 'email_address': 'example@example.com' -}; + 'email_address': 'example@example.com', + }; request.qs = queryParams; request.method = 'DELETE'; request.url = '/v3/suppression/bounces/{email}'; @@ -3321,12 +3321,12 @@ describe('test_suppression_bounces__email__get', () => { describe('test_suppression_invalid_emails_delete', () => { const request = {}; const data = { - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}; + 'delete_all': false, + 'emails': [ + 'example1@example.com', + 'example2@example.com', + ], + }; request.body = data; request.method = 'DELETE'; request.url = '/v3/suppression/invalid_emails'; @@ -3346,11 +3346,11 @@ describe('test_suppression_invalid_emails_delete', () => { describe('test_suppression_invalid_emails_get', () => { const request = {}; const queryParams = { - 'end_time': 1, - 'limit': 1, - 'offset': 1, - 'start_time': 1 -}; + 'end_time': 1, + 'limit': 1, + 'offset': 1, + 'start_time': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/suppression/invalid_emails'; @@ -3404,12 +3404,12 @@ describe('test_suppression_invalid_emails__email__get', () => { describe('test_suppression_spam_reports_delete', () => { const request = {}; const data = { - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}; + 'delete_all': false, + 'emails': [ + 'example1@example.com', + 'example2@example.com', + ], + }; request.body = data; request.method = 'DELETE'; request.url = '/v3/suppression/spam_reports'; @@ -3429,11 +3429,11 @@ describe('test_suppression_spam_reports_delete', () => { describe('test_suppression_spam_reports_get', () => { const request = {}; const queryParams = { - 'end_time': 1, - 'limit': 1, - 'offset': 1, - 'start_time': 1 -}; + 'end_time': 1, + 'limit': 1, + 'offset': 1, + 'start_time': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/suppression/spam_reports'; @@ -3487,11 +3487,11 @@ describe('test_suppression_spam_reports__email__get', () => { describe('test_suppression_unsubscribes_get', () => { const request = {}; const queryParams = { - 'end_time': 1, - 'limit': 1, - 'offset': 1, - 'start_time': 1 -}; + 'end_time': 1, + 'limit': 1, + 'offset': 1, + 'start_time': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/suppression/unsubscribes'; @@ -3511,13 +3511,13 @@ describe('test_suppression_unsubscribes_get', () => { describe('test_teammates_post', () => { const request = {}; const data = { - "email": "teammate1@example.com", - "is_admin": false, - "scopes": [ - "user.profile.read", - "user.profile.update" - ] -}; + 'email': 'teammate1@example.com', + 'is_admin': false, + 'scopes': [ + 'user.profile.read', + 'user.profile.update', + ], + }; request.body = data; request.method = 'POST'; request.url = '/v3/teammates'; @@ -3537,9 +3537,9 @@ describe('test_teammates_post', () => { describe('test_teammates_get', () => { const request = {}; const queryParams = { - 'limit': 1, - 'offset': 1 -}; + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/teammates'; @@ -3627,12 +3627,12 @@ describe('test_teammates__username__delete', () => { describe('test_teammates__username__patch', () => { const request = {}; const data = { - "is_admin": false, - "scopes": [ - "user.profile.read", - "user.profile.edit" - ] -}; + 'is_admin': false, + 'scopes': [ + 'user.profile.read', + 'user.profile.edit', + ], + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/teammates/{username}'; @@ -3669,8 +3669,8 @@ describe('test_teammates__username__get', () => { describe('test_templates_post', () => { const request = {}; const data = { - "name": "example_name" -}; + 'name': 'example_name', + }; request.body = data; request.method = 'POST'; request.url = '/v3/templates'; @@ -3724,8 +3724,8 @@ describe('test_templates__template_id__delete', () => { describe('test_templates__template_id__patch', () => { const request = {}; const data = { - "name": "new_example_name" -}; + 'name': 'new_example_name', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/templates/{template_id}'; @@ -3762,13 +3762,13 @@ describe('test_templates__template_id__get', () => { describe('test_templates__template_id__versions_post', () => { const request = {}; const data = { - "active": 1, - "html_content": "<%body%>", - "name": "example_version_name", - "plain_content": "<%body%>", - "subject": "<%subject%>", - "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" -}; + 'active': 1, + 'html_content': '<%body%>', + 'name': 'example_version_name', + 'plain_content': '<%body%>', + 'subject': '<%subject%>', + 'template_id': 'ddb96bbc-9b92-425e-8979-99464621b543', + }; request.body = data; request.method = 'POST'; request.url = '/v3/templates/{template_id}/versions'; @@ -3805,12 +3805,12 @@ describe('test_templates__template_id__versions__version_id__delete', () => { describe('test_templates__template_id__versions__version_id__patch', () => { const request = {}; const data = { - "active": 1, - "html_content": "<%body%>", - "name": "updated_example_name", - "plain_content": "<%body%>", - "subject": "<%subject%>" -}; + 'active': 1, + 'html_content': '<%body%>', + 'name': 'updated_example_name', + 'plain_content': '<%body%>', + 'subject': '<%subject%>', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/templates/{template_id}/versions/{version_id}'; @@ -3864,9 +3864,9 @@ describe('test_templates__template_id__versions__version_id__activate_post', () describe('test_tracking_settings_get', () => { const request = {}; const queryParams = { - 'limit': 1, - 'offset': 1 -}; + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/tracking_settings'; @@ -3886,8 +3886,8 @@ describe('test_tracking_settings_get', () => { describe('test_tracking_settings_click_patch', () => { const request = {}; const data = { - "enabled": true -}; + 'enabled': true, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/tracking_settings/click'; @@ -3924,13 +3924,13 @@ describe('test_tracking_settings_click_get', () => { describe('test_tracking_settings_google_analytics_patch', () => { const request = {}; const data = { - "enabled": true, - "utm_campaign": "website", - "utm_content": "", - "utm_medium": "email", - "utm_source": "sendgrid.com", - "utm_term": "" -}; + 'enabled': true, + 'utm_campaign': 'website', + 'utm_content': '', + 'utm_medium': 'email', + 'utm_source': 'sendgrid.com', + 'utm_term': '', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/tracking_settings/google_analytics'; @@ -3967,8 +3967,8 @@ describe('test_tracking_settings_google_analytics_get', () => { describe('test_tracking_settings_open_patch', () => { const request = {}; const data = { - "enabled": true -}; + 'enabled': true, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/tracking_settings/open'; @@ -4005,13 +4005,13 @@ describe('test_tracking_settings_open_get', () => { describe('test_tracking_settings_subscription_patch', () => { const request = {}; const data = { - "enabled": true, - "html_content": "html content", - "landing": "landing page html", - "plain_content": "text content", - "replace": "replacement tag", - "url": "url" -}; + 'enabled': true, + 'html_content': 'html content', + 'landing': 'landing page html', + 'plain_content': 'text content', + 'replace': 'replacement tag', + 'url': 'url', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/tracking_settings/subscription'; @@ -4082,8 +4082,8 @@ describe('test_user_credits_get', () => { describe('test_user_email_put', () => { const request = {}; const data = { - "email": "example@example.com" -}; + 'email': 'example@example.com', + }; request.body = data; request.method = 'PUT'; request.url = '/v3/user/email'; @@ -4120,9 +4120,9 @@ describe('test_user_email_get', () => { describe('test_user_password_put', () => { const request = {}; const data = { - "new_password": "new_password", - "old_password": "old_password" -}; + 'new_password': 'new_password', + 'old_password': 'old_password', + }; request.body = data; request.method = 'PUT'; request.url = '/v3/user/password'; @@ -4142,10 +4142,10 @@ describe('test_user_password_put', () => { describe('test_user_profile_patch', () => { const request = {}; const data = { - "city": "Orange", - "first_name": "Example", - "last_name": "User" -}; + 'city': 'Orange', + 'first_name': 'Example', + 'last_name': 'User', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/user/profile'; @@ -4182,9 +4182,9 @@ describe('test_user_profile_get', () => { describe('test_user_scheduled_sends_post', () => { const request = {}; const data = { - "batch_id": "YOUR_BATCH_ID", - "status": "pause" -}; + 'batch_id': 'YOUR_BATCH_ID', + 'status': 'pause', + }; request.body = data; request.method = 'POST'; request.url = '/v3/user/scheduled_sends'; @@ -4238,8 +4238,8 @@ describe('test_user_scheduled_sends__batch_id__delete', () => { describe('test_user_scheduled_sends__batch_id__patch', () => { const request = {}; const data = { - "status": "pause" -}; + 'status': 'pause', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/user/scheduled_sends/{batch_id}'; @@ -4276,9 +4276,9 @@ describe('test_user_scheduled_sends__batch_id__get', () => { describe('test_user_settings_enforced_tls_patch', () => { const request = {}; const data = { - "require_tls": true, - "require_valid_cert": false -}; + 'require_tls': true, + 'require_valid_cert': false, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/user/settings/enforced_tls'; @@ -4315,8 +4315,8 @@ describe('test_user_settings_enforced_tls_get', () => { describe('test_user_username_put', () => { const request = {}; const data = { - "username": "test_username" -}; + 'username': 'test_username', + }; request.body = data; request.method = 'PUT'; request.url = '/v3/user/username'; @@ -4353,20 +4353,20 @@ describe('test_user_username_get', () => { describe('test_user_webhooks_event_settings_patch', () => { const request = {}; const data = { - "bounce": true, - "click": true, - "deferred": true, - "delivered": true, - "dropped": true, - "enabled": true, - "group_resubscribe": true, - "group_unsubscribe": true, - "open": true, - "processed": true, - "spam_report": true, - "unsubscribe": true, - "url": "url" -}; + 'bounce': true, + 'click': true, + 'deferred': true, + 'delivered': true, + 'dropped': true, + 'enabled': true, + 'group_resubscribe': true, + 'group_unsubscribe': true, + 'open': true, + 'processed': true, + 'spam_report': true, + 'unsubscribe': true, + 'url': 'url', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/user/webhooks/event/settings'; @@ -4403,8 +4403,8 @@ describe('test_user_webhooks_event_settings_get', () => { describe('test_user_webhooks_event_test_post', () => { const request = {}; const data = { - "url": "url" -}; + 'url': 'url', + }; request.body = data; request.method = 'POST'; request.url = '/v3/user/webhooks/event/test'; @@ -4424,11 +4424,11 @@ describe('test_user_webhooks_event_test_post', () => { describe('test_user_webhooks_parse_settings_post', () => { const request = {}; const data = { - "hostname": "myhostname.com", - "send_raw": false, - "spam_check": true, - "url": "http://email.myhosthame.com" -}; + 'hostname': 'myhostname.com', + 'send_raw': false, + 'spam_check': true, + 'url': 'http://email.myhosthame.com', + }; request.body = data; request.method = 'POST'; request.url = '/v3/user/webhooks/parse/settings'; @@ -4482,10 +4482,10 @@ describe('test_user_webhooks_parse_settings__hostname__delete', () => { describe('test_user_webhooks_parse_settings__hostname__patch', () => { const request = {}; const data = { - "send_raw": true, - "spam_check": false, - "url": "http://newdomain.com/parse" -}; + 'send_raw': true, + 'spam_check': false, + 'url': 'http://newdomain.com/parse', + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/user/webhooks/parse/settings/{hostname}'; @@ -4522,12 +4522,12 @@ describe('test_user_webhooks_parse_settings__hostname__get', () => { describe('test_user_webhooks_parse_stats_get', () => { const request = {}; const queryParams = { - 'aggregated_by': 'day', - 'end_date': '2016-04-01', - 'limit': 'test_string', - 'offset': 'test_string', - 'start_date': '2016-01-01' -}; + 'aggregated_by': 'day', + 'end_date': '2016-04-01', + 'limit': 'test_string', + 'offset': 'test_string', + 'start_date': '2016-01-01', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/user/webhooks/parse/stats'; @@ -4547,17 +4547,17 @@ describe('test_user_webhooks_parse_stats_get', () => { describe('test_whitelabel_domains_post', () => { const request = {}; const data = { - "automatic_security": false, - "custom_spf": true, - "default": true, - "domain": "example.com", - "ips": [ - "192.168.1.1", - "192.168.1.2" - ], - "subdomain": "news", - "username": "john@example.com" -}; + 'automatic_security': false, + 'custom_spf': true, + 'default': true, + 'domain': 'example.com', + 'ips': [ + '192.168.1.1', + '192.168.1.2', + ], + 'subdomain': 'news', + 'username': 'john@example.com', + }; request.body = data; request.method = 'POST'; request.url = '/v3/whitelabel/domains'; @@ -4577,12 +4577,12 @@ describe('test_whitelabel_domains_post', () => { describe('test_whitelabel_domains_get', () => { const request = {}; const queryParams = { - 'domain': 'test_string', - 'exclude_subusers': 'true', - 'limit': 1, - 'offset': 1, - 'username': 'test_string' -}; + 'domain': 'test_string', + 'exclude_subusers': 'true', + 'limit': 1, + 'offset': 1, + 'username': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/whitelabel/domains'; @@ -4670,9 +4670,9 @@ describe('test_whitelabel_domains__domain_id__delete', () => { describe('test_whitelabel_domains__domain_id__patch', () => { const request = {}; const data = { - "custom_spf": true, - "default": false -}; + 'custom_spf': true, + 'default': false, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/whitelabel/domains/{domain_id}'; @@ -4709,8 +4709,8 @@ describe('test_whitelabel_domains__domain_id__get', () => { describe('test_whitelabel_domains__domain_id__subuser_post', () => { const request = {}; const data = { - "username": "jane@example.com" -}; + 'username': 'jane@example.com', + }; request.body = data; request.method = 'POST'; request.url = '/v3/whitelabel/domains/{domain_id}/subuser'; @@ -4730,8 +4730,8 @@ describe('test_whitelabel_domains__domain_id__subuser_post', () => { describe('test_whitelabel_domains__id__ips_post', () => { const request = {}; const data = { - "ip": "192.168.0.1" -}; + 'ip': '192.168.0.1', + }; request.body = data; request.method = 'POST'; request.url = '/v3/whitelabel/domains/{id}/ips'; @@ -4785,10 +4785,10 @@ describe('test_whitelabel_domains__id__validate_post', () => { describe('test_whitelabel_ips_post', () => { const request = {}; const data = { - "domain": "example.com", - "ip": "192.168.1.1", - "subdomain": "email" -}; + 'domain': 'example.com', + 'ip': '192.168.1.1', + 'subdomain': 'email', + }; request.body = data; request.method = 'POST'; request.url = '/v3/whitelabel/ips'; @@ -4808,10 +4808,10 @@ describe('test_whitelabel_ips_post', () => { describe('test_whitelabel_ips_get', () => { const request = {}; const queryParams = { - 'ip': 'test_string', - 'limit': 1, - 'offset': 1 -}; + 'ip': 'test_string', + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/whitelabel/ips'; @@ -4882,15 +4882,15 @@ describe('test_whitelabel_ips__id__validate_post', () => { describe('test_whitelabel_links_post', () => { const request = {}; const data = { - "default": true, - "domain": "example.com", - "subdomain": "mail" -}; + 'default': true, + 'domain': 'example.com', + 'subdomain': 'mail', + }; request.body = data; const queryParams = { - 'limit': 1, - 'offset': 1 -}; + 'limit': 1, + 'offset': 1, + }; request.qs = queryParams; request.method = 'POST'; request.url = '/v3/whitelabel/links'; @@ -4910,8 +4910,8 @@ describe('test_whitelabel_links_post', () => { describe('test_whitelabel_links_get', () => { const request = {}; const queryParams = { - 'limit': 1 -}; + 'limit': 1, + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/whitelabel/links'; @@ -4931,8 +4931,8 @@ describe('test_whitelabel_links_get', () => { describe('test_whitelabel_links_default_get', () => { const request = {}; const queryParams = { - 'domain': 'test_string' -}; + 'domain': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/whitelabel/links/default'; @@ -4952,8 +4952,8 @@ describe('test_whitelabel_links_default_get', () => { describe('test_whitelabel_links_subuser_delete', () => { const request = {}; const queryParams = { - 'username': 'test_string' -}; + 'username': 'test_string', + }; request.qs = queryParams; request.method = 'DELETE'; request.url = '/v3/whitelabel/links/subuser'; @@ -4973,8 +4973,8 @@ describe('test_whitelabel_links_subuser_delete', () => { describe('test_whitelabel_links_subuser_get', () => { const request = {}; const queryParams = { - 'username': 'test_string' -}; + 'username': 'test_string', + }; request.qs = queryParams; request.method = 'GET'; request.url = '/v3/whitelabel/links/subuser'; @@ -5011,8 +5011,8 @@ describe('test_whitelabel_links__id__delete', () => { describe('test_whitelabel_links__id__patch', () => { const request = {}; const data = { - "default": true -}; + 'default': true, + }; request.body = data; request.method = 'PATCH'; request.url = '/v3/whitelabel/links/{id}'; @@ -5066,8 +5066,8 @@ describe('test_whitelabel_links__id__validate_post', () => { describe('test_whitelabel_links__link_id__subuser_post', () => { const request = {}; const data = { - "username": "jane@example.com" -}; + 'username': 'jane@example.com', + }; request.body = data; request.method = 'POST'; request.url = '/v3/whitelabel/links/{link_id}/subuser'; @@ -5084,4 +5084,3 @@ describe('test_whitelabel_links__link_id__subuser_post', () => { }); }); - diff --git a/packages/helpers/classes/attachment.js b/packages/helpers/classes/attachment.js index d2dccdd61..ab64c9bed 100644 --- a/packages/helpers/classes/attachment.js +++ b/packages/helpers/classes/attachment.js @@ -47,7 +47,7 @@ class Attachment { type, disposition, contentId, - filePath + filePath, } = data; if ((typeof content !== 'undefined') && (typeof filePath !== 'undefined')) { @@ -79,10 +79,11 @@ class Attachment { if (typeof content === 'string') { this.content = content; return; - } else if (content instanceof Buffer && content.toString !== undefined) { + } + else if (content instanceof Buffer && content.toString !== undefined) { this.content = content.toString(); - if (this.disposition == 'attachment') { + if (this.disposition === 'attachment') { this.content = content.toString('base64'); } diff --git a/packages/helpers/classes/attachment.spec.js b/packages/helpers/classes/attachment.spec.js index 820855008..9b2aae084 100644 --- a/packages/helpers/classes/attachment.spec.js +++ b/packages/helpers/classes/attachment.spec.js @@ -20,7 +20,7 @@ describe('Attachment', function() { //Set content as string describe('setContent(), string', function() { it('should set string as content', function() { - attachment.setContent("Just a string."); + attachment.setContent('Just a string.'); expect(attachment.content).to.equal('Just a string.'); }); }); @@ -51,7 +51,7 @@ describe('Attachment', function() { disposition: 'attachment', contentId: 'myattachment', content: '', - filePath: '' + filePath: '', }); }).to.throw(Error); }); @@ -77,7 +77,7 @@ describe('setContent()', function() { }); it('should accept a buffer', function() { - attachment.setContent(new Buffer("Hello World\n")); + attachment.setContent(new Buffer('Hello World\n')); expect(attachment.content).to.equal('SGVsbG8gV29ybGQK'); }); @@ -87,7 +87,7 @@ describe('setContent()', function() { type: 'plain/text', disposition: 'attachment', contentId: 'myattachment', - filePath: path.resolve(__dirname + '/attachment.js') + filePath: path.resolve(path.join(__dirname, '/attachment.js')), }); expect(attachment.content).to.be.a('string'); diff --git a/packages/helpers/classes/email-address.js b/packages/helpers/classes/email-address.js index f8d2cbbf0..9da73ef89 100644 --- a/packages/helpers/classes/email-address.js +++ b/packages/helpers/classes/email-address.js @@ -10,7 +10,7 @@ const splitNameEmail = require('../helpers/split-name-email'); */ class EmailAddress { - /** + /** * Constructor */ constructor(data) { @@ -75,7 +75,7 @@ class EmailAddress { this.email = email; } - /** + /** * To JSON */ toJSON() { diff --git a/packages/helpers/classes/personalization_specs/reverse-merge-dynamic_teplate_data.spec.js b/packages/helpers/classes/personalization_specs/reverse-merge-dynamic_teplate_data.spec.js index 55e22103c..f2301f2b4 100644 --- a/packages/helpers/classes/personalization_specs/reverse-merge-dynamic_teplate_data.spec.js +++ b/packages/helpers/classes/personalization_specs/reverse-merge-dynamic_teplate_data.spec.js @@ -9,17 +9,17 @@ const EmailAddress = require('../email-address'); /** * Tests */ -describe('Personalization', function () { +describe('Personalization', function() { //Create new personalization before each test let p; - beforeEach(function () { + beforeEach(function() { p = new Personalization(); }); //Reverse merge substitutions - describe('deepMergeDynamicTemplateData()', function () { - it('should reverse merge dynamicTemplateData', function () { + describe('deepMergeDynamicTemplateData()', function() { + it('should reverse merge dynamicTemplateData', function() { p.setDynamicTemplateData({ test1: 'Test1' }); p.deepMergeDynamicTemplateData({ test2: 'Test2' }); expect(p.dynamicTemplateData).to.have.a.property('test1'); @@ -27,7 +27,7 @@ describe('Personalization', function () { expect(p.dynamicTemplateData.test1).to.equal('Test1'); expect(p.dynamicTemplateData.test2).to.equal('Test2'); }); - it('should not overwrite existing keys', function () { + it('should not overwrite existing keys', function() { p.setDynamicTemplateData({ test1: 'Test1' }); p.deepMergeDynamicTemplateData({ test1: 'Test3', test2: 'Test2' }); expect(p.dynamicTemplateData).to.have.a.property('test1'); @@ -35,18 +35,18 @@ describe('Personalization', function () { expect(p.dynamicTemplateData.test1).to.equal('Test1'); expect(p.dynamicTemplateData.test2).to.equal('Test2'); }); - it('should work without prior dynamicTemplateData', function () { + it('should work without prior dynamicTemplateData', function() { p.deepMergeDynamicTemplateData({ test2: 'Test2' }); expect(p.dynamicTemplateData).to.have.a.property('test2'); expect(p.dynamicTemplateData.test2).to.equal('Test2'); }); - it('should throw an error for invalid input', function () { - expect(function () { + it('should throw an error for invalid input', function() { + expect(function() { p.deepMergeDynamicTemplateData(3); }).to.throw(Error); }); - it('should accept no input', function () { - expect(function () { + it('should accept no input', function() { + expect(function() { p.deepMergeDynamicTemplateData(); }).not.to.throw(Error); }); diff --git a/packages/helpers/classes/personalization_specs/set-subject.spec.js b/packages/helpers/classes/personalization_specs/set-subject.spec.js index e65ef9101..31b758285 100644 --- a/packages/helpers/classes/personalization_specs/set-subject.spec.js +++ b/packages/helpers/classes/personalization_specs/set-subject.spec.js @@ -9,7 +9,7 @@ const EmailAddress = require('../email-address'); /** * Tests */ - describe('Personalization', function() { +describe('Personalization', function() { //Create new personalization before each test let p; @@ -42,4 +42,4 @@ const EmailAddress = require('../email-address'); expect(p.subject).to.equal('Test'); }); }); -}); \ No newline at end of file +}); diff --git a/packages/helpers/classes/personalization_specs/to-json.spec.js b/packages/helpers/classes/personalization_specs/to-json.spec.js index 0b252c23c..1bab9a5da 100644 --- a/packages/helpers/classes/personalization_specs/to-json.spec.js +++ b/packages/helpers/classes/personalization_specs/to-json.spec.js @@ -9,21 +9,21 @@ const EmailAddress = require('../email-address'); /** * Tests */ -describe('Personalization', function () { +describe('Personalization', function() { //Create new personalization before each test let p; - beforeEach(function () { + beforeEach(function() { p = new Personalization(); }); //JSON conversion - describe('toJSON()', function () { - beforeEach(function () { + describe('toJSON()', function() { + beforeEach(function() { p.setTo('test@example.org'); }); - it('should always have the to field', function () { + it('should always have the to field', function() { const json = p.toJSON(); expect(json).to.have.property('to'); expect(json.to).to.be.an.instanceof(Array); @@ -31,7 +31,7 @@ describe('Personalization', function () { expect(json.to[0]).to.be.an.instanceof(EmailAddress); expect(json.to[0].email).to.equal('test@example.org'); }); - it('should set the cc field', function () { + it('should set the cc field', function() { p.setCc('testcc@example.org'); const json = p.toJSON(); expect(json).to.have.property('cc'); @@ -40,7 +40,7 @@ describe('Personalization', function () { expect(json.cc[0]).to.be.an.instanceof(EmailAddress); expect(json.cc[0].email).to.equal('testcc@example.org'); }); - it('should set the bcc field', function () { + it('should set the bcc field', function() { p.setBcc('testbcc@example.org'); const json = p.toJSON(); expect(json).to.have.property('bcc'); @@ -49,27 +49,27 @@ describe('Personalization', function () { expect(json.bcc[0]).to.be.an.instanceof(EmailAddress); expect(json.bcc[0].email).to.equal('testbcc@example.org'); }); - it('should set the headers field', function () { + it('should set the headers field', function() { p.setHeaders({ test: 'Test' }); const json = p.toJSON(); expect(json).to.have.property('headers'); expect(json.headers).to.be.an.instanceof(Object); expect(json.headers.test).to.equal('Test'); }); - it('should set the custom_args field', function () { + it('should set the custom_args field', function() { p.setCustomArgs({ test: 'Test' }); const json = p.toJSON(); expect(json).to.have.property('custom_args'); expect(json.custom_args).to.be.an.instanceof(Object); expect(json.custom_args.test).to.equal('Test'); }); - it('should set the substitutions field', function () { + it('should set the substitutions field', function() { p.setSubstitutions({ test: 'Test' }); const json = p.toJSON(); expect(json).to.have.property('substitutions'); expect(json.substitutions).to.be.an.instanceof(Object); }); - it('should apply wrappers to the substitutions', function () { + it('should apply wrappers to the substitutions', function() { p.setSubstitutions({ test: 'Test', otherTest2: 'Test2' }); p.setSubstitutionWrappers(['{{', '}}']); const json = p.toJSON(); @@ -80,19 +80,19 @@ describe('Personalization', function () { expect(json.substitutions).not.to.have.property('test'); expect(json.substitutions).not.to.have.property('otherTest2'); }); - it('should set the dynamicTemplateData field', function () { + it('should set the dynamicTemplateData field', function() { p.setDynamicTemplateData({ test: 'Test' }); const json = p.toJSON(); expect(json).to.have.property('dynamic_template_data'); expect(json.dynamic_template_data).to.be.an.instanceof(Object); }); - it('should set the subject field', function () { + it('should set the subject field', function() { p.setSubject('Test'); const json = p.toJSON(); expect(json).to.have.property('subject'); expect(json.subject).to.equal('Test'); }); - it('should set the send_at field', function () { + it('should set the send_at field', function() { p.setSendAt(555); const json = p.toJSON(); expect(json).to.have.property('send_at'); diff --git a/packages/helpers/classes/statistics.js b/packages/helpers/classes/statistics.js index 6180f949c..260c949f7 100644 --- a/packages/helpers/classes/statistics.js +++ b/packages/helpers/classes/statistics.js @@ -43,9 +43,9 @@ class Statistics { data = toCamelCase(data, ['substitutions', 'customArgs']); const { startDate, - endDate, - aggregatedBy, - } = data; + endDate, + aggregatedBy, + } = data; this.setStartDate(startDate); this.setEndDate(endDate); diff --git a/packages/helpers/classes/statistics.spec.js b/packages/helpers/classes/statistics.spec.js index 427fd4773..e50f4b1a5 100644 --- a/packages/helpers/classes/statistics.spec.js +++ b/packages/helpers/classes/statistics.spec.js @@ -10,7 +10,7 @@ const Statistics = require('./statistics'); */ describe('Statistics', function() { - //Test data + //Test data const data = { startDate: new Date(), endDate: new Date('2017-10-21'), diff --git a/packages/helpers/helpers/html-to-plain-text.js b/packages/helpers/helpers/html-to-plain-text.js index 210f6d13e..a5cffa7cb 100644 --- a/packages/helpers/helpers/html-to-plain-text.js +++ b/packages/helpers/helpers/html-to-plain-text.js @@ -4,7 +4,7 @@ * Helper to convert an HTML string to a plain text string */ module.exports = function convertHTML2PlainString(html) { - let text = html.replace(/(<([^>]+)>)/g, ""); - text = text.replace(/\s+/g,' ') - return text -} + let text = html.replace(/(<([^>]+)>)/g, ''); + text = text.replace(/\s+/g, ' '); + return text; +}; diff --git a/packages/helpers/helpers/html-to-plain-text.spec.js b/packages/helpers/helpers/html-to-plain-text.spec.js index 71ae9d6ab..80eb3a1e2 100644 --- a/packages/helpers/helpers/html-to-plain-text.spec.js +++ b/packages/helpers/helpers/html-to-plain-text.spec.js @@ -10,23 +10,23 @@ const convertHTML2PlainString = require('./html-to-plain-text'); */ describe('convertHTML2PlainString', function() { - //Test string with one html tag - const html1 = 'Hello world
'; - - //Test string with nested html tags - const html2 = 'Hello World!
Hello world
'; + + //Test string with nested html tags + const html2 = 'Hello World!