diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 10:36:18 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 10:36:18 +0200 |
commit | ee9e7b61f59a427208386738057c8eff48fba599 (patch) | |
tree | 9097de886128e15f21f0b5920a2076d16a087467 /server/initializers/constants.ts | |
parent | 70c065d64c330196d371941d9294a55da6e3aa37 (diff) | |
download | PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.gz PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.zst PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.zip |
Create types for model enums
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index b476ef928..bf99f4df6 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -4,6 +4,15 @@ import { join } from 'path' | |||
4 | // Do not use barrels, remain constants as independent as possible | 4 | // Do not use barrels, remain constants as independent as possible |
5 | import { root, isTestInstance } from '../helpers/core-utils' | 5 | import { root, isTestInstance } from '../helpers/core-utils' |
6 | 6 | ||
7 | import { | ||
8 | UserRole, | ||
9 | VideoRateType, | ||
10 | RequestEndpoint, | ||
11 | RequestVideoEventType, | ||
12 | RequestVideoQaduType, | ||
13 | JobState | ||
14 | } from '../../shared/models' | ||
15 | |||
7 | // --------------------------------------------------------------------------- | 16 | // --------------------------------------------------------------------------- |
8 | 17 | ||
9 | const LAST_MIGRATION_VERSION = 50 | 18 | const LAST_MIGRATION_VERSION = 50 |
@@ -105,7 +114,7 @@ const CONSTRAINTS_FIELDS = { | |||
105 | } | 114 | } |
106 | } | 115 | } |
107 | 116 | ||
108 | const VIDEO_RATE_TYPES = { | 117 | const VIDEO_RATE_TYPES: { [ id: string ]: VideoRateType } = { |
109 | LIKE: 'like', | 118 | LIKE: 'like', |
110 | DISLIKE: 'dislike' | 119 | DISLIKE: 'dislike' |
111 | } | 120 | } |
@@ -198,7 +207,7 @@ const REQUESTS_VIDEO_EVENT_LIMIT_PER_POD = 50 | |||
198 | // Number of requests to retry for replay requests module | 207 | // Number of requests to retry for replay requests module |
199 | const RETRY_REQUESTS = 5 | 208 | const RETRY_REQUESTS = 5 |
200 | 209 | ||
201 | const REQUEST_ENDPOINTS = { | 210 | const REQUEST_ENDPOINTS: { [ id: string ]: RequestEndpoint } = { |
202 | VIDEOS: 'videos' | 211 | VIDEOS: 'videos' |
203 | } | 212 | } |
204 | 213 | ||
@@ -213,13 +222,13 @@ REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = { | |||
213 | const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu' | 222 | const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu' |
214 | const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events' | 223 | const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events' |
215 | 224 | ||
216 | const REQUEST_VIDEO_QADU_TYPES = { | 225 | const REQUEST_VIDEO_QADU_TYPES: { [ id: string ]: RequestVideoQaduType } = { |
217 | LIKES: 'likes', | 226 | LIKES: 'likes', |
218 | DISLIKES: 'dislikes', | 227 | DISLIKES: 'dislikes', |
219 | VIEWS: 'views' | 228 | VIEWS: 'views' |
220 | } | 229 | } |
221 | 230 | ||
222 | const REQUEST_VIDEO_EVENT_TYPES = { | 231 | const REQUEST_VIDEO_EVENT_TYPES: { [ id: string ]: RequestVideoEventType } = { |
223 | LIKES: 'likes', | 232 | LIKES: 'likes', |
224 | DISLIKES: 'dislikes', | 233 | DISLIKES: 'dislikes', |
225 | VIEWS: 'views' | 234 | VIEWS: 'views' |
@@ -230,7 +239,7 @@ const REMOTE_SCHEME = { | |||
230 | WS: 'wss' | 239 | WS: 'wss' |
231 | } | 240 | } |
232 | 241 | ||
233 | const JOB_STATES = { | 242 | const JOB_STATES: { [ id: string ]: JobState } = { |
234 | PENDING: 'pending', | 243 | PENDING: 'pending', |
235 | PROCESSING: 'processing', | 244 | PROCESSING: 'processing', |
236 | ERROR: 'error', | 245 | ERROR: 'error', |
@@ -271,7 +280,7 @@ const PREVIEWS_SIZE = '640x480' | |||
271 | 280 | ||
272 | // --------------------------------------------------------------------------- | 281 | // --------------------------------------------------------------------------- |
273 | 282 | ||
274 | const USER_ROLES = { | 283 | const USER_ROLES: { [ id: string ]: UserRole } = { |
275 | ADMIN: 'admin', | 284 | ADMIN: 'admin', |
276 | USER: 'user' | 285 | USER: 'user' |
277 | } | 286 | } |