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

Function getClient

lib/models/calendar.ts:56–77  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

54const calendarConfig = await AppConfig.getCalendarConfig();
55
56async function getClient(userId: string) {
57 const client = await createDAVClient({
58 serverUrl: calendarConfig.calDavUrl,
59 credentials: {},
60 authMethod: 'Custom',
61 // deno-lint-ignore require-await
62 authFunction: async () => {
63 return {
64 'X-Remote-User': userId,
65 };
66 },
67 fetchOptions: {
68 timeout: 15_000,
69 },
70 defaultAccountType: 'caldav',
71 rootUrl: `${calendarConfig.calDavUrl}/`,
72 principalUrl: `${calendarConfig.calDavUrl}/${userId}/`,
73 homeUrl: `${calendarConfig.calDavUrl}/${userId}/`,
74 });
75
76 return client;
77}
78
79export class CalendarModel {
80 static async list(

Callers 8

listMethod · 0.70
createMethod · 0.70
deleteMethod · 0.70
fetchByCalendarIdMethod · 0.70
getMethod · 0.70
createMethod · 0.70
updateMethod · 0.70
deleteMethod · 0.70

Calls 1

createDAVClientFunction · 0.90

Tested by

no test coverage detected