2018-04-01 13:18:36 +03:00
|
|
|
import renderImage from './image';
|
|
|
|
import renderKey from './key';
|
2018-04-02 07:15:53 +03:00
|
|
|
import config from '../../../config';
|
2018-04-01 13:18:36 +03:00
|
|
|
|
|
|
|
export default user => {
|
2018-04-08 09:15:22 +03:00
|
|
|
const id = `${config.url}/users/${user._id}`;
|
2018-04-01 13:18:36 +03:00
|
|
|
|
|
|
|
return {
|
|
|
|
type: 'Person',
|
|
|
|
id,
|
|
|
|
inbox: `${id}/inbox`,
|
|
|
|
outbox: `${id}/outbox`,
|
2018-04-23 09:37:27 +03:00
|
|
|
sharedInbox: `${config.url}/inbox`,
|
2018-04-08 12:21:02 +03:00
|
|
|
url: `${config.url}/@${user.username}`,
|
2018-04-01 13:18:36 +03:00
|
|
|
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)
|
|
|
|
};
|
|
|
|
};
|