2018-04-07 11:30:37 -06:00
|
|
|
import Note from '../../../models/note';
|
2018-03-29 05:32:18 -06:00
|
|
|
import User from '../../../models/user';
|
2017-08-12 00:17:03 -06:00
|
|
|
|
|
|
|
/**
|
2018-05-07 16:19:23 -06:00
|
|
|
* Get the misskey's statistics
|
2017-08-12 00:17:03 -06:00
|
|
|
*/
|
|
|
|
module.exports = params => new Promise(async (res, rej) => {
|
2018-05-07 16:19:23 -06:00
|
|
|
const notesCount = await Note.count();
|
2017-08-12 00:17:03 -06:00
|
|
|
|
2018-05-07 16:19:23 -06:00
|
|
|
const usersCount = await User.count();
|
|
|
|
|
|
|
|
const originalNotesCount = await Note.count({
|
|
|
|
'_user.host': null
|
|
|
|
});
|
|
|
|
|
|
|
|
const originalUsersCount = await User.count({
|
|
|
|
host: null
|
|
|
|
});
|
2017-08-12 00:17:03 -06:00
|
|
|
|
|
|
|
res({
|
2018-05-07 16:19:23 -06:00
|
|
|
notesCount,
|
|
|
|
usersCount,
|
|
|
|
originalNotesCount,
|
|
|
|
originalUsersCount
|
2017-08-12 00:17:03 -06:00
|
|
|
});
|
|
|
|
});
|