mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-26 19:06:43 -06:00
20 lines
507 B
TypeScript
20 lines
507 B
TypeScript
import renderImage from './image';
|
|
import renderKey from './key';
|
|
import config from '../../../config';
|
|
|
|
export default user => {
|
|
const id = `${config.url}/users/${user._id}`;
|
|
|
|
return {
|
|
type: 'Person',
|
|
id,
|
|
inbox: `${id}/inbox`,
|
|
outbox: `${id}/outbox`,
|
|
preferredUsername: user.username,
|
|
name: user.name,
|
|
summary: user.description,
|
|
icon: user.avatarId && renderImage({ _id: user.avatarId }),
|
|
image: user.bannerId && renderImage({ _id: user.bannerId }),
|
|
publicKey: renderKey(user)
|
|
};
|
|
};
|