Skip to content

Commit 225e334

Browse files
committed
feat(calendar): add support for additional fields
1 parent 6674256 commit 225e334

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

drivers/microsoft/graph_api.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require "../place/calendar_common"
33
class Microsoft::GraphAPI < PlaceOS::Driver
44
include Place::CalendarCommon
55

6-
# update to trigger build
6+
# update to trigger build.
77
descriptive_name "Microsoft Graph API"
88
generic_name :Calendar
99

drivers/place/calendar.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require "./calendar_common"
33
class Place::Calendar < PlaceOS::Driver
44
include Place::CalendarCommon
55

6-
# update to trigger build
6+
# update to trigger build.
77
descriptive_name "PlaceOS Calendar"
88
generic_name :Calendar
99

drivers/place/calendar_common.cr

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ module Place::CalendarCommon
177177
def get_members(
178178
group_id : String,
179179
next_page : String? = nil,
180+
additional_fields : Array(String)? = nil,
180181
)
181182
logger.debug { "listing members of group: #{group_id}" }
182183

@@ -187,7 +188,7 @@ module Place::CalendarCommon
187188
end
188189
end
189190
end
190-
members = client &.get_members(group_id, next_link: next_page)
191+
members = client &.get_members(group_id, next_link: next_page, additional_fields: additional_fields)
191192

192193
if member = members.first?
193194
member.next_page = member.next_link
@@ -205,9 +206,10 @@ module Place::CalendarCommon
205206
limit : Int32? = nil,
206207
filter : String? = nil,
207208
next_page : String? = nil,
209+
additional_fields : Array(String)? = nil,
208210
)
209211
logger.debug { "listing user details, query #{query || filter}, limit #{limit} (next: #{!!next_page})" }
210-
users = client &.list_users(query, limit, filter: filter, next_link: next_page)
212+
users = client &.list_users(query, limit, filter: filter, next_link: next_page, additional_fields: additional_fields)
211213
# next link is not returned to reduce payload size and used
212214
# in the staff API for setting a header
213215
if user = users.first?
@@ -217,9 +219,9 @@ module Place::CalendarCommon
217219
end
218220

219221
@[PlaceOS::Driver::Security(Level::Support)]
220-
def get_user(user_id : String)
222+
def get_user(user_id : String, additional_fields : Array(String)? = nil)
221223
logger.debug { "getting user details for #{user_id}" }
222-
client &.get_user_by_email(user_id)
224+
client &.get_user_by_email(user_id, additional_fields: additional_fields)
223225
end
224226

225227
@[PlaceOS::Driver::Security(Level::Support)]

shard.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ shards:
191191

192192
office365:
193193
git: https://github.com/placeos/office365.git
194-
version: 1.25.7
194+
version: 1.26.0
195195

196196
openssl_ext:
197197
git: https://github.com/spider-gazelle/openssl_ext.git
@@ -227,7 +227,7 @@ shards:
227227

228228
place_calendar:
229229
git: https://github.com/placeos/calendar.git
230-
version: 4.28.1
230+
version: 4.29.0
231231

232232
placeos:
233233
git: https://github.com/placeos/crystal-client.git
@@ -243,7 +243,7 @@ shards:
243243

244244
placeos-driver:
245245
git: https://github.com/placeos/driver.git
246-
version: 7.17.0
246+
version: 7.17.1
247247

248248
placeos-log-backend:
249249
git: https://github.com/place-labs/log-backend.git

0 commit comments

Comments
 (0)