From 8e2ce805e8d805c40b6fa489e860f977591f3a9d Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 3 Aug 2020 13:49:25 +0200 Subject: [PATCH 1/3] feat: add calendars include on the users.syncAccounts resource --- src/__snapshots__/Skedify.test.js.snap | 3 +++ src/resources/__snapshots__/index.test.js.snap | 4 +++- src/resources/users.js | 16 ++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/__snapshots__/Skedify.test.js.snap b/src/__snapshots__/Skedify.test.js.snap index 461b85d..cf4a5c9 100644 --- a/src/__snapshots__/Skedify.test.js.snap +++ b/src/__snapshots__/Skedify.test.js.snap @@ -1036,6 +1036,9 @@ Object { "availability_settings": Object { "toString": [Function], }, + "calendars": Object { + "toString": [Function], + }, "completion_outcome_list": Object { "outcome_outcome_lists": Object { "toString": [Function], diff --git a/src/resources/__snapshots__/index.test.js.snap b/src/resources/__snapshots__/index.test.js.snap index c696802..03031b6 100644 --- a/src/resources/__snapshots__/index.test.js.snap +++ b/src/resources/__snapshots__/index.test.js.snap @@ -1515,7 +1515,9 @@ Object { "sub_resources": Object {}, }, "syncAccounts": Object { - "allowed_includes": Array [], + "allowed_includes": Array [ + "calendars", + ], "allowed_methods": Array [ "*", ], diff --git a/src/resources/users.js b/src/resources/users.js index 5e95998..098cd52 100644 --- a/src/resources/users.js +++ b/src/resources/users.js @@ -2,22 +2,18 @@ import createResourceDescription from './util/createResourceDescription' export const users = createResourceDescription( 'users', + { includes: ['employees', 'sync_accounts'] }, { - includes: ['employees', 'sync_accounts'], - }, - { - syncAccounts: createResourceDescription('sync_accounts'), + syncAccounts: createResourceDescription('sync_accounts', { + includes: ['calendars'], + }), events: createResourceDescription('events', { filters: ['start', 'end', 'split', 'group_by'], }), - employees: createResourceDescription('employees', { - includes: ['roles'], - }), + employees: createResourceDescription('employees', { includes: ['roles'] }), calendars: createResourceDescription( 'calendars', - { - includes: ['sync_accounts'], - }, + { includes: ['sync_accounts'] }, { events: createResourceDescription('events', { filters: ['start', 'end', 'split', 'group_by'], From 0cefc943ca46f41272bfb93247ec201a4b94872a Mon Sep 17 00:00:00 2001 From: Jeroen Van den Bossche Date: Mon, 3 Aug 2020 08:36:27 +0200 Subject: [PATCH 2/3] feat: add country and postal_code to timetable filters --- src/resources/__snapshots__/index.test.js.snap | 8 ++++++++ src/resources/timetable.js | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/resources/__snapshots__/index.test.js.snap b/src/resources/__snapshots__/index.test.js.snap index 03031b6..c9bcf02 100644 --- a/src/resources/__snapshots__/index.test.js.snap +++ b/src/resources/__snapshots__/index.test.js.snap @@ -1395,6 +1395,14 @@ Object { "key": "location[geolocation]", "name": "geolocation", }, + Object { + "key": "location[country]", + "name": "country", + }, + Object { + "key": "location[postal_code]", + "name": "postal_code", + }, ], "headers": Object {}, "requires_domain_map": false, diff --git a/src/resources/timetable.js b/src/resources/timetable.js index 0066e9c..75f3d1c 100644 --- a/src/resources/timetable.js +++ b/src/resources/timetable.js @@ -11,6 +11,8 @@ export const timetable = createResourceDescription('timetable', { 'contacts', { name: 'timezone', key: 'format[timezone]' }, { name: 'geolocation', key: 'location[geolocation]' }, + { name: 'country', key: 'location[country]' }, + { name: 'postal_code', key: 'location[postal_code]' }, ], allowed_methods: [HTTP_VERB_GET], enable_pagination: false, From ba492dd168876fca109e58c5b8db30c4d296b4a3 Mon Sep 17 00:00:00 2001 From: Jeroen Van den Bossche Date: Mon, 3 Aug 2020 15:28:49 +0200 Subject: [PATCH 3/3] feat: add country and postal_code to defined availability filters --- src/resources/__snapshots__/index.test.js.snap | 8 ++++++++ src/resources/definedAvailability.js | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/resources/__snapshots__/index.test.js.snap b/src/resources/__snapshots__/index.test.js.snap index c9bcf02..7aa6e6e 100644 --- a/src/resources/__snapshots__/index.test.js.snap +++ b/src/resources/__snapshots__/index.test.js.snap @@ -669,6 +669,14 @@ Object { "key": "location[geolocation]", "name": "geolocation", }, + Object { + "key": "location[country]", + "name": "country", + }, + Object { + "key": "location[postal_code]", + "name": "postal_code", + }, ], "headers": Object {}, "requires_domain_map": false, diff --git a/src/resources/definedAvailability.js b/src/resources/definedAvailability.js index bb0b9aa..3bf0b79 100644 --- a/src/resources/definedAvailability.js +++ b/src/resources/definedAvailability.js @@ -14,6 +14,8 @@ export const definedAvailability = createResourceDescription( 'meeting_types', { name: 'timezone', key: 'format[timezone]' }, { name: 'geolocation', key: 'location[geolocation]' }, + { name: 'country', key: 'location[country]' }, + { name: 'postal_code', key: 'location[postal_code]' }, ], enable_pagination: false, }