OpenAPI: Add `admin:` scope prefix to admin operations

Also splits "Emoji packs" to two categories: "Emoji pack administration"
and "Emoji packs"
This commit is contained in:
rinpatch 2021-02-17 20:56:13 +03:00
parent 6d66fadea7
commit 95a22c1cc2
13 changed files with 54 additions and 54 deletions

View File

@ -85,7 +85,7 @@ def spec(opts \\ []) do
"name" => "Administration", "name" => "Administration",
"tags" => [ "tags" => [
"Chat administration", "Chat administration",
"Emoji packs", "Emoji pack administration",
"Frontend managment", "Frontend managment",
"Instance configuration", "Instance configuration",
"Instance documents", "Instance documents",
@ -127,7 +127,7 @@ def spec(opts \\ []) do
"Status actions" "Status actions"
] ]
}, },
%{"name" => "Miscellaneous", "tags" => ["Reports", "Suggestions"]} %{"name" => "Miscellaneous", "tags" => ["Emoji packs", "Reports", "Suggestions"]}
] ]
} }
} }

View File

@ -33,7 +33,7 @@ def delete_message_operation do
}, },
security: [ security: [
%{ %{
"oAuth" => ["write:chats"] "oAuth" => ["admin:write:chats"]
} }
] ]
} }
@ -57,7 +57,7 @@ def messages_operation do
}, },
security: [ security: [
%{ %{
"oAuth" => ["read:chats"] "oAuth" => ["admin:read:chats"]
} }
] ]
} }
@ -88,7 +88,7 @@ def show_operation do
}, },
security: [ security: [
%{ %{
"oAuth" => ["read"] "oAuth" => ["admin:read"]
} }
] ]
} }

View File

