ActivityPub-federated video streaming platform using P2P directly in your web browser
Format server type models
Chocobozzzde5adc09b26f
diff --git a/server/core/types/express.d.ts b/server/core/types/express.d.tsindex a1455c4a04..098c2fef5d 100644--- a/server/core/types/express.d.ts+++ b/server/core/types/express.d.ts@@ -82,7 +82,7 @@ declare module 'express' {}// Our custom UploadXFile object using our custom metadata- export type CustomUploadXFile <T extends Metadata> = UploadXFile & { metadata: T }+ export type CustomUploadXFile<T extends Metadata> = UploadXFile & { metadata: T }export type EnhancedUploadXFile = CustomUploadXFile<Metadata> & {duration?: number // If video filediff --git a/server/core/types/lib.d.ts b/server/core/types/lib.d.tsindex c901e20326..da1c72a936 100644--- a/server/core/types/lib.d.ts+++ b/server/core/types/lib.d.ts@@ -1,12 +1,8 @@-type ObjectKeys<T> =- T extends object- ? `${Exclude<keyof T, symbol>}`[]- : T extends number- ? []- : T extends any | string- ? string[]- : never+type ObjectKeys<T> = T extends object ? `${Exclude<keyof T, symbol>}`[] :+ T extends number ? [] :+ T extends any | string ? string[] :+ neverinterface ObjectConstructor {- keys<T> (o: T): ObjectKeys<T>+ keys<T>(o: T): ObjectKeys<T>}diff --git a/server/core/types/models/abuse/abuse-message.ts b/server/core/types/models/abuse/abuse-message.tsindex 85ea028d27..280c81b846 100644--- a/server/core/types/models/abuse/abuse-message.ts+++ b/server/core/types/models/abuse/abuse-message.ts@@ -16,5 +16,5 @@ export type MAbuseMessageId = Pick<AbuseModel, 'id'>// Format for APIexport type MAbuseMessageFormattable =- MAbuseMessage &- Use<'Account', MAccountFormattable>+ & MAbuseMessage+ & Use<'Account', MAccountFormattable>diff --git a/server/core/types/models/abuse/abuse.ts b/server/core/types/models/abuse/abuse.tsindex c0c8d37768..5d0ab8a702 100644--- a/server/core/types/models/abuse/abuse.ts+++ b/server/core/types/models/abuse/abuse.ts@@ -20,95 +20,100 @@ export type MVideoAbuse = Omit<VideoAbuseModel, 'Abuse' | 'Video'>export type MCommentAbuse = Omit<VideoCommentAbuseModel, 'Abuse' | 'VideoComment'>export type MAbuseReporter =- MAbuse &- Use<'ReporterAccount', MAccountDefault>+ & MAbuse+ & Use<'ReporterAccount', MAccountDefault>// ############################################################################export type MVideoAbuseVideo =- MVideoAbuse &- UseVideoAbuse<'Video', MVideo>+ & MVideoAbuse+ & UseVideoAbuse<'Video', MVideo>export type MVideoAbuseVideoUrl =- MVideoAbuse &- UseVideoAbuse<'Video', MVideoUrl>+ & MVideoAbuse+ & UseVideoAbuse<'Video', MVideoUrl>export type MVideoAbuseVideoFull =- MVideoAbuse &- UseVideoAbuse<'Video', Omit<MVideoAccountLightBlacklistAllFiles, 'VideoFiles' | 'VideoStreamingPlaylists'>>+ & MVideoAbuse+ & UseVideoAbuse<'Video', Omit<MVideoAccountLightBlacklistAllFiles, 'VideoFiles' | 'VideoStreamingPlaylists'>>export type MVideoAbuseFormattable =- MVideoAbuse &- UseVideoAbuse<'Video', Pick<MVideoAccountLightBlacklistAllFiles,- 'id' | 'uuid' | 'name' | 'nsfw' | 'getMiniature' | 'getMiniatureStaticPath' | 'isBlacklisted' | 'VideoChannel' | 'Thumbnails'>>+ & MVideoAbuse+ & UseVideoAbuse<+ 'Video',+ Pick<+ MVideoAccountLightBlacklistAllFiles,+ 'id' | 'uuid' | 'name' | 'nsfw' | 'getMiniature' | 'getMiniatureStaticPath' | 'isBlacklisted' | 'VideoChannel' | 'Thumbnails'+ >+ >// ############################################################################export type MCommentAbuseAccount =- MCommentAbuse &- UseCommentAbuse<'VideoComment', MCommentOwner>+ & MCommentAbuse+ & UseCommentAbuse<'VideoComment', MCommentOwner>export type MCommentAbuseAccountVideo =- MCommentAbuse &- UseCommentAbuse<'VideoComment', MCommentOwner & PickWith<VideoCommentModel, 'Video', MVideo>>+ & MCommentAbuse+ & UseCommentAbuse<'VideoComment', MCommentOwner & PickWith<VideoCommentModel, 'Video', MVideo>>export type MCommentAbuseUrl =- MCommentAbuse &- UseCommentAbuse<'VideoComment', MCommentUrl>+ & MCommentAbuse+ & UseCommentAbuse<'VideoComment', MCommentUrl>export type MCommentAbuseFormattable =- MCommentAbuse &- UseCommentAbuse<'VideoComment', MComment & PickWith<MCommentVideo, 'Video', Pick<MVideo, 'id' | 'uuid' | 'name'>>>+ & MCommentAbuse+ & UseCommentAbuse<'VideoComment', MComment & PickWith<MCommentVideo, 'Video', Pick<MVideo, 'id' | 'uuid' | 'name'>>>// ############################################################################export type MAbuseId = Pick<AbuseModel, 'id'>export type MAbuseVideo =- MAbuse &- Pick<AbuseModel, 'toActivityPubObject'> &- Use<'VideoAbuse', MVideoAbuseVideo>+ & MAbuse+ & Pick<AbuseModel, 'toActivityPubObject'>+ & Use<'VideoAbuse', MVideoAbuseVideo>export type MAbuseUrl =- MAbuse &- Use<'VideoAbuse', MVideoAbuseVideoUrl> &- Use<'VideoCommentAbuse', MCommentAbuseUrl>+ & MAbuse+ & Use<'VideoAbuse', MVideoAbuseVideoUrl>+ & Use<'VideoCommentAbuse', MCommentAbuseUrl>export type MAbuseAccountVideo =- MAbuse &- Pick<AbuseModel, 'toActivityPubObject'> &- Use<'VideoAbuse', MVideoAbuseVideoFull> &- Use<'ReporterAccount', MAccountDefault>+ & MAbuse+ & Pick<AbuseModel, 'toActivityPubObject'>+ & Use<'VideoAbuse', MVideoAbuseVideoFull>+ & Use<'ReporterAccount', MAccountDefault>export type MAbuseFull =- MAbuse &- Pick<AbuseModel, 'toActivityPubObject'> &- Use<'ReporterAccount', MAccountLight> &- Use<'FlaggedAccount', MAccountLight> &- Use<'VideoAbuse', MVideoAbuseVideoFull> &- Use<'VideoCommentAbuse', MCommentAbuseAccountVideo>+ & MAbuse+ & Pick<AbuseModel, 'toActivityPubObject'>+ & Use<'ReporterAccount', MAccountLight>+ & Use<'FlaggedAccount', MAccountLight>+ & Use<'VideoAbuse', MVideoAbuseVideoFull>+ & Use<'VideoCommentAbuse', MCommentAbuseAccountVideo>// ############################################################################// Format for API or AP objectexport type MAbuseAdminFormattable =- MAbuse &- Use<'ReporterAccount', MAccountFormattable> &- Use<'FlaggedAccount', MAccountFormattable> &- Use<'VideoAbuse', MVideoAbuseFormattable> &- Use<'VideoCommentAbuse', MCommentAbuseFormattable>+ & MAbuse+ & Use<'ReporterAccount', MAccountFormattable>+ & Use<'FlaggedAccount', MAccountFormattable>+ & Use<'VideoAbuse', MVideoAbuseFormattable>+ & Use<'VideoCommentAbuse', MCommentAbuseFormattable>export type MAbuseUserFormattable =- MAbuse &- Use<'FlaggedAccount', MAccountFormattable> &- Use<'VideoAbuse', MVideoAbuseFormattable> &- Use<'VideoCommentAbuse', MCommentAbuseFormattable>+ & MAbuse+ & Use<'FlaggedAccount', MAccountFormattable>+ & Use<'VideoAbuse', MVideoAbuseFormattable>+ & Use<'VideoCommentAbuse', MCommentAbuseFormattable>export type MAbuseAP =- MAbuse &- Pick<AbuseModel, 'toActivityPubObject'> &- Use<'ReporterAccount', MAccountUrl> &- Use<'FlaggedAccount', MAccountUrl> &- Use<'VideoAbuse', MVideoAbuseVideo> &- Use<'VideoCommentAbuse', MCommentAbuseAccount>+ & MAbuse+ & Pick<AbuseModel, 'toActivityPubObject'>+ & Use<'ReporterAccount', MAccountUrl>+ & Use<'FlaggedAccount', MAccountUrl>+ & Use<'VideoAbuse', MVideoAbuseVideo>+ & Use<'VideoCommentAbuse', MCommentAbuseAccount>diff --git a/server/core/types/models/account/account-blocklist.ts b/server/core/types/models/account/account-blocklist.tsindex d761b2de4f..27abe712ea 100644--- a/server/core/types/models/account/account-blocklist.ts+++ b/server/core/types/models/account/account-blocklist.ts@@ -13,15 +13,15 @@ export type MAccountBlocklist = Omit<AccountBlocklistModel, 'ByAccount' | 'Blockexport type MAccountBlocklistId = Pick<AccountBlocklistModel, 'id'>export type MAccountBlocklistAccounts =- MAccountBlocklist &- Use<'ByAccount', MAccountDefault> &- Use<'BlockedAccount', MAccountDefault>+ & MAccountBlocklist+ & Use<'ByAccount', MAccountDefault>+ & Use<'BlockedAccount', MAccountDefault>// ############################################################################// Format for API or AP objectexport type MAccountBlocklistFormattable =- Pick<MAccountBlocklist, 'createdAt'> &- Use<'ByAccount', MAccountFormattable> &- Use<'BlockedAccount', MAccountFormattable>+ & Pick<MAccountBlocklist, 'createdAt'>+ & Use<'ByAccount', MAccountFormattable>+ & Use<'BlockedAccount', MAccountFormattable>diff --git a/server/core/types/models/account/account.ts b/server/core/types/models/account/account.tsindex a8ff058eda..3aefa60798 100644--- a/server/core/types/models/account/account.ts+++ b/server/core/types/models/account/account.ts@@ -21,9 +21,10 @@ type Use<K extends keyof AccountModel, M> = PickWith<AccountModel, K, M>// ############################################################################-export type MAccount =- Omit<AccountModel, 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' |- 'VideoComments' | 'BlockedBy'>+export type MAccount = Omit<+ AccountModel,+ 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' | 'VideoComments' | 'BlockedBy'+>// ############################################################################@@ -36,73 +37,73 @@ export type MAccountUrl = Use<'Actor', MActorUrl>export type MAccountAudience = Use<'Actor', MActorAudience>export type MAccountIdActor =- MAccountId &- Use<'Actor', MActor>+ & MAccountId+ & Use<'Actor', MActor>export type MAccountIdActorId =- MAccountId &- Use<'Actor', MActorId>+ & MAccountId+ & Use<'Actor', MActorId>// ############################################################################// Default scopeexport type MAccountDefault =- MAccount &- Use<'Actor', MActorDefault>+ & MAccount+ & Use<'Actor', MActorDefault>// Default with default association scopesexport type MAccountDefaultChannelDefault =- MAccount &- Use<'Actor', MActorDefault> &- Use<'VideoChannels', MChannelDefault[]>+ & MAccount+ & Use<'Actor', MActorDefault>+ & Use<'VideoChannels', MChannelDefault[]>// We don't need some actors attributesexport type MAccountLight =- MAccount &- Use<'Actor', MActorDefaultLight>+ & MAccount+ & Use<'Actor', MActorDefaultLight>// ############################################################################// Full actorexport type MAccountActor =- MAccount &- Use<'Actor', MActor>+ & MAccount+ & Use<'Actor', MActor>export type MAccountHost =- MAccount &- Use<'Actor', MActorHost>+ & MAccount+ & Use<'Actor', MActorHost>// ############################################################################// For APIexport type MAccountSummary =- FunctionProperties<MAccount> &- Pick<MAccount, 'id' | 'name'> &- Use<'Actor', MActorSummary>+ & FunctionProperties<MAccount>+ & Pick<MAccount, 'id' | 'name'>+ & Use<'Actor', MActorSummary>export type MAccountSummaryBlocks =- MAccountSummary &- Use<'BlockedBy', MAccountBlocklistId[]>+ & MAccountSummary+ & Use<'BlockedBy', MAccountBlocklistId[]>export type MAccountAPI =- MAccount &- Use<'Actor', MActorAPI>+ & MAccount+ & Use<'Actor', MActorAPI>// ############################################################################// Format for API or AP objectexport type MAccountSummaryFormattable =- FunctionProperties<MAccount> &- Pick<MAccount, 'id' | 'name'> &- Use<'Actor', MActorSummaryFormattable>+ & FunctionProperties<MAccount>+ & Pick<MAccount, 'id' | 'name'>+ & Use<'Actor', MActorSummaryFormattable>export type MAccountFormattable =- FunctionProperties<MAccount> &- Pick<MAccount, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'userId'> &- Use<'Actor', MActorFormattable>+ & FunctionProperties<MAccount>+ & Pick<MAccount, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'userId'>+ & Use<'Actor', MActorFormattable>export type MAccountAP =- Pick<MAccount, 'name' | 'description'> &- Use<'Actor', MActorAPAccount>+ & Pick<MAccount, 'name' | 'description'>+ & Use<'Actor', MActorAPAccount>diff --git a/server/core/types/models/actor/actor-follow.ts b/server/core/types/models/actor/actor-follow.tsindex a130751f92..c92ad1ff29 100644--- a/server/core/types/models/actor/actor-follow.ts+++ b/server/core/types/models/actor/actor-follow.ts@@ -20,46 +20,46 @@ export type MActorFollow = Omit<ActorFollowModel, 'ActorFollower' | 'ActorFollow// ############################################################################export type MActorFollowFollowingHost =- MActorFollow &- Use<'ActorFollowing', MActorUsername & MActorHostOnly>+ & MActorFollow+ & Use<'ActorFollowing', MActorUsername & MActorHostOnly>// ############################################################################// With actors or actors defaultexport type MActorFollowActors =- MActorFollow &- Use<'ActorFollower', MActor> &- Use<'ActorFollowing', MActor>+ & MActorFollow+ & Use<'ActorFollower', MActor>+ & Use<'ActorFollowing', MActor>export type MActorFollowActorsDefault =- MActorFollow &- Use<'ActorFollower', MActorDefault> &- Use<'ActorFollowing', MActorDefault>+ & MActorFollow+ & Use<'ActorFollower', MActorDefault>+ & Use<'ActorFollowing', MActorDefault>export type MActorFollowFull =- MActorFollow &- Use<'ActorFollower', MActorDefaultAccountChannel> &- Use<'ActorFollowing', MActorDefaultAccountChannel>+ & MActorFollow+ & Use<'ActorFollower', MActorDefaultAccountChannel>+ & Use<'ActorFollowing', MActorDefaultAccountChannel>// ############################################################################// For subscriptionsexport type MActorFollowActorsDefaultSubscription =- MActorFollow &- Use<'ActorFollower', MActorDefault> &- Use<'ActorFollowing', MActorDefaultChannelId>+ & MActorFollow+ & Use<'ActorFollower', MActorDefault>+ & Use<'ActorFollowing', MActorDefaultChannelId>export type MActorFollowSubscriptions =- MActorFollow &- Use<'ActorFollowing', MActorChannelAccountActor>+ & MActorFollow+ & Use<'ActorFollowing', MActorChannelAccountActor>// ############################################################################// Format for API or AP objectexport type MActorFollowFormattable =- Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'> &- Use<'ActorFollower', MActorFormattable> &- Use<'ActorFollowing', MActorFormattable>+ & Pick<MActorFollow, 'id' | 'score' | 'state' | 'createdAt' | 'updatedAt'>+ & Use<'ActorFollower', MActorFormattable>+ & Use<'ActorFollowing', MActorFormattable>diff --git a/server/core/types/models/actor/actor-image.ts b/server/core/types/models/actor/actor-image.tsindex 7c9013a9eb..753e0666b2 100644--- a/server/core/types/models/actor/actor-image.ts+++ b/server/core/types/models/actor/actor-image.ts@@ -10,5 +10,5 @@ export type MActorImagePath = Pick<MActorImage, 'type' | 'filename' | 'getStatic// Format for API or AP objectexport type MActorImageFormattable =- FunctionProperties<MActorImage> &- Pick<MActorImage, 'type' | 'getStaticPath' | 'width' | 'filename' | 'createdAt' | 'updatedAt'>+ & FunctionProperties<MActorImage>+ & Pick<MActorImage, 'type' | 'getStaticPath' | 'width' | 'filename' | 'createdAt' | 'updatedAt'>diff --git a/server/core/types/models/actor/actor.ts b/server/core/types/models/actor/actor.tsindex 0d594545f5..418779c9c1 100644--- a/server/core/types/models/actor/actor.ts+++ b/server/core/types/models/actor/actor.ts@@ -31,29 +31,29 @@ export type MActorLight = Omit<MActor, 'privateKey' | 'privateKey'>export type MActorHostOnly = Use<'Server', MServerHost>export type MActorHost =- MActorLight &- Use<'Server', MServerHost>+ & MActorLight+ & Use<'Server', MServerHost>export type MActorRedundancyAllowedOpt = PickWithOpt<ActorModel, 'Server', MServerRedundancyAllowed>export type MActorDefaultLight =- MActorLight &- Use<'Server', MServerHost> &- Use<'Avatars', MActorImage[]>+ & MActorLight+ & Use<'Server', MServerHost>+ & Use<'Avatars', MActorImage[]>export type MActorAccountId =- MActor &- Use<'Account', MAccountId>+ & MActor+ & Use<'Account', MAccountId>export type MActorAccountIdActor =- MActor &- Use<'Account', MAccountIdActor>+ & MActor+ & Use<'Account', MAccountIdActor>export type MActorChannelId =- MActor &- Use<'VideoChannel', MChannelId>+ & MActor+ & Use<'VideoChannel', MChannelId>export type MActorChannelIdActor =- MActor &- Use<'VideoChannel', MChannelIdActor>+ & MActor+ & Use<'VideoChannel', MChannelIdActor>export type MActorAccountChannelId = MActorAccountId & MActorChannelIdexport type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelIdActor@@ -63,108 +63,117 @@ export type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelId// Include raw account/channel/serverexport type MActorAccount =- MActor &- Use<'Account', MAccount>+ & MActor+ & Use<'Account', MAccount>export type MActorChannel =- MActor &- Use<'VideoChannel', MChannel>+ & MActor+ & Use<'VideoChannel', MChannel>export type MActorDefaultAccountChannel = MActorDefault & MActorAccount & MActorChannelexport type MActorServerLight =- MActorLight &- Use<'Server', MServer>+ & MActorLight+ & Use<'Server', MServer>// ############################################################################// Complex actor associationsexport type MActorImages =- MActor &- Use<'Avatars', MActorImage[]> &- UseOpt<'Banners', MActorImage[]>+ & MActor+ & Use<'Avatars', MActorImage[]>+ & UseOpt<'Banners', MActorImage[]>export type MActorDefault =- MActor &- Use<'Server', MServer> &- Use<'Avatars', MActorImage[]>+ & MActor+ & Use<'Server', MServer>+ & Use<'Avatars', MActorImage[]>export type MActorDefaultChannelId =- MActorDefault &- Use<'VideoChannel', MChannelId>+ & MActorDefault+ & Use<'VideoChannel', MChannelId>export type MActorDefaultBanner =- MActor &- Use<'Server', MServer> &- Use<'Avatars', MActorImage[]> &- Use<'Banners', MActorImage[]>+ & MActor+ & Use<'Server', MServer>+ & Use<'Avatars', MActorImage[]>+ & Use<'Banners', MActorImage[]>// Actor with channel that is associated to an account and its actor// Actor -> VideoChannel -> Account -> Actorexport type MActorChannelAccountActor =- MActor &- Use<'VideoChannel', MChannelAccountActor>+ & MActor+ & Use<'VideoChannel', MChannelAccountActor>export type MActorFull =- MActor &- Use<'Server', MServer> &- Use<'Avatars', MActorImage[]> &- Use<'Banners', MActorImage[]> &- Use<'Account', MAccount> &- Use<'VideoChannel', MChannelAccountActor>+ & MActor+ & Use<'Server', MServer>+ & Use<'Avatars', MActorImage[]>+ & Use<'Banners', MActorImage[]>+ & Use<'Account', MAccount>+ & Use<'VideoChannel', MChannelAccountActor>// Same than ActorFull, but the account and the channel have their actorexport type MActorFullActor =- MActor &- Use<'Server', MServer> &- Use<'Avatars', MActorImage[]> &- Use<'Banners', MActorImage[]> &- Use<'Account', MAccountDefault> &- Use<'VideoChannel', MChannelAccountDefault>+ & MActor+ & Use<'Server', MServer>+ & Use<'Avatars', MActorImage[]>+ & Use<'Banners', MActorImage[]>+ & Use<'Account', MAccountDefault>+ & Use<'VideoChannel', MChannelAccountDefault>// ############################################################################// APIexport type MActorSummary =- FunctionProperties<MActor> &- Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId'> &- Use<'Server', MServerHost> &- Use<'Avatars', MActorImage[]>+ & FunctionProperties<MActor>+ & Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId'>+ & Use<'Server', MServerHost>+ & Use<'Avatars', MActorImage[]>export type MActorSummaryBlocks =- MActorSummary &- Use<'Server', MServerHostBlocks>--export type MActorAPI =- Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' |- 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'>+ & MActorSummary+ & Use<'Server', MServerHostBlocks>++export type MActorAPI = Omit<+ MActorDefault,+ | 'publicKey'+ | 'privateKey'+ | 'inboxUrl'+ | 'outboxUrl'+ | 'sharedInboxUrl'+ | 'followersUrl'+ | 'followingUrl'+ | 'url'+ | 'createdAt'+ | 'updatedAt'+>// ############################################################################// Format for API or AP objectexport type MActorSummaryFormattable =- FunctionProperties<MActor> &- Pick<MActor, 'url' | 'preferredUsername'> &- Use<'Server', MServerHost> &- Use<'Avatars', MActorImageFormattable[]>+ & FunctionProperties<MActor>+ & Pick<MActor, 'url' | 'preferredUsername'>+ & Use<'Server', MServerHost>+ & Use<'Avatars', MActorImageFormattable[]>export type MActorFormattable =- MActorSummaryFormattable &- Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt' | 'remoteCreatedAt'> &- Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>> &- UseOpt<'Banners', MActorImageFormattable[]> &- UseOpt<'Avatars', MActorImageFormattable[]>+ & MActorSummaryFormattable+ & Pick<MActor, 'id' | 'followingCount' | 'followersCount' | 'createdAt' | 'updatedAt' | 'remoteCreatedAt'>+ & Use<'Server', MServerHost & Partial<Pick<MServer, 'redundancyAllowed'>>>+ & UseOpt<'Banners', MActorImageFormattable[]>+ & UseOpt<'Avatars', MActorImageFormattable[]>type MActorAPBase =- MActor &- Use<'Avatars', MActorImage[]>+ & MActor+ & Use<'Avatars', MActorImage[]>-export type MActorAPAccount =- MActorAPBase+export type MActorAPAccount = MActorAPBaseexport type MActorAPChannel =- MActorAPBase &- Use<'Banners', MActorImage[]>+ & MActorAPBase+ & Use<'Banners', MActorImage[]>diff --git a/server/core/types/models/automatic-tag/comment-automatic-tag.ts b/server/core/types/models/automatic-tag/comment-automatic-tag.tsindex 13ff9af797..dacf2b7544 100644--- a/server/core/types/models/automatic-tag/comment-automatic-tag.ts+++ b/server/core/types/models/automatic-tag/comment-automatic-tag.ts@@ -11,5 +11,5 @@ export type MCommentAutomaticTag = Omit<CommentAutomaticTagModel, 'Account' | 'V// ############################################################################export type MCommentAutomaticTagWithTag =- MCommentAutomaticTag &- Use<'AutomaticTag', MAutomaticTag>+ & MCommentAutomaticTag+ & Use<'AutomaticTag', MAutomaticTag>diff --git a/server/core/types/models/automatic-tag/video-automatic-tag.ts b/server/core/types/models/automatic-tag/video-automatic-tag.tsindex 7d8d536940..f25132c603 100644--- a/server/core/types/models/automatic-tag/video-automatic-tag.ts+++ b/server/core/types/models/automatic-tag/video-automatic-tag.ts@@ -11,5 +11,5 @@ export type MVideoAutomaticTag = Omit<VideoAutomaticTagModel, 'Account' | 'Video// ############################################################################export type MVideoAutomaticTagWithTag =- MVideoAutomaticTag &- Use<'AutomaticTag', MAutomaticTag>+ & MVideoAutomaticTag+ & Use<'AutomaticTag', MAutomaticTag>diff --git a/server/core/types/models/oauth/oauth-token.ts b/server/core/types/models/oauth/oauth-token.tsindex cf44129386..a15166d156 100644--- a/server/core/types/models/oauth/oauth-token.ts+++ b/server/core/types/models/oauth/oauth-token.ts@@ -9,6 +9,6 @@ type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M>export type MOAuthToken = Omit<OAuthTokenModel, 'User' | 'OAuthClients'>export type MOAuthTokenUser =- MOAuthToken &- Use<'User', MUserAccountUrl> &- { user?: MUserAccountUrl }+ & MOAuthToken+ & Use<'User', MUserAccountUrl>+ & { user?: MUserAccountUrl }diff --git a/server/core/types/models/runners/runner-job.ts b/server/core/types/models/runners/runner-job.tsindex 4fa024f57e..2186b83e00 100644--- a/server/core/types/models/runners/runner-job.ts+++ b/server/core/types/models/runners/runner-job.ts@@ -11,10 +11,10 @@ export type MRunnerJob = Omit<RunnerJobModel, 'Runner' | 'DependsOnRunnerJob'>// ############################################################################export type MRunnerJobRunner =- MRunnerJob &- Use<'Runner', MRunner>+ & MRunnerJob+ & Use<'Runner', MRunner>export type MRunnerJobRunnerParent =- MRunnerJob &- Use<'Runner', MRunner> &- Use<'DependsOnRunnerJob', MRunnerJob>+ & MRunnerJob+ & Use<'Runner', MRunner>+ & Use<'DependsOnRunnerJob', MRunnerJob>diff --git a/server/core/types/models/server/plugin.ts b/server/core/types/models/server/plugin.tsindex 0d5a8fb02d..1c3d53b8ea 100644--- a/server/core/types/models/server/plugin.ts+++ b/server/core/types/models/server/plugin.ts@@ -6,6 +6,18 @@ export type MPlugin = PluginModel// Format for API or AP object-export type MPluginFormattable =- Pick<MPlugin, 'name' | 'type' | 'version' | 'latestVersion' | 'enabled' | 'uninstalled'- | 'peertubeEngine' | 'description' | 'homepage' | 'settings' | 'createdAt' | 'updatedAt'>+export type MPluginFormattable = Pick<+ MPlugin,+ | 'name'+ | 'type'+ | 'version'+ | 'latestVersion'+ | 'enabled'+ | 'uninstalled'+ | 'peertubeEngine'+ | 'description'+ | 'homepage'+ | 'settings'+ | 'createdAt'+ | 'updatedAt'+>diff --git a/server/core/types/models/server/server-blocklist.ts b/server/core/types/models/server/server-blocklist.tsindex e944e7328f..e290c0c76b 100644--- a/server/core/types/models/server/server-blocklist.ts+++ b/server/core/types/models/server/server-blocklist.ts@@ -12,15 +12,15 @@ export type MServerBlocklist = Omit<ServerBlocklistModel, 'ByAccount' | 'Blocked// ############################################################################export type MServerBlocklistAccountServer =- MServerBlocklist &- Use<'ByAccount', MAccountDefault> &- Use<'BlockedServer', MServer>+ & MServerBlocklist+ & Use<'ByAccount', MAccountDefault>+ & Use<'BlockedServer', MServer>// ############################################################################// Format for API or AP objectexport type MServerBlocklistFormattable =- Pick<MServerBlocklist, 'createdAt'> &- Use<'ByAccount', MAccountFormattable> &- Use<'BlockedServer', MServerFormattable>+ & Pick<MServerBlocklist, 'createdAt'>+ & Use<'ByAccount', MAccountFormattable>+ & Use<'BlockedServer', MServerFormattable>diff --git a/server/core/types/models/server/server.ts b/server/core/types/models/server/server.tsindex fe3d362b52..744042dc07 100644--- a/server/core/types/models/server/server.ts+++ b/server/core/types/models/server/server.ts@@ -14,13 +14,13 @@ export type MServerHost = Pick<MServer, 'host'>export type MServerRedundancyAllowed = Pick<MServer, 'redundancyAllowed'>export type MServerHostBlocks =- MServerHost &- Use<'BlockedBy', MAccountBlocklistId[]>+ & MServerHost+ & Use<'BlockedBy', MAccountBlocklistId[]>// ############################################################################// Format for API or AP objectexport type MServerFormattable =- FunctionProperties<MServer> &- Pick<MServer, 'host'>+ & FunctionProperties<MServer>+ & Pick<MServer, 'host'>diff --git a/server/core/types/models/user/user-notification.ts b/server/core/types/models/user/user-notification.tsindex f90ebdab23..dcadb51a25 100644--- a/server/core/types/models/user/user-notification.ts+++ b/server/core/types/models/user/user-notification.ts@@ -27,102 +27,114 @@ export module UserNotificationIncludes {export type VideoInclude = Pick<VideoModel, 'id' | 'uuid' | 'name' | 'state'>export type VideoIncludeChannel =- VideoInclude &- PickWith<VideoModel, 'VideoChannel', VideoChannelIncludeActor>+ & VideoInclude+ & PickWith<VideoModel, 'VideoChannel', VideoChannelIncludeActor>export type ActorInclude =- Pick<ActorModel, 'preferredUsername' | 'getHost'> &- PickWith<ActorModel, 'Avatars', ActorImageInclude[]> &- PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>+ & Pick<ActorModel, 'preferredUsername' | 'getHost'>+ & PickWith<ActorModel, 'Avatars', ActorImageInclude[]>+ & PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>export type VideoChannelInclude = Pick<VideoChannelModel, 'id' | 'name' | 'getDisplayName'>export type VideoChannelIncludeActor =- VideoChannelInclude &- PickWith<VideoChannelModel, 'Actor', ActorInclude>+ & VideoChannelInclude+ & PickWith<VideoChannelModel, 'Actor', ActorInclude>export type AccountInclude = Pick<AccountModel, 'id' | 'name' | 'getDisplayName'>export type AccountIncludeActor =- AccountInclude &- PickWith<AccountModel, 'Actor', ActorInclude>+ & AccountInclude+ & PickWith<AccountModel, 'Actor', ActorInclude>export type VideoCommentInclude =- Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId' | 'heldForReview'> &- PickWith<VideoCommentModel, 'Account', AccountIncludeActor> &- PickWith<VideoCommentModel, 'Video', VideoInclude>+ & Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId' | 'heldForReview'>+ & PickWith<VideoCommentModel, 'Account', AccountIncludeActor>+ & PickWith<VideoCommentModel, 'Video', VideoInclude>export type VideoAbuseInclude =- Pick<VideoAbuseModel, 'id'> &- PickWith<VideoAbuseModel, 'Video', VideoInclude>+ & Pick<VideoAbuseModel, 'id'>+ & PickWith<VideoAbuseModel, 'Video', VideoInclude>export type VideoCommentAbuseInclude =- Pick<VideoCommentAbuseModel, 'id'> &- PickWith<VideoCommentAbuseModel, 'VideoComment',- Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId'> &- PickWith<VideoCommentModel, 'Video', Pick<VideoModel, 'id' | 'name' | 'uuid' | 'state'>>>+ & Pick<VideoCommentAbuseModel, 'id'>+ & PickWith<+ VideoCommentAbuseModel,+ 'VideoComment',+ & Pick<VideoCommentModel, 'id' | 'originCommentId' | 'getThreadId'>+ & PickWith<VideoCommentModel, 'Video', Pick<VideoModel, 'id' | 'name' | 'uuid' | 'state'>>+ >export type AbuseInclude =- Pick<AbuseModel, 'id' | 'state'> &- PickWith<AbuseModel, 'VideoAbuse', VideoAbuseInclude> &- PickWith<AbuseModel, 'VideoCommentAbuse', VideoCommentAbuseInclude> &- PickWith<AbuseModel, 'FlaggedAccount', AccountIncludeActor>+ & Pick<AbuseModel, 'id' | 'state'>+ & PickWith<AbuseModel, 'VideoAbuse', VideoAbuseInclude>+ & PickWith<AbuseModel, 'VideoCommentAbuse', VideoCommentAbuseInclude>+ & PickWith<AbuseModel, 'FlaggedAccount', AccountIncludeActor>export type VideoBlacklistInclude =- Pick<VideoBlacklistModel, 'id'> &- PickWith<VideoAbuseModel, 'Video', VideoInclude>+ & Pick<VideoBlacklistModel, 'id'>+ & PickWith<VideoAbuseModel, 'Video', VideoInclude>export type VideoImportInclude =- Pick<VideoImportModel, 'id' | 'magnetUri' | 'targetUrl' | 'torrentName'> &- PickWith<VideoImportModel, 'Video', VideoInclude>+ & Pick<VideoImportModel, 'id' | 'magnetUri' | 'targetUrl' | 'torrentName'>+ & PickWith<VideoImportModel, 'Video', VideoInclude>export type ActorFollower =- Pick<ActorModel, 'preferredUsername' | 'getHost'> &- PickWith<ActorModel, 'Account', AccountInclude> &- PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>> &- PickWithOpt<ActorModel, 'Avatars', ActorImageInclude[]>+ & Pick<ActorModel, 'preferredUsername' | 'getHost'>+ & PickWith<ActorModel, 'Account', AccountInclude>+ & PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>+ & PickWithOpt<ActorModel, 'Avatars', ActorImageInclude[]>export type ActorFollowing =- Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'> &- PickWith<ActorModel, 'VideoChannel', VideoChannelInclude> &- PickWith<ActorModel, 'Account', AccountInclude> &- PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>+ & Pick<ActorModel, 'preferredUsername' | 'type' | 'getHost'>+ & PickWith<ActorModel, 'VideoChannel', VideoChannelInclude>+ & PickWith<ActorModel, 'Account', AccountInclude>+ & PickWith<ActorModel, 'Server', Pick<ServerModel, 'host'>>export type ActorFollowInclude =- Pick<ActorFollowModel, 'id' | 'state'> &- PickWith<ActorFollowModel, 'ActorFollower', ActorFollower> &- PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing>+ & Pick<ActorFollowModel, 'id' | 'state'>+ & PickWith<ActorFollowModel, 'ActorFollower', ActorFollower>+ & PickWith<ActorFollowModel, 'ActorFollowing', ActorFollowing>- export type PluginInclude =- Pick<PluginModel, 'id' | 'name' | 'type' | 'latestVersion'>+ export type PluginInclude = Pick<PluginModel, 'id' | 'name' | 'type' | 'latestVersion'>- export type ApplicationInclude =- Pick<ApplicationModel, 'latestPeerTubeVersion'>+ export type ApplicationInclude = Pick<ApplicationModel, 'latestPeerTubeVersion'>- export type UserRegistrationInclude =- Pick<UserRegistrationModel, 'id' | 'username'>+ export type UserRegistrationInclude = Pick<UserRegistrationModel, 'id' | 'username'>export type VideoCaptionInclude =- Pick<VideoCaptionModel, 'id' | 'language'> &- PickWith<VideoCaptionModel, 'Video', VideoInclude>+ & Pick<VideoCaptionModel, 'id' | 'language'>+ & PickWith<VideoCaptionModel, 'Video', VideoInclude>}// ############################################################################-export type MUserNotification =- Omit<UserNotificationModel, 'User' | 'Video' | 'VideoComment' | 'Abuse' | 'VideoBlacklist' |- 'VideoImport' | 'Account' | 'ActorFollow' | 'Plugin' | 'Application' | 'UserRegistration' | 'VideoCaption'>+export type MUserNotification = Omit<+ UserNotificationModel,+ | 'User'+ | 'Video'+ | 'VideoComment'+ | 'Abuse'+ | 'VideoBlacklist'+ | 'VideoImport'+ | 'Account'+ | 'ActorFollow'+ | 'Plugin'+ | 'Application'+ | 'UserRegistration'+ | 'VideoCaption'+>// ############################################################################export type UserNotificationModelForApi =- MUserNotification &- Use<'Video', UserNotificationIncludes.VideoIncludeChannel> &- Use<'VideoComment', UserNotificationIncludes.VideoCommentInclude> &- Use<'Abuse', UserNotificationIncludes.AbuseInclude> &- Use<'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude> &- Use<'VideoImport', UserNotificationIncludes.VideoImportInclude> &- Use<'ActorFollow', UserNotificationIncludes.ActorFollowInclude> &- Use<'Plugin', UserNotificationIncludes.PluginInclude> &- Use<'Application', UserNotificationIncludes.ApplicationInclude> &- Use<'Account', UserNotificationIncludes.AccountIncludeActor> &- Use<'UserRegistration', UserNotificationIncludes.UserRegistrationInclude> &- Use<'VideoCaption', UserNotificationIncludes.VideoCaptionInclude>+ & MUserNotification+ & Use<'Video', UserNotificationIncludes.VideoIncludeChannel>+ & Use<'VideoComment', UserNotificationIncludes.VideoCommentInclude>+ & Use<'Abuse', UserNotificationIncludes.AbuseInclude>+ & Use<'VideoBlacklist', UserNotificationIncludes.VideoBlacklistInclude>+ & Use<'VideoImport', UserNotificationIncludes.VideoImportInclude>+ & Use<'ActorFollow', UserNotificationIncludes.ActorFollowInclude>+ & Use<'Plugin', UserNotificationIncludes.PluginInclude>+ & Use<'Application', UserNotificationIncludes.ApplicationInclude>+ & Use<'Account', UserNotificationIncludes.AccountIncludeActor>+ & Use<'UserRegistration', UserNotificationIncludes.UserRegistrationInclude>+ & Use<'VideoCaption', UserNotificationIncludes.VideoCaptionInclude>diff --git a/server/core/types/models/user/user-registration.ts b/server/core/types/models/user/user-registration.tsindex bcbe52fbde..3838898933 100644--- a/server/core/types/models/user/user-registration.ts+++ b/server/core/types/models/user/user-registration.ts@@ -11,5 +11,5 @@ export type MRegistration = Omit<UserRegistrationModel, 'User'>// ############################################################################export type MRegistrationFormattable =- MRegistration &- Use<'User', MUserId>+ & MRegistration+ & Use<'User', MUserId>diff --git a/server/core/types/models/user/user.ts b/server/core/types/models/user/user.tsindex 3d0bee1aa8..c32e80dce4 100644--- a/server/core/types/models/user/user.ts+++ b/server/core/types/models/user/user.ts@@ -30,45 +30,45 @@ export type MUserId = Pick<UserModel, 'id'>// With accountexport type MUserAccountId =- MUser &- Use<'Account', MAccountId>+ & MUser+ & Use<'Account', MAccountId>export type MUserAccountUrl =- MUser &- Use<'Account', MAccountUrl & MAccountIdActorId>+ & MUser+ & Use<'Account', MAccountUrl & MAccountIdActorId>export type MUserAccount =- MUser &- Use<'Account', MAccount>+ & MUser+ & Use<'Account', MAccount>export type MUserAccountDefault =- MUser &- Use<'Account', MAccountDefault>+ & MUser+ & Use<'Account', MAccountDefault>// With channelexport type MUserNotifSettingChannelDefault =- MUser &- Use<'NotificationSetting', MNotificationSetting> &- Use<'Account', MAccountDefaultChannelDefault>+ & MUser+ & Use<'NotificationSetting', MNotificationSetting>+ & Use<'Account', MAccountDefaultChannelDefault>// With notification settingsexport type MUserWithNotificationSetting =- MUser &- Use<'NotificationSetting', MNotificationSetting>+ & MUser+ & Use<'NotificationSetting', MNotificationSetting>export type MUserNotifSettingAccount =- MUser &- Use<'NotificationSetting', MNotificationSetting> &- Use<'Account', MAccount>+ & MUser+ & Use<'NotificationSetting', MNotificationSetting>+ & Use<'Account', MAccount>// Default scopeexport type MUserDefault =- MUser &- Use<'NotificationSetting', MNotificationSetting> &- Use<'Account', MAccountDefault>+ & MUser+ & Use<'NotificationSetting', MNotificationSetting>+ & Use<'Account', MAccountDefault>// ############################################################################@@ -76,14 +76,14 @@ export type MUserDefault =type MAccountWithChannels = MAccountFormattable & PickWithOpt<AccountModel, 'VideoChannels', MChannelFormattable[]>type MAccountWithChannelsAndSpecialPlaylists =- MAccountWithChannels &- PickWithOpt<AccountModel, 'VideoPlaylists', MVideoPlaylist[]>+ & MAccountWithChannels+ & PickWithOpt<AccountModel, 'VideoPlaylists', MVideoPlaylist[]>export type MUserFormattable =- MUserQuotaUsed &- Use<'Account', MAccountWithChannels> &- PickWithOpt<UserModel, 'NotificationSetting', MNotificationSettingFormattable>+ & MUserQuotaUsed+ & Use<'Account', MAccountWithChannels>+ & PickWithOpt<UserModel, 'NotificationSetting', MNotificationSettingFormattable>export type MMyUserFormattable =- MUserFormattable &- Use<'Account', MAccountWithChannelsAndSpecialPlaylists>+ & MUserFormattable+ & Use<'Account', MAccountWithChannelsAndSpecialPlaylists>diff --git a/server/core/types/models/video/local-video-viewer.ts b/server/core/types/models/video/local-video-viewer.tsindex 90535dac02..cfc4ca675a 100644--- a/server/core/types/models/video/local-video-viewer.ts+++ b/server/core/types/models/video/local-video-viewer.ts@@ -10,10 +10,10 @@ type Use<K extends keyof LocalVideoViewerModel, M> = PickWith<LocalVideoViewerMoexport type MLocalVideoViewer = Omit<LocalVideoViewerModel, 'Video'>export type MLocalVideoViewerVideo =- MLocalVideoViewer &- Use<'Video', MVideo>+ & MLocalVideoViewer+ & Use<'Video', MVideo>export type MLocalVideoViewerWithWatchSections =- MLocalVideoViewer &- Use<'Video', MVideo> &- Use<'WatchSections', MLocalVideoViewerWatchSection[]>+ & MLocalVideoViewer+ & Use<'Video', MVideo>+ & Use<'WatchSections', MLocalVideoViewerWatchSection[]>diff --git a/server/core/types/models/video/storyboard.ts b/server/core/types/models/video/storyboard.tsindex d8a0e39ea1..dcb617bdd3 100644--- a/server/core/types/models/video/storyboard.ts+++ b/server/core/types/models/video/storyboard.ts@@ -11,5 +11,5 @@ export type MStoryboard = Omit<StoryboardModel, 'Video'>// ############################################################################export type MStoryboardVideo =- MStoryboard &- Use<'Video', MVideo>+ & MStoryboard+ & Use<'Video', MVideo>diff --git a/server/core/types/models/video/thumbnail.ts b/server/core/types/models/video/thumbnail.tsindex b952c06a01..1fc04bd0d7 100644--- a/server/core/types/models/video/thumbnail.ts+++ b/server/core/types/models/video/thumbnail.ts@@ -11,5 +11,5 @@ export type MThumbnail = Omit<ThumbnailModel, 'Video' | 'VideoPlaylist'>// ############################################################################export type MThumbnailVideo =- MThumbnail &- Use<'Video', MVideo>+ & MThumbnail+ & Use<'Video', MVideo>diff --git a/server/core/types/models/video/video-blacklist.ts b/server/core/types/models/video/video-blacklist.tsindex b202e9261f..dc35191a36 100644--- a/server/core/types/models/video/video-blacklist.ts+++ b/server/core/types/models/video/video-blacklist.ts@@ -14,17 +14,17 @@ export type MVideoBlacklistUnfederated = Pick<MVideoBlacklist, 'unfederated'>// ############################################################################export type MVideoBlacklistLightVideo =- MVideoBlacklistLight &- Use<'Video', MVideo>+ & MVideoBlacklistLight+ & Use<'Video', MVideo>export type MVideoBlacklistVideo =- MVideoBlacklist &- Use<'Video', MVideo>+ & MVideoBlacklist+ & Use<'Video', MVideo>// ############################################################################// Format for API or AP objectexport type MVideoBlacklistFormattable =- MVideoBlacklist &- Use<'Video', MVideoFormattable>+ & MVideoBlacklist+ & Use<'Video', MVideoFormattable>diff --git a/server/core/types/models/video/video-caption.ts b/server/core/types/models/video/video-caption.tsindex 02f0ffdf1b..2f9c755101 100644--- a/server/core/types/models/video/video-caption.ts+++ b/server/core/types/models/video/video-caption.ts@@ -11,19 +11,28 @@ export type MVideoCaption = Omit<VideoCaptionModel, 'Video'>// ############################################################################export type MVideoCaptionLanguage = Pick<MVideoCaption, 'language'>-export type MVideoCaptionLanguageUrl =- Pick<MVideoCaption, 'language' | 'fileUrl' | 'storage' | 'filename' | 'automaticallyGenerated' | 'getFileUrl' | 'getCaptionStaticPath' |- 'toActivityPubObject' | 'getOriginFileUrl'>+export type MVideoCaptionLanguageUrl = Pick<+ MVideoCaption,+ | 'language'+ | 'fileUrl'+ | 'storage'+ | 'filename'+ | 'automaticallyGenerated'+ | 'getFileUrl'+ | 'getCaptionStaticPath'+ | 'toActivityPubObject'+ | 'getOriginFileUrl'+>export type MVideoCaptionVideo =- MVideoCaption &- Use<'Video', Pick<MVideo, 'id' | 'name' | 'remote' | 'uuid' | 'url' | 'state' | 'getWatchStaticPath' | 'isOwned'>>+ & MVideoCaption+ & Use<'Video', Pick<MVideo, 'id' | 'name' | 'remote' | 'uuid' | 'url' | 'state' | 'getWatchStaticPath' | 'isOwned'>>// ############################################################################// Format for API or AP objectexport type MVideoCaptionFormattable =- MVideoCaption &- Pick<MVideoCaption, 'language'> &- Use<'Video', MVideoOwned & MVideoUUID>+ & MVideoCaption+ & Pick<MVideoCaption, 'language'>+ & Use<'Video', MVideoOwned & MVideoUUID>diff --git a/server/core/types/models/video/video-change-ownership.ts b/server/core/types/models/video/video-change-ownership.tsindex 70753e30b2..2dde7dbab5 100644--- a/server/core/types/models/video/video-change-ownership.ts+++ b/server/core/types/models/video/video-change-ownership.ts@@ -10,17 +10,17 @@ type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnexport type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>export type MVideoChangeOwnershipFull =- MVideoChangeOwnership &- Use<'Initiator', MAccountDefault> &- Use<'NextOwner', MAccountDefault> &- Use<'Video', MVideoWithAllFiles>+ & MVideoChangeOwnership+ & Use<'Initiator', MAccountDefault>+ & Use<'NextOwner', MAccountDefault>+ & Use<'Video', MVideoWithAllFiles>// ############################################################################// Format for API or AP objectexport type MVideoChangeOwnershipFormattable =- Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &- Use<'Initiator', MAccountFormattable> &- Use<'NextOwner', MAccountFormattable> &- Use<'Video', MVideoFormattable>+ & Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'>+ & Use<'Initiator', MAccountFormattable>+ & Use<'NextOwner', MAccountFormattable>+ & Use<'Video', MVideoFormattable>diff --git a/server/core/types/models/video/video-channel-sync.ts b/server/core/types/models/video/video-channel-sync.tsindex 7e4f9373b0..733a2e2a9e 100644--- a/server/core/types/models/video/video-channel-sync.ts+++ b/server/core/types/models/video/video-channel-sync.ts@@ -7,11 +7,11 @@ type Use<K extends keyof VideoChannelSyncModel, M> = PickWith<VideoChannelSyncMoexport type MChannelSync = Omit<VideoChannelSyncModel, 'VideoChannel'>export type MChannelSyncChannel =- MChannelSync &- Use<'VideoChannel', MChannelAccountDefault> &- FunctionProperties<VideoChannelSyncModel>+ & MChannelSync+ & Use<'VideoChannel', MChannelAccountDefault>+ & FunctionProperties<VideoChannelSyncModel>export type MChannelSyncFormattable =- FunctionProperties<MChannelSyncChannel> &- Use<'VideoChannel', MChannelFormattable> &- MChannelSync+ & FunctionProperties<MChannelSyncChannel>+ & Use<'VideoChannel', MChannelFormattable>+ & MChannelSyncdiff --git a/server/core/types/models/video/video-channel.ts b/server/core/types/models/video/video-channel.tsindex d29090f956..72e2f0de3e 100644--- a/server/core/types/models/video/video-channel.ts+++ b/server/core/types/models/video/video-channel.ts@@ -4,7 +4,8 @@ import {MAccountAPI,MAccountActor,MAccountDefault,- MAccountFormattable, MAccountIdActorId,+ MAccountFormattable,+ MAccountIdActorId,MAccountLight,MAccountSummaryBlocks,MAccountSummaryFormattable,@@ -43,117 +44,117 @@ export type MChannelId = Pick<MChannel, 'id'>// ############################################################################export type MChannelIdActor =- MChannelId &- Use<'Actor', MActorAccountChannelId>+ & MChannelId+ & Use<'Actor', MActorAccountChannelId>export type MChannelUserId =- Pick<MChannel, 'accountId'> &- Use<'Account', MAccountUserId>+ & Pick<MChannel, 'accountId'>+ & Use<'Account', MAccountUserId>export type MChannelAccountIdUrl =- Pick<MChannel, 'id' | 'accountId'> &- Use<'Actor', MActorUrl & MActorId> &- Use<'Account', MAccountIdActorId & MAccountUrl>+ & Pick<MChannel, 'id' | 'accountId'>+ & Use<'Actor', MActorUrl & MActorId>+ & Use<'Account', MAccountIdActorId & MAccountUrl>export type MChannelActor =- MChannel &- Use<'Actor', MActor>+ & MChannel+ & Use<'Actor', MActor>export type MChannelUrl = Use<'Actor', MActorUrl>// Default scopeexport type MChannelDefault =- MChannel &- Use<'Actor', MActorDefault>+ & MChannel+ & Use<'Actor', MActorDefault>export type MChannelBannerDefault =- MChannel &- Use<'Actor', MActorDefaultBanner>+ & MChannel+ & Use<'Actor', MActorDefaultBanner>// ############################################################################// Not all association attributesexport type MChannelActorLight =- MChannel &- Use<'Actor', MActorLight>+ & MChannel+ & Use<'Actor', MActorLight>export type MChannelAccountLight =- MChannel &- Use<'Actor', MActorDefaultLight> &- Use<'Account', MAccountLight>+ & MChannel+ & Use<'Actor', MActorDefaultLight>+ & Use<'Account', MAccountLight>export type MChannelHost =- MChannel &- Use<'Actor', MActorHost>+ & MChannel+ & Use<'Actor', MActorHost>export type MChannelHostOnly =- MChannelId &- Use<'Actor', MActorHostOnly>+ & MChannelId+ & Use<'Actor', MActorHostOnly>// ############################################################################// Account associationsexport type MChannelAccountActor =- MChannel &- Use<'Account', MAccountActor>+ & MChannel+ & Use<'Account', MAccountActor>export type MChannelBannerAccountDefault =- MChannel &- Use<'Actor', MActorDefaultBanner> &- Use<'Account', MAccountDefault>+ & MChannel+ & Use<'Actor', MActorDefaultBanner>+ & Use<'Account', MAccountDefault>export type MChannelAccountDefault =- MChannel &- Use<'Actor', MActorDefault> &- Use<'Account', MAccountDefault>+ & MChannel+ & Use<'Actor', MActorDefault>+ & Use<'Account', MAccountDefault>// ############################################################################// Videos associationsexport type MChannelVideos =- MChannel &- Use<'Videos', MVideo[]>+ & MChannel+ & Use<'Videos', MVideo[]>// ############################################################################// For APIexport type MChannelSummary =- FunctionProperties<MChannel> &- Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> &- Use<'Actor', MActorSummary>+ & FunctionProperties<MChannel>+ & Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'>+ & Use<'Actor', MActorSummary>export type MChannelSummaryAccount =- MChannelSummary &- Use<'Account', MAccountSummaryBlocks>+ & MChannelSummary+ & Use<'Account', MAccountSummaryBlocks>export type MChannelAPI =- MChannel &- Use<'Actor', MActorAPI> &- Use<'Account', MAccountAPI>+ & MChannel+ & Use<'Actor', MActorAPI>+ & Use<'Account', MAccountAPI>// ############################################################################// Format for API or AP objectexport type MChannelSummaryFormattable =- FunctionProperties<MChannel> &- Pick<MChannel, 'id' | 'name'> &- Use<'Actor', MActorSummaryFormattable>+ & FunctionProperties<MChannel>+ & Pick<MChannel, 'id' | 'name'>+ & Use<'Actor', MActorSummaryFormattable>export type MChannelAccountSummaryFormattable =- MChannelSummaryFormattable &- Use<'Account', MAccountSummaryFormattable>+ & MChannelSummaryFormattable+ & Use<'Account', MAccountSummaryFormattable>export type MChannelFormattable =- FunctionProperties<MChannel> &- Pick<MChannel, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'support'> &- Use<'Actor', MActorFormattable> &- PickWithOpt<VideoChannelModel, 'Account', MAccountFormattable>+ & FunctionProperties<MChannel>+ & Pick<MChannel, 'id' | 'name' | 'description' | 'createdAt' | 'updatedAt' | 'support'>+ & Use<'Actor', MActorFormattable>+ & PickWithOpt<VideoChannelModel, 'Account', MAccountFormattable>export type MChannelAP =- Pick<MChannel, 'name' | 'description' | 'support'> &- Use<'Actor', MActorAPChannel> &- Use<'Account', MAccountUrl>+ & Pick<MChannel, 'name' | 'description' | 'support'>+ & Use<'Actor', MActorAPChannel>+ & Use<'Account', MAccountUrl>diff --git a/server/core/types/models/video/video-comment.ts b/server/core/types/models/video/video-comment.tsindex 5036721773..248940f0f7 100644--- a/server/core/types/models/video/video-comment.ts+++ b/server/core/types/models/video/video-comment.ts@@ -8,8 +8,10 @@ type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K,// ############################################################################-export type MComment =- Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account' | 'CommentAutomaticTags'>+export type MComment = Omit<+ VideoCommentModel,+ 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account' | 'CommentAutomaticTags'+>export type MCommentTotalReplies = MComment & { totalReplies?: number }export type MCommentId = Pick<MComment, 'id'>@@ -18,44 +20,44 @@ export type MCommentUrl = Pick<MComment, 'url'>// ---------------------------------------------------------------------------export type MCommentExport =- Pick<MComment, 'id' | 'url' | 'text' | 'createdAt'> &- Use<'Video', MVideoIdUrl & MVideoUUID> &- Use<'InReplyToVideoComment', MCommentUrl>+ & Pick<MComment, 'id' | 'url' | 'text' | 'createdAt'>+ & Use<'Video', MVideoIdUrl & MVideoUUID>+ & Use<'InReplyToVideoComment', MCommentUrl>// ############################################################################export type MCommentOwner =- MComment &- Use<'Account', MAccountDefault>+ & MComment+ & Use<'Account', MAccountDefault>export type MCommentVideo =- MComment &- Use<'Video', MVideoAccountLight>+ & MComment+ & Use<'Video', MVideoAccountLight>export type MCommentReply =- MComment &- Use<'InReplyToVideoComment', MComment>+ & MComment+ & Use<'InReplyToVideoComment', MComment>export type MCommentOwnerVideo =- MComment &- Use<'Account', MAccountDefault> &- Use<'Video', MVideoAccountIdUrl>+ & MComment+ & Use<'Account', MAccountDefault>+ & Use<'Video', MVideoAccountIdUrl>export type MCommentOwnerVideoReply =- MComment &- Use<'Account', MAccountDefault> &- Use<'Video', MVideoAccountIdUrl> &- Use<'InReplyToVideoComment', MComment>+ & MComment+ & Use<'Account', MAccountDefault>+ & Use<'Video', MVideoAccountIdUrl>+ & Use<'InReplyToVideoComment', MComment>export type MCommentOwnerReplyVideoImmutable =- MComment &- Use<'Account', MAccountDefault> &- Use<'InReplyToVideoComment', MComment> &- Use<'Video', MVideoImmutable>+ & MComment+ & Use<'Account', MAccountDefault>+ & Use<'InReplyToVideoComment', MComment>+ & Use<'Video', MVideoImmutable>export type MCommentOwnerVideoFeed =- MCommentOwner &- Use<'Video', MVideoFeed>+ & MCommentOwner+ & Use<'Video', MVideoFeed>// ############################################################################@@ -66,17 +68,17 @@ export type MCommentAPI = MComment & { totalReplies: number }// Format for API or AP objectexport type MCommentFormattable =- MCommentTotalReplies &- Use<'Account', MAccountFormattable>+ & MCommentTotalReplies+ & Use<'Account', MAccountFormattable>export type MCommentAdminOrUserFormattable =- MComment &- Use<'Account', MAccountFormattable> &- Use<'Video', MVideo> &- Use<'CommentAutomaticTags', MCommentAutomaticTagWithTag[]>+ & MComment+ & Use<'Account', MAccountFormattable>+ & Use<'Video', MVideo>+ & Use<'CommentAutomaticTags', MCommentAutomaticTagWithTag[]>export type MCommentAP =- MComment &- Use<'Account', MAccountUrl> &- PickWithOpt<VideoCommentModel, 'Video', MVideoImmutable> &- PickWithOpt<VideoCommentModel, 'InReplyToVideoComment', MCommentUrl>+ & MComment+ & Use<'Account', MAccountUrl>+ & PickWithOpt<VideoCommentModel, 'Video', MVideoImmutable>+ & PickWithOpt<VideoCommentModel, 'InReplyToVideoComment', MCommentUrl>diff --git a/server/core/types/models/video/video-file.ts b/server/core/types/models/video/video-file.tsindex f0e85992c9..9df420bebb 100644--- a/server/core/types/models/video/video-file.ts+++ b/server/core/types/models/video/video-file.ts@@ -10,20 +10,20 @@ type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M>export type MVideoFile = Omit<VideoFileModel, 'Video' | 'VideoStreamingPlaylist'>export type MVideoFileVideo =- MVideoFile &- Use<'Video', MVideo>+ & MVideoFile+ & Use<'Video', MVideo>export type MVideoFileStreamingPlaylist =- MVideoFile &- Use<'VideoStreamingPlaylist', MStreamingPlaylist>+ & MVideoFile+ & Use<'VideoStreamingPlaylist', MStreamingPlaylist>export type MVideoFileStreamingPlaylistVideo =- MVideoFile &- Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>+ & MVideoFile+ & Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>export type MVideoFileVideoUUID =- MVideoFile &- Use<'Video', MVideoUUID>+ & MVideoFile+ & Use<'Video', MVideoUUID>export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingPlaylist {return !!file.videoStreamingPlaylistIddiff --git a/server/core/types/models/video/video-import.ts b/server/core/types/models/video/video-import.tsindex 4920dfac39..0c1263d05a 100644--- a/server/core/types/models/video/video-import.ts+++ b/server/core/types/models/video/video-import.ts@@ -10,27 +10,27 @@ type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M>export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'>export type MVideoImportVideo =- MVideoImport &- Use<'Video', MVideo>+ & MVideoImport+ & Use<'Video', MVideo>// ############################################################################type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnailexport type MVideoImportDefault =- MVideoImport &- Use<'User', MUser> &- Use<'Video', VideoAssociation>+ & MVideoImport+ & Use<'User', MUser>+ & Use<'Video', VideoAssociation>export type MVideoImportDefaultFiles =- MVideoImport &- Use<'User', MUser> &- Use<'Video', VideoAssociation & MVideoWithFile>+ & MVideoImport+ & Use<'User', MUser>+ & Use<'Video', VideoAssociation & MVideoWithFile>// ############################################################################// Format for API or AP objectexport type MVideoImportFormattable =- MVideoImport &- PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>+ & MVideoImport+ & PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>diff --git a/server/core/types/models/video/video-live-session.ts b/server/core/types/models/video/video-live-session.tsindex 994726244d..694da1dfb0 100644--- a/server/core/types/models/video/video-live-session.ts+++ b/server/core/types/models/video/video-live-session.ts@@ -12,6 +12,6 @@ export type MVideoLiveSession = Omit<VideoLiveSessionModel, 'Video' | 'VideoLive// ############################################################################export type MVideoLiveSessionReplay =- MVideoLiveSession &- Use<'ReplayVideo', MVideo> &- Use<'ReplaySetting', MLiveReplaySetting>+ & MVideoLiveSession+ & Use<'ReplayVideo', MVideo>+ & Use<'ReplaySetting', MLiveReplaySetting>diff --git a/server/core/types/models/video/video-live.ts b/server/core/types/models/video/video-live.tsindex 84b34a8cc4..954645a2be 100644--- a/server/core/types/models/video/video-live.ts+++ b/server/core/types/models/video/video-live.ts@@ -12,15 +12,15 @@ export type MVideoLive = Omit<VideoLiveModel, 'Video' | 'ReplaySetting'>// ############################################################################export type MVideoLiveVideo =- MVideoLive &- Use<'Video', MVideo>+ & MVideoLive+ & Use<'Video', MVideo>// ############################################################################export type MVideoLiveWithSetting =- MVideoLive &- Use<'ReplaySetting', MLiveReplaySetting>+ & MVideoLive+ & Use<'ReplaySetting', MLiveReplaySetting>export type MVideoLiveVideoWithSetting =- MVideoLiveVideo &- Use<'ReplaySetting', MLiveReplaySetting>+ & MVideoLiveVideo+ & Use<'ReplaySetting', MLiveReplaySetting>diff --git a/server/core/types/models/video/video-playlist-element.ts b/server/core/types/models/video/video-playlist-element.tsindex ea1552ac2a..4439e2f6bc 100644--- a/server/core/types/models/video/video-playlist-element.ts+++ b/server/core/types/models/video/video-playlist-element.ts@@ -18,26 +18,26 @@ export type MVideoPlaylistElementLight = Pick<MVideoPlaylistElement, 'id' | 'vid// ############################################################################export type MVideoPlaylistElementVideoThumbnail =- MVideoPlaylistElement &- Use<'Video', MVideoThumbnail>+ & MVideoPlaylistElement+ & Use<'Video', MVideoThumbnail>export type MVideoPlaylistElementVideoUrl =- MVideoPlaylistElement &- Use<'Video', MVideoUrl>+ & MVideoPlaylistElement+ & Use<'Video', MVideoUrl>export type MVideoPlaylistElementVideoUrlPlaylistPrivacy =- MVideoPlaylistElement &- Use<'Video', MVideoUrl> &- Use<'VideoPlaylist', MVideoPlaylistPrivacy>+ & MVideoPlaylistElement+ & Use<'Video', MVideoUrl>+ & Use<'VideoPlaylist', MVideoPlaylistPrivacy>// ############################################################################// Format for API or AP objectexport type MVideoPlaylistElementFormattable =- MVideoPlaylistElement &- Use<'Video', MVideoFormattable>+ & MVideoPlaylistElement+ & Use<'Video', MVideoFormattable>export type MVideoPlaylistElementAP =- MVideoPlaylistElement &- Use<'Video', MVideoUrl>+ & MVideoPlaylistElement+ & Use<'Video', MVideoUrl>diff --git a/server/core/types/models/video/video-playlist.ts b/server/core/types/models/video/video-playlist.tsindex 152904d22a..e43f55adb2 100644--- a/server/core/types/models/video/video-playlist.ts+++ b/server/core/types/models/video/video-playlist.ts@@ -15,9 +15,9 @@ export type MVideoPlaylist = Omit<VideoPlaylistModel, 'OwnerAccount' | 'VideoChaexport type MVideoPlaylistId = Pick<MVideoPlaylist, 'id'>export type MVideoPlaylistSummary =- Pick<MVideoPlaylist, 'id'> &- Pick<MVideoPlaylist, 'name'> &- Pick<MVideoPlaylist, 'uuid'>+ & Pick<MVideoPlaylist, 'id'>+ & Pick<MVideoPlaylist, 'name'>+ & Pick<MVideoPlaylist, 'uuid'>export type MVideoPlaylistPrivacy = Pick<MVideoPlaylist, 'privacy'>export type MVideoPlaylistUUID = Pick<MVideoPlaylist, 'uuid'>export type MVideoPlaylistVideosLength = MVideoPlaylist & { videosLength?: number }@@ -27,78 +27,78 @@ export type MVideoPlaylistVideosLength = MVideoPlaylist & { videosLength?: numbe// With elementsexport type MVideoPlaylistSummaryWithElements =- MVideoPlaylistSummary &- Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]>+ & MVideoPlaylistSummary+ & Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]>// ############################################################################// With accountexport type MVideoPlaylistOwner =- MVideoPlaylist &- Use<'OwnerAccount', MAccount>+ & MVideoPlaylist+ & Use<'OwnerAccount', MAccount>export type MVideoPlaylistOwnerDefault =- MVideoPlaylist &- Use<'OwnerAccount', MAccountDefault>+ & MVideoPlaylist+ & Use<'OwnerAccount', MAccountDefault>// ############################################################################// With thumbnailexport type MVideoPlaylistThumbnail =- MVideoPlaylist &- Use<'Thumbnail', MThumbnail>+ & MVideoPlaylist+ & Use<'Thumbnail', MThumbnail>export type MVideoPlaylistAccountThumbnail =- MVideoPlaylist &- Use<'OwnerAccount', MAccountDefault> &- Use<'Thumbnail', MThumbnail>+ & MVideoPlaylist+ & Use<'OwnerAccount', MAccountDefault>+ & Use<'Thumbnail', MThumbnail>// ############################################################################// With channelexport type MVideoPlaylistAccountChannelDefault =- MVideoPlaylist &- Use<'OwnerAccount', MAccountDefault> &- Use<'VideoChannel', MChannelDefault>+ & MVideoPlaylist+ & Use<'OwnerAccount', MAccountDefault>+ & Use<'VideoChannel', MChannelDefault>// ############################################################################// With all associationsexport type MVideoPlaylistFull =- MVideoPlaylistVideosLength &- Use<'OwnerAccount', MAccountDefault> &- Use<'VideoChannel', MChannelDefault> &- Use<'Thumbnail', MThumbnail>+ & MVideoPlaylistVideosLength+ & Use<'OwnerAccount', MAccountDefault>+ & Use<'VideoChannel', MChannelDefault>+ & Use<'Thumbnail', MThumbnail>// ############################################################################// For APIexport type MVideoPlaylistAccountChannelSummary =- MVideoPlaylist &- Use<'OwnerAccount', MAccountSummary> &- Use<'VideoChannel', MChannelSummary>+ & MVideoPlaylist+ & Use<'OwnerAccount', MAccountSummary>+ & Use<'VideoChannel', MChannelSummary>export type MVideoPlaylistFullSummary =- MVideoPlaylistVideosLength &- Use<'Thumbnail', MThumbnail> &- Use<'OwnerAccount', MAccountSummary> &- Use<'VideoChannel', MChannelSummary>+ & MVideoPlaylistVideosLength+ & Use<'Thumbnail', MThumbnail>+ & Use<'OwnerAccount', MAccountSummary>+ & Use<'VideoChannel', MChannelSummary>// ############################################################################// Format for API or AP objectexport type MVideoPlaylistFormattable =- MVideoPlaylistVideosLength &- Use<'OwnerAccount', MAccountSummaryFormattable> &- Use<'VideoChannel', MChannelSummaryFormattable>+ & MVideoPlaylistVideosLength+ & Use<'OwnerAccount', MAccountSummaryFormattable>+ & Use<'VideoChannel', MChannelSummaryFormattable>export type MVideoPlaylistAP =- MVideoPlaylist &- Use<'Thumbnail', MThumbnail> &- Use<'VideoChannel', MChannelUrl>+ & MVideoPlaylist+ & Use<'Thumbnail', MThumbnail>+ & Use<'VideoChannel', MChannelUrl>diff --git a/server/core/types/models/video/video-rate.ts b/server/core/types/models/video/video-rate.tsindex dc6504fb33..61a5028287 100644--- a/server/core/types/models/video/video-rate.ts+++ b/server/core/types/models/video/video-rate.ts@@ -10,22 +10,22 @@ type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateMoexport type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'>export type MAccountVideoRateVideoUrl =- MAccountVideoRate &- Use<'Video', MVideoUrl>+ & MAccountVideoRate+ & Use<'Video', MVideoUrl>export type MAccountVideoRateAccountUrl =- MAccountVideoRate &- Use<'Account', MAccountUrl>+ & MAccountVideoRate+ & Use<'Account', MAccountUrl>export type MAccountVideoRateAccountVideo =- MAccountVideoRate &- Use<'Account', MAccountAudience> &- Use<'Video', MVideo>+ & MAccountVideoRate+ & Use<'Account', MAccountAudience>+ & Use<'Video', MVideo>// ############################################################################// Format for API or AP objectexport type MAccountVideoRateFormattable =- Pick<MAccountVideoRate, 'type'> &- Use<'Video', MVideoFormattable>+ & Pick<MAccountVideoRate, 'type'>+ & Use<'Video', MVideoFormattable>diff --git a/server/core/types/models/video/video-redundancy.ts b/server/core/types/models/video/video-redundancy.tsindex 3cf06f5c86..13af1049ff 100644--- a/server/core/types/models/video/video-redundancy.ts+++ b/server/core/types/models/video/video-redundancy.ts@@ -15,17 +15,17 @@ export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'>// ############################################################################export type MVideoRedundancyStreamingPlaylistVideo =- MVideoRedundancy &- Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>+ & MVideoRedundancy+ & Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>export type MVideoRedundancyVideo =- MVideoRedundancy &- Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>+ & MVideoRedundancy+ & Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>// ############################################################################// Format for API or AP objectexport type MVideoRedundancyAP =- MVideoRedundancy &- PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>+ & MVideoRedundancy+ & PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>diff --git a/server/core/types/models/video/video-share.ts b/server/core/types/models/video/video-share.tsindex 52e98d8ec9..9aaf4e7500 100644--- a/server/core/types/models/video/video-share.ts+++ b/server/core/types/models/video/video-share.ts@@ -10,10 +10,10 @@ type Use<K extends keyof VideoShareModel, M> = PickWith<VideoShareModel, K, M>export type MVideoShare = Omit<VideoShareModel, 'Actor' | 'Video'>export type MVideoShareActor =- MVideoShare &- Use<'Actor', MActorDefault>+ & MVideoShare+ & Use<'Actor', MActorDefault>export type MVideoShareFull =- MVideoShare &- Use<'Actor', MActorDefault> &- Use<'Video', MVideo>+ & MVideoShare+ & Use<'Actor', MActorDefault>+ & Use<'Video', MVideo>diff --git a/server/core/types/models/video/video-streaming-playlist.ts b/server/core/types/models/video/video-streaming-playlist.tsindex a416469691..d3a54e131b 100644--- a/server/core/types/models/video/video-streaming-playlist.ts+++ b/server/core/types/models/video/video-streaming-playlist.ts@@ -11,32 +11,32 @@ type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamiexport type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'>export type MStreamingPlaylistFiles =- MStreamingPlaylist &- Use<'VideoFiles', MVideoFile[]>+ & MStreamingPlaylist+ & Use<'VideoFiles', MVideoFile[]>export type MStreamingPlaylistVideo =- MStreamingPlaylist &- Use<'Video', MVideo>+ & MStreamingPlaylist+ & Use<'Video', MVideo>export type MStreamingPlaylistFilesVideo =- MStreamingPlaylist &- Use<'VideoFiles', MVideoFile[]> &- Use<'Video', MVideo>+ & MStreamingPlaylist+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'Video', MVideo>export type MStreamingPlaylistRedundanciesAll =- MStreamingPlaylist &- Use<'VideoFiles', MVideoFile[]> &- Use<'RedundancyVideos', MVideoRedundancy[]>+ & MStreamingPlaylist+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'RedundancyVideos', MVideoRedundancy[]>export type MStreamingPlaylistRedundancies =- MStreamingPlaylist &- Use<'VideoFiles', MVideoFile[]> &- Use<'RedundancyVideos', MVideoRedundancyFileUrl[]>+ & MStreamingPlaylist+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'RedundancyVideos', MVideoRedundancyFileUrl[]>export type MStreamingPlaylistRedundanciesOpt =- MStreamingPlaylist &- Use<'VideoFiles', MVideoFile[]> &- PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>+ & MStreamingPlaylist+ & Use<'VideoFiles', MVideoFile[]>+ & PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo {return !!(value as MStreamingPlaylist).videoIddiff --git a/server/core/types/models/video/video.ts b/server/core/types/models/video/video.tsindex 8dafbd467d..4d3e9e0b4c 100644--- a/server/core/types/models/video/video.ts+++ b/server/core/types/models/video/video.ts@@ -31,11 +31,30 @@ type Use<K extends keyof VideoModel, M> = PickWith<VideoModel, K, M>// ############################################################################-export type MVideo =- Omit<VideoModel, 'VideoChannel' | 'Tags' | 'Thumbnails' | 'VideoPlaylistElements' | 'VideoAbuses' |- 'VideoFiles' | 'VideoStreamingPlaylists' | 'VideoShares' | 'AccountVideoRates' | 'VideoComments' | 'VideoViews' | 'UserVideoHistories' |- 'ScheduleVideoUpdate' | 'VideoBlacklist' | 'VideoImport' | 'VideoCaptions' | 'VideoLive' | 'Trackers' | 'VideoPasswords' | 'Storyboard' |- 'AutomaticTags'>+export type MVideo = Omit<+ VideoModel,+ | 'VideoChannel'+ | 'Tags'+ | 'Thumbnails'+ | 'VideoPlaylistElements'+ | 'VideoAbuses'+ | 'VideoFiles'+ | 'VideoStreamingPlaylists'+ | 'VideoShares'+ | 'AccountVideoRates'+ | 'VideoComments'+ | 'VideoViews'+ | 'UserVideoHistories'+ | 'ScheduleVideoUpdate'+ | 'VideoBlacklist'+ | 'VideoImport'+ | 'VideoCaptions'+ | 'VideoLive'+ | 'Trackers'+ | 'VideoPasswords'+ | 'Storyboard'+ | 'AutomaticTags'+>// ############################################################################@@ -54,181 +73,181 @@ export type MVideoFeed = Pick<MVideo, 'name' | 'uuid'>// "With" to not confuse with the VideoFile modelexport type MVideoWithFile =- MVideo &- Use<'VideoFiles', MVideoFile[]> &- Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>+ & MVideo+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>export type MVideoThumbnail =- MVideo &- Use<'Thumbnails', MThumbnail[]>+ & MVideo+ & Use<'Thumbnails', MThumbnail[]>export type MVideoIdThumbnail =- MVideoId &- Use<'Thumbnails', MThumbnail[]>+ & MVideoId+ & Use<'Thumbnails', MThumbnail[]>export type MVideoWithFileThumbnail =- MVideoWithFile &- Use<'Thumbnails', MThumbnail[]>+ & MVideoWithFile+ & Use<'Thumbnails', MThumbnail[]>export type MVideoThumbnailBlacklist =- MVideo &- Use<'Thumbnails', MThumbnail[]> &- Use<'VideoBlacklist', MVideoBlacklistLight>+ & MVideo+ & Use<'Thumbnails', MThumbnail[]>+ & Use<'VideoBlacklist', MVideoBlacklistLight>export type MVideoTag =- MVideo &- Use<'Tags', MTag[]>+ & MVideo+ & Use<'Tags', MTag[]>export type MVideoWithSchedule =- MVideo &- PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate>+ & MVideo+ & PickWithOpt<VideoModel, 'ScheduleVideoUpdate', MScheduleVideoUpdate>export type MVideoWithCaptions =- MVideo &- Use<'VideoCaptions', MVideoCaptionLanguage[]>+ & MVideo+ & Use<'VideoCaptions', MVideoCaptionLanguage[]>export type MVideoWithStreamingPlaylist =- MVideo &- Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>+ & MVideo+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>// ############################################################################// Associations with not all their attributesexport type MVideoUserHistory =- MVideo &- Use<'UserVideoHistories', MUserVideoHistoryTime[]>+ & MVideo+ & Use<'UserVideoHistories', MUserVideoHistoryTime[]>export type MVideoWithBlacklistLight =- MVideo &- Use<'VideoBlacklist', MVideoBlacklistLight>+ & MVideo+ & Use<'VideoBlacklist', MVideoBlacklistLight>export type MVideoWithBlacklistRights =- MVideo &- Use<'VideoBlacklist', MVideoBlacklistUnfederated>+ & MVideo+ & Use<'VideoBlacklist', MVideoBlacklistUnfederated>export type MVideoAccountLight =- MVideo &- Use<'VideoChannel', MChannelAccountLight>+ & MVideo+ & Use<'VideoChannel', MChannelAccountLight>export type MVideoWithRights =- MVideo &- Use<'VideoBlacklist', MVideoBlacklistLight> &- Use<'VideoChannel', MChannelUserId>+ & MVideo+ & Use<'VideoBlacklist', MVideoBlacklistLight>+ & Use<'VideoChannel', MChannelUserId>// ############################################################################// All files with some additional associationsexport type MVideoWithAllFiles =- MVideo &- Use<'VideoFiles', MVideoFile[]> &- Use<'Thumbnails', MThumbnail[]> &- Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>+ & MVideo+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'Thumbnails', MThumbnail[]>+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>export type MVideoAccountLightBlacklistAllFiles =- MVideo &- Use<'VideoFiles', MVideoFile[]> &- Use<'Thumbnails', MThumbnail[]> &- Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &- Use<'VideoChannel', MChannelAccountLight> &- Use<'VideoBlacklist', MVideoBlacklistLight>+ & MVideo+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'Thumbnails', MThumbnail[]>+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>+ & Use<'VideoChannel', MChannelAccountLight>+ & Use<'VideoBlacklist', MVideoBlacklistLight>// ############################################################################// With accountexport type MVideoAccountDefault =- MVideo &- Use<'VideoChannel', MChannelAccountDefault>+ & MVideo+ & Use<'VideoChannel', MChannelAccountDefault>export type MVideoAccountIdUrl =- MVideo &- Use<'VideoChannel', MChannelAccountIdUrl>+ & MVideo+ & Use<'VideoChannel', MChannelAccountIdUrl>export type MVideoThumbnailAccountDefault =- MVideo &- Use<'Thumbnails', MThumbnail[]> &- Use<'VideoChannel', MChannelAccountDefault>+ & MVideo+ & Use<'Thumbnails', MThumbnail[]>+ & Use<'VideoChannel', MChannelAccountDefault>export type MVideoWithChannelActor =- MVideo &- Use<'VideoChannel', MChannelActor>+ & MVideo+ & Use<'VideoChannel', MChannelActor>export type MVideoWithHost =- MVideo &- Use<'VideoChannel', MChannelHostOnly>+ & MVideo+ & Use<'VideoChannel', MChannelHostOnly>export type MVideoFullLight =- MVideo &- Use<'Thumbnails', MThumbnail[]> &- Use<'VideoBlacklist', MVideoBlacklistLight> &- Use<'Tags', MTag[]> &- Use<'VideoChannel', MChannelAccountLight> &- Use<'UserVideoHistories', MUserVideoHistoryTime[]> &- Use<'VideoFiles', MVideoFile[]> &- Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> &- Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &- Use<'VideoLive', MVideoLive>+ & MVideo+ & Use<'Thumbnails', MThumbnail[]>+ & Use<'VideoBlacklist', MVideoBlacklistLight>+ & Use<'Tags', MTag[]>+ & Use<'VideoChannel', MChannelAccountLight>+ & Use<'UserVideoHistories', MUserVideoHistoryTime[]>+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'ScheduleVideoUpdate', MScheduleVideoUpdate>+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>+ & Use<'VideoLive', MVideoLive>// ############################################################################// APIexport type MVideoAP =- MVideo &- Use<'Tags', MTag[]> &- Use<'VideoChannel', MChannelAccountLight> &- Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &- Use<'VideoCaptions', MVideoCaptionLanguageUrl[]> &- Use<'VideoBlacklist', MVideoBlacklistUnfederated> &- Use<'VideoFiles', MVideoFile[]> &- Use<'Thumbnails', MThumbnail[]> &- Use<'VideoLive', MVideoLive> &- Use<'Storyboard', MStoryboard>+ & MVideo+ & Use<'Tags', MTag[]>+ & Use<'VideoChannel', MChannelAccountLight>+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>+ & Use<'VideoCaptions', MVideoCaptionLanguageUrl[]>+ & Use<'VideoBlacklist', MVideoBlacklistUnfederated>+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'Thumbnails', MThumbnail[]>+ & Use<'VideoLive', MVideoLive>+ & Use<'Storyboard', MStoryboard>export type MVideoAPLight = Omit<MVideoAP, 'VideoCaptions' | 'Storyboard'>export type MVideoDetails =- MVideo &- Use<'VideoBlacklist', MVideoBlacklistLight> &- Use<'Tags', MTag[]> &- Use<'VideoChannel', MChannelAccountLight> &- Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> &- Use<'Thumbnails', MThumbnail[]> &- Use<'UserVideoHistories', MUserVideoHistoryTime[]> &- Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]> &- Use<'VideoFiles', MVideoFile[]> &- Use<'Trackers', MTrackerUrl[]>+ & MVideo+ & Use<'VideoBlacklist', MVideoBlacklistLight>+ & Use<'Tags', MTag[]>+ & Use<'VideoChannel', MChannelAccountLight>+ & Use<'ScheduleVideoUpdate', MScheduleVideoUpdate>+ & Use<'Thumbnails', MThumbnail[]>+ & Use<'UserVideoHistories', MUserVideoHistoryTime[]>+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundancies[]>+ & Use<'VideoFiles', MVideoFile[]>+ & Use<'Trackers', MTrackerUrl[]>export type MVideoForUser =- MVideo &- Use<'VideoChannel', MChannelAccountDefault> &- Use<'ScheduleVideoUpdate', MScheduleVideoUpdate> &- Use<'VideoBlacklist', MVideoBlacklistLight> &- Use<'Thumbnails', MThumbnail[]>+ & MVideo+ & Use<'VideoChannel', MChannelAccountDefault>+ & Use<'ScheduleVideoUpdate', MScheduleVideoUpdate>+ & Use<'VideoBlacklist', MVideoBlacklistLight>+ & Use<'Thumbnails', MThumbnail[]>export type MVideoForRedundancyAPI =- MVideo &- Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]>+ & MVideo+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesAll[]>// ############################################################################// Format for API or AP objectexport type MVideoFormattable =- MVideoThumbnail &- PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]> &- Use<'VideoChannel', MChannelAccountSummaryFormattable> &- PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>> &- PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>> &- PickWithOpt<VideoModel, 'VideoStreamingPlaylists', MStreamingPlaylistFiles[]> &- PickWithOpt<VideoModel, 'VideoFiles', MVideoFile[]>+ & MVideoThumbnail+ & PickWithOpt<VideoModel, 'UserVideoHistories', MUserVideoHistoryTime[]>+ & Use<'VideoChannel', MChannelAccountSummaryFormattable>+ & PickWithOpt<VideoModel, 'ScheduleVideoUpdate', Pick<MScheduleVideoUpdate, 'updateAt' | 'privacy'>>+ & PickWithOpt<VideoModel, 'VideoBlacklist', Pick<MVideoBlacklist, 'reason'>>+ & PickWithOpt<VideoModel, 'VideoStreamingPlaylists', MStreamingPlaylistFiles[]>+ & PickWithOpt<VideoModel, 'VideoFiles', MVideoFile[]>export type MVideoFormattableDetails =- MVideoFormattable &- Use<'VideoChannel', MChannelFormattable> &- Use<'Tags', MTag[]> &- Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesOpt[]> &- Use<'VideoFiles', MVideoFile[]> &- PickWithOpt<VideoModel, 'Trackers', MTrackerUrl[]>+ & MVideoFormattable+ & Use<'VideoChannel', MChannelFormattable>+ & Use<'Tags', MTag[]>+ & Use<'VideoStreamingPlaylists', MStreamingPlaylistRedundanciesOpt[]>+ & Use<'VideoFiles', MVideoFile[]>+ & PickWithOpt<VideoModel, 'Trackers', MTrackerUrl[]>diff --git a/server/core/types/plugins/register-server-auth.model.ts b/server/core/types/plugins/register-server-auth.model.tsindex 377682af6e..ea22d36f96 100644--- a/server/core/types/plugins/register-server-auth.model.ts+++ b/server/core/types/plugins/register-server-auth.model.ts@@ -10,7 +10,7 @@ export interface RegisterServerAuthenticatedResult {// Update the user profile if it already exists// Default behaviour is no update// Introduced in PeerTube >= 5.1- userUpdater?: <T> (options: {+ userUpdater?: <T>(options: {fieldName: AuthenticatedResultUpdaterFieldNamecurrentValue: TnewValue: T@@ -68,5 +68,5 @@ export interface RegisterServerAuthExternalOptions extends RegisterServerAuthBas}export interface RegisterServerAuthExternalResult {- userAuthenticated (options: RegisterServerExternalAuthenticatedResult): void+ userAuthenticated(options: RegisterServerExternalAuthenticatedResult): void}diff --git a/server/core/types/sequelize.ts b/server/core/types/sequelize.tsindex cf0d040ae1..6c41812299 100644--- a/server/core/types/sequelize.ts+++ b/server/core/types/sequelize.ts@@ -4,7 +4,7 @@ import { Model } from 'sequelize'// Thanks to sequelize-typescript: https://github.com/RobinBuschmann/sequelize-typescriptexport type Diff<T extends string | symbol | number, U extends string | symbol | number> =- ({ [P in T]: P } & { [P in U]: never } & { [ x: string ]: never })[T]+ ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]export type Omit<T, K extends keyof T> = { [P in Diff<keyof T, K>]: T[P] }