X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Faccount-interface.ts;h=b369766dc4d6b6ecd399715eded4163684c972c8;hb=25ed141c7c7631ef21d8764c1163fbf8a6591391;hp=6fc36ae9d7fe447c47eee9e84c5b9e0e3b77de7d;hpb=350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/account-interface.ts b/server/models/account/account-interface.ts index 6fc36ae9d..b369766dc 100644 --- a/server/models/account/account-interface.ts +++ b/server/models/account/account-interface.ts @@ -1,8 +1,7 @@ import * as Bluebird from 'bluebird' import * as Sequelize from 'sequelize' import { Account as FormattedAccount, ActivityPubActor } from '../../../shared' -import { ResultList } from '../../../shared/models/result-list.model' -import { PodInstance } from '../pod/pod-interface' +import { ServerInstance } from '../server/server-interface' import { VideoChannelInstance } from '../video/video-channel-interface' export namespace AccountMethods { @@ -11,19 +10,14 @@ export namespace AccountMethods { export type Load = (id: number) => Bluebird export type LoadByUUID = (uuid: string) => Bluebird export type LoadByUrl = (url: string, transaction?: Sequelize.Transaction) => Bluebird - export type LoadAccountByPodAndUUID = (uuid: string, podId: number, transaction: Sequelize.Transaction) => Bluebird export type LoadLocalByName = (name: string) => Bluebird export type LoadByNameAndHost = (name: string, host: string) => Bluebird - export type ListOwned = () => Bluebird - export type ListAcceptedFollowerUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList > - export type ListAcceptedFollowingUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList > - export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList > - export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList > + export type ListByFollowersUrls = (followerUrls: string[], transaction: Sequelize.Transaction) => Bluebird export type ToActivityPubObject = (this: AccountInstance) => ActivityPubActor export type ToFormattedJSON = (this: AccountInstance) => FormattedAccount export type IsOwned = (this: AccountInstance) => boolean - export type GetFollowerSharedInboxUrls = (this: AccountInstance) => Bluebird + export type GetFollowerSharedInboxUrls = (this: AccountInstance, t: Sequelize.Transaction) => Bluebird export type GetFollowingUrl = (this: AccountInstance) => string export type GetFollowersUrl = (this: AccountInstance) => string export type GetPublicKeyUrl = (this: AccountInstance) => string @@ -31,22 +25,17 @@ export namespace AccountMethods { export interface AccountClass { loadApplication: AccountMethods.LoadApplication - loadAccountByPodAndUUID: AccountMethods.LoadAccountByPodAndUUID load: AccountMethods.Load loadByUUID: AccountMethods.LoadByUUID loadByUrl: AccountMethods.LoadByUrl loadLocalByName: AccountMethods.LoadLocalByName loadByNameAndHost: AccountMethods.LoadByNameAndHost - listOwned: AccountMethods.ListOwned - listAcceptedFollowerUrlsForApi: AccountMethods.ListAcceptedFollowerUrlsForApi - listAcceptedFollowingUrlsForApi: AccountMethods.ListAcceptedFollowingUrlsForApi - listFollowingForApi: AccountMethods.ListFollowingForApi - listFollowersForApi: AccountMethods.ListFollowersForApi + listByFollowersUrls: AccountMethods.ListByFollowersUrls } export interface AccountAttributes { name: string - url: string + url?: string publicKey: string privateKey: string followersCount: number @@ -59,7 +48,7 @@ export interface AccountAttributes { uuid?: string - podId?: number + serverId?: number userId?: number applicationId?: number } @@ -77,7 +66,7 @@ export interface AccountInstance extends AccountClass, AccountAttributes, Sequel createdAt: Date updatedAt: Date - Pod: PodInstance + Server: ServerInstance VideoChannels: VideoChannelInstance[] }