]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account-follow-interface.ts
Fix update host script
[github/Chocobozzz/PeerTube.git] / server / models / account / account-follow-interface.ts
index efdff915e1890da389bcff2d9807d62bee2516e1..21fda98cecc3bbc681df420bbf7acea412f1806f 100644 (file)
@@ -1,13 +1,28 @@
 import * as Sequelize from 'sequelize'
 import * as Bluebird from 'bluebird'
 import { FollowState } from '../../../shared/models/accounts/follow.model'
+import { ResultList } from '../../../shared/models/result-list.model'
+import { AccountInstance } from './account-interface'
 
 export namespace AccountFollowMethods {
   export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance>
+
+  export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> >
+  export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> >
+
+  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> >
 }
 
 export interface AccountFollowClass {
   loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget
+  listFollowersForApi: AccountFollowMethods.ListFollowersForApi
+  listFollowingForApi: AccountFollowMethods.ListFollowingForApi
+
+  listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi
+  listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi
+  listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls
 }
 
 export interface AccountFollowAttributes {
@@ -20,6 +35,9 @@ export interface AccountFollowInstance extends AccountFollowClass, AccountFollow
   id: number
   createdAt: Date
   updatedAt: Date
+
+  AccountFollower?: AccountInstance
+  AccountFollowing?: AccountInstance
 }
 
 export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {}