pl-api: support gotosocial csv exports api
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -1859,9 +1859,19 @@ class PlApiClient {
|
||||
* Requires features{@link Features.exportFollowers}.
|
||||
*/
|
||||
exportFollowers: async () => {
|
||||
const response = await this.request('/api/v1/settings/export_followers', {
|
||||
let response;
|
||||
|
||||
switch (this.features.version.software) {
|
||||
case GOTOSOCIAL:
|
||||
response = await this.request('/api/v1/exports/followers.csv', {
|
||||
method: 'GET',
|
||||
});
|
||||
break;
|
||||
default:
|
||||
response = await this.request('/api/v1/settings/export_followers', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
return response.data;
|
||||
},
|
||||
@ -1872,7 +1882,56 @@ class PlApiClient {
|
||||
* Requires features{@link Features.exportFollows}.
|
||||
*/
|
||||
exportFollows: async () => {
|
||||
const response = await this.request('/api/v1/settings/export_follows', {
|
||||
let response;
|
||||
|
||||
switch (this.features.version.software) {
|
||||
case GOTOSOCIAL:
|
||||
response = await this.request('/api/v1/exports/following.csv', {
|
||||
method: 'GET',
|
||||
});
|
||||
break;
|
||||
default:
|
||||
response = await this.request('/api/v1/settings/export_follows', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Export lists to CSV file
|
||||
*
|
||||
* Requires features{@link Features.exportLists}.
|
||||
*/
|
||||
exportLists: async () => {
|
||||
const response = await this.request('/api/v1/exports/lists.csv', {
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Export blocks to CSV file
|
||||
*
|
||||
* Requires features{@link Features.exportBlocks}.
|
||||
*/
|
||||
exportBlocks: async () => {
|
||||
const response = await this.request('/api/v1/exports/blocks.csv', {
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Export mutes to CSV file
|
||||
*
|
||||
* Requires features{@link Features.exportMutes}.
|
||||
*/
|
||||
exportMutes: async () => {
|
||||
const response = await this.request('/api/v1/exports/mutes.csv', {
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
|
||||
@ -693,17 +693,43 @@ const getFeatures = (instance: Instance) => {
|
||||
*/
|
||||
events: instance.api_versions['events.pleroma.pl-api'] >= 1,
|
||||
|
||||
/**
|
||||
* Export blocks to CSV file
|
||||
* @see GET /api/v1/exports/blocks.csv
|
||||
*/
|
||||
exportBlocks: v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
|
||||
|
||||
/**
|
||||
* Export followers to CSV file
|
||||
* @see GET /api/v1/exports/followers.csv
|
||||
* @see GET /api/v1/settings/export_followers
|
||||
*/
|
||||
exportFollowers: v.software === MITRA && gte(v.version, '1.27.0'),
|
||||
exportFollowers: any([
|
||||
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
|
||||
v.software === MITRA && gte(v.version, '1.27.0'),
|
||||
]),
|
||||
|
||||
/**
|
||||
* Export follows to CSV file
|
||||
* @see GET /api/v1/exports/following.csv
|
||||
* @see GET /api/v1/settings/export_follows
|
||||
*/
|
||||
exportFollows: v.software === MITRA && gte(v.version, '1.27.0'),
|
||||
exportFollows: any([
|
||||
v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
|
||||
v.software === MITRA && gte(v.version, '1.27.0'),
|
||||
]),
|
||||
|
||||
/**
|
||||
* Export lists to CSV file
|
||||
* @see GET /api/v1/exports/lists.csv
|
||||
*/
|
||||
exportLists: v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
|
||||
|
||||
/**
|
||||
* Export mutes to CSV file
|
||||
* @see GET /api/v1/exports/mutes.csv
|
||||
*/
|
||||
exportMutes: v.software === GOTOSOCIAL && gte(v.version, '0.17.0'),
|
||||
|
||||
/** Whether the accounts who favourited or emoji-reacted to a status can be viewed through the API. */
|
||||
exposableReactions: any([
|
||||
|
||||
Reference in New Issue
Block a user