summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortastytea2020-01-05 16:01:38 +0100
committertastytea2020-01-05 16:01:38 +0100
commit765fc8617988e5da20fcf07965d3e9ef8a904836 (patch)
tree58d0a2752c869f8770197226eb03a1ad112c874a
parent571206c9f4da9c4f8afebf15c500c89271860e66 (diff)
downloadmastodonpp-765fc8617988e5da20fcf07965d3e9ef8a904836.tar
mastodonpp-765fc8617988e5da20fcf07965d3e9ef8a904836.tar.gz
mastodonpp-765fc8617988e5da20fcf07965d3e9ef8a904836.zip
Add all API endpoints of Pleroma 1.1.7.
-rw-r--r--include/api.hpp71
-rw-r--r--src/api.cpp73
2 files changed, 138 insertions, 6 deletions
diff --git a/include/api.hpp b/include/api.hpp
index d22c3d2..00a6dc3 100644
--- a/include/api.hpp
+++ b/include/api.hpp
@@ -31,7 +31,7 @@ using std::variant;
/*!
* @brief Holds %API endpoints.
*
- * Supported %API endpoints: Mastodon 3.0.
+ * Supported %API endpoints: Mastodon 3.0.1, Pleroma 1.1.7.
*
* @since 0.1.0
*
@@ -181,7 +181,22 @@ public:
admin_reports_id_assign_to_self,
admin_reports_id_unassign,
admin_reports_id_resolve,
- admin_reports_id_reopen
+ admin_reports_id_reopen,
+
+ pleroma_notifications_read,
+
+ pleroma_accounts_id_subscribe,
+ pleroma_accounts_id_unsubscribe,
+ pleroma_accounts_id_favourites,
+ pleroma_accounts_update_avatar,
+ pleroma_accounts_update_banner,
+ pleroma_accounts_update_background,
+ pleroma_accounts_confirmation_resend,
+
+ pleroma_mascot,
+
+ pleroma_conversations_id_statuses,
+ pleroma_conversations_id,
};
/*!
@@ -226,12 +241,58 @@ public:
};
/*!
- * @brief Type for endpoints. Can be API::v1, API::v2, API::oauth or
- * API::other.
+ * @brief An enumeration of all pleroma %API endpoints.
+ *
+ * The original `/` are substituted with `_`.
+ *
+ * @since 0.1.0
+ */
+ enum class pleroma
+ {
+ admin_users,
+ admin_users_follow,
+ admin_users_unfollow,
+ admin_users_nickname,
+ admin_users_tag,
+ admin_users_nickname_permission_group,
+ admin_users_nickname_permission_group_permission_group,
+ admin_users_nickname_activation_status,
+ admin_users_nickname_or_id,
+ admin_users_nickname_or_id_statuses,
+ admin_relay,
+ admin_users_invite_token,
+ admin_users_invites,
+ admin_users_revoke_invite,
+ admin_users_email_invite,
+ admin_users_nickname_password_reset,
+ admin_reports,
+ admin_reports_id,
+ admin_reports_id_respond,
+ admin_statuses_id,
+ admin_config_migrate_to_db,
+ admin_config_migrate_from_db,
+ admin_config,
+
+ emoji,
+ follow_import,
+ captcha,
+
+ delete_account,
+ disable_account,
+ account_register,
+
+ pleroma_notification_settings,
+ pleroma_healthcheck,
+ pleroma_change_email
+ };
+
+ /*!
+ * @brief Type for endpoints. Can be API::v1, API::v2, API::oauth,
+ * API::other or API::pleroma.
*
* @since 0.1.0
*/
- using endpoint_type = variant<v1,v2,oauth,other>;
+ using endpoint_type = variant<v1,v2,oauth,other,pleroma>;
/*!
* @brief Constructs an API object. You should never need this.
diff --git a/src/api.cpp b/src/api.cpp
index 4a90eb2..f656dc7 100644
--- a/src/api.cpp
+++ b/src/api.cpp
@@ -159,6 +159,29 @@ API::API()
{v1::admin_reports_id_resolve, "/api/v1/admin/reports/resolve"},
{v1::admin_reports_id_reopen, "/api/v1/admin/reports/<ID>/reopen"},
+ {v1::pleroma_notifications_read, " /api/v1/pleroma/notifications/read"},
+
+ {v1::pleroma_accounts_id_subscribe,
+ "/api/v1/pleroma/accounts/<ID>/subscribe"},
+ {v1::pleroma_accounts_id_unsubscribe,
+ "/api/v1/pleroma/accounts/<ID>/unsubscribe"},
+ {v1::pleroma_accounts_id_favourites,
+ "/api/v1/pleroma/accounts/:id/favourites"},
+ {v1::pleroma_accounts_update_avatar,
+ "/api/v1/pleroma/accounts/update_avatar"},
+ {v1::pleroma_accounts_update_banner,
+ "/api/v1/pleroma/accounts/update_banner"},
+ {v1::pleroma_accounts_update_background,
+ "/api/v1/pleroma/accounts/update_background"},
+ {v1::pleroma_accounts_confirmation_resend,
+ "/api/v1/pleroma/accounts/confirmation_resend"},
+
+ {v1::pleroma_mascot, "/api/v1/pleroma/mascot"},
+
+ {v1::pleroma_conversations_id_statuses,
+ "/api/v1/pleroma/conversations/<ID>/statuses"},
+ {v1::pleroma_conversations_id, "/api/v1/pleroma/conversations/<ID>"},
+
{v2::search, "/api/v2/search"},
{oauth::authorize, "/oauth/authorize"},
@@ -166,7 +189,55 @@ API::API()
{oauth::revoke, "/oauth/revoke"},
{other::proofs, "/api/proofs"},
- {other::oembed, "/api/oembed"}
+ {other::oembed, "/api/oembed"},
+
+ {pleroma::admin_users, "/api/pleroma/admin/users"},
+ {pleroma::admin_users_follow, "/api/pleroma/admin/users/follow"},
+ {pleroma::admin_users_unfollow, "/api/pleroma/admin/users/unfollow"},
+ {pleroma::admin_users_nickname, "/api/pleroma/admin/users/<NICKNAME>"},
+ {pleroma::admin_users_tag, "/api/pleroma/admin/users/tag"},
+ {pleroma::admin_users_nickname_permission_group,
+ "/api/pleroma/admin/users/<NICKNAME>/permission_group"},
+ {pleroma::admin_users_nickname_permission_group_permission_group,
+ "/api/pleroma/admin/users/<NICKNAME>/permission_group/<PERMISSION_GROUP>"},
+ {pleroma::admin_users_nickname_activation_status,
+ "/api/pleroma/admin/users/<NICKNAME>/activation_status"},
+ {pleroma::admin_users_nickname_or_id,
+ "/api/pleroma/admin/users/<NICKNAME_OR_ID>"},
+ {pleroma::admin_users_nickname_or_id_statuses,
+ "/api/pleroma/admin/users/<NICKNAME_OR_ID>/statuses"},
+ {pleroma::admin_relay, "/api/pleroma/admin/relay"},
+ {pleroma::admin_users_invite_token,
+ "/api/pleroma/admin/users/invite_token"},
+ {pleroma::admin_users_invites, "/api/pleroma/admin/users/invites"},
+ {pleroma::admin_users_revoke_invite,
+ "/api/pleroma/admin/users/revoke_invite"},
+ {pleroma::admin_users_email_invite,
+ "/api/pleroma/admin/users/email_invite"},
+ {pleroma::admin_users_nickname_password_reset,
+ "/api/pleroma/admin/users/<NICKNAME>/password_reset"},
+ {pleroma::admin_reports, "/api/pleroma/admin/reports"},
+ {pleroma::admin_reports_id, "/api/pleroma/admin/reports/<ID>"},
+ {pleroma::admin_reports_id_respond,
+ "/api/pleroma/admin/reports/<ID>/respond"},
+ {pleroma::admin_statuses_id, "/api/pleroma/admin/statuses/<ID>"},
+ {pleroma::admin_config_migrate_to_db,
+ "/api/pleroma/admin/config/migrate_to_db"},
+ {pleroma::admin_config_migrate_from_db,
+ "/api/pleroma/admin/config/migrate_from_db"},
+ {pleroma::admin_config, "/api/pleroma/admin/config"},
+
+ {pleroma::emoji, "/api/pleroma/emoji"},
+ {pleroma::follow_import, "/api/pleroma/follow_import"},
+ {pleroma::captcha, "/api/pleroma/captcha,"},
+ {pleroma::delete_account, "/api/pleroma/delete_account"},
+ {pleroma::disable_account, "/api/pleroma/disable_account"},
+ {pleroma::account_register, "/api/pleroma/account/register"},
+
+ {pleroma::pleroma_notification_settings,
+ "/api/pleroma/pleroma/notification_settings"},
+ {pleroma::pleroma_healthcheck, "/api/pleroma/pleroma/healthcheck"},
+ {pleroma::pleroma_change_email, "/api/pleroma/pleroma/change_email"},
}
{}