diff options
Diffstat (limited to 'shared/models')
26 files changed, 154 insertions, 86 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' | |||
8 | import { APObject } from './objects/object.model' | 8 | import { APObject } from './objects/object.model' |
9 | import { PlaylistObject } from './objects/playlist-object' | 9 | import { PlaylistObject } from './objects/playlist-object' |
10 | 10 | ||
11 | export type Activity = ActivityCreate | ActivityUpdate | | 11 | export type Activity = |
12 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | | 12 | ActivityCreate | |
13 | ActivityUndo | ActivityLike | ActivityReject | ActivityView | ActivityDislike | ActivityFlag | 13 | ActivityUpdate | |
14 | 14 | ActivityDelete | | |
15 | export 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 | |||
25 | export 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 | ||
18 | export interface ActivityAudience { | 39 | export interface ActivityAudience { |
19 | to: string[] | 40 | to: string[] |
@@ -66,17 +87,17 @@ export interface ActivityAnnounce extends BaseActivity { | |||
66 | } | 87 | } |
67 | 88 | ||
68 | export interface ActivityUndo extends BaseActivity { | 89 | export 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 | ||
73 | export interface ActivityLike extends BaseActivity { | 94 | export interface ActivityLike extends BaseActivity { |
74 | type: 'Like', | 95 | type: 'Like' |
75 | object: APObject | 96 | object: APObject |
76 | } | 97 | } |
77 | 98 | ||
78 | export interface ActivityView extends BaseActivity { | 99 | export 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 | ||
91 | export interface ActivityFlag extends BaseActivity { | 112 | export 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 @@ | |||
1 | import { ActivityPubAttributedTo } from './objects/common-objects' | 1 | import { ActivityIconObject, ActivityPubAttributedTo } from './objects/common-objects' |
2 | 2 | ||
3 | export type ActivityPubActorType = 'Person' | 'Application' | 'Group' | 'Service' | 'Organization' | 3 | export 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 @@ | |||
1 | export interface ActivityPubSignature { | 1 | export 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 | ||
3 | export interface CacheFileObject { | 3 | export 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 @@ | |||
1 | export interface ActivityIdentifierObject { | 1 | export interface ActivityIdentifierObject { |
2 | identifier: string | 2 | identifier: string |
3 | name: string | 3 | name: string |
4 | url?: string | ||
4 | } | 5 | } |
5 | 6 | ||
6 | export interface ActivityIconObject { | 7 | export 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 | ||
14 | export type ActivityVideoUrlObject = { | 15 | export type ActivityVideoUrlObject = { |
@@ -71,19 +72,21 @@ export interface ActivityMentionObject { | |||
71 | name: string | 72 | name: string |
72 | } | 73 | } |
73 | 74 | ||
74 | export type ActivityTagObject = ActivityPlaylistSegmentHashesObject | | 75 | export 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 | ||
82 | export type ActivityUrlObject = ActivityVideoUrlObject | | 84 | export type ActivityUrlObject = |
83 | ActivityPlaylistUrlObject | | 85 | ActivityVideoUrlObject |
84 | ActivityBitTorrentUrlObject | | 86 | | ActivityPlaylistUrlObject |
85 | ActivityMagnetUrlObject | | 87 | | ActivityBitTorrentUrlObject |
86 | ActivityHtmlUrlObject | 88 | | ActivityMagnetUrlObject |
89 | | ActivityHtmlUrlObject | ||
87 | 90 | ||
88 | export interface ActivityPubAttributedTo { | 91 | export 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 @@ | |||
1 | export interface VideoAbuseObject { | 1 | export 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 @@ | |||
1 | export interface ViewObject { | 1 | export 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..9ae175df9 100644 --- a/shared/models/i18n/i18n.ts +++ b/shared/models/i18n/i18n.ts | |||
@@ -56,6 +56,8 @@ export function isDefaultLocale (locale: string) { | |||
56 | } | 56 | } |
57 | 57 | ||
58 | export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { | 58 | export function peertubeTranslate (str: string, translations?: { [ id: string ]: string }) { |
59 | // FIXME: remove disable rule when the client is upgraded to typescript 3.7 | ||
60 | // eslint-disable-next-line | ||
59 | return translations && translations[str] ? translations[str] : str | 61 | return translations && translations[str] ? translations[str] : str |
60 | } | 62 | } |
61 | 63 | ||
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 @@ | |||
1 | export interface PeertubePluginLatestVersionRequest { | 1 | export 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 | ||
7 | export type ClientScript = { | 7 | export 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/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 @@ | |||
1 | export * from './videos-redundancy.model' | 1 | export * from './videos-redundancy-strategy.model' |
2 | export * from './video-redundancies-filters.model' | ||
3 | export * 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 @@ | |||
1 | export 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 | |||
14 | interface 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 | ||
28 | export interface FileRedundancyInformation extends RedundancyInformation { | ||
29 | |||
30 | } | ||
31 | |||
32 | // eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
33 | export 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 @@ | |||
1 | export type VideoRedundancyStrategy = 'most-views' | 'trending' | 'recently-added' | 1 | export type VideoRedundancyStrategy = 'most-views' | 'trending' | 'recently-added' |
2 | export type VideoRedundancyStrategyWithManual = VideoRedundancyStrategy | 'manual' | ||
2 | 3 | ||
3 | export type MostViewsRedundancyStrategy = { | 4 | export 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 | ||
22 | export type VideosRedundancy = MostViewsRedundancyStrategy | TrendingRedundancyStrategy | RecentlyAddedStrategy | 23 | export 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 @@ | |||
1 | export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 1 | export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' |
2 | 2 | ||
3 | export type JobType = 'activitypub-http-unicast' | | 3 | export 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 | ||
14 | export interface Job { | 16 | export 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..76e0d6f2d 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts | |||
@@ -46,7 +46,7 @@ export interface ServerConfig { | |||
46 | } | 46 | } |
47 | 47 | ||
48 | signup: { | 48 | signup: { |
49 | allowed: boolean, | 49 | allowed: boolean |
50 | allowedForCurrentIP: boolean | 50 | allowedForCurrentIP: boolean |
51 | requiresEmailVerification: boolean | 51 | requiresEmailVerification: boolean |
52 | } | 52 | } |
@@ -97,7 +97,7 @@ export interface ServerConfig { | |||
97 | max: number | 97 | max: number |
98 | } | 98 | } |
99 | extensions: string[] | 99 | extensions: string[] |
100 | }, | 100 | } |
101 | file: { | 101 | file: { |
102 | extensions: string[] | 102 | extensions: string[] |
103 | } | 103 | } |
@@ -107,7 +107,7 @@ export interface ServerConfig { | |||
107 | file: { | 107 | file: { |
108 | size: { | 108 | size: { |
109 | max: number | 109 | max: number |
110 | }, | 110 | } |
111 | extensions: string[] | 111 | extensions: string[] |
112 | } | 112 | } |
113 | } | 113 | } |
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 @@ | |||
1 | import { VideoRedundancyStrategy } from '../redundancy' | 1 | import { VideoRedundancyStrategyWithManual } from '../redundancy' |
2 | 2 | ||
3 | export interface ServerStats { | 3 | export 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 | 19 | export 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 | 10 | export const USER_ROLE_LABELS: { [ id in UserRole ]: string } = { |
11 | export 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 | 16 | const userRoleRights: { [ id in UserRole ]: UserRight[] } = { |
18 | const 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 @@ | |||
1 | import { Account } from '../actors' | 1 | import { Account } from '../actors' |
2 | import { VideoChannel } from '../videos/channel/video-channel.model' | 2 | import { VideoChannel } from '../videos/channel/video-channel.model' |
3 | import { VideoPlaylist } from '../videos/playlist/video-playlist.model' | ||
4 | import { UserRole } from './user-role' | 3 | import { UserRole } from './user-role' |
5 | import { NSFWPolicyType } from '../videos/nsfw-policy.type' | 4 | import { NSFWPolicyType } from '../videos/nsfw-policy.type' |
6 | import { UserNotificationSetting } from './user-notification-setting.model' | 5 | import { 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 @@ | |||
1 | export type VideoTranscodingFPS = { | 1 | export 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 @@ | |||
1 | import { AccountSummary, VideoChannelSummary, VideoResolution, VideoState } from '../../index' | 1 | import { AccountSummary, VideoChannelSummary, VideoState } from '../../index' |
2 | import { Account } from '../actors' | 2 | import { Account } from '../actors' |
3 | import { VideoChannel } from './channel/video-channel.model' | 3 | import { VideoChannel } from './channel/video-channel.model' |
4 | import { VideoPrivacy } from './video-privacy.enum' | 4 | import { VideoPrivacy } from './video-privacy.enum' |