user.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { IAttachment } from './attachment';
  2. import { Ref } from './common';
  3. import { HasObjectId } from './has-object-id';
  4. import { Lang } from './lang';
  5. export type IUser = {
  6. name: string,
  7. username: string,
  8. email: string,
  9. password: string,
  10. image?: string, // for backward conpatibility
  11. imageAttachment?: Ref<IAttachment>,
  12. imageUrlCached: string,
  13. isGravatarEnabled: boolean,
  14. admin: boolean,
  15. apiToken?: string,
  16. isEmailPublished: boolean,
  17. lang: Lang,
  18. slackMemberId?: string,
  19. createdAt: Date,
  20. lastLoginAt?: Date,
  21. introduction: string,
  22. status: number,
  23. }
  24. export type IUserGroupRelation = {
  25. relatedGroup: Ref<IUserGroup>,
  26. relatedUser: Ref<IUser>,
  27. createdAt: Date,
  28. }
  29. export type IUserGroup = {
  30. name: string;
  31. createdAt: Date;
  32. description: string;
  33. parent: Ref<IUserGroupHasId> | null;
  34. }
  35. export type IUserHasId = IUser & HasObjectId;
  36. export type IUserGroupHasId = IUserGroup & HasObjectId;
  37. export type IUserGroupRelationHasId = IUserGroupRelation & HasObjectId;
  38. export type IAdminExternalAccount = {
  39. _id: string,
  40. providerType: string,
  41. accountId: string,
  42. user: IUser,
  43. createdAt: Date,
  44. }