user.ts 776 B

12345678910111213141516171819202122232425262728293031323334
  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. email: string
  10. allowedFreeTrial?: boolean
  11. signUpDate?: string // date string
  12. features?: {
  13. collaborators?: number
  14. compileGroup?: 'standard' | 'priority'
  15. compileTimeout?: number
  16. dropbox?: boolean
  17. gitBridge?: boolean
  18. github?: boolean
  19. mendeley?: boolean
  20. references?: boolean
  21. referencesSearch?: boolean
  22. symbolPalette?: boolean
  23. templates?: boolean
  24. trackChanges?: boolean
  25. versioning?: boolean
  26. zotero?: boolean
  27. }
  28. refProviders?: RefProviders
  29. }
  30. export type MongoUser = Pick<User, Exclude<keyof User, 'id'>> & { _id: string }