Merge branch 'develop' into documentation-migration
[akkoma] / lib / pleroma / web / api_spec / operations / twitter_util_operation.ex
index be45720b12750f390fb1647c138987845c348948..2a701066d409549e5fcdde77fcc04a0558cc7db9 100644 (file)
@@ -121,7 +121,10 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do
       type: :object,
       required: [:email, :password],
       properties: %{
-        email: %Schema{type: :string, description: "New email"},
+        email: %Schema{
+          type: :string,
+          description: "New email. Set to blank to remove the user's email."
+        },
         password: %Schema{type: :string, description: "Current password"}
       }
     }
@@ -236,6 +239,32 @@ defmodule Pleroma.Web.ApiSpec.TwitterUtilOperation do
     }
   end
 
+  def remote_interaction_operation do
+    %Operation{
+      tags: ["Accounts"],
+      summary: "Remote interaction",
+      operationId: "UtilController.remote_interaction",
+      requestBody: request_body("Parameters", remote_interaction_request(), required: true),
+      responses: %{
+        200 =>
+          Operation.response("Remote interaction URL", "application/json", %Schema{type: :object})
+      }
+    }
+  end
+
+  defp remote_interaction_request do
+    %Schema{
+      title: "RemoteInteractionRequest",
+      description: "POST body for remote interaction",
+      type: :object,
+      required: [:ap_id, :profile],
+      properties: %{
+        ap_id: %Schema{type: :string, description: "Profile or status ActivityPub ID"},
+        profile: %Schema{type: :string, description: "Remote profile webfinger"}
+      }
+    }
+  end
+
   defp delete_account_request do
     %Schema{
       title: "AccountDeleteRequest",