feature: add calendar

This commit is contained in:
WonderAliceUwU committed 2026-07-08 17:06:32 +02:00
1 parent 7953a258d4
commit eaa0ede2ec
6 files changed
+621 -12

No files matched your search

+7
View File
@@ -14,6 +14,7 @@ import {
import { decryptJson, deriveEncryptionKey, encryptJson, randomToken, verifyPassword, createPasswordRecord } from './lib/security.js';
import { loadState, readAdmin, readEncryptedConfig, saveAdminAndConfig, updateEncryptedConfig } from './lib/store.js';
import {
getCalendar,
getConnectionStatuses,
getDashboard,
getDownloads,
@@ -230,6 +231,12 @@ async function routeRequest(request: IncomingMessage, response: ServerResponse):
return;
}
if (url.pathname === '/api/calendar' && method === 'GET') {
const config = await readConfig(session!.encryptionKey);
sendJson(response, 200, await getCalendar(config));
return;
}
if (url.pathname === '/api/title-details' && method === 'POST') {
const config = await readConfig(session!.encryptionKey);
const body = await readJson<TitleDetailsRequest>(request);