aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/account-follow-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-12 17:53:50 +0100
committerChocobozzz <me@florianbigard.com>2017-12-13 16:50:33 +0100
commit3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch)
treee5ca358287fca6ecacce83defcf23af1e8e9f419 /server/models/account/account-follow-interface.ts
parentc893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff)
downloadPeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip
Move models to typescript-sequelize
Diffstat (limited to 'server/models/account/account-follow-interface.ts')
-rw-r--r--server/models/account/account-follow-interface.ts60
1 files changed, 0 insertions, 60 deletions
diff --git a/server/models/account/account-follow-interface.ts b/server/models/account/account-follow-interface.ts
deleted file mode 100644
index 7975a46f3..000000000
--- a/server/models/account/account-follow-interface.ts
+++ /dev/null
@@ -1,60 +0,0 @@
1import * as Bluebird from 'bluebird'
2import * as Sequelize from 'sequelize'
3import { AccountFollow, FollowState } from '../../../shared/models/accounts/follow.model'
4import { ResultList } from '../../../shared/models/result-list.model'
5import { AccountInstance } from './account-interface'
6
7export namespace AccountFollowMethods {
8 export type LoadByAccountAndTarget = (
9 accountId: number,
10 targetAccountId: number,
11 t?: Sequelize.Transaction
12 ) => Bluebird<AccountFollowInstance>
13
14 export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
15 export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountFollowInstance>>
16
17 export type ListAcceptedFollowerUrlsForApi = (
18 accountId: number[],
19 t: Sequelize.Transaction,
20 start?: number,
21 count?: number
22 ) => Promise< ResultList<string> >
23 export type ListAcceptedFollowingUrlsForApi = (
24 accountId: number[],
25 t: Sequelize.Transaction,
26 start?: number,
27 count?: number
28 ) => Promise< ResultList<string> >
29 export type ListAcceptedFollowerSharedInboxUrls = (accountId: number[], t: Sequelize.Transaction) => Promise< ResultList<string> >
30 export type ToFormattedJSON = (this: AccountFollowInstance) => AccountFollow
31}
32
33export interface AccountFollowClass {
34 loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget
35 listFollowersForApi: AccountFollowMethods.ListFollowersForApi
36 listFollowingForApi: AccountFollowMethods.ListFollowingForApi
37
38 listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi
39 listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi
40 listAcceptedFollowerSharedInboxUrls: AccountFollowMethods.ListAcceptedFollowerSharedInboxUrls
41}
42
43export interface AccountFollowAttributes {
44 accountId: number
45 targetAccountId: number
46 state: FollowState
47}
48
49export interface AccountFollowInstance extends AccountFollowClass, AccountFollowAttributes, Sequelize.Instance<AccountFollowAttributes> {
50 id: number
51 createdAt: Date
52 updatedAt: Date
53
54 AccountFollower?: AccountInstance
55 AccountFollowing?: AccountInstance
56
57 toFormattedJSON: AccountFollowMethods.ToFormattedJSON
58}
59
60export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {}