1
0
Fork 0

Format server type models

This commit is contained in:
Chocobozzz 2025-02-21 07:50:38 +01:00
parent 0bf17d869c
commit de5adc09b2
No known key found for this signature in database
GPG key ID: 583A612D890159BE
41 changed files with 712 additions and 646 deletions

View file

@ -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 file

View file

@ -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[] :
never
interface ObjectConstructor {
keys<T> (o: T): ObjectKeys<T>
keys<T>(o: T): ObjectKeys<T>
}

View file

@ -16,5 +16,5 @@ export type MAbuseMessageId = Pick<AbuseModel, 'id'>
// Format for API
export type MAbuseMessageFormattable =
MAbuseMessage &
Use<'Account', MAccountFormattable>
& MAbuseMessage
& Use<'Account', MAccountFormattable>

View file

@ -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 object
export 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>

View file

@ -13,15 +13,15 @@ export type MAccountBlocklist = Omit<AccountBlocklistModel, 'ByAccount' | 'Block
export 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 object
export type MAccountBlocklistFormattable =
Pick<MAccountBlocklist, 'createdAt'> &
Use<'ByAccount', MAccountFormattable> &
Use<'BlockedAccount', MAccountFormattable>
& Pick<MAccountBlocklist, 'createdAt'>
& Use<'ByAccount', MAccountFormattable>
& Use<'BlockedAccount', MAccountFormattable>

View file

@ -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 scope
export type MAccountDefault =
MAccount &
Use<'Actor', MActorDefault>
& MAccount
& Use<'Actor', MActorDefault>
// Default with default association scopes
export type MAccountDefaultChannelDefault =
MAccount &
Use<'Actor', MActorDefault> &
Use<'VideoChannels', MChannelDefault[]>
& MAccount
& Use<'Actor', MActorDefault>
& Use<'VideoChannels', MChannelDefault[]>
// We don't need some actors attributes
export type MAccountLight =
MAccount &
Use<'Actor', MActorDefaultLight>
& MAccount
& Use<'Actor', MActorDefaultLight>
// ############################################################################
// Full actor
export type MAccountActor =
MAccount &
Use<'Actor', MActor>
& MAccount
& Use<'Actor', MActor>
export type MAccountHost =
MAccount &
Use<'Actor', MActorHost>
& MAccount
& Use<'Actor', MActorHost>
// ############################################################################
// For API
export 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 object
export 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>

View file

@ -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 default
export 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 subscriptions
export 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 object
export 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>

View file

@ -10,5 +10,5 @@ export type MActorImagePath = Pick<MActorImage, 'type' | 'filename' | 'getStatic
// Format for API or AP object
export type MActorImageFormattable =
FunctionProperties<MActorImage> &
Pick<MActorImage, 'type' | 'getStaticPath' | 'width' | 'filename' | 'createdAt' | 'updatedAt'>
& FunctionProperties<MActorImage>
& Pick<MActorImage, 'type' | 'getStaticPath' | 'width' | 'filename' | 'createdAt' | 'updatedAt'>

View file

@ -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 & MActorChannelId
export type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelIdActor
@ -63,108 +63,117 @@ export type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelId
// Include raw account/channel/server
export 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 & MActorChannel
export type MActorServerLight =
MActorLight &
Use<'Server', MServer>
& MActorLight
& Use<'Server', MServer>
// ############################################################################
// Complex actor associations
export 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 -> Actor
export 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 actor
export 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>
// ############################################################################
// API
export 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>
& MActorSummary
& Use<'Server', MServerHostBlocks>
export type MActorAPI =
Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' |
'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'>
export type MActorAPI = Omit<
MActorDefault,
| 'publicKey'
| 'privateKey'
| 'inboxUrl'
| 'outboxUrl'
| 'sharedInboxUrl'
| 'followersUrl'
| 'followingUrl'
| 'url'
| 'createdAt'
| 'updatedAt'
>
// ############################################################################
// Format for API or AP object
export 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 = MActorAPBase
export type MActorAPChannel =
MActorAPBase &
Use<'Banners', MActorImage[]>
& MActorAPBase
& Use<'Banners', MActorImage[]>

View file

