Add CalDav routes and methods, with mock data

This commit is contained in:
Bruno Bernardino
2024-03-18 19:18:29 +00:00
parent 3c66eec301
commit 062c0d3d09
11 changed files with 1008 additions and 115 deletions

View File

@@ -18,6 +18,9 @@ interface DavResponse {
'card:addressbook-home-set'?: {
'd:href': string;
};
'cal:calendar-home-set'?: {
'd:href': string;
};
'd:current-user-principal'?: {
'd:href': string;
};
@@ -109,6 +112,12 @@ export const handler: Handler<Data, FreshContextState> = async (request, context
};
}
if (requestBody.includes('calendar-home-set')) {
propResponse['d:propstat']['d:prop']['cal:calendar-home-set'] = {
'd:href': `/dav/calendars/`,
};
}
responseBody['d:multistatus']['d:response'].push(propResponse);
}