aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/activitypub/activity.ts135
-rw-r--r--shared/models/activitypub/activitypub-actor.ts34
-rw-r--r--shared/models/activitypub/activitypub-collection.ts9
-rw-r--r--shared/models/activitypub/activitypub-ordered-collection.ts10
-rw-r--r--shared/models/activitypub/activitypub-root.ts5
-rw-r--r--shared/models/activitypub/activitypub-signature.ts6
-rw-r--r--shared/models/activitypub/context.ts16
-rw-r--r--shared/models/activitypub/index.ts9
-rw-r--r--shared/models/activitypub/objects/abuse-object.ts15
-rw-r--r--shared/models/activitypub/objects/activitypub-object.ts17
-rw-r--r--shared/models/activitypub/objects/cache-file-object.ts9
-rw-r--r--shared/models/activitypub/objects/common-objects.ts130
-rw-r--r--shared/models/activitypub/objects/index.ts9
-rw-r--r--shared/models/activitypub/objects/playlist-element-object.ts10
-rw-r--r--shared/models/activitypub/objects/playlist-object.ts29
-rw-r--r--shared/models/activitypub/objects/video-comment-object.ts16
-rw-r--r--shared/models/activitypub/objects/video-object.ts74
-rw-r--r--shared/models/activitypub/objects/watch-action-object.ts22
-rw-r--r--shared/models/activitypub/webfinger.ts9
-rw-r--r--shared/models/actors/account.model.ts22
-rw-r--r--shared/models/actors/actor-image.model.ts9
-rw-r--r--shared/models/actors/actor-image.type.ts4
-rw-r--r--shared/models/actors/actor.model.ts13
-rw-r--r--shared/models/actors/custom-page.model.ts3
-rw-r--r--shared/models/actors/follow.model.ts13
-rw-r--r--shared/models/actors/index.ts6
-rw-r--r--shared/models/bulk/bulk-remove-comments-of-body.model.ts4
-rw-r--r--shared/models/bulk/index.ts1
-rw-r--r--shared/models/common/index.ts1
-rw-r--r--shared/models/common/result-list.model.ts8
-rw-r--r--shared/models/custom-markup/custom-markup-data.model.ts58
-rw-r--r--shared/models/custom-markup/index.ts1
-rw-r--r--shared/models/feeds/feed-format.enum.ts5
-rw-r--r--shared/models/feeds/index.ts1
-rw-r--r--shared/models/http/http-error-codes.ts364
-rw-r--r--shared/models/http/http-methods.ts21
-rw-r--r--shared/models/http/index.ts2
-rw-r--r--shared/models/index.ts19
-rw-r--r--shared/models/joinpeertube/index.ts1
-rw-r--r--shared/models/joinpeertube/versions.model.ts5
-rw-r--r--shared/models/metrics/index.ts1
-rw-r--r--shared/models/metrics/playback-metric-create.model.ts22
-rw-r--r--shared/models/moderation/abuse/abuse-create.model.ts21
-rw-r--r--shared/models/moderation/abuse/abuse-filter.type.ts1
-rw-r--r--shared/models/moderation/abuse/abuse-message.model.ts10
-rw-r--r--shared/models/moderation/abuse/abuse-reason.model.ts20
-rw-r--r--shared/models/moderation/abuse/abuse-state.model.ts5
-rw-r--r--shared/models/moderation/abuse/abuse-update.model.ts7
-rw-r--r--shared/models/moderation/abuse/abuse-video-is.type.ts1
-rw-r--r--shared/models/moderation/abuse/abuse.model.ts70
-rw-r--r--shared/models/moderation/abuse/index.ts8
-rw-r--r--shared/models/moderation/account-block.model.ts7
-rw-r--r--shared/models/moderation/block-status.model.ts15
-rw-r--r--shared/models/moderation/index.ts4
-rw-r--r--shared/models/moderation/server-block.model.ts9
-rw-r--r--shared/models/nodeinfo/index.ts1
-rw-r--r--shared/models/nodeinfo/nodeinfo.model.ts117
-rw-r--r--shared/models/overviews/index.ts1
-rw-r--r--shared/models/overviews/videos-overview.model.ts24
-rw-r--r--shared/models/plugins/client/client-hook.model.ts195
-rw-r--r--shared/models/plugins/client/index.ts8
-rw-r--r--shared/models/plugins/client/plugin-client-scope.type.ts11
-rw-r--r--shared/models/plugins/client/plugin-element-placeholder.type.ts4
-rw-r--r--shared/models/plugins/client/plugin-selector-id.type.ts10
-rw-r--r--shared/models/plugins/client/register-client-form-field.model.ts30
-rw-r--r--shared/models/plugins/client/register-client-hook.model.ts7
-rw-r--r--shared/models/plugins/client/register-client-route.model.ts7
-rw-r--r--shared/models/plugins/client/register-client-settings-script.model.ts8
-rw-r--r--shared/models/plugins/hook-type.enum.ts5
-rw-r--r--shared/models/plugins/index.ts6
-rw-r--r--shared/models/plugins/plugin-index/index.ts3
-rw-r--r--shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts10
-rw-r--r--shared/models/plugins/plugin-index/peertube-plugin-index.model.ts16
-rw-r--r--shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts10
-rw-r--r--shared/models/plugins/plugin-package-json.model.ts29
-rw-r--r--shared/models/plugins/plugin.type.ts4
-rw-r--r--shared/models/plugins/server/api/index.ts3
-rw-r--r--shared/models/plugins/server/api/install-plugin.model.ts5
-rw-r--r--shared/models/plugins/server/api/manage-plugin.model.ts3
-rw-r--r--shared/models/plugins/server/api/peertube-plugin.model.ts16
-rw-r--r--shared/models/plugins/server/index.ts6
-rw-r--r--shared/models/plugins/server/managers/index.ts9
-rw-r--r--shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts12
-rw-r--r--shared/models/plugins/server/managers/plugin-settings-manager.model.ts17
-rw-r--r--shared/models/plugins/server/managers/plugin-storage-manager.model.ts5
-rw-r--r--shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts13
-rw-r--r--shared/models/plugins/server/managers/plugin-video-category-manager.model.ts13
-rw-r--r--shared/models/plugins/server/managers/plugin-video-language-manager.model.ts13
-rw-r--r--shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts13
-rw-r--r--shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts13
-rw-r--r--shared/models/plugins/server/plugin-constant-manager.model.ts7
-rw-r--r--shared/models/plugins/server/plugin-translation.model.ts5
-rw-r--r--shared/models/plugins/server/register-server-hook.model.ts7
-rw-r--r--shared/models/plugins/server/server-hook.model.ts221
-rw-r--r--shared/models/plugins/server/settings/index.ts2
-rw-r--r--shared/models/plugins/server/settings/public-server.setting.ts5
-rw-r--r--shared/models/plugins/server/settings/register-server-setting.model.ts12
-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-config-filter.type.ts1
-rw-r--r--shared/models/redundancy/video-redundancy.model.ts35
-rw-r--r--shared/models/redundancy/videos-redundancy-strategy.model.ts23
-rw-r--r--shared/models/runners/abort-runner-job-body.model.ts6
-rw-r--r--shared/models/runners/accept-runner-job-body.model.ts3
-rw-r--r--shared/models/runners/accept-runner-job-result.model.ts6
-rw-r--r--shared/models/runners/error-runner-job-body.model.ts6
-rw-r--r--shared/models/runners/index.ts21
-rw-r--r--shared/models/runners/list-runner-jobs-query.model.ts9
-rw-r--r--shared/models/runners/list-runner-registration-tokens.model.ts5
-rw-r--r--shared/models/runners/list-runners-query.model.ts5
-rw-r--r--shared/models/runners/register-runner-body.model.ts6
-rw-r--r--shared/models/runners/register-runner-result.model.ts4
-rw-r--r--shared/models/runners/request-runner-job-body.model.ts3
-rw-r--r--shared/models/runners/request-runner-job-result.model.ts10
-rw-r--r--shared/models/runners/runner-job-payload.model.ts79
-rw-r--r--shared/models/runners/runner-job-private-payload.model.ts45
-rw-r--r--shared/models/runners/runner-job-state.model.ts11
-rw-r--r--shared/models/runners/runner-job-success-body.model.ts46
-rw-r--r--shared/models/runners/runner-job-type.type.ts6
-rw-r--r--shared/models/runners/runner-job-update-body.model.ts28
-rw-r--r--shared/models/runners/runner-job.model.ts45
-rw-r--r--shared/models/runners/runner-registration-token.ts10
-rw-r--r--shared/models/runners/runner.model.ts12
-rw-r--r--shared/models/runners/unregister-runner-body.model.ts3
-rw-r--r--shared/models/search/boolean-both-query.model.ts2
-rw-r--r--shared/models/search/index.ts6
-rw-r--r--shared/models/search/search-target-query.model.ts5
-rw-r--r--shared/models/search/video-channels-search-query.model.ts18
-rw-r--r--shared/models/search/video-playlists-search-query.model.ts20
-rw-r--r--shared/models/search/videos-common-query.model.ts45
-rw-r--r--shared/models/search/videos-search-query.model.ts26
-rw-r--r--shared/models/server/about.model.ts20
-rw-r--r--shared/models/server/broadcast-message-level.type.ts1
-rw-r--r--shared/models/server/client-log-create.model.ts11
-rw-r--r--shared/models/server/client-log-level.type.ts1
-rw-r--r--shared/models/server/contact-form.model.ts6
-rw-r--r--shared/models/server/custom-config.model.ts259
-rw-r--r--shared/models/server/debug.model.ts12
-rw-r--r--shared/models/server/emailer.model.ts49
-rw-r--r--shared/models/server/index.ts16
-rw-r--r--shared/models/server/job.model.ts304
-rw-r--r--shared/models/server/peertube-problem-document.model.ts32
-rw-r--r--shared/models/server/server-config.model.ts305
-rw-r--r--shared/models/server/server-debug.model.ts4
-rw-r--r--shared/models/server/server-error-code.enum.ts89
-rw-r--r--shared/models/server/server-follow-create.model.ts4
-rw-r--r--shared/models/server/server-log-level.type.ts1
-rw-r--r--shared/models/server/server-stats.model.ts47
-rw-r--r--shared/models/tokens/index.ts1
-rw-r--r--shared/models/tokens/oauth-client-local.model.ts4
-rw-r--r--shared/models/users/index.ts16
-rw-r--r--shared/models/users/registration/index.ts5
-rw-r--r--shared/models/users/registration/user-register.model.ts12
-rw-r--r--shared/models/users/registration/user-registration-request.model.ts5
-rw-r--r--shared/models/users/registration/user-registration-state.model.ts5
-rw-r--r--shared/models/users/registration/user-registration-update-state.model.ts4
-rw-r--r--shared/models/users/registration/user-registration.model.ts29
-rw-r--r--shared/models/users/two-factor-enable-result.model.ts7
-rw-r--r--shared/models/users/user-create-result.model.ts7
-rw-r--r--shared/models/users/user-create.model.ts13
-rw-r--r--shared/models/users/user-flag.model.ts4
-rw-r--r--shared/models/users/user-login.model.ts5
-rw-r--r--shared/models/users/user-notification-setting.model.ts32
-rw-r--r--shared/models/users/user-notification.model.ts138
-rw-r--r--shared/models/users/user-refresh-token.model.ts4
-rw-r--r--shared/models/users/user-right.enum.ts51
-rw-r--r--shared/models/users/user-role.ts6
-rw-r--r--shared/models/users/user-scoped-token.ts5
-rw-r--r--shared/models/users/user-update-me.model.ts26
-rw-r--r--shared/models/users/user-update.model.ts13
-rw-r--r--shared/models/users/user-video-quota.model.ts4
-rw-r--r--shared/models/users/user.model.ts78
-rw-r--r--shared/models/videos/blacklist/index.ts3
-rw-r--r--shared/models/videos/blacklist/video-blacklist-create.model.ts4
-rw-r--r--shared/models/videos/blacklist/video-blacklist-update.model.ts3
-rw-r--r--shared/models/videos/blacklist/video-blacklist.model.ts18
-rw-r--r--shared/models/videos/caption/index.ts2
-rw-r--r--shared/models/videos/caption/video-caption-update.model.ts4
-rw-r--r--shared/models/videos/caption/video-caption.model.ts7
-rw-r--r--shared/models/videos/change-ownership/index.ts3
-rw-r--r--shared/models/videos/change-ownership/video-change-ownership-accept.model.ts3
-rw-r--r--shared/models/videos/change-ownership/video-change-ownership-create.model.ts3
-rw-r--r--shared/models/videos/change-ownership/video-change-ownership.model.ts17
-rw-r--r--shared/models/videos/channel-sync/index.ts3
-rw-r--r--shared/models/videos/channel-sync/video-channel-sync-create.model.ts4
-rw-r--r--shared/models/videos/channel-sync/video-channel-sync-state.enum.ts6
-rw-r--r--shared/models/videos/channel-sync/video-channel-sync.model.ts14
-rw-r--r--shared/models/videos/channel/index.ts4
-rw-r--r--shared/models/videos/channel/video-channel-create-result.model.ts3
-rw-r--r--shared/models/videos/channel/video-channel-create.model.ts6
-rw-r--r--shared/models/videos/channel/video-channel-update.model.ts7
-rw-r--r--shared/models/videos/channel/video-channel.model.ts34
-rw-r--r--shared/models/videos/comment/index.ts2
-rw-r--r--shared/models/videos/comment/video-comment-create.model.ts3
-rw-r--r--shared/models/videos/comment/video-comment.model.ts45
-rw-r--r--shared/models/videos/file/index.ts3
-rw-r--r--shared/models/videos/file/video-file-metadata.model.ts13
-rw-r--r--shared/models/videos/file/video-file.model.ts23
-rw-r--r--shared/models/videos/file/video-resolution.enum.ts11
-rw-r--r--shared/models/videos/import/index.ts4
-rw-r--r--shared/models/videos/import/video-import-create.model.ts9
-rw-r--r--shared/models/videos/import/video-import-state.enum.ts8
-rw-r--r--shared/models/videos/import/video-import.model.ts24
-rw-r--r--shared/models/videos/import/videos-import-in-channel-create.model.ts4
-rw-r--r--shared/models/videos/index.ts42
-rw-r--r--shared/models/videos/live/index.ts8
-rw-r--r--shared/models/videos/live/live-video-create.model.ts11
-rw-r--r--shared/models/videos/live/live-video-error.enum.ts9
-rw-r--r--shared/models/videos/live/live-video-event-payload.model.ts7
-rw-r--r--shared/models/videos/live/live-video-event.type.ts1
-rw-r--r--shared/models/videos/live/live-video-latency-mode.enum.ts5
-rw-r--r--shared/models/videos/live/live-video-session.model.ts22
-rw-r--r--shared/models/videos/live/live-video-update.model.ts9
-rw-r--r--shared/models/videos/live/live-video.model.ts14
-rw-r--r--shared/models/videos/nsfw-policy.type.ts1
-rw-r--r--shared/models/videos/playlist/index.ts12
-rw-r--r--shared/models/videos/playlist/video-exist-in-playlist.model.ts18
-rw-r--r--shared/models/videos/playlist/video-playlist-create-result.model.ts5
-rw-r--r--shared/models/videos/playlist/video-playlist-create.model.ts11
-rw-r--r--shared/models/videos/playlist/video-playlist-element-create-result.model.ts3
-rw-r--r--shared/models/videos/playlist/video-playlist-element-create.model.ts6
-rw-r--r--shared/models/videos/playlist/video-playlist-element-update.model.ts4
-rw-r--r--shared/models/videos/playlist/video-playlist-element.model.ts19
-rw-r--r--shared/models/videos/playlist/video-playlist-privacy.model.ts5
-rw-r--r--shared/models/videos/playlist/video-playlist-reorder.model.ts5
-rw-r--r--shared/models/videos/playlist/video-playlist-type.model.ts4
-rw-r--r--shared/models/videos/playlist/video-playlist-update.model.ts10
-rw-r--r--shared/models/videos/playlist/video-playlist.model.ts34
-rw-r--r--shared/models/videos/rate/account-video-rate.model.ts7
-rw-r--r--shared/models/videos/rate/index.ts5
-rw-r--r--shared/models/videos/rate/user-video-rate-update.model.ts5
-rw-r--r--shared/models/videos/rate/user-video-rate.model.ts6
-rw-r--r--shared/models/videos/rate/user-video-rate.type.ts1
-rw-r--r--shared/models/videos/stats/index.ts6
-rw-r--r--shared/models/videos/stats/video-stats-overall-query.model.ts4
-rw-r--r--shared/models/videos/stats/video-stats-overall.model.ts14
-rw-r--r--shared/models/videos/stats/video-stats-retention.model.ts6
-rw-r--r--shared/models/videos/stats/video-stats-timeserie-metric.type.ts1
-rw-r--r--shared/models/videos/stats/video-stats-timeserie-query.model.ts4
-rw-r--r--shared/models/videos/stats/video-stats-timeserie.model.ts8
-rw-r--r--shared/models/videos/storyboard.model.ts11
-rw-r--r--shared/models/videos/studio/index.ts1
-rw-r--r--shared/models/videos/studio/video-studio-create-edit.model.ts60
-rw-r--r--shared/models/videos/thumbnail.type.ts4
-rw-r--r--shared/models/videos/transcoding/index.ts3
-rw-r--r--shared/models/videos/transcoding/video-transcoding-create.model.ts5
-rw-r--r--shared/models/videos/transcoding/video-transcoding-fps.model.ts9
-rw-r--r--shared/models/videos/transcoding/video-transcoding.model.ts67
-rw-r--r--shared/models/videos/video-constant.model.ts5
-rw-r--r--shared/models/videos/video-create-result.model.ts5
-rw-r--r--shared/models/videos/video-create.model.ts25
-rw-r--r--shared/models/videos/video-include.enum.ts8
-rw-r--r--shared/models/videos/video-password.model.ts7
-rw-r--r--shared/models/videos/video-privacy.enum.ts7
-rw-r--r--shared/models/videos/video-rate.type.ts1
-rw-r--r--shared/models/videos/video-schedule-update.model.ts6
-rw-r--r--shared/models/videos/video-sort-field.type.ts13
-rw-r--r--shared/models/videos/video-source.ts4
-rw-r--r--shared/models/videos/video-state.enum.ts11
-rw-r--r--shared/models/videos/video-storage.enum.ts4
-rw-r--r--shared/models/videos/video-streaming-playlist.model.ts15
-rw-r--r--shared/models/videos/video-streaming-playlist.type.ts3
-rw-r--r--shared/models/videos/video-token.model.ts6
-rw-r--r--shared/models/videos/video-update.model.ts25
-rw-r--r--shared/models/videos/video-view.model.ts6
-rw-r--r--shared/models/videos/video.model.ts99
266 files changed, 0 insertions, 5461 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts
deleted file mode 100644
index 10cf53ead..000000000
--- a/shared/models/activitypub/activity.ts
+++ /dev/null
@@ -1,135 +0,0 @@
1import { ActivityPubActor } from './activitypub-actor'
2import { ActivityPubSignature } from './activitypub-signature'
3import {
4 ActivityFlagReasonObject,
5 ActivityObject,
6 APObjectId,
7 CacheFileObject,
8 PlaylistObject,
9 VideoCommentObject,
10 VideoObject,
11 WatchActionObject
12} from './objects'
13
14export type ActivityUpdateObject =
15 Extract<ActivityObject, VideoObject | CacheFileObject | PlaylistObject | ActivityPubActor | string> | ActivityPubActor
16
17// Cannot Extract from Activity because of circular reference
18export type ActivityUndoObject =
19 ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate<CacheFileObject | string> | ActivityAnnounce
20
21export type ActivityCreateObject =
22 Extract<ActivityObject, VideoObject | CacheFileObject | WatchActionObject | VideoCommentObject | PlaylistObject | string>
23
24export type Activity =
25 ActivityCreate<ActivityCreateObject> |
26 ActivityUpdate<ActivityUpdateObject> |
27 ActivityDelete |
28 ActivityFollow |
29 ActivityAccept |
30 ActivityAnnounce |
31 ActivityUndo<ActivityUndoObject> |
32 ActivityLike |
33 ActivityReject |
34 ActivityView |
35 ActivityDislike |
36 ActivityFlag
37
38export type ActivityType =
39 'Create' |
40 'Update' |
41 'Delete' |
42 'Follow' |
43 'Accept' |
44 'Announce' |
45 'Undo' |
46 'Like' |
47 'Reject' |
48 'View' |
49 'Dislike' |
50 'Flag'
51
52export interface ActivityAudience {
53 to: string[]
54 cc: string[]
55}
56
57export interface BaseActivity {
58 '@context'?: any[]
59 id: string
60 to?: string[]
61 cc?: string[]
62 actor: string | ActivityPubActor
63 type: ActivityType
64 signature?: ActivityPubSignature
65}
66
67export interface ActivityCreate <T extends ActivityCreateObject> extends BaseActivity {
68 type: 'Create'
69 object: T
70}
71
72export interface ActivityUpdate <T extends ActivityUpdateObject> extends BaseActivity {
73 type: 'Update'
74 object: T
75}
76
77export interface ActivityDelete extends BaseActivity {
78 type: 'Delete'
79 object: APObjectId
80}
81
82export interface ActivityFollow extends BaseActivity {
83 type: 'Follow'
84 object: string
85}
86
87export interface ActivityAccept extends BaseActivity {
88 type: 'Accept'
89 object: ActivityFollow
90}
91
92export interface ActivityReject extends BaseActivity {
93 type: 'Reject'
94 object: ActivityFollow
95}
96
97export interface ActivityAnnounce extends BaseActivity {
98 type: 'Announce'
99 object: APObjectId
100}
101
102export interface ActivityUndo <T extends ActivityUndoObject> extends BaseActivity {
103 type: 'Undo'
104 object: T
105}
106
107export interface ActivityLike extends BaseActivity {
108 type: 'Like'
109 object: APObjectId
110}
111
112export interface ActivityView extends BaseActivity {
113 type: 'View'
114 actor: string
115 object: APObjectId
116
117 // If sending a "viewer" event
118 expires?: string
119}
120
121export interface ActivityDislike extends BaseActivity {
122 id: string
123 type: 'Dislike'
124 actor: string
125 object: APObjectId
126}
127
128export interface ActivityFlag extends BaseActivity {
129 type: 'Flag'
130 content: string
131 object: APObjectId | APObjectId[]
132 tag?: ActivityFlagReasonObject[]
133 startAt?: number
134 endAt?: number
135}
diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.ts
deleted file mode 100644
index b86bcb764..000000000
--- a/shared/models/activitypub/activitypub-actor.ts
+++ /dev/null
@@ -1,34 +0,0 @@
1import { ActivityIconObject, ActivityPubAttributedTo } from './objects/common-objects'
2
3export type ActivityPubActorType = 'Person' | 'Application' | 'Group' | 'Service' | 'Organization'
4
5export interface ActivityPubActor {
6 '@context': any[]
7 type: ActivityPubActorType
8 id: string
9 following: string
10 followers: string
11 playlists?: string
12 inbox: string
13 outbox: string
14 preferredUsername: string
15 url: string
16 name: string
17 endpoints: {
18 sharedInbox: string
19 }
20 summary: string
21 attributedTo: ActivityPubAttributedTo[]
22
23 support?: string
24 publicKey: {
25 id: string
26 owner: string
27 publicKeyPem: string
28 }
29
30 image?: ActivityIconObject | ActivityIconObject[]
31 icon?: ActivityIconObject | ActivityIconObject[]
32
33 published?: string
34}
diff --git a/shared/models/activitypub/activitypub-collection.ts b/shared/models/activitypub/activitypub-collection.ts
deleted file mode 100644
index 60a6a6b04..000000000
--- a/shared/models/activitypub/activitypub-collection.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1import { Activity } from './activity'
2
3export interface ActivityPubCollection {
4 '@context': string[]
5 type: 'Collection' | 'CollectionPage'
6 totalItems: number
7 partOf?: string
8 items: Activity[]
9}
diff --git a/shared/models/activitypub/activitypub-ordered-collection.ts b/shared/models/activitypub/activitypub-ordered-collection.ts
deleted file mode 100644
index 3de0890bb..000000000
--- a/shared/models/activitypub/activitypub-ordered-collection.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1export interface ActivityPubOrderedCollection<T> {
2 '@context': string[]
3 type: 'OrderedCollection' | 'OrderedCollectionPage'
4 totalItems: number
5 orderedItems: T[]
6
7 partOf?: string
8 next?: string
9 first?: string
10}
diff --git a/shared/models/activitypub/activitypub-root.ts b/shared/models/activitypub/activitypub-root.ts
deleted file mode 100644
index 22dff83a2..000000000
--- a/shared/models/activitypub/activitypub-root.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1import { Activity } from './activity'
2import { ActivityPubCollection } from './activitypub-collection'
3import { ActivityPubOrderedCollection } from './activitypub-ordered-collection'
4
5export type RootActivity = Activity | ActivityPubCollection | ActivityPubOrderedCollection<Activity>
diff --git a/shared/models/activitypub/activitypub-signature.ts b/shared/models/activitypub/activitypub-signature.ts
deleted file mode 100644
index fafdc246d..000000000
--- a/shared/models/activitypub/activitypub-signature.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface ActivityPubSignature {
2 type: string
3 created: Date
4 creator: string
5 signatureValue: string
6}
diff --git a/shared/models/activitypub/context.ts b/shared/models/activitypub/context.ts
deleted file mode 100644
index e9df38207..000000000
--- a/shared/models/activitypub/context.ts
+++ /dev/null
@@ -1,16 +0,0 @@
1export type ContextType =
2 'Video' |
3 'Comment' |
4 'Playlist' |
5 'Follow' |
6 'Reject' |
7 'Accept' |
8 'View' |
9 'Announce' |
10 'CacheFile' |
11 'Delete' |
12 'Rate' |
13 'Flag' |
14 'Actor' |
15 'Collection' |
16 'WatchAction'
diff --git a/shared/models/activitypub/index.ts b/shared/models/activitypub/index.ts
deleted file mode 100644
index fa07b6a64..000000000
--- a/shared/models/activitypub/index.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1export * from './objects'
2export * from './activity'
3export * from './activitypub-actor'
4export * from './activitypub-collection'
5export * from './activitypub-ordered-collection'
6export * from './activitypub-root'
7export * from './activitypub-signature'
8export * from './context'
9export * from './webfinger'
diff --git a/shared/models/activitypub/objects/abuse-object.ts b/shared/models/activitypub/objects/abuse-object.ts
deleted file mode 100644
index d938b8693..000000000
--- a/shared/models/activitypub/objects/abuse-object.ts
+++ /dev/null
@@ -1,15 +0,0 @@
1import { ActivityFlagReasonObject } from './common-objects'
2
3export interface AbuseObject {
4 type: 'Flag'
5
6 content: string
7 mediaType: 'text/markdown'
8
9 object: string | string[]
10
11 tag?: ActivityFlagReasonObject[]
12
13 startAt?: number
14 endAt?: number
15}
diff --git a/shared/models/activitypub/objects/activitypub-object.ts b/shared/models/activitypub/objects/activitypub-object.ts
deleted file mode 100644
index faeac2618..000000000
--- a/shared/models/activitypub/objects/activitypub-object.ts
+++ /dev/null
@@ -1,17 +0,0 @@
1import { AbuseObject } from './abuse-object'
2import { CacheFileObject } from './cache-file-object'
3import { PlaylistObject } from './playlist-object'
4import { VideoCommentObject } from './video-comment-object'
5import { VideoObject } from './video-object'
6import { WatchActionObject } from './watch-action-object'
7
8export type ActivityObject =
9 VideoObject |
10 AbuseObject |
11 VideoCommentObject |
12 CacheFileObject |
13 PlaylistObject |
14 WatchActionObject |
15 string
16
17export type APObjectId = string | { id: string }
diff --git a/shared/models/activitypub/objects/cache-file-object.ts b/shared/models/activitypub/objects/cache-file-object.ts
deleted file mode 100644
index 19a817582..000000000
--- a/shared/models/activitypub/objects/cache-file-object.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1import { ActivityVideoUrlObject, ActivityPlaylistUrlObject } from './common-objects'
2
3export interface CacheFileObject {
4 id: string
5 type: 'CacheFile'
6 object: string
7 expires: string
8 url: ActivityVideoUrlObject | ActivityPlaylistUrlObject
9}
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
deleted file mode 100644
index db9c73658..000000000
--- a/shared/models/activitypub/objects/common-objects.ts
+++ /dev/null
@@ -1,130 +0,0 @@
1import { AbusePredefinedReasonsString } from '../../moderation/abuse/abuse-reason.model'
2
3export interface ActivityIdentifierObject {
4 identifier: string
5 name: string
6 url?: string
7}
8
9export interface ActivityIconObject {
10 type: 'Image'
11 url: string
12 mediaType: string
13 width?: number
14 height?: number
15}
16
17export type ActivityVideoUrlObject = {
18 type: 'Link'
19 mediaType: 'video/mp4' | 'video/webm' | 'video/ogg'
20 href: string
21 height: number
22 size: number
23 fps: number
24}
25
26export type ActivityPlaylistSegmentHashesObject = {
27 type: 'Link'
28 name: 'sha256'
29 mediaType: 'application/json'
30 href: string
31}
32
33export type ActivityVideoFileMetadataUrlObject = {
34 type: 'Link'
35 rel: [ 'metadata', any ]
36 mediaType: 'application/json'
37 height: number
38 href: string
39 fps: number
40}
41
42export type ActivityTrackerUrlObject = {
43 type: 'Link'
44 rel: [ 'tracker', 'websocket' | 'http' ]
45 name: string
46 href: string
47}
48
49export type ActivityStreamingPlaylistInfohashesObject = {
50 type: 'Infohash'
51 name: string
52}
53
54export type ActivityPlaylistUrlObject = {
55 type: 'Link'
56 mediaType: 'application/x-mpegURL'
57 href: string
58 tag?: ActivityTagObject[]
59}
60
61export type ActivityBitTorrentUrlObject = {
62 type: 'Link'
63 mediaType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
64 href: string
65 height: number
66}
67
68export type ActivityMagnetUrlObject = {
69 type: 'Link'
70 mediaType: 'application/x-bittorrent;x-scheme-handler/magnet'
71 href: string
72 height: number
73}
74
75export type ActivityHtmlUrlObject = {
76 type: 'Link'
77 mediaType: 'text/html'
78 href: string
79}
80
81export interface ActivityHashTagObject {
82 type: 'Hashtag'
83 href?: string
84 name: string
85}
86
87export interface ActivityMentionObject {
88 type: 'Mention'
89 href?: string
90 name: string
91}
92
93export interface ActivityFlagReasonObject {
94 type: 'Hashtag'
95 name: AbusePredefinedReasonsString
96}
97
98export type ActivityTagObject =
99 ActivityPlaylistSegmentHashesObject
100 | ActivityStreamingPlaylistInfohashesObject
101 | ActivityVideoUrlObject
102 | ActivityHashTagObject
103 | ActivityMentionObject
104 | ActivityBitTorrentUrlObject
105 | ActivityMagnetUrlObject
106 | ActivityVideoFileMetadataUrlObject
107
108export type ActivityUrlObject =
109 ActivityVideoUrlObject
110 | ActivityPlaylistUrlObject
111 | ActivityBitTorrentUrlObject
112 | ActivityMagnetUrlObject
113 | ActivityHtmlUrlObject
114 | ActivityVideoFileMetadataUrlObject
115 | ActivityTrackerUrlObject
116
117export type ActivityPubAttributedTo = { type: 'Group' | 'Person', id: string } | string
118
119export interface ActivityTombstoneObject {
120 '@context'?: any
121 id: string
122 url?: string
123 type: 'Tombstone'
124 name?: string
125 formerType?: string
126 inReplyTo?: string
127 published: string
128 updated: string
129 deleted: string
130}
diff --git a/shared/models/activitypub/objects/index.ts b/shared/models/activitypub/objects/index.ts
deleted file mode 100644
index 753e02003..000000000
--- a/shared/models/activitypub/objects/index.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1export * from './abuse-object'
2export * from './activitypub-object'
3export * from './cache-file-object'
4export * from './common-objects'
5export * from './playlist-element-object'
6export * from './playlist-object'
7export * from './video-comment-object'
8export * from './video-object'
9export * from './watch-action-object'
diff --git a/shared/models/activitypub/objects/playlist-element-object.ts b/shared/models/activitypub/objects/playlist-element-object.ts
deleted file mode 100644
index b85e4fe19..000000000
--- a/shared/models/activitypub/objects/playlist-element-object.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1export interface PlaylistElementObject {
2 id: string
3 type: 'PlaylistElement'
4
5 url: string
6 position: number
7
8 startTimestamp?: number
9 stopTimestamp?: number
10}
diff --git a/shared/models/activitypub/objects/playlist-object.ts b/shared/models/activitypub/objects/playlist-object.ts
deleted file mode 100644
index 0ccb71828..000000000
--- a/shared/models/activitypub/objects/playlist-object.ts
+++ /dev/null
@@ -1,29 +0,0 @@
1import { ActivityIconObject, ActivityPubAttributedTo } from './common-objects'
2
3export interface PlaylistObject {
4 id: string
5 type: 'Playlist'
6
7 name: string
8
9 content: string
10 mediaType: 'text/markdown'
11
12 uuid: string
13
14 totalItems: number
15 attributedTo: ActivityPubAttributedTo[]
16
17 icon?: ActivityIconObject
18
19 published: string
20 updated: string
21
22 orderedItems?: string[]
23
24 partOf?: string
25 next?: string
26 first?: string
27
28 to?: string[]
29}
diff --git a/shared/models/activitypub/objects/video-comment-object.ts b/shared/models/activitypub/objects/video-comment-object.ts
deleted file mode 100644
index fb1e6f8db..000000000
--- a/shared/models/activitypub/objects/video-comment-object.ts
+++ /dev/null
@@ -1,16 +0,0 @@
1import { ActivityPubAttributedTo, ActivityTagObject } from './common-objects'
2
3export interface VideoCommentObject {
4 type: 'Note'
5 id: string
6
7 content: string
8 mediaType: 'text/markdown'
9
10 inReplyTo: string
11 published: string
12 updated: string
13 url: string
14 attributedTo: ActivityPubAttributedTo
15 tag: ActivityTagObject[]
16}
diff --git a/shared/models/activitypub/objects/video-object.ts b/shared/models/activitypub/objects/video-object.ts
deleted file mode 100644
index 409504f0f..000000000
--- a/shared/models/activitypub/objects/video-object.ts
+++ /dev/null
@@ -1,74 +0,0 @@
1import {
2 ActivityIconObject,
3 ActivityIdentifierObject,
4 ActivityPubAttributedTo,
5 ActivityTagObject,
6 ActivityUrlObject
7} from './common-objects'
8import { LiveVideoLatencyMode, VideoState } from '../../videos'
9
10export interface VideoObject {
11 type: 'Video'
12 id: string
13 name: string
14 duration: string
15 uuid: string
16 tag: ActivityTagObject[]
17 category: ActivityIdentifierObject
18 licence: ActivityIdentifierObject
19 language: ActivityIdentifierObject
20 subtitleLanguage: ActivityIdentifierObject[]
21 views: number
22
23 sensitive: boolean
24
25 isLiveBroadcast: boolean
26 liveSaveReplay: boolean
27 permanentLive: boolean
28 latencyMode: LiveVideoLatencyMode
29
30 commentsEnabled: boolean
31 downloadEnabled: boolean
32 waitTranscoding: boolean
33 state: VideoState
34
35 published: string
36 originallyPublishedAt: string
37 updated: string
38 uploadDate: string
39
40 mediaType: 'text/markdown'
41 content: string
42
43 support: string
44
45 icon: ActivityIconObject[]
46
47 url: ActivityUrlObject[]
48
49 likes: string
50 dislikes: string
51 shares: string
52 comments: string
53
54 attributedTo: ActivityPubAttributedTo[]
55
56 preview?: ActivityPubStoryboard[]
57
58 to?: string[]
59 cc?: string[]
60}
61
62export interface ActivityPubStoryboard {
63 type: 'Image'
64 rel: [ 'storyboard' ]
65 url: {
66 href: string
67 mediaType: string
68 width: number
69 height: number
70 tileWidth: number
71 tileHeight: number
72 tileDuration: string
73 }[]
74}
diff --git a/shared/models/activitypub/objects/watch-action-object.ts b/shared/models/activitypub/objects/watch-action-object.ts
deleted file mode 100644
index ed336602f..000000000
--- a/shared/models/activitypub/objects/watch-action-object.ts
+++ /dev/null
@@ -1,22 +0,0 @@
1export interface WatchActionObject {
2 id: string
3 type: 'WatchAction'
4
5 startTime: string
6 endTime: string
7
8 location?: {
9 addressCountry: string
10 }
11
12 uuid: string
13 object: string
14 actionStatus: 'CompletedActionStatus'
15
16 duration: string
17
18 watchSections: {
19 startTimestamp: number
20 endTimestamp: number
21 }[]
22}
diff --git a/shared/models/activitypub/webfinger.ts b/shared/models/activitypub/webfinger.ts
deleted file mode 100644
index b94baf996..000000000
--- a/shared/models/activitypub/webfinger.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1export interface WebFingerData {
2 subject: string
3 aliases: string[]
4 links: {
5 rel: 'self'
6 type: 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
7 href: string
8 }[]
9}
diff --git a/shared/models/actors/account.model.ts b/shared/models/actors/account.model.ts
deleted file mode 100644
index 9fbec60ba..000000000
--- a/shared/models/actors/account.model.ts
+++ /dev/null
@@ -1,22 +0,0 @@
1import { ActorImage } from './actor-image.model'
2import { Actor } from './actor.model'
3
4export interface Account extends Actor {
5 displayName: string
6 description: string
7 avatars: ActorImage[]
8
9 updatedAt: Date | string
10
11 userId?: number
12}
13
14export interface AccountSummary {
15 id: number
16 name: string
17 displayName: string
18 url: string
19 host: string
20
21 avatars: ActorImage[]
22}
diff --git a/shared/models/actors/actor-image.model.ts b/shared/models/actors/actor-image.model.ts
deleted file mode 100644
index cfe44ac15..000000000
--- a/shared/models/actors/actor-image.model.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1export interface ActorImage {
2 width: number
3 path: string
4
5 url?: string
6
7 createdAt: Date | string
8 updatedAt: Date | string
9}
diff --git a/shared/models/actors/actor-image.type.ts b/shared/models/actors/actor-image.type.ts
deleted file mode 100644
index ac8eb6bf2..000000000
--- a/shared/models/actors/actor-image.type.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export const enum ActorImageType {
2 AVATAR = 1,
3 BANNER = 2
4}
diff --git a/shared/models/actors/actor.model.ts b/shared/models/actors/actor.model.ts
deleted file mode 100644
index ab0760263..000000000
--- a/shared/models/actors/actor.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { ActorImage } from './actor-image.model'
2
3export interface Actor {
4 id: number
5 url: string
6 name: string
7 host: string
8 followingCount: number
9 followersCount: number
10 createdAt: Date | string
11
12 avatars: ActorImage[]
13}
diff --git a/shared/models/actors/custom-page.model.ts b/shared/models/actors/custom-page.model.ts
deleted file mode 100644
index 1e33584c1..000000000
--- a/shared/models/actors/custom-page.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface CustomPage {
2 content: string
3}
diff --git a/shared/models/actors/follow.model.ts b/shared/models/actors/follow.model.ts
deleted file mode 100644
index 244d6d97e..000000000
--- a/shared/models/actors/follow.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { Actor } from './actor.model'
2
3export type FollowState = 'pending' | 'accepted' | 'rejected'
4
5export interface ActorFollow {
6 id: number
7 follower: Actor & { hostRedundancyAllowed: boolean }
8 following: Actor & { hostRedundancyAllowed: boolean }
9 score: number
10 state: FollowState
11 createdAt: Date
12 updatedAt: Date
13}
diff --git a/shared/models/actors/index.ts b/shared/models/actors/index.ts
deleted file mode 100644
index e03f168cd..000000000
--- a/shared/models/actors/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export * from './account.model'
2export * from './actor-image.model'
3export * from './actor-image.type'
4export * from './actor.model'
5export * from './custom-page.model'
6export * from './follow.model'
diff --git a/shared/models/bulk/bulk-remove-comments-of-body.model.ts b/shared/models/bulk/bulk-remove-comments-of-body.model.ts
deleted file mode 100644
index 31e018c2a..000000000
--- a/shared/models/bulk/bulk-remove-comments-of-body.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface BulkRemoveCommentsOfBody {
2 accountName: string
3 scope: 'my-videos' | 'instance'
4}
diff --git a/shared/models/bulk/index.ts b/shared/models/bulk/index.ts
deleted file mode 100644
index 168c8cd48..000000000
--- a/shared/models/bulk/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './bulk-remove-comments-of-body.model'
diff --git a/shared/models/common/index.ts b/shared/models/common/index.ts
deleted file mode 100644
index 4db85eff2..000000000
--- a/shared/models/common/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './result-list.model'
diff --git a/shared/models/common/result-list.model.ts b/shared/models/common/result-list.model.ts
deleted file mode 100644
index fcafcfb2f..000000000
--- a/shared/models/common/result-list.model.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1export interface ResultList<T> {
2 total: number
3 data: T[]
4}
5
6export interface ThreadsResultList <T> extends ResultList <T> {
7 totalNotDeletedComments: number
8}
diff --git a/shared/models/custom-markup/custom-markup-data.model.ts b/shared/models/custom-markup/custom-markup-data.model.ts
deleted file mode 100644
index 3e396052a..000000000
--- a/shared/models/custom-markup/custom-markup-data.model.ts
+++ /dev/null
@@ -1,58 +0,0 @@
1export type EmbedMarkupData = {
2 // Video or playlist uuid
3 uuid: string
4}
5
6export type VideoMiniatureMarkupData = {
7 // Video uuid
8 uuid: string
9
10 onlyDisplayTitle?: string // boolean
11}
12
13export type PlaylistMiniatureMarkupData = {
14 // Playlist uuid
15 uuid: string
16}
17
18export type ChannelMiniatureMarkupData = {
19 // Channel name (username)
20 name: string
21
22 displayLatestVideo?: string // boolean
23 displayDescription?: string // boolean
24}
25
26export type VideosListMarkupData = {
27 onlyDisplayTitle?: string // boolean
28 maxRows?: string // number
29
30 sort?: string
31 count?: string // number
32
33 categoryOneOf?: string // coma separated values, number[]
34 languageOneOf?: string // coma separated values
35
36 channelHandle?: string
37 accountHandle?: string
38
39 isLive?: string // number
40
41 onlyLocal?: string // boolean
42}
43
44export type ButtonMarkupData = {
45 theme: 'primary' | 'secondary'
46 href: string
47 label: string
48 blankTarget?: string // boolean
49}
50
51export type ContainerMarkupData = {
52 width?: string
53 title?: string
54 description?: string
55 layout?: 'row' | 'column'
56
57 justifyContent?: 'space-between' | 'normal' // default to 'space-between'
58}
diff --git a/shared/models/custom-markup/index.ts b/shared/models/custom-markup/index.ts
deleted file mode 100644
index 2898dfa90..000000000
--- a/shared/models/custom-markup/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './custom-markup-data.model'
diff --git a/shared/models/feeds/feed-format.enum.ts b/shared/models/feeds/feed-format.enum.ts
deleted file mode 100644
index d3d574331..000000000
--- a/shared/models/feeds/feed-format.enum.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export const enum FeedFormat {
2 RSS = 'xml',
3 ATOM = 'atom',
4 JSON = 'json'
5}
diff --git a/shared/models/feeds/index.ts b/shared/models/feeds/index.ts
deleted file mode 100644
index d56c8458c..000000000
--- a/shared/models/feeds/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './feed-format.enum'
diff --git a/shared/models/http/http-error-codes.ts b/shared/models/http/http-error-codes.ts
deleted file mode 100644
index 5ebff1cb5..000000000
--- a/shared/models/http/http-error-codes.ts
+++ /dev/null
@@ -1,364 +0,0 @@
1/**
2 * Hypertext Transfer Protocol (HTTP) response status codes.
3 * @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
4 *
5 * WebDAV and other codes useless with regards to PeerTube are not listed.
6 */
7export const enum HttpStatusCode {
8
9 /**
10 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1
11 *
12 * The server has received the request headers and the client should proceed to send the request body
13 * (in the case of a request for which a body needs to be sent; for example, a POST request).
14 * Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.
15 * To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request
16 * and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates
17 * the request should not be continued.
18 */
19 CONTINUE_100 = 100,
20
21 /**
22 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2
23 *
24 * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.
25 */
26 SWITCHING_PROTOCOLS_101 = 101,
27
28 /**
29 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1
30 *
31 * Standard response for successful HTTP requests. The actual response will depend on the request method used:
32 * GET: The resource has been fetched and is transmitted in the message body.
33 * HEAD: The entity headers are in the message body.
34 * POST: The resource describing the result of the action is transmitted in the message body.
35 * TRACE: The message body contains the request message as received by the server
36 */
37 OK_200 = 200,
38
39 /**
40 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2
41 *
42 * The request has been fulfilled, resulting in the creation of a new resource, typically after a PUT.
43 */
44 CREATED_201 = 201,
45
46 /**
47 * The request has been accepted for processing, but the processing has not been completed.
48 * The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
49 */
50 ACCEPTED_202 = 202,
51
52 /**
53 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5
54 *
55 * There is no content to send for this request, but the headers may be useful.
56 * The user-agent may update its cached headers for this resource with the new ones.
57 */
58 NO_CONTENT_204 = 204,
59
60 /**
61 * The server successfully processed the request, but is not returning any content.
62 * Unlike a 204 response, this response requires that the requester reset the document view.
63 */
64 RESET_CONTENT_205 = 205,
65
66 /**
67 * The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
68 * The range header is used by HTTP clients to enable resuming of interrupted downloads,
69 * or split a download into multiple simultaneous streams.
70 */
71 PARTIAL_CONTENT_206 = 206,
72
73 /**
74 * Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
75 * For example, this code could be used to present multiple video format options,
76 * to list files with different filename extensions, or to suggest word-sense disambiguation.
77 */
78 MULTIPLE_CHOICES_300 = 300,
79
80 /**
81 * This and all future requests should be directed to the given URI.
82 */
83 MOVED_PERMANENTLY_301 = 301,
84
85 /**
86 * This is an example of industry practice contradicting the standard.
87 * The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
88 * (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302
89 * with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307
90 * to distinguish between the two behaviours. However, some Web applications and frameworks
91 * use the 302 status code as if it were the 303.
92 */
93 FOUND_302 = 302,
94
95 /**
96 * SINCE HTTP/1.1
97 * The response to the request can be found under another URI using a GET method.
98 * When received in response to a POST (or PUT/DELETE), the client should presume that
99 * the server has received the data and should issue a redirect with a separate GET message.
100 */
101 SEE_OTHER_303 = 303,
102
103 /**
104 * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1
105 *
106 * Indicates that the resource has not been modified since the version specified by the request headers
107 * `If-Modified-Since` or `If-None-Match`.
108 * In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.
109 */
110 NOT_MODIFIED_304 = 304,
111
112 /**
113 * SINCE HTTP/1.1
114 * In this case, the request should be repeated with another URI; however, future requests should still use the original URI.
115 * In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the
116 * original request.
117 * For example, a POST request should be repeated using another POST request.
118 */
119 TEMPORARY_REDIRECT_307 = 307,
120
121 /**
122 * The request and all future requests should be repeated using another URI.
123 * 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
124 * So, for example, submitting a form to a permanently redirected resource may continue smoothly.
125 */
126 PERMANENT_REDIRECT_308 = 308,
127
128 /**
129 * The server cannot or will not process the request due to an apparent client error
130 * (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).
131 */
132 BAD_REQUEST_400 = 400,
133
134 /**
135 * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1
136 *
137 * Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet
138 * been provided. The response must include a `WWW-Authenticate` header field containing a challenge applicable to the
139 * requested resource. See Basic access authentication and Digest access authentication. 401 semantically means
140 * "unauthenticated",i.e. the user does not have the necessary credentials.
141 */
142 UNAUTHORIZED_401 = 401,
143
144 /**
145 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2
146 *
147 * Reserved for future use. The original intention was that this code might be used as part of some form of digital
148 * cash or micro payment scheme, but that has not happened, and this code is not usually used.
149 * Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
150 */
151 PAYMENT_REQUIRED_402 = 402,
152
153 /**
154 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3
155 *
156 * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to
157 * give proper response. Unlike 401, the client's identity is known to the server.
158 */
159 FORBIDDEN_403 = 403,
160
161 /**
162 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2
163 *
164 * The requested resource could not be found but may be available in the future.
165 * Subsequent requests by the client are permissible.
166 */
167 NOT_FOUND_404 = 404,
168
169 /**
170 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5
171 *
172 * A request method is not supported for the requested resource;
173 * for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.
174 */
175 METHOD_NOT_ALLOWED_405 = 405,
176
177 /**
178 * The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
179 */
180 NOT_ACCEPTABLE_406 = 406,
181
182 /**
183 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7
184 *
185 * This response is sent on an idle connection by some servers, even without any previous request by the client.
186 * It means that the server would like to shut down this unused connection. This response is used much more since
187 * some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also
188 * note that some servers merely shut down the connection without sending this message.
189 *
190 * @
191 */
192 REQUEST_TIMEOUT_408 = 408,
193
194 /**
195 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8
196 *
197 * Indicates that the request could not be processed because of conflict in the request,
198 * such as an edit conflict between multiple simultaneous updates.
199 *
200 * @see HttpStatusCode.UNPROCESSABLE_ENTITY_422 to denote a disabled feature
201 */
202 CONFLICT_409 = 409,
203
204 /**
205 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9
206 *
207 * Indicates that the resource requested is no longer available and will not be available again.
208 * This should be used when a resource has been intentionally removed and the resource should be purged.
209 * Upon receiving a 410 status code, the client should not request the resource in the future.
210 * Clients such as search engines should remove the resource from their indices.
211 * Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
212 */
213 GONE_410 = 410,
214
215 /**
216 * The request did not specify the length of its content, which is required by the requested resource.
217 */
218 LENGTH_REQUIRED_411 = 411,
219
220 /**
221 * The server does not meet one of the preconditions that the requester put on the request.
222 */
223 PRECONDITION_FAILED_412 = 412,
224
225 /**
226 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11
227 *
228 * The request is larger than the server is willing or able to process ; the server might close the connection
229 * or return an Retry-After header field.
230 * Previously called "Request Entity Too Large".
231 */
232 PAYLOAD_TOO_LARGE_413 = 413,
233
234 /**
235 * The URI provided was too long for the server to process. Often the result of too much data being encoded as a
236 * query-string of a GET request, in which case it should be converted to a POST request.
237 * Called "Request-URI Too Long" previously.
238 */
239 URI_TOO_LONG_414 = 414,
240
241 /**
242 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13
243 *
244 * The request entity has a media type which the server or resource does not support.
245 * For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.
246 */
247 UNSUPPORTED_MEDIA_TYPE_415 = 415,
248
249 /**
250 * The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
251 * For example, if the client asked for a part of the file that lies beyond the end of the file.
252 * Called "Requested Range Not Satisfiable" previously.
253 */
254 RANGE_NOT_SATISFIABLE_416 = 416,
255
256 /**
257 * The server cannot meet the requirements of the `Expect` request-header field.
258 */
259 EXPECTATION_FAILED_417 = 417,
260
261 /**
262 * Official Documentation @ https://tools.ietf.org/html/rfc2324
263 *
264 * This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,
265 * and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by
266 * teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including PeerTube instances ;-).
267 */
268 I_AM_A_TEAPOT_418 = 418,
269
270 /**
271 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3
272 *
273 * The request was well-formed but was unable to be followed due to semantic errors.
274 * The server understands the content type of the request entity (hence a 415 (Unsupported Media Type) status code is inappropriate),
275 * and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process
276 * the contained instructions. For example, this error condition may occur if an JSON request body contains well-formed (i.e.,
277 * syntactically correct), but semantically erroneous, JSON instructions.
278 *
279 * Can also be used to denote disabled features (akin to disabled syntax).
280 *
281 * @see HttpStatusCode.UNSUPPORTED_MEDIA_TYPE_415 if the `Content-Type` was not supported.
282 * @see HttpStatusCode.BAD_REQUEST_400 if the request was not parsable (broken JSON, XML)
283 */
284 UNPROCESSABLE_ENTITY_422 = 422,
285
286 /**
287 * Official Documentation @ https://tools.ietf.org/html/rfc4918#section-11.3
288 *
289 * The resource that is being accessed is locked. WebDAV-specific but used by some HTTP services.
290 *
291 * @deprecated use `If-Match` / `If-None-Match` instead
292 * @see {@link https://evertpot.com/http/423-locked}
293 */
294 LOCKED_423 = 423,
295
296 /**
297 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4
298 *
299 * The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
300 */
301 TOO_MANY_REQUESTS_429 = 429,
302
303 /**
304 * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5
305 *
306 * The server is unwilling to process the request because either an individual header field,
307 * or all the header fields collectively, are too large.
308 */
309 REQUEST_HEADER_FIELDS_TOO_LARGE_431 = 431,
310
311 /**
312 * Official Documentation @ https://tools.ietf.org/html/rfc7725
313 *
314 * A server operator has received a legal demand to deny access to a resource or to a set of resources
315 * that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.
316 */
317 UNAVAILABLE_FOR_LEGAL_REASONS_451 = 451,
318
319 /**
320 * A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
321 */
322 INTERNAL_SERVER_ERROR_500 = 500,
323
324 /**
325 * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2
326 *
327 * The server either does not recognize the request method, or it lacks the ability to fulfill the request.
328 * Usually this implies future availability (e.g., a new feature of a web-service API).
329 */
330 NOT_IMPLEMENTED_501 = 501,
331
332 /**
333 * The server was acting as a gateway or proxy and received an invalid response from the upstream server.
334 */
335 BAD_GATEWAY_502 = 502,
336
337 /**
338 * The server is currently unavailable (because it is overloaded or down for maintenance).
339 * Generally, this is a temporary state.
340 */
341 SERVICE_UNAVAILABLE_503 = 503,
342
343 /**
344 * The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
345 */
346 GATEWAY_TIMEOUT_504 = 504,
347
348 /**
349 * The server does not support the HTTP protocol version used in the request
350 */
351 HTTP_VERSION_NOT_SUPPORTED_505 = 505,
352
353 /**
354 * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6
355 *
356 * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the
357 * server is unable to store the representation needed to successfully complete the request. This condition is
358 * considered to be temporary. If the request which received this status code was the result of a user action,
359 * the request MUST NOT be repeated until it is requested by a separate user action.
360 *
361 * @see HttpStatusCode.PAYLOAD_TOO_LARGE_413 for quota errors
362 */
363 INSUFFICIENT_STORAGE_507 = 507,
364}
diff --git a/shared/models/http/http-methods.ts b/shared/models/http/http-methods.ts
deleted file mode 100644
index 3f4adafe2..000000000
--- a/shared/models/http/http-methods.ts
+++ /dev/null
@@ -1,21 +0,0 @@
1/** HTTP request method to indicate the desired action to be performed for a given resource. */
2export const enum HttpMethod {
3 /** The CONNECT method establishes a tunnel to the server identified by the target resource. */
4 CONNECT = 'CONNECT',
5 /** The DELETE method deletes the specified resource. */
6 DELETE = 'DELETE',
7 /** The GET method requests a representation of the specified resource. Requests using GET should only retrieve data. */
8 GET = 'GET',
9 /** The HEAD method asks for a response identical to that of a GET request, but without the response body. */
10 HEAD = 'HEAD',
11 /** The OPTIONS method is used to describe the communication options for the target resource. */
12 OPTIONS = 'OPTIONS',
13 /** The PATCH method is used to apply partial modifications to a resource. */
14 PATCH = 'PATCH',
15 /** The POST method is used to submit an entity to the specified resource */
16 POST = 'POST',
17 /** The PUT method replaces all current representations of the target resource with the request payload. */
18 PUT = 'PUT',
19 /** The TRACE method performs a message loop-back test along the path to the target resource. */
20 TRACE = 'TRACE'
21}
diff --git a/shared/models/http/index.ts b/shared/models/http/index.ts
deleted file mode 100644
index ec991afe0..000000000
--- a/shared/models/http/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './http-error-codes'
2export * from './http-methods'
diff --git a/shared/models/index.ts b/shared/models/index.ts
deleted file mode 100644
index 78f6e73e3..000000000
--- a/shared/models/index.ts
+++ /dev/null
@@ -1,19 +0,0 @@
1export * from './activitypub'
2export * from './actors'
3export * from './bulk'
4export * from './common'
5export * from './custom-markup'
6export * from './feeds'
7export * from './http'
8export * from './joinpeertube'
9export * from './metrics'
10export * from './moderation'
11export * from './overviews'
12export * from './plugins'
13export * from './redundancy'
14export * from './runners'
15export * from './search'
16export * from './server'
17export * from './tokens'
18export * from './users'
19export * from './videos'
diff --git a/shared/models/joinpeertube/index.ts b/shared/models/joinpeertube/index.ts
deleted file mode 100644
index 9681c35ad..000000000
--- a/shared/models/joinpeertube/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './versions.model'
diff --git a/shared/models/joinpeertube/versions.model.ts b/shared/models/joinpeertube/versions.model.ts
deleted file mode 100644
index 60a769150..000000000
--- a/shared/models/joinpeertube/versions.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface JoinPeerTubeVersions {
2 peertube: {
3 latestVersion: string
4 }
5}
diff --git a/shared/models/metrics/index.ts b/shared/models/metrics/index.ts
deleted file mode 100644
index 24194cce3..000000000
--- a/shared/models/metrics/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './playback-metric-create.model'
diff --git a/shared/models/metrics/playback-metric-create.model.ts b/shared/models/metrics/playback-metric-create.model.ts
deleted file mode 100644
index 1d47421c3..000000000
--- a/shared/models/metrics/playback-metric-create.model.ts
+++ /dev/null
@@ -1,22 +0,0 @@
1import { VideoResolution } from '../videos'
2
3export interface PlaybackMetricCreate {
4 playerMode: 'p2p-media-loader' | 'webtorrent' | 'web-video' // FIXME: remove webtorrent player mode not used anymore in PeerTube v6
5
6 resolution?: VideoResolution
7 fps?: number
8
9 p2pEnabled: boolean
10 p2pPeers?: number
11
12 resolutionChanges: number
13
14 errors: number
15
16 downloadedBytesP2P: number
17 downloadedBytesHTTP: number
18
19 uploadedBytesP2P: number
20
21 videoId: number | string
22}
diff --git a/shared/models/moderation/abuse/abuse-create.model.ts b/shared/models/moderation/abuse/abuse-create.model.ts
deleted file mode 100644
index 7d35555c3..000000000
--- a/shared/models/moderation/abuse/abuse-create.model.ts
+++ /dev/null
@@ -1,21 +0,0 @@
1import { AbusePredefinedReasonsString } from './abuse-reason.model'
2
3export interface AbuseCreate {
4 reason: string
5
6 predefinedReasons?: AbusePredefinedReasonsString[]
7
8 account?: {
9 id: number
10 }
11
12 video?: {
13 id: number | string
14 startAt?: number
15 endAt?: number
16 }
17
18 comment?: {
19 id: number
20 }
21}
diff --git a/shared/models/moderation/abuse/abuse-filter.type.ts b/shared/models/moderation/abuse/abuse-filter.type.ts
deleted file mode 100644
index 7dafc6d77..000000000
--- a/shared/models/moderation/abuse/abuse-filter.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type AbuseFilter = 'video' | 'comment' | 'account'
diff --git a/shared/models/moderation/abuse/abuse-message.model.ts b/shared/models/moderation/abuse/abuse-message.model.ts
deleted file mode 100644
index 9edd9daff..000000000
--- a/shared/models/moderation/abuse/abuse-message.model.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1import { AccountSummary } from '../../actors/account.model'
2
3export interface AbuseMessage {
4 id: number
5 message: string
6 byModerator: boolean
7 createdAt: Date | string
8
9 account: AccountSummary
10}
diff --git a/shared/models/moderation/abuse/abuse-reason.model.ts b/shared/models/moderation/abuse/abuse-reason.model.ts
deleted file mode 100644
index 57359aef6..000000000
--- a/shared/models/moderation/abuse/abuse-reason.model.ts
+++ /dev/null
@@ -1,20 +0,0 @@
1export const enum AbusePredefinedReasons {
2 VIOLENT_OR_REPULSIVE = 1,
3 HATEFUL_OR_ABUSIVE,
4 SPAM_OR_MISLEADING,
5 PRIVACY,
6 RIGHTS,
7 SERVER_RULES,
8 THUMBNAILS,
9 CAPTIONS
10}
11
12export type AbusePredefinedReasonsString =
13 'violentOrRepulsive' |
14 'hatefulOrAbusive' |
15 'spamOrMisleading' |
16 'privacy' |
17 'rights' |
18 'serverRules' |
19 'thumbnails' |
20 'captions'
diff --git a/shared/models/moderation/abuse/abuse-state.model.ts b/shared/models/moderation/abuse/abuse-state.model.ts
deleted file mode 100644
index 8ef6fdada..000000000
--- a/shared/models/moderation/abuse/abuse-state.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export const enum AbuseState {
2 PENDING = 1,
3 REJECTED = 2,
4 ACCEPTED = 3
5}
diff --git a/shared/models/moderation/abuse/abuse-update.model.ts b/shared/models/moderation/abuse/abuse-update.model.ts
deleted file mode 100644
index 4360fe7ac..000000000
--- a/shared/models/moderation/abuse/abuse-update.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { AbuseState } from './abuse-state.model'
2
3export interface AbuseUpdate {
4 moderationComment?: string
5
6 state?: AbuseState
7}
diff --git a/shared/models/moderation/abuse/abuse-video-is.type.ts b/shared/models/moderation/abuse/abuse-video-is.type.ts
deleted file mode 100644
index 74937f3b9..000000000
--- a/shared/models/moderation/abuse/abuse-video-is.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type AbuseVideoIs = 'deleted' | 'blacklisted'
diff --git a/shared/models/moderation/abuse/abuse.model.ts b/shared/models/moderation/abuse/abuse.model.ts
deleted file mode 100644
index 6048777ff..000000000
--- a/shared/models/moderation/abuse/abuse.model.ts
+++ /dev/null
@@ -1,70 +0,0 @@
1import { Account } from '../../actors/account.model'
2import { AbuseState } from './abuse-state.model'
3import { AbusePredefinedReasonsString } from './abuse-reason.model'
4import { VideoConstant } from '../../videos/video-constant.model'
5import { VideoChannel } from '../../videos/channel/video-channel.model'
6
7export interface AdminVideoAbuse {
8 id: number
9 name: string
10 uuid: string
11 nsfw: boolean
12
13 deleted: boolean
14 blacklisted: boolean
15
16 startAt: number | null
17 endAt: number | null
18
19 thumbnailPath?: string
20 channel?: VideoChannel
21
22 countReports: number
23 nthReport: number
24}
25
26export interface AdminVideoCommentAbuse {
27 id: number
28 threadId: number
29
30 video: {
31 id: number
32 name: string
33 uuid: string
34 }
35
36 text: string
37
38 deleted: boolean
39}
40
41export interface AdminAbuse {
42 id: number
43
44 reason: string
45 predefinedReasons?: AbusePredefinedReasonsString[]
46
47 reporterAccount: Account
48 flaggedAccount: Account
49
50 state: VideoConstant<AbuseState>
51 moderationComment?: string
52
53 video?: AdminVideoAbuse
54 comment?: AdminVideoCommentAbuse
55
56 createdAt: Date
57 updatedAt: Date
58
59 countReportsForReporter?: number
60 countReportsForReportee?: number
61
62 countMessages: number
63}
64
65export type UserVideoAbuse = Omit<AdminVideoAbuse, 'countReports' | 'nthReport'>
66
67export type UserVideoCommentAbuse = AdminVideoCommentAbuse
68
69export type UserAbuse = Omit<AdminAbuse, 'reporterAccount' | 'countReportsForReportee' | 'countReportsForReporter' | 'startAt' | 'endAt'
70| 'count' | 'nth' | 'moderationComment'>
diff --git a/shared/models/moderation/abuse/index.ts b/shared/models/moderation/abuse/index.ts
deleted file mode 100644
index b518517a6..000000000
--- a/shared/models/moderation/abuse/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1export * from './abuse-create.model'
2export * from './abuse-filter.type'
3export * from './abuse-message.model'
4export * from './abuse-reason.model'
5export * from './abuse-state.model'
6export * from './abuse-update.model'
7export * from './abuse-video-is.type'
8export * from './abuse.model'
diff --git a/shared/models/moderation/account-block.model.ts b/shared/models/moderation/account-block.model.ts
deleted file mode 100644
index a942ed614..000000000
--- a/shared/models/moderation/account-block.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { Account } from '../actors'
2
3export interface AccountBlock {
4 byAccount: Account
5 blockedAccount: Account
6 createdAt: Date | string
7}
diff --git a/shared/models/moderation/block-status.model.ts b/shared/models/moderation/block-status.model.ts
deleted file mode 100644
index 597312757..000000000
--- a/shared/models/moderation/block-status.model.ts
+++ /dev/null
@@ -1,15 +0,0 @@
1export interface BlockStatus {
2 accounts: {
3 [ handle: string ]: {
4 blockedByServer: boolean
5 blockedByUser?: boolean
6 }
7 }
8
9 hosts: {
10 [ host: string ]: {
11 blockedByServer: boolean
12 blockedByUser?: boolean
13 }
14 }
15}
diff --git a/shared/models/moderation/index.ts b/shared/models/moderation/index.ts
deleted file mode 100644
index f8e6d351c..000000000
--- a/shared/models/moderation/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export * from './abuse'
2export * from './block-status.model'
3export * from './account-block.model'
4export * from './server-block.model'
diff --git a/shared/models/moderation/server-block.model.ts b/shared/models/moderation/server-block.model.ts
deleted file mode 100644
index a8b8af0b7..000000000
--- a/shared/models/moderation/server-block.model.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1import { Account } from '../actors'
2
3export interface ServerBlock {
4 byAccount: Account
5 blockedServer: {
6 host: string
7 }
8 createdAt: Date | string
9}
diff --git a/shared/models/nodeinfo/index.ts b/shared/models/nodeinfo/index.ts
deleted file mode 100644
index faa64302a..000000000
--- a/shared/models/nodeinfo/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './nodeinfo.model'
diff --git a/shared/models/nodeinfo/nodeinfo.model.ts b/shared/models/nodeinfo/nodeinfo.model.ts
deleted file mode 100644
index 336cb66d2..000000000
--- a/shared/models/nodeinfo/nodeinfo.model.ts
+++ /dev/null
@@ -1,117 +0,0 @@
1/**
2 * NodeInfo schema version 2.0.
3 */
4export interface HttpNodeinfoDiasporaSoftwareNsSchema20 {
5 /**
6 * The schema version, must be 2.0.
7 */
8 version: '2.0'
9 /**
10 * Metadata about server software in use.
11 */
12 software: {
13 /**
14 * The canonical name of this server software.
15 */
16 name: string
17 /**
18 * The version of this server software.
19 */
20 version: string
21 }
22 /**
23 * The protocols supported on this server.
24 */
25 protocols: (
26 | 'activitypub'
27 | 'buddycloud'
28 | 'dfrn'
29 | 'diaspora'
30 | 'libertree'
31 | 'ostatus'
32 | 'pumpio'
33 | 'tent'
34 | 'xmpp'
35 | 'zot')[]
36 /**
37 * The third party sites this server can connect to via their application API.
38 */
39 services: {
40 /**
41 * The third party sites this server can retrieve messages from for combined display with regular traffic.
42 */
43 inbound: ('atom1.0' | 'gnusocial' | 'imap' | 'pnut' | 'pop3' | 'pumpio' | 'rss2.0' | 'twitter')[]
44 /**
45 * The third party sites this server can publish messages to on the behalf of a user.
46 */
47 outbound: (
48 | 'atom1.0'
49 | 'blogger'
50 | 'buddycloud'
51 | 'diaspora'
52 | 'dreamwidth'
53 | 'drupal'
54 | 'facebook'
55 | 'friendica'
56 | 'gnusocial'
57 | 'google'
58 | 'insanejournal'
59 | 'libertree'
60 | 'linkedin'
61 | 'livejournal'
62 | 'mediagoblin'
63 | 'myspace'
64 | 'pinterest'
65 | 'pnut'
66 | 'posterous'
67 | 'pumpio'
68 | 'redmatrix'
69 | 'rss2.0'
70 | 'smtp'
71 | 'tent'
72 | 'tumblr'
73 | 'twitter'
74 | 'wordpress'
75 | 'xmpp')[]
76 }
77 /**
78 * Whether this server allows open self-registration.
79 */
80 openRegistrations: boolean
81 /**
82 * Usage statistics for this server.
83 */
84 usage: {
85 /**
86 * statistics about the users of this server.
87 */
88 users: {
89 /**
90 * The total amount of on this server registered users.
91 */
92 total?: number
93 /**
94 * The amount of users that signed in at least once in the last 180 days.
95 */
96 activeHalfyear?: number
97 /**
98 * The amount of users that signed in at least once in the last 30 days.
99 */
100 activeMonth?: number
101 }
102 /**
103 * The amount of posts that were made by users that are registered on this server.
104 */
105 localPosts?: number
106 /**
107 * The amount of comments that were made by users that are registered on this server.
108 */
109 localComments?: number
110 }
111 /**
112 * Free form key value pairs for software specific values. Clients should not rely on any specific key present.
113 */
114 metadata: {
115 [k: string]: any
116 }
117}
diff --git a/shared/models/overviews/index.ts b/shared/models/overviews/index.ts
deleted file mode 100644
index 468507c6b..000000000
--- a/shared/models/overviews/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './videos-overview.model'
diff --git a/shared/models/overviews/videos-overview.model.ts b/shared/models/overviews/videos-overview.model.ts
deleted file mode 100644
index 0f3cb4a52..000000000
--- a/shared/models/overviews/videos-overview.model.ts
+++ /dev/null
@@ -1,24 +0,0 @@
1import { Video, VideoChannelSummary, VideoConstant } from '../videos'
2
3export interface ChannelOverview {
4 channel: VideoChannelSummary
5 videos: Video[]
6}
7
8export interface CategoryOverview {
9 category: VideoConstant<number>
10 videos: Video[]
11}
12
13export interface TagOverview {
14 tag: string
15 videos: Video[]
16}
17
18export interface VideosOverview {
19 channels: ChannelOverview[]
20
21 categories: CategoryOverview[]
22
23 tags: TagOverview[]
24}
diff --git a/shared/models/plugins/client/client-hook.model.ts b/shared/models/plugins/client/client-hook.model.ts
deleted file mode 100644
index 4a0818c99..000000000
--- a/shared/models/plugins/client/client-hook.model.ts
+++ /dev/null
@@ -1,195 +0,0 @@
1// Data from API hooks: {hookType}:api.{location}.{elementType}.{actionType}.{target}
2// Data in internal functions: {hookType}:{location}.{elementType}.{actionType}.{target}
3
4export const clientFilterHookObject = {
5 // Filter params/result of the function that fetch videos of the trending page
6 'filter:api.trending-videos.videos.list.params': true,
7 'filter:api.trending-videos.videos.list.result': true,
8
9 // Filter params/result of the function that fetch videos of the trending page
10 'filter:api.most-liked-videos.videos.list.params': true,
11 'filter:api.most-liked-videos.videos.list.result': true,
12
13 // Filter params/result of the function that fetch videos of the local page
14 'filter:api.local-videos.videos.list.params': true,
15 'filter:api.local-videos.videos.list.result': true,
16
17 // Filter params/result of the function that fetch videos of the recently-added page
18 'filter:api.recently-added-videos.videos.list.params': true,
19 'filter:api.recently-added-videos.videos.list.result': true,
20
21 // Filter params/result of the function that fetch videos of the user subscription page
22 'filter:api.user-subscriptions-videos.videos.list.params': true,
23 'filter:api.user-subscriptions-videos.videos.list.result': true,
24
25 // Filter params/result of the function that fetch the video of the video-watch page
26 'filter:api.video-watch.video.get.params': true,
27 'filter:api.video-watch.video.get.result': true,
28
29 // Filter params/result of the function that fetch video playlist elements of the video-watch page
30 'filter:api.video-watch.video-playlist-elements.get.params': true,
31 'filter:api.video-watch.video-playlist-elements.get.result': true,
32
33 // Filter params/result of the function that fetch the threads of the video-watch page
34 'filter:api.video-watch.video-threads.list.params': true,
35 'filter:api.video-watch.video-threads.list.result': true,
36
37 // Filter params/result of the function that fetch the replies of a thread in the video-watch page
38 'filter:api.video-watch.video-thread-replies.list.params': true,
39 'filter:api.video-watch.video-thread-replies.list.result': true,
40
41 // Filter params/result of the function that fetch videos according to the user search
42 'filter:api.search.videos.list.params': true,
43 'filter:api.search.videos.list.result': true,
44 // Filter params/result of the function that fetch video channels according to the user search
45 'filter:api.search.video-channels.list.params': true,
46 'filter:api.search.video-channels.list.result': true,
47 // Filter params/result of the function that fetch video playlists according to the user search
48 'filter:api.search.video-playlists.list.params': true,
49 'filter:api.search.video-playlists.list.result': true,
50
51 // Filter form
52 'filter:api.signup.registration.create.params': true,
53
54 // Filter params/result of the function that fetch video playlist elements of the my-library page
55 'filter:api.my-library.video-playlist-elements.list.params': true,
56 'filter:api.my-library.video-playlist-elements.list.result': true,
57
58 // Filter the options to create our player
59 'filter:internal.video-watch.player.build-options.params': true,
60 'filter:internal.video-watch.player.build-options.result': true,
61
62 // Filter the options to load a new video in our player
63 'filter:internal.video-watch.player.load-options.params': true,
64 'filter:internal.video-watch.player.load-options.result': true,
65
66 // Filter our SVG icons content
67 'filter:internal.common.svg-icons.get-content.params': true,
68 'filter:internal.common.svg-icons.get-content.result': true,
69
70 // Filter left menu links
71 'filter:left-menu.links.create.result': true,
72
73 // Filter upload page alert messages
74 'filter:upload.messages.create.result': true,
75
76 'filter:login.instance-about-plugin-panels.create.result': true,
77 'filter:signup.instance-about-plugin-panels.create.result': true,
78
79 'filter:share.video-embed-code.build.params': true,
80 'filter:share.video-embed-code.build.result': true,
81 'filter:share.video-playlist-embed-code.build.params': true,
82 'filter:share.video-playlist-embed-code.build.result': true,
83
84 'filter:share.video-embed-url.build.params': true,
85 'filter:share.video-embed-url.build.result': true,
86 'filter:share.video-playlist-embed-url.build.params': true,
87 'filter:share.video-playlist-embed-url.build.result': true,
88
89 'filter:share.video-url.build.params': true,
90 'filter:share.video-url.build.result': true,
91 'filter:share.video-playlist-url.build.params': true,
92 'filter:share.video-playlist-url.build.result': true,
93
94 'filter:video-watch.video-plugin-metadata.result': true,
95
96 // Filter videojs options built for PeerTube player
97 'filter:internal.player.videojs.options.result': true,
98
99 // Filter p2p media loader options built for PeerTube player
100 'filter:internal.player.p2p-media-loader.options.result': true
101}
102
103export type ClientFilterHookName = keyof typeof clientFilterHookObject
104
105export const clientActionHookObject = {
106 // Fired when the application is being initialized
107 'action:application.init': true,
108
109 // Fired when the video watch page is being initialized
110 'action:video-watch.init': true,
111 // Fired when the video watch page loaded the video
112 'action:video-watch.video.loaded': true,
113 // Fired when the player finished loading
114 'action:video-watch.player.loaded': true,
115 // Fired when the video watch page comments(threads) are loaded and load more comments on scroll
116 'action:video-watch.video-threads.loaded': true,
117 // Fired when a user click on 'View x replies' and they're loaded
118 'action:video-watch.video-thread-replies.loaded': true,
119
120 // Fired when the video channel creation page is being initialized
121 'action:video-channel-create.init': true,
122
123 // Fired when the video channel update page is being initialized
124 'action:video-channel-update.init': true,
125 'action:video-channel-update.video-channel.loaded': true,
126
127 // Fired when the page that list video channel videos is being initialized
128 'action:video-channel-videos.init': true,
129 'action:video-channel-videos.video-channel.loaded': true,
130 'action:video-channel-videos.videos.loaded': true,
131
132 // Fired when the page that list video channel playlists is being initialized
133 'action:video-channel-playlists.init': true,
134 'action:video-channel-playlists.video-channel.loaded': true,
135 'action:video-channel-playlists.playlists.loaded': true,
136
137 // Fired when the video edit page (upload, URL/torrent import, update) is being initialized
138 // Contains a `type` and `updateForm` object attributes
139 'action:video-edit.init': true,
140
141 // Fired when values of the video edit form changed
142 'action:video-edit.form.updated': true,
143
144 // Fired when the login page is being initialized
145 'action:login.init': true,
146
147 // Fired when the search page is being initialized
148 'action:search.init': true,
149
150 // Fired every time Angular URL changes
151 'action:router.navigation-end': true,
152
153 // Fired when the registration page is being initialized
154 'action:signup.register.init': true,
155
156 // PeerTube >= 3.2
157 // Fired when the admin plugin settings page is being initialized
158 'action:admin-plugin-settings.init': true,
159
160 // Fired when the video upload page is being initialized
161 'action:video-upload.init': true,
162 // Fired when the video import by URL page is being initialized
163 'action:video-url-import.init': true,
164 // Fired when the video import by torrent/magnet URI page is being initialized
165 'action:video-torrent-import.init': true,
166 // Fired when the "Go Live" page is being initialized
167 'action:go-live.init': true,
168
169 // Fired when the user explicitly logged in/logged out
170 'action:auth-user.logged-in': true,
171 'action:auth-user.logged-out': true,
172 // Fired when the application loaded user information (using tokens from the local storage or after a successful login)
173 'action:auth-user.information-loaded': true,
174
175 // Fired when the modal to download a video/caption is shown
176 'action:modal.video-download.shown': true,
177 // Fired when the modal to share a video/playlist is shown
178 'action:modal.share.shown': true,
179
180 // ####### Embed hooks #######
181 // /!\ In embed scope, peertube helpers are not available
182 // ###########################
183
184 // Fired when the embed loaded the player
185 'action:embed.player.loaded': true
186}
187
188export type ClientActionHookName = keyof typeof clientActionHookObject
189
190export const clientHookObject = Object.assign({}, clientFilterHookObject, clientActionHookObject)
191export type ClientHookName = keyof typeof clientHookObject
192
193export interface ClientHook {
194 runHook <T> (hookName: ClientHookName, result?: T, params?: any): Promise<T>
195}
diff --git a/shared/models/plugins/client/index.ts b/shared/models/plugins/client/index.ts
deleted file mode 100644
index f3e3fcbcf..000000000
--- a/shared/models/plugins/client/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1export * from './client-hook.model'
2export * from './plugin-client-scope.type'
3export * from './plugin-element-placeholder.type'
4export * from './plugin-selector-id.type'
5export * from './register-client-form-field.model'
6export * from './register-client-hook.model'
7export * from './register-client-route.model'
8export * from './register-client-settings-script.model'
diff --git a/shared/models/plugins/client/plugin-client-scope.type.ts b/shared/models/plugins/client/plugin-client-scope.type.ts
deleted file mode 100644
index c09a453b8..000000000
--- a/shared/models/plugins/client/plugin-client-scope.type.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1export type PluginClientScope =
2 'common' |
3 'video-watch' |
4 'search' |
5 'signup' |
6 'login' |
7 'embed' |
8 'video-edit' |
9 'admin-plugin' |
10 'my-library' |
11 'video-channel'
diff --git a/shared/models/plugins/client/plugin-element-placeholder.type.ts b/shared/models/plugins/client/plugin-element-placeholder.type.ts
deleted file mode 100644
index 7b8a2605b..000000000
--- a/shared/models/plugins/client/plugin-element-placeholder.type.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export type PluginElementPlaceholder =
2 'player-next' |
3 'share-modal-playlist-settings' |
4 'share-modal-video-settings'
diff --git a/shared/models/plugins/client/plugin-selector-id.type.ts b/shared/models/plugins/client/plugin-selector-id.type.ts
deleted file mode 100644
index 8d23314b5..000000000
--- a/shared/models/plugins/client/plugin-selector-id.type.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1export type PluginSelectorId =
2 'login-form' |
3 'menu-user-dropdown-language-item' |
4 'about-instance-features' |
5 'about-instance-statistics' |
6 'about-instance-moderation' |
7 'about-menu-instance' |
8 'about-menu-peertube' |
9 'about-menu-network' |
10 'about-instance-other-information'
diff --git a/shared/models/plugins/client/register-client-form-field.model.ts b/shared/models/plugins/client/register-client-form-field.model.ts
deleted file mode 100644
index 153c4a6ea..000000000
--- a/shared/models/plugins/client/register-client-form-field.model.ts
+++ /dev/null
@@ -1,30 +0,0 @@
1export type RegisterClientFormFieldOptions = {
2 name?: string
3 label?: string
4 type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html'
5
6 // For select type
7 options?: { value: string, label: string }[]
8
9 // For html type
10 html?: string
11
12 descriptionHTML?: string
13
14 // Default setting value
15 default?: string | boolean
16
17 // Not supported by plugin setting registration, use registerSettingsScript instead
18 hidden?: (options: any) => boolean
19
20 // Return undefined | null if there is no error or return a string with the detailed error
21 // Not supported by plugin setting registration
22 error?: (options: any) => Promise<{ error: boolean, text?: string }>
23}
24
25export interface RegisterClientVideoFieldOptions {
26 type: 'update' | 'upload' | 'import-url' | 'import-torrent' | 'go-live'
27
28 // Default to 'plugin-settings'
29 tab?: 'main' | 'plugin-settings'
30}
diff --git a/shared/models/plugins/client/register-client-hook.model.ts b/shared/models/plugins/client/register-client-hook.model.ts
deleted file mode 100644
index 81047b21d..000000000
--- a/shared/models/plugins/client/register-client-hook.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { ClientHookName } from './client-hook.model'
2
3export interface RegisterClientHookOptions {
4 target: ClientHookName
5 handler: Function
6 priority?: number
7}
diff --git a/shared/models/plugins/client/register-client-route.model.ts b/shared/models/plugins/client/register-client-route.model.ts
deleted file mode 100644
index 271b67834..000000000
--- a/shared/models/plugins/client/register-client-route.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export interface RegisterClientRouteOptions {
2 route: string
3
4 onMount (options: {
5 rootEl: HTMLElement
6 }): void
7}
diff --git a/shared/models/plugins/client/register-client-settings-script.model.ts b/shared/models/plugins/client/register-client-settings-script.model.ts
deleted file mode 100644
index 117ca4739..000000000
--- a/shared/models/plugins/client/register-client-settings-script.model.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1import { RegisterServerSettingOptions } from '../server'
2
3export interface RegisterClientSettingsScriptOptions {
4 isSettingHidden (options: {
5 setting: RegisterServerSettingOptions
6 formValues: { [name: string]: any }
7 }): boolean
8}
diff --git a/shared/models/plugins/hook-type.enum.ts b/shared/models/plugins/hook-type.enum.ts
deleted file mode 100644
index a96c943f1..000000000
--- a/shared/models/plugins/hook-type.enum.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export const enum HookType {
2 STATIC = 1,
3 ACTION = 2,
4 FILTER = 3
5}
diff --git a/shared/models/plugins/index.ts b/shared/models/plugins/index.ts
deleted file mode 100644
index cbbe4916e..000000000
--- a/shared/models/plugins/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export * from './client'
2export * from './plugin-index'
3export * from './server'
4export * from './hook-type.enum'
5export * from './plugin-package-json.model'
6export * from './plugin.type'
diff --git a/shared/models/plugins/plugin-index/index.ts b/shared/models/plugins/plugin-index/index.ts
deleted file mode 100644
index 913846638..000000000
--- a/shared/models/plugins/plugin-index/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export * from './peertube-plugin-index-list.model'
2export * from './peertube-plugin-index.model'
3export * from './peertube-plugin-latest-version.model'
diff --git a/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts
deleted file mode 100644
index ecb46482e..000000000
--- a/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1import { PluginType } from '../plugin.type'
2
3export interface PeertubePluginIndexList {
4 start: number
5 count: number
6 sort: string
7 pluginType?: PluginType
8 currentPeerTubeEngine?: string
9 search?: string
10}
diff --git a/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts
deleted file mode 100644
index 36dfef943..000000000
--- a/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts
+++ /dev/null
@@ -1,16 +0,0 @@
1export interface PeerTubePluginIndex {
2 npmName: string
3 description: string
4 homepage: string
5 createdAt: Date
6 updatedAt: Date
7
8 popularity: number
9
10 latestVersion: string
11
12 official: boolean
13
14 name?: string
15 installed?: boolean
16}
diff --git a/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts
deleted file mode 100644
index 811a64429..000000000
--- a/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1export interface PeertubePluginLatestVersionRequest {
2 currentPeerTubeEngine?: string
3
4 npmNames: string[]
5}
6
7export type PeertubePluginLatestVersionResponse = {
8 npmName: string
9 latestVersion: string | null
10}[]
diff --git a/shared/models/plugins/plugin-package-json.model.ts b/shared/models/plugins/plugin-package-json.model.ts
deleted file mode 100644
index 7ce968ff2..000000000
--- a/shared/models/plugins/plugin-package-json.model.ts
+++ /dev/null
@@ -1,29 +0,0 @@
1import { PluginClientScope } from './client/plugin-client-scope.type'
2
3export type PluginTranslationPathsJSON = {
4 [ locale: string ]: string
5}
6
7export type ClientScriptJSON = {
8 script: string
9 scopes: PluginClientScope[]
10}
11
12export type PluginPackageJSON = {
13 name: string
14 version: string
15 description: string
16 engine: { peertube: string }
17
18 homepage: string
19 author: string
20 bugs: string
21 library: string
22
23 staticDirs: { [ name: string ]: string }
24 css: string[]
25
26 clientScripts: ClientScriptJSON[]
27
28 translations: PluginTranslationPathsJSON
29}
diff --git a/shared/models/plugins/plugin.type.ts b/shared/models/plugins/plugin.type.ts
deleted file mode 100644
index 016219ceb..000000000
--- a/shared/models/plugins/plugin.type.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export const enum PluginType {
2 PLUGIN = 1,
3 THEME = 2
4}
diff --git a/shared/models/plugins/server/api/index.ts b/shared/models/plugins/server/api/index.ts
deleted file mode 100644
index eb59a03f0..000000000
--- a/shared/models/plugins/server/api/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export * from './install-plugin.model'
2export * from './manage-plugin.model'
3export * from './peertube-plugin.model'
diff --git a/shared/models/plugins/server/api/install-plugin.model.ts b/shared/models/plugins/server/api/install-plugin.model.ts
deleted file mode 100644
index a1d009a00..000000000
--- a/shared/models/plugins/server/api/install-plugin.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface InstallOrUpdatePlugin {
2 npmName?: string
3 pluginVersion?: string
4 path?: string
5}
diff --git a/shared/models/plugins/server/api/manage-plugin.model.ts b/shared/models/plugins/server/api/manage-plugin.model.ts
deleted file mode 100644
index 612b3056c..000000000
--- a/shared/models/plugins/server/api/manage-plugin.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface ManagePlugin {
2 npmName: string
3}
diff --git a/shared/models/plugins/server/api/peertube-plugin.model.ts b/shared/models/plugins/server/api/peertube-plugin.model.ts
deleted file mode 100644
index 54c383f57..000000000
--- a/shared/models/plugins/server/api/peertube-plugin.model.ts
+++ /dev/null
@@ -1,16 +0,0 @@
1import { PluginType } from '../../plugin.type'
2
3export interface PeerTubePlugin {
4 name: string
5 type: PluginType
6 latestVersion: string
7 version: string
8 enabled: boolean
9 uninstalled: boolean
10 peertubeEngine: string
11 description: string
12 homepage: string
13 settings: { [ name: string ]: string }
14 createdAt: Date
15 updatedAt: Date
16}
diff --git a/shared/models/plugins/server/index.ts b/shared/models/plugins/server/index.ts
deleted file mode 100644
index d3ff49d3b..000000000
--- a/shared/models/plugins/server/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export * from './api'
2export * from './managers'
3export * from './settings'
4export * from './plugin-translation.model'
5export * from './register-server-hook.model'
6export * from './server-hook.model'
diff --git a/shared/models/plugins/server/managers/index.ts b/shared/models/plugins/server/managers/index.ts
deleted file mode 100644
index 49365a854..000000000
--- a/shared/models/plugins/server/managers/index.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1
2export * from './plugin-playlist-privacy-manager.model'
3export * from './plugin-settings-manager.model'
4export * from './plugin-storage-manager.model'
5export * from './plugin-transcoding-manager.model'
6export * from './plugin-video-category-manager.model'
7export * from './plugin-video-language-manager.model'
8export * from './plugin-video-licence-manager.model'
9export * from './plugin-video-privacy-manager.model'
diff --git a/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts b/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts
deleted file mode 100644
index 35247c1e3..000000000
--- a/shared/models/plugins/server/managers/plugin-playlist-privacy-manager.model.ts
+++ /dev/null
@@ -1,12 +0,0 @@
1import { VideoPlaylistPrivacy } from '../../../videos/playlist/video-playlist-privacy.model'
2import { ConstantManager } from '../plugin-constant-manager.model'
3
4export interface PluginPlaylistPrivacyManager extends ConstantManager<VideoPlaylistPrivacy> {
5 /**
6 * PUBLIC = 1,
7 * UNLISTED = 2,
8 * PRIVATE = 3
9 * @deprecated use `deleteConstant` instead
10 */
11 deletePlaylistPrivacy: (privacyKey: VideoPlaylistPrivacy) => boolean
12}
diff --git a/shared/models/plugins/server/managers/plugin-settings-manager.model.ts b/shared/models/plugins/server/managers/plugin-settings-manager.model.ts
deleted file mode 100644
index b628718dd..000000000
--- a/shared/models/plugins/server/managers/plugin-settings-manager.model.ts
+++ /dev/null
@@ -1,17 +0,0 @@
1export type SettingValue = string | boolean
2
3export interface SettingEntries {
4 [settingName: string]: SettingValue
5}
6
7export type SettingsChangeCallback = (settings: SettingEntries) => Promise<any>
8
9export interface PluginSettingsManager {
10 getSetting: (name: string) => Promise<SettingValue>
11
12 getSettings: (names: string[]) => Promise<SettingEntries>
13
14 setSetting: (name: string, value: SettingValue) => Promise<any>
15
16 onSettingsChange: (cb: SettingsChangeCallback) => void
17}
diff --git a/shared/models/plugins/server/managers/plugin-storage-manager.model.ts b/shared/models/plugins/server/managers/plugin-storage-manager.model.ts
deleted file mode 100644
index 51567044a..000000000
--- a/shared/models/plugins/server/managers/plugin-storage-manager.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface PluginStorageManager {
2 getData: (key: string) => Promise<string>
3
4 storeData: (key: string, data: any) => Promise<any>
5}
diff --git a/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts b/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts
deleted file mode 100644
index b6fb46ba0..000000000
--- a/shared/models/plugins/server/managers/plugin-transcoding-manager.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { EncoderOptionsBuilder } from '../../../videos/transcoding'
2
3export interface PluginTranscodingManager {
4 addLiveProfile (encoder: string, profile: string, builder: EncoderOptionsBuilder): boolean
5
6 addVODProfile (encoder: string, profile: string, builder: EncoderOptionsBuilder): boolean
7
8 addLiveEncoderPriority (streamType: 'audio' | 'video', encoder: string, priority: number): void
9
10 addVODEncoderPriority (streamType: 'audio' | 'video', encoder: string, priority: number): void
11
12 removeAllProfilesAndEncoderPriorities(): void
13}
diff --git a/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts
deleted file mode 100644
index cf3d828fe..000000000
--- a/shared/models/plugins/server/managers/plugin-video-category-manager.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { ConstantManager } from '../plugin-constant-manager.model'
2
3export interface PluginVideoCategoryManager extends ConstantManager<number> {
4 /**
5 * @deprecated use `addConstant` instead
6 */
7 addCategory: (categoryKey: number, categoryLabel: string) => boolean
8
9 /**
10 * @deprecated use `deleteConstant` instead
11 */
12 deleteCategory: (categoryKey: number) => boolean
13}
diff --git a/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts
deleted file mode 100644
index 69fc8e503..000000000
--- a/shared/models/plugins/server/managers/plugin-video-language-manager.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { ConstantManager } from '../plugin-constant-manager.model'
2
3export interface PluginVideoLanguageManager extends ConstantManager<string> {
4 /**
5 * @deprecated use `addConstant` instead
6 */
7 addLanguage: (languageKey: string, languageLabel: string) => boolean
8
9 /**
10 * @deprecated use `deleteConstant` instead
11 */
12 deleteLanguage: (languageKey: string) => boolean
13}
diff --git a/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts
deleted file mode 100644
index 21b422270..000000000
--- a/shared/models/plugins/server/managers/plugin-video-licence-manager.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { ConstantManager } from '../plugin-constant-manager.model'
2
3export interface PluginVideoLicenceManager extends ConstantManager<number> {
4 /**
5 * @deprecated use `addConstant` instead
6 */
7 addLicence: (licenceKey: number, licenceLabel: string) => boolean
8
9 /**
10 * @deprecated use `deleteConstant` instead
11 */
12 deleteLicence: (licenceKey: number) => boolean
13}
diff --git a/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts b/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts
deleted file mode 100644
index a237037db..000000000
--- a/shared/models/plugins/server/managers/plugin-video-privacy-manager.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { VideoPrivacy } from '../../../videos/video-privacy.enum'
2import { ConstantManager } from '../plugin-constant-manager.model'
3
4export interface PluginVideoPrivacyManager extends ConstantManager<VideoPrivacy> {
5 /**
6 * PUBLIC = 1,
7 * UNLISTED = 2,
8 * PRIVATE = 3
9 * INTERNAL = 4
10 * @deprecated use `deleteConstant` instead
11 */
12 deletePrivacy: (privacyKey: VideoPrivacy) => boolean
13}
diff --git a/shared/models/plugins/server/plugin-constant-manager.model.ts b/shared/models/plugins/server/plugin-constant-manager.model.ts
deleted file mode 100644
index 4de3ce38f..000000000
--- a/shared/models/plugins/server/plugin-constant-manager.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export interface ConstantManager <K extends string | number> {
2 addConstant: (key: K, label: string) => boolean
3 deleteConstant: (key: K) => boolean
4 getConstantValue: (key: K) => string
5 getConstants: () => Record<K, string>
6 resetConstants: () => void
7}
diff --git a/shared/models/plugins/server/plugin-translation.model.ts b/shared/models/plugins/server/plugin-translation.model.ts
deleted file mode 100644
index a2dd8e560..000000000
--- a/shared/models/plugins/server/plugin-translation.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export type PluginTranslation = {
2 [ npmName: string ]: {
3 [ key: string ]: string
4 }
5}
diff --git a/shared/models/plugins/server/register-server-hook.model.ts b/shared/models/plugins/server/register-server-hook.model.ts
deleted file mode 100644
index 746fdc329..000000000
--- a/shared/models/plugins/server/register-server-hook.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { ServerHookName } from './server-hook.model'
2
3export interface RegisterServerHookOptions {
4 target: ServerHookName
5 handler: Function
6 priority?: number
7}
diff --git a/shared/models/plugins/server/server-hook.model.ts b/shared/models/plugins/server/server-hook.model.ts
deleted file mode 100644
index cf387ffd7..000000000
--- a/shared/models/plugins/server/server-hook.model.ts
+++ /dev/null
@@ -1,221 +0,0 @@
1// {hookType}:{root}.{location}.{subLocation?}.{actionType}.{target}
2
3export const serverFilterHookObject = {
4 // Filter params/result used to list videos for the REST API
5 // (used by the trending page, recently-added page, local page etc)
6 'filter:api.videos.list.params': true,
7 'filter:api.videos.list.result': true,
8
9 // Filter params/result used to list a video playlists videos
10 // for the REST API
11 'filter:api.video-playlist.videos.list.params': true,
12 'filter:api.video-playlist.videos.list.result': true,
13
14 // Filter params/result used to list account videos for the REST API
15 'filter:api.accounts.videos.list.params': true,
16 'filter:api.accounts.videos.list.result': true,
17
18 // Filter params/result used to list channel videos for the REST API
19 'filter:api.video-channels.videos.list.params': true,
20 'filter:api.video-channels.videos.list.result': true,
21
22 // Filter params/result used to list my user videos for the REST API
23 'filter:api.user.me.videos.list.params': true,
24 'filter:api.user.me.videos.list.result': true,
25
26 // Filter params/result used to list overview videos for the REST API
27 'filter:api.overviews.videos.list.params': true,
28 'filter:api.overviews.videos.list.result': true,
29
30 // Filter params/result used to list subscription videos for the REST API
31 'filter:api.user.me.subscription-videos.list.params': true,
32 'filter:api.user.me.subscription-videos.list.result': true,
33
34 // Filter params/results to search videos/channels in the DB or on the remote index
35 'filter:api.search.videos.local.list.params': true,
36 'filter:api.search.videos.local.list.result': true,
37 'filter:api.search.videos.index.list.params': true,
38 'filter:api.search.videos.index.list.result': true,
39 'filter:api.search.video-channels.local.list.params': true,
40 'filter:api.search.video-channels.local.list.result': true,
41 'filter:api.search.video-channels.index.list.params': true,
42 'filter:api.search.video-channels.index.list.result': true,
43 'filter:api.search.video-playlists.local.list.params': true,
44 'filter:api.search.video-playlists.local.list.result': true,
45 'filter:api.search.video-playlists.index.list.params': true,
46 'filter:api.search.video-playlists.index.list.result': true,
47
48 // Filter the result of the get function
49 // Used to get detailed video information (video watch page for example)
50 'filter:api.video.get.result': true,
51
52 // Filter params/results when listing video channels
53 'filter:api.video-channels.list.params': true,
54 'filter:api.video-channels.list.result': true,
55
56 // Filter the result when getting a video channel
57 'filter:api.video-channel.get.result': true,
58
59 // Filter the result of the accept upload/live, import via torrent/url functions
60 // If this function returns false then the upload is aborted with an error
61 'filter:api.video.upload.accept.result': true,
62 'filter:api.live-video.create.accept.result': true,
63 'filter:api.video.pre-import-url.accept.result': true,
64 'filter:api.video.pre-import-torrent.accept.result': true,
65 'filter:api.video.post-import-url.accept.result': true,
66 'filter:api.video.post-import-torrent.accept.result': true,
67 'filter:api.video.update-file.accept.result': true,
68 // Filter the result of the accept comment (thread or reply) functions
69 // If the functions return false then the user cannot post its comment
70 'filter:api.video-thread.create.accept.result': true,
71 'filter:api.video-comment-reply.create.accept.result': true,
72
73 // Filter attributes when creating video object
74 'filter:api.video.upload.video-attribute.result': true,
75 'filter:api.video.import-url.video-attribute.result': true,
76 'filter:api.video.import-torrent.video-attribute.result': true,
77 'filter:api.video.live.video-attribute.result': true,
78
79 // Filter params/result used to list threads of a specific video
80 // (used by the video watch page)
81 'filter:api.video-threads.list.params': true,
82 'filter:api.video-threads.list.result': true,
83
84 // Filter params/result used to list replies of a specific thread
85 // (used by the video watch page when we click on the "View replies" button)
86 'filter:api.video-thread-comments.list.params': true,
87 'filter:api.video-thread-comments.list.result': true,
88
89 // Filter get stats result
90 'filter:api.server.stats.get.result': true,
91
92 // Filter result used to check if we need to auto blacklist a video
93 // (fired when a local or remote video is created or updated)
94 'filter:video.auto-blacklist.result': true,
95
96 // Filter result used to check if a user can register on the instance
97 'filter:api.user.signup.allowed.result': true,
98
99 // Filter result used to check if a user can send a registration request on the instance
100 // PeerTube >= 5.1
101 'filter:api.user.request-signup.allowed.result': true,
102
103 // Filter result used to check if video/torrent download is allowed
104 'filter:api.download.video.allowed.result': true,
105 'filter:api.download.torrent.allowed.result': true,
106
107 // Filter result to check if the embed is allowed for a particular request
108 'filter:html.embed.video.allowed.result': true,
109 'filter:html.embed.video-playlist.allowed.result': true,
110
111 // Peertube >= 5.2
112 'filter:html.client.json-ld.result': true,
113
114 'filter:job-queue.process.params': true,
115 'filter:job-queue.process.result': true,
116
117 'filter:transcoding.manual.resolutions-to-transcode.result': true,
118 'filter:transcoding.auto.resolutions-to-transcode.result': true,
119
120 'filter:activity-pub.remote-video-comment.create.accept.result': true,
121
122 'filter:activity-pub.activity.context.build.result': true,
123
124 // Filter the result of video JSON LD builder
125 // You may also need to use filter:activity-pub.activity.context.build.result to also update JSON LD context
126 'filter:activity-pub.video.json-ld.build.result': true,
127
128 // Filter result to allow custom XMLNS definitions in podcast RSS feeds
129 // Peertube >= 5.2
130 'filter:feed.podcast.rss.create-custom-xmlns.result': true,
131
132 // Filter result to allow custom tags in podcast RSS feeds
133 // Peertube >= 5.2
134 'filter:feed.podcast.channel.create-custom-tags.result': true,
135 // Peertube >= 5.2
136 'filter:feed.podcast.video.create-custom-tags.result': true
137}
138
139export type ServerFilterHookName = keyof typeof serverFilterHookObject
140
141export const serverActionHookObject = {
142 // Fired when the application has been loaded and is listening HTTP requests
143 'action:application.listening': true,
144
145 // Fired when a new notification is created
146 'action:notifier.notification.created': true,
147
148 // API actions hooks give access to the original express `req` and `res` parameters
149
150 // Fired when a local video is updated
151 'action:api.video.updated': true,
152 // Fired when a local video is deleted
153 'action:api.video.deleted': true,
154 // Fired when a local video is uploaded
155 'action:api.video.uploaded': true,
156 // Fired when a local video is viewed
157 'action:api.video.viewed': true,
158
159 // Fired when a local video file has been replaced by a new one
160 'action:api.video.file-updated': true,
161
162 // Fired when a video channel is created
163 'action:api.video-channel.created': true,
164 // Fired when a video channel is updated
165 'action:api.video-channel.updated': true,
166 // Fired when a video channel is deleted
167 'action:api.video-channel.deleted': true,
168
169 // Fired when a live video is created
170 'action:api.live-video.created': true,
171 // Fired when a live video starts or ends
172 // Peertube >= 5.2
173 'action:live.video.state.updated': true,
174
175 // Fired when a thread is created
176 'action:api.video-thread.created': true,
177 // Fired when a reply to a thread is created
178 'action:api.video-comment-reply.created': true,
179 // Fired when a comment (thread or reply) is deleted
180 'action:api.video-comment.deleted': true,
181
182 // Fired when a caption is created
183 'action:api.video-caption.created': true,
184 // Fired when a caption is deleted
185 'action:api.video-caption.deleted': true,
186
187 // Fired when a user is blocked (banned)
188 'action:api.user.blocked': true,
189 // Fired when a user is unblocked (unbanned)
190 'action:api.user.unblocked': true,
191 // Fired when a user registered on the instance
192 'action:api.user.registered': true,
193 // Fired when a user requested registration on the instance
194 // PeerTube >= 5.1
195 'action:api.user.requested-registration': true,
196 // Fired when an admin/moderator created a user
197 'action:api.user.created': true,
198 // Fired when a user is removed by an admin/moderator
199 'action:api.user.deleted': true,
200 // Fired when a user is updated by an admin/moderator
201 'action:api.user.updated': true,
202
203 // Fired when a user got a new oauth2 token
204 'action:api.user.oauth2-got-token': true,
205
206 // Fired when a video is added to a playlist
207 'action:api.video-playlist-element.created': true,
208
209 // Fired when a remote video has been created/updated
210 'action:activity-pub.remote-video.created': true,
211 'action:activity-pub.remote-video.updated': true
212}
213
214export type ServerActionHookName = keyof typeof serverActionHookObject
215
216export const serverHookObject = Object.assign({}, serverFilterHookObject, serverActionHookObject)
217export type ServerHookName = keyof typeof serverHookObject
218
219export interface ServerHook {
220 runHook <T> (hookName: ServerHookName, result?: T, params?: any): Promise<T>
221}
diff --git a/shared/models/plugins/server/settings/index.ts b/shared/models/plugins/server/settings/index.ts
deleted file mode 100644
index b456de019..000000000
--- a/shared/models/plugins/server/settings/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './public-server.setting'
2export * from './register-server-setting.model'
diff --git a/shared/models/plugins/server/settings/public-server.setting.ts b/shared/models/plugins/server/settings/public-server.setting.ts
deleted file mode 100644
index d38e5424a..000000000
--- a/shared/models/plugins/server/settings/public-server.setting.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1import { SettingEntries } from '../managers/plugin-settings-manager.model'
2
3export interface PublicServerSetting {
4 publicSettings: SettingEntries
5}
diff --git a/shared/models/plugins/server/settings/register-server-setting.model.ts b/shared/models/plugins/server/settings/register-server-setting.model.ts
deleted file mode 100644
index d9a798cac..000000000
--- a/shared/models/plugins/server/settings/register-server-setting.model.ts
+++ /dev/null
@@ -1,12 +0,0 @@
1import { RegisterClientFormFieldOptions } from '../../client'
2
3export type RegisterServerSettingOptions = RegisterClientFormFieldOptions & {
4 // If the setting is not private, anyone can view its value (client code included)
5 // If the setting is private, only server-side hooks can access it
6 // Mainly used by the PeerTube client to get admin config
7 private: boolean
8}
9
10export interface RegisteredServerSettings {
11 registeredSettings: RegisterServerSettingOptions[]
12}
diff --git a/shared/models/redundancy/index.ts b/shared/models/redundancy/index.ts
deleted file mode 100644
index 641a5d625..000000000
--- a/shared/models/redundancy/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export * from './video-redundancies-filters.model'
2export * from './video-redundancy-config-filter.type'
3export * from './video-redundancy.model'
4export * from './videos-redundancy-strategy.model'
diff --git a/shared/models/redundancy/video-redundancies-filters.model.ts b/shared/models/redundancy/video-redundancies-filters.model.ts
deleted file mode 100644
index 05ba7dfd3..000000000
--- a/shared/models/redundancy/video-redundancies-filters.model.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type VideoRedundanciesTarget = 'my-videos' | 'remote-videos'
diff --git a/shared/models/redundancy/video-redundancy-config-filter.type.ts b/shared/models/redundancy/video-redundancy-config-filter.type.ts
deleted file mode 100644
index bb1ae701c..000000000
--- a/shared/models/redundancy/video-redundancy-config-filter.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type VideoRedundancyConfigFilter = 'nobody' | 'anybody' | 'followings'
diff --git a/shared/models/redundancy/video-redundancy.model.ts b/shared/models/redundancy/video-redundancy.model.ts
deleted file mode 100644
index fa6e05832..000000000
--- a/shared/models/redundancy/video-redundancy.model.ts
+++ /dev/null
@@ -1,35 +0,0 @@
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-strategy.model.ts b/shared/models/redundancy/videos-redundancy-strategy.model.ts
deleted file mode 100644
index 15409abf0..000000000
--- a/shared/models/redundancy/videos-redundancy-strategy.model.ts
+++ /dev/null
@@ -1,23 +0,0 @@
1export type VideoRedundancyStrategy = 'most-views' | 'trending' | 'recently-added'
2export type VideoRedundancyStrategyWithManual = VideoRedundancyStrategy | 'manual'
3
4export type MostViewsRedundancyStrategy = {
5 strategy: 'most-views'
6 size: number
7 minLifetime: number
8}
9
10export type TrendingRedundancyStrategy = {
11 strategy: 'trending'
12 size: number
13 minLifetime: number
14}
15
16export type RecentlyAddedStrategy = {
17 strategy: 'recently-added'
18 size: number
19 minViews: number
20 minLifetime: number
21}
22
23export type VideosRedundancyStrategy = MostViewsRedundancyStrategy | TrendingRedundancyStrategy | RecentlyAddedStrategy
diff --git a/shared/models/runners/abort-runner-job-body.model.ts b/shared/models/runners/abort-runner-job-body.model.ts
deleted file mode 100644
index 0b9c46c91..000000000
--- a/shared/models/runners/abort-runner-job-body.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface AbortRunnerJobBody {
2 runnerToken: string
3 jobToken: string
4
5 reason: string
6}
diff --git a/shared/models/runners/accept-runner-job-body.model.ts b/shared/models/runners/accept-runner-job-body.model.ts
deleted file mode 100644
index cb266c4e6..000000000
--- a/shared/models/runners/accept-runner-job-body.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface AcceptRunnerJobBody {
2 runnerToken: string
3}
diff --git a/shared/models/runners/accept-runner-job-result.model.ts b/shared/models/runners/accept-runner-job-result.model.ts
deleted file mode 100644
index f2094b945..000000000
--- a/shared/models/runners/accept-runner-job-result.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1import { RunnerJobPayload } from './runner-job-payload.model'
2import { RunnerJob } from './runner-job.model'
3
4export interface AcceptRunnerJobResult <T extends RunnerJobPayload = RunnerJobPayload> {
5 job: RunnerJob<T> & { jobToken: string }
6}
diff --git a/shared/models/runners/error-runner-job-body.model.ts b/shared/models/runners/error-runner-job-body.model.ts
deleted file mode 100644
index ac8568409..000000000
--- a/shared/models/runners/error-runner-job-body.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface ErrorRunnerJobBody {
2 runnerToken: string
3 jobToken: string
4
5 message: string
6}
diff --git a/shared/models/runners/index.ts b/shared/models/runners/index.ts
deleted file mode 100644
index a52b82d2e..000000000
--- a/shared/models/runners/index.ts
+++ /dev/null
@@ -1,21 +0,0 @@
1export * from './abort-runner-job-body.model'
2export * from './accept-runner-job-body.model'
3export * from './accept-runner-job-result.model'
4export * from './error-runner-job-body.model'
5export * from './list-runner-jobs-query.model'
6export * from './list-runner-registration-tokens.model'
7export * from './list-runners-query.model'
8export * from './register-runner-body.model'
9export * from './register-runner-result.model'
10export * from './request-runner-job-body.model'
11export * from './request-runner-job-result.model'
12export * from './runner-job-payload.model'
13export * from './runner-job-private-payload.model'
14export * from './runner-job-state.model'
15export * from './runner-job-success-body.model'
16export * from './runner-job-type.type'
17export * from './runner-job-update-body.model'
18export * from './runner-job.model'
19export * from './runner-registration-token'
20export * from './runner.model'
21export * from './unregister-runner-body.model'
diff --git a/shared/models/runners/list-runner-jobs-query.model.ts b/shared/models/runners/list-runner-jobs-query.model.ts
deleted file mode 100644
index ef19b31fa..000000000
--- a/shared/models/runners/list-runner-jobs-query.model.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1import { RunnerJobState } from './runner-job-state.model'
2
3export interface ListRunnerJobsQuery {
4 start?: number
5 count?: number
6 sort?: string
7 search?: string
8 stateOneOf?: RunnerJobState[]
9}
diff --git a/shared/models/runners/list-runner-registration-tokens.model.ts b/shared/models/runners/list-runner-registration-tokens.model.ts
deleted file mode 100644
index 872e059cf..000000000
--- a/shared/models/runners/list-runner-registration-tokens.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface ListRunnerRegistrationTokensQuery {
2 start?: number
3 count?: number
4 sort?: string
5}
diff --git a/shared/models/runners/list-runners-query.model.ts b/shared/models/runners/list-runners-query.model.ts
deleted file mode 100644
index d4362e4c5..000000000
--- a/shared/models/runners/list-runners-query.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface ListRunnersQuery {
2 start?: number
3 count?: number
4 sort?: string
5}
diff --git a/shared/models/runners/register-runner-body.model.ts b/shared/models/runners/register-runner-body.model.ts
deleted file mode 100644
index 969bb35e1..000000000
--- a/shared/models/runners/register-runner-body.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface RegisterRunnerBody {
2 registrationToken: string
3
4 name: string
5 description?: string
6}
diff --git a/shared/models/runners/register-runner-result.model.ts b/shared/models/runners/register-runner-result.model.ts
deleted file mode 100644
index e31776c6a..000000000
--- a/shared/models/runners/register-runner-result.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface RegisterRunnerResult {
2 id: number
3 runnerToken: string
4}
diff --git a/shared/models/runners/request-runner-job-body.model.ts b/shared/models/runners/request-runner-job-body.model.ts
deleted file mode 100644
index 0970d9007..000000000
--- a/shared/models/runners/request-runner-job-body.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface RequestRunnerJobBody {
2 runnerToken: string
3}
diff --git a/shared/models/runners/request-runner-job-result.model.ts b/shared/models/runners/request-runner-job-result.model.ts
deleted file mode 100644
index 98601c42c..000000000
--- a/shared/models/runners/request-runner-job-result.model.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1import { RunnerJobPayload } from './runner-job-payload.model'
2import { RunnerJobType } from './runner-job-type.type'
3
4export interface RequestRunnerJobResult <P extends RunnerJobPayload = RunnerJobPayload> {
5 availableJobs: {
6 uuid: string
7 type: RunnerJobType
8 payload: P
9 }[]
10}
diff --git a/shared/models/runners/runner-job-payload.model.ts b/shared/models/runners/runner-job-payload.model.ts
deleted file mode 100644
index 3dda6c51f..000000000
--- a/shared/models/runners/runner-job-payload.model.ts
+++ /dev/null
@@ -1,79 +0,0 @@
1import { VideoStudioTaskPayload } from '../server'
2
3export type RunnerJobVODPayload =
4 RunnerJobVODWebVideoTranscodingPayload |
5 RunnerJobVODHLSTranscodingPayload |
6 RunnerJobVODAudioMergeTranscodingPayload
7
8export type RunnerJobPayload =
9 RunnerJobVODPayload |
10 RunnerJobLiveRTMPHLSTranscodingPayload |
11 RunnerJobStudioTranscodingPayload
12
13// ---------------------------------------------------------------------------
14
15export interface RunnerJobVODWebVideoTranscodingPayload {
16 input: {
17 videoFileUrl: string
18 }
19
20 output: {
21 resolution: number
22 fps: number
23 }
24}
25
26export interface RunnerJobVODHLSTranscodingPayload {
27 input: {
28 videoFileUrl: string
29 }
30
31 output: {
32 resolution: number
33 fps: number
34 }
35}
36
37export interface RunnerJobVODAudioMergeTranscodingPayload {
38 input: {
39 audioFileUrl: string
40 previewFileUrl: string
41 }
42
43 output: {
44 resolution: number
45 fps: number
46 }
47}
48
49export interface RunnerJobStudioTranscodingPayload {
50 input: {
51 videoFileUrl: string
52 }
53
54 tasks: VideoStudioTaskPayload[]
55}
56
57// ---------------------------------------------------------------------------
58
59export function isAudioMergeTranscodingPayload (payload: RunnerJobPayload): payload is RunnerJobVODAudioMergeTranscodingPayload {
60 return !!(payload as RunnerJobVODAudioMergeTranscodingPayload).input.audioFileUrl
61}
62
63// ---------------------------------------------------------------------------
64
65export interface RunnerJobLiveRTMPHLSTranscodingPayload {
66 input: {
67 rtmpUrl: string
68 }
69
70 output: {
71 toTranscode: {
72 resolution: number
73 fps: number
74 }[]
75
76 segmentDuration: number
77 segmentListSize: number
78 }
79}
diff --git a/shared/models/runners/runner-job-private-payload.model.ts b/shared/models/runners/runner-job-private-payload.model.ts
deleted file mode 100644
index 529034db8..000000000
--- a/shared/models/runners/runner-job-private-payload.model.ts
+++ /dev/null
@@ -1,45 +0,0 @@
1import { VideoStudioTaskPayload } from '../server'
2
3export type RunnerJobVODPrivatePayload =
4 RunnerJobVODWebVideoTranscodingPrivatePayload |
5 RunnerJobVODAudioMergeTranscodingPrivatePayload |
6 RunnerJobVODHLSTranscodingPrivatePayload
7
8export type RunnerJobPrivatePayload =
9 RunnerJobVODPrivatePayload |
10 RunnerJobLiveRTMPHLSTranscodingPrivatePayload |
11 RunnerJobVideoStudioTranscodingPrivatePayload
12
13// ---------------------------------------------------------------------------
14
15export interface RunnerJobVODWebVideoTranscodingPrivatePayload {
16 videoUUID: string
17 isNewVideo: boolean
18}
19
20export interface RunnerJobVODAudioMergeTranscodingPrivatePayload {
21 videoUUID: string
22 isNewVideo: boolean
23}
24
25export interface RunnerJobVODHLSTranscodingPrivatePayload {
26 videoUUID: string
27 isNewVideo: boolean
28 deleteWebVideoFiles: boolean
29}
30
31// ---------------------------------------------------------------------------
32
33export interface RunnerJobLiveRTMPHLSTranscodingPrivatePayload {
34 videoUUID: string
35 masterPlaylistName: string
36 outputDirectory: string
37 sessionId: string
38}
39
40// ---------------------------------------------------------------------------
41
42export interface RunnerJobVideoStudioTranscodingPrivatePayload {
43 videoUUID: string
44 originalTasks: VideoStudioTaskPayload[]
45}
diff --git a/shared/models/runners/runner-job-state.model.ts b/shared/models/runners/runner-job-state.model.ts
deleted file mode 100644
index 7ed34b3bf..000000000
--- a/shared/models/runners/runner-job-state.model.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1export enum RunnerJobState {
2 PENDING = 1,
3 PROCESSING = 2,
4 COMPLETED = 3,
5 ERRORED = 4,
6 WAITING_FOR_PARENT_JOB = 5,
7 CANCELLED = 6,
8 PARENT_ERRORED = 7,
9 PARENT_CANCELLED = 8,
10 COMPLETING = 9
11}
diff --git a/shared/models/runners/runner-job-success-body.model.ts b/shared/models/runners/runner-job-success-body.model.ts
deleted file mode 100644
index f45336b05..000000000
--- a/shared/models/runners/runner-job-success-body.model.ts
+++ /dev/null
@@ -1,46 +0,0 @@
1export interface RunnerJobSuccessBody {
2 runnerToken: string
3 jobToken: string
4
5 payload: RunnerJobSuccessPayload
6}
7
8// ---------------------------------------------------------------------------
9
10export type RunnerJobSuccessPayload =
11 VODWebVideoTranscodingSuccess |
12 VODHLSTranscodingSuccess |
13 VODAudioMergeTranscodingSuccess |
14 LiveRTMPHLSTranscodingSuccess |
15 VideoStudioTranscodingSuccess
16
17export interface VODWebVideoTranscodingSuccess {
18 videoFile: Blob | string
19}
20
21export interface VODHLSTranscodingSuccess {
22 videoFile: Blob | string
23 resolutionPlaylistFile: Blob | string
24}
25
26export interface VODAudioMergeTranscodingSuccess {
27 videoFile: Blob | string
28}
29
30export interface LiveRTMPHLSTranscodingSuccess {
31
32}
33
34export interface VideoStudioTranscodingSuccess {
35 videoFile: Blob | string
36}
37
38export function isWebVideoOrAudioMergeTranscodingPayloadSuccess (
39 payload: RunnerJobSuccessPayload
40): payload is VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess {
41 return !!(payload as VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess)?.videoFile
42}
43
44export function isHLSTranscodingPayloadSuccess (payload: RunnerJobSuccessPayload): payload is VODHLSTranscodingSuccess {
45 return !!(payload as VODHLSTranscodingSuccess)?.resolutionPlaylistFile
46}
diff --git a/shared/models/runners/runner-job-type.type.ts b/shared/models/runners/runner-job-type.type.ts
deleted file mode 100644
index 91b92a729..000000000
--- a/shared/models/runners/runner-job-type.type.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export type RunnerJobType =
2 'vod-web-video-transcoding' |
3 'vod-hls-transcoding' |
4 'vod-audio-merge-transcoding' |
5 'live-rtmp-hls-transcoding' |
6 'video-studio-transcoding'
diff --git a/shared/models/runners/runner-job-update-body.model.ts b/shared/models/runners/runner-job-update-body.model.ts
deleted file mode 100644
index ed94bbe63..000000000
--- a/shared/models/runners/runner-job-update-body.model.ts
+++ /dev/null
@@ -1,28 +0,0 @@
1export interface RunnerJobUpdateBody {
2 runnerToken: string
3 jobToken: string
4
5 progress?: number
6 payload?: RunnerJobUpdatePayload
7}
8
9// ---------------------------------------------------------------------------
10
11export type RunnerJobUpdatePayload = LiveRTMPHLSTranscodingUpdatePayload
12
13export interface LiveRTMPHLSTranscodingUpdatePayload {
14 type: 'add-chunk' | 'remove-chunk'
15
16 masterPlaylistFile?: Blob | string
17
18 resolutionPlaylistFilename?: string
19 resolutionPlaylistFile?: Blob | string
20
21 videoChunkFilename: string
22 videoChunkFile?: Blob | string
23}
24
25export function isLiveRTMPHLSTranscodingUpdatePayload (value: RunnerJobUpdatePayload): value is LiveRTMPHLSTranscodingUpdatePayload {
26 // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
27 return !!(value as LiveRTMPHLSTranscodingUpdatePayload)?.videoChunkFilename
28}
diff --git a/shared/models/runners/runner-job.model.ts b/shared/models/runners/runner-job.model.ts
deleted file mode 100644
index 080093563..000000000
--- a/shared/models/runners/runner-job.model.ts
+++ /dev/null
@@ -1,45 +0,0 @@
1import { VideoConstant } from '../videos'
2import { RunnerJobPayload } from './runner-job-payload.model'
3import { RunnerJobPrivatePayload } from './runner-job-private-payload.model'
4import { RunnerJobState } from './runner-job-state.model'
5import { RunnerJobType } from './runner-job-type.type'
6
7export interface RunnerJob <T extends RunnerJobPayload = RunnerJobPayload> {
8 uuid: string
9
10 type: RunnerJobType
11
12 state: VideoConstant<RunnerJobState>
13
14 payload: T
15
16 failures: number
17 error: string | null
18
19 progress: number
20 priority: number
21
22 startedAt: Date | string
23 createdAt: Date | string
24 updatedAt: Date | string
25 finishedAt: Date | string
26
27 parent?: {
28 type: RunnerJobType
29 state: VideoConstant<RunnerJobState>
30 uuid: string
31 }
32
33 // If associated to a runner
34 runner?: {
35 id: number
36 name: string
37
38 description: string
39 }
40}
41
42// eslint-disable-next-line max-len
43export interface RunnerJobAdmin <T extends RunnerJobPayload = RunnerJobPayload, U extends RunnerJobPrivatePayload = RunnerJobPrivatePayload> extends RunnerJob<T> {
44 privatePayload: U
45}
diff --git a/shared/models/runners/runner-registration-token.ts b/shared/models/runners/runner-registration-token.ts
deleted file mode 100644
index 0a157aa51..000000000
--- a/shared/models/runners/runner-registration-token.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1export interface RunnerRegistrationToken {
2 id: number
3
4 registrationToken: string
5
6 createdAt: Date
7 updatedAt: Date
8
9 registeredRunnersCount: number
10}
diff --git a/shared/models/runners/runner.model.ts b/shared/models/runners/runner.model.ts
deleted file mode 100644
index 3284f2992..000000000
--- a/shared/models/runners/runner.model.ts
+++ /dev/null
@@ -1,12 +0,0 @@
1export interface Runner {
2 id: number
3
4 name: string
5 description: string
6
7 ip: string
8 lastContact: Date | string
9
10 createdAt: Date | string
11 updatedAt: Date | string
12}
diff --git a/shared/models/runners/unregister-runner-body.model.ts b/shared/models/runners/unregister-runner-body.model.ts
deleted file mode 100644
index d3465c5d6..000000000
--- a/shared/models/runners/unregister-runner-body.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface UnregisterRunnerBody {
2 runnerToken: string
3}
diff --git a/shared/models/search/boolean-both-query.model.ts b/shared/models/search/boolean-both-query.model.ts
deleted file mode 100644
index d6a438249..000000000
--- a/shared/models/search/boolean-both-query.model.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export type BooleanBothQuery = 'true' | 'false' | 'both'
2export type BooleanQuery = 'true' | 'false'
diff --git a/shared/models/search/index.ts b/shared/models/search/index.ts
deleted file mode 100644
index 50aeeddc8..000000000
--- a/shared/models/search/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export * from './boolean-both-query.model'
2export * from './search-target-query.model'
3export * from './videos-common-query.model'
4export * from './video-channels-search-query.model'
5export * from './video-playlists-search-query.model'
6export * from './videos-search-query.model'
diff --git a/shared/models/search/search-target-query.model.ts b/shared/models/search/search-target-query.model.ts
deleted file mode 100644
index 3bb2e0d31..000000000
--- a/shared/models/search/search-target-query.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export type SearchTargetType = 'local' | 'search-index'
2
3export interface SearchTargetQuery {
4 searchTarget?: SearchTargetType
5}
diff --git a/shared/models/search/video-channels-search-query.model.ts b/shared/models/search/video-channels-search-query.model.ts
deleted file mode 100644
index b68a1e80b..000000000
--- a/shared/models/search/video-channels-search-query.model.ts
+++ /dev/null
@@ -1,18 +0,0 @@
1import { SearchTargetQuery } from './search-target-query.model'
2
3export interface VideoChannelsSearchQuery extends SearchTargetQuery {
4 search?: string
5
6 start?: number
7 count?: number
8 sort?: string
9
10 host?: string
11 handles?: string[]
12}
13
14export interface VideoChannelsSearchQueryAfterSanitize extends VideoChannelsSearchQuery {
15 start: number
16 count: number
17 sort: string
18}
diff --git a/shared/models/search/video-playlists-search-query.model.ts b/shared/models/search/video-playlists-search-query.model.ts
deleted file mode 100644
index d9027eb5b..000000000
--- a/shared/models/search/video-playlists-search-query.model.ts
+++ /dev/null
@@ -1,20 +0,0 @@
1import { SearchTargetQuery } from './search-target-query.model'
2
3export interface VideoPlaylistsSearchQuery extends SearchTargetQuery {
4 search?: string
5
6 start?: number
7 count?: number
8 sort?: string
9
10 host?: string
11
12 // UUIDs or short UUIDs
13 uuids?: string[]
14}
15
16export interface VideoPlaylistsSearchQueryAfterSanitize extends VideoPlaylistsSearchQuery {
17 start: number
18 count: number
19 sort: string
20}
diff --git a/shared/models/search/videos-common-query.model.ts b/shared/models/search/videos-common-query.model.ts
deleted file mode 100644
index f783d7534..000000000
--- a/shared/models/search/videos-common-query.model.ts
+++ /dev/null
@@ -1,45 +0,0 @@
1import { VideoPrivacy } from '@shared/models'
2import { VideoInclude } from '../videos/video-include.enum'
3import { BooleanBothQuery } from './boolean-both-query.model'
4
5// These query parameters can be used with any endpoint that list videos
6export interface VideosCommonQuery {
7 start?: number
8 count?: number
9 sort?: string
10
11 nsfw?: BooleanBothQuery
12
13 isLive?: boolean
14
15 isLocal?: boolean
16 include?: VideoInclude
17
18 categoryOneOf?: number[]
19
20 licenceOneOf?: number[]
21
22 languageOneOf?: string[]
23
24 privacyOneOf?: VideoPrivacy[]
25
26 tagsOneOf?: string[]
27 tagsAllOf?: string[]
28
29 hasHLSFiles?: boolean
30
31 hasWebtorrentFiles?: boolean // TODO: remove in v7
32 hasWebVideoFiles?: boolean
33
34 skipCount?: boolean
35
36 search?: string
37
38 excludeAlreadyWatched?: boolean
39}
40
41export interface VideosCommonQueryAfterSanitize extends VideosCommonQuery {
42 start: number
43 count: number
44 sort: string
45}
diff --git a/shared/models/search/videos-search-query.model.ts b/shared/models/search/videos-search-query.model.ts
deleted file mode 100644
index a5436879d..000000000
--- a/shared/models/search/videos-search-query.model.ts
+++ /dev/null
@@ -1,26 +0,0 @@
1import { SearchTargetQuery } from './search-target-query.model'
2import { VideosCommonQuery } from './videos-common-query.model'
3
4export interface VideosSearchQuery extends SearchTargetQuery, VideosCommonQuery {
5 search?: string
6
7 host?: string
8
9 startDate?: string // ISO 8601
10 endDate?: string // ISO 8601
11
12 originallyPublishedStartDate?: string // ISO 8601
13 originallyPublishedEndDate?: string // ISO 8601
14
15 durationMin?: number // seconds
16 durationMax?: number // seconds
17
18 // UUIDs or short UUIDs
19 uuids?: string[]
20}
21
22export interface VideosSearchQueryAfterSanitize extends VideosSearchQuery {
23 start: number
24 count: number
25 sort: string
26}
diff --git a/shared/models/server/about.model.ts b/shared/models/server/about.model.ts
deleted file mode 100644
index 6d4ba63c4..000000000
--- a/shared/models/server/about.model.ts
+++ /dev/null
@@ -1,20 +0,0 @@
1export interface About {
2 instance: {
3 name: string
4 shortDescription: string
5 description: string
6 terms: string
7
8 codeOfConduct: string
9 hardwareInformation: string
10
11 creationReason: string
12 moderationInformation: string
13 administrator: string
14 maintenanceLifetime: string
15 businessModel: string
16
17 languages: string[]
18 categories: number[]
19 }
20}
diff --git a/shared/models/server/broadcast-message-level.type.ts b/shared/models/server/broadcast-message-level.type.ts
deleted file mode 100644
index bf43e18b5..000000000
--- a/shared/models/server/broadcast-message-level.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type BroadcastMessageLevel = 'info' | 'warning' | 'error'
diff --git a/shared/models/server/client-log-create.model.ts b/shared/models/server/client-log-create.model.ts
deleted file mode 100644
index c9dc65568..000000000
--- a/shared/models/server/client-log-create.model.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1import { ClientLogLevel } from './client-log-level.type'
2
3export interface ClientLogCreate {
4 message: string
5 url: string
6 level: ClientLogLevel
7
8 stackTrace?: string
9 userAgent?: string
10 meta?: string
11}
diff --git a/shared/models/server/client-log-level.type.ts b/shared/models/server/client-log-level.type.ts
deleted file mode 100644
index 18dea2751..000000000
--- a/shared/models/server/client-log-level.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type ClientLogLevel = 'warn' | 'error'
diff --git a/shared/models/server/contact-form.model.ts b/shared/models/server/contact-form.model.ts
deleted file mode 100644
index c23e6d1ba..000000000
--- a/shared/models/server/contact-form.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface ContactForm {
2 fromEmail: string
3 fromName: string
4 subject: string
5 body: string
6}
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
deleted file mode 100644
index 0dbb46fa8..000000000
--- a/shared/models/server/custom-config.model.ts
+++ /dev/null
@@ -1,259 +0,0 @@
1import { NSFWPolicyType } from '../videos/nsfw-policy.type'
2import { BroadcastMessageLevel } from './broadcast-message-level.type'
3
4export type ConfigResolutions = {
5 '144p': boolean
6 '240p': boolean
7 '360p': boolean
8 '480p': boolean
9 '720p': boolean
10 '1080p': boolean
11 '1440p': boolean
12 '2160p': boolean
13}
14
15export interface CustomConfig {
16 instance: {
17 name: string
18 shortDescription: string
19 description: string
20 terms: string
21 codeOfConduct: string
22
23 creationReason: string
24 moderationInformation: string
25 administrator: string
26 maintenanceLifetime: string
27 businessModel: string
28 hardwareInformation: string
29
30 languages: string[]
31 categories: number[]
32
33 isNSFW: boolean
34 defaultNSFWPolicy: NSFWPolicyType
35
36 defaultClientRoute: string
37
38 customizations: {
39 javascript?: string
40 css?: string
41 }
42 }
43
44 theme: {
45 default: string
46 }
47
48 services: {
49 twitter: {
50 username: string
51 whitelisted: boolean
52 }
53 }
54
55 client: {
56 videos: {
57 miniature: {
58 preferAuthorDisplayName: boolean
59 }
60 }
61
62 menu: {
63 login: {
64 redirectOnSingleExternalAuth: boolean
65 }
66 }
67 }
68
69 cache: {
70 previews: {
71 size: number
72 }
73
74 captions: {
75 size: number
76 }
77
78 torrents: {
79 size: number
80 }
81
82 storyboards: {
83 size: number
84 }
85 }
86
87 signup: {
88 enabled: boolean
89 limit: number
90 requiresApproval: boolean
91 requiresEmailVerification: boolean
92 minimumAge: number
93 }
94
95 admin: {
96 email: string
97 }
98
99 contactForm: {
100 enabled: boolean
101 }
102
103 user: {
104 history: {
105 videos: {
106 enabled: boolean
107 }
108 }
109 videoQuota: number
110 videoQuotaDaily: number
111 }
112
113 videoChannels: {
114 maxPerUser: number
115 }
116
117 transcoding: {
118 enabled: boolean
119
120 allowAdditionalExtensions: boolean
121 allowAudioFiles: boolean
122
123 remoteRunners: {
124 enabled: boolean
125 }
126
127 threads: number
128 concurrency: number
129
130 profile: string
131
132 resolutions: ConfigResolutions & { '0p': boolean }
133
134 alwaysTranscodeOriginalResolution: boolean
135
136 webVideos: {
137 enabled: boolean
138 }
139
140 hls: {
141 enabled: boolean
142 }
143 }
144
145 live: {
146 enabled: boolean
147
148 allowReplay: boolean
149
150 latencySetting: {
151 enabled: boolean
152 }
153
154 maxDuration: number
155 maxInstanceLives: number
156 maxUserLives: number
157
158 transcoding: {
159 enabled: boolean
160 remoteRunners: {
161 enabled: boolean
162 }
163 threads: number
164 profile: string
165 resolutions: ConfigResolutions
166 alwaysTranscodeOriginalResolution: boolean
167 }
168 }
169
170 videoStudio: {
171 enabled: boolean
172
173 remoteRunners: {
174 enabled: boolean
175 }
176 }
177
178 videoFile: {
179 update: {
180 enabled: boolean
181 }
182 }
183
184 import: {
185 videos: {
186 concurrency: number
187
188 http: {
189 enabled: boolean
190 }
191 torrent: {
192 enabled: boolean
193 }
194 }
195 videoChannelSynchronization: {
196 enabled: boolean
197 maxPerUser: number
198 }
199 }
200
201 trending: {
202 videos: {
203 algorithms: {
204 enabled: string[]
205 default: string
206 }
207 }
208 }
209
210 autoBlacklist: {
211 videos: {
212 ofUsers: {
213 enabled: boolean
214 }
215 }
216 }
217
218 followers: {
219 instance: {
220 enabled: boolean
221 manualApproval: boolean
222 }
223 }
224
225 followings: {
226 instance: {
227 autoFollowBack: {
228 enabled: boolean
229 }
230
231 autoFollowIndex: {
232 enabled: boolean
233 indexUrl: string
234 }
235 }
236 }
237
238 broadcastMessage: {
239 enabled: boolean
240 message: string
241 level: BroadcastMessageLevel
242 dismissable: boolean
243 }
244
245 search: {
246 remoteUri: {
247 users: boolean
248 anonymous: boolean
249 }
250
251 searchIndex: {
252 enabled: boolean
253 url: string
254 disableLocalSearch: boolean
255 isDefaultSearch: boolean
256 }
257 }
258
259}
diff --git a/shared/models/server/debug.model.ts b/shared/models/server/debug.model.ts
deleted file mode 100644
index 41f2109af..000000000
--- a/shared/models/server/debug.model.ts
+++ /dev/null
@@ -1,12 +0,0 @@
1export interface Debug {
2 ip: string
3 activityPubMessagesWaiting: number
4}
5
6export interface SendDebugCommand {
7 command: 'remove-dandling-resumable-uploads'
8 | 'process-video-views-buffer'
9 | 'process-video-viewers'
10 | 'process-video-channel-sync-latest'
11 | 'process-update-videos-scheduler'
12}
diff --git a/shared/models/server/emailer.model.ts b/shared/models/server/emailer.model.ts
deleted file mode 100644
index 39512d306..000000000
--- a/shared/models/server/emailer.model.ts
+++ /dev/null
@@ -1,49 +0,0 @@
1type From = string | { name?: string, address: string }
2
3interface Base extends Partial<SendEmailDefaultMessageOptions> {
4 to: string[] | string
5}
6
7interface MailTemplate extends Base {
8 template: string
9 locals?: { [key: string]: any }
10 text?: undefined
11}
12
13interface MailText extends Base {
14 text: string
15
16 locals?: Partial<SendEmailDefaultLocalsOptions> & {
17 title?: string
18 action?: {
19 url: string
20 text: string
21 }
22 }
23}
24
25interface SendEmailDefaultLocalsOptions {
26 instanceName: string
27 text: string
28 subject: string
29}
30
31interface SendEmailDefaultMessageOptions {
32 to: string[] | string
33 from: From
34 subject: string
35 replyTo: string
36}
37
38export type SendEmailDefaultOptions = {
39 template: 'common'
40
41 message: SendEmailDefaultMessageOptions
42
43 locals: SendEmailDefaultLocalsOptions & {
44 WEBSERVER: any
45 EMAIL: any
46 }
47}
48
49export type SendEmailOptions = MailTemplate | MailText
diff --git a/shared/models/server/index.ts b/shared/models/server/index.ts
deleted file mode 100644
index a9136f3d4..000000000
--- a/shared/models/server/index.ts
+++ /dev/null
@@ -1,16 +0,0 @@
1export * from './about.model'
2export * from './broadcast-message-level.type'
3export * from './client-log-create.model'
4export * from './client-log-level.type'
5export * from './contact-form.model'
6export * from './custom-config.model'
7export * from './debug.model'
8export * from './emailer.model'
9export * from './job.model'
10export * from './peertube-problem-document.model'
11export * from './server-config.model'
12export * from './server-debug.model'
13export * from './server-error-code.enum'
14export * from './server-follow-create.model'
15export * from './server-log-level.type'
16export * from './server-stats.model'
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
deleted file mode 100644
index c14806dab..000000000
--- a/shared/models/server/job.model.ts
+++ /dev/null
@@ -1,304 +0,0 @@
1import { ContextType } from '../activitypub/context'
2import { VideoState } from '../videos'
3import { VideoResolution } from '../videos/file/video-resolution.enum'
4import { VideoStudioTaskCut } from '../videos/studio'
5import { SendEmailOptions } from './emailer.model'
6
7export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused' | 'waiting-children'
8
9export type JobType =
10 | 'activitypub-cleaner'
11 | 'activitypub-follow'
12 | 'activitypub-http-broadcast-parallel'
13 | 'activitypub-http-broadcast'
14 | 'activitypub-http-fetcher'
15 | 'activitypub-http-unicast'
16 | 'activitypub-refresher'
17 | 'actor-keys'
18 | 'after-video-channel-import'
19 | 'email'
20 | 'federate-video'
21 | 'transcoding-job-builder'
22 | 'manage-video-torrent'
23 | 'move-to-object-storage'
24 | 'notify'
25 | 'video-channel-import'
26 | 'video-file-import'
27 | 'video-import'
28 | 'video-live-ending'
29 | 'video-redundancy'
30 | 'video-studio-edition'
31 | 'video-transcoding'
32 | 'videos-views-stats'
33 | 'generate-video-storyboard'
34
35export interface Job {
36 id: number | string
37 state: JobState | 'unknown'
38 type: JobType
39 data: any
40 priority: number
41 progress: number
42 error: any
43 createdAt: Date | string
44 finishedOn: Date | string
45 processedOn: Date | string
46
47 parent?: {
48 id: string
49 }
50}
51
52export type ActivitypubHttpBroadcastPayload = {
53 uris: string[]
54 contextType: ContextType
55 body: any
56 signatureActorId?: number
57}
58
59export type ActivitypubFollowPayload = {
60 followerActorId: number
61 name: string
62 host: string
63 isAutoFollow?: boolean
64 assertIsChannel?: boolean
65}
66
67export type FetchType = 'activity' | 'video-shares' | 'video-comments' | 'account-playlists'
68export type ActivitypubHttpFetcherPayload = {
69 uri: string
70 type: FetchType
71 videoId?: number
72}
73
74export type ActivitypubHttpUnicastPayload = {
75 uri: string
76 contextType: ContextType
77 signatureActorId?: number
78 body: object
79}
80
81export type RefreshPayload = {
82 type: 'video' | 'video-playlist' | 'actor'
83 url: string
84}
85
86export type EmailPayload = SendEmailOptions
87
88export type VideoFileImportPayload = {
89 videoUUID: string
90 filePath: string
91}
92
93// ---------------------------------------------------------------------------
94
95export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
96export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
97
98export interface VideoImportYoutubeDLPayload {
99 type: VideoImportYoutubeDLPayloadType
100 videoImportId: number
101
102 fileExt?: string
103}
104
105export interface VideoImportTorrentPayload {
106 type: VideoImportTorrentPayloadType
107 videoImportId: number
108}
109
110export type VideoImportPayload = (VideoImportYoutubeDLPayload | VideoImportTorrentPayload) & {
111 preventException: boolean
112}
113
114export interface VideoImportPreventExceptionResult {
115 resultType: 'success' | 'error'
116}
117
118// ---------------------------------------------------------------------------
119
120export type VideoRedundancyPayload = {
121 videoId: number
122}
123
124export type ManageVideoTorrentPayload =
125 {
126 action: 'create'
127 videoId: number
128 videoFileId: number
129 } | {
130 action: 'update-metadata'
131
132 videoId?: number
133 streamingPlaylistId?: number
134
135 videoFileId: number
136 }
137
138// Video transcoding payloads
139
140interface BaseTranscodingPayload {
141 videoUUID: string
142 isNewVideo?: boolean
143}
144
145export interface HLSTranscodingPayload extends BaseTranscodingPayload {
146 type: 'new-resolution-to-hls'
147 resolution: VideoResolution
148 fps: number
149 copyCodecs: boolean
150
151 deleteWebVideoFiles: boolean
152}
153
154export interface NewWebVideoResolutionTranscodingPayload extends BaseTranscodingPayload {
155 type: 'new-resolution-to-web-video'
156 resolution: VideoResolution
157 fps: number
158}
159
160export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
161 type: 'merge-audio-to-web-video'
162
163 resolution: VideoResolution
164 fps: number
165
166 hasChildren: boolean
167}
168
169export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
170 type: 'optimize-to-web-video'
171
172 quickTranscode: boolean
173
174 hasChildren: boolean
175}
176
177export type VideoTranscodingPayload =
178 HLSTranscodingPayload
179 | NewWebVideoResolutionTranscodingPayload
180 | OptimizeTranscodingPayload
181 | MergeAudioTranscodingPayload
182
183export interface VideoLiveEndingPayload {
184 videoId: number
185 publishedAt: string
186 liveSessionId: number
187 streamingPlaylistId: number
188
189 replayDirectory?: string
190}
191
192export interface ActorKeysPayload {
193 actorId: number
194}
195
196export interface DeleteResumableUploadMetaFilePayload {
197 filepath: string
198}
199
200export interface MoveObjectStoragePayload {
201 videoUUID: string
202 isNewVideo: boolean
203 previousVideoState: VideoState
204}
205
206export type VideoStudioTaskCutPayload = VideoStudioTaskCut
207
208export type VideoStudioTaskIntroPayload = {
209 name: 'add-intro'
210
211 options: {
212 file: string
213 }
214}
215
216export type VideoStudioTaskOutroPayload = {
217 name: 'add-outro'
218
219 options: {
220 file: string
221 }
222}
223
224export type VideoStudioTaskWatermarkPayload = {
225 name: 'add-watermark'
226
227 options: {
228 file: string
229
230 watermarkSizeRatio: number
231 horitonzalMarginRatio: number
232 verticalMarginRatio: number
233 }
234}
235
236export type VideoStudioTaskPayload =
237 VideoStudioTaskCutPayload |
238 VideoStudioTaskIntroPayload |
239 VideoStudioTaskOutroPayload |
240 VideoStudioTaskWatermarkPayload
241
242export interface VideoStudioEditionPayload {
243 videoUUID: string
244 tasks: VideoStudioTaskPayload[]
245}
246
247// ---------------------------------------------------------------------------
248
249export interface VideoChannelImportPayload {
250 externalChannelUrl: string
251 videoChannelId: number
252
253 partOfChannelSyncId?: number
254}
255
256export interface AfterVideoChannelImportPayload {
257 channelSyncId: number
258}
259
260// ---------------------------------------------------------------------------
261
262export type NotifyPayload =
263 {
264 action: 'new-video'
265 videoUUID: string
266 }
267
268// ---------------------------------------------------------------------------
269
270export interface FederateVideoPayload {
271 videoUUID: string
272 isNewVideo: boolean
273}
274
275// ---------------------------------------------------------------------------
276
277export interface TranscodingJobBuilderPayload {
278 videoUUID: string
279
280 optimizeJob?: {
281 isNewVideo: boolean
282 }
283
284 // Array of jobs to create
285 jobs?: {
286 type: 'video-transcoding'
287 payload: VideoTranscodingPayload
288 priority?: number
289 }[]
290
291 // Array of sequential jobs to create
292 sequentialJobs?: {
293 type: 'video-transcoding'
294 payload: VideoTranscodingPayload
295 priority?: number
296 }[][]
297}
298
299// ---------------------------------------------------------------------------
300
301export interface GenerateStoryboardPayload {
302 videoUUID: string
303 federate: boolean
304}
diff --git a/shared/models/server/peertube-problem-document.model.ts b/shared/models/server/peertube-problem-document.model.ts
deleted file mode 100644
index 83d9cea9b..000000000
--- a/shared/models/server/peertube-problem-document.model.ts
+++ /dev/null
@@ -1,32 +0,0 @@
1import { HttpStatusCode } from '../../models'
2import { OAuth2ErrorCode, ServerErrorCode } from './server-error-code.enum'
3
4export interface PeerTubeProblemDocumentData {
5 'invalid-params'?: Record<string, object>
6
7 originUrl?: string
8
9 keyId?: string
10
11 targetUrl?: string
12
13 actorUrl?: string
14
15 // Feeds
16 format?: string
17 url?: string
18}
19
20export interface PeerTubeProblemDocument extends PeerTubeProblemDocumentData {
21 type: string
22 title: string
23
24 detail: string
25 // Compat PeerTube <= 3.2
26 error: string
27
28 status: HttpStatusCode
29
30 docs?: string
31 code?: ServerErrorCode | OAuth2ErrorCode
32}
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts
deleted file mode 100644
index 3f61e93b5..000000000
--- a/shared/models/server/server-config.model.ts
+++ /dev/null
@@ -1,305 +0,0 @@
1import { ClientScriptJSON } from '../plugins/plugin-package-json.model'
2import { NSFWPolicyType } from '../videos/nsfw-policy.type'
3import { VideoPrivacy } from '../videos/video-privacy.enum'
4import { BroadcastMessageLevel } from './broadcast-message-level.type'
5
6export interface ServerConfigPlugin {
7 name: string
8 npmName: string
9 version: string
10 description: string
11 clientScripts: { [name: string]: ClientScriptJSON }
12}
13
14export interface ServerConfigTheme extends ServerConfigPlugin {
15 css: string[]
16}
17
18export interface RegisteredExternalAuthConfig {
19 npmName: string
20 name: string
21 version: string
22 authName: string
23 authDisplayName: string
24}
25
26export interface RegisteredIdAndPassAuthConfig {
27 npmName: string
28 name: string
29 version: string
30 authName: string
31 weight: number
32}
33
34export interface ServerConfig {
35 serverVersion: string
36 serverCommit?: string
37
38 client: {
39 videos: {
40 miniature: {
41 displayAuthorAvatar: boolean
42 preferAuthorDisplayName: boolean
43 }
44 resumableUpload: {
45 maxChunkSize: number
46 }
47 }
48
49 menu: {
50 login: {
51 redirectOnSingleExternalAuth: boolean
52 }
53 }
54 }
55
56 defaults: {
57 publish: {
58 downloadEnabled: boolean
59 commentsEnabled: boolean
60 privacy: VideoPrivacy
61 licence: number
62 }
63
64 p2p: {
65 webapp: {
66 enabled: boolean
67 }
68
69 embed: {
70 enabled: boolean
71 }
72 }
73 }
74
75 webadmin: {
76 configuration: {
77 edition: {
78 allowed: boolean
79 }
80 }
81 }
82
83 instance: {
84 name: string
85 shortDescription: string
86 isNSFW: boolean
87 defaultNSFWPolicy: NSFWPolicyType
88 defaultClientRoute: string
89 customizations: {
90 javascript: string
91 css: string
92 }
93 }
94
95 search: {
96 remoteUri: {
97 users: boolean
98 anonymous: boolean
99 }
100
101 searchIndex: {
102 enabled: boolean
103 url: string
104 disableLocalSearch: boolean
105 isDefaultSearch: boolean
106 }
107 }
108
109 plugin: {
110 registered: ServerConfigPlugin[]
111
112 registeredExternalAuths: RegisteredExternalAuthConfig[]
113
114 registeredIdAndPassAuths: RegisteredIdAndPassAuthConfig[]
115 }
116
117 theme: {
118 registered: ServerConfigTheme[]
119 default: string
120 }
121
122 email: {
123 enabled: boolean
124 }
125
126 contactForm: {
127 enabled: boolean
128 }
129
130 signup: {
131 allowed: boolean
132 allowedForCurrentIP: boolean
133 requiresEmailVerification: boolean
134 requiresApproval: boolean
135 minimumAge: number
136 }
137
138 transcoding: {
139 hls: {
140 enabled: boolean
141 }
142
143 web_videos: {
144 enabled: boolean
145 }
146
147 enabledResolutions: number[]
148
149 profile: string
150 availableProfiles: string[]
151
152 remoteRunners: {
153 enabled: boolean
154 }
155 }
156
157 live: {
158 enabled: boolean
159
160 allowReplay: boolean
161 latencySetting: {
162 enabled: boolean
163 }
164
165 maxDuration: number
166 maxInstanceLives: number
167 maxUserLives: number
168
169 transcoding: {
170 enabled: boolean
171
172 remoteRunners: {
173 enabled: boolean
174 }
175
176 enabledResolutions: number[]
177
178 profile: string
179 availableProfiles: string[]
180 }
181
182 rtmp: {
183 port: number
184 }
185 }
186
187 videoStudio: {
188 enabled: boolean
189
190 remoteRunners: {
191 enabled: boolean
192 }
193 }
194
195 videoFile: {
196 update: {
197 enabled: boolean
198 }
199 }
200
201 import: {
202 videos: {
203 http: {
204 enabled: boolean
205 }
206 torrent: {
207 enabled: boolean
208 }
209 }
210 videoChannelSynchronization: {
211 enabled: boolean
212 }
213 }
214
215 autoBlacklist: {
216 videos: {
217 ofUsers: {
218 enabled: boolean
219 }
220 }
221 }
222
223 avatar: {
224 file: {
225 size: {
226 max: number
227 }
228 extensions: string[]
229 }
230 }
231
232 banner: {
233 file: {
234 size: {
235 max: number
236 }
237 extensions: string[]
238 }
239 }
240
241 video: {
242 image: {
243 size: {
244 max: number
245 }
246 extensions: string[]
247 }
248 file: {
249 extensions: string[]
250 }
251 }
252
253 videoCaption: {
254 file: {
255 size: {
256 max: number
257 }
258 extensions: string[]
259 }
260 }
261
262 user: {
263 videoQuota: number
264 videoQuotaDaily: number
265 }
266
267 videoChannels: {
268 maxPerUser: number
269 }
270
271 trending: {
272 videos: {
273 intervalDays: number
274 algorithms: {
275 enabled: string[]
276 default: string
277 }
278 }
279 }
280
281 tracker: {
282 enabled: boolean
283 }
284
285 followings: {
286 instance: {
287 autoFollowIndex: {
288 indexUrl: string
289 }
290 }
291 }
292
293 broadcastMessage: {
294 enabled: boolean
295 message: string
296 level: BroadcastMessageLevel
297 dismissable: boolean
298 }
299
300 homepage: {
301 enabled: boolean
302 }
303}
304
305export type HTMLServerConfig = Omit<ServerConfig, 'signup'>
diff --git a/shared/models/server/server-debug.model.ts b/shared/models/server/server-debug.model.ts
deleted file mode 100644
index 4b731bb90..000000000
--- a/shared/models/server/server-debug.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface ServerDebug {
2 ip: string
3 activityPubMessagesWaiting: number
4}
diff --git a/shared/models/server/server-error-code.enum.ts b/shared/models/server/server-error-code.enum.ts
deleted file mode 100644
index 583e8245f..000000000
--- a/shared/models/server/server-error-code.enum.ts
+++ /dev/null
@@ -1,89 +0,0 @@
1export const enum ServerErrorCode {
2 /**
3 * The simplest form of payload too large: when the file size is over the
4 * global file size limit
5 */
6 MAX_FILE_SIZE_REACHED = 'max_file_size_reached',
7
8 /**
9 * The payload is too large for the user quota set
10 */
11 QUOTA_REACHED = 'quota_reached',
12
13 /**
14 * Error yielded upon trying to access a video that is not federated, nor can
15 * be. This may be due to: remote videos on instances that are not followed by
16 * yours, and with your instance disallowing unknown instances being accessed.
17 */
18 DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS = 'does_not_respect_follow_constraints',
19
20 LIVE_NOT_ENABLED = 'live_not_enabled',
21 LIVE_NOT_ALLOWING_REPLAY = 'live_not_allowing_replay',
22 LIVE_CONFLICTING_PERMANENT_AND_SAVE_REPLAY = 'live_conflicting_permanent_and_save_replay',
23 /**
24 * Pretty self-explanatory: the set maximum number of simultaneous lives was
25 * reached, and this error is typically there to inform the user trying to
26 * broadcast one.
27 */
28 MAX_INSTANCE_LIVES_LIMIT_REACHED = 'max_instance_lives_limit_reached',
29 /**
30 * Pretty self-explanatory: the set maximum number of simultaneous lives FOR
31 * THIS USER was reached, and this error is typically there to inform the user
32 * trying to broadcast one.
33 */
34 MAX_USER_LIVES_LIMIT_REACHED = 'max_user_lives_limit_reached',
35
36 /**
37 * A torrent should have at most one correct video file. Any more and we will
38 * not be able to choose automatically.
39 */
40 INCORRECT_FILES_IN_TORRENT = 'incorrect_files_in_torrent',
41
42 COMMENT_NOT_ASSOCIATED_TO_VIDEO = 'comment_not_associated_to_video',
43
44 MISSING_TWO_FACTOR = 'missing_two_factor',
45 INVALID_TWO_FACTOR = 'invalid_two_factor',
46
47 ACCOUNT_WAITING_FOR_APPROVAL = 'account_waiting_for_approval',
48 ACCOUNT_APPROVAL_REJECTED = 'account_approval_rejected',
49
50 RUNNER_JOB_NOT_IN_PROCESSING_STATE = 'runner_job_not_in_processing_state',
51 RUNNER_JOB_NOT_IN_PENDING_STATE = 'runner_job_not_in_pending_state',
52 UNKNOWN_RUNNER_TOKEN = 'unknown_runner_token',
53
54 VIDEO_REQUIRES_PASSWORD = 'video_requires_password',
55 INCORRECT_VIDEO_PASSWORD = 'incorrect_video_password',
56
57 VIDEO_ALREADY_BEING_TRANSCODED = 'video_already_being_transcoded'
58}
59
60/**
61 * oauthjs/oauth2-server error codes
62 * @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
63 **/
64export const enum OAuth2ErrorCode {
65 /**
66 * The provided authorization grant (e.g., authorization code, resource owner
67 * credentials) or refresh token is invalid, expired, revoked, does not match
68 * the redirection URI used in the authorization request, or was issued to
69 * another client.
70 *
71 * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-grant-error.js
72 */
73 INVALID_GRANT = 'invalid_grant',
74
75 /**
76 * Client authentication failed (e.g., unknown client, no client authentication
77 * included, or unsupported authentication method).
78 *
79 * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-client-error.js
80 */
81 INVALID_CLIENT = 'invalid_client',
82
83 /**
84 * The access token provided is expired, revoked, malformed, or invalid for other reasons
85 *
86 * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-token-error.js
87 */
88 INVALID_TOKEN = 'invalid_token'
89}
diff --git a/shared/models/server/server-follow-create.model.ts b/shared/models/server/server-follow-create.model.ts
deleted file mode 100644
index 3f90c7d6f..000000000
--- a/shared/models/server/server-follow-create.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface ServerFollowCreate {
2 hosts?: string[]
3 handles?: string[]
4}
diff --git a/shared/models/server/server-log-level.type.ts b/shared/models/server/server-log-level.type.ts
deleted file mode 100644
index f0f31a4ae..000000000
--- a/shared/models/server/server-log-level.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type ServerLogLevel = 'debug' | 'info' | 'warn' | 'error' | 'audit'
diff --git a/shared/models/server/server-stats.model.ts b/shared/models/server/server-stats.model.ts
deleted file mode 100644
index 82f5a737f..000000000
--- a/shared/models/server/server-stats.model.ts
+++ /dev/null
@@ -1,47 +0,0 @@
1import { ActivityType } from '../activitypub'
2import { VideoRedundancyStrategyWithManual } from '../redundancy'
3
4type ActivityPubMessagesSuccess = Record<`totalActivityPub${ActivityType}MessagesSuccesses`, number>
5type ActivityPubMessagesErrors = Record<`totalActivityPub${ActivityType}MessagesErrors`, number>
6
7export interface ServerStats extends ActivityPubMessagesSuccess, ActivityPubMessagesErrors {
8 totalUsers: number
9 totalDailyActiveUsers: number
10 totalWeeklyActiveUsers: number
11 totalMonthlyActiveUsers: number
12
13 totalLocalVideos: number
14 totalLocalVideoViews: number
15 totalLocalVideoComments: number
16 totalLocalVideoFilesSize: number
17
18 totalVideos: number
19 totalVideoComments: number
20
21 totalLocalVideoChannels: number
22 totalLocalDailyActiveVideoChannels: number
23 totalLocalWeeklyActiveVideoChannels: number
24 totalLocalMonthlyActiveVideoChannels: number
25
26 totalLocalPlaylists: number
27
28 totalInstanceFollowers: number
29 totalInstanceFollowing: number
30
31 videosRedundancy: VideosRedundancyStats[]
32
33 totalActivityPubMessagesProcessed: number
34 totalActivityPubMessagesSuccesses: number
35 totalActivityPubMessagesErrors: number
36
37 activityPubMessagesProcessedPerSecond: number
38 totalActivityPubMessagesWaiting: number
39}
40
41export interface VideosRedundancyStats {
42 strategy: VideoRedundancyStrategyWithManual
43 totalSize: number
44 totalUsed: number
45 totalVideoFiles: number
46 totalVideos: number
47}
diff --git a/shared/models/tokens/index.ts b/shared/models/tokens/index.ts
deleted file mode 100644
index fe130f153..000000000
--- a/shared/models/tokens/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './oauth-client-local.model'
diff --git a/shared/models/tokens/oauth-client-local.model.ts b/shared/models/tokens/oauth-client-local.model.ts
deleted file mode 100644
index 0c6ce6c5d..000000000
--- a/shared/models/tokens/oauth-client-local.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface OAuthClientLocal {
2 client_id: string
3 client_secret: string
4}
diff --git a/shared/models/users/index.ts b/shared/models/users/index.ts
deleted file mode 100644
index 4a050c870..000000000
--- a/shared/models/users/index.ts
+++ /dev/null
@@ -1,16 +0,0 @@
1export * from './registration'
2export * from './two-factor-enable-result.model'
3export * from './user-create-result.model'
4export * from './user-create.model'
5export * from './user-flag.model'
6export * from './user-login.model'
7export * from './user-notification-setting.model'
8export * from './user-notification.model'
9export * from './user-refresh-token.model'
10export * from './user-right.enum'
11export * from './user-role'
12export * from './user-scoped-token'
13export * from './user-update-me.model'
14export * from './user-update.model'
15export * from './user-video-quota.model'
16export * from './user.model'
diff --git a/shared/models/users/registration/index.ts b/shared/models/users/registration/index.ts
deleted file mode 100644
index 593740c4f..000000000
--- a/shared/models/users/registration/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export * from './user-register.model'
2export * from './user-registration-request.model'
3export * from './user-registration-state.model'
4export * from './user-registration-update-state.model'
5export * from './user-registration.model'
diff --git a/shared/models/users/registration/user-register.model.ts b/shared/models/users/registration/user-register.model.ts
deleted file mode 100644
index cf9a43a67..000000000
--- a/shared/models/users/registration/user-register.model.ts
+++ /dev/null
@@ -1,12 +0,0 @@
1export interface UserRegister {
2 username: string
3 password: string
4 email: string
5
6 displayName?: string
7
8 channel?: {
9 name: string
10 displayName: string
11 }
12}
diff --git a/shared/models/users/registration/user-registration-request.model.ts b/shared/models/users/registration/user-registration-request.model.ts
deleted file mode 100644
index 6c38817e0..000000000
--- a/shared/models/users/registration/user-registration-request.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1import { UserRegister } from './user-register.model'
2
3export interface UserRegistrationRequest extends UserRegister {
4 registrationReason: string
5}
diff --git a/shared/models/users/registration/user-registration-state.model.ts b/shared/models/users/registration/user-registration-state.model.ts
deleted file mode 100644
index e4c835f78..000000000
--- a/shared/models/users/registration/user-registration-state.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export const enum UserRegistrationState {
2 PENDING = 1,
3 REJECTED = 2,
4 ACCEPTED = 3
5}
diff --git a/shared/models/users/registration/user-registration-update-state.model.ts b/shared/models/users/registration/user-registration-update-state.model.ts
deleted file mode 100644
index a1740dcca..000000000
--- a/shared/models/users/registration/user-registration-update-state.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface UserRegistrationUpdateState {
2 moderationResponse: string
3 preventEmailDelivery?: boolean
4}
diff --git a/shared/models/users/registration/user-registration.model.ts b/shared/models/users/registration/user-registration.model.ts
deleted file mode 100644
index 0d74dc28b..000000000
--- a/shared/models/users/registration/user-registration.model.ts
+++ /dev/null
@@ -1,29 +0,0 @@
1import { UserRegistrationState } from './user-registration-state.model'
2
3export interface UserRegistration {
4 id: number
5
6 state: {
7 id: UserRegistrationState
8 label: string
9 }
10
11 registrationReason: string
12 moderationResponse: string
13
14 username: string
15 email: string
16 emailVerified: boolean
17
18 accountDisplayName: string
19
20 channelHandle: string
21 channelDisplayName: string
22
23 createdAt: Date
24 updatedAt: Date
25
26 user?: {
27 id: number
28 }
29}
diff --git a/shared/models/users/two-factor-enable-result.model.ts b/shared/models/users/two-factor-enable-result.model.ts
deleted file mode 100644
index 1fc801f0a..000000000
--- a/shared/models/users/two-factor-enable-result.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export interface TwoFactorEnableResult {
2 otpRequest: {
3 requestToken: string
4 secret: string
5 uri: string
6 }
7}
diff --git a/shared/models/users/user-create-result.model.ts b/shared/models/users/user-create-result.model.ts
deleted file mode 100644
index 835b241ed..000000000
--- a/shared/models/users/user-create-result.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export interface UserCreateResult {
2 id: number
3
4 account: {
5 id: number
6 }
7}
diff --git a/shared/models/users/user-create.model.ts b/shared/models/users/user-create.model.ts
deleted file mode 100644
index ddc71dd59..000000000
--- a/shared/models/users/user-create.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { UserRole } from './user-role'
2import { UserAdminFlag } from './user-flag.model'
3
4export interface UserCreate {
5 username: string
6 password: string
7 email: string
8 videoQuota: number
9 videoQuotaDaily: number
10 role: UserRole
11 adminFlags?: UserAdminFlag
12 channelName?: string
13}
diff --git a/shared/models/users/user-flag.model.ts b/shared/models/users/user-flag.model.ts
deleted file mode 100644
index b791a1263..000000000
--- a/shared/models/users/user-flag.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export const enum UserAdminFlag {
2 NONE = 0,
3 BYPASS_VIDEO_AUTO_BLACKLIST = 1 << 0
4}
diff --git a/shared/models/users/user-login.model.ts b/shared/models/users/user-login.model.ts
deleted file mode 100644
index 1e85ab30b..000000000
--- a/shared/models/users/user-login.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface UserLogin {
2 access_token: string
3 refresh_token: string
4 token_type: string
5}
diff --git a/shared/models/users/user-notification-setting.model.ts b/shared/models/users/user-notification-setting.model.ts
deleted file mode 100644
index 278a05e7a..000000000
--- a/shared/models/users/user-notification-setting.model.ts
+++ /dev/null
@@ -1,32 +0,0 @@
1export const enum UserNotificationSettingValue {
2 NONE = 0,
3 WEB = 1 << 0,
4 EMAIL = 1 << 1
5}
6
7export interface UserNotificationSetting {
8 abuseAsModerator: UserNotificationSettingValue
9 videoAutoBlacklistAsModerator: UserNotificationSettingValue
10 newUserRegistration: UserNotificationSettingValue
11
12 newVideoFromSubscription: UserNotificationSettingValue
13
14 blacklistOnMyVideo: UserNotificationSettingValue
15 myVideoPublished: UserNotificationSettingValue
16 myVideoImportFinished: UserNotificationSettingValue
17
18 commentMention: UserNotificationSettingValue
19 newCommentOnMyVideo: UserNotificationSettingValue
20
21 newFollow: UserNotificationSettingValue
22 newInstanceFollower: UserNotificationSettingValue
23 autoInstanceFollowing: UserNotificationSettingValue
24
25 abuseStateChange: UserNotificationSettingValue
26 abuseNewMessage: UserNotificationSettingValue
27
28 newPeerTubeVersion: UserNotificationSettingValue
29 newPluginVersion: UserNotificationSettingValue
30
31 myVideoStudioEditionFinished: UserNotificationSettingValue
32}
diff --git a/shared/models/users/user-notification.model.ts b/shared/models/users/user-notification.model.ts
deleted file mode 100644
index 294c921bd..000000000
--- a/shared/models/users/user-notification.model.ts
+++ /dev/null
@@ -1,138 +0,0 @@
1import { FollowState } from '../actors'
2import { AbuseState } from '../moderation'
3import { PluginType } from '../plugins'
4
5export const enum UserNotificationType {
6 NEW_VIDEO_FROM_SUBSCRIPTION = 1,
7 NEW_COMMENT_ON_MY_VIDEO = 2,
8 NEW_ABUSE_FOR_MODERATORS = 3,
9
10 BLACKLIST_ON_MY_VIDEO = 4,
11 UNBLACKLIST_ON_MY_VIDEO = 5,
12
13 MY_VIDEO_PUBLISHED = 6,
14
15 MY_VIDEO_IMPORT_SUCCESS = 7,
16 MY_VIDEO_IMPORT_ERROR = 8,
17
18 NEW_USER_REGISTRATION = 9,
19 NEW_FOLLOW = 10,
20 COMMENT_MENTION = 11,
21
22 VIDEO_AUTO_BLACKLIST_FOR_MODERATORS = 12,
23
24 NEW_INSTANCE_FOLLOWER = 13,
25
26 AUTO_INSTANCE_FOLLOWING = 14,
27
28 ABUSE_STATE_CHANGE = 15,
29
30 ABUSE_NEW_MESSAGE = 16,
31
32 NEW_PLUGIN_VERSION = 17,
33 NEW_PEERTUBE_VERSION = 18,
34
35 MY_VIDEO_STUDIO_EDITION_FINISHED = 19,
36
37 NEW_USER_REGISTRATION_REQUEST = 20
38}
39
40export interface VideoInfo {
41 id: number
42 uuid: string
43 shortUUID: string
44 name: string
45}
46
47export interface AvatarInfo {
48 width: number
49 path: string
50}
51
52export interface ActorInfo {
53 id: number
54 displayName: string
55 name: string
56 host: string
57
58 avatars: AvatarInfo[]
59 avatar: AvatarInfo
60}
61
62export interface UserNotification {
63 id: number
64 type: UserNotificationType
65 read: boolean
66
67 video?: VideoInfo & {
68 channel: ActorInfo
69 }
70
71 videoImport?: {
72 id: number
73 video?: VideoInfo
74 torrentName?: string
75 magnetUri?: string
76 targetUrl?: string
77 }
78
79 comment?: {
80 id: number
81 threadId: number
82 account: ActorInfo
83 video: VideoInfo
84 }
85
86 abuse?: {
87 id: number
88 state: AbuseState
89
90 video?: VideoInfo
91
92 comment?: {
93 threadId: number
94
95 video: VideoInfo
96 }
97
98 account?: ActorInfo
99 }
100
101 videoBlacklist?: {
102 id: number
103 video: VideoInfo
104 }
105
106 account?: ActorInfo
107
108 actorFollow?: {
109 id: number
110 follower: ActorInfo
111 state: FollowState
112
113 following: {
114 type: 'account' | 'channel' | 'instance'
115 name: string
116 displayName: string
117 host: string
118 }
119 }
120
121 plugin?: {
122 name: string
123 type: PluginType
124 latestVersion: string
125 }
126
127 peertube?: {
128 latestVersion: string
129 }
130
131 registration?: {
132 id: number
133 username: string
134 }
135
136 createdAt: string
137 updatedAt: string
138}
diff --git a/shared/models/users/user-refresh-token.model.ts b/shared/models/users/user-refresh-token.model.ts
deleted file mode 100644
index f528dd961..000000000
--- a/shared/models/users/user-refresh-token.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface UserRefreshToken {
2 access_token: string
3 refresh_token: string
4}
diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts
deleted file mode 100644
index a5a770b75..000000000
--- a/shared/models/users/user-right.enum.ts
+++ /dev/null
@@ -1,51 +0,0 @@
1export const enum UserRight {
2 ALL = 0,
3
4 MANAGE_USERS = 1,
5
6 MANAGE_SERVER_FOLLOW = 2,
7
8 MANAGE_LOGS = 3,
9
10 MANAGE_DEBUG = 4,
11
12 MANAGE_SERVER_REDUNDANCY = 5,
13
14 MANAGE_ABUSES = 6,
15
16 MANAGE_JOBS = 7,
17
18 MANAGE_CONFIGURATION = 8,
19 MANAGE_INSTANCE_CUSTOM_PAGE = 9,
20
21 MANAGE_ACCOUNTS_BLOCKLIST = 10,
22 MANAGE_SERVERS_BLOCKLIST = 11,
23
24 MANAGE_VIDEO_BLACKLIST = 12,
25 MANAGE_ANY_VIDEO_CHANNEL = 13,
26
27 REMOVE_ANY_VIDEO = 14,
28 REMOVE_ANY_VIDEO_PLAYLIST = 15,
29 REMOVE_ANY_VIDEO_COMMENT = 16,
30
31 UPDATE_ANY_VIDEO = 17,
32 UPDATE_ANY_VIDEO_PLAYLIST = 18,
33
34 GET_ANY_LIVE = 19,
35 SEE_ALL_VIDEOS = 20,
36 SEE_ALL_COMMENTS = 21,
37 CHANGE_VIDEO_OWNERSHIP = 22,
38
39 MANAGE_PLUGINS = 23,
40
41 MANAGE_VIDEOS_REDUNDANCIES = 24,
42
43 MANAGE_VIDEO_FILES = 25,
44 RUN_VIDEO_TRANSCODING = 26,
45
46 MANAGE_VIDEO_IMPORTS = 27,
47
48 MANAGE_REGISTRATIONS = 28,
49
50 MANAGE_RUNNERS = 29
51}
diff --git a/shared/models/users/user-role.ts b/shared/models/users/user-role.ts
deleted file mode 100644
index 687a2aa0d..000000000
--- a/shared/models/users/user-role.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1// Keep the order
2export const enum UserRole {
3 ADMINISTRATOR = 0,
4 MODERATOR = 1,
5 USER = 2
6}
diff --git a/shared/models/users/user-scoped-token.ts b/shared/models/users/user-scoped-token.ts
deleted file mode 100644
index f9d9b0a8b..000000000
--- a/shared/models/users/user-scoped-token.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export type ScopedTokenType = 'feedToken'
2
3export type ScopedToken = {
4 feedToken: string
5}
diff --git a/shared/models/users/user-update-me.model.ts b/shared/models/users/user-update-me.model.ts
deleted file mode 100644
index c1d5ffba4..000000000
--- a/shared/models/users/user-update-me.model.ts
+++ /dev/null
@@ -1,26 +0,0 @@
1import { NSFWPolicyType } from '../videos/nsfw-policy.type'
2
3export interface UserUpdateMe {
4 displayName?: string
5 description?: string
6 nsfwPolicy?: NSFWPolicyType
7
8 p2pEnabled?: boolean
9
10 autoPlayVideo?: boolean
11 autoPlayNextVideo?: boolean
12 autoPlayNextVideoPlaylist?: boolean
13 videosHistoryEnabled?: boolean
14 videoLanguages?: string[]
15
16 email?: string
17 emailPublic?: boolean
18 currentPassword?: string
19 password?: string
20
21 theme?: string
22
23 noInstanceConfigWarningModal?: boolean
24 noWelcomeModal?: boolean
25 noAccountSetupWarningModal?: boolean
26}
diff --git a/shared/models/users/user-update.model.ts b/shared/models/users/user-update.model.ts
deleted file mode 100644
index 158738545..000000000
--- a/shared/models/users/user-update.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { UserRole } from './user-role'
2import { UserAdminFlag } from './user-flag.model'
3
4export interface UserUpdate {
5 password?: string
6 email?: string
7 emailVerified?: boolean
8 videoQuota?: number
9 videoQuotaDaily?: number
10 role?: UserRole
11 adminFlags?: UserAdminFlag
12 pluginAuth?: string
13}
diff --git a/shared/models/users/user-video-quota.model.ts b/shared/models/users/user-video-quota.model.ts
deleted file mode 100644
index a24871d71..000000000
--- a/shared/models/users/user-video-quota.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface UserVideoQuota {
2 videoQuotaUsed: number
3 videoQuotaUsedDaily: number
4}
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts
deleted file mode 100644
index 9de4118b4..000000000
--- a/shared/models/users/user.model.ts
+++ /dev/null
@@ -1,78 +0,0 @@
1import { Account } from '../actors'
2import { VideoChannel } from '../videos/channel/video-channel.model'
3import { UserRole } from './user-role'
4import { NSFWPolicyType } from '../videos/nsfw-policy.type'
5import { UserNotificationSetting } from './user-notification-setting.model'
6import { UserAdminFlag } from './user-flag.model'
7import { VideoPlaylistType } from '../videos/playlist/video-playlist-type.model'
8
9export interface User {
10 id: number
11 username: string
12 email: string
13 pendingEmail: string | null
14
15 emailVerified: boolean
16 emailPublic: boolean
17 nsfwPolicy: NSFWPolicyType
18
19 adminFlags?: UserAdminFlag
20
21 autoPlayVideo: boolean
22 autoPlayNextVideo: boolean
23 autoPlayNextVideoPlaylist: boolean
24
25 p2pEnabled: boolean
26
27 videosHistoryEnabled: boolean
28 videoLanguages: string[]
29
30 role: {
31 id: UserRole
32 label: string
33 }
34
35 videoQuota: number
36 videoQuotaDaily: number
37 videoQuotaUsed?: number
38 videoQuotaUsedDaily?: number
39
40 videosCount?: number
41
42 abusesCount?: number
43 abusesAcceptedCount?: number
44 abusesCreatedCount?: number
45
46 videoCommentsCount?: number
47
48 theme: string
49
50 account: Account
51 notificationSettings?: UserNotificationSetting
52 videoChannels?: VideoChannel[]
53
54 blocked: boolean
55 blockedReason?: string
56
57 noInstanceConfigWarningModal: boolean
58 noWelcomeModal: boolean
59 noAccountSetupWarningModal: boolean
60
61 createdAt: Date
62
63 pluginAuth: string | null
64
65 lastLoginDate: Date | null
66
67 twoFactorEnabled: boolean
68}
69
70export interface MyUserSpecialPlaylist {
71 id: number
72 name: string
73 type: VideoPlaylistType
74}
75
76export interface MyUser extends User {
77 specialPlaylists: MyUserSpecialPlaylist[]
78}
diff --git a/shared/models/videos/blacklist/index.ts b/shared/models/videos/blacklist/index.ts
deleted file mode 100644
index 66082be34..000000000
--- a/shared/models/videos/blacklist/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export * from './video-blacklist.model'
2export * from './video-blacklist-create.model'
3export * from './video-blacklist-update.model'
diff --git a/shared/models/videos/blacklist/video-blacklist-create.model.ts b/shared/models/videos/blacklist/video-blacklist-create.model.ts
deleted file mode 100644
index 6e7d36421..000000000
--- a/shared/models/videos/blacklist/video-blacklist-create.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideoBlacklistCreate {
2 reason?: string
3 unfederate?: boolean
4}
diff --git a/shared/models/videos/blacklist/video-blacklist-update.model.ts b/shared/models/videos/blacklist/video-blacklist-update.model.ts
deleted file mode 100644
index 0a86cf7b0..000000000
--- a/shared/models/videos/blacklist/video-blacklist-update.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface VideoBlacklistUpdate {
2 reason?: string
3}
diff --git a/shared/models/videos/blacklist/video-blacklist.model.ts b/shared/models/videos/blacklist/video-blacklist.model.ts
deleted file mode 100644
index 982a34592..000000000
--- a/shared/models/videos/blacklist/video-blacklist.model.ts
+++ /dev/null
@@ -1,18 +0,0 @@
1import { Video } from '../video.model'
2
3export const enum VideoBlacklistType {
4 MANUAL = 1,
5 AUTO_BEFORE_PUBLISHED = 2
6}
7
8export interface VideoBlacklist {
9 id: number
10 unfederated: boolean
11 reason?: string
12 type: VideoBlacklistType
13
14 video: Video
15
16 createdAt: Date
17 updatedAt: Date
18}
diff --git a/shared/models/videos/caption/index.ts b/shared/models/videos/caption/index.ts
deleted file mode 100644
index 2a5ff512d..000000000
--- a/shared/models/videos/caption/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './video-caption.model'
2export * from './video-caption-update.model'
diff --git a/shared/models/videos/caption/video-caption-update.model.ts b/shared/models/videos/caption/video-caption-update.model.ts
deleted file mode 100644
index ff5728715..000000000
--- a/shared/models/videos/caption/video-caption-update.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideoCaptionUpdate {
2 language: string
3 captionfile: Blob
4}
diff --git a/shared/models/videos/caption/video-caption.model.ts b/shared/models/videos/caption/video-caption.model.ts
deleted file mode 100644
index 6d5665006..000000000
--- a/shared/models/videos/caption/video-caption.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { VideoConstant } from '../video-constant.model'
2
3export interface VideoCaption {
4 language: VideoConstant<string>
5 captionPath: string
6 updatedAt: string
7}
diff --git a/shared/models/videos/change-ownership/index.ts b/shared/models/videos/change-ownership/index.ts
deleted file mode 100644
index a942fb2cd..000000000
--- a/shared/models/videos/change-ownership/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export * from './video-change-ownership-accept.model'
2export * from './video-change-ownership-create.model'
3export * from './video-change-ownership.model'
diff --git a/shared/models/videos/change-ownership/video-change-ownership-accept.model.ts b/shared/models/videos/change-ownership/video-change-ownership-accept.model.ts
deleted file mode 100644
index f27247633..000000000
--- a/shared/models/videos/change-ownership/video-change-ownership-accept.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface VideoChangeOwnershipAccept {
2 channelId: number
3}
diff --git a/shared/models/videos/change-ownership/video-change-ownership-create.model.ts b/shared/models/videos/change-ownership/video-change-ownership-create.model.ts
deleted file mode 100644
index 40fcca285..000000000
--- a/shared/models/videos/change-ownership/video-change-ownership-create.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface VideoChangeOwnershipCreate {
2 username: string
3}
diff --git a/shared/models/videos/change-ownership/video-change-ownership.model.ts b/shared/models/videos/change-ownership/video-change-ownership.model.ts
deleted file mode 100644
index 3d31cad0a..000000000
--- a/shared/models/videos/change-ownership/video-change-ownership.model.ts
+++ /dev/null
@@ -1,17 +0,0 @@
1import { Account } from '../../actors'
2import { Video } from '../video.model'
3
4export interface VideoChangeOwnership {
5 id: number
6 status: VideoChangeOwnershipStatus
7 initiatorAccount: Account
8 nextOwnerAccount: Account
9 video: Video
10 createdAt: Date
11}
12
13export const enum VideoChangeOwnershipStatus {
14 WAITING = 'WAITING',
15 ACCEPTED = 'ACCEPTED',
16 REFUSED = 'REFUSED'
17}
diff --git a/shared/models/videos/channel-sync/index.ts b/shared/models/videos/channel-sync/index.ts
deleted file mode 100644
index 7d25aaac3..000000000
--- a/shared/models/videos/channel-sync/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export * from './video-channel-sync-state.enum'
2export * from './video-channel-sync.model'
3export * from './video-channel-sync-create.model'
diff --git a/shared/models/videos/channel-sync/video-channel-sync-create.model.ts b/shared/models/videos/channel-sync/video-channel-sync-create.model.ts
deleted file mode 100644
index 753a8ee4c..000000000
--- a/shared/models/videos/channel-sync/video-channel-sync-create.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideoChannelSyncCreate {
2 externalChannelUrl: string
3 videoChannelId: number
4}
diff --git a/shared/models/videos/channel-sync/video-channel-sync-state.enum.ts b/shared/models/videos/channel-sync/video-channel-sync-state.enum.ts
deleted file mode 100644
index 3e9f5ddc2..000000000
--- a/shared/models/videos/channel-sync/video-channel-sync-state.enum.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export const enum VideoChannelSyncState {
2 WAITING_FIRST_RUN = 1,
3 PROCESSING = 2,
4 SYNCED = 3,
5 FAILED = 4
6}
diff --git a/shared/models/videos/channel-sync/video-channel-sync.model.ts b/shared/models/videos/channel-sync/video-channel-sync.model.ts
deleted file mode 100644
index 73ac0615b..000000000
--- a/shared/models/videos/channel-sync/video-channel-sync.model.ts
+++ /dev/null
@@ -1,14 +0,0 @@
1import { VideoChannelSummary } from '../channel/video-channel.model'
2import { VideoConstant } from '../video-constant.model'
3import { VideoChannelSyncState } from './video-channel-sync-state.enum'
4
5export interface VideoChannelSync {
6 id: number
7
8 externalChannelUrl: string
9
10 createdAt: string
11 channel: VideoChannelSummary
12 state: VideoConstant<VideoChannelSyncState>
13 lastSyncAt: string
14}
diff --git a/shared/models/videos/channel/index.ts b/shared/models/videos/channel/index.ts
deleted file mode 100644
index 6cdabffbd..000000000
--- a/shared/models/videos/channel/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export * from './video-channel-create-result.model'
2export * from './video-channel-create.model'
3export * from './video-channel-update.model'
4export * from './video-channel.model'
diff --git a/shared/models/videos/channel/video-channel-create-result.model.ts b/shared/models/videos/channel/video-channel-create-result.model.ts
deleted file mode 100644
index e3d7aeb4c..000000000
--- a/shared/models/videos/channel/video-channel-create-result.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface VideoChannelCreateResult {
2 id: number
3}
diff --git a/shared/models/videos/channel/video-channel-create.model.ts b/shared/models/videos/channel/video-channel-create.model.ts
deleted file mode 100644
index da8ce620c..000000000
--- a/shared/models/videos/channel/video-channel-create.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface VideoChannelCreate {
2 name: string
3 displayName: string
4 description?: string
5 support?: string
6}
diff --git a/shared/models/videos/channel/video-channel-update.model.ts b/shared/models/videos/channel/video-channel-update.model.ts
deleted file mode 100644
index 8dde9188b..000000000
--- a/shared/models/videos/channel/video-channel-update.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export interface VideoChannelUpdate {
2 displayName?: string
3 description?: string
4 support?: string
5
6 bulkVideosSupportUpdate?: boolean
7}
diff --git a/shared/models/videos/channel/video-channel.model.ts b/shared/models/videos/channel/video-channel.model.ts
deleted file mode 100644
index ce5fc0e8d..000000000
--- a/shared/models/videos/channel/video-channel.model.ts
+++ /dev/null
@@ -1,34 +0,0 @@
1import { Account, ActorImage } from '../../actors'
2import { Actor } from '../../actors/actor.model'
3
4export type ViewsPerDate = {
5 date: Date
6 views: number
7}
8
9export interface VideoChannel extends Actor {
10 displayName: string
11 description: string
12 support: string
13 isLocal: boolean
14
15 updatedAt: Date | string
16
17 ownerAccount?: Account
18
19 videosCount?: number
20 viewsPerDay?: ViewsPerDate[] // chronologically ordered
21 totalViews?: number
22
23 banners: ActorImage[]
24}
25
26export interface VideoChannelSummary {
27 id: number
28 name: string
29 displayName: string
30 url: string
31 host: string
32
33 avatars: ActorImage[]
34}
diff --git a/shared/models/videos/comment/index.ts b/shared/models/videos/comment/index.ts
deleted file mode 100644
index 80c6c0724..000000000
--- a/shared/models/videos/comment/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './video-comment-create.model'
2export * from './video-comment.model'
diff --git a/shared/models/videos/comment/video-comment-create.model.ts b/shared/models/videos/comment/video-comment-create.model.ts
deleted file mode 100644
index 1f0135405..000000000
--- a/shared/models/videos/comment/video-comment-create.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface VideoCommentCreate {
2 text: string
3}
diff --git a/shared/models/videos/comment/video-comment.model.ts b/shared/models/videos/comment/video-comment.model.ts
deleted file mode 100644
index 737cfe098..000000000
--- a/shared/models/videos/comment/video-comment.model.ts
+++ /dev/null
@@ -1,45 +0,0 @@
1import { ResultList } from '../../common'
2import { Account } from '../../actors'
3
4export interface VideoComment {
5 id: number
6 url: string
7 text: string
8 threadId: number
9 inReplyToCommentId: number
10 videoId: number
11 createdAt: Date | string
12 updatedAt: Date | string
13 deletedAt: Date | string
14 isDeleted: boolean
15 totalRepliesFromVideoAuthor: number
16 totalReplies: number
17 account: Account
18}
19
20export interface VideoCommentAdmin {
21 id: number
22 url: string
23 text: string
24
25 threadId: number
26 inReplyToCommentId: number
27
28 createdAt: Date | string
29 updatedAt: Date | string
30
31 account: Account
32
33 video: {
34 id: number
35 uuid: string
36 name: string
37 }
38}
39
40export type VideoCommentThreads = ResultList<VideoComment> & { totalNotDeletedComments: number }
41
42export interface VideoCommentThreadTree {
43 comment: VideoComment
44 children: VideoCommentThreadTree[]
45}
diff --git a/shared/models/videos/file/index.ts b/shared/models/videos/file/index.ts
deleted file mode 100644
index 78a784a3c..000000000
--- a/shared/models/videos/file/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export * from './video-file-metadata.model'
2export * from './video-file.model'
3export * from './video-resolution.enum'
diff --git a/shared/models/videos/file/video-file-metadata.model.ts b/shared/models/videos/file/video-file-metadata.model.ts
deleted file mode 100644
index 8f527c0a7..000000000
--- a/shared/models/videos/file/video-file-metadata.model.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1export class VideoFileMetadata {
2 streams: { [x: string]: any, [x: number]: any }[]
3 format: { [x: string]: any, [x: number]: any }
4 chapters: any[]
5
6 constructor (hash: { chapters: any[], format: any, streams: any[] }) {
7 this.chapters = hash.chapters
8 this.format = hash.format
9 this.streams = hash.streams
10
11 delete this.format.filename
12 }
13}
diff --git a/shared/models/videos/file/video-file.model.ts b/shared/models/videos/file/video-file.model.ts
deleted file mode 100644
index 2bbff48eb..000000000
--- a/shared/models/videos/file/video-file.model.ts
+++ /dev/null
@@ -1,23 +0,0 @@
1import { VideoConstant } from '../video-constant.model'
2import { VideoFileMetadata } from './video-file-metadata.model'
3import { VideoResolution } from './video-resolution.enum'
4
5export interface VideoFile {
6 id: number
7
8 resolution: VideoConstant<VideoResolution>
9 size: number // Bytes
10
11 torrentUrl: string
12 torrentDownloadUrl: string
13
14 fileUrl: string
15 fileDownloadUrl: string
16
17 fps: number
18
19 metadata?: VideoFileMetadata
20 metadataUrl?: string
21
22 magnetUri: string | null
23}
diff --git a/shared/models/videos/file/video-resolution.enum.ts b/shared/models/videos/file/video-resolution.enum.ts
deleted file mode 100644
index 5b48ad353..000000000
--- a/shared/models/videos/file/video-resolution.enum.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1export const enum VideoResolution {
2 H_NOVIDEO = 0,
3 H_144P = 144,
4 H_240P = 240,
5 H_360P = 360,
6 H_480P = 480,
7 H_720P = 720,
8 H_1080P = 1080,
9 H_1440P = 1440,
10 H_4K = 2160
11}
diff --git a/shared/models/videos/import/index.ts b/shared/models/videos/import/index.ts
deleted file mode 100644
index b38a67b5f..000000000
--- a/shared/models/videos/import/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export * from './video-import-create.model'
2export * from './video-import-state.enum'
3export * from './video-import.model'
4export * from './videos-import-in-channel-create.model'
diff --git a/shared/models/videos/import/video-import-create.model.ts b/shared/models/videos/import/video-import-create.model.ts
deleted file mode 100644
index 425477389..000000000
--- a/shared/models/videos/import/video-import-create.model.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1import { VideoUpdate } from '../video-update.model'
2
3export interface VideoImportCreate extends VideoUpdate {
4 targetUrl?: string
5 magnetUri?: string
6 torrentfile?: Blob
7
8 channelId: number // Required
9}
diff --git a/shared/models/videos/import/video-import-state.enum.ts b/shared/models/videos/import/video-import-state.enum.ts
deleted file mode 100644
index ff5c6beff..000000000
--- a/shared/models/videos/import/video-import-state.enum.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1export const enum VideoImportState {
2 PENDING = 1,
3 SUCCESS = 2,
4 FAILED = 3,
5 REJECTED = 4,
6 CANCELLED = 5,
7 PROCESSING = 6
8}
diff --git a/shared/models/videos/import/video-import.model.ts b/shared/models/videos/import/video-import.model.ts
deleted file mode 100644
index 6aed7a91a..000000000
--- a/shared/models/videos/import/video-import.model.ts
+++ /dev/null
@@ -1,24 +0,0 @@
1import { Video } from '../video.model'
2import { VideoConstant } from '../video-constant.model'
3import { VideoImportState } from './video-import-state.enum'
4
5export interface VideoImport {
6 id: number
7
8 targetUrl: string
9 magnetUri: string
10 torrentName: string
11
12 createdAt: string
13 updatedAt: string
14 originallyPublishedAt?: string
15 state: VideoConstant<VideoImportState>
16 error?: string
17
18 video?: Video & { tags: string[] }
19
20 videoChannelSync?: {
21 id: number
22 externalChannelUrl: string
23 }
24}
diff --git a/shared/models/videos/import/videos-import-in-channel-create.model.ts b/shared/models/videos/import/videos-import-in-channel-create.model.ts
deleted file mode 100644
index fbfef63f8..000000000
--- a/shared/models/videos/import/videos-import-in-channel-create.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideosImportInChannelCreate {
2 externalChannelUrl: string
3 videoChannelSyncId?: number
4}
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts
deleted file mode 100644
index f8f1ce081..000000000
--- a/shared/models/videos/index.ts
+++ /dev/null
@@ -1,42 +0,0 @@
1export * from './blacklist'
2export * from './caption'
3export * from './change-ownership'
4export * from './channel'
5export * from './comment'
6export * from './studio'
7export * from './live'
8export * from './file'
9export * from './import'
10export * from './playlist'
11export * from './rate'
12export * from './stats'
13export * from './transcoding'
14export * from './channel-sync'
15
16export * from './nsfw-policy.type'
17
18export * from './storyboard.model'
19export * from './thumbnail.type'
20
21export * from './video-constant.model'
22export * from './video-create.model'
23
24export * from './video-privacy.enum'
25export * from './video-include.enum'
26export * from './video-rate.type'
27
28export * from './video-schedule-update.model'
29export * from './video-sort-field.type'
30export * from './video-state.enum'
31export * from './video-storage.enum'
32
33export * from './video-streaming-playlist.model'
34export * from './video-streaming-playlist.type'
35
36export * from './video-token.model'
37
38export * from './video-update.model'
39export * from './video-view.model'
40export * from './video.model'
41export * from './video-create-result.model'
42export * from './video-password.model'
diff --git a/shared/models/videos/live/index.ts b/shared/models/videos/live/index.ts
deleted file mode 100644
index 07b59fe2c..000000000
--- a/shared/models/videos/live/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1export * from './live-video-create.model'
2export * from './live-video-error.enum'
3export * from './live-video-event-payload.model'
4export * from './live-video-event.type'
5export * from './live-video-latency-mode.enum'
6export * from './live-video-session.model'
7export * from './live-video-update.model'
8export * from './live-video.model'
diff --git a/shared/models/videos/live/live-video-create.model.ts b/shared/models/videos/live/live-video-create.model.ts
deleted file mode 100644
index f8ae9e5a9..000000000
--- a/shared/models/videos/live/live-video-create.model.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1import { VideoCreate } from '../video-create.model'
2import { VideoPrivacy } from '../video-privacy.enum'
3import { LiveVideoLatencyMode } from './live-video-latency-mode.enum'
4
5export interface LiveVideoCreate extends VideoCreate {
6 permanentLive?: boolean
7 latencyMode?: LiveVideoLatencyMode
8
9 saveReplay?: boolean
10 replaySettings?: { privacy: VideoPrivacy }
11}
diff --git a/shared/models/videos/live/live-video-error.enum.ts b/shared/models/videos/live/live-video-error.enum.ts
deleted file mode 100644
index a26453505..000000000
--- a/shared/models/videos/live/live-video-error.enum.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1export const enum LiveVideoError {
2 BAD_SOCKET_HEALTH = 1,
3 DURATION_EXCEEDED = 2,
4 QUOTA_EXCEEDED = 3,
5 FFMPEG_ERROR = 4,
6 BLACKLISTED = 5,
7 RUNNER_JOB_ERROR = 6,
8 RUNNER_JOB_CANCEL = 7
9}
diff --git a/shared/models/videos/live/live-video-event-payload.model.ts b/shared/models/videos/live/live-video-event-payload.model.ts
deleted file mode 100644
index 646856ac3..000000000
--- a/shared/models/videos/live/live-video-event-payload.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { VideoState } from '../video-state.enum'
2
3export interface LiveVideoEventPayload {
4 state?: VideoState
5
6 viewers?: number
7}
diff --git a/shared/models/videos/live/live-video-event.type.ts b/shared/models/videos/live/live-video-event.type.ts
deleted file mode 100644
index 50f794561..000000000
--- a/shared/models/videos/live/live-video-event.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type LiveVideoEventType = 'state-change' | 'views-change'
diff --git a/shared/models/videos/live/live-video-latency-mode.enum.ts b/shared/models/videos/live/live-video-latency-mode.enum.ts
deleted file mode 100644
index 4285e1d41..000000000
--- a/shared/models/videos/live/live-video-latency-mode.enum.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export const enum LiveVideoLatencyMode {
2 DEFAULT = 1,
3 HIGH_LATENCY = 2,
4 SMALL_LATENCY = 3
5}
diff --git a/shared/models/videos/live/live-video-session.model.ts b/shared/models/videos/live/live-video-session.model.ts
deleted file mode 100644
index 888c20a8a..000000000
--- a/shared/models/videos/live/live-video-session.model.ts
+++ /dev/null
@@ -1,22 +0,0 @@
1import { VideoPrivacy } from '../video-privacy.enum'
2import { LiveVideoError } from './live-video-error.enum'
3
4export interface LiveVideoSession {
5 id: number
6
7 startDate: string
8 endDate: string
9
10 error: LiveVideoError
11
12 saveReplay: boolean
13 endingProcessed: boolean
14
15 replaySettings?: { privacy: VideoPrivacy }
16
17 replayVideo: {
18 id: number
19 uuid: string
20 shortUUID: string
21 }
22}
diff --git a/shared/models/videos/live/live-video-update.model.ts b/shared/models/videos/live/live-video-update.model.ts
deleted file mode 100644
index d6aa6fb37..000000000
--- a/shared/models/videos/live/live-video-update.model.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1import { VideoPrivacy } from '../video-privacy.enum'
2import { LiveVideoLatencyMode } from './live-video-latency-mode.enum'
3
4export interface LiveVideoUpdate {
5 permanentLive?: boolean
6 saveReplay?: boolean
7 replaySettings?: { privacy: VideoPrivacy }
8 latencyMode?: LiveVideoLatencyMode
9}
diff --git a/shared/models/videos/live/live-video.model.ts b/shared/models/videos/live/live-video.model.ts
deleted file mode 100644
index fd8454123..000000000
--- a/shared/models/videos/live/live-video.model.ts
+++ /dev/null
@@ -1,14 +0,0 @@
1import { VideoPrivacy } from '../video-privacy.enum'
2import { LiveVideoLatencyMode } from './live-video-latency-mode.enum'
3
4export interface LiveVideo {
5 // If owner
6 rtmpUrl?: string
7 rtmpsUrl?: string
8 streamKey?: string
9
10 saveReplay: boolean
11 replaySettings?: { privacy: VideoPrivacy }
12 permanentLive: boolean
13 latencyMode: LiveVideoLatencyMode
14}
diff --git a/shared/models/videos/nsfw-policy.type.ts b/shared/models/videos/nsfw-policy.type.ts
deleted file mode 100644
index dc0032a14..000000000
--- a/shared/models/videos/nsfw-policy.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type NSFWPolicyType = 'do_not_list' | 'blur' | 'display'
diff --git a/shared/models/videos/playlist/index.ts b/shared/models/videos/playlist/index.ts
deleted file mode 100644
index a9e8ce496..000000000
--- a/shared/models/videos/playlist/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
1export * from './video-exist-in-playlist.model'
2export * from './video-playlist-create-result.model'
3export * from './video-playlist-create.model'
4export * from './video-playlist-element-create-result.model'
5export * from './video-playlist-element-create.model'
6export * from './video-playlist-element-update.model'
7export * from './video-playlist-element.model'
8export * from './video-playlist-privacy.model'
9export * from './video-playlist-reorder.model'
10export * from './video-playlist-type.model'
11export * from './video-playlist-update.model'
12export * from './video-playlist.model'
diff --git a/shared/models/videos/playlist/video-exist-in-playlist.model.ts b/shared/models/videos/playlist/video-exist-in-playlist.model.ts
deleted file mode 100644
index 6d06c0f4d..000000000
--- a/shared/models/videos/playlist/video-exist-in-playlist.model.ts
+++ /dev/null
@@ -1,18 +0,0 @@
1export type VideosExistInPlaylists = {
2 [videoId: number]: VideoExistInPlaylist[]
3}
4export type CachedVideosExistInPlaylists = {
5 [videoId: number]: CachedVideoExistInPlaylist[]
6}
7
8export type CachedVideoExistInPlaylist = {
9 playlistElementId: number
10 playlistId: number
11 startTimestamp?: number
12 stopTimestamp?: number
13}
14
15export type VideoExistInPlaylist = CachedVideoExistInPlaylist & {
16 playlistDisplayName: string
17 playlistShortUUID: string
18}
diff --git a/shared/models/videos/playlist/video-playlist-create-result.model.ts b/shared/models/videos/playlist/video-playlist-create-result.model.ts
deleted file mode 100644
index cd9b170ae..000000000
--- a/shared/models/videos/playlist/video-playlist-create-result.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface VideoPlaylistCreateResult {
2 id: number
3 uuid: string
4 shortUUID: string
5}
diff --git a/shared/models/videos/playlist/video-playlist-create.model.ts b/shared/models/videos/playlist/video-playlist-create.model.ts
deleted file mode 100644
index 67a33fa35..000000000
--- a/shared/models/videos/playlist/video-playlist-create.model.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1import { VideoPlaylistPrivacy } from './video-playlist-privacy.model'
2
3export interface VideoPlaylistCreate {
4 displayName: string
5 privacy: VideoPlaylistPrivacy
6
7 description?: string
8 videoChannelId?: number
9
10 thumbnailfile?: any
11}
diff --git a/shared/models/videos/playlist/video-playlist-element-create-result.model.ts b/shared/models/videos/playlist/video-playlist-element-create-result.model.ts
deleted file mode 100644
index dc475e7d8..000000000
--- a/shared/models/videos/playlist/video-playlist-element-create-result.model.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export interface VideoPlaylistElementCreateResult {
2 id: number
3}
diff --git a/shared/models/videos/playlist/video-playlist-element-create.model.ts b/shared/models/videos/playlist/video-playlist-element-create.model.ts
deleted file mode 100644
index c31702892..000000000
--- a/shared/models/videos/playlist/video-playlist-element-create.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface VideoPlaylistElementCreate {
2 videoId: number
3
4 startTimestamp?: number
5 stopTimestamp?: number
6}
diff --git a/shared/models/videos/playlist/video-playlist-element-update.model.ts b/shared/models/videos/playlist/video-playlist-element-update.model.ts
deleted file mode 100644
index 15a30fbdc..000000000
--- a/shared/models/videos/playlist/video-playlist-element-update.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideoPlaylistElementUpdate {
2 startTimestamp?: number
3 stopTimestamp?: number
4}
diff --git a/shared/models/videos/playlist/video-playlist-element.model.ts b/shared/models/videos/playlist/video-playlist-element.model.ts
deleted file mode 100644
index df9e3b5cf..000000000
--- a/shared/models/videos/playlist/video-playlist-element.model.ts
+++ /dev/null
@@ -1,19 +0,0 @@
1import { Video } from '../video.model'
2
3export const enum VideoPlaylistElementType {
4 REGULAR = 0,
5 DELETED = 1,
6 PRIVATE = 2,
7 UNAVAILABLE = 3 // Blacklisted, blocked by the user/instance, NSFW...
8}
9
10export interface VideoPlaylistElement {
11 id: number
12 position: number
13 startTimestamp: number
14 stopTimestamp: number
15
16 type: VideoPlaylistElementType
17
18 video?: Video
19}
diff --git a/shared/models/videos/playlist/video-playlist-privacy.model.ts b/shared/models/videos/playlist/video-playlist-privacy.model.ts
deleted file mode 100644
index 480e1f104..000000000
--- a/shared/models/videos/playlist/video-playlist-privacy.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export const enum VideoPlaylistPrivacy {
2 PUBLIC = 1,
3 UNLISTED = 2,
4 PRIVATE = 3
5}
diff --git a/shared/models/videos/playlist/video-playlist-reorder.model.ts b/shared/models/videos/playlist/video-playlist-reorder.model.ts
deleted file mode 100644
index 63ec714c5..000000000
--- a/shared/models/videos/playlist/video-playlist-reorder.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface VideoPlaylistReorder {
2 startPosition: number
3 insertAfterPosition: number
4 reorderLength?: number
5}
diff --git a/shared/models/videos/playlist/video-playlist-type.model.ts b/shared/models/videos/playlist/video-playlist-type.model.ts
deleted file mode 100644
index 7f51a6354..000000000
--- a/shared/models/videos/playlist/video-playlist-type.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export const enum VideoPlaylistType {
2 REGULAR = 1,
3 WATCH_LATER = 2
4}
diff --git a/shared/models/videos/playlist/video-playlist-update.model.ts b/shared/models/videos/playlist/video-playlist-update.model.ts
deleted file mode 100644
index a6a3f74d9..000000000
--- a/shared/models/videos/playlist/video-playlist-update.model.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1import { VideoPlaylistPrivacy } from './video-playlist-privacy.model'
2
3export interface VideoPlaylistUpdate {
4 displayName?: string
5 privacy?: VideoPlaylistPrivacy
6
7 description?: string
8 videoChannelId?: number
9 thumbnailfile?: any
10}
diff --git a/shared/models/videos/playlist/video-playlist.model.ts b/shared/models/videos/playlist/video-playlist.model.ts
deleted file mode 100644
index b8a9955d9..000000000
--- a/shared/models/videos/playlist/video-playlist.model.ts
+++ /dev/null
@@ -1,34 +0,0 @@
1import { AccountSummary } from '../../actors/index'
2import { VideoChannelSummary, VideoConstant } from '..'
3import { VideoPlaylistPrivacy } from './video-playlist-privacy.model'
4import { VideoPlaylistType } from './video-playlist-type.model'
5
6export interface VideoPlaylist {
7 id: number
8 uuid: string
9 shortUUID: string
10
11 isLocal: boolean
12
13 url: string
14
15 displayName: string
16 description: string
17 privacy: VideoConstant<VideoPlaylistPrivacy>
18
19 thumbnailPath: string
20 thumbnailUrl?: string
21
22 videosLength: number
23
24 type: VideoConstant<VideoPlaylistType>
25
26 embedPath: string
27 embedUrl?: string
28
29 createdAt: Date | string
30 updatedAt: Date | string
31
32 ownerAccount: AccountSummary
33 videoChannel?: VideoChannelSummary
34}
diff --git a/shared/models/videos/rate/account-video-rate.model.ts b/shared/models/videos/rate/account-video-rate.model.ts
deleted file mode 100644
index e789367dc..000000000
--- a/shared/models/videos/rate/account-video-rate.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1import { UserVideoRateType } from './user-video-rate.type'
2import { Video } from '../video.model'
3
4export interface AccountVideoRate {
5 video: Video
6 rating: UserVideoRateType
7}
diff --git a/shared/models/videos/rate/index.ts b/shared/models/videos/rate/index.ts
deleted file mode 100644
index 06aa691bd..000000000
--- a/shared/models/videos/rate/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1
2export * from './user-video-rate-update.model'
3export * from './user-video-rate.model'
4export * from './account-video-rate.model'
5export * from './user-video-rate.type'
diff --git a/shared/models/videos/rate/user-video-rate-update.model.ts b/shared/models/videos/rate/user-video-rate-update.model.ts
deleted file mode 100644
index 85e89271a..000000000
--- a/shared/models/videos/rate/user-video-rate-update.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1import { UserVideoRateType } from './user-video-rate.type'
2
3export interface UserVideoRateUpdate {
4 rating: UserVideoRateType
5}
diff --git a/shared/models/videos/rate/user-video-rate.model.ts b/shared/models/videos/rate/user-video-rate.model.ts
deleted file mode 100644
index d39a1c3d5..000000000
--- a/shared/models/videos/rate/user-video-rate.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1import { UserVideoRateType } from './user-video-rate.type'
2
3export interface UserVideoRate {
4 videoId: number
5 rating: UserVideoRateType
6}
diff --git a/shared/models/videos/rate/user-video-rate.type.ts b/shared/models/videos/rate/user-video-rate.type.ts
deleted file mode 100644
index a4d9c7e39..000000000
--- a/shared/models/videos/rate/user-video-rate.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type UserVideoRateType = 'like' | 'dislike' | 'none'
diff --git a/shared/models/videos/stats/index.ts b/shared/models/videos/stats/index.ts
deleted file mode 100644
index a9b203f58..000000000
--- a/shared/models/videos/stats/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export * from './video-stats-overall-query.model'
2export * from './video-stats-overall.model'
3export * from './video-stats-retention.model'
4export * from './video-stats-timeserie-query.model'
5export * from './video-stats-timeserie-metric.type'
6export * from './video-stats-timeserie.model'
diff --git a/shared/models/videos/stats/video-stats-overall-query.model.ts b/shared/models/videos/stats/video-stats-overall-query.model.ts
deleted file mode 100644
index 6b4c2164f..000000000
--- a/shared/models/videos/stats/video-stats-overall-query.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideoStatsOverallQuery {
2 startDate?: string
3 endDate?: string
4}
diff --git a/shared/models/videos/stats/video-stats-overall.model.ts b/shared/models/videos/stats/video-stats-overall.model.ts
deleted file mode 100644
index 54b57798f..000000000
--- a/shared/models/videos/stats/video-stats-overall.model.ts
+++ /dev/null
@@ -1,14 +0,0 @@
1export interface VideoStatsOverall {
2 averageWatchTime: number
3 totalWatchTime: number
4
5 totalViewers: number
6
7 viewersPeak: number
8 viewersPeakDate: string
9
10 countries: {
11 isoCode: string
12 viewers: number
13 }[]
14}
diff --git a/shared/models/videos/stats/video-stats-retention.model.ts b/shared/models/videos/stats/video-stats-retention.model.ts
deleted file mode 100644
index e494888ed..000000000
--- a/shared/models/videos/stats/video-stats-retention.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface VideoStatsRetention {
2 data: {
3 second: number
4 retentionPercent: number
5 }[]
6}
diff --git a/shared/models/videos/stats/video-stats-timeserie-metric.type.ts b/shared/models/videos/stats/video-stats-timeserie-metric.type.ts
deleted file mode 100644
index fc268d083..000000000
--- a/shared/models/videos/stats/video-stats-timeserie-metric.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type VideoStatsTimeserieMetric = 'viewers' | 'aggregateWatchTime'
diff --git a/shared/models/videos/stats/video-stats-timeserie-query.model.ts b/shared/models/videos/stats/video-stats-timeserie-query.model.ts
deleted file mode 100644
index f3a8430e1..000000000
--- a/shared/models/videos/stats/video-stats-timeserie-query.model.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideoStatsTimeserieQuery {
2 startDate?: string
3 endDate?: string
4}
diff --git a/shared/models/videos/stats/video-stats-timeserie.model.ts b/shared/models/videos/stats/video-stats-timeserie.model.ts
deleted file mode 100644
index 4a0e208df..000000000
--- a/shared/models/videos/stats/video-stats-timeserie.model.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1export interface VideoStatsTimeserie {
2 groupInterval: string
3
4 data: {
5 date: string
6 value: number
7 }[]
8}
diff --git a/shared/models/videos/storyboard.model.ts b/shared/models/videos/storyboard.model.ts
deleted file mode 100644
index c92c81f09..000000000
--- a/shared/models/videos/storyboard.model.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1export interface Storyboard {
2 storyboardPath: string
3
4 totalHeight: number
5 totalWidth: number
6
7 spriteHeight: number
8 spriteWidth: number
9
10 spriteDuration: number
11}
diff --git a/shared/models/videos/studio/index.ts b/shared/models/videos/studio/index.ts
deleted file mode 100644
index a1eb98a49..000000000
--- a/shared/models/videos/studio/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-studio-create-edit.model'
diff --git a/shared/models/videos/studio/video-studio-create-edit.model.ts b/shared/models/videos/studio/video-studio-create-edit.model.ts
deleted file mode 100644
index 5e8296dc9..000000000
--- a/shared/models/videos/studio/video-studio-create-edit.model.ts
+++ /dev/null
@@ -1,60 +0,0 @@
1export interface VideoStudioCreateEdition {
2 tasks: VideoStudioTask[]
3}
4
5export type VideoStudioTask =
6 VideoStudioTaskCut |
7 VideoStudioTaskIntro |
8 VideoStudioTaskOutro |
9 VideoStudioTaskWatermark
10
11export interface VideoStudioTaskCut {
12 name: 'cut'
13
14 options: {
15 start?: number
16 end?: number
17 }
18}
19
20export interface VideoStudioTaskIntro {
21 name: 'add-intro'
22
23 options: {
24 file: Blob | string
25 }
26}
27
28export interface VideoStudioTaskOutro {
29 name: 'add-outro'
30
31 options: {
32 file: Blob | string
33 }
34}
35
36export interface VideoStudioTaskWatermark {
37 name: 'add-watermark'
38
39 options: {
40 file: Blob | string
41 }
42}
43
44// ---------------------------------------------------------------------------
45
46export function isVideoStudioTaskIntro (v: VideoStudioTask): v is VideoStudioTaskIntro {
47 return v.name === 'add-intro'
48}
49
50export function isVideoStudioTaskOutro (v: VideoStudioTask): v is VideoStudioTaskOutro {
51 return v.name === 'add-outro'
52}
53
54export function isVideoStudioTaskWatermark (v: VideoStudioTask): v is VideoStudioTaskWatermark {
55 return v.name === 'add-watermark'
56}
57
58export function hasVideoStudioTaskFile (v: VideoStudioTask): v is VideoStudioTaskIntro | VideoStudioTaskOutro | VideoStudioTaskWatermark {
59 return isVideoStudioTaskIntro(v) || isVideoStudioTaskOutro(v) || isVideoStudioTaskWatermark(v)
60}
diff --git a/shared/models/videos/thumbnail.type.ts b/shared/models/videos/thumbnail.type.ts
deleted file mode 100644
index 6907b2802..000000000
--- a/shared/models/videos/thumbnail.type.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export const enum ThumbnailType {
2 MINIATURE = 1,
3 PREVIEW = 2
4}
diff --git a/shared/models/videos/transcoding/index.ts b/shared/models/videos/transcoding/index.ts
deleted file mode 100644
index 14472d900..000000000
--- a/shared/models/videos/transcoding/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export * from './video-transcoding-create.model'
2export * from './video-transcoding-fps.model'
3export * from './video-transcoding.model'
diff --git a/shared/models/videos/transcoding/video-transcoding-create.model.ts b/shared/models/videos/transcoding/video-transcoding-create.model.ts
deleted file mode 100644
index 6c2dbefa6..000000000
--- a/shared/models/videos/transcoding/video-transcoding-create.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface VideoTranscodingCreate {
2 transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
3
4 forceTranscoding?: boolean // Default false
5}
diff --git a/shared/models/videos/transcoding/video-transcoding-fps.model.ts b/shared/models/videos/transcoding/video-transcoding-fps.model.ts
deleted file mode 100644
index 9a330ac94..000000000
--- a/shared/models/videos/transcoding/video-transcoding-fps.model.ts
+++ /dev/null
@@ -1,9 +0,0 @@
1export type VideoTranscodingFPS = {
2 MIN: number
3 STANDARD: number[]
4 HD_STANDARD: number[]
5 AUDIO_MERGE: number
6 AVERAGE: number
7 MAX: number
8 KEEP_ORIGIN_FPS_RESOLUTION_MIN: number
9}
diff --git a/shared/models/videos/transcoding/video-transcoding.model.ts b/shared/models/videos/transcoding/video-transcoding.model.ts
deleted file mode 100644
index 91eacf8dc..000000000
--- a/shared/models/videos/transcoding/video-transcoding.model.ts
+++ /dev/null
@@ -1,67 +0,0 @@
1import { VideoResolution } from '../file/video-resolution.enum'
2
3// Types used by plugins and ffmpeg-utils
4
5export type EncoderOptionsBuilderParams = {
6 input: string
7
8 resolution: VideoResolution
9
10 // If PeerTube applies a filter, transcoding profile must not copy input stream
11 canCopyAudio: boolean
12 canCopyVideo: boolean
13
14 fps: number
15
16 // Could be undefined if we could not get input bitrate (some RTMP streams for example)
17 inputBitrate: number
18 inputRatio: number
19
20 // For lives
21 streamNum?: number
22}
23
24export type EncoderOptionsBuilder = (params: EncoderOptionsBuilderParams) => Promise<EncoderOptions> | EncoderOptions
25
26export interface EncoderOptions {
27 copy?: boolean // Copy stream? Default to false
28
29 scaleFilter?: {
30 name: string
31 }
32
33 inputOptions?: string[]
34 outputOptions?: string[]
35}
36
37// All our encoders
38
39export interface EncoderProfile <T> {
40 [ profile: string ]: T
41
42 default: T
43}
44
45export type AvailableEncoders = {
46 available: {
47 live: {
48 [ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
49 }
50
51 vod: {
52 [ encoder: string ]: EncoderProfile<EncoderOptionsBuilder>
53 }
54 }
55
56 encodersToTry: {
57 vod: {
58 video: string[]
59 audio: string[]
60 }
61
62 live: {
63 video: string[]
64 audio: string[]
65 }
66 }
67}
diff --git a/shared/models/videos/video-constant.model.ts b/shared/models/videos/video-constant.model.ts
deleted file mode 100644
index 353a29535..000000000
--- a/shared/models/videos/video-constant.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface VideoConstant<T> {
2 id: T
3 label: string
4 description?: string
5}
diff --git a/shared/models/videos/video-create-result.model.ts b/shared/models/videos/video-create-result.model.ts
deleted file mode 100644
index a9f8e25a0..000000000
--- a/shared/models/videos/video-create-result.model.ts
+++ /dev/null
@@ -1,5 +0,0 @@
1export interface VideoCreateResult {
2 id: number
3 uuid: string
4 shortUUID: string
5}
diff --git a/shared/models/videos/video-create.model.ts b/shared/models/videos/video-create.model.ts
deleted file mode 100644
index 7a34b5afe..000000000
--- a/shared/models/videos/video-create.model.ts
+++ /dev/null
@@ -1,25 +0,0 @@
1import { VideoPrivacy } from './video-privacy.enum'
2import { VideoScheduleUpdate } from './video-schedule-update.model'
3
4export interface VideoCreate {
5 name: string
6 channelId: number
7
8 category?: number
9 licence?: number
10 language?: string
11 description?: string
12 support?: string
13 nsfw?: boolean
14 waitTranscoding?: boolean
15 tags?: string[]
16 commentsEnabled?: boolean
17 downloadEnabled?: boolean
18 privacy: VideoPrivacy
19 scheduleUpdate?: VideoScheduleUpdate
20 originallyPublishedAt?: Date | string
21 videoPasswords?: string[]
22
23 thumbnailfile?: Blob | string
24 previewfile?: Blob | string
25}
diff --git a/shared/models/videos/video-include.enum.ts b/shared/models/videos/video-include.enum.ts
deleted file mode 100644
index 32ee12e86..000000000
--- a/shared/models/videos/video-include.enum.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1export const enum VideoInclude {
2 NONE = 0,
3 NOT_PUBLISHED_STATE = 1 << 0,
4 BLACKLISTED = 1 << 1,
5 BLOCKED_OWNER = 1 << 2,
6 FILES = 1 << 3,
7 CAPTIONS = 1 << 4
8}
diff --git a/shared/models/videos/video-password.model.ts b/shared/models/videos/video-password.model.ts
deleted file mode 100644
index c0280b9b9..000000000
--- a/shared/models/videos/video-password.model.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export interface VideoPassword {
2 id: number
3 password: string
4 videoId: number
5 createdAt: Date | string
6 updatedAt: Date | string
7}
diff --git a/shared/models/videos/video-privacy.enum.ts b/shared/models/videos/video-privacy.enum.ts
deleted file mode 100644
index 12e1d196f..000000000
--- a/shared/models/videos/video-privacy.enum.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export const enum VideoPrivacy {
2 PUBLIC = 1,
3 UNLISTED = 2,
4 PRIVATE = 3,
5 INTERNAL = 4,
6 PASSWORD_PROTECTED = 5
7}
diff --git a/shared/models/videos/video-rate.type.ts b/shared/models/videos/video-rate.type.ts
deleted file mode 100644
index d48774a4b..000000000
--- a/shared/models/videos/video-rate.type.ts
+++ /dev/null
@@ -1 +0,0 @@
1export type VideoRateType = 'like' | 'dislike'
diff --git a/shared/models/videos/video-schedule-update.model.ts b/shared/models/videos/video-schedule-update.model.ts
deleted file mode 100644
index 87d74f654..000000000
--- a/shared/models/videos/video-schedule-update.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1import { VideoPrivacy } from './video-privacy.enum'
2
3export interface VideoScheduleUpdate {
4 updateAt: Date | string
5 privacy?: VideoPrivacy.PUBLIC | VideoPrivacy.UNLISTED | VideoPrivacy.INTERNAL // Cannot schedule an update to PRIVATE
6}
diff --git a/shared/models/videos/video-sort-field.type.ts b/shared/models/videos/video-sort-field.type.ts
deleted file mode 100644
index 7fa07fa73..000000000
--- a/shared/models/videos/video-sort-field.type.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1export type VideoSortField =
2 'name' | '-name' |
3 'duration' | '-duration' |
4 'publishedAt' | '-publishedAt' |
5 'originallyPublishedAt' | '-originallyPublishedAt' |
6 'createdAt' | '-createdAt' |
7 'views' | '-views' |
8 'likes' | '-likes' |
9
10 // trending sorts
11 'trending' | '-trending' |
12 'hot' | '-hot' |
13 'best' | '-best'
diff --git a/shared/models/videos/video-source.ts b/shared/models/videos/video-source.ts
deleted file mode 100644
index bf4ad2453..000000000
--- a/shared/models/videos/video-source.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export interface VideoSource {
2 filename: string
3 createdAt: string | Date
4}
diff --git a/shared/models/videos/video-state.enum.ts b/shared/models/videos/video-state.enum.ts
deleted file mode 100644
index e45e4adc2..000000000
--- a/shared/models/videos/video-state.enum.ts
+++ /dev/null
@@ -1,11 +0,0 @@
1export const enum VideoState {
2 PUBLISHED = 1,
3 TO_TRANSCODE = 2,
4 TO_IMPORT = 3,
5 WAITING_FOR_LIVE = 4,
6 LIVE_ENDED = 5,
7 TO_MOVE_TO_EXTERNAL_STORAGE = 6,
8 TRANSCODING_FAILED = 7,
9 TO_MOVE_TO_EXTERNAL_STORAGE_FAILED = 8,
10 TO_EDIT = 9
11}
diff --git a/shared/models/videos/video-storage.enum.ts b/shared/models/videos/video-storage.enum.ts
deleted file mode 100644
index 7c6690db2..000000000
--- a/shared/models/videos/video-storage.enum.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export const enum VideoStorage {
2 FILE_SYSTEM,
3 OBJECT_STORAGE,
4}
diff --git a/shared/models/videos/video-streaming-playlist.model.ts b/shared/models/videos/video-streaming-playlist.model.ts
deleted file mode 100644
index 11919a4ee..000000000
--- a/shared/models/videos/video-streaming-playlist.model.ts
+++ /dev/null
@@ -1,15 +0,0 @@
1import { VideoStreamingPlaylistType } from './video-streaming-playlist.type'
2import { VideoFile } from './file'
3
4export interface VideoStreamingPlaylist {
5 id: number
6 type: VideoStreamingPlaylistType
7 playlistUrl: string
8 segmentsSha256Url: string
9
10 redundancies: {
11 baseUrl: string
12 }[]
13
14 files: VideoFile[]
15}
diff --git a/shared/models/videos/video-streaming-playlist.type.ts b/shared/models/videos/video-streaming-playlist.type.ts
deleted file mode 100644
index e2e2b93ea..000000000
--- a/shared/models/videos/video-streaming-playlist.type.ts
+++ /dev/null
@@ -1,3 +0,0 @@
1export const enum VideoStreamingPlaylistType {
2 HLS = 1
3}
diff --git a/shared/models/videos/video-token.model.ts b/shared/models/videos/video-token.model.ts
deleted file mode 100644
index aefea565f..000000000
--- a/shared/models/videos/video-token.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export interface VideoToken {
2 files: {
3 token: string
4 expires: string | Date
5 }
6}
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts
deleted file mode 100644
index 43537b5af..000000000
--- a/shared/models/videos/video-update.model.ts
+++ /dev/null
@@ -1,25 +0,0 @@
1import { VideoPrivacy } from './video-privacy.enum'
2import { VideoScheduleUpdate } from './video-schedule-update.model'
3
4export interface VideoUpdate {
5 name?: string
6 category?: number
7 licence?: number
8 language?: string
9 description?: string
10 support?: string
11 privacy?: VideoPrivacy
12 tags?: string[]
13 commentsEnabled?: boolean
14 downloadEnabled?: boolean
15 nsfw?: boolean
16 waitTranscoding?: boolean
17 channelId?: number
18 thumbnailfile?: Blob
19 previewfile?: Blob
20 scheduleUpdate?: VideoScheduleUpdate
21 originallyPublishedAt?: Date | string
22 videoPasswords?: string[]
23
24 pluginData?: any
25}
diff --git a/shared/models/videos/video-view.model.ts b/shared/models/videos/video-view.model.ts
deleted file mode 100644
index f61211104..000000000
--- a/shared/models/videos/video-view.model.ts
+++ /dev/null
@@ -1,6 +0,0 @@
1export type VideoViewEvent = 'seek'
2
3export interface VideoView {
4 currentTime: number
5 viewEvent?: VideoViewEvent
6}
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
deleted file mode 100644
index 7e5930067..000000000
--- a/shared/models/videos/video.model.ts
+++ /dev/null
@@ -1,99 +0,0 @@
1import { Account, AccountSummary } from '../actors'
2import { VideoChannel, VideoChannelSummary } from './channel/video-channel.model'
3import { VideoFile } from './file'
4import { VideoConstant } from './video-constant.model'
5import { VideoPrivacy } from './video-privacy.enum'
6import { VideoScheduleUpdate } from './video-schedule-update.model'
7import { VideoState } from './video-state.enum'
8import { VideoStreamingPlaylist } from './video-streaming-playlist.model'
9
10export interface Video extends Partial<VideoAdditionalAttributes> {
11 id: number
12 uuid: string
13 shortUUID: string
14
15 createdAt: Date | string
16 updatedAt: Date | string
17 publishedAt: Date | string
18 originallyPublishedAt: Date | string
19 category: VideoConstant<number>
20 licence: VideoConstant<number>
21 language: VideoConstant<string>
22 privacy: VideoConstant<VideoPrivacy>
23
24 // Deprecated in 5.0 in favour of truncatedDescription
25 description: string
26 truncatedDescription: string
27
28 duration: number
29 isLocal: boolean
30 name: string
31
32 isLive: boolean
33
34 thumbnailPath: string
35 thumbnailUrl?: string
36
37 previewPath: string
38 previewUrl?: string
39
40 embedPath: string
41 embedUrl?: string
42
43 url: string
44
45 views: number
46 viewers: number
47
48 likes: number
49 dislikes: number
50 nsfw: boolean
51
52 account: AccountSummary
53 channel: VideoChannelSummary
54
55 userHistory?: {
56 currentTime: number
57 }
58
59 pluginData?: any
60}
61
62// Not included by default, needs query params
63export interface VideoAdditionalAttributes {
64 waitTranscoding: boolean
65 state: VideoConstant<VideoState>
66 scheduledUpdate: VideoScheduleUpdate
67
68 blacklisted: boolean
69 blacklistedReason: string
70
71 blockedOwner: boolean
72 blockedServer: boolean
73
74 files: VideoFile[]
75 streamingPlaylists: VideoStreamingPlaylist[]
76}
77
78export interface VideoDetails extends Video {
79 // Deprecated in 5.0
80 descriptionPath: string
81
82 support: string
83 channel: VideoChannel
84 account: Account
85 tags: string[]
86 commentsEnabled: boolean
87 downloadEnabled: boolean
88
89 // Not optional in details (unlike in parent Video)
90 waitTranscoding: boolean
91 state: VideoConstant<VideoState>
92
93 trackerUrls: string[]
94
95 files: VideoFile[]
96 streamingPlaylists: VideoStreamingPlaylist[]
97
98 inputFileUpdatedAt: string | Date
99}