(
userId: string,
calendarId: string,
eventId: string,
)
| 260 | } |
| 261 | |
| 262 | static async get( |
| 263 | userId: string, |
| 264 | calendarId: string, |
| 265 | eventId: string, |
| 266 | ): Promise<CalendarEvent | undefined> { |
| 267 | const client = await getClient(userId); |
| 268 | |
| 269 | const davCalendarEvents: DAVObject[] = await client.fetchCalendarObjects({ |
| 270 | calendar: { |
| 271 | url: `${calendarConfig.calDavUrl}/${userId}/${calendarId}/`, |
| 272 | }, |
| 273 | objectUrls: [`${calendarConfig.calDavUrl}/${userId}/${calendarId}/${eventId}.ics`], |
| 274 | }); |
| 275 | |
| 276 | if (davCalendarEvents.length === 0) { |
| 277 | return undefined; |
| 278 | } |
| 279 | |
| 280 | const davCalendarEvent = davCalendarEvents[0]; |
| 281 | |
| 282 | const calendarEvent: CalendarEvent = { |
| 283 | ...davCalendarEvent, |
| 284 | ...parseVCalendar(davCalendarEvent.data || '')[0], |
| 285 | uid: eventId, |
| 286 | calendarId, |
| 287 | }; |
| 288 | |
| 289 | return calendarEvent; |
| 290 | } |
| 291 | |
| 292 | static async create( |
| 293 | userId: string, |
nothing calls this directly
no test coverage detected