aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/account-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-13 17:39:41 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commit7a7724e66e4533523083e7336cd0d0c747c4a33b (patch)
tree805299eb9c6829158cd17e5a823a84a3a54d8209 /server/models/account/account-interface.ts
parent571389d43b8fc8aaf27e77c06f19b320b08dbbc9 (diff)
downloadPeerTube-7a7724e66e4533523083e7336cd0d0c747c4a33b.tar.gz
PeerTube-7a7724e66e4533523083e7336cd0d0c747c4a33b.tar.zst
PeerTube-7a7724e66e4533523083e7336cd0d0c747c4a33b.zip
Handle follow/accept
Diffstat (limited to 'server/models/account/account-interface.ts')
-rw-r--r--server/models/account/account-interface.ts24
1 files changed, 16 insertions, 8 deletions
diff --git a/server/models/account/account-interface.ts b/server/models/account/account-interface.ts
index a662eb992..d49dfbe17 100644
--- a/server/models/account/account-interface.ts
+++ b/server/models/account/account-interface.ts
@@ -1,22 +1,26 @@
1import * as Sequelize from 'sequelize'
2import * as Bluebird from 'bluebird' 1import * as Bluebird from 'bluebird'
3 2import * as Sequelize from 'sequelize'
3import { Account as FormattedAccount, ActivityPubActor } from '../../../shared'
4import { ResultList } from '../../../shared/models/result-list.model'
4import { PodInstance } from '../pod/pod-interface' 5import { PodInstance } from '../pod/pod-interface'
5import { VideoChannelInstance } from '../video/video-channel-interface' 6import { VideoChannelInstance } from '../video/video-channel-interface'
6import { ActivityPubActor } from '../../../shared'
7import { ResultList } from '../../../shared/models/result-list.model'
8 7
9export namespace AccountMethods { 8export namespace AccountMethods {
9 export type LoadApplication = () => Bluebird<AccountInstance>
10
10 export type Load = (id: number) => Bluebird<AccountInstance> 11 export type Load = (id: number) => Bluebird<AccountInstance>
11 export type LoadByUUID = (uuid: string) => Bluebird<AccountInstance> 12 export type LoadByUUID = (uuid: string) => Bluebird<AccountInstance>
12 export type LoadByUrl = (url: string) => Bluebird<AccountInstance> 13 export type LoadByUrl = (url: string) => Bluebird<AccountInstance>
13 export type LoadAccountByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Bluebird<AccountInstance> 14 export type LoadAccountByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Bluebird<AccountInstance>
14 export type LoadLocalAccountByName = (name: string) => Bluebird<AccountInstance> 15 export type LoadLocalAccountByNameAndPod = (name: string, host: string) => Bluebird<AccountInstance>
15 export type ListOwned = () => Bluebird<AccountInstance[]> 16 export type ListOwned = () => Bluebird<AccountInstance[]>
16 export type ListFollowerUrlsForApi = (name: string, start: number, count?: number) => Promise< ResultList<string> > 17 export type ListFollowerUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> >
17 export type ListFollowingUrlsForApi = (name: string, start: number, count?: number) => Promise< ResultList<string> > 18 export type ListFollowingUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> >
19 export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> >
20 export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> >
18 21
19 export type ToActivityPubObject = (this: AccountInstance) => ActivityPubActor 22 export type ToActivityPubObject = (this: AccountInstance) => ActivityPubActor
23 export type ToFormattedJSON = (this: AccountInstance) => FormattedAccount
20 export type IsOwned = (this: AccountInstance) => boolean 24 export type IsOwned = (this: AccountInstance) => boolean
21 export type GetFollowerSharedInboxUrls = (this: AccountInstance) => Bluebird<string[]> 25 export type GetFollowerSharedInboxUrls = (this: AccountInstance) => Bluebird<string[]>
22 export type GetFollowingUrl = (this: AccountInstance) => string 26 export type GetFollowingUrl = (this: AccountInstance) => string
@@ -25,14 +29,17 @@ export namespace AccountMethods {
25} 29}
26 30
27export interface AccountClass { 31export interface AccountClass {
32 loadApplication: AccountMethods.LoadApplication
28 loadAccountByPodAndUUID: AccountMethods.LoadAccountByPodAndUUID 33 loadAccountByPodAndUUID: AccountMethods.LoadAccountByPodAndUUID
29 load: AccountMethods.Load 34 load: AccountMethods.Load
30 loadByUUID: AccountMethods.LoadByUUID 35 loadByUUID: AccountMethods.LoadByUUID
31 loadByUrl: AccountMethods.LoadByUrl 36 loadByUrl: AccountMethods.LoadByUrl
32 loadLocalAccountByName: AccountMethods.LoadLocalAccountByName 37 loadLocalAccountByNameAndPod: AccountMethods.LoadLocalAccountByNameAndPod
33 listOwned: AccountMethods.ListOwned 38 listOwned: AccountMethods.ListOwned
34 listFollowerUrlsForApi: AccountMethods.ListFollowerUrlsForApi 39 listFollowerUrlsForApi: AccountMethods.ListFollowerUrlsForApi
35 listFollowingUrlsForApi: AccountMethods.ListFollowingUrlsForApi 40 listFollowingUrlsForApi: AccountMethods.ListFollowingUrlsForApi
41 listFollowingForApi: AccountMethods.ListFollowingForApi
42 listFollowersForApi: AccountMethods.ListFollowersForApi
36} 43}
37 44
38export interface AccountAttributes { 45export interface AccountAttributes {
@@ -58,6 +65,7 @@ export interface AccountAttributes {
58export interface AccountInstance extends AccountClass, AccountAttributes, Sequelize.Instance<AccountAttributes> { 65export interface AccountInstance extends AccountClass, AccountAttributes, Sequelize.Instance<AccountAttributes> {
59 isOwned: AccountMethods.IsOwned 66 isOwned: AccountMethods.IsOwned
60 toActivityPubObject: AccountMethods.ToActivityPubObject 67 toActivityPubObject: AccountMethods.ToActivityPubObject
68 toFormattedJSON: AccountMethods.ToFormattedJSON
61 getFollowerSharedInboxUrls: AccountMethods.GetFollowerSharedInboxUrls 69 getFollowerSharedInboxUrls: AccountMethods.GetFollowerSharedInboxUrls
62 getFollowingUrl: AccountMethods.GetFollowingUrl 70 getFollowingUrl: AccountMethods.GetFollowingUrl
63 getFollowersUrl: AccountMethods.GetFollowersUrl 71 getFollowersUrl: AccountMethods.GetFollowersUrl