pl-api: support status redacts for admins

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-09-17 19:41:09 +02:00
parent 13324463dd
commit c9ca46172e
2 changed files with 20 additions and 0 deletions

View File

@ -4397,6 +4397,24 @@ class PlApiClient {
return response.json as {}; 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: { trends: {

View File

@ -1428,6 +1428,8 @@ const getFeatures = (instance: Instance) => {
v.software === PLEROMA, v.software === PLEROMA,
]), ]),
pleromaAdminStatusesRedact: instance.api_versions['admin_statuses_redact.pleroma.pl-api'] >= 1,
/** /**
* Displays a form to follow a user when logged out. * Displays a form to follow a user when logged out.
* @see POST /main/ostatus * @see POST /main/ostatus