user.ts 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { Brand } from './helpers/brand'
  2. export type RefProviders = {
  3. mendeley?: boolean
  4. zotero?: boolean
  5. }
  6. export type UserId = Brand<string, 'UserId'>
  7. export type User = {
  8. id: UserId
  9. isAdmin?: boolean
  10. email: string
  11. allowedFreeTrial?: boolean
  12. first_name?: string
  13. last_name?: string
  14. alphaProgram?: boolean
  15. betaProgram?: boolean
  16. labsProgram?: boolean
  17. signUpDate?: string // date string
  18. features?: {
  19. collaborators?: number
  20. compileGroup?: 'standard' | 'priority'
  21. compileTimeout?: number
  22. dropbox?: boolean
  23. gitBridge?: boolean
  24. github?: boolean
  25. mendeley?: boolean
  26. references?: boolean
  27. referencesSearch?: boolean
  28. symbolPalette?: boolean
  29. templates?: boolean
  30. trackChanges?: boolean
  31. versioning?: boolean
  32. zotero?: boolean
  33. }
  34. refProviders?: RefProviders
  35. writefull?: {
  36. enabled: boolean
  37. }
  38. }
  39. export type MongoUser = Pick<User, Exclude<keyof User, 'id'>> & { _id: string }