pl-api: support status redacts for admins
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -4397,6 +4397,24 @@ class PlApiClient {
|
||||
|
||||
return response.json as {};
|
||||
},
|
||||
|
||||
/**
|
||||
* Requires features{@link Features.pleromaAdminStatusesRedact}
|
||||
*/
|
||||
redactStatus: async (statusId: string, params: EditStatusParams & { overwrite?: boolean }) => {
|
||||
const response = await this.request(`/api/v1/pleroma/admin/statuses/${statusId}/redact`, { method: 'PUT', body: params });
|
||||
|
||||
return v.parse(statusSchema, response.json);
|
||||
},
|
||||
|
||||
/**
|
||||
* Requires features{@link Features.pleromaAdminStatusesRedact}
|
||||
*/
|
||||
getStatusSource: async (statusId: string) => {
|
||||
const response = await this.request(`/api/v1/pleroma/admin/statuses/${statusId}/source`);
|
||||
|
||||
return v.parse(statusSourceSchema, response.json);
|
||||
},
|
||||
},
|
||||
|
||||
trends: {
|
||||
|
||||
@ -1428,6 +1428,8 @@ const getFeatures = (instance: Instance) => {
|
||||
v.software === PLEROMA,
|
||||
]),
|
||||
|
||||
pleromaAdminStatusesRedact: instance.api_versions['admin_statuses_redact.pleroma.pl-api'] >= 1,
|
||||
|
||||
/**
|
||||
* Displays a form to follow a user when logged out.
|
||||
* @see POST /main/ostatus
|
||||
|
||||
Reference in New Issue
Block a user