diff options
Diffstat (limited to 'server/typings/models/account')
-rw-r--r-- | server/typings/models/account/account-blocklist.ts | 11 | ||||
-rw-r--r-- | server/typings/models/account/account.ts | 56 | ||||
-rw-r--r-- | server/typings/models/account/actor-follow.ts | 27 | ||||
-rw-r--r-- | server/typings/models/account/actor.ts | 74 | ||||
-rw-r--r-- | server/typings/models/account/avatar.ts | 3 | ||||
-rw-r--r-- | server/typings/models/account/index.d.ts | 5 |
6 files changed, 176 insertions, 0 deletions
diff --git a/server/typings/models/account/account-blocklist.ts b/server/typings/models/account/account-blocklist.ts new file mode 100644 index 000000000..6d1771de8 --- /dev/null +++ b/server/typings/models/account/account-blocklist.ts | |||
@@ -0,0 +1,11 @@ | |||
1 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' | ||
2 | import { PickWith } from '../../utils' | ||
3 | import { MAccountDefault } from './account' | ||
4 | |||
5 | export type MAccountBlocklist = Omit<AccountBlocklistModel, 'ByAccount' | 'BlockedAccount'> | ||
6 | |||
7 | export type MAccountBlocklistId = Pick<AccountBlocklistModel, 'id'> | ||
8 | |||
9 | export type MAccountBlocklistAccounts = MAccountBlocklist & | ||
10 | PickWith<AccountBlocklistModel, 'ByAccount', MAccountDefault> & | ||
11 | PickWith<AccountBlocklistModel, 'BlockedAccount', MAccountDefault> | ||
diff --git a/server/typings/models/account/account.ts b/server/typings/models/account/account.ts new file mode 100644 index 000000000..f3646d510 --- /dev/null +++ b/server/typings/models/account/account.ts | |||
@@ -0,0 +1,56 @@ | |||
1 | import { AccountModel } from '../../../models/account/account' | ||
2 | import { | ||
3 | MActor, | ||
4 | MActorAccountChannelId, | ||
5 | MActorAPI, | ||
6 | MActorAudience, | ||
7 | MActorDefault, | ||
8 | MActorDefaultLight, MActorId, | ||
9 | MActorServer, | ||
10 | MActorSummary, | ||
11 | MActorUrl | ||
12 | } from './actor' | ||
13 | import { PickWith } from '../../utils' | ||
14 | import { MAccountBlocklistId } from './account-blocklist' | ||
15 | import { MChannelDefault } from '@server/typings/models' | ||
16 | |||
17 | export type MAccountId = Pick<AccountModel, 'id'> | ||
18 | export type MAccountIdActor = MAccountId & | ||
19 | PickWith<AccountModel, 'Actor', MActorAccountChannelId> | ||
20 | export type MAccountIdActorId = MAccountId & | ||
21 | PickWith<AccountModel, 'Actor', MActorId> | ||
22 | |||
23 | export type MAccount = Omit<AccountModel, 'Actor' | 'User' | 'Application' | 'VideoChannels' | 'VideoPlaylists' | | ||
24 | 'VideoComments' | 'BlockedAccounts'> | ||
25 | |||
26 | // Default scope | ||
27 | export type MAccountDefault = MAccount & | ||
28 | PickWith<AccountModel, 'Actor', MActorDefault> | ||
29 | |||
30 | export type MAccountDefaultChannelDefault = MAccountDefault & | ||
31 | PickWith<AccountModel, 'VideoChannels', MChannelDefault[]> | ||
32 | |||
33 | export type MAccountLight = MAccount & | ||
34 | PickWith<AccountModel, 'Actor', MActorDefaultLight> | ||
35 | |||
36 | export type MAccountUserId = Pick<MAccount, 'userId'> | ||
37 | |||
38 | export type MAccountActor = MAccount & | ||
39 | PickWith<AccountModel, 'Actor', MActor> | ||
40 | export type MAccountServer = MAccountActor & | ||
41 | PickWith<AccountModel, 'Actor', MActorServer> | ||
42 | |||
43 | export type MAccountActorDefault = MAccount & | ||
44 | PickWith<AccountModel, 'Actor', MActorDefault> | ||
45 | |||
46 | export type MAccountSummary = Pick<MAccount, 'id' | 'name'> & | ||
47 | PickWith<AccountModel, 'Actor', MActorSummary> | ||
48 | |||
49 | export type MAccountBlocks = MAccountSummary & | ||
50 | PickWith<AccountModel, 'BlockedAccounts', MAccountBlocklistId[]> | ||
51 | |||
52 | export type MAccountAPI = MAccountDefault & | ||
53 | PickWith<AccountModel, 'Actor', MActorAPI> | ||
54 | |||
55 | export type MAccountUrl = PickWith<AccountModel, 'Actor', MActorUrl> | ||
56 | export type MAccountAudience = PickWith<AccountModel, 'Actor', MActorAudience> | ||
diff --git a/server/typings/models/account/actor-follow.ts b/server/typings/models/account/actor-follow.ts new file mode 100644 index 000000000..96c53d857 --- /dev/null +++ b/server/typings/models/account/actor-follow.ts | |||
@@ -0,0 +1,27 @@ | |||
1 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' | ||
2 | import { MActor, MActorAccountChannel, MActorChannel, MActorChannelAccount, MActorDefault, MActorHost, MActorUsername } from './actor' | ||
3 | import { PickWith } from '../../utils' | ||
4 | |||
5 | export type MActorFollow = Omit<ActorFollowModel, 'ActorFollower' | 'ActorFollowing'> | ||
6 | |||
7 | export type MActorFollowActors = MActorFollow & | ||
8 | PickWith<ActorFollowModel, 'ActorFollower', MActor> & | ||
9 | PickWith<ActorFollowModel, 'ActorFollowing', MActor> | ||
10 | |||
11 | export type MActorFollowActorsDefault = MActorFollow & | ||
12 | PickWith<ActorFollowModel, 'ActorFollower', MActorDefault> & | ||
13 | PickWith<ActorFollowModel, 'ActorFollowing', MActorDefault> | ||
14 | |||
15 | export type MActorFollowActorsDefaultSubscription = MActorFollow & | ||
16 | PickWith<ActorFollowModel, 'ActorFollower', MActorDefault> & | ||
17 | PickWith<ActorFollowModel, 'ActorFollowing', MActorDefault & MActorChannel> | ||
18 | |||
19 | export type MActorFollowFull = MActorFollow & | ||
20 | PickWith<ActorFollowModel, 'ActorFollower', MActorAccountChannel> & | ||
21 | PickWith<ActorFollowModel, 'ActorFollowing', MActorAccountChannel> | ||
22 | |||
23 | export type MActorFollowFollowingHost = MActorFollow & | ||
24 | PickWith<ActorFollowModel, 'ActorFollowing', MActorUsername & MActorHost> | ||
25 | |||
26 | export type MActorFollowSubscriptions = MActorFollow & | ||
27 | PickWith<ActorFollowModel, 'ActorFollowing', MActorChannelAccount> | ||
diff --git a/server/typings/models/account/actor.ts b/server/typings/models/account/actor.ts new file mode 100644 index 000000000..f3e752a98 --- /dev/null +++ b/server/typings/models/account/actor.ts | |||
@@ -0,0 +1,74 @@ | |||
1 | import { ActorModel } from '../../../models/activitypub/actor' | ||
2 | import { PickWith } from '../../utils' | ||
3 | import { MAccount, MAccountActorDefault, MAccountId, MAccountIdActor } from './account' | ||
4 | import { MServerHost, MServerHostBlocks, MServer } from '../server' | ||
5 | import { MAvatar } from './avatar' | ||
6 | import { MChannel, MChannelAccountActor, MChannelActorAccountDefault, MChannelId, MChannelIdActor } from '../video' | ||
7 | |||
8 | export type MActor = Omit<ActorModel, 'Account' | 'VideoChannel' | 'ActorFollowing' | 'Avatar' | 'ActorFollowers' | 'Server'> | ||
9 | |||
10 | export type MActorUrl = Pick<MActor, 'url'> | ||
11 | export type MActorId = Pick<MActor, 'id'> | ||
12 | export type MActorUsername = Pick<MActor, 'preferredUsername'> | ||
13 | export type MActorHost = PickWith<ActorModel, 'Server', MServerHost> | ||
14 | |||
15 | export type MActorFollowersUrl = Pick<MActor, 'followersUrl'> | ||
16 | export type MActorAudience = MActorUrl & MActorFollowersUrl | ||
17 | |||
18 | export type MActorLight = Omit<MActor, 'privateKey' | 'privateKey'> | ||
19 | |||
20 | export type MActorDefaultLight = MActorLight & | ||
21 | MActorHost & | ||
22 | PickWith<ActorModel, 'Avatar', MAvatar> | ||
23 | |||
24 | export type MActorAccountId = MActor & | ||
25 | PickWith<ActorModel, 'Account', MAccountId> | ||
26 | export type MActorAccountIdActor = MActor & | ||
27 | PickWith<ActorModel, 'Account', MAccountIdActor> | ||
28 | |||
29 | export type MActorChannelId = MActor & | ||
30 | PickWith<ActorModel, 'VideoChannel', MChannelId> | ||
31 | export type MActorChannelIdActor = MActor & | ||
32 | PickWith<ActorModel, 'VideoChannel', MChannelIdActor> | ||
33 | |||
34 | export type MActorAccountChannelId = MActorAccountId & MActorChannelId | ||
35 | export type MActorAccountChannelIdActor = MActorAccountIdActor & MActorChannelIdActor | ||
36 | |||
37 | export type MActorAccount = MActor & | ||
38 | PickWith<ActorModel, 'Account', MAccount> | ||
39 | |||
40 | export type MActorChannel = MActor & | ||
41 | PickWith<ActorModel, 'VideoChannel', MChannel> | ||
42 | |||
43 | export type MActorAccountChannel = MActorAccount & MActorChannel | ||
44 | |||
45 | export type MActorChannelAccount = MActor & | ||
46 | PickWith<ActorModel, 'VideoChannel', MChannelAccountActor> | ||
47 | |||
48 | export type MActorServer = MActor & | ||
49 | PickWith<ActorModel, 'Server', MServer> | ||
50 | |||
51 | export type MActorDefault = MActorServer & | ||
52 | PickWith<ActorModel, 'Avatar', MAvatar> | ||
53 | |||
54 | export type MActorFull = MActorDefault & | ||
55 | PickWith<ActorModel, 'Account', MAccount> & | ||
56 | PickWith<ActorModel, 'VideoChannel', MChannelAccountActor> | ||
57 | |||
58 | export type MActorFullActor = MActorDefault & | ||
59 | PickWith<ActorModel, 'Account', MAccountActorDefault> & | ||
60 | PickWith<ActorModel, 'VideoChannel', MChannelActorAccountDefault> | ||
61 | |||
62 | export type MActorSummary = Pick<MActor, 'id' | 'preferredUsername' | 'url' | 'serverId' | 'avatarId'> & | ||
63 | MActorHost & | ||
64 | PickWith<ActorModel, 'Avatar', MAvatar> | ||
65 | |||
66 | export type MActorSummaryBlocks = Omit<MActorSummary, 'Server'> & | ||
67 | PickWith<ActorModel, 'Server', MServerHostBlocks> | ||
68 | |||
69 | export type MActorFollowerException = Pick<ActorModel, 'sharedInboxUrl' | 'inboxUrl'> | ||
70 | |||
71 | export type MActorAPI = Omit<MActorDefault, 'publicKey' | 'privateKey' | 'inboxUrl' | 'outboxUrl' | 'sharedInboxUrl' | | ||
72 | 'followersUrl' | 'followingUrl' | 'url' | 'createdAt' | 'updatedAt'> | ||
73 | |||
74 | export type MActorSignature = MActorAccountChannelId | ||
diff --git a/server/typings/models/account/avatar.ts b/server/typings/models/account/avatar.ts new file mode 100644 index 000000000..257c48bfc --- /dev/null +++ b/server/typings/models/account/avatar.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | import { AvatarModel } from '../../../models/avatar/avatar' | ||
2 | |||
3 | export type MAvatar = AvatarModel | ||
diff --git a/server/typings/models/account/index.d.ts b/server/typings/models/account/index.d.ts new file mode 100644 index 000000000..513c09c40 --- /dev/null +++ b/server/typings/models/account/index.d.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export * from './account' | ||
2 | export * from './account-blocklist' | ||
3 | export * from './actor' | ||
4 | export * from './actor-follow' | ||
5 | export * from './avatar' | ||