X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fusers%2Faccounts-command.ts;h=98d9d59271d3b0416a4b4e44d48000beaf9b1439;hb=5678353d4fb0ddd8bea044868576ee02cdbabedb;hp=2f586104eb90a3f358e6e6febbdfd02ad0d1585a;hpb=421ff4618da64f0849353383f690a014024c40da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/users/accounts-command.ts b/shared/extra-utils/users/accounts-command.ts index 2f586104e..98d9d5927 100644 --- a/shared/extra-utils/users/accounts-command.ts +++ b/shared/extra-utils/users/accounts-command.ts @@ -1,5 +1,5 @@ import { HttpStatusCode, ResultList } from '@shared/models' -import { Account } from '../../models/actors' +import { Account, ActorFollow } from '../../models/actors' import { AccountVideoRate, VideoRateType } from '../../models/videos' import { AbstractCommand, OverrideCommandOptions } from '../shared' @@ -53,4 +53,26 @@ export class AccountsCommand extends AbstractCommand { defaultExpectedStatus: HttpStatusCode.OK_200 }) } + + listFollowers (options: OverrideCommandOptions & { + accountName: string + start?: number + count?: number + sort?: string + search?: string + }) { + const { accountName, start, count, sort, search } = options + const path = '/api/v1/accounts/' + accountName + '/followers' + + const query = { start, count, sort, search } + + return this.getRequestBody>({ + ...options, + + path, + query, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.OK_200 + }) + } }