Implement remote status retrieval

This commit is contained in:
Akihiko Odaki 2018-03-31 19:55:00 +09:00
parent 7da60a0147
commit 68a9aac957
46 changed files with 468 additions and 198 deletions

View file

@ -0,0 +1,15 @@
import * as mongodb from 'mongodb';
import db from '../db/mongodb';
const RemoteUserObject = db.get<IRemoteUserObject>('remoteUserObjects');
export default RemoteUserObject;
export type IRemoteUserObject = {
_id: mongodb.ObjectID;
uri: string;
object: {
$ref: string;
$id: mongodb.ObjectID;
}
};

View file

@ -97,6 +97,9 @@ export type IUser = {
account: ILocalAccount | IRemoteAccount;
};
export type ILocalUser = IUser & { account: ILocalAccount };
export type IRemoteUser = IUser & { account: IRemoteAccount };
export function init(user): IUser {
user._id = new mongo.ObjectID(user._id);
user.avatarId = new mongo.ObjectID(user.avatarId);