From a15871560f80e07386c1dabb8370cd2664ecfd1f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 31 Jan 2020 16:56:52 +0100 Subject: Move to eslint --- server/typings/models/account/account-blocklist.ts | 6 ++- server/typings/models/account/account.ts | 42 +++++++++++------ server/typings/models/account/actor-follow.ts | 24 ++++++---- server/typings/models/account/actor.ts | 54 ++++++++++++++-------- server/typings/models/account/avatar.ts | 3 +- 5 files changed, 86 insertions(+), 43 deletions(-) (limited to 'server/typings/models/account') diff --git a/server/typings/models/account/account-blocklist.ts b/server/typings/models/account/account-blocklist.ts index c9cb55332..0d8bf11bd 100644 --- a/server/typings/models/account/account-blocklist.ts +++ b/server/typings/models/account/account-blocklist.ts @@ -12,7 +12,8 @@ export type MAccountBlocklist = Omit -export type MAccountBlocklistAccounts = MAccountBlocklist & +export type MAccountBlocklistAccounts = + MAccountBlocklist & Use<'ByAccount', MAccountDefault> & Use<'BlockedAccount', MAccountDefault> @@ -20,6 +21,7 @@ export type MAccountBlocklistAccounts = MAccountBlocklist & // Format for API or AP object -export type MAccountBlocklistFormattable = Pick & +export type MAccountBlocklistFormattable = + Pick & Use<'ByAccount', MAccountFormattable> & Use<'BlockedAccount', MAccountFormattable> diff --git a/server/typings/models/account/account.ts b/server/typings/models/account/account.ts index adb1f3689..7b826ee04 100644 --- a/server/typings/models/account/account.ts +++ b/server/typings/models/account/account.ts @@ -21,7 +21,8 @@ type Use = PickWith // ############################################################################ -export type MAccount = Omit // ############################################################################ @@ -34,62 +35,75 @@ export type MAccountUserId = Pick export type MAccountUrl = Use<'Actor', MActorUrl> export type MAccountAudience = Use<'Actor', MActorAudience> -export type MAccountIdActor = MAccountId & +export type MAccountIdActor = + MAccountId & Use<'Actor', MActor> -export type MAccountIdActorId = MAccountId & +export type MAccountIdActorId = + MAccountId & Use<'Actor', MActorId> // ############################################################################ // Default scope -export type MAccountDefault = MAccount & +export type MAccountDefault = + MAccount & Use<'Actor', MActorDefault> // Default with default association scopes -export type MAccountDefaultChannelDefault = MAccount & +export type MAccountDefaultChannelDefault = + MAccount & Use<'Actor', MActorDefault> & Use<'VideoChannels', MChannelDefault[]> // We don't need some actors attributes -export type MAccountLight = MAccount & +export type MAccountLight = + MAccount & Use<'Actor', MActorDefaultLight> // ############################################################################ // Full actor -export type MAccountActor = MAccount & +export type MAccountActor = + MAccount & Use<'Actor', MActor> // Full actor with server -export type MAccountServer = MAccount & +export type MAccountServer = + MAccount & Use<'Actor', MActorServer> // ############################################################################ // For API -export type MAccountSummary = FunctionProperties & +export type MAccountSummary = + FunctionProperties & Pick & Use<'Actor', MActorSummary> -export type MAccountSummaryBlocks = MAccountSummary & +export type MAccountSummaryBlocks = + MAccountSummary & Use<'BlockedAccounts', MAccountBlocklistId[]> -export type MAccountAPI = MAccount & +export type MAccountAPI = + MAccount & Use<'Actor', MActorAPI> // ############################################################################ // Format for API or AP object -export type MAccountSummaryFormattable = FunctionProperties & +export type MAccountSummaryFormattable = + FunctionProperties & Pick & Use<'Actor', MActorSummaryFormattable> -export type MAccountFormattable = FunctionProperties & +export type MAccountFormattable = + FunctionProperties & Pick & Use<'Actor', MActorFormattable> -export type MAccountAP = Pick & +export type MAccountAP = + Pick & Use<'Actor', MActorAP> diff --git a/server/typings/models/account/actor-follow.ts b/server/typings/models/account/actor-follow.ts index f44157eba..5d0c03c8d 100644 --- a/server/typings/models/account/actor-follow.ts +++ b/server/typings/models/account/actor-follow.ts @@ -20,22 +20,26 @@ export type MActorFollow = Omit // ############################################################################ // With actors or actors default -export type MActorFollowActors = MActorFollow & +export type MActorFollowActors = + MActorFollow & Use<'ActorFollower', MActor> & Use<'ActorFollowing', MActor> -export type MActorFollowActorsDefault = MActorFollow & +export type MActorFollowActorsDefault = + MActorFollow & Use<'ActorFollower', MActorDefault> & Use<'ActorFollowing', MActorDefault> -export type MActorFollowFull = MActorFollow & +export type MActorFollowFull = + MActorFollow & Use<'ActorFollower', MActorDefaultAccountChannel> & Use<'ActorFollowing', MActorDefaultAccountChannel> @@ -43,20 +47,24 @@ export type MActorFollowFull = MActorFollow & // For subscriptions -type SubscriptionFollowing = MActorDefault & +type SubscriptionFollowing = + MActorDefault & PickWith -export type MActorFollowActorsDefaultSubscription = MActorFollow & +export type MActorFollowActorsDefaultSubscription = + MActorFollow & Use<'ActorFollower', MActorDefault> & Use<'ActorFollowing', SubscriptionFollowing> -export type MActorFollowSubscriptions = MActorFollow & +export type MActorFollowSubscriptions = + MActorFollow & Use<'ActorFollowing', MActorChannelAccountActor> // ############################################################################ // Format for API or AP object -export type MActorFollowFormattable = Pick & +export type MActorFollowFormattable = + Pick & Use<'ActorFollower', MActorFormattable> & Use<'ActorFollowing', MActorFormattable> diff --git a/server/typings/models/account/actor.ts b/server/typings/models/account/actor.ts index ee4ece755..1160e84cb 100644 --- a/server/typings/models/account/actor.ts +++ b/server/typings/models/account/actor.ts @@ -31,18 +31,23 @@ export type MActorLight = Omit export type MActorHost = Use<'Server', MServerHost> export type MActorRedundancyAllowedOpt = PickWithOpt -export type MActorDefaultLight = MActorLight & +export type MActorDefaultLight = + MActorLight & Use<'Server', MServerHost> & Use<'Avatar', MAvatar> -export type MActorAccountId = MActor & +export type MActorAccountId = + MActor & Use<'Account', MAccountId> -export type MActorAccountIdActor = MActor & +export type MActorAccountIdActor = + MActor & Use<'Account', MAccountIdActor> -export type MActorChannelId = MActor & +export type MActorChannelId = + MActor & Use<'VideoChannel', MChannelId> -export type MActorChannelIdActor = MActor & +export type MActorChannelIdActor = + MActor & Use<'VideoChannel', MChannelIdActor> export type MActorAccountChannelId = MActorAccountId & MActorChannelId @@ -52,38 +57,45 @@ export type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelId // Include raw account/channel/server -export type MActorAccount = MActor & +export type MActorAccount = + MActor & Use<'Account', MAccount> -export type MActorChannel = MActor & +export type MActorChannel = + MActor & Use<'VideoChannel', MChannel> export type MActorDefaultAccountChannel = MActorDefault & MActorAccount & MActorChannel -export type MActorServer = MActor & +export type MActorServer = + MActor & Use<'Server', MServer> // ############################################################################ // Complex actor associations -export type MActorDefault = MActor & +export type MActorDefault = + MActor & Use<'Server', MServer> & Use<'Avatar', MAvatar> // Actor with channel that is associated to an account and its actor // Actor -> VideoChannel -> Account -> Actor -export type MActorChannelAccountActor = MActor & +export type MActorChannelAccountActor = + MActor & Use<'VideoChannel', MChannelAccountActor> -export type MActorFull = MActor & +export type MActorFull = + MActor & Use<'Server', MServer> & Use<'Avatar', MAvatar> & Use<'Account', MAccount> & Use<'VideoChannel', MChannelAccountActor> // Same than ActorFull, but the account and the channel have their actor -export type MActorFullActor = MActor & +export type MActorFullActor = + MActor & Use<'Server', MServer> & Use<'Avatar', MAvatar> & Use<'Account', MAccountDefault> & @@ -93,29 +105,35 @@ export type MActorFullActor = MActor & // API -export type MActorSummary = FunctionProperties & +export type MActorSummary = + FunctionProperties & Pick & Use<'Server', MServerHost> & Use<'Avatar', MAvatar> -export type MActorSummaryBlocks = MActorSummary & +export type MActorSummaryBlocks = + MActorSummary & Use<'Server', MServerHostBlocks> -export type MActorAPI = Omit // ############################################################################ // Format for API or AP object -export type MActorSummaryFormattable = FunctionProperties & +export type MActorSummaryFormattable = + FunctionProperties & Pick & Use<'Server', MServerHost> & Use<'Avatar', MAvatarFormattable> -export type MActorFormattable = MActorSummaryFormattable & +export type MActorFormattable = + MActorSummaryFormattable & Pick & Use<'Server', MServerHost & Partial>> -export type MActorAP = MActor & +export type MActorAP = + MActor & Use<'Avatar', MAvatar> diff --git a/server/typings/models/account/avatar.ts b/server/typings/models/account/avatar.ts index 8af6cc787..21b47180f 100644 --- a/server/typings/models/account/avatar.ts +++ b/server/typings/models/account/avatar.ts @@ -7,5 +7,6 @@ export type MAvatar = AvatarModel // Format for API or AP object -export type MAvatarFormattable = FunctionProperties & +export type MAvatarFormattable = + FunctionProperties & Pick -- cgit v1.2.3