diff options
author | marcin mikołajczak <git@mkljczk.pl> | 2021-12-25 00:52:02 +0100 |
---|---|---|
committer | marcin mikołajczak <git@mkljczk.pl> | 2021-12-25 00:52:02 +0100 |
commit | 9775955974171c19e2dd9e6930e96e33f25cb4db (patch) | |
tree | 498b0572f6edb8d09acb471b6b557de6ca9bc638 /lib/pleroma/web/api_spec | |
parent | cd5fb84b76a51fe6c7b5d672298a87c34737c303 (diff) | |
parent | 1fa616638b8823a6cc0d67d0354cc179da5943f8 (diff) | |
download | pleroma-9775955974171c19e2dd9e6930e96e33f25cb4db.tar.gz |
Merge remote-tracking branch 'origin/develop' into remote-follow-api
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'lib/pleroma/web/api_spec')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/admin/user_operation.ex | 66 | ||||
-rw-r--r-- | lib/pleroma/web/api_spec/operations/twitter_util_operation.ex | 19 |
2 files changed, 84 insertions, 1 deletions
diff --git a/lib/pleroma/web/api_spec/operations/admin/user_operation.ex b/lib/pleroma/web/api_spec/operations/admin/user_operation.ex index c9d0bfd7c..57fb1ad65 100644 --- a/lib/pleroma/web/api_spec/operations/admin/user_operation.ex +++ b/lib/pleroma/web/api_spec/operations/admin/user_operation.ex @@ -216,7 +216,71 @@ defmodule Pleroma.Web.ApiSpec.Admin.UserOperation do request_body( "Parameters", %Schema{ - description: "POST body for deleting multiple users", + description: "POST body for approving multiple users", + type: :object, + properties: %{ + nicknames: %Schema{ + type: :array, + items: %Schema{type: :string} + } + } + } + ), + responses: %{ + 200 => + Operation.response("Response", "application/json", %Schema{ + type: :object, + properties: %{user: %Schema{type: :array, items: user()}} + }), + 403 => Operation.response("Forbidden", "application/json", ApiError) + } + } + end + + def suggest_operation do + %Operation{ + tags: ["User administration"], + summary: "Suggest multiple users", + operationId: "AdminAPI.UserController.suggest", + security: [%{"oAuth" => ["admin:write:accounts"]}], + parameters: admin_api_params(), + requestBody: + request_body( + "Parameters", + %Schema{ + description: "POST body for adding multiple suggested users", + type: :object, + properties: %{ + nicknames: %Schema{ + type: :array, + items: %Schema{type: :string} + } + } + } + ), + responses: %{ + 200 => + Operation.response("Response", "application/json", %Schema{ + type: :object, + properties: %{user: %Schema{type: :array, items: user()}} + }), + 403 => Operation.response("Forbidden", "application/json", ApiError) + } + } + end + + def unsuggest_operation do + %Operation{ + tags: ["User administration"], + summary: "Unsuggest multiple users", + operationId: "AdminAPI.UserController.unsuggest", + security: [%{"oAuth" => ["admin:write:accounts"]}], + parameters: admin_api_params(), + requestBody: + request_body( + "Parameters", + %Schema{ + description: "POST body for removing multiple suggested users", type: :object, properties: %{ nicknames: %Schema{ diff --git a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex index 1a2dbb166..2a701066d 100644 --- a/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex +++ b/lib/pleroma/web/api_spec/operations/twitter_util_operation.ex @@ -191,6 +191,7 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do parameters: [ Operation.parameter(:password, :query, :string, "Password") ], + requestBody: request_body("Parameters", delete_account_request(), required: false), responses: %{ 200 => Operation.response("Success", "application/json", %Schema{ @@ -263,4 +264,22 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do } } end + + defp delete_account_request do + %Schema{ + title: "AccountDeleteRequest", + description: "POST body for deleting one's own account", + type: :object, + properties: %{ + password: %Schema{ + type: :string, + description: "The user's own password for confirmation.", + format: :password + } + }, + example: %{ + "password" => "prettyp0ony1313" + } + } + end end |