user.ts 962 B

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