monkeeShark/src/common/remote/activitypub/renderer/person.ts
2018-04-01 19:21:59 +09:00

20 lines
508 B
TypeScript

import renderImage from './image';
import renderKey from './key';
import config from '../../../../conf';
export default user => {
const id = `${config.url}/@${user.username}`;
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)
};
};