pl-api: allow displaying subscribers list

Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
Nicole Mikołajczyk
2025-04-09 10:11:36 +02:00
parent e0a4ea76ff
commit e2b7622e15
4 changed files with 32 additions and 2 deletions

View File

@@ -108,6 +108,7 @@ import type {
GetAccountFollowingParams,
GetAccountParams,
GetAccountStatusesParams,
GetAccountSubscribersParams,
GetRelationshipsParams,
GetScrobblesParams,
ReportAccountParams,
@@ -594,6 +595,14 @@ class PlApiClient {
getAccountFollowing: async (accountId: string, params?: GetAccountFollowingParams) =>
this.#paginatedGet(`/api/v1/accounts/${accountId}/following`, { params }, accountSchema),
/**
* Subscriptions to the given user.
*
* Requires features{@link Features['subscriptions']}.
*/
getAccountSubscribers: async (accountId: string, params?: GetAccountSubscribersParams) =>
this.#paginatedGet(`/api/v1/accounts/${accountId}/subscribers`, { params }, accountSchema),
/**
* Get accounts featured tags
* Tags featured by this account.

View File

@@ -1475,6 +1475,18 @@ const getFeatures = (instance: Instance) => {
*/
statusDislikes: v.software === FRIENDICA && gte(v.version, '2023.3.0'),
/**
* @see GET /api/v1/accounts/:id/subscribers
* @see POST /api/v1/subscriptions
* @see GET /api/v1/subscriptions/options
* @see POST /api/v1/subscriptions/options
* @see GET /api/v1/subscriptions/find
* @see POST /api/v1/subscriptions/invoices
* @see GET /api/v1/subscriptions/invoices/:id
* @see DELETE /api/v1/subscriptions/invoices/:id
*/
subscriptions: v.software === MITRA,
/**
* Can display suggested accounts.
* @see {@link https://docs.joinmastodon.org/methods/suggestions/}

View File

@@ -27,6 +27,14 @@ type GetAccountFollowersParams = PaginationParams & WithRelationshipsParam;
*/
type GetAccountFollowingParams = PaginationParams & WithRelationshipsParam;
/**
* @category Request params
*/
interface GetAccountSubscribersParams extends PaginationParams, WithRelationshipsParam {
/** Include expired subscriptions. */
include_expired?: boolean;
}
/**
* @category Request params
*/
@@ -111,6 +119,7 @@ export type {
GetAccountStatusesParams,
GetAccountFollowersParams,
GetAccountFollowingParams,
GetAccountSubscribersParams,
FollowAccountParams,
GetRelationshipsParams,
SearchAccountParams,

View File

@@ -1436,10 +1436,10 @@
"security.qr.fail": "Failed to fetch setup key",
"security.submit": "Save changes",
"security.submit.delete": "Delete account",
"security.text.delete": "To delete your account, enter your password and then click Delete account. This is a permanent action that cannot be undone. Your account will be destroyed from this server, and a deletion request will be sent to other servers. It's not guaranteed that all servers will purge your account.",
"security.text.delete": "To delete your account, enter your password and then click Delete account. This is a permanent action that cannot be undone. Your account will be destroyed from this server, and a deletion request will be sent to other servers. Its not guaranteed that all servers will purge your account.",
"security.text.delete.local": "To delete your account, enter your password and then click Delete account. This is a permanent action that cannot be undone.",
"security.text.delete.local.without_password": "To delete your account, click Delete account. This is a permanent action that cannot be undone.",
"security.text.delete.without_password": "To delete your account, click Delete account. This is a permanent action that cannot be undone. Your account will be destroyed from this server, and a deletion request will be sent to other servers. It's not guaranteed that all servers will purge your account.",
"security.text.delete.without_password": "To delete your account, click Delete account. This is a permanent action that cannot be undone. Your account will be destroyed from this server, and a deletion request will be sent to other servers. Its not guaranteed that all servers will purge your account.",
"security.tokens.created_at": "Created on {date}",
"security.tokens.last_used": "Last used on {date}",
"security.tokens.revoke": "Revoke",