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.ts23
1 files changed, 19 insertions, 4 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 132164746..54dce980f 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -10,6 +10,7 @@ import {
10 RequestEndpoint, 10 RequestEndpoint,
11 RequestVideoEventType, 11 RequestVideoEventType,
12 RequestVideoQaduType, 12 RequestVideoQaduType,
13 RemoteVideoRequestType,
13 JobState 14 JobState
14} from '../../shared/models' 15} from '../../shared/models'
15 16
@@ -35,6 +36,7 @@ const SORTABLE_COLUMNS = {
35 PODS: [ 'id', 'host', 'score', 'createdAt' ], 36 PODS: [ 'id', 'host', 'score', 'createdAt' ],
36 USERS: [ 'id', 'username', 'createdAt' ], 37 USERS: [ 'id', 'username', 'createdAt' ],
37 VIDEO_ABUSES: [ 'id', 'createdAt' ], 38 VIDEO_ABUSES: [ 'id', 'createdAt' ],
39 VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
38 VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ], 40 VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ],
39 BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ] 41 BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ]
40} 42}
@@ -115,6 +117,10 @@ const CONSTRAINTS_FIELDS = {
115 VIDEO_ABUSES: { 117 VIDEO_ABUSES: {
116 REASON: { min: 2, max: 300 } // Length 118 REASON: { min: 2, max: 300 } // Length
117 }, 119 },
120 VIDEO_CHANNELS: {
121 NAME: { min: 3, max: 50 }, // Length
122 DESCRIPTION: { min: 3, max: 250 } // Length
123 },
118 VIDEOS: { 124 VIDEOS: {
119 NAME: { min: 3, max: 50 }, // Length 125 NAME: { min: 3, max: 50 }, // Length
120 DESCRIPTION: { min: 3, max: 250 }, // Length 126 DESCRIPTION: { min: 3, max: 250 }, // Length
@@ -232,11 +238,20 @@ const REQUEST_ENDPOINTS: { [ id: string ]: RequestEndpoint } = {
232 VIDEOS: 'videos' 238 VIDEOS: 'videos'
233} 239}
234 240
235const REQUEST_ENDPOINT_ACTIONS: { [ id: string ]: any } = {} 241const REQUEST_ENDPOINT_ACTIONS: {
242 [ id: string ]: {
243 [ id: string ]: RemoteVideoRequestType
244 }
245} = {}
236REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = { 246REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
237 ADD: 'add', 247 ADD_VIDEO: 'add-video',
238 UPDATE: 'update', 248 UPDATE_VIDEO: 'update-video',
239 REMOVE: 'remove', 249 REMOVE_VIDEO: 'remove-video',
250 ADD_CHANNEL: 'add-channel',
251 UPDATE_CHANNEL: 'update-channel',
252 REMOVE_CHANNEL: 'remove-channel',
253 ADD_AUTHOR: 'add-author',
254 REMOVE_AUTHOR: 'remove-author',
240 REPORT_ABUSE: 'report-abuse' 255 REPORT_ABUSE: 'report-abuse'
241} 256}
242 257