user-notification.model.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import { FollowState } from '../actors'
  2. export enum UserNotificationType {
  3. NEW_VIDEO_FROM_SUBSCRIPTION = 1,
  4. NEW_COMMENT_ON_MY_VIDEO = 2,
  5. NEW_VIDEO_ABUSE_FOR_MODERATORS = 3,
  6. BLACKLIST_ON_MY_VIDEO = 4,
  7. UNBLACKLIST_ON_MY_VIDEO = 5,
  8. MY_VIDEO_PUBLISHED = 6,
  9. MY_VIDEO_IMPORT_SUCCESS = 7,
  10. MY_VIDEO_IMPORT_ERROR = 8,
  11. NEW_USER_REGISTRATION = 9,
  12. NEW_FOLLOW = 10,
  13. COMMENT_MENTION = 11,
  14. VIDEO_AUTO_BLACKLIST_FOR_MODERATORS = 12,
  15. NEW_INSTANCE_FOLLOWER = 13
  16. }
  17. export interface VideoInfo {
  18. id: number
  19. uuid: string
  20. name: string
  21. }
  22. export interface ActorInfo {
  23. id: number
  24. displayName: string
  25. name: string
  26. host: string
  27. avatar?: {
  28. path: string
  29. }
  30. }
  31. export interface UserNotification {
  32. id: number
  33. type: UserNotificationType
  34. read: boolean
  35. video?: VideoInfo & {
  36. channel: ActorInfo
  37. }
  38. videoImport?: {
  39. id: number
  40. video?: VideoInfo
  41. torrentName?: string
  42. magnetUri?: string
  43. targetUrl?: string
  44. }
  45. comment?: {
  46. id: number
  47. threadId: number
  48. account: ActorInfo
  49. video: VideoInfo
  50. }
  51. videoAbuse?: {
  52. id: number
  53. video: VideoInfo
  54. }
  55. videoBlacklist?: {
  56. id: number
  57. video: VideoInfo
  58. }
  59. account?: ActorInfo
  60. actorFollow?: {
  61. id: number
  62. follower: ActorInfo
  63. state: FollowState
  64. following: {
  65. type: 'account' | 'channel'
  66. name: string
  67. displayName: string
  68. }
  69. }
  70. createdAt: string
  71. updatedAt: string
  72. }