Stub out missing Elk endpoints

This commit is contained in:
Alex Gleason 2023-05-13 14:27:49 -05:00
parent ab1bb3854a
commit 017a34d5d4
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 25 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import { emptyArrayController, emptyObjectController } from './controllers/api/f
import { homeController } from './controllers/api/timelines.ts'; import { homeController } from './controllers/api/timelines.ts';
import instanceController from './controllers/api/instance.ts'; import instanceController from './controllers/api/instance.ts';
import { createTokenController, oauthAuthorizeController, oauthController } from './controllers/api/oauth.ts'; import { createTokenController, oauthAuthorizeController, oauthController } from './controllers/api/oauth.ts';
import { preferencesController } from './controllers/api/preferences.ts';
import { import {
contextController, contextController,
createStatusController, createStatusController,
@ -61,6 +62,8 @@ app.post('/api/v1/statuses', requireAuth, createStatusController);
app.get('/api/v1/timelines/home', requireAuth, homeController); app.get('/api/v1/timelines/home', requireAuth, homeController);
app.get('/api/v1/preferences', preferencesController);
// Not (yet) implemented. // Not (yet) implemented.
app.get('/api/v1/notifications', emptyArrayController); app.get('/api/v1/notifications', emptyArrayController);
app.get('/api/v1/bookmarks', emptyArrayController); app.get('/api/v1/bookmarks', emptyArrayController);
@ -73,6 +76,9 @@ app.get('/api/v1/mutes', emptyArrayController);
app.get('/api/v1/domain_blocks', emptyArrayController); app.get('/api/v1/domain_blocks', emptyArrayController);
app.get('/api/v1/markers', emptyObjectController); app.get('/api/v1/markers', emptyObjectController);
app.get('/api/v1/timelines/public', emptyArrayController); app.get('/api/v1/timelines/public', emptyArrayController);
app.get('/api/v1/conversations', emptyArrayController);
app.get('/api/v1/favourites', emptyArrayController);
app.get('/api/v1/lists', emptyArrayController);
app.get('/', indexController); app.get('/', indexController);

View File

@ -0,0 +1,19 @@
import { AppController } from '@/app.ts';
/**
* Return a default set of preferences for compatibilty purposes.
* Clients like Soapbox do not use this.
*
* https://docs.joinmastodon.org/methods/preferences/
*/
const preferencesController: AppController = (c) => {
return c.json({
'posting:default:visibility': 'public',
'posting:default:sensitive': false,
'posting:default:language': null,
'reading:expand:media': 'default',
'reading:expand:spoilers': false,
});
};
export { preferencesController };