2017-11-13 17:39:41 +01:00
|
|
|
import * as Bluebird from 'bluebird'
|
2017-11-20 11:19:23 +01:00
|
|
|
import * as Sequelize from 'sequelize'
|
|
|
|
import { AccountFollow, FollowState } from '../../../shared/models/accounts/follow.model'
|
2017-11-15 10:10:41 +01:00
|
|
|
import { ResultList } from '../../../shared/models/result-list.model'
|
|
|
|
import { AccountInstance } from './account-interface'
|
2017-11-09 17:51:58 +01:00
|
|
|
|
|
|
|
export namespace AccountFollowMethods {
|
2017-11-23 14:19:55 +01:00
|
|
|
export type LoadByAccountAndTarget = (
|
|
|
|
accountId: number,
|
|
|
|
targetAccountId: number,
|
|
|
|
t?: Sequelize.Transaction
|
|
|
|
) => Bluebird<AccountFollowInstance>
|
2017-11-15 10:10:41 +01:00
|
|
|
|
2017-11-20 11:19:23 +01:00
|
|
|
export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
|
|
|
|
export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
|
2017-11-15 10:10:41 +01:00
|
|
|
|
2017-11-16 11:08:25 +01:00
|
|
|
export type ListAcceptedFollowerUrlsForApi = (accountId: number[], start?: number, count?: number) => Promise< ResultList<string> >
|
|
|
|
export type ListAcceptedFollowingUrlsForApi = (accountId: number[], start?: number, count?: number) => Promise< ResultList<string> >
|
|
|
|
export type ListAcceptedFollowerSharedInboxUrls = (accountId: number[]) => Promise< ResultList<string> >
|
2017-11-20 11:19:23 +01:00
|
|
|
export type ToFormattedJSON = (this: AccountFollowInstance) => AccountFollow
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AccountFollowClass {
|
2017-11-13 17:39:41 +01:00
|
|
|
loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget
|
2017-11-15 10:10:41 +01:00
|
|
|
listFollowersForApi: AccountFollowMethods.ListFollowersForApi
|
|
|
|
listFollowingForApi: AccountFollowMethods.ListFollowingForApi
|
|
|
|
|
|
|
|
listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi
|
|
|
|
listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi
|
2017-11-16 11:08:25 +01:00
|
|
|
listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AccountFollowAttributes {
|
|
|
|
accountId: number
|
|
|
|
targetAccountId: number
|
2017-11-13 17:39:41 +01:00
|
|
|
state: FollowState
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> {
|
|
|
|
id: number
|
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-11-15 10:10:41 +01:00
|
|
|
|
|
|
|
AccountFollower?: AccountInstance
|
|
|
|
AccountFollowing?: AccountInstance
|
2017-11-20 11:19:23 +01:00
|
|
|
|
|
|
|
toFormattedJSON: AccountFollowMethods.ToFormattedJSON
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {}
|