feat(cardav): create cardav router with GET /accounts
Add CardDAV API router with GET /accounts endpoint. Returns all CardDAV accounts from database via cardav-sync service. Added test infrastructure with _setTestDatabase helper for isolated API testing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -1354,6 +1354,14 @@ function transaction(fn) {
|
||||
return get().transaction(fn)();
|
||||
}
|
||||
|
||||
/**
|
||||
* ONLY FOR TESTING: Override the internal db instance
|
||||
* @param {import('better-sqlite3').Database} testDb
|
||||
*/
|
||||
function _setTestDatabase(testDb) {
|
||||
db = testDb;
|
||||
}
|
||||
|
||||
init(); // auto-initialise when module is first imported
|
||||
|
||||
export { init, get, transaction, currentVersion, getPath, backupToFile, restoreFromFile, MIGRATIONS };
|
||||
export { init, get, transaction, currentVersion, getPath, backupToFile, restoreFromFile, MIGRATIONS, _setTestDatabase };
|
||||
|
||||
Reference in New Issue
Block a user