@ -11,5 +11,5 @@ export type MCommentAutomaticTag = Omit<CommentAutomaticTagModel, 'Account' | 'V
// ############################################################################
export type MCommentAutomaticTagWithTag =
MCommentAutomaticTag &
Use<'AutomaticTag', MAutomaticTag>
& MCommentAutomaticTag
& Use<'AutomaticTag', MAutomaticTag>

View file

@ -11,5 +11,5 @@ export type MVideoAutomaticTag = Omit<VideoAutomaticTagModel, 'Account' | 'Video
// ############################################################################
export type MVideoAutomaticTagWithTag =
MVideoAutomaticTag &
Use<'AutomaticTag', MAutomaticTag>
& MVideoAutomaticTag
& Use<'AutomaticTag', MAutomaticTag>

View file

@ -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 }

View file

@ -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>

View file

@ -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'
>

View file

@ -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 object
export type MServerBlocklistFormattable =
Pick<MServerBlocklist, 'createdAt'> &
Use<'ByAccount', MAccountFormattable> &
Use<'BlockedServer', MServerFormattable>
& Pick<MServerBlocklist, 'createdAt'>
& Use<'ByAccount', MAccountFormattable>
& Use<'BlockedServer', MServerFormattable>

View file

@ -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 object
export type MServerFormattable =
FunctionProperties<MServer> &
Pick<MServer, 'host'>
& FunctionProperties<MServer>
& Pick<MServer, 'host'>

View file

@ -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>

View file

@ -11,5 +11,5 @@ export type MRegistration = Omit<UserRegistrationModel, 'User'>
// ############################################################################
export type MRegistrationFormattable =
MRegistration &
Use<'User', MUserId>
& MRegistration
& Use<'User', MUserId>

View file

@ -30,45 +30,45 @@ export type MUserId = Pick<UserModel, 'id'>
// With account
export 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 channel
export type MUserNotifSettingChannelDefault =
MUser &
Use<'NotificationSetting', MNotificationSetting> &
Use<'Account', MAccountDefaultChannelDefault>
& MUser
& Use<'NotificationSetting', MNotificationSetting>
& Use<'Account', MAccountDefaultChannelDefault>
// With notification settings
export 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 scope
export 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>

View file

@ -10,10 +10,10 @@ type Use<K extends keyof LocalVideoViewerModel, M> = PickWith<LocalVideoViewerMo
export 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[]>

View file

@ -11,5 +11,5 @@ export type MStoryboard = Omit<StoryboardModel, 'Video'>
// ############################################################################
export type MStoryboardVideo =
MStoryboard &
Use<'Video', MVideo>
& MStoryboard
& Use<'Video', MVideo>

View file

@ -11,5 +11,5 @@ export type MThumbnail = Omit<ThumbnailModel, 'Video' | 'VideoPlaylist'>
// ############################################################################
export type MThumbnailVideo =
MThumbnail &
Use<'Video', MVideo>
& MThumbnail
& Use<'Video', MVideo>

View file

@ -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 object
export type MVideoBlacklistFormattable =
MVideoBlacklist &
Use<'Video', MVideoFormattable>
& MVideoBlacklist
& Use<'Video', MVideoFormattable>

View file

@ -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 object
export type MVideoCaptionFormattable =
MVideoCaption &
Pick<MVideoCaption, 'language'> &
Use<'Video', MVideoOwned & MVideoUUID>
& MVideoCaption
& Pick<MVideoCaption, 'language'>
& Use<'Video', MVideoOwned & MVideoUUID>

View file

@ -10,17 +10,17 @@ type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwn
export 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 object
export 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>

View file

@ -7,11 +7,11 @@ type Use<K extends keyof VideoChannelSyncModel, M> = PickWith<VideoChannelSyncMo
export 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>
& MChannelSync

View file

@ -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 scope
export type MChannelDefault =
MChannel &
Use<'Actor', MActorDefault>
& MChannel
& Use<'Actor', MActorDefault>
export type MChannelBannerDefault =
MChannel &
Use<'Actor', MActorDefaultBanner>
& MChannel
& Use<'Actor', MActorDefaultBanner>
// ############################################################################
// Not all association attributes
export 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 associations
export 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 associations
export type MChannelVideos =
MChannel &
Use<'Videos', MVideo[]>
& MChannel
& Use<'Videos', MVideo[]>
// ############################################################################
// For API
export 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 object
export 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>

