(userId: string)
| 54 | const calendarConfig = await AppConfig.getCalendarConfig(); |
| 55 | |
| 56 | async 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 | |
| 79 | export class CalendarModel { |
| 80 | static async list( |
no test coverage detected