projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request 'Spin off imports into n oban jobs' (#319) from spin-off-imports...
[akkoma]
/
lib
/
pleroma
/
web
/
api_spec
/
operations
/
pleroma_emoji_file_operation.ex
diff --git
a/lib/pleroma/web/api_spec/operations/pleroma_emoji_file_operation.ex
b/lib/pleroma/web/api_spec/operations/pleroma_emoji_file_operation.ex
index b6932157aef07908bdc10cbb062aa53f9c4f45de..8c76096b5cbc37121d04038a1822c9c08ab9ab4d 100644
(file)
--- a/
lib/pleroma/web/api_spec/operations/pleroma_emoji_file_operation.ex
+++ b/
lib/pleroma/web/api_spec/operations/pleroma_emoji_file_operation.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ApiSpec.PleromaEmojiFileOperation do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ApiSpec.PleromaEmojiFileOperation do
@@
-16,16
+16,19
@@
defmodule Pleroma.Web.ApiSpec.PleromaEmojiFileOperation do
def create_operation do
%Operation{
def create_operation do
%Operation{
- tags: ["Emoji
Packs
"],
+ tags: ["Emoji
pack administration
"],
summary: "Add new file to the pack",
operationId: "PleromaAPI.EmojiPackController.add_file",
summary: "Add new file to the pack",
operationId: "PleromaAPI.EmojiPackController.add_file",
- security: [%{"oAuth" => ["write"]}],
+ security: [%{"oAuth" => ["
admin:
write"]}],
requestBody: request_body("Parameters", create_request(), required: true),
parameters: [name_param()],
responses: %{
200 => Operation.response("Files Object", "application/json", files_object()),
requestBody: request_body("Parameters", create_request(), required: true),
parameters: [name_param()],
responses: %{
200 => Operation.response("Files Object", "application/json", files_object()),
+ 422 => Operation.response("Unprocessable Entity", "application/json", ApiError),
+ 404 => Operation.response("Not Found", "application/json", ApiError),
400 => Operation.response("Bad Request", "application/json", ApiError),
400 => Operation.response("Bad Request", "application/json", ApiError),
- 409 => Operation.response("Conflict", "application/json", ApiError)
+ 409 => Operation.response("Conflict", "application/json", ApiError),
+ 500 => Operation.response("Error", "application/json", ApiError)
}
}
end
}
}
end
@@
-59,16
+62,18
@@
defmodule Pleroma.Web.ApiSpec.PleromaEmojiFileOperation do
def update_operation do
%Operation{
def update_operation do
%Operation{
- tags: ["Emoji
Packs
"],
+ tags: ["Emoji
pack administration
"],
summary: "Add new file to the pack",
operationId: "PleromaAPI.EmojiPackController.update_file",
summary: "Add new file to the pack",
operationId: "PleromaAPI.EmojiPackController.update_file",
- security: [%{"oAuth" => ["write"]}],
+ security: [%{"oAuth" => ["
admin:
write"]}],
requestBody: request_body("Parameters", update_request(), required: true),
parameters: [name_param()],
responses: %{
200 => Operation.response("Files Object", "application/json", files_object()),
requestBody: request_body("Parameters", update_request(), required: true),
parameters: [name_param()],
responses: %{
200 => Operation.response("Files Object", "application/json", files_object()),
+ 404 => Operation.response("Not Found", "application/json", ApiError),
400 => Operation.response("Bad Request", "application/json", ApiError),
400 => Operation.response("Bad Request", "application/json", ApiError),
- 409 => Operation.response("Conflict", "application/json", ApiError)
+ 409 => Operation.response("Conflict", "application/json", ApiError),
+ 422 => Operation.response("Unprocessable Entity", "application/json", ApiError)
}
}
end
}
}
end
@@
-101,10
+106,10
@@
defmodule Pleroma.Web.ApiSpec.PleromaEmojiFileOperation do
def delete_operation do
%Operation{
def delete_operation do
%Operation{
- tags: ["Emoji
Packs
"],
+ tags: ["Emoji
pack administration
"],
summary: "Delete emoji file from pack",
operationId: "PleromaAPI.EmojiPackController.delete_file",
summary: "Delete emoji file from pack",
operationId: "PleromaAPI.EmojiPackController.delete_file",
- security: [%{"oAuth" => ["write"]}],
+ security: [%{"oAuth" => ["
admin:
write"]}],
parameters: [
name_param(),
Operation.parameter(:shortcode, :query, :string, "File shortcode",
parameters: [
name_param(),
Operation.parameter(:shortcode, :query, :string, "File shortcode",
@@
-114,13
+119,15
@@
defmodule Pleroma.Web.ApiSpec.PleromaEmojiFileOperation do
],
responses: %{
200 => Operation.response("Files Object", "application/json", files_object()),
],
responses: %{
200 => Operation.response("Files Object", "application/json", files_object()),
- 400 => Operation.response("Bad Request", "application/json", ApiError)
+ 400 => Operation.response("Bad Request", "application/json", ApiError),
+ 404 => Operation.response("Not Found", "application/json", ApiError),
+ 422 => Operation.response("Unprocessable Entity", "application/json", ApiError)
}
}
end
defp name_param do
}
}
end
defp name_param do
- Operation.parameter(:name, :
path
, :string, "Pack Name", example: "cofe", required: true)
+ Operation.parameter(:name, :
query
, :string, "Pack Name", example: "cofe", required: true)
end
defp files_object do
end
defp files_object do