View file

@ -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 object
export 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>

View file

@ -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.videoStreamingPlaylistId

View file

@ -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 & MVideoThumbnail
export 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 object
export type MVideoImportFormattable =
MVideoImport &
PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>
& MVideoImport
& PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>

View file

@ -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>

View file

@ -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>

View file

@ -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 object
export type MVideoPlaylistElementFormattable =
MVideoPlaylistElement &
Use<'Video', MVideoFormattable>
& MVideoPlaylistElement
& Use<'Video', MVideoFormattable>
export type MVideoPlaylistElementAP =
MVideoPlaylistElement &
Use<'Video', MVideoUrl>
& MVideoPlaylistElement
& Use<'Video', MVideoUrl>

View file

@ -15,9 +15,9 @@ export type MVideoPlaylist = Omit<VideoPlaylistModel, 'OwnerAccount' | 'VideoCha
export 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 elements
export type MVideoPlaylistSummaryWithElements =
MVideoPlaylistSummary &
Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]>
& MVideoPlaylistSummary
& Use<'VideoPlaylistElements', MVideoPlaylistElementLight[]>
// ############################################################################
// With account
export type MVideoPlaylistOwner =
MVideoPlaylist &
Use<'OwnerAccount', MAccount>
& MVideoPlaylist
& Use<'OwnerAccount', MAccount>
export type MVideoPlaylistOwnerDefault =
MVideoPlaylist &
Use<'OwnerAccount', MAccountDefault>
& MVideoPlaylist
& Use<'OwnerAccount', MAccountDefault>
// ############################################################################
// With thumbnail
export 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 channel
export type MVideoPlaylistAccountChannelDefault =
MVideoPlaylist &
Use<'OwnerAccount', MAccountDefault> &
Use<'VideoChannel', MChannelDefault>
& MVideoPlaylist
& Use<'OwnerAccount', MAccountDefault>
& Use<'VideoChannel', MChannelDefault>
// ############################################################################
// With all associations
export type MVideoPlaylistFull =
MVideoPlaylistVideosLength &
Use<'OwnerAccount', MAccountDefault> &
Use<'VideoChannel', MChannelDefault> &
Use<'Thumbnail', MThumbnail>
& MVideoPlaylistVideosLength
& Use<'OwnerAccount', MAccountDefault>
& Use<'VideoChannel', MChannelDefault>
& Use<'Thumbnail', MThumbnail>
// ############################################################################
// For API
export 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 object
export 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>

View file

@ -10,22 +10,22 @@ type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateMo
export 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 object
export type MAccountVideoRateFormattable =
Pick<MAccountVideoRate, 'type'> &
Use<'Video', MVideoFormattable>
& Pick<MAccountVideoRate, 'type'>
& Use<'Video', MVideoFormattable>

View file

@ -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 object
export type MVideoRedundancyAP =
MVideoRedundancy &
PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>
& MVideoRedundancy
& PickWithOpt<VideoRedundancyModel, 'VideoStreamingPlaylist', PickWith<VideoStreamingPlaylistModel, 'Video', MVideoUrl>>

View file

@ -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>

View file

@ -11,32 +11,32 @@ type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreami
export 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).videoId

View file

@ -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 model
export 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 attributes
export 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 associations
export 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 account
export 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>
// ############################################################################
// API
export 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 object
export 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[]>

View file

@ -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: AuthenticatedResultUpdaterFieldName
currentValue: T
newValue: T
@ -68,5 +68,5 @@ export interface RegisterServerAuthExternalOptions extends RegisterServerAuthBas
}
export interface RegisterServerAuthExternalResult {
userAuthenticated (options: RegisterServerExternalAuthenticatedResult): void
userAuthenticated(options: RegisterServerExternalAuthenticatedResult): void
}

View file

@ -4,7 +4,7 @@ import { Model } from 'sequelize'
// Thanks to sequelize-typescript: https://github.com/RobinBuschmann/sequelize-typescript
export 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] }