diff options
Diffstat (limited to 'server/models/account/account-follow-interface.ts')
-rw-r--r-- | server/models/account/account-follow-interface.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/models/account/account-follow-interface.ts b/server/models/account/account-follow-interface.ts index efdff915e..413dad190 100644 --- a/server/models/account/account-follow-interface.ts +++ b/server/models/account/account-follow-interface.ts | |||
@@ -1,13 +1,26 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import * as Bluebird from 'bluebird' | 2 | import * as Bluebird from 'bluebird' |
3 | import { FollowState } from '../../../shared/models/accounts/follow.model' | 3 | import { FollowState } from '../../../shared/models/accounts/follow.model' |
4 | import { ResultList } from '../../../shared/models/result-list.model' | ||
5 | import { AccountInstance } from './account-interface' | ||
4 | 6 | ||
5 | export namespace AccountFollowMethods { | 7 | export namespace AccountFollowMethods { |
6 | export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance> | 8 | export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance> |
9 | |||
10 | export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> > | ||
11 | export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> > | ||
12 | |||
13 | export type ListAcceptedFollowerUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> > | ||
14 | export type ListAcceptedFollowingUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> > | ||
7 | } | 15 | } |
8 | 16 | ||
9 | export interface AccountFollowClass { | 17 | export interface AccountFollowClass { |
10 | loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget | 18 | loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget |
19 | listFollowersForApi: AccountFollowMethods.ListFollowersForApi | ||
20 | listFollowingForApi: AccountFollowMethods.ListFollowingForApi | ||
21 | |||
22 | listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi | ||
23 | listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi | ||
11 | } | 24 | } |
12 | 25 | ||
13 | export interface AccountFollowAttributes { | 26 | export interface AccountFollowAttributes { |
@@ -20,6 +33,9 @@ export interface AccountFollowInstance extends AccountFollowClass, AccountFollow | |||
20 | id: number | 33 | id: number |
21 | createdAt: Date | 34 | createdAt: Date |
22 | updatedAt: Date | 35 | updatedAt: Date |
36 | |||
37 | AccountFollower?: AccountInstance | ||
38 | AccountFollowing?: AccountInstance | ||
23 | } | 39 | } |
24 | 40 | ||
25 | export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {} | 41 | export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {} |