feat: support outlook for calendar plus minor fixes

This commit is contained in:
2026-06-27 15:07:10 +09:30
parent 2163f06de9
commit d34333ca38
31 changed files with 1791 additions and 231 deletions
@@ -0,0 +1,36 @@
import { BSPLUS_OUTLOOK_CALENDAR_EVENT_CATEGORY } from "@/config/outlookCalendar";
import type {
GoogleCalendarEventInput,
SeqtaTimetableLesson,
} from "@/seqta/utils/googleCalendar/types";
import {
lessonToGoogleEvent,
mapLessonsToGoogleEvents,
} from "@/seqta/utils/googleCalendar/eventMapper";
export { mapLessonsToGoogleEvents, lessonToGoogleEvent, seqtaLessonKey } from "@/seqta/utils/googleCalendar/eventMapper";
export function outlookGraphEventBody(event: GoogleCalendarEventInput): Record<string, unknown> {
const body: Record<string, unknown> = {
subject: event.summary,
body: {
contentType: "text",
content: event.description ?? "Synced by BetterSEQTA+",
},
start: { dateTime: event.startDateTime, timeZone: event.timeZone },
end: { dateTime: event.endDateTime, timeZone: event.timeZone },
categories: [BSPLUS_OUTLOOK_CALENDAR_EVENT_CATEGORY],
};
if (event.location) {
body.location = { displayName: event.location };
}
return body;
}
export function mapLessonsToOutlookEvents(
origin: string,
lessons: SeqtaTimetableLesson[],
timeZone: string,
): GoogleCalendarEventInput[] {
return mapLessonsToGoogleEvents(origin, lessons, timeZone);
}