]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account-interface.ts
Put activity pub sends inside transactions
[github/Chocobozzz/PeerTube.git] / server / models / account / account-interface.ts
index 1a567fb7a8802cd1242bef0985ab5e24c8d9c638..b369766dc4d6b6ecd399715eded4163684c972c8 100644 (file)
@@ -10,15 +10,14 @@ export namespace AccountMethods {
   export type Load = (id: number) => Bluebird<AccountInstance>
   export type LoadByUUID = (uuid: string) => Bluebird<AccountInstance>
   export type LoadByUrl = (url: string, transaction?: Sequelize.Transaction) => Bluebird<AccountInstance>
-  export type LoadAccountByServerAndUUID = (uuid: string, serverId: number, transaction: Sequelize.Transaction) => Bluebird<AccountInstance>
   export type LoadLocalByName = (name: string) => Bluebird<AccountInstance>
   export type LoadByNameAndHost = (name: string, host: string) => Bluebird<AccountInstance>
-  export type ListOwned = () => Bluebird<AccountInstance[]>
+  export type ListByFollowersUrls = (followerUrls: string[], transaction: Sequelize.Transaction) => Bluebird<AccountInstance[]>
 
   export type ToActivityPubObject = (this: AccountInstance) => ActivityPubActor
   export type ToFormattedJSON = (this: AccountInstance) => FormattedAccount
   export type IsOwned = (this: AccountInstance) => boolean
-  export type GetFollowerSharedInboxUrls = (this: AccountInstance) => Bluebird<string[]>
+  export type GetFollowerSharedInboxUrls = (this: AccountInstance, t: Sequelize.Transaction) => Bluebird<string[]>
   export type GetFollowingUrl = (this: AccountInstance) => string
   export type GetFollowersUrl = (this: AccountInstance) => string
   export type GetPublicKeyUrl = (this: AccountInstance) => string
@@ -26,18 +25,17 @@ export namespace AccountMethods {
 
 export interface AccountClass {
   loadApplication: AccountMethods.LoadApplication
-  loadAccountByServerAndUUID: AccountMethods.LoadAccountByServerAndUUID
   load: AccountMethods.Load
   loadByUUID: AccountMethods.LoadByUUID
   loadByUrl: AccountMethods.LoadByUrl
   loadLocalByName: AccountMethods.LoadLocalByName
   loadByNameAndHost: AccountMethods.LoadByNameAndHost
-  listOwned: AccountMethods.ListOwned
+  listByFollowersUrls: AccountMethods.ListByFollowersUrls
 }
 
 export interface AccountAttributes {
   name: string
-  url: string
+  url?: string
   publicKey: string
   privateKey: string
   followersCount: number