0
0
Fork 0

wip: ログ

This commit is contained in:
Xeltica 2023-02-24 17:40:05 +09:00
parent d4c3673315
commit 0c3df4245d
9 changed files with 133 additions and 19 deletions

View file

@ -1,6 +1,26 @@
import { User } from '../models/entities/user';
import { toSignedString } from '../../common/functions/to-signed-string';
import {Count} from '../models/count';
import {api} from '../services/misskey';
import {Score} from '../../common/types/score';
import {MiUser} from './update-score';
/**
*
* @param user
* @returns
*/
export const getScores = async (user: User): Promise<Score> => {
// TODO 毎回取ってくるのも微妙なので、ある程度キャッシュしたいかも
const miUser = await api<MiUser>(user.host, 'users/show', { username: user.username }, user.token);
return {
notesCount: miUser.notesCount,
followingCount: miUser.followingCount,
followersCount: miUser.followersCount,
...getDelta(user, miUser),
};
};
/**
*