user-notification.model.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import { FollowState } from '../actors'
  2. import { AbuseState } from '../moderation'
  3. import { PluginType } from '../plugins'
  4. export const enum UserNotificationType {
  5. NEW_VIDEO_FROM_SUBSCRIPTION = 1,
  6. NEW_COMMENT_ON_MY_VIDEO = 2,
  7. NEW_ABUSE_FOR_MODERATORS = 3,
  8. BLACKLIST_ON_MY_VIDEO = 4,
  9. UNBLACKLIST_ON_MY_VIDEO = 5,
  10. MY_VIDEO_PUBLISHED = 6,
  11. MY_VIDEO_IMPORT_SUCCESS = 7,
  12. MY_VIDEO_IMPORT_ERROR = 8,
  13. NEW_USER_REGISTRATION = 9,
  14. NEW_FOLLOW = 10,
  15. COMMENT_MENTION = 11,
  16. VIDEO_AUTO_BLACKLIST_FOR_MODERATORS = 12,
  17. NEW_INSTANCE_FOLLOWER = 13,
  18. AUTO_INSTANCE_FOLLOWING = 14,
  19. ABUSE_STATE_CHANGE = 15,
  20. ABUSE_NEW_MESSAGE = 16,
  21. NEW_PLUGIN_VERSION = 17,
  22. NEW_PEERTUBE_VERSION = 18,
  23. MY_VIDEO_STUDIO_EDITION_FINISHED = 19
  24. }
  25. export interface VideoInfo {
  26. id: number
  27. uuid: string
  28. shortUUID: string
  29. name: string
  30. }
  31. export interface AvatarInfo {
  32. width: number
  33. path: string
  34. }
  35. export interface ActorInfo {
  36. id: number
  37. displayName: string
  38. name: string
  39. host: string
  40. avatars: AvatarInfo[]
  41. avatar: AvatarInfo
  42. }
  43. export interface UserNotification {
  44. id: number
  45. type: UserNotificationType
  46. read: boolean
  47. video?: VideoInfo & {
  48. channel: ActorInfo
  49. }
  50. videoImport?: {
  51. id: number
  52. video?: VideoInfo
  53. torrentName?: string
  54. magnetUri?: string
  55. targetUrl?: string
  56. }
  57. comment?: {
  58. id: number
  59. threadId: number
  60. account: ActorInfo
  61. video: VideoInfo
  62. }
  63. abuse?: {
  64. id: number
  65. state: AbuseState
  66. video?: VideoInfo
  67. comment?: {
  68. threadId: number
  69. video: VideoInfo
  70. }
  71. account?: ActorInfo
  72. }
  73. videoBlacklist?: {
  74. id: number
  75. video: VideoInfo
  76. }
  77. account?: ActorInfo
  78. actorFollow?: {
  79. id: number
  80. follower: ActorInfo
  81. state: FollowState
  82. following: {
  83. type: 'account' | 'channel' | 'instance'
  84. name: string
  85. displayName: string
  86. host: string
  87. }
  88. }
  89. plugin?: {
  90. name: string
  91. type: PluginType
  92. latestVersion: string
  93. }
  94. peertube?: {
  95. latestVersion: string
  96. }
  97. createdAt: string
  98. updatedAt: string
  99. }