createUserCalendar
generates a URL for a user's personal calendar,
the endpoint should be served by getUserIcs.
const url = calendarRoutes.createUserCalendar()
getGoogleCalendarUrl
generates a URL to add a Session
to a visitor's Google Calendar.
Redirect the visitor to the returned URL so they can add the session to their calendar.
const url = await calendarRoutes.getGoogleCalendarUrl('en', 'session-a')
Potential errors:
general.notFound
— if the session is not found or is not scheduledgetSessionIcsFile
returns a translated ics file from a Session
.
It returns a string which is the contents of the ics file.
const file = await calendarRoutes.getSessionIcsFile('en', 'session-a')
Set these headers for it to download nicely:
Content-Type: text/calendar
Content-Disposition: attachment; filename="{session_id}.ics
— where session_id
is the id of the session being downloadedPotential errors:
general.notFound
— if the session is not found or is not scheduledgeneral.internalServerError
— if there was an unknown error generating the ics.getUserIcs
generates an ICS file with all sessions a visitor is attending.
see getSessionIcsFile
for the best headers to set.
const file = await calendarRoutes.getSessionIcsFile(icalToken)
Potential errors:
general.unauthorized
— if icalToken
is not passed, it should be validated elsewhere.general.internalServerError
— if there was an unknown error generating the ics.Optional
icalToken: UserICalTokenGenerated using TypeDoc
CalendarRoutes
provides routes for processing conference data into calendar events.Todo
Update to use express-based examples