Hi Forest,
jus to let you know that we have a type error on Liana.ResourceSerializer that we use in smart relationships
So I did
new (Liana as any).ResourceSerializer
to make it work
Hi Forest,
jus to let you know that we have a type error on Liana.ResourceSerializer that we use in smart relationships
So I did
new (Liana as any).ResourceSerializer
to make it work
Hello @Guiguijo 
Thanks for raising an issue on Types here 
Indeed, the resource serialiser is not an exported type from our Types. Can you try to use the RecordsGetter instead please ? Like the following:
const usersGetter = new RecordsGetter(User);
const administrators = ...;
const serializedAdministrators = await usersGetter.serialize(administrators);
Keep me in touch 
Steve.
Hi @anon36130554 ,
not sure how to use it:
import PromiseBB from 'bluebird'
import { RecordsGetter } from 'forest-express-mongoose'
...
const User = models['user']
const administrators = User.find({
'rolesByAccount.account': accountId,
'rolesByAccount.role': EUserRoles.Administrator
})
const usersGetter = new RecordsGetter(User)
return PromiseBB.all([administrators.length, administrators]).spread((count, administrators) => {
return usersGetter.serialize(administrators)
// return new (Liana as any).ResourceSerializer(Liana, User, administrators, null, {
// count
// }).perform()
})
or
import PromiseBB from 'bluebird'
import { RecordsGetter } from 'forest-express-mongoose'
...
const User = models['user']
const administrators = User.find({
'rolesByAccount.account': accountId,
'rolesByAccount.role': EUserRoles.Administrator
})
const usersGetter = new RecordsGetter(User)
return usersGetter.serialize(administrators)
neither the first way nor the second seems to work
Hello @Guiguijo,
The second way should be the way, but maybe a little await is missing for
const administrators = await User.find
Tell me if it helps 
A little …maybe yes 
It’s better now 
Hello @Guiguijo 
I am glad to announce that the new Types implementation has just been released 
To benefit from the new Types, you just have to upgrade your Liana to version 7.9.0. Yes, Types our now directly integrated in the forest-express-mongoose repository, you don’t need to install @types/forest-express-mongoose anymore 
To help you with your migration, we also created a documentation to guide you as much as possible, please refer to this link.
Don’t hesitate to post any issue or frustration you encounter regarding Types, we will be glad to help you out and every feedback are appreciated.
I hope you will enjoy the new version !
Steve.