X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftypings%2Fmodels%2Fuser%2Fuser.ts;h=6ac19c20b615add1e4b7ad472de6f77bfa2a6259;hb=26469f9ed85f5e7d67ccecaa820f33e37179b76a;hp=466cde33b890bf41525eeffe67190bf3fe37f4f1;hpb=0283eaac2a8e73006c66df3cf5bb9012e37450e5;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/typings/models/user/user.ts b/server/typings/models/user/user.ts index 466cde33b..6ac19c20b 100644 --- a/server/typings/models/user/user.ts +++ b/server/typings/models/user/user.ts @@ -1,7 +1,18 @@ import { UserModel } from '../../../models/account/user' -import { PickWith } from '../../utils' -import { MAccount, MAccountDefault, MAccountDefaultChannelDefault, MAccountId, MAccountIdActorId, MAccountUrl } from '../account' -import { MNotificationSetting } from './user-notification-setting' +import { PickWith, PickWithOpt } from '../../utils' +import { + MAccount, + MAccountDefault, + MAccountDefaultChannelDefault, + MAccountFormattable, + MAccountId, + MAccountIdActorId, + MAccountUrl +} from '../account' +import { MNotificationSetting, MNotificationSettingFormattable } from './user-notification-setting' +import { AccountModel } from '@server/models/account/account' +import { MChannelFormattable } from '../video/video-channels' +import { MVideoPlaylist } from '@server/typings/models' type Use = PickWith @@ -11,6 +22,7 @@ export type MUser = Omit // ############################################################################ @@ -49,3 +61,18 @@ export type MUserNotifSettingAccount = MUser & export type MUserDefault = MUser & Use<'NotificationSetting', MNotificationSetting> & Use<'Account', MAccountDefault> + +// ############################################################################ + +// Format for API or AP object + +type MAccountWithChannels = MAccountFormattable & PickWithOpt +type MAccountWithChannelsAndSpecialPlaylists = MAccountWithChannels & + PickWithOpt + +export type MUserFormattable = MUserQuotaUsed & + Use<'Account', MAccountWithChannels> & + PickWithOpt + +export type MMyUserFormattable = MUserFormattable & + Use<'Account', MAccountWithChannelsAndSpecialPlaylists>