@ -28,7 +28,7 @@ def show_operation do
) )
| admin_api_params() | admin_api_params()
], ],
security: [%{"oAuth" => ["read"]}], security: [%{"oAuth" => ["admin:read"]}],
responses: %{ responses: %{
200 => Operation.response("Config", "application/json", config_response()), 200 => Operation.response("Config", "application/json", config_response()),
400 => Operation.response("Bad Request", "application/json", ApiError) 400 => Operation.response("Bad Request", "application/json", ApiError)
@ -41,7 +41,7 @@ def update_operation do
tags: ["Instance configuration"], tags: ["Instance configuration"],
summary: "Update instance configuration", summary: "Update instance configuration",
operationId: "AdminAPI.ConfigController.update", operationId: "AdminAPI.ConfigController.update",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: requestBody:
request_body("Parameters", %Schema{ request_body("Parameters", %Schema{
@ -74,7 +74,7 @@ def descriptions_operation do
tags: ["Instance configuration"], tags: ["Instance configuration"],
summary: "Retrieve config description", summary: "Retrieve config description",
operationId: "AdminAPI.ConfigController.descriptions", operationId: "AdminAPI.ConfigController.descriptions",
security: [%{"oAuth" => ["read"]}], security: [%{"oAuth" => ["admin:read"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
responses: %{ responses: %{
200 => 200 =>

View File

@ -19,7 +19,7 @@ def index_operation do
tags: ["Frontend managment"], tags: ["Frontend managment"],
summary: "Retrieve a list of available frontends", summary: "Retrieve a list of available frontends",
operationId: "AdminAPI.FrontendController.index", operationId: "AdminAPI.FrontendController.index",
security: [%{"oAuth" => ["read"]}], security: [%{"oAuth" => ["admin:read"]}],
responses: %{ responses: %{
200 => Operation.response("Response", "application/json", list_of_frontends()), 200 => Operation.response("Response", "application/json", list_of_frontends()),
403 => Operation.response("Forbidden", "application/json", ApiError) 403 => Operation.response("Forbidden", "application/json", ApiError)
@ -32,7 +32,7 @@ def install_operation do
tags: ["Frontend managment"], tags: ["Frontend managment"],
summary: "Install a frontend", summary: "Install a frontend",
operationId: "AdminAPI.FrontendController.install", operationId: "AdminAPI.FrontendController.install",
security: [%{"oAuth" => ["read"]}], security: [%{"oAuth" => ["admin:read"]}],
requestBody: request_body("Parameters", install_request(), required: true), requestBody: request_body("Parameters", install_request(), required: true),
responses: %{ responses: %{
200 => Operation.response("Response", "application/json", list_of_frontends()), 200 => Operation.response("Response", "application/json", list_of_frontends()),

View File

@ -18,7 +18,7 @@ def show_operation do
tags: ["Instance documents"], tags: ["Instance documents"],
summary: "Retrieve an instance document", summary: "Retrieve an instance document",
operationId: "AdminAPI.InstanceDocumentController.show", operationId: "AdminAPI.InstanceDocumentController.show",
security: [%{"oAuth" => ["read"]}], security: [%{"oAuth" => ["admin:read"]}],
parameters: [ parameters: [
Operation.parameter(:name, :path, %Schema{type: :string}, "The document name", Operation.parameter(:name, :path, %Schema{type: :string}, "The document name",
required: true required: true
@ -39,7 +39,7 @@ def update_operation do
tags: ["Instance documents"], tags: ["Instance documents"],
summary: "Update an instance document", summary: "Update an instance document",
operationId: "AdminAPI.InstanceDocumentController.update", operationId: "AdminAPI.InstanceDocumentController.update",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
requestBody: Helpers.request_body("Parameters", update_request()), requestBody: Helpers.request_body("Parameters", update_request()),
parameters: [ parameters: [
Operation.parameter(:name, :path, %Schema{type: :string}, "The document name", Operation.parameter(:name, :path, %Schema{type: :string}, "The document name",
@ -77,7 +77,7 @@ def delete_operation do
tags: ["Instance documents"], tags: ["Instance documents"],
summary: "Delete an instance document", summary: "Delete an instance document",
operationId: "AdminAPI.InstanceDocumentController.delete", operationId: "AdminAPI.InstanceDocumentController.delete",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
parameters: [ parameters: [
Operation.parameter(:name, :path, %Schema{type: :string}, "The document name", Operation.parameter(:name, :path, %Schema{type: :string}, "The document name",
required: true required: true

View File

@ -19,7 +19,7 @@ def index_operation do
tags: ["Invites"], tags: ["Invites"],
summary: "Get a list of generated invites", summary: "Get a list of generated invites",
operationId: "AdminAPI.InviteController.index", operationId: "AdminAPI.InviteController.index",
security: [%{"oAuth" => ["read:invites"]}], security: [%{"oAuth" => ["admin:read:invites"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
responses: %{ responses: %{
200 => 200 =>
@ -51,7 +51,7 @@ def create_operation do
tags: ["Invites"], tags: ["Invites"],
summary: "Create an account registration invite token", summary: "Create an account registration invite token",
operationId: "AdminAPI.InviteController.create", operationId: "AdminAPI.InviteController.create",
security: [%{"oAuth" => ["write:invites"]}], security: [%{"oAuth" => ["admin:write:invites"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: requestBody:
request_body("Parameters", %Schema{ request_body("Parameters", %Schema{
@ -72,7 +72,7 @@ def revoke_operation do
tags: ["Invites"], tags: ["Invites"],
summary: "Revoke invite by token", summary: "Revoke invite by token",
operationId: "AdminAPI.InviteController.revoke", operationId: "AdminAPI.InviteController.revoke",
security: [%{"oAuth" => ["write:invites"]}], security: [%{"oAuth" => ["admin:write:invites"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: requestBody:
request_body( request_body(
@ -99,7 +99,7 @@ def email_operation do
tags: ["Invites"], tags: ["Invites"],
summary: "Sends registration invite via email", summary: "Sends registration invite via email",
operationId: "AdminAPI.InviteController.email", operationId: "AdminAPI.InviteController.email",
security: [%{"oAuth" => ["write:invites"]}], security: [%{"oAuth" => ["admin:write:invites"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: requestBody:
request_body( request_body(

View File

@ -19,7 +19,7 @@ def index_operation do
tags: ["MediaProxy cache"], tags: ["MediaProxy cache"],
summary: "Retrieve a list of banned MediaProxy URLs", summary: "Retrieve a list of banned MediaProxy URLs",
operationId: "AdminAPI.MediaProxyCacheController.index", operationId: "AdminAPI.MediaProxyCacheController.index",
security: [%{"oAuth" => ["read:media_proxy_caches"]}], security: [%{"oAuth" => ["admin:read:media_proxy_caches"]}],
parameters: [ parameters: [
Operation.parameter( Operation.parameter(
:query, :query,
@ -71,7 +71,7 @@ def delete_operation do
tags: ["MediaProxy cache"], tags: ["MediaProxy cache"],
summary: "Remove a banned MediaProxy URL", summary: "Remove a banned MediaProxy URL",
operationId: "AdminAPI.MediaProxyCacheController.delete", operationId: "AdminAPI.MediaProxyCacheController.delete",
security: [%{"oAuth" => ["write:media_proxy_caches"]}], security: [%{"oAuth" => ["admin:write:media_proxy_caches"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: requestBody:
request_body( request_body(
@ -97,7 +97,7 @@ def purge_operation do
tags: ["MediaProxy cache"], tags: ["MediaProxy cache"],
summary: "Purge a URL from MediaProxy cache and optionally ban it", summary: "Purge a URL from MediaProxy cache and optionally ban it",
operationId: "AdminAPI.MediaProxyCacheController.purge", operationId: "AdminAPI.MediaProxyCacheController.purge",
security: [%{"oAuth" => ["write:media_proxy_caches"]}], security: [%{"oAuth" => ["admin:write:media_proxy_caches"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: requestBody:
request_body( request_body(

View File

@ -19,7 +19,7 @@ def index_operation do
summary: "Retrieve a list of OAuth applications", summary: "Retrieve a list of OAuth applications",
tags: ["OAuth application managment"], tags: ["OAuth application managment"],
operationId: "AdminAPI.OAuthAppController.index", operationId: "AdminAPI.OAuthAppController.index",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
parameters: [ parameters: [
Operation.parameter(:name, :query, %Schema{type: :string}, "App name"), Operation.parameter(:name, :query, %Schema{type: :string}, "App name"),
Operation.parameter(:client_id, :query, %Schema{type: :string}, "Client ID"), Operation.parameter(:client_id, :query, %Schema{type: :string}, "Client ID"),
@ -74,7 +74,7 @@ def create_operation do
operationId: "AdminAPI.OAuthAppController.create", operationId: "AdminAPI.OAuthAppController.create",
requestBody: request_body("Parameters", create_request()), requestBody: request_body("Parameters", create_request()),
parameters: admin_api_params(), parameters: admin_api_params(),
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
responses: %{ responses: %{
200 => Operation.response("App", "application/json", oauth_app()), 200 => Operation.response("App", "application/json", oauth_app()),
400 => Operation.response("Bad Request", "application/json", ApiError) 400 => Operation.response("Bad Request", "application/json", ApiError)
@ -88,7 +88,7 @@ def update_operation do
summary: "Update OAuth application", summary: "Update OAuth application",
operationId: "AdminAPI.OAuthAppController.update", operationId: "AdminAPI.OAuthAppController.update",
parameters: [id_param() | admin_api_params()], parameters: [id_param() | admin_api_params()],
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
requestBody: request_body("Parameters", update_request()), requestBody: request_body("Parameters", update_request()),
responses: %{ responses: %{
200 => Operation.response("App", "application/json", oauth_app()), 200 => Operation.response("App", "application/json", oauth_app()),
@ -106,7 +106,7 @@ def delete_operation do
summary: "Delete OAuth application", summary: "Delete OAuth application",
operationId: "AdminAPI.OAuthAppController.delete", operationId: "AdminAPI.OAuthAppController.delete",
parameters: [id_param() | admin_api_params()], parameters: [id_param() | admin_api_params()],
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
responses: %{ responses: %{
204 => no_content_response(), 204 => no_content_response(),
400 => no_content_response() 400 => no_content_response()

View File

@ -18,7 +18,7 @@ def index_operation do
tags: ["Relays"], tags: ["Relays"],
summary: "Retrieve a list of relays", summary: "Retrieve a list of relays",
operationId: "AdminAPI.RelayController.index", operationId: "AdminAPI.RelayController.index",
security: [%{"oAuth" => ["read"]}], security: [%{"oAuth" => ["admin:read"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
responses: %{ responses: %{
200 => 200 =>
@ -40,7 +40,7 @@ def follow_operation do
tags: ["Relays"], tags: ["Relays"],
summary: "Follow a relay", summary: "Follow a relay",
operationId: "AdminAPI.RelayController.follow", operationId: "AdminAPI.RelayController.follow",
security: [%{"oAuth" => ["write:follows"]}], security: [%{"oAuth" => ["admin:write:follows"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: request_body("Parameters", relay_url()), requestBody: request_body("Parameters", relay_url()),
responses: %{ responses: %{
@ -54,7 +54,7 @@ def unfollow_operation do
tags: ["Relays"], tags: ["Relays"],
summary: "Unfollow a relay", summary: "Unfollow a relay",
operationId: "AdminAPI.RelayController.unfollow", operationId: "AdminAPI.RelayController.unfollow",
security: [%{"oAuth" => ["write:follows"]}], security: [%{"oAuth" => ["admin:write:follows"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: request_body("Parameters", relay_unfollow()), requestBody: request_body("Parameters", relay_unfollow()),
responses: %{ responses: %{

View File

@ -22,7 +22,7 @@ def index_operation do
tags: ["Report managment"], tags: ["Report managment"],
summary: "Retrieve a list of reports", summary: "Retrieve a list of reports",
operationId: "AdminAPI.ReportController.index", operationId: "AdminAPI.ReportController.index",
security: [%{"oAuth" => ["read:reports"]}], security: [%{"oAuth" => ["admin:read:reports"]}],
parameters: [ parameters: [
Operation.parameter( Operation.parameter(
:state, :state,
@ -73,7 +73,7 @@ def show_operation do
summary: "Retrieve a report", summary: "Retrieve a report",
operationId: "AdminAPI.ReportController.show", operationId: "AdminAPI.ReportController.show",
parameters: [id_param() | admin_api_params()], parameters: [id_param() | admin_api_params()],
security: [%{"oAuth" => ["read:reports"]}], security: [%{"oAuth" => ["admin:read:reports"]}],
responses: %{ responses: %{
200 => Operation.response("Report", "application/json", report()), 200 => Operation.response("Report", "application/json", report()),
404 => Operation.response("Not Found", "application/json", ApiError) 404 => Operation.response("Not Found", "application/json", ApiError)
@ -86,7 +86,7 @@ def update_operation do
tags: ["Report managment"], tags: ["Report managment"],
summary: "Change state of specified reports", summary: "Change state of specified reports",
operationId: "AdminAPI.ReportController.update", operationId: "AdminAPI.ReportController.update",
security: [%{"oAuth" => ["write:reports"]}], security: [%{"oAuth" => ["admin:write:reports"]}],
parameters: admin_api_params(), parameters: admin_api_params(),
requestBody: request_body("Parameters", update_request(), required: true), requestBody: request_body("Parameters", update_request(), required: true),
responses: %{ responses: %{
@ -110,7 +110,7 @@ def notes_create_operation do
content: %Schema{type: :string, description: "The message"} content: %Schema{type: :string, description: "The message"}
} }
}), }),
security: [%{"oAuth" => ["write:reports"]}], security: [%{"oAuth" => ["admin:write:reports"]}],
responses: %{ responses: %{
204 => no_content_response(), 204 => no_content_response(),
404 => Operation.response("Not Found", "application/json", ApiError) 404 => Operation.response("Not Found", "application/json", ApiError)
@ -128,7 +128,7 @@ def notes_delete_operation do
Operation.parameter(:id, :path, :string, "Note ID") Operation.parameter(:id, :path, :string, "Note ID")
| admin_api_params() | admin_api_params()
], ],
security: [%{"oAuth" => ["write:reports"]}], security: [%{"oAuth" => ["admin:write:reports"]}],
responses: %{ responses: %{
204 => no_content_response(), 204 => no_content_response(),
404 => Operation.response("Not Found", "application/json", ApiError) 404 => Operation.response("Not Found", "application/json", ApiError)

View File

@ -24,7 +24,7 @@ def index_operation do
tags: ["Status administration"], tags: ["Status administration"],
operationId: "AdminAPI.StatusController.index", operationId: "AdminAPI.StatusController.index",
summary: "Get all statuses", summary: "Get all statuses",
security: [%{"oAuth" => ["read:statuses"]}], security: [%{"oAuth" => ["admin:read:statuses"]}],
parameters: [ parameters: [
Operation.parameter( Operation.parameter(
:godmode, :godmode,
@ -74,7 +74,7 @@ def show_operation do
summary: "Get status", summary: "Get status",
operationId: "AdminAPI.StatusController.show", operationId: "AdminAPI.StatusController.show",
parameters: [id_param() | admin_api_params()], parameters: [id_param() | admin_api_params()],
security: [%{"oAuth" => ["read:statuses"]}], security: [%{"oAuth" => ["admin:read:statuses"]}],
responses: %{ responses: %{
200 => Operation.response("Status", "application/json", status()), 200 => Operation.response("Status", "application/json", status()),
404 => Operation.response("Not Found", "application/json", ApiError) 404 => Operation.response("Not Found", "application/json", ApiError)
@ -88,7 +88,7 @@ def update_operation do
summary: "Change the scope of a status", summary: "Change the scope of a status",
operationId: "AdminAPI.StatusController.update", operationId: "AdminAPI.StatusController.update",
parameters: [id_param() | admin_api_params()], parameters: [id_param() | admin_api_params()],
security: [%{"oAuth" => ["write:statuses"]}], security: [%{"oAuth" => ["admin:write:statuses"]}],
requestBody: request_body("Parameters", update_request(), required: true), requestBody: request_body("Parameters", update_request(), required: true),
responses: %{ responses: %{
200 => Operation.response("Status", "application/json", Status), 200 => Operation.response("Status", "application/json", Status),
@ -103,7 +103,7 @@ def delete_operation do
summary: "Delete status", summary: "Delete status",
operationId: "AdminAPI.StatusController.delete", operationId: "AdminAPI.StatusController.delete",
parameters: [id_param() | admin_api_params()], parameters: [id_param() | admin_api_params()],
security: [%{"oAuth" => ["write:statuses"]}], security: [%{"oAuth" => ["admin:write:statuses"]}],
responses: %{ responses: %{
200 => empty_object_response(), 200 => empty_object_response(),
404 => Operation.response("Not Found", "application/json", ApiError) 404 => Operation.response("Not Found", "application/json", ApiError)

View File

@ -16,10 +16,10 @@ def open_api_operation(action) do
def create_operation do def create_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Add new file to the pack", summary: "Add new file to the pack",
operationId: "PleromaAPI.EmojiPackController.add_file", operationId: "PleromaAPI.EmojiPackController.add_file",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
requestBody: request_body("Parameters", create_request(), required: true), requestBody: request_body("Parameters", create_request(), required: true),
parameters: [name_param()], parameters: [name_param()],
responses: %{ responses: %{
@ -62,10 +62,10 @@ defp create_request do
def update_operation do def update_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Add new file to the pack", summary: "Add new file to the pack",
operationId: "PleromaAPI.EmojiPackController.update_file", operationId: "PleromaAPI.EmojiPackController.update_file",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
requestBody: request_body("Parameters", update_request(), required: true), requestBody: request_body("Parameters", update_request(), required: true),
parameters: [name_param()], parameters: [name_param()],
responses: %{ responses: %{
@ -106,10 +106,10 @@ defp update_request do
def delete_operation do def delete_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Delete emoji file from pack", summary: "Delete emoji file from pack",
operationId: "PleromaAPI.EmojiPackController.delete_file", operationId: "PleromaAPI.EmojiPackController.delete_file",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
parameters: [ parameters: [
name_param(), name_param(),
Operation.parameter(:shortcode, :query, :string, "File shortcode", Operation.parameter(:shortcode, :query, :string, "File shortcode",

View File

@ -16,9 +16,9 @@ def open_api_operation(action) do
def remote_operation do def remote_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Make request to another instance for emoji packs list", summary: "Make request to another instance for emoji packs list",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
parameters: [ parameters: [
url_param(), url_param(),
Operation.parameter( Operation.parameter(
@ -115,10 +115,10 @@ def archive_operation do
def download_operation do def download_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Download pack from another instance", summary: "Download pack from another instance",
operationId: "PleromaAPI.EmojiPackController.download", operationId: "PleromaAPI.EmojiPackController.download",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
requestBody: request_body("Parameters", download_request(), required: true), requestBody: request_body("Parameters", download_request(), required: true),
responses: %{ responses: %{
200 => ok_response(), 200 => ok_response(),
@ -145,10 +145,10 @@ defp download_request do
def create_operation do def create_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Create an empty pack", summary: "Create an empty pack",
operationId: "PleromaAPI.EmojiPackController.create", operationId: "PleromaAPI.EmojiPackController.create",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
parameters: [name_param()], parameters: [name_param()],
responses: %{ responses: %{
200 => ok_response(), 200 => ok_response(),
@ -161,10 +161,10 @@ def create_operation do
def delete_operation do def delete_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Delete a custom emoji pack", summary: "Delete a custom emoji pack",
operationId: "PleromaAPI.EmojiPackController.delete", operationId: "PleromaAPI.EmojiPackController.delete",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
parameters: [name_param()], parameters: [name_param()],
responses: %{ responses: %{
200 => ok_response(), 200 => ok_response(),
@ -177,10 +177,10 @@ def delete_operation do
def update_operation do def update_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Updates (replaces) pack metadata", summary: "Updates (replaces) pack metadata",
operationId: "PleromaAPI.EmojiPackController.update", operationId: "PleromaAPI.EmojiPackController.update",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
requestBody: request_body("Parameters", update_request(), required: true), requestBody: request_body("Parameters", update_request(), required: true),
parameters: [name_param()], parameters: [name_param()],
responses: %{ responses: %{
@ -193,10 +193,10 @@ def update_operation do
def import_from_filesystem_operation do def import_from_filesystem_operation do
%Operation{ %Operation{
tags: ["Emoji packs"], tags: ["Emoji pack administration"],
summary: "Imports packs from filesystem", summary: "Imports packs from filesystem",
operationId: "PleromaAPI.EmojiPackController.import", operationId: "PleromaAPI.EmojiPackController.import",
security: [%{"oAuth" => ["write"]}], security: [%{"oAuth" => ["admin:write"]}],
responses: %{ responses: %{
200 => 200 =>
Operation.response("Array of imported pack names", "application/json", %Schema{ Operation.response("Array of imported pack names", "application/json", %Schema{