aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/activitypub/activity.ts43
-rw-r--r--shared/models/activitypub/activitypub-actor.ts8
-rw-r--r--shared/models/activitypub/activitypub-signature.ts4
-rw-r--r--shared/models/activitypub/objects/cache-file-object.ts2
-rw-r--r--shared/models/activitypub/objects/common-objects.ts33
-rw-r--r--shared/models/activitypub/objects/video-abuse-object.ts2
-rw-r--r--shared/models/activitypub/objects/video-torrent-object.ts8
-rw-r--r--shared/models/activitypub/objects/view-object.ts2
-rw-r--r--shared/models/i18n/i18n.ts44
-rw-r--r--shared/models/nodeinfo/index.d.ts2
-rw-r--r--shared/models/plugins/peertube-plugin-latest-version.model.ts2
-rw-r--r--shared/models/plugins/plugin-package-json.model.ts12
-rw-r--r--shared/models/plugins/register-server-setting.model.ts2
-rw-r--r--shared/models/plugins/server-hook.model.ts2
-rw-r--r--shared/models/redundancy/index.ts4
-rw-r--r--shared/models/redundancy/video-redundancies-filters.model.ts1
-rw-r--r--shared/models/redundancy/video-redundancy.model.ts35
-rw-r--r--shared/models/redundancy/videos-redundancy-strategy.model.ts (renamed from shared/models/redundancy/videos-redundancy.model.ts)3
-rw-r--r--shared/models/server/custom-config.model.ts4
-rw-r--r--shared/models/server/job.model.ts26
-rw-r--r--shared/models/server/server-config.model.ts13
-rw-r--r--shared/models/server/server-stats.model.ts18
-rw-r--r--shared/models/users/user-right.enum.ts4
-rw-r--r--shared/models/users/user-role.ts6
-rw-r--r--shared/models/users/user.model.ts1
-rw-r--r--shared/models/videos/video-transcoding-fps.model.ts8
-rw-r--r--shared/models/videos/video.model.ts2
27 files changed, 186 insertions, 105 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts
index 492b672c7..20ecf176c 100644
--- a/shared/models/activitypub/activity.ts
+++ b/shared/models/activitypub/activity.ts
@@ -8,12 +8,33 @@ import { ViewObject } from './objects/view-object'
8import { APObject } from './objects/object.model' 8import { APObject } from './objects/object.model'
9import { PlaylistObject } from './objects/playlist-object' 9import { PlaylistObject } from './objects/playlist-object'
10 10
11export type Activity = ActivityCreate | ActivityUpdate | 11export type Activity =
12 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | 12 ActivityCreate |
13 ActivityUndo | ActivityLike | ActivityReject | ActivityView | ActivityDislike | ActivityFlag 13 ActivityUpdate |
14 14 ActivityDelete |
15export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' | 'Reject' | 15 ActivityFollow |
16 'View' | 'Dislike' | 'Flag' 16 ActivityAccept |
17 ActivityAnnounce |
18 ActivityUndo |
19 ActivityLike |
20 ActivityReject |
21 ActivityView |
22 ActivityDislike |
23 ActivityFlag
24
25export type ActivityType =
26 'Create' |
27 'Update' |
28 'Delete' |
29 'Follow' |
30 'Accept' |
31 'Announce' |
32 'Undo' |
33 'Like' |
34 'Reject' |
35 'View' |
36 'Dislike' |
37 'Flag'
17 38
18export interface ActivityAudience { 39export interface ActivityAudience {
19 to: string[] 40 to: string[]
@@ -66,17 +87,17 @@ export interface ActivityAnnounce extends BaseActivity {
66} 87}
67 88
68export interface ActivityUndo extends BaseActivity { 89export interface ActivityUndo extends BaseActivity {
69 type: 'Undo', 90 type: 'Undo'
70 object: ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate | ActivityAnnounce 91 object: ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate | ActivityAnnounce
71} 92}
72 93
73export interface ActivityLike extends BaseActivity { 94export interface ActivityLike extends BaseActivity {
74 type: 'Like', 95 type: 'Like'
75 object: APObject 96 object: APObject
76} 97}
77 98
78export interface ActivityView extends BaseActivity { 99export interface ActivityView extends BaseActivity {
79 type: 'View', 100 type: 'View'
80 actor: string 101 actor: string
81 object: APObject 102 object: APObject
82} 103}
@@ -89,7 +110,7 @@ export interface ActivityDislike extends BaseActivity {
89} 110}
90 111
91export interface ActivityFlag extends BaseActivity { 112export interface ActivityFlag extends BaseActivity {
92 type: 'Flag', 113 type: 'Flag'
93 content: string, 114 content: string
94 object: APObject | APObject[] 115 object: APObject | APObject[]
95} 116}
diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.ts
index b8a2dc925..f022f3d02 100644
--- a/shared/models/activitypub/activitypub-actor.ts
+++ b/shared/models/activitypub/activitypub-actor.ts
@@ -1,4 +1,4 @@
1import { ActivityPubAttributedTo } from './objects/common-objects' 1import { ActivityIconObject, ActivityPubAttributedTo } from './objects/common-objects'
2 2
3export type ActivityPubActorType = 'Person' | 'Application' | 'Group' | 'Service' | 'Organization' 3export type ActivityPubActorType = 'Person' | 'Application' | 'Group' | 'Service' | 'Organization'
4 4
@@ -27,9 +27,5 @@ export interface ActivityPubActor {
27 publicKeyPem: string 27 publicKeyPem: string
28 } 28 }
29 29
30 icon: { 30 icon: ActivityIconObject
31 type: 'Image'
32 mediaType: 'image/png'
33 url: string
34 }
35} 31}
diff --git a/shared/models/activitypub/activitypub-signature.ts b/shared/models/activitypub/activitypub-signature.ts
index 1d9f4b3b3..fafdc246d 100644
--- a/shared/models/activitypub/activitypub-signature.ts
+++ b/shared/models/activitypub/activitypub-signature.ts
@@ -1,6 +1,6 @@
1export interface ActivityPubSignature { 1export interface ActivityPubSignature {
2 type: 'GraphSignature2012' 2 type: string
3 created: Date, 3 created: Date
4 creator: string 4 creator: string
5 signatureValue: string 5 signatureValue: string
6} 6}
diff --git a/shared/models/activitypub/objects/cache-file-object.ts b/shared/models/activitypub/objects/cache-file-object.ts
index 4b0a3a724..19a817582 100644
--- a/shared/models/activitypub/objects/cache-file-object.ts
+++ b/shared/models/activitypub/objects/cache-file-object.ts
@@ -2,7 +2,7 @@ import { ActivityVideoUrlObject, ActivityPlaylistUrlObject } from './common-obje
2 2
3export interface CacheFileObject { 3export interface CacheFileObject {
4 id: string 4 id: string
5 type: 'CacheFile', 5 type: 'CacheFile'
6 object: string 6 object: string
7 expires: string 7 expires: string
8 url: ActivityVideoUrlObject | ActivityPlaylistUrlObject 8 url: ActivityVideoUrlObject | ActivityPlaylistUrlObject
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
index de1116ab3..e94d05429 100644
--- a/shared/models/activitypub/objects/common-objects.ts
+++ b/shared/models/activitypub/objects/common-objects.ts
@@ -1,14 +1,15 @@
1export interface ActivityIdentifierObject { 1export interface ActivityIdentifierObject {
2 identifier: string 2 identifier: string
3 name: string 3 name: string
4 url?: string
4} 5}
5 6
6export interface ActivityIconObject { 7export interface ActivityIconObject {
7 type: 'Image' 8 type: 'Image'
8 url: string 9 url: string
9 mediaType: 'image/jpeg' 10 mediaType: 'image/jpeg' | 'image/png'
10 width: number 11 width?: number
11 height: number 12 height?: number
12} 13}
13 14
14export type ActivityVideoUrlObject = { 15export type ActivityVideoUrlObject = {
@@ -71,19 +72,21 @@ export interface ActivityMentionObject {
71 name: string 72 name: string
72} 73}
73 74
74export type ActivityTagObject = ActivityPlaylistSegmentHashesObject | 75export type ActivityTagObject =
75 ActivityPlaylistInfohashesObject | 76 ActivityPlaylistSegmentHashesObject
76 ActivityVideoUrlObject | 77 | ActivityPlaylistInfohashesObject
77 ActivityHashTagObject | 78 | ActivityVideoUrlObject
78 ActivityMentionObject | 79 | ActivityHashTagObject
79 ActivityBitTorrentUrlObject | 80 | ActivityMentionObject
80 ActivityMagnetUrlObject 81 | ActivityBitTorrentUrlObject
82 | ActivityMagnetUrlObject
81 83
82export type ActivityUrlObject = ActivityVideoUrlObject | 84export type ActivityUrlObject =
83 ActivityPlaylistUrlObject | 85 ActivityVideoUrlObject
84 ActivityBitTorrentUrlObject | 86 | ActivityPlaylistUrlObject
85 ActivityMagnetUrlObject | 87 | ActivityBitTorrentUrlObject
86 ActivityHtmlUrlObject 88 | ActivityMagnetUrlObject
89 | ActivityHtmlUrlObject
87 90
88export interface ActivityPubAttributedTo { 91export interface ActivityPubAttributedTo {
89 type: 'Group' | 'Person' 92 type: 'Group' | 'Person'
diff --git a/shared/models/activitypub/objects/video-abuse-object.ts b/shared/models/activitypub/objects/video-abuse-object.ts
index 5f1264a76..d9622b414 100644
--- a/shared/models/activitypub/objects/video-abuse-object.ts
+++ b/shared/models/activitypub/objects/video-abuse-object.ts
@@ -1,5 +1,5 @@
1export interface VideoAbuseObject { 1export interface VideoAbuseObject {
2 type: 'Flag', 2 type: 'Flag'
3 content: string 3 content: string
4 object: string | string[] 4 object: string | string[]
5} 5}
diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts
index 239822bc4..11de8fc56 100644
--- a/shared/models/activitypub/objects/video-torrent-object.ts
+++ b/shared/models/activitypub/objects/video-torrent-object.ts
@@ -20,8 +20,8 @@ export interface VideoTorrentObject {
20 subtitleLanguage: ActivityIdentifierObject[] 20 subtitleLanguage: ActivityIdentifierObject[]
21 views: number 21 views: number
22 sensitive: boolean 22 sensitive: boolean
23 commentsEnabled: boolean, 23 commentsEnabled: boolean
24 downloadEnabled: boolean, 24 downloadEnabled: boolean
25 waitTranscoding: boolean 25 waitTranscoding: boolean
26 state: VideoState 26 state: VideoState
27 published: string 27 published: string
@@ -30,7 +30,9 @@ export interface VideoTorrentObject {
30 mediaType: 'text/markdown' 30 mediaType: 'text/markdown'
31 content: string 31 content: string
32 support: string 32 support: string
33 icon: ActivityIconObject 33
34 icon: ActivityIconObject[]
35
34 url: ActivityUrlObject[] 36 url: ActivityUrlObject[]
35 likes: string 37 likes: string
36 dislikes: string 38 dislikes: string
diff --git a/shared/models/activitypub/objects/view-object.ts b/shared/models/activitypub/objects/view-object.ts
index 00348116a..4dd21ce8e 100644
--- a/shared/models/activitypub/objects/view-object.ts
+++ b/shared/models/activitypub/objects/view-object.ts
@@ -1,5 +1,5 @@
1export interface ViewObject { 1export interface ViewObject {
2 type: 'View', 2 type: 'View'
3 actor: string 3 actor: string
4 object: string 4 object: string
5} 5}
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts
index 032944281..36688382d 100644
--- a/shared/models/i18n/i18n.ts
+++ b/shared/models/i18n/i18n.ts
@@ -1,44 +1,50 @@
1export const LOCALE_FILES = [ 'player', 'server' ] 1export const LOCALE_FILES = [ 'player', 'server' ]
2 2
3export const I18N_LOCALES = { 3export const I18N_LOCALES = {
4 // Always first to avoid issues when using express acceptLanguages function when no accept language header is set
4 'en-US': 'English', 5 'en-US': 'English',
5 'fr-FR': 'Français', 6
6 'ja-JP': '日本語',
7 'eu-ES': 'Euskara',
8 'ca-ES': 'Català', 7 'ca-ES': 'Català',
9 'cs-CZ': 'Čeština', 8 'cs-CZ': 'Čeština',
10 'eo': 'Esperanto',
11 'el-GR': 'ελληνικά',
12 'de-DE': 'Deutsch', 9 'de-DE': 'Deutsch',
10 'el-GR': 'ελληνικά',
11 'eo': 'Esperanto',
12 'es-ES': 'Español',
13 'eu-ES': 'Euskara',
14 'fi-FI': 'suomi',
15 'fr-FR': 'Français',
16 'gd': 'Gàidhlig',
17 'hu-HU': 'magyar',
13 'it-IT': 'Italiano', 18 'it-IT': 'Italiano',
19 'ja-JP': '日本語',
14 'nl-NL': 'Nederlands', 20 'nl-NL': 'Nederlands',
15 'es-ES': 'Español',
16 'oc': 'Occitan', 21 'oc': 'Occitan',
17 'gd': 'Gàidhlig', 22 'pl-PL': 'Polski',
18 'zh-Hant-TW': '繁體中文(台灣)',
19 'pt-BR': 'Português (Brasil)', 23 'pt-BR': 'Português (Brasil)',
20 'pt-PT': 'Português (Portugal)', 24 'pt-PT': 'Português (Portugal)',
21 'sv-SE': 'svenska',
22 'pl-PL': 'Polski',
23 'fi-FI': 'suomi',
24 'ru-RU': 'русский', 25 'ru-RU': 'русский',
25 'zh-Hans-CN': '简体中文(中国)' 26 'sv-SE': 'svenska',
27 'th-TH': 'ไทย',
28 'zh-Hans-CN': '简体中文(中国)',
29 'zh-Hant-TW': '繁體中文(台灣)'
26} 30}
27 31
28const I18N_LOCALE_ALIAS = { 32const I18N_LOCALE_ALIAS = {
29 'en': 'en-US',
30 'fr': 'fr-FR',
31 'eu': 'eu-ES',
32 'ca': 'ca-ES', 33 'ca': 'ca-ES',
33 'cs': 'cs-CZ', 34 'cs': 'cs-CZ',
34 'de': 'de-DE', 35 'de': 'de-DE',
36 'en': 'en-US',
35 'es': 'es-ES', 37 'es': 'es-ES',
36 'pt': 'pt-PT', 38 'eu': 'eu-ES',
37 'fi': 'fi-FI', 39 'fi': 'fi-FI',
38 'sv': 'sv-SE', 40 'fr': 'fr-FR',
41 'hu': 'hu-HU',
42 'nl': 'nl-NL',
39 'pl': 'pl-PL', 43 'pl': 'pl-PL',
44 'pt': 'pt-PT',
40 'ru': 'ru-RU', 45 'ru': 'ru-RU',
41 'nl': 'nl-NL', 46 'sv': 'sv-SE',
47 'th': 'th-TH',
42 'zh': 'zh-Hans-CN', 48 'zh': 'zh-Hans-CN',
43 'zh-CN': 'zh-Hans-CN', 49 'zh-CN': 'zh-Hans-CN',
44 'zh-TW': 'zh-Hant-TW' 50 'zh-TW': 'zh-Hant-TW'
@@ -56,6 +62,8 @@ export function isDefaultLocale (locale: string) {
56} 62}
57 63
58export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { 64export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) {
65 // FIXME: remove disable rule when the client is upgraded to typescript 3.7
66 // eslint-disable-next-line
59 return translations && translations[str] ? translations[str] : str 67 return translations && translations[str] ? translations[str] : str
60} 68}
61 69
diff --git a/shared/models/nodeinfo/index.d.ts b/shared/models/nodeinfo/index.d.ts
index 0a2d0492e..336cb66d2 100644
--- a/shared/models/nodeinfo/index.d.ts
+++ b/shared/models/nodeinfo/index.d.ts
@@ -98,7 +98,7 @@ export interface HttpNodeinfoDiasporaSoftwareNsSchema20 {
98 * The amount of users that signed in at least once in the last 30 days. 98 * The amount of users that signed in at least once in the last 30 days.
99 */ 99 */
100 activeMonth?: number 100 activeMonth?: number
101 }; 101 }
102 /** 102 /**
103 * The amount of posts that were made by users that are registered on this server. 103 * The amount of posts that were made by users that are registered on this server.
104 */ 104 */
diff --git a/shared/models/plugins/peertube-plugin-latest-version.model.ts b/shared/models/plugins/peertube-plugin-latest-version.model.ts
index dec4618fa..811a64429 100644
--- a/shared/models/plugins/peertube-plugin-latest-version.model.ts
+++ b/shared/models/plugins/peertube-plugin-latest-version.model.ts
@@ -1,5 +1,5 @@
1export interface PeertubePluginLatestVersionRequest { 1export interface PeertubePluginLatestVersionRequest {
2 currentPeerTubeEngine?: string, 2 currentPeerTubeEngine?: string
3 3
4 npmNames: string[] 4 npmNames: string[]
5} 5}
diff --git a/shared/models/plugins/plugin-package-json.model.ts b/shared/models/plugins/plugin-package-json.model.ts
index 3f3077671..c26e9ae5b 100644
--- a/shared/models/plugins/plugin-package-json.model.ts
+++ b/shared/models/plugins/plugin-package-json.model.ts
@@ -5,7 +5,7 @@ export type PluginTranslationPaths = {
5} 5}
6 6
7export type ClientScript = { 7export type ClientScript = {
8 script: string, 8 script: string
9 scopes: PluginClientScope[] 9 scopes: PluginClientScope[]
10} 10}
11 11
@@ -13,12 +13,12 @@ export type PluginPackageJson = {
13 name: string 13 name: string
14 version: string 14 version: string
15 description: string 15 description: string
16 engine: { peertube: string }, 16 engine: { peertube: string }
17 17
18 homepage: string, 18 homepage: string
19 author: string, 19 author: string
20 bugs: string, 20 bugs: string
21 library: string, 21 library: string
22 22
23 staticDirs: { [ name: string ]: string } 23 staticDirs: { [ name: string ]: string }
24 css: string[] 24 css: string[]
diff --git a/shared/models/plugins/register-server-setting.model.ts b/shared/models/plugins/register-server-setting.model.ts
index 65a181705..45d79228d 100644
--- a/shared/models/plugins/register-server-setting.model.ts
+++ b/shared/models/plugins/register-server-setting.model.ts
@@ -1,7 +1,7 @@
1export interface RegisterServerSettingOptions { 1export interface RegisterServerSettingOptions {
2 name: string 2 name: string
3 label: string 3 label: string
4 type: 'input' 4 type: 'input' | 'input-checkbox' | 'input-textarea'
5 5
6 // If the setting is not private, anyone can view its value (client code included) 6 // If the setting is not private, anyone can view its value (client code included)
7 // If the setting is private, only server-side hooks can access it 7 // If the setting is private, only server-side hooks can access it
diff --git a/shared/models/plugins/server-hook.model.ts b/shared/models/plugins/server-hook.model.ts
index 80ecd9e24..20f89b86d 100644
--- a/shared/models/plugins/server-hook.model.ts
+++ b/shared/models/plugins/server-hook.model.ts
@@ -70,7 +70,7 @@ export const serverActionHookObject = {
70 // Fired when a user is updated by an admin/moderator 70 // Fired when a user is updated by an admin/moderator
71 'action:api.user.updated': true, 71 'action:api.user.updated': true,
72 72
73 // Fired when a user got a new oauth2 token 73 // Fired when a user got a new oauth2 token
74 'action:api.user.oauth2-got-token': true 74 'action:api.user.oauth2-got-token': true
75} 75}
76 76
diff --git a/shared/models/redundancy/index.ts b/shared/models/redundancy/index.ts
index 61bf0fca7..649cc489f 100644
--- a/shared/models/redundancy/index.ts
+++ b/shared/models/redundancy/index.ts
@@ -1 +1,3 @@
1export * from './videos-redundancy.model' 1export * from './videos-redundancy-strategy.model'
2export * from './video-redundancies-filters.model'
3export * from './video-redundancy.model'
diff --git a/shared/models/redundancy/video-redundancies-filters.model.ts b/shared/models/redundancy/video-redundancies-filters.model.ts
new file mode 100644
index 000000000..05ba7dfd3
--- /dev/null
+++ b/shared/models/redundancy/video-redundancies-filters.model.ts
@@ -0,0 +1 @@
export type VideoRedundanciesTarget = 'my-videos' | 'remote-videos'
diff --git a/shared/models/redundancy/video-redundancy.model.ts b/shared/models/redundancy/video-redundancy.model.ts
new file mode 100644
index 000000000..fa6e05832
--- /dev/null
+++ b/shared/models/redundancy/video-redundancy.model.ts
@@ -0,0 +1,35 @@
1export interface VideoRedundancy {
2 id: number
3 name: string
4 url: string
5 uuid: string
6
7 redundancies: {
8 files: FileRedundancyInformation[]
9
10 streamingPlaylists: StreamingPlaylistRedundancyInformation[]
11 }
12}
13
14interface RedundancyInformation {
15 id: number
16 fileUrl: string
17 strategy: string
18
19 createdAt: Date | string
20 updatedAt: Date | string
21
22 expiresOn: Date | string
23
24 size: number
25}
26
27// eslint-disable-next-line @typescript-eslint/no-empty-interface
28export interface FileRedundancyInformation extends RedundancyInformation {
29
30}
31
32// eslint-disable-next-line @typescript-eslint/no-empty-interface
33export interface StreamingPlaylistRedundancyInformation extends RedundancyInformation {
34
35}
diff --git a/shared/models/redundancy/videos-redundancy.model.ts b/shared/models/redundancy/videos-redundancy-strategy.model.ts
index a8c2743c1..15409abf0 100644
--- a/shared/models/redundancy/videos-redundancy.model.ts
+++ b/shared/models/redundancy/videos-redundancy-strategy.model.ts
@@ -1,4 +1,5 @@
1export type VideoRedundancyStrategy = 'most-views' | 'trending' | 'recently-added' 1export type VideoRedundancyStrategy = 'most-views' | 'trending' | 'recently-added'
2export type VideoRedundancyStrategyWithManual = VideoRedundancyStrategy | 'manual'
2 3
3export type MostViewsRedundancyStrategy = { 4export type MostViewsRedundancyStrategy = {
4 strategy: 'most-views' 5 strategy: 'most-views'
@@ -19,4 +20,4 @@ export type RecentlyAddedStrategy = {
19 minLifetime: number 20 minLifetime: number
20} 21}
21 22
22export type VideosRedundancy = MostViewsRedundancyStrategy | TrendingRedundancyStrategy | RecentlyAddedStrategy 23export type VideosRedundancyStrategy = MostViewsRedundancyStrategy | TrendingRedundancyStrategy | RecentlyAddedStrategy
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
index 032b91a29..07e17bda2 100644
--- a/shared/models/server/custom-config.model.ts
+++ b/shared/models/server/custom-config.model.ts
@@ -97,7 +97,7 @@ export interface CustomConfig {
97 videos: { 97 videos: {
98 http: { 98 http: {
99 enabled: boolean 99 enabled: boolean
100 }, 100 }
101 torrent: { 101 torrent: {
102 enabled: boolean 102 enabled: boolean
103 } 103 }
@@ -114,7 +114,7 @@ export interface CustomConfig {
114 114
115 followers: { 115 followers: {
116 instance: { 116 instance: {
117 enabled: boolean, 117 enabled: boolean
118 manualApproval: boolean 118 manualApproval: boolean
119 } 119 }
120 } 120 }
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
index b82a633b2..cf29d20d4 100644
--- a/shared/models/server/job.model.ts
+++ b/shared/models/server/job.model.ts
@@ -1,22 +1,24 @@
1export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' 1export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed'
2 2
3export type JobType = 'activitypub-http-unicast' | 3export type JobType =
4 'activitypub-http-broadcast' | 4 | 'activitypub-http-unicast'
5 'activitypub-http-fetcher' | 5 | 'activitypub-http-broadcast'
6 'activitypub-follow' | 6 | 'activitypub-http-fetcher'
7 'video-file-import' | 7 | 'activitypub-follow'
8 'video-transcoding' | 8 | 'video-file-import'
9 'email' | 9 | 'video-transcoding'
10 'video-import' | 10 | 'email'
11 'videos-views' | 11 | 'video-import'
12 'activitypub-refresher' 12 | 'videos-views'
13 | 'activitypub-refresher'
14 | 'video-redundancy'
13 15
14export interface Job { 16export interface Job {
15 id: number 17 id: number
16 state: JobState 18 state: JobState
17 type: JobType 19 type: JobType
18 data: any, 20 data: any
19 error: any, 21 error: any
20 createdAt: Date | string 22 createdAt: Date | string
21 finishedOn: Date | string 23 finishedOn: Date | string
22 processedOn: Date | string 24 processedOn: Date | string
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts
index f1bb2153c..c3976a346 100644
--- a/shared/models/server/server-config.model.ts
+++ b/shared/models/server/server-config.model.ts
@@ -28,6 +28,13 @@ export interface ServerConfig {
28 } 28 }
29 } 29 }
30 30
31 search: {
32 remoteUri: {
33 users: boolean
34 anonymous: boolean
35 }
36 }
37
31 plugin: { 38 plugin: {
32 registered: ServerConfigPlugin[] 39 registered: ServerConfigPlugin[]
33 } 40 }
@@ -46,7 +53,7 @@ export interface ServerConfig {
46 } 53 }
47 54
48 signup: { 55 signup: {
49 allowed: boolean, 56 allowed: boolean
50 allowedForCurrentIP: boolean 57 allowedForCurrentIP: boolean
51 requiresEmailVerification: boolean 58 requiresEmailVerification: boolean
52 } 59 }
@@ -97,7 +104,7 @@ export interface ServerConfig {
97 max: number 104 max: number
98 } 105 }
99 extensions: string[] 106 extensions: string[]
100 }, 107 }
101 file: { 108 file: {
102 extensions: string[] 109 extensions: string[]
103 } 110 }
@@ -107,7 +114,7 @@ export interface ServerConfig {
107 file: { 114 file: {
108 size: { 115 size: {
109 max: number 116 max: number
110 }, 117 }
111 extensions: string[] 118 extensions: string[]
112 } 119 }
113 } 120 }
diff --git a/shared/models/server/server-stats.model.ts b/shared/models/server/server-stats.model.ts
index 74f3de5d3..11778e6ed 100644
--- a/shared/models/server/server-stats.model.ts
+++ b/shared/models/server/server-stats.model.ts
@@ -1,4 +1,4 @@
1import { VideoRedundancyStrategy } from '../redundancy' 1import { VideoRedundancyStrategyWithManual } from '../redundancy'
2 2
3export interface ServerStats { 3export interface ServerStats {
4 totalUsers: number 4 totalUsers: number
@@ -13,11 +13,13 @@ export interface ServerStats {
13 totalInstanceFollowers: number 13 totalInstanceFollowers: number
14 totalInstanceFollowing: number 14 totalInstanceFollowing: number
15 15
16 videosRedundancy: { 16 videosRedundancy: VideosRedundancyStats[]
17 strategy: VideoRedundancyStrategy 17}
18 totalSize: number 18
19 totalUsed: number 19export interface VideosRedundancyStats {
20 totalVideoFiles: number 20 strategy: VideoRedundancyStrategyWithManual
21 totalVideos: number 21 totalSize: number
22 }[] 22 totalUsed: number
23 totalVideoFiles: number
24 totalVideos: number
23} 25}
diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts
index 4a28a229d..2f88a65de 100644
--- a/shared/models/users/user-right.enum.ts
+++ b/shared/models/users/user-right.enum.ts
@@ -33,5 +33,7 @@ export enum UserRight {
33 SEE_ALL_VIDEOS, 33 SEE_ALL_VIDEOS,
34 CHANGE_VIDEO_OWNERSHIP, 34 CHANGE_VIDEO_OWNERSHIP,
35 35
36 MANAGE_PLUGINS 36 MANAGE_PLUGINS,
37
38 MANAGE_VIDEOS_REDUNDANCIES
37} 39}
diff --git a/shared/models/users/user-role.ts b/shared/models/users/user-role.ts
index 0b6554e51..ae3a0d983 100644
--- a/shared/models/users/user-role.ts
+++ b/shared/models/users/user-role.ts
@@ -7,15 +7,13 @@ export enum UserRole {
7 USER = 2 7 USER = 2
8} 8}
9 9
10// TODO: use UserRole for key once https://github.com/Microsoft/TypeScript/issues/13042 is fixed 10export const USER_ROLE_LABELS: { [ id in UserRole ]: string } = {
11export const USER_ROLE_LABELS: { [ id: number ]: string } = {
12 [UserRole.USER]: 'User', 11 [UserRole.USER]: 'User',
13 [UserRole.MODERATOR]: 'Moderator', 12 [UserRole.MODERATOR]: 'Moderator',
14 [UserRole.ADMINISTRATOR]: 'Administrator' 13 [UserRole.ADMINISTRATOR]: 'Administrator'
15} 14}
16 15
17// TODO: use UserRole for key once https://github.com/Microsoft/TypeScript/issues/13042 is fixed 16const userRoleRights: { [ id in UserRole ]: UserRight[] } = {
18const userRoleRights: { [ id: number ]: UserRight[] } = {
19 [UserRole.ADMINISTRATOR]: [ 17 [UserRole.ADMINISTRATOR]: [
20 UserRight.ALL 18 UserRight.ALL
21 ], 19 ],
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts
index 168851196..efb451014 100644
--- a/shared/models/users/user.model.ts
+++ b/shared/models/users/user.model.ts
@@ -1,6 +1,5 @@
1import { Account } from '../actors' 1import { Account } from '../actors'
2import { VideoChannel } from '../videos/channel/video-channel.model' 2import { VideoChannel } from '../videos/channel/video-channel.model'
3import { VideoPlaylist } from '../videos/playlist/video-playlist.model'
4import { UserRole } from './user-role' 3import { UserRole } from './user-role'
5import { NSFWPolicyType } from '../videos/nsfw-policy.type' 4import { NSFWPolicyType } from '../videos/nsfw-policy.type'
6import { UserNotificationSetting } from './user-notification-setting.model' 5import { UserNotificationSetting } from './user-notification-setting.model'
diff --git a/shared/models/videos/video-transcoding-fps.model.ts b/shared/models/videos/video-transcoding-fps.model.ts
index 82022d2f1..25fc1c2da 100644
--- a/shared/models/videos/video-transcoding-fps.model.ts
+++ b/shared/models/videos/video-transcoding-fps.model.ts
@@ -1,6 +1,8 @@
1export type VideoTranscodingFPS = { 1export type VideoTranscodingFPS = {
2 MIN: number, 2 MIN: number
3 AVERAGE: number, 3 STANDARD: number[]
4 MAX: number, 4 HD_STANDARD: number[]
5 AVERAGE: number
6 MAX: number
5 KEEP_ORIGIN_FPS_RESOLUTION_MIN: number 7 KEEP_ORIGIN_FPS_RESOLUTION_MIN: number
6} 8}
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index 7576439fe..a69152759 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -1,4 +1,4 @@
1import { AccountSummary, VideoChannelSummary, VideoResolution, VideoState } from '../../index' 1import { AccountSummary, VideoChannelSummary, VideoState } from '../../index'
2import { Account } from '../actors' 2import { Account } from '../actors'
3import { VideoChannel } from './channel/video-channel.model' 3import { VideoChannel } from './channel/video-channel.model'
4import { VideoPrivacy } from './video-privacy.enum' 4import { VideoPrivacy } from './video-privacy.enum'