user.ts 921 B

12345678910111213141516171819202122232425262728293031323334353637
  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. }
  20. export type IUserGroupRelation = {
  21. relatedGroup: Ref<IUserGroup>,
  22. relatedUser: Ref<IUser>,
  23. createdAt: Date,
  24. }
  25. export type IUserGroup = {
  26. name: string;
  27. createdAt: Date;
  28. description: string;
  29. parent: Ref<IUserGroupHasId> | null;
  30. }
  31. export type IUserHasId = IUser & HasObjectId;
  32. export type IUserGroupHasId = IUserGroup & HasObjectId;
  33. export type IUserGroupRelationHasId = IUserGroupRelation & HasObjectId;