aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/typings/models')
-rw-r--r--server/typings/models/account/account-blocklist.ts6
-rw-r--r--server/typings/models/account/account.ts42
-rw-r--r--server/typings/models/account/actor-follow.ts24
-rw-r--r--server/typings/models/account/actor.ts54
-rw-r--r--server/typings/models/account/avatar.ts3
-rw-r--r--server/typings/models/oauth/oauth-token.ts3
-rw-r--r--server/typings/models/server/plugin.ts3
-rw-r--r--server/typings/models/server/server-blocklist.ts6
-rw-r--r--server/typings/models/server/server.ts6
-rw-r--r--server/typings/models/user/user-notification.ts42
-rw-r--r--server/typings/models/user/user.ts33
-rw-r--r--server/typings/models/video/schedule-video-update.ts3
-rw-r--r--server/typings/models/video/video-abuse.ts9
-rw-r--r--server/typings/models/video/video-blacklist.ts9
-rw-r--r--server/typings/models/video/video-caption.ts6
-rw-r--r--server/typings/models/video/video-change-ownership.ts6
-rw-r--r--server/typings/models/video/video-channels.ts57
-rw-r--r--server/typings/models/video/video-comment.ts27
-rw-r--r--server/typings/models/video/video-file.ts18
-rw-r--r--server/typings/models/video/video-import.ts12
-rw-r--r--server/typings/models/video/video-playlist-element.ts12
-rw-r--r--server/typings/models/video/video-playlist.ts36
-rw-r--r--server/typings/models/video/video-rate.ts9
-rw-r--r--server/typings/models/video/video-redundancy.ts15
-rw-r--r--server/typings/models/video/video-share.ts6
-rw-r--r--server/typings/models/video/video-streaming-playlist.ts18
-rw-r--r--server/typings/models/video/video.ts78
27 files changed, 362 insertions, 181 deletions
diff --git a/server/typings/models/account/account-blocklist.ts b/server/typings/models/account/account-blocklist.ts
index c9cb55332..0d8bf11bd 100644
--- a/server/typings/models/account/account-blocklist.ts
+++ b/server/typings/models/account/account-blocklist.ts
@@ -12,7 +12,8 @@ export type MAccountBlocklist = Omit<AccountBlocklistModel, 'ByAccount' | 'Block
12 12
13export type MAccountBlocklistId = Pick<AccountBlocklistModel, 'id'> 13export type MAccountBlocklistId = Pick<AccountBlocklistModel, 'id'>
14 14
15export type MAccountBlocklistAccounts = MAccountBlocklist & 15export type MAccountBlocklistAccounts =
16 MAccountBlocklist &
16 Use<'ByAccount', MAccountDefault> & 17 Use<'ByAccount', MAccountDefault> &
17 Use<'BlockedAccount', MAccountDefault> 18 Use<'BlockedAccount', MAccountDefault>
18 19
@@ -20,6 +21,7 @@ export type MAccountBlocklistAccounts = MAccountBlocklist &
20 21
21// Format for API or AP object 22// Format for API or AP object
22 23
23export type MAccountBlocklistFormattable = Pick<MAccountBlocklist, 'createdAt'> & 24export type MAccountBlocklistFormattable =
25 Pick<MAccountBlocklist, 'createdAt'> &
24 Use<'ByAccount', MAccountFormattable> & 26 Use<'ByAccount', MAccountFormattable> &
25 Use<'BlockedAccount', MAccountFormattable> 27 Use<'BlockedAccount', MAccountFormattable>
diff --git a/server/typings/models/account/account.ts b/server/typings/models/account/account.ts
index adb1f3689..7b826ee04 100644
--- a/server/typings/models/account/account.ts
+++ b/server/typings/models/account/account.ts
@@ -21,7 +21,8 @@ type Use<K extends keyof AccountModel, M> = PickWith<AccountModel, K, M>
21 21
22// ############################################################################ 22// ############################################################################
23 23
24export type MAccount = Omit<AccountModel, 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' | 24export type MAccount =
25 Omit<AccountModel, 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' |
25 'VideoComments' | 'BlockedAccounts'> 26 'VideoComments' | 'BlockedAccounts'>
26 27
27// ############################################################################ 28// ############################################################################
@@ -34,62 +35,75 @@ export type MAccountUserId = Pick<MAccount, 'userId'>
34export type MAccountUrl = Use<'Actor', MActorUrl> 35export type MAccountUrl = Use<'Actor', MActorUrl>
35export type MAccountAudience = Use<'Actor', MActorAudience> 36export type MAccountAudience = Use<'Actor', MActorAudience>
36 37
37export type MAccountIdActor = MAccountId & 38export type MAccountIdActor =
39 MAccountId &
38 Use<'Actor', MActor> 40 Use<'Actor', MActor>
39 41
40export type MAccountIdActorId = MAccountId & 42export type MAccountIdActorId =
43 MAccountId &
41 Use<'Actor', MActorId> 44 Use<'Actor', MActorId>
42 45
43// ############################################################################ 46// ############################################################################
44 47
45// Default scope 48// Default scope
46export type MAccountDefault = MAccount & 49export type MAccountDefault =
50 MAccount &
47 Use<'Actor', MActorDefault> 51 Use<'Actor', MActorDefault>
48 52
49// Default with default association scopes 53// Default with default association scopes
50export type MAccountDefaultChannelDefault = MAccount & 54export type MAccountDefaultChannelDefault =
55 MAccount &
51 Use<'Actor', MActorDefault> & 56 Use<'Actor', MActorDefault> &
52 Use<'VideoChannels', MChannelDefault[]> 57 Use<'VideoChannels', MChannelDefault[]>
53 58
54// We don't need some actors attributes 59// We don't need some actors attributes
55export type MAccountLight = MAccount & 60export type MAccountLight =
61 MAccount &
56 Use<'Actor', MActorDefaultLight> 62 Use<'Actor', MActorDefaultLight>
57 63
58// ############################################################################ 64// ############################################################################
59 65
60// Full actor 66// Full actor
61export type MAccountActor = MAccount & 67export type MAccountActor =
68 MAccount &
62 Use<'Actor', MActor> 69 Use<'Actor', MActor>
63 70
64// Full actor with server 71// Full actor with server
65export type MAccountServer = MAccount & 72export type MAccountServer =
73 MAccount &
66 Use<'Actor', MActorServer> 74 Use<'Actor', MActorServer>
67 75
68// ############################################################################ 76// ############################################################################
69 77
70// For API 78// For API
71 79
72export type MAccountSummary = FunctionProperties<MAccount> & 80export type MAccountSummary =
81 FunctionProperties<MAccount> &
73 Pick<MAccount, 'id' | 'name'> & 82 Pick<MAccount, 'id' | 'name'> &
74 Use<'Actor', MActorSummary> 83 Use<'Actor', MActorSummary>
75 84
76export type MAccountSummaryBlocks = MAccountSummary & 85export type MAccountSummaryBlocks =
86 MAccountSummary &
77 Use<'BlockedAccounts', MAccountBlocklistId[]> 87 Use<'BlockedAccounts', MAccountBlocklistId[]>
78 88
79export type MAccountAPI = MAccount & 89export type MAccountAPI =
90 MAccount &
80 Use<'Actor', MActorAPI> 91 Use<'Actor', MActorAPI>
81 92
82// ############################################################################ 93// ############################################################################
83 94
84// Format for API or AP object 95// Format for API or AP object
85 96
86export type MAccountSummaryFormattable = FunctionProperties<MAccount> & 97export type MAccountSummaryFormattable =
98 FunctionProperties<MAccount> &
87 Pick<MAccount, 'id' | 'name'> & 99 Pick<MAccount, 'id' | 'name'> &
88 Use<'Actor', MActorSummaryFormattable> 100 Use<'Actor', MActorSummaryFormattable>
89 101
90export type MAccountFormattable = FunctionProperties<MAccount> & 102export type MAccountFormattable =
103 FunctionProperties<MAccount> &
91 Pick<MAccount, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'userId'> & 104 Pick<MAccount, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'userId'> &
92 Use<'Actor', MActorFormattable> 105 Use<'Actor', MActorFormattable>
93 106
94export type MAccountAP = Pick<MAccount, 'name' | 'description'> & 107export type MAccountAP =
108 Pick<MAccount, 'name' | 'description'> &
95 Use<'Actor', MActorAP> 109 Use<'Actor', MActorAP>
diff --git a/server/typings/models/account/actor-follow.ts b/server/typings/models/account/actor-follow.ts
index f44157eba..5d0c03c8d 100644
--- a/server/typings/models/account/actor-follow.ts
+++ b/server/typings/models/account/actor-follow.ts
@@ -20,22 +20,26 @@ export type MActorFollow = Omit<ActorFollowModel, 'ActorFollower' | 'ActorFollow
20 20
21// ############################################################################ 21// ############################################################################
22 22
23export type MActorFollowFollowingHost = MActorFollow & 23export type MActorFollowFollowingHost =
24 MActorFollow &
24 Use<'ActorFollowing', MActorUsername & MActorHost> 25 Use<'ActorFollowing', MActorUsername & MActorHost>
25 26
26// ############################################################################ 27// ############################################################################
27 28
28// With actors or actors default 29// With actors or actors default
29 30
30export type MActorFollowActors = MActorFollow & 31export type MActorFollowActors =
32 MActorFollow &
31 Use<'ActorFollower', MActor> & 33 Use<'ActorFollower', MActor> &
32 Use<'ActorFollowing', MActor> 34 Use<'ActorFollowing', MActor>
33 35
34export type MActorFollowActorsDefault = MActorFollow & 36export type MActorFollowActorsDefault =
37 MActorFollow &
35 Use<'ActorFollower', MActorDefault> & 38 Use<'ActorFollower', MActorDefault> &
36 Use<'ActorFollowing', MActorDefault> 39 Use<'ActorFollowing', MActorDefault>
37 40
38export type MActorFollowFull = MActorFollow & 41export type MActorFollowFull =
42 MActorFollow &
39 Use<'ActorFollower', MActorDefaultAccountChannel> & 43 Use<'ActorFollower', MActorDefaultAccountChannel> &
40 Use<'ActorFollowing', MActorDefaultAccountChannel> 44 Use<'ActorFollowing', MActorDefaultAccountChannel>
41 45
@@ -43,20 +47,24 @@ export type MActorFollowFull = MActorFollow &
43 47
44// For subscriptions 48// For subscriptions
45 49
46type SubscriptionFollowing = MActorDefault & 50type SubscriptionFollowing =
51 MActorDefault &
47 PickWith<ActorModel, 'VideoChannel', MChannelDefault> 52 PickWith<ActorModel, 'VideoChannel', MChannelDefault>
48 53
49export type MActorFollowActorsDefaultSubscription = MActorFollow & 54export type MActorFollowActorsDefaultSubscription =
55 MActorFollow &
50 Use<'ActorFollower', MActorDefault> & 56 Use<'ActorFollower', MActorDefault> &
51 Use<'ActorFollowing', SubscriptionFollowing> 57 Use<'ActorFollowing', SubscriptionFollowing>
52 58
53export type MActorFollowSubscriptions = MActorFollow & 59export type MActorFollowSubscriptions =
60 MActorFollow &
54 Use<'ActorFollowing', MActorChannelAccountActor> 61 Use<'ActorFollowing', MActorChannelAccountActor>
55 62
56// ############################################################################ 63// ############################################################################
57 64
58// Format for API or AP object 65// Format for API or AP object
59 66
60export type MActorFollowFormattable = Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> & 67export type MActorFollowFormattable =
68 Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> &
61 Use<'ActorFollower', MActorFormattable> & 69 Use<'ActorFollower', MActorFormattable> &
62 Use<'ActorFollowing', MActorFormattable> 70 Use<'ActorFollowing', MActorFormattable>
diff --git a/server/typings/models/account/actor.ts b/server/typings/models/account/actor.ts
index ee4ece755..1160e84cb 100644
--- a/server/typings/models/account/actor.ts
+++ b/server/typings/models/account/actor.ts
@@ -31,18 +31,23 @@ export type MActorLight = Omit<MActor, 'privateKey' | 'privateKey'>
31export type MActorHost = Use<'Server', MServerHost> 31export type MActorHost = Use<'Server', MServerHost>
32export type MActorRedundancyAllowedOpt = PickWithOpt<ActorModel, 'Server', MServerRedundancyAllowed> 32export type MActorRedundancyAllowedOpt = PickWithOpt<ActorModel, 'Server', MServerRedundancyAllowed>
33 33
34export type MActorDefaultLight = MActorLight & 34export type MActorDefaultLight =
35 MActorLight &
35 Use<'Server', MServerHost> & 36 Use<'Server', MServerHost> &
36 Use<'Avatar', MAvatar> 37 Use<'Avatar', MAvatar>
37 38
38export type MActorAccountId = MActor & 39export type MActorAccountId =
40 MActor &
39 Use<'Account', MAccountId> 41 Use<'Account', MAccountId>
40export type MActorAccountIdActor = MActor & 42export type MActorAccountIdActor =
43 MActor &
41 Use<'Account', MAccountIdActor> 44 Use<'Account', MAccountIdActor>
42 45
43export type MActorChannelId = MActor & 46export type MActorChannelId =
47 MActor &
44 Use<'VideoChannel', MChannelId> 48 Use<'VideoChannel', MChannelId>
45export type MActorChannelIdActor = MActor & 49export type MActorChannelIdActor =
50 MActor &
46 Use<'VideoChannel', MChannelIdActor> 51 Use<'VideoChannel', MChannelIdActor>
47 52
48export type MActorAccountChannelId = MActorAccountId & MActorChannelId 53export type MActorAccountChannelId = MActorAccountId & MActorChannelId
@@ -52,38 +57,45 @@ export type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelId
52 57
53// Include raw account/channel/server 58// Include raw account/channel/server
54 59
55export type MActorAccount = MActor & 60export type MActorAccount =
61 MActor &
56 Use<'Account', MAccount> 62 Use<'Account', MAccount>
57 63
58export type MActorChannel = MActor & 64export type MActorChannel =
65 MActor &
59 Use<'VideoChannel', MChannel> 66 Use<'VideoChannel', MChannel>
60 67
61export type MActorDefaultAccountChannel = MActorDefault & MActorAccount & MActorChannel 68export type MActorDefaultAccountChannel = MActorDefault & MActorAccount & MActorChannel
62 69
63export type MActorServer = MActor & 70export type MActorServer =
71 MActor &
64 Use<'Server', MServer> 72 Use<'Server', MServer>
65 73
66// ############################################################################ 74// ############################################################################
67 75
68// Complex actor associations 76// Complex actor associations
69 77
70export type MActorDefault = MActor & 78export type MActorDefault =
79 MActor &
71 Use<'Server', MServer> & 80 Use<'Server', MServer> &
72 Use<'Avatar', MAvatar> 81 Use<'Avatar', MAvatar>
73 82
74// Actor with channel that is associated to an account and its actor 83// Actor with channel that is associated to an account and its actor
75// Actor -> VideoChannel -> Account -> Actor 84// Actor -> VideoChannel -> Account -> Actor
76export type MActorChannelAccountActor = MActor & 85export type MActorChannelAccountActor =
86 MActor &
77 Use<'VideoChannel', MChannelAccountActor> 87 Use<'VideoChannel', MChannelAccountActor>
78 88
79export type MActorFull = MActor & 89export type MActorFull =
90 MActor &
80 Use<'Server', MServer> & 91 Use<'Server', MServer> &
81 Use<'Avatar', MAvatar> & 92 Use<'Avatar', MAvatar> &
82 Use<'Account', MAccount> & 93 Use<'Account', MAccount> &
83 Use<'VideoChannel', MChannelAccountActor> 94 Use<'VideoChannel', MChannelAccountActor>
84 95
85// Same than ActorFull, but the account and the channel have their actor 96// Same than ActorFull, but the account and the channel have their actor
86export type MActorFullActor = MActor & 97export type MActorFullActor =
98 MActor &
87 Use<'Server', MServer> & 99 Use<'Server', MServer> &
88 Use<'Avatar', MAvatar> & 100 Use<'Avatar', MAvatar> &
89 Use<'Account', MAccountDefault> & 101 Use<'Account', MAccountDefault> &
@@ -93,29 +105,35 @@ export type MActorFullActor = MActor &
93 105
94// API 106// API
95 107
96export type MActorSummary = FunctionProperties<MActor> & 108export type MActorSummary =
109 FunctionProperties<MActor> &
97 Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> & 110 Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> &
98 Use<'Server', MServerHost> & 111 Use<'Server', MServerHost> &
99 Use<'Avatar', MAvatar> 112 Use<'Avatar', MAvatar>
100 113
101export type MActorSummaryBlocks = MActorSummary & 114export type MActorSummaryBlocks =
115 MActorSummary &
102 Use<'Server', MServerHostBlocks> 116 Use<'Server', MServerHostBlocks>
103 117
104export type MActorAPI = Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' | 118export type MActorAPI =
119 Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' |
105 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'> 120 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'>
106 121
107// ############################################################################ 122// ############################################################################
108 123
109// Format for API or AP object 124// Format for API or AP object
110 125
111export type MActorSummaryFormattable = FunctionProperties<MActor> & 126export type MActorSummaryFormattable =
127 FunctionProperties<MActor> &
112 Pick<MActor, 'url' | 'preferredUsername'> & 128 Pick<MActor, 'url' | 'preferredUsername'> &
113 Use<'Server', MServerHost> & 129 Use<'Server', MServerHost> &
114 Use<'Avatar', MAvatarFormattable> 130 Use<'Avatar', MAvatarFormattable>
115 131
116export type MActorFormattable = MActorSummaryFormattable & 132export type MActorFormattable =
133 MActorSummaryFormattable &
117 Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt'> & 134 Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt'> &
118 Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>> 135 Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>>
119 136
120export type MActorAP = MActor & 137export type MActorAP =
138 MActor &
121 Use<'Avatar', MAvatar> 139 Use<'Avatar', MAvatar>
diff --git a/server/typings/models/account/avatar.ts b/server/typings/models/account/avatar.ts
index 8af6cc787..21b47180f 100644
--- a/server/typings/models/account/avatar.ts
+++ b/server/typings/models/account/avatar.ts
@@ -7,5 +7,6 @@ export type MAvatar = AvatarModel
7 7
8// Format for API or AP object 8// Format for API or AP object
9 9
10export type MAvatarFormattable = FunctionProperties<MAvatar> & 10export type MAvatarFormattable =
11 FunctionProperties<MAvatar> &
11 Pick<MAvatar, 'filename' | 'createdAt' | 'updatedAt'> 12 Pick<MAvatar, 'filename' | 'createdAt' | 'updatedAt'>
diff --git a/server/typings/models/oauth/oauth-token.ts b/server/typings/models/oauth/oauth-token.ts
index 8ef042d4e..b24a95fd8 100644
--- a/server/typings/models/oauth/oauth-token.ts
+++ b/server/typings/models/oauth/oauth-token.ts
@@ -8,6 +8,7 @@ type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M>
8 8
9export type MOAuthToken = Omit<OAuthTokenModel, 'User' | 'OAuthClients'> 9export type MOAuthToken = Omit<OAuthTokenModel, 'User' | 'OAuthClients'>
10 10
11export type MOAuthTokenUser = MOAuthToken & 11export type MOAuthTokenUser =
12 MOAuthToken &
12 Use<'User', MUserAccountUrl> & 13 Use<'User', MUserAccountUrl> &
13 { user?: MUserAccountUrl } 14 { user?: MUserAccountUrl }
diff --git a/server/typings/models/server/plugin.ts b/server/typings/models/server/plugin.ts
index 94674c318..83eb83794 100644
--- a/server/typings/models/server/plugin.ts
+++ b/server/typings/models/server/plugin.ts
@@ -6,5 +6,6 @@ export type MPlugin = PluginModel
6 6
7// Format for API or AP object 7// Format for API or AP object
8 8
9export type MPluginFormattable = Pick<MPlugin, 'name' | 'type' | 'version' | 'latestVersion' | 'enabled' | 'uninstalled' 9export type MPluginFormattable =
10 Pick<MPlugin, 'name' | 'type' | 'version' | 'latestVersion' | 'enabled' | 'uninstalled'
10 | 'peertubeEngine' | 'description' | 'homepage' | 'settings' | 'createdAt' | 'updatedAt'> 11 | 'peertubeEngine' | 'description' | 'homepage' | 'settings' | 'createdAt' | 'updatedAt'>
diff --git a/server/typings/models/server/server-blocklist.ts b/server/typings/models/server/server-blocklist.ts
index c3e6230f2..ff6f49176 100644
--- a/server/typings/models/server/server-blocklist.ts
+++ b/server/typings/models/server/server-blocklist.ts
@@ -11,7 +11,8 @@ export type MServerBlocklist = Omit<ServerBlocklistModel, 'ByAccount' | 'Blocked
11 11
12// ############################################################################ 12// ############################################################################
13 13
14export type MServerBlocklistAccountServer = MServerBlocklist & 14export type MServerBlocklistAccountServer =
15 MServerBlocklist &
15 Use<'ByAccount', MAccountDefault> & 16 Use<'ByAccount', MAccountDefault> &
16 Use<'BlockedServer', MServer> 17 Use<'BlockedServer', MServer>
17 18
@@ -19,6 +20,7 @@ export type MServerBlocklistAccountServer = MServerBlocklist &
19 20
20// Format for API or AP object 21// Format for API or AP object
21 22
22export type MServerBlocklistFormattable = Pick<MServerBlocklist, 'createdAt'> & 23export type MServerBlocklistFormattable =
24 Pick<MServerBlocklist, 'createdAt'> &
23 Use<'ByAccount', MAccountFormattable> & 25 Use<'ByAccount', MAccountFormattable> &
24 Use<'BlockedServer', MServerFormattable> 26 Use<'BlockedServer', MServerFormattable>
diff --git a/server/typings/models/server/server.ts b/server/typings/models/server/server.ts
index 190cc0c28..b35e55aeb 100644
--- a/server/typings/models/server/server.ts
+++ b/server/typings/models/server/server.ts
@@ -13,12 +13,14 @@ export type MServer = Omit<ServerModel, 'Actors' | 'BlockedByAccounts'>
13export type MServerHost = Pick<MServer, 'host'> 13export type MServerHost = Pick<MServer, 'host'>
14export type MServerRedundancyAllowed = Pick<MServer, 'redundancyAllowed'> 14export type MServerRedundancyAllowed = Pick<MServer, 'redundancyAllowed'>
15 15
16export type MServerHostBlocks = MServerHost & 16export type MServerHostBlocks =
17 MServerHost &
17 Use<'BlockedByAccounts', MAccountBlocklistId[]> 18 Use<'BlockedByAccounts', MAccountBlocklistId[]>
18 19
19// ############################################################################ 20// ############################################################################
20 21
21// Format for API or AP object 22// Format for API or AP object
22 23
23export type MServerFormattable = FunctionProperties<MServer> & 24export type MServerFormattable =
25 FunctionProperties<MServer> &
24 Pick<MServer, 'host'> 26 Pick<MServer, 'host'>
diff --git a/server/typings/models/user/user-notification.ts b/server/typings/models/user/user-notification.ts
index 1cdc691b0..2080360e1 100644
--- a/server/typings/models/user/user-notification.ts
+++ b/server/typings/models/user/user-notification.ts
@@ -16,59 +16,73 @@ type Use<K extends keyof UserNotificationModel, M> = PickWith<UserNotificationMo
16 16
17// ############################################################################ 17// ############################################################################
18 18
19export namespace UserNotificationIncludes { 19export module UserNotificationIncludes {
20
20 export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'> 21 export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name'>
21 export type VideoIncludeChannel = VideoInclude & 22 export type VideoIncludeChannel =
23 VideoInclude &
22 PickWith<VideoModel, 'VideoChannel', VideoChannelIncludeActor> 24 PickWith<VideoModel, 'VideoChannel', VideoChannelIncludeActor>
23 25
24 export type ActorInclude = Pick<ActorModel, 'preferredUsername' | 'getHost'> & 26 export type ActorInclude =
27 Pick<ActorModel, 'preferredUsername' | 'getHost'> &
25 PickWith<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> & 28 PickWith<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> &
26 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> 29 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>
27 30
28 export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'> 31 export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'>
29 export type VideoChannelIncludeActor = VideoChannelInclude & 32 export type VideoChannelIncludeActor =
33 VideoChannelInclude &
30 PickWith<VideoChannelModel, 'Actor', ActorInclude> 34 PickWith<VideoChannelModel, 'Actor', ActorInclude>
31 35
32 export type AccountInclude = Pick<AccountModel, 'id' | 'name' | 'getDisplayName'> 36 export type AccountInclude = Pick<AccountModel, 'id' | 'name' | 'getDisplayName'>
33 export type AccountIncludeActor = AccountInclude & 37 export type AccountIncludeActor =
38 AccountInclude &
34 PickWith<AccountModel, 'Actor', ActorInclude> 39 PickWith<AccountModel, 'Actor', ActorInclude>
35 40
36 export type VideoCommentInclude = Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId'> & 41 export type VideoCommentInclude =
42 Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId'> &
37 PickWith<VideoCommentModel, 'Account', AccountIncludeActor> & 43 PickWith<VideoCommentModel, 'Account', AccountIncludeActor> &
38 PickWith<VideoCommentModel, 'Video', VideoInclude> 44 PickWith<VideoCommentModel, 'Video', VideoInclude>
39 45
40 export type VideoAbuseInclude = Pick<VideoAbuseModel, 'id'> & 46 export type VideoAbuseInclude =
47 Pick<VideoAbuseModel, 'id'> &
41 PickWith<VideoAbuseModel, 'Video', VideoInclude> 48 PickWith<VideoAbuseModel, 'Video', VideoInclude>
42 49
43 export type VideoBlacklistInclude = Pick<VideoBlacklistModel, 'id'> & 50 export type VideoBlacklistInclude =
51 Pick<VideoBlacklistModel, 'id'> &
44 PickWith<VideoAbuseModel, 'Video', VideoInclude> 52 PickWith<VideoAbuseModel, 'Video', VideoInclude>
45 53
46 export type VideoImportInclude = Pick<VideoImportModel, 'id' | 'magnetUri' | 'targetUrl' | 'torrentName'> & 54 export type VideoImportInclude =
55 Pick<VideoImportModel, 'id' | 'magnetUri' | 'targetUrl' | 'torrentName'> &
47 PickWith<VideoImportModel, 'Video', VideoInclude> 56 PickWith<VideoImportModel, 'Video', VideoInclude>
48 57
49 export type ActorFollower = Pick<ActorModel, 'preferredUsername' | 'getHost'> & 58 export type ActorFollower =
59 Pick<ActorModel, 'preferredUsername' | 'getHost'> &
50 PickWith<ActorModel, 'Account', AccountInclude> & 60 PickWith<ActorModel, 'Account', AccountInclude> &
51 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> & 61 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> &
52 PickWithOpt<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>> 62 PickWithOpt<ActorModel, 'Avatar', Pick<AvatarModel, 'filename' | 'getStaticPath'>>
53 63
54 export type ActorFollowing = Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> & 64 export type ActorFollowing =
65 Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> &
55 PickWith<ActorModel, 'VideoChannel', VideoChannelInclude> & 66 PickWith<ActorModel, 'VideoChannel', VideoChannelInclude> &
56 PickWith<ActorModel, 'Account', AccountInclude> & 67 PickWith<ActorModel, 'Account', AccountInclude> &
57 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> 68 PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>
58 69
59 export type ActorFollowInclude = Pick<ActorFollowModel, 'id' | 'state'> & 70 export type ActorFollowInclude =
71 Pick<ActorFollowModel, 'id' | 'state'> &
60 PickWith<ActorFollowModel, 'ActorFollower', ActorFollower> & 72 PickWith<ActorFollowModel, 'ActorFollower', ActorFollower> &
61 PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing> 73 PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing>
62} 74}
63 75
64// ############################################################################ 76// ############################################################################
65 77
66export type MUserNotification = Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'VideoAbuse' | 'VideoBlacklist' | 78export type MUserNotification =
79 Omit<UserNotificationModel, 'User' | 'Video' | 'Comment' | 'VideoAbuse' | 'VideoBlacklist' |
67 'VideoImport' | 'Account' | 'ActorFollow'> 80 'VideoImport' | 'Account' | 'ActorFollow'>
68 81
69// ############################################################################ 82// ############################################################################
70 83
71export type UserNotificationModelForApi = MUserNotification & 84export type UserNotificationModelForApi =
85 MUserNotification &
72 Use<'Video', UserNotificationIncludes.VideoIncludeChannel> & 86 Use<'Video', UserNotificationIncludes.VideoIncludeChannel> &
73 Use<'Comment', UserNotificationIncludes.VideoCommentInclude> & 87 Use<'Comment', UserNotificationIncludes.VideoCommentInclude> &
74 Use<'VideoAbuse', UserNotificationIncludes.VideoAbuseInclude> & 88 Use<'VideoAbuse', UserNotificationIncludes.VideoAbuseInclude> &
diff --git a/server/typings/models/user/user.ts b/server/typings/models/user/user.ts
index 6ac19c20b..31cf075ef 100644
--- a/server/typings/models/user/user.ts
+++ b/server/typings/models/user/user.ts
@@ -29,36 +29,44 @@ export type MUserId = Pick<UserModel, 'id'>
29 29
30// With account 30// With account
31 31
32export type MUserAccountId = MUser & 32export type MUserAccountId =
33 MUser &
33 Use<'Account', MAccountId> 34 Use<'Account', MAccountId>
34 35
35export type MUserAccountUrl = MUser & 36export type MUserAccountUrl =
37 MUser &
36 Use<'Account', MAccountUrl & MAccountIdActorId> 38 Use<'Account', MAccountUrl & MAccountIdActorId>
37 39
38export type MUserAccount = MUser & 40export type MUserAccount =
41 MUser &
39 Use<'Account', MAccount> 42 Use<'Account', MAccount>
40 43
41export type MUserAccountDefault = MUser & 44export type MUserAccountDefault =
45 MUser &
42 Use<'Account', MAccountDefault> 46 Use<'Account', MAccountDefault>
43 47
44// With channel 48// With channel
45 49
46export type MUserNotifSettingChannelDefault = MUser & 50export type MUserNotifSettingChannelDefault =
51 MUser &
47 Use<'NotificationSetting', MNotificationSetting> & 52 Use<'NotificationSetting', MNotificationSetting> &
48 Use<'Account', MAccountDefaultChannelDefault> 53 Use<'Account', MAccountDefaultChannelDefault>
49 54
50// With notification settings 55// With notification settings
51 56
52export type MUserWithNotificationSetting = MUser & 57export type MUserWithNotificationSetting =
58 MUser &
53 Use<'NotificationSetting', MNotificationSetting> 59 Use<'NotificationSetting', MNotificationSetting>
54 60
55export type MUserNotifSettingAccount = MUser & 61export type MUserNotifSettingAccount =
62 MUser &
56 Use<'NotificationSetting', MNotificationSetting> & 63 Use<'NotificationSetting', MNotificationSetting> &
57 Use<'Account', MAccount> 64 Use<'Account', MAccount>
58 65
59// Default scope 66// Default scope
60 67
61export type MUserDefault = MUser & 68export type MUserDefault =
69 MUser &
62 Use<'NotificationSetting', MNotificationSetting> & 70 Use<'NotificationSetting', MNotificationSetting> &
63 Use<'Account', MAccountDefault> 71 Use<'Account', MAccountDefault>
64 72
@@ -67,12 +75,15 @@ export type MUserDefault = MUser &
67// Format for API or AP object 75// Format for API or AP object
68 76
69type MAccountWithChannels = MAccountFormattable & PickWithOpt<AccountModel, 'VideoChannels', MChannelFormattable[]> 77type MAccountWithChannels = MAccountFormattable & PickWithOpt<AccountModel, 'VideoChannels', MChannelFormattable[]>
70type MAccountWithChannelsAndSpecialPlaylists = MAccountWithChannels & 78type MAccountWithChannelsAndSpecialPlaylists =
79 MAccountWithChannels &
71 PickWithOpt<AccountModel, 'VideoPlaylists', MVideoPlaylist[]> 80 PickWithOpt<AccountModel, 'VideoPlaylists', MVideoPlaylist[]>
72 81
73export type MUserFormattable = MUserQuotaUsed & 82export type MUserFormattable =
83 MUserQuotaUsed &
74 Use<'Account', MAccountWithChannels> & 84 Use<'Account', MAccountWithChannels> &
75 PickWithOpt<UserModel, 'NotificationSetting', MNotificationSettingFormattable> 85 PickWithOpt<UserModel, 'NotificationSetting', MNotificationSettingFormattable>
76 86
77export type MMyUserFormattable = MUserFormattable & 87export type MMyUserFormattable =
88 MUserFormattable &
78 Use<'Account', MAccountWithChannelsAndSpecialPlaylists> 89 Use<'Account', MAccountWithChannelsAndSpecialPlaylists>
diff --git a/server/typings/models/video/schedule-video-update.ts b/server/typings/models/video/schedule-video-update.ts
index e6f478cdf..95a53d139 100644
--- a/server/typings/models/video/schedule-video-update.ts
+++ b/server/typings/models/video/schedule-video-update.ts
@@ -10,7 +10,8 @@ export type MScheduleVideoUpdate = Omit<ScheduleVideoUpdateModel, 'Video'>
10 10
11// ############################################################################ 11// ############################################################################
12 12
13export type MScheduleVideoUpdateVideoAll = MScheduleVideoUpdate & 13export type MScheduleVideoUpdateVideoAll =
14 MScheduleVideoUpdate &
14 Use<'Video', MVideoAPWithoutCaption & MVideoWithBlacklistLight> 15 Use<'Video', MVideoAPWithoutCaption & MVideoWithBlacklistLight>
15 16
16// Format for API or AP object 17// Format for API or AP object
diff --git a/server/typings/models/video/video-abuse.ts b/server/typings/models/video/video-abuse.ts
index e38c3f586..955ec4780 100644
--- a/server/typings/models/video/video-abuse.ts
+++ b/server/typings/models/video/video-abuse.ts
@@ -13,11 +13,13 @@ export type MVideoAbuse = Omit<VideoAbuseModel, 'Account' | 'Video' | 'toActivit
13 13
14export type MVideoAbuseId = Pick<VideoAbuseModel, 'id'> 14export type MVideoAbuseId = Pick<VideoAbuseModel, 'id'>
15 15
16export type MVideoAbuseVideo = MVideoAbuse & 16export type MVideoAbuseVideo =
17 MVideoAbuse &
17 Pick<VideoAbuseModel, 'toActivityPubObject'> & 18 Pick<VideoAbuseModel, 'toActivityPubObject'> &
18 Use<'Video', MVideo> 19 Use<'Video', MVideo>
19 20
20export type MVideoAbuseAccountVideo = MVideoAbuse & 21export type MVideoAbuseAccountVideo =
22 MVideoAbuse &
21 Pick<VideoAbuseModel, 'toActivityPubObject'> & 23 Pick<VideoAbuseModel, 'toActivityPubObject'> &
22 Use<'Video', MVideo> & 24 Use<'Video', MVideo> &
23 Use<'Account', MAccountDefault> 25 Use<'Account', MAccountDefault>
@@ -26,6 +28,7 @@ export type MVideoAbuseAccountVideo = MVideoAbuse &
26 28
27// Format for API or AP object 29// Format for API or AP object
28 30
29export type MVideoAbuseFormattable = MVideoAbuse & 31export type MVideoAbuseFormattable =
32 MVideoAbuse &
30 Use<'Account', MAccountFormattable> & 33 Use<'Account', MAccountFormattable> &
31 Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'name'>> 34 Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'name'>>
diff --git a/server/typings/models/video/video-blacklist.ts b/server/typings/models/video/video-blacklist.ts
index 7122a9dc0..ddb4db832 100644
--- a/server/typings/models/video/video-blacklist.ts
+++ b/server/typings/models/video/video-blacklist.ts
@@ -13,15 +13,18 @@ export type MVideoBlacklistUnfederated = Pick<MVideoBlacklist, 'unfederated'>
13 13
14// ############################################################################ 14// ############################################################################
15 15
16export type MVideoBlacklistLightVideo = MVideoBlacklistLight & 16export type MVideoBlacklistLightVideo =
17 MVideoBlacklistLight &
17 Use<'Video', MVideo> 18 Use<'Video', MVideo>
18 19
19export type MVideoBlacklistVideo = MVideoBlacklist & 20export type MVideoBlacklistVideo =
21 MVideoBlacklist &
20 Use<'Video', MVideo> 22 Use<'Video', MVideo>
21 23
22// ############################################################################ 24// ############################################################################
23 25
24// Format for API or AP object 26// Format for API or AP object
25 27
26export type MVideoBlacklistFormattable = MVideoBlacklist & 28export type MVideoBlacklistFormattable =
29 MVideoBlacklist &
27 Use<'Video', MVideoFormattable> 30 Use<'Video', MVideoFormattable>
diff --git a/server/typings/models/video/video-caption.ts b/server/typings/models/video/video-caption.ts
index eeddedb40..e7aff6956 100644
--- a/server/typings/models/video/video-caption.ts
+++ b/server/typings/models/video/video-caption.ts
@@ -13,13 +13,15 @@ export type MVideoCaption = Omit<VideoCaptionModel, 'Video'>
13export type MVideoCaptionLanguage = Pick<MVideoCaption, 'language'> 13export type MVideoCaptionLanguage = Pick<MVideoCaption, 'language'>
14export type MVideoCaptionLanguageUrl = Pick<MVideoCaption, 'language' | 'fileUrl' | 'getFileUrl'> 14export type MVideoCaptionLanguageUrl = Pick<MVideoCaption, 'language' | 'fileUrl' | 'getFileUrl'>
15 15
16export type MVideoCaptionVideo = MVideoCaption & 16export type MVideoCaptionVideo =
17 MVideoCaption &
17 Use<'Video', Pick<MVideo, 'id' | 'remote' | 'uuid'>> 18 Use<'Video', Pick<MVideo, 'id' | 'remote' | 'uuid'>>
18 19
19// ############################################################################ 20// ############################################################################
20 21
21// Format for API or AP object 22// Format for API or AP object
22 23
23export type MVideoCaptionFormattable = FunctionProperties<MVideoCaption> & 24export type MVideoCaptionFormattable =
25 FunctionProperties<MVideoCaption> &
24 Pick<MVideoCaption, 'language'> & 26 Pick<MVideoCaption, 'language'> &
25 Use<'Video', MVideoUUID> 27 Use<'Video', MVideoUUID>
diff --git a/server/typings/models/video/video-change-ownership.ts b/server/typings/models/video/video-change-ownership.ts
index e5b5bbc1d..971dc3db5 100644
--- a/server/typings/models/video/video-change-ownership.ts
+++ b/server/typings/models/video/video-change-ownership.ts
@@ -9,7 +9,8 @@ type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwn
9 9
10export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'> 10export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
11 11
12export type MVideoChangeOwnershipFull = MVideoChangeOwnership & 12export type MVideoChangeOwnershipFull =
13 MVideoChangeOwnership &
13 Use<'Initiator', MAccountDefault> & 14 Use<'Initiator', MAccountDefault> &
14 Use<'NextOwner', MAccountDefault> & 15 Use<'NextOwner', MAccountDefault> &
15 Use<'Video', MVideoWithAllFiles> 16 Use<'Video', MVideoWithAllFiles>
@@ -18,7 +19,8 @@ export type MVideoChangeOwnershipFull = MVideoChangeOwnership &
18 19
19// Format for API or AP object 20// Format for API or AP object
20 21
21export type MVideoChangeOwnershipFormattable = Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> & 22export type MVideoChangeOwnershipFormattable =
23 Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
22 Use<'Initiator', MAccountFormattable> & 24 Use<'Initiator', MAccountFormattable> &
23 Use<'NextOwner', MAccountFormattable> & 25 Use<'NextOwner', MAccountFormattable> &
24 Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>> 26 Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>>
diff --git a/server/typings/models/video/video-channels.ts b/server/typings/models/video/video-channels.ts
index 292d0ac95..50f7c2d8a 100644
--- a/server/typings/models/video/video-channels.ts
+++ b/server/typings/models/video/video-channels.ts
@@ -35,32 +35,39 @@ export type MChannelId = Pick<MChannel, 'id'>
35 35
36// ############################################################################ 36// ############################################################################
37 37
38export type MChannelIdActor = MChannelId & 38export type MChannelIdActor =
39 MChannelId &
39 Use<'Actor', MActorAccountChannelId> 40 Use<'Actor', MActorAccountChannelId>
40 41
41export type MChannelUserId = Pick<MChannel, 'accountId'> & 42export type MChannelUserId =
43 Pick<MChannel, 'accountId'> &
42 Use<'Account', MAccountUserId> 44 Use<'Account', MAccountUserId>
43 45
44export type MChannelActor = MChannel & 46export type MChannelActor =
47 MChannel &
45 Use<'Actor', MActor> 48 Use<'Actor', MActor>
46 49
47export type MChannelUrl = Use<'Actor', MActorUrl> 50export type MChannelUrl = Use<'Actor', MActorUrl>
48 51
49// Default scope 52// Default scope
50export type MChannelDefault = MChannel & 53export type MChannelDefault =
54 MChannel &
51 Use<'Actor', MActorDefault> 55 Use<'Actor', MActorDefault>
52 56
53// ############################################################################ 57// ############################################################################
54 58
55// Not all association attributes 59// Not all association attributes
56 60
57export type MChannelLight = MChannel & 61export type MChannelLight =
62 MChannel &
58 Use<'Actor', MActorDefaultLight> 63 Use<'Actor', MActorDefaultLight>
59 64
60export type MChannelActorLight = MChannel & 65export type MChannelActorLight =
66 MChannel &
61 Use<'Actor', MActorLight> 67 Use<'Actor', MActorLight>
62 68
63export type MChannelAccountLight = MChannel & 69export type MChannelAccountLight =
70 MChannel &
64 Use<'Actor', MActorDefaultLight> & 71 Use<'Actor', MActorDefaultLight> &
65 Use<'Account', MAccountLight> 72 Use<'Account', MAccountLight>
66 73
@@ -68,24 +75,29 @@ export type MChannelAccountLight = MChannel &
68 75
69// Account associations 76// Account associations
70 77
71export type MChannelAccountActor = MChannel & 78export type MChannelAccountActor =
79 MChannel &
72 Use<'Account', MAccountActor> 80 Use<'Account', MAccountActor>
73 81
74export type MChannelAccountDefault = MChannel & 82export type MChannelAccountDefault =
83 MChannel &
75 Use<'Actor', MActorDefault> & 84 Use<'Actor', MActorDefault> &
76 Use<'Account', MAccountDefault> 85 Use<'Account', MAccountDefault>
77 86
78export type MChannelActorAccountActor = MChannel & 87export type MChannelActorAccountActor =
88 MChannel &
79 Use<'Account', MAccountActor> & 89 Use<'Account', MAccountActor> &
80 Use<'Actor', MActor> 90 Use<'Actor', MActor>
81 91
82// ############################################################################ 92// ############################################################################
83 93
84// Videos associations 94// Videos associations
85export type MChannelVideos = MChannel & 95export type MChannelVideos =
96 MChannel &
86 Use<'Videos', MVideo[]> 97 Use<'Videos', MVideo[]>
87 98
88export type MChannelActorAccountDefaultVideos = MChannel & 99export type MChannelActorAccountDefaultVideos =
100 MChannel &
89 Use<'Actor', MActorDefault> & 101 Use<'Actor', MActorDefault> &
90 Use<'Account', MAccountDefault> & 102 Use<'Account', MAccountDefault> &
91 Use<'Videos', MVideo[]> 103 Use<'Videos', MVideo[]>
@@ -94,14 +106,17 @@ export type MChannelActorAccountDefaultVideos = MChannel &
94 106
95// For API 107// For API
96 108
97export type MChannelSummary = FunctionProperties<MChannel> & 109export type MChannelSummary =
110 FunctionProperties<MChannel> &
98 Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> & 111 Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> &
99 Use<'Actor', MActorSummary> 112 Use<'Actor', MActorSummary>
100 113
101export type MChannelSummaryAccount = MChannelSummary & 114export type MChannelSummaryAccount =
115 MChannelSummary &
102 Use<'Account', MAccountSummaryBlocks> 116 Use<'Account', MAccountSummaryBlocks>
103 117
104export type MChannelAPI = MChannel & 118export type MChannelAPI =
119 MChannel &
105 Use<'Actor', MActorAPI> & 120 Use<'Actor', MActorAPI> &
106 Use<'Account', MAccountAPI> 121 Use<'Account', MAccountAPI>
107 122
@@ -109,18 +124,22 @@ export type MChannelAPI = MChannel &
109 124
110// Format for API or AP object 125// Format for API or AP object
111 126
112export type MChannelSummaryFormattable = FunctionProperties<MChannel> & 127export type MChannelSummaryFormattable =
128 FunctionProperties<MChannel> &
113 Pick<MChannel, 'id' | 'name'> & 129 Pick<MChannel, 'id' | 'name'> &
114 Use<'Actor', MActorSummaryFormattable> 130 Use<'Actor', MActorSummaryFormattable>
115 131
116export type MChannelAccountSummaryFormattable = MChannelSummaryFormattable & 132export type MChannelAccountSummaryFormattable =
133 MChannelSummaryFormattable &
117 Use<'Account', MAccountSummaryFormattable> 134 Use<'Account', MAccountSummaryFormattable>
118 135
119export type MChannelFormattable = FunctionProperties<MChannel> & 136export type MChannelFormattable =
137 FunctionProperties<MChannel> &
120 Pick<MChannel, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'support'> & 138 Pick<MChannel, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'support'> &
121 Use<'Actor', MActorFormattable> & 139 Use<'Actor', MActorFormattable> &
122 PickWithOpt<VideoChannelModel, 'Account', MAccountFormattable> 140 PickWithOpt<VideoChannelModel, 'Account', MAccountFormattable>
123 141
124export type MChannelAP = Pick<MChannel, 'name' | 'description' | 'support'> & 142export type MChannelAP =
143 Pick<MChannel, 'name' | 'description' | 'support'> &
125 Use<'Actor', MActorAP> & 144 Use<'Actor', MActorAP> &
126 Use<'Account', MAccountUrl> 145 Use<'Account', MAccountUrl>
diff --git a/server/typings/models/video/video-comment.ts b/server/typings/models/video/video-comment.ts
index d693f9186..d6e0b66f5 100644
--- a/server/typings/models/video/video-comment.ts
+++ b/server/typings/models/video/video-comment.ts
@@ -14,30 +14,37 @@ export type MCommentUrl = Pick<MComment, 'url'>
14 14
15// ############################################################################ 15// ############################################################################
16 16
17export type MCommentOwner = MComment & 17export type MCommentOwner =
18 MComment &
18 Use<'Account', MAccountDefault> 19 Use<'Account', MAccountDefault>
19 20
20export type MCommentVideo = MComment & 21export type MCommentVideo =
22 MComment &
21 Use<'Video', MVideoAccountLight> 23 Use<'Video', MVideoAccountLight>
22 24
23export type MCommentReply = MComment & 25export type MCommentReply =
26 MComment &
24 Use<'InReplyToVideoComment', MComment> 27 Use<'InReplyToVideoComment', MComment>
25 28
26export type MCommentOwnerVideo = MComment & 29export type MCommentOwnerVideo =
30 MComment &
27 Use<'Account', MAccountDefault> & 31 Use<'Account', MAccountDefault> &
28 Use<'Video', MVideoAccountLight> 32 Use<'Video', MVideoAccountLight>
29 33
30export type MCommentOwnerVideoReply = MComment & 34export type MCommentOwnerVideoReply =
35 MComment &
31 Use<'Account', MAccountDefault> & 36 Use<'Account', MAccountDefault> &
32 Use<'Video', MVideoAccountLight> & 37 Use<'Video', MVideoAccountLight> &
33 Use<'InReplyToVideoComment', MComment> 38 Use<'InReplyToVideoComment', MComment>
34 39
35export type MCommentOwnerReplyVideoLight = MComment & 40export type MCommentOwnerReplyVideoLight =
41 MComment &
36 Use<'Account', MAccountDefault> & 42 Use<'Account', MAccountDefault> &
37 Use<'InReplyToVideoComment', MComment> & 43 Use<'InReplyToVideoComment', MComment> &
38 Use<'Video', MVideoIdUrl> 44 Use<'Video', MVideoIdUrl>
39 45
40export type MCommentOwnerVideoFeed = MCommentOwner & 46export type MCommentOwnerVideoFeed =
47 MCommentOwner &
41 Use<'Video', MVideoFeed> 48 Use<'Video', MVideoFeed>
42 49
43// ############################################################################ 50// ############################################################################
@@ -48,10 +55,12 @@ export type MCommentAPI = MComment & { totalReplies: number }
48 55
49// Format for API or AP object 56// Format for API or AP object
50 57
51export type MCommentFormattable = MCommentTotalReplies & 58export type MCommentFormattable =
59 MCommentTotalReplies &
52 Use<'Account', MAccountFormattable> 60 Use<'Account', MAccountFormattable>
53 61
54export type MCommentAP = MComment & 62export type MCommentAP =
63 MComment &
55 Use<'Account', MAccountUrl> & 64 Use<'Account', MAccountUrl> &
56 PickWithOpt<VideoCommentModel, 'Video', MVideoUrl> & 65 PickWithOpt<VideoCommentModel, 'Video', MVideoUrl> &
57 PickWithOpt<VideoCommentModel, 'InReplyToVideoComment', MCommentUrl> 66 PickWithOpt<VideoCommentModel, 'InReplyToVideoComment', MCommentUrl>
diff --git a/server/typings/models/video/video-file.ts b/server/typings/models/video/video-file.ts
index 139b22b2c..3fcaca78f 100644
--- a/server/typings/models/video/video-file.ts
+++ b/server/typings/models/video/video-file.ts
@@ -10,22 +10,28 @@ type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M>
10 10
11export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos' | 'VideoStreamingPlaylist'> 11export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos' | 'VideoStreamingPlaylist'>
12 12
13export type MVideoFileVideo = MVideoFile & 13export type MVideoFileVideo =
14 MVideoFile &
14 Use<'Video', MVideo> 15 Use<'Video', MVideo>
15 16
16export type MVideoFileStreamingPlaylist = MVideoFile & 17export type MVideoFileStreamingPlaylist =
18 MVideoFile &
17 Use<'VideoStreamingPlaylist', MStreamingPlaylist> 19 Use<'VideoStreamingPlaylist', MStreamingPlaylist>
18 20
19export type MVideoFileStreamingPlaylistVideo = MVideoFile & 21export type MVideoFileStreamingPlaylistVideo =
22 MVideoFile &
20 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> 23 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
21 24
22export type MVideoFileVideoUUID = MVideoFile & 25export type MVideoFileVideoUUID =
26 MVideoFile &
23 Use<'Video', MVideoUUID> 27 Use<'Video', MVideoUUID>
24 28
25export type MVideoFileRedundanciesAll = MVideoFile & 29export type MVideoFileRedundanciesAll =
30 MVideoFile &
26 PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancy[]> 31 PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancy[]>
27 32
28export type MVideoFileRedundanciesOpt = MVideoFile & 33export type MVideoFileRedundanciesOpt =
34 MVideoFile &
29 PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> 35 PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>
30 36
31export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist { 37export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist {
diff --git a/server/typings/models/video/video-import.ts b/server/typings/models/video/video-import.ts
index e119f17f9..4e5c2e4f0 100644
--- a/server/typings/models/video/video-import.ts
+++ b/server/typings/models/video/video-import.ts
@@ -9,18 +9,21 @@ type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M>
9 9
10export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'> 10export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'>
11 11
12export type MVideoImportVideo = MVideoImport & 12export type MVideoImportVideo =
13 MVideoImport &
13 Use<'Video', MVideo> 14 Use<'Video', MVideo>
14 15
15// ############################################################################ 16// ############################################################################
16 17
17type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail 18type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail
18 19
19export type MVideoImportDefault = MVideoImport & 20export type MVideoImportDefault =
21 MVideoImport &
20 Use<'User', MUser> & 22 Use<'User', MUser> &
21 Use<'Video', VideoAssociation> 23 Use<'Video', VideoAssociation>
22 24
23export type MVideoImportDefaultFiles = MVideoImport & 25export type MVideoImportDefaultFiles =
26 MVideoImport &
24 Use<'User', MUser> & 27 Use<'User', MUser> &
25 Use<'Video', VideoAssociation & MVideoWithFile> 28 Use<'Video', VideoAssociation & MVideoWithFile>
26 29
@@ -28,5 +31,6 @@ export type MVideoImportDefaultFiles = MVideoImport &
28 31
29// Format for API or AP object 32// Format for API or AP object
30 33
31export type MVideoImportFormattable = MVideoImport & 34export type MVideoImportFormattable =
35 MVideoImport &
32 PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag> 36 PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>
diff --git a/server/typings/models/video/video-playlist-element.ts b/server/typings/models/video/video-playlist-element.ts
index 1aeff78d8..f33c76594 100644
--- a/server/typings/models/video/video-playlist-element.ts
+++ b/server/typings/models/video/video-playlist-element.ts
@@ -17,10 +17,12 @@ export type MVideoPlaylistElementLight = Pick<MVideoPlaylistElement, 'id' | 'vid
17 17
18// ############################################################################ 18// ############################################################################
19 19
20export type MVideoPlaylistVideoThumbnail = MVideoPlaylistElement & 20export type MVideoPlaylistVideoThumbnail =
21 MVideoPlaylistElement &
21 Use<'Video', MVideoThumbnail> 22 Use<'Video', MVideoThumbnail>
22 23
23export type MVideoPlaylistElementVideoUrlPlaylistPrivacy = MVideoPlaylistElement & 24export type MVideoPlaylistElementVideoUrlPlaylistPrivacy =
25 MVideoPlaylistElement &
24 Use<'Video', MVideoUrl> & 26 Use<'Video', MVideoUrl> &
25 Use<'VideoPlaylist', MVideoPlaylistPrivacy> 27 Use<'VideoPlaylist', MVideoPlaylistPrivacy>
26 28
@@ -28,8 +30,10 @@ export type MVideoPlaylistElementVideoUrlPlaylistPrivacy = MVideoPlaylistElement
28 30
29// Format for API or AP object 31// Format for API or AP object
30 32
31export type MVideoPlaylistElementFormattable = MVideoPlaylistElement & 33export type MVideoPlaylistElementFormattable =
34 MVideoPlaylistElement &
32 Use<'Video', MVideoFormattable> 35 Use<'Video', MVideoFormattable>
33 36
34export type MVideoPlaylistElementAP = MVideoPlaylistElement & 37export type MVideoPlaylistElementAP =
38 MVideoPlaylistElement &
35 Use<'Video', MVideoUrl> 39 Use<'Video', MVideoUrl>
diff --git a/server/typings/models/video/video-playlist.ts b/server/typings/models/video/video-playlist.ts
index a40c7aca9..49c27f4a7 100644
--- a/server/typings/models/video/video-playlist.ts
+++ b/server/typings/models/video/video-playlist.ts
@@ -22,30 +22,36 @@ export type MVideoPlaylistVideosLength = MVideoPlaylist & { videosLength?: numbe
22 22
23// With elements 23// With elements
24 24
25export type MVideoPlaylistWithElements = MVideoPlaylist & 25export type MVideoPlaylistWithElements =
26 MVideoPlaylist &
26 Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]> 27 Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]>
27 28
28export type MVideoPlaylistIdWithElements = MVideoPlaylistId & 29export type MVideoPlaylistIdWithElements =
30 MVideoPlaylistId &
29 Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]> 31 Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]>
30 32
31// ############################################################################ 33// ############################################################################
32 34
33// With account 35// With account
34 36
35export type MVideoPlaylistOwner = MVideoPlaylist & 37export type MVideoPlaylistOwner =
38 MVideoPlaylist &
36 Use<'OwnerAccount', MAccount> 39 Use<'OwnerAccount', MAccount>
37 40
38export type MVideoPlaylistOwnerDefault = MVideoPlaylist & 41export type MVideoPlaylistOwnerDefault =
42 MVideoPlaylist &
39 Use<'OwnerAccount', MAccountDefault> 43 Use<'OwnerAccount', MAccountDefault>
40 44
41// ############################################################################ 45// ############################################################################
42 46
43// With thumbnail 47// With thumbnail
44 48
45export type MVideoPlaylistThumbnail = MVideoPlaylist & 49export type MVideoPlaylistThumbnail =
50 MVideoPlaylist &
46 Use<'Thumbnail', MThumbnail> 51 Use<'Thumbnail', MThumbnail>
47 52
48export type MVideoPlaylistAccountThumbnail = MVideoPlaylist & 53export type MVideoPlaylistAccountThumbnail =
54 MVideoPlaylist &
49 Use<'OwnerAccount', MAccountDefault> & 55 Use<'OwnerAccount', MAccountDefault> &
50 Use<'Thumbnail', MThumbnail> 56 Use<'Thumbnail', MThumbnail>
51 57
@@ -53,7 +59,8 @@ export type MVideoPlaylistAccountThumbnail = MVideoPlaylist &
53 59
54// With channel 60// With channel
55 61
56export type MVideoPlaylistAccountChannelDefault = MVideoPlaylist & 62export type MVideoPlaylistAccountChannelDefault =
63 MVideoPlaylist &
57 Use<'OwnerAccount', MAccountDefault> & 64 Use<'OwnerAccount', MAccountDefault> &
58 Use<'VideoChannel', MChannelDefault> 65 Use<'VideoChannel', MChannelDefault>
59 66
@@ -61,7 +68,8 @@ export type MVideoPlaylistAccountChannelDefault = MVideoPlaylist &
61 68
62// With all associations 69// With all associations
63 70
64export type MVideoPlaylistFull = MVideoPlaylist & 71export type MVideoPlaylistFull =
72 MVideoPlaylist &
65 Use<'OwnerAccount', MAccountDefault> & 73 Use<'OwnerAccount', MAccountDefault> &
66 Use<'VideoChannel', MChannelDefault> & 74 Use<'VideoChannel', MChannelDefault> &
67 Use<'Thumbnail', MThumbnail> 75 Use<'Thumbnail', MThumbnail>
@@ -70,11 +78,13 @@ export type MVideoPlaylistFull = MVideoPlaylist &
70 78
71// For API 79// For API
72 80
73export type MVideoPlaylistAccountChannelSummary = MVideoPlaylist & 81export type MVideoPlaylistAccountChannelSummary =
82 MVideoPlaylist &
74 Use<'OwnerAccount', MAccountSummary> & 83 Use<'OwnerAccount', MAccountSummary> &
75 Use<'VideoChannel', MChannelSummary> 84 Use<'VideoChannel', MChannelSummary>
76 85
77export type MVideoPlaylistFullSummary = MVideoPlaylist & 86export type MVideoPlaylistFullSummary =
87 MVideoPlaylist &
78 Use<'Thumbnail', MThumbnail> & 88 Use<'Thumbnail', MThumbnail> &
79 Use<'OwnerAccount', MAccountSummary> & 89 Use<'OwnerAccount', MAccountSummary> &
80 Use<'VideoChannel', MChannelSummary> 90 Use<'VideoChannel', MChannelSummary>
@@ -83,10 +93,12 @@ export type MVideoPlaylistFullSummary = MVideoPlaylist &
83 93
84// Format for API or AP object 94// Format for API or AP object
85 95
86export type MVideoPlaylistFormattable = MVideoPlaylistVideosLength & 96export type MVideoPlaylistFormattable =
97 MVideoPlaylistVideosLength &
87 Use<'OwnerAccount', MAccountSummaryFormattable> & 98 Use<'OwnerAccount', MAccountSummaryFormattable> &
88 Use<'VideoChannel', MChannelSummaryFormattable> 99 Use<'VideoChannel', MChannelSummaryFormattable>
89 100
90export type MVideoPlaylistAP = MVideoPlaylist & 101export type MVideoPlaylistAP =
102 MVideoPlaylist &
91 Use<'Thumbnail', MThumbnail> & 103 Use<'Thumbnail', MThumbnail> &
92 Use<'VideoChannel', MChannelUrl> 104 Use<'VideoChannel', MChannelUrl>
diff --git a/server/typings/models/video/video-rate.ts b/server/typings/models/video/video-rate.ts
index f6bb527fc..64ce4965b 100644
--- a/server/typings/models/video/video-rate.ts
+++ b/server/typings/models/video/video-rate.ts
@@ -9,10 +9,12 @@ type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateMo
9 9
10export type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'> 10export type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'>
11 11
12export type MAccountVideoRateAccountUrl = MAccountVideoRate & 12export type MAccountVideoRateAccountUrl =
13 MAccountVideoRate &
13 Use<'Account', MAccountUrl> 14 Use<'Account', MAccountUrl>
14 15
15export type MAccountVideoRateAccountVideo = MAccountVideoRate & 16export type MAccountVideoRateAccountVideo =
17 MAccountVideoRate &
16 Use<'Account', MAccountAudience> & 18 Use<'Account', MAccountAudience> &
17 Use<'Video', MVideo> 19 Use<'Video', MVideo>
18 20
@@ -20,5 +22,6 @@ export type MAccountVideoRateAccountVideo = MAccountVideoRate &
20 22
21// Format for API or AP object 23// Format for API or AP object
22 24
23export type MAccountVideoRateFormattable = Pick<MAccountVideoRate, 'type'> & 25export type MAccountVideoRateFormattable =
26 Pick<MAccountVideoRate, 'type'> &
24 Use<'Video', MVideoFormattable> 27 Use<'Video', MVideoFormattable>
diff --git a/server/typings/models/video/video-redundancy.ts b/server/typings/models/video/video-redundancy.ts
index 25bdac057..5107aa7f4 100644
--- a/server/typings/models/video/video-redundancy.ts
+++ b/server/typings/models/video/video-redundancy.ts
@@ -16,16 +16,20 @@ export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'>
16 16
17// ############################################################################ 17// ############################################################################
18 18
19export type MVideoRedundancyFile = MVideoRedundancy & 19export type MVideoRedundancyFile =
20 MVideoRedundancy &
20 Use<'VideoFile', MVideoFile> 21 Use<'VideoFile', MVideoFile>
21 22
22export type MVideoRedundancyFileVideo = MVideoRedundancy & 23export type MVideoRedundancyFileVideo =
24 MVideoRedundancy &
23 Use<'VideoFile', MVideoFileVideo> 25 Use<'VideoFile', MVideoFileVideo>
24 26
25export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy & 27export type MVideoRedundancyStreamingPlaylistVideo =
28 MVideoRedundancy &
26 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> 29 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
27 30
28export type MVideoRedundancyVideo = MVideoRedundancy & 31export type MVideoRedundancyVideo =
32 MVideoRedundancy &
29 Use<'VideoFile', MVideoFileVideo> & 33 Use<'VideoFile', MVideoFileVideo> &
30 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> 34 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
31 35
@@ -33,6 +37,7 @@ export type MVideoRedundancyVideo = MVideoRedundancy &
33 37
34// Format for API or AP object 38// Format for API or AP object
35 39
36export type MVideoRedundancyAP = MVideoRedundancy & 40export type MVideoRedundancyAP =
41 MVideoRedundancy &
37 PickWithOpt<VideoRedundancyModel, 'VideoFile', MVideoFile & PickWith<VideoFileModel, 'Video', MVideoUrl>> & 42 PickWithOpt<VideoRedundancyModel, 'VideoFile', MVideoFile & PickWith<VideoFileModel, 'Video', MVideoUrl>> &
38 PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>> 43 PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>
diff --git a/server/typings/models/video/video-share.ts b/server/typings/models/video/video-share.ts
index a7a90beeb..50ca75d26 100644
--- a/server/typings/models/video/video-share.ts
+++ b/server/typings/models/video/video-share.ts
@@ -9,9 +9,11 @@ type Use<K extends keyof VideoShareModel, M> = PickWith<VideoShareModel, K, M>
9 9
10export type MVideoShare = Omit<VideoShareModel, 'Actor' | 'Video'> 10export type MVideoShare = Omit<VideoShareModel, 'Actor' | 'Video'>
11 11
12export type MVideoShareActor = MVideoShare & 12export type MVideoShareActor =
13 MVideoShare &
13 Use<'Actor', MActorDefault> 14 Use<'Actor', MActorDefault>
14 15
15export type MVideoShareFull = MVideoShare & 16export type MVideoShareFull =
17 MVideoShare &
16 Use<'Actor', MActorDefault> & 18 Use<'Actor', MActorDefault> &
17 Use<'Video', MVideo> 19 Use<'Video', MVideo>
diff --git a/server/typings/models/video/video-streaming-playlist.ts b/server/typings/models/video/video-streaming-playlist.ts
index 6fd489945..3f54aa560 100644
--- a/server/typings/models/video/video-streaming-playlist.ts
+++ b/server/typings/models/video/video-streaming-playlist.ts
@@ -10,25 +10,31 @@ type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreami
10 10
11export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'> 11export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'>
12 12
13export type MStreamingPlaylistFiles = MStreamingPlaylist & 13export type MStreamingPlaylistFiles =
14 MStreamingPlaylist &
14 Use<'VideoFiles', MVideoFile[]> 15 Use<'VideoFiles', MVideoFile[]>
15 16
16export type MStreamingPlaylistVideo = MStreamingPlaylist & 17export type MStreamingPlaylistVideo =
18 MStreamingPlaylist &
17 Use<'Video', MVideo> 19 Use<'Video', MVideo>
18 20
19export type MStreamingPlaylistFilesVideo = MStreamingPlaylist & 21export type MStreamingPlaylistFilesVideo =
22 MStreamingPlaylist &
20 Use<'VideoFiles', MVideoFile[]> & 23 Use<'VideoFiles', MVideoFile[]> &
21 Use<'Video', MVideo> 24 Use<'Video', MVideo>
22 25
23export type MStreamingPlaylistRedundanciesAll = MStreamingPlaylist & 26export type MStreamingPlaylistRedundanciesAll =
27 MStreamingPlaylist &
24 Use<'VideoFiles', MVideoFile[]> & 28 Use<'VideoFiles', MVideoFile[]> &
25 Use<'RedundancyVideos', MVideoRedundancy[]> 29 Use<'RedundancyVideos', MVideoRedundancy[]>
26 30
27export type MStreamingPlaylistRedundancies = MStreamingPlaylist & 31export type MStreamingPlaylistRedundancies =
32 MStreamingPlaylist &
28 Use<'VideoFiles', MVideoFile[]> & 33 Use<'VideoFiles', MVideoFile[]> &
29 Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> 34 Use<'RedundancyVideos', MVideoRedundancyFileUrl[]>
30 35
31export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist & 36export type MStreamingPlaylistRedundanciesOpt =
37 MStreamingPlaylist &
32 Use<'VideoFiles', MVideoFile[]> & 38 Use<'VideoFiles', MVideoFile[]> &
33 PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> 39 PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>
34 40
diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts
index 82d76f40c..7eff0a913 100644
--- a/server/typings/models/video/video.ts
+++ b/server/typings/models/video/video.ts
@@ -26,7 +26,8 @@ type Use<K extends keyof VideoModel, M> = PickWith<VideoModel, K, M>
26 26
27// ############################################################################ 27// ############################################################################
28 28
29export type MVideo = Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' | 29export type MVideo =
30 Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' |
30 'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' | 31 'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' |
31 'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions'> 32 'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions'>
32 33
@@ -44,50 +45,63 @@ export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'>
44// Video raw associations: schedules, video files, tags, thumbnails, captions, streaming playlists 45// Video raw associations: schedules, video files, tags, thumbnails, captions, streaming playlists
45 46
46// "With" to not confuse with the VideoFile model 47// "With" to not confuse with the VideoFile model
47export type MVideoWithFile = MVideo & 48export type MVideoWithFile =
49 MVideo &
48 Use<'VideoFiles', MVideoFile[]> & 50 Use<'VideoFiles', MVideoFile[]> &
49 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> 51 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>
50 52
51export type MVideoThumbnail = MVideo & 53export type MVideoThumbnail =
54 MVideo &
52 Use<'Thumbnails', MThumbnail[]> 55 Use<'Thumbnails', MThumbnail[]>
53 56
54export type MVideoIdThumbnail = MVideoId & 57export type MVideoIdThumbnail =
58 MVideoId &
55 Use<'Thumbnails', MThumbnail[]> 59 Use<'Thumbnails', MThumbnail[]>
56 60
57export type MVideoWithFileThumbnail = MVideo & 61export type MVideoWithFileThumbnail =
62 MVideo &
58 Use<'VideoFiles', MVideoFile[]> & 63 Use<'VideoFiles', MVideoFile[]> &
59 Use<'Thumbnails', MThumbnail[]> 64 Use<'Thumbnails', MThumbnail[]>
60 65
61export type MVideoThumbnailBlacklist = MVideo & 66export type MVideoThumbnailBlacklist =
67 MVideo &
62 Use<'Thumbnails', MThumbnail[]> & 68 Use<'Thumbnails', MThumbnail[]> &
63 Use<'VideoBlacklist', MVideoBlacklistLight> 69 Use<'VideoBlacklist', MVideoBlacklistLight>
64 70
65export type MVideoTag = MVideo & 71export type MVideoTag =
72 MVideo &
66 Use<'Tags', MTag[]> 73 Use<'Tags', MTag[]>
67 74
68export type MVideoWithSchedule = MVideo & 75export type MVideoWithSchedule =
76 MVideo &
69 PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate> 77 PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate>
70 78
71export type MVideoWithCaptions = MVideo & 79export type MVideoWithCaptions =
80 MVideo &
72 Use<'VideoCaptions', MVideoCaptionLanguage[]> 81 Use<'VideoCaptions', MVideoCaptionLanguage[]>
73 82
74export type MVideoWithStreamingPlaylist = MVideo & 83export type MVideoWithStreamingPlaylist =
84 MVideo &
75 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> 85 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>
76 86
77// ############################################################################ 87// ############################################################################
78 88
79// Associations with not all their attributes 89// Associations with not all their attributes
80 90
81export type MVideoUserHistory = MVideo & 91export type MVideoUserHistory =
92 MVideo &
82 Use<'UserVideoHistories', MUserVideoHistoryTime[]> 93 Use<'UserVideoHistories', MUserVideoHistoryTime[]>
83 94
84export type MVideoWithBlacklistLight = MVideo & 95export type MVideoWithBlacklistLight =
96 MVideo &
85 Use<'VideoBlacklist', MVideoBlacklistLight> 97 Use<'VideoBlacklist', MVideoBlacklistLight>
86 98
87export type MVideoAccountLight = MVideo & 99export type MVideoAccountLight =
100 MVideo &
88 Use<'VideoChannel', MChannelAccountLight> 101 Use<'VideoChannel', MChannelAccountLight>
89 102
90export type MVideoWithRights = MVideo & 103export type MVideoWithRights =
104 MVideo &
91 Use<'VideoBlacklist', MVideoBlacklistLight> & 105 Use<'VideoBlacklist', MVideoBlacklistLight> &
92 Use<'Thumbnails', MThumbnail[]> & 106 Use<'Thumbnails', MThumbnail[]> &
93 Use<'VideoChannel', MChannelUserId> 107 Use<'VideoChannel', MChannelUserId>
@@ -96,12 +110,14 @@ export type MVideoWithRights = MVideo &
96 110
97// All files with some additional associations 111// All files with some additional associations
98 112
99export type MVideoWithAllFiles = MVideo & 113export type MVideoWithAllFiles =
114 MVideo &
100 Use<'VideoFiles', MVideoFile[]> & 115 Use<'VideoFiles', MVideoFile[]> &
101 Use<'Thumbnails', MThumbnail[]> & 116 Use<'Thumbnails', MThumbnail[]> &
102 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> 117 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>
103 118
104export type MVideoAccountLightBlacklistAllFiles = MVideo & 119export type MVideoAccountLightBlacklistAllFiles =
120 MVideo &
105 Use<'VideoFiles', MVideoFile[]> & 121 Use<'VideoFiles', MVideoFile[]> &
106 Use<'Thumbnails', MThumbnail[]> & 122 Use<'Thumbnails', MThumbnail[]> &
107 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & 123 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &
@@ -112,17 +128,21 @@ export type MVideoAccountLightBlacklistAllFiles = MVideo &
112 128
113// With account 129// With account
114 130
115export type MVideoAccountDefault = MVideo & 131export type MVideoAccountDefault =
132 MVideo &
116 Use<'VideoChannel', MChannelAccountDefault> 133 Use<'VideoChannel', MChannelAccountDefault>
117 134
118export type MVideoThumbnailAccountDefault = MVideo & 135export type MVideoThumbnailAccountDefault =
136 MVideo &
119 Use<'Thumbnails', MThumbnail[]> & 137 Use<'Thumbnails', MThumbnail[]> &
120 Use<'VideoChannel', MChannelAccountDefault> 138 Use<'VideoChannel', MChannelAccountDefault>
121 139
122export type MVideoWithChannelActor = MVideo & 140export type MVideoWithChannelActor =
141 MVideo &
123 Use<'VideoChannel', MChannelActor> 142 Use<'VideoChannel', MChannelActor>
124 143
125export type MVideoFullLight = MVideo & 144export type MVideoFullLight =
145 MVideo &
126 Use<'Thumbnails', MThumbnail[]> & 146 Use<'Thumbnails', MThumbnail[]> &
127 Use<'VideoBlacklist', MVideoBlacklistLight> & 147 Use<'VideoBlacklist', MVideoBlacklistLight> &
128 Use<'Tags', MTag[]> & 148 Use<'Tags', MTag[]> &
@@ -136,7 +156,8 @@ export type MVideoFullLight = MVideo &
136 156
137// API 157// API
138 158
139export type MVideoAP = MVideo & 159export type MVideoAP =
160 MVideo &
140 Use<'Tags', MTag[]> & 161 Use<'Tags', MTag[]> &
141 Use<'VideoChannel', MChannelAccountLight> & 162 Use<'VideoChannel', MChannelAccountLight> &
142 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> & 163 Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &
@@ -147,7 +168,8 @@ export type MVideoAP = MVideo &
147 168
148export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'> 169export type MVideoAPWithoutCaption = Omit<MVideoAP, 'VideoCaptions'>
149 170
150export type MVideoDetails = MVideo & 171export type MVideoDetails =
172 MVideo &
151 Use<'VideoBlacklist', MVideoBlacklistLight> & 173 Use<'VideoBlacklist', MVideoBlacklistLight> &
152 Use<'Tags', MTag[]> & 174 Use<'Tags', MTag[]> &
153 Use<'VideoChannel', MChannelAccountLight> & 175 Use<'VideoChannel', MChannelAccountLight> &
@@ -157,13 +179,15 @@ export type MVideoDetails = MVideo &
157 Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> & 179 Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> &
158 Use<'VideoFiles', MVideoFileRedundanciesOpt[]> 180 Use<'VideoFiles', MVideoFileRedundanciesOpt[]>
159 181
160export type MVideoForUser = MVideo & 182export type MVideoForUser =
183 MVideo &
161 Use<'VideoChannel', MChannelAccountDefault> & 184 Use<'VideoChannel', MChannelAccountDefault> &
162 Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> & 185 Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> &
163 Use<'VideoBlacklist', MVideoBlacklistLight> & 186 Use<'VideoBlacklist', MVideoBlacklistLight> &
164 Use<'Thumbnails', MThumbnail[]> 187 Use<'Thumbnails', MThumbnail[]>
165 188
166export type MVideoForRedundancyAPI = MVideo & 189export type MVideoForRedundancyAPI =
190 MVideo &
167 Use<'VideoFiles', MVideoFileRedundanciesAll[]> & 191 Use<'VideoFiles', MVideoFileRedundanciesAll[]> &
168 Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]> 192 Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]>
169 193
@@ -171,13 +195,15 @@ export type MVideoForRedundancyAPI = MVideo &
171 195
172// Format for API or AP object 196// Format for API or AP object
173 197
174export type MVideoFormattable = MVideo & 198export type MVideoFormattable =
199 MVideo &
175 PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]> & 200 PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]> &
176 Use<'VideoChannel', MChannelAccountSummaryFormattable> & 201 Use<'VideoChannel', MChannelAccountSummaryFormattable> &
177 PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>> & 202 PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>> &
178 PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>> 203 PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>>
179 204
180export type MVideoFormattableDetails = MVideoFormattable & 205export type MVideoFormattableDetails =
206 MVideoFormattable &
181 Use<'VideoChannel', MChannelFormattable> & 207 Use<'VideoChannel', MChannelFormattable> &
182 Use<'Tags', MTag[]> & 208 Use<'Tags', MTag[]> &
183 Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesOpt[]> & 209 Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesOpt[]> &