user.ts 892 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { IAttachment } from './attachment';
  2. import { Ref } from './common';
  3. import { HasObjectId } from './has-object-id';
  4. export type IUser = {
  5. name: string,
  6. username: string,
  7. email: string,
  8. password: string,
  9. image?: string, // for backward conpatibility
  10. imageAttachment?: Ref<IAttachment>,
  11. imageUrlCached: string,
  12. isGravatarEnabled: boolean,
  13. admin: boolean,
  14. apiToken?: string,
  15. isEmailPublished: boolean,
  16. lang: string,
  17. slackMemberId?: string,
  18. }
  19. export type IUserGroupRelation = {
  20. relatedGroup: Ref<IUserGroup>,
  21. relatedUser: Ref<IUser>,
  22. createdAt: Date,
  23. }
  24. export type IUserGroup = {
  25. name: string;
  26. createdAt: Date;
  27. description: string;
  28. parent: Ref<IUserGroupHasId> | null;
  29. }
  30. export type IUserHasId = IUser & HasObjectId;
  31. export type IUserGroupHasId = IUserGroup & HasObjectId;
  32. export type IUserGroupRelationHasId = IUserGroupRelation & HasObjectId;