MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / get

Method get

lib/models/calendar.ts:262–290  ·  view source on GitHub ↗
(
    userId: string,
    calendarId: string,
    eventId: string,
  )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 3

parseVCalendarFunction · 0.90
fetchCalendarObjectsMethod · 0.80
getClientFunction · 0.70

Tested by

no test coverage detected