aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts21
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
5import { root, isTestInstance } from '../helpers/core-utils' 5import { root, isTestInstance } from '../helpers/core-utils'
6 6
7import {
8 UserRole,
9 VideoRateType,
10 RequestEndpoint,
11 RequestVideoEventType,
12 RequestVideoQaduType,
13 JobState
14} from '../../shared/models'
15
7// --------------------------------------------------------------------------- 16// ---------------------------------------------------------------------------
8 17
9const LAST_MIGRATION_VERSION = 50 18const LAST_MIGRATION_VERSION = 50
@@ -105,7 +114,7 @@ const CONSTRAINTS_FIELDS = {
105 } 114 }
106} 115}
107 116
108const VIDEO_RATE_TYPES = { 117const 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
199const RETRY_REQUESTS = 5 208const RETRY_REQUESTS = 5
200 209
201const REQUEST_ENDPOINTS = { 210const 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] = {
213const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu' 222const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu'
214const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events' 223const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events'
215 224
216const REQUEST_VIDEO_QADU_TYPES = { 225const 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
222const REQUEST_VIDEO_EVENT_TYPES = { 231const 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
233const JOB_STATES = { 242const 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
274const USER_ROLES = { 283const USER_ROLES: { [ id: string ]: UserRole } = {
275 ADMIN: 'admin', 284 ADMIN: 'admin',
276 USER: 'user' 285 USER: 'user'
277} 286}