diff options
Diffstat (limited to 'packages/models/src/users/user-notification.model.ts')
-rw-r--r-- | packages/models/src/users/user-notification.model.ts | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/packages/models/src/users/user-notification.model.ts b/packages/models/src/users/user-notification.model.ts new file mode 100644 index 000000000..991fe6728 --- /dev/null +++ b/packages/models/src/users/user-notification.model.ts | |||
@@ -0,0 +1,140 @@ | |||
1 | import { FollowState } from '../actors/index.js' | ||
2 | import { AbuseStateType } from '../moderation/index.js' | ||
3 | import { PluginType_Type } from '../plugins/index.js' | ||
4 | |||
5 | export const UserNotificationType = { | ||
6 | NEW_VIDEO_FROM_SUBSCRIPTION: 1, | ||
7 | NEW_COMMENT_ON_MY_VIDEO: 2, | ||
8 | NEW_ABUSE_FOR_MODERATORS: 3, | ||
9 | |||
10 | BLACKLIST_ON_MY_VIDEO: 4, | ||
11 | UNBLACKLIST_ON_MY_VIDEO: 5, | ||
12 | |||
13 | MY_VIDEO_PUBLISHED: 6, | ||
14 | |||
15 | MY_VIDEO_IMPORT_SUCCESS: 7, | ||
16 | MY_VIDEO_IMPORT_ERROR: 8, | ||
17 | |||
18 | NEW_USER_REGISTRATION: 9, | ||
19 | NEW_FOLLOW: 10, | ||
20 | COMMENT_MENTION: 11, | ||
21 | |||
22 | VIDEO_AUTO_BLACKLIST_FOR_MODERATORS: 12, | ||
23 | |||
24 | NEW_INSTANCE_FOLLOWER: 13, | ||
25 | |||
26 | AUTO_INSTANCE_FOLLOWING: 14, | ||
27 | |||
28 | ABUSE_STATE_CHANGE: 15, | ||
29 | |||
30 | ABUSE_NEW_MESSAGE: 16, | ||
31 | |||
32 | NEW_PLUGIN_VERSION: 17, | ||
33 | NEW_PEERTUBE_VERSION: 18, | ||
34 | |||
35 | MY_VIDEO_STUDIO_EDITION_FINISHED: 19, | ||
36 | |||
37 | NEW_USER_REGISTRATION_REQUEST: 20 | ||
38 | } as const | ||
39 | |||
40 | export type UserNotificationType_Type = typeof UserNotificationType[keyof typeof UserNotificationType] | ||
41 | |||
42 | export interface VideoInfo { | ||
43 | id: number | ||
44 | uuid: string | ||
45 | shortUUID: string | ||
46 | name: string | ||
47 | } | ||
48 | |||
49 | export interface AvatarInfo { | ||
50 | width: number | ||
51 | path: string | ||
52 | } | ||
53 | |||
54 | export interface ActorInfo { | ||
55 | id: number | ||
56 | displayName: string | ||
57 | name: string | ||
58 | host: string | ||
59 | |||
60 | avatars: AvatarInfo[] | ||
61 | avatar: AvatarInfo | ||
62 | } | ||
63 | |||
64 | export interface UserNotification { | ||
65 | id: number | ||
66 | type: UserNotificationType_Type | ||
67 | read: boolean | ||
68 | |||
69 | video?: VideoInfo & { | ||
70 | channel: ActorInfo | ||
71 | } | ||
72 | |||
73 | videoImport?: { | ||
74 | id: number | ||
75 | video?: VideoInfo | ||
76 | torrentName?: string | ||
77 | magnetUri?: string | ||
78 | targetUrl?: string | ||
79 | } | ||
80 | |||
81 | comment?: { | ||
82 | id: number | ||
83 | threadId: number | ||
84 | account: ActorInfo | ||
85 | video: VideoInfo | ||
86 | } | ||
87 | |||
88 | abuse?: { | ||
89 | id: number | ||
90 | state: AbuseStateType | ||
91 | |||
92 | video?: VideoInfo | ||
93 | |||
94 | comment?: { | ||
95 | threadId: number | ||
96 | |||
97 | video: VideoInfo | ||
98 | } | ||
99 | |||
100 | account?: ActorInfo | ||
101 | } | ||
102 | |||
103 | videoBlacklist?: { | ||
104 | id: number | ||
105 | video: VideoInfo | ||
106 | } | ||
107 | |||
108 | account?: ActorInfo | ||
109 | |||
110 | actorFollow?: { | ||
111 | id: number | ||
112 | follower: ActorInfo | ||
113 | state: FollowState | ||
114 | |||
115 | following: { | ||
116 | type: 'account' | 'channel' | 'instance' | ||
117 | name: string | ||
118 | displayName: string | ||
119 | host: string | ||
120 | } | ||
121 | } | ||
122 | |||
123 | plugin?: { | ||
124 | name: string | ||
125 | type: PluginType_Type | ||
126 | latestVersion: string | ||
127 | } | ||
128 | |||
129 | peertube?: { | ||
130 | latestVersion: string | ||
131 | } | ||
132 | |||
133 | registration?: { | ||
134 | id: number | ||
135 | username: string | ||
136 | } | ||
137 | |||
138 | createdAt: string | ||
139 | updatedAt: string | ||
140 | } | ||