mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-17 11:08:58 +01:00
24 lines
696 B
TypeScript
24 lines
696 B
TypeScript
import renderImage from './image';
|
|
import renderKey from './key';
|
|
import config from '../../../config';
|
|
import { ILocalUser } from '../../../models/user';
|
|
|
|
export default (user: ILocalUser) => {
|
|
const id = `${config.url}/users/${user._id}`;
|
|
|
|
return {
|
|
type: 'Person',
|
|
id,
|
|
inbox: `${id}/inbox`,
|
|
outbox: `${id}/outbox`,
|
|
sharedInbox: `${config.url}/inbox`,
|
|
url: `${config.url}/@${user.username}`,
|
|
preferredUsername: user.username,
|
|
name: user.name,
|
|
summary: user.description,
|
|
icon: user.avatarId && renderImage({ _id: user.avatarId }),
|
|
image: user.bannerId && renderImage({ _id: user.bannerId }),
|
|
manuallyApprovesFollowers: user.isLocked,
|
|
publicKey: renderKey(user)
|
|
};
|
|
};
|