diff --git a/packages/pl-api/lib/client.ts b/packages/pl-api/lib/client.ts index 95890c01d..28d1a0e24 100644 --- a/packages/pl-api/lib/client.ts +++ b/packages/pl-api/lib/client.ts @@ -1637,6 +1637,32 @@ class PlApiClient { return response.json; }, + /** + * Export followers to CSV file + * + * Requires features{@link Features['exportFollowers']}. + */ + exportFollowers: async () => { + const response = await this.request('/api/v1/settings/export_followers', { + method: 'GET', + }); + + return response.data; + }, + + /** + * Export follows to CSV file + * + * Requires features{@link Features['exportFollows']}. + */ + exportFollows: async () => { + const response = await this.request('/api/v1/settings/export_follows', { + method: 'GET', + }); + + return response.data; + } + /** * Updates user notification settings * diff --git a/packages/pl-api/lib/features.ts b/packages/pl-api/lib/features.ts index dbd2de626..59fae83bb 100644 --- a/packages/pl-api/lib/features.ts +++ b/packages/pl-api/lib/features.ts @@ -621,6 +621,18 @@ const getFeatures = (instance: Instance) => { /** Whether to allow exporting follows/blocks/mutes to CSV by paginating the API. */ exportData: true, + /** + * Export followers to CSV file + * @see GET /api/v1/settings/export_followers + */ + exportFollowers: v.software === MITRA && gte(v.version, '1.27.0'), + + /** + * Export follows to CSV file + * @see GET /api/v1/settings/export_follows + */ + exportFollows: v.software === MITRA && gte(v.version, '1.27.0'), + /** Whether the accounts who favourited or emoji-reacted to a status can be viewed through the API. */ exposableReactions: any([ v.software === FIREFISH,