From b31a934a804aed3f35442ceafe2080b0955e7317 Mon Sep 17 00:00:00 2001 From: dcc Date: Wed, 15 May 2024 00:57:23 -0700 Subject: total rebase --- lib/pleroma/web/api_spec/schemas/account.ex | 0 lib/pleroma/web/api_spec/schemas/account_field.ex | 0 .../web/api_spec/schemas/account_relationship.ex | 0 lib/pleroma/web/api_spec/schemas/actor_type.ex | 0 lib/pleroma/web/api_spec/schemas/announcement.ex | 0 lib/pleroma/web/api_spec/schemas/api_error.ex | 0 lib/pleroma/web/api_spec/schemas/app.ex | 0 lib/pleroma/web/api_spec/schemas/attachment.ex | 2 +- .../web/api_spec/schemas/bookmark_folder.ex | 26 +++++++++++++ lib/pleroma/web/api_spec/schemas/boolean_like.ex | 0 lib/pleroma/web/api_spec/schemas/chat.ex | 0 lib/pleroma/web/api_spec/schemas/chat_message.ex | 0 lib/pleroma/web/api_spec/schemas/conversation.ex | 0 lib/pleroma/web/api_spec/schemas/emoji.ex | 0 lib/pleroma/web/api_spec/schemas/flake_id.ex | 0 lib/pleroma/web/api_spec/schemas/list.ex | 0 lib/pleroma/web/api_spec/schemas/poll.ex | 14 ++++++- .../web/api_spec/schemas/push_subscription.ex | 0 .../web/api_spec/schemas/scheduled_status.ex | 0 lib/pleroma/web/api_spec/schemas/status.ex | 43 ++++++++++++++++++++-- lib/pleroma/web/api_spec/schemas/tag.ex | 0 .../web/api_spec/schemas/visibility_scope.ex | 0 22 files changed, 80 insertions(+), 5 deletions(-) mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/account.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/account_field.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/account_relationship.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/actor_type.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/announcement.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/api_error.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/app.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/attachment.ex create mode 100644 lib/pleroma/web/api_spec/schemas/bookmark_folder.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/boolean_like.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/chat.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/chat_message.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/conversation.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/emoji.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/flake_id.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/list.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/poll.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/push_subscription.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/scheduled_status.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/status.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/tag.ex mode change 100755 => 100644 lib/pleroma/web/api_spec/schemas/visibility_scope.ex (limited to 'lib/pleroma/web/api_spec/schemas') diff --git a/lib/pleroma/web/api_spec/schemas/account.ex b/lib/pleroma/web/api_spec/schemas/account.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/account_field.ex b/lib/pleroma/web/api_spec/schemas/account_field.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/account_relationship.ex b/lib/pleroma/web/api_spec/schemas/account_relationship.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/actor_type.ex b/lib/pleroma/web/api_spec/schemas/actor_type.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/announcement.ex b/lib/pleroma/web/api_spec/schemas/announcement.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/api_error.ex b/lib/pleroma/web/api_spec/schemas/api_error.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/app.ex b/lib/pleroma/web/api_spec/schemas/app.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/attachment.ex b/lib/pleroma/web/api_spec/schemas/attachment.ex old mode 100755 new mode 100644 index 48634a1..2871b5f --- a/lib/pleroma/web/api_spec/schemas/attachment.ex +++ b/lib/pleroma/web/api_spec/schemas/attachment.ex @@ -11,7 +11,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Attachment do title: "Attachment", description: "Represents a file or media attachment that can be added to a status.", type: :object, - requried: [:id, :url, :preview_url], + required: [:id, :url, :preview_url], properties: %{ id: %Schema{type: :string, description: "The ID of the attachment in the database."}, url: %Schema{ diff --git a/lib/pleroma/web/api_spec/schemas/bookmark_folder.ex b/lib/pleroma/web/api_spec/schemas/bookmark_folder.ex new file mode 100644 index 0000000..e8b4f43 --- /dev/null +++ b/lib/pleroma/web/api_spec/schemas/bookmark_folder.ex @@ -0,0 +1,26 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2024 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.ApiSpec.Schemas.BookmarkFolder do + alias OpenApiSpex.Schema + alias Pleroma.Web.ApiSpec.Schemas.FlakeID + + require OpenApiSpex + + OpenApiSpex.schema(%{ + title: "BookmarkFolder", + description: "Response schema for a bookmark folder", + type: :object, + properties: %{ + id: FlakeID, + name: %Schema{type: :string, description: "Folder name"}, + emoji: %Schema{type: :string, description: "Folder emoji", nullable: true} + }, + example: %{ + "id" => "9toJCu5YZW7O7gfvH6", + "name" => "Read later", + "emoji" => nil + } + }) +end diff --git a/lib/pleroma/web/api_spec/schemas/boolean_like.ex b/lib/pleroma/web/api_spec/schemas/boolean_like.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/chat.ex b/lib/pleroma/web/api_spec/schemas/chat.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/chat_message.ex b/lib/pleroma/web/api_spec/schemas/chat_message.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/conversation.ex b/lib/pleroma/web/api_spec/schemas/conversation.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/emoji.ex b/lib/pleroma/web/api_spec/schemas/emoji.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/flake_id.ex b/lib/pleroma/web/api_spec/schemas/flake_id.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/list.ex b/lib/pleroma/web/api_spec/schemas/list.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/poll.ex b/lib/pleroma/web/api_spec/schemas/poll.ex old mode 100755 new mode 100644 index 9157058..20cf5b0 --- a/lib/pleroma/web/api_spec/schemas/poll.ex +++ b/lib/pleroma/web/api_spec/schemas/poll.ex @@ -56,6 +56,15 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Poll do } }, description: "Possible answers for the poll." + }, + pleroma: %Schema{ + type: :object, + properties: %{ + non_anonymous: %Schema{ + type: :boolean, + description: "Can voters be publicly identified?" + } + } } }, example: %{ @@ -79,7 +88,10 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Poll do votes_count: 4 } ], - emojis: [] + emojis: [], + pleroma: %{ + non_anonymous: false + } } }) end diff --git a/lib/pleroma/web/api_spec/schemas/push_subscription.ex b/lib/pleroma/web/api_spec/schemas/push_subscription.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/scheduled_status.ex b/lib/pleroma/web/api_spec/schemas/scheduled_status.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/status.ex b/lib/pleroma/web/api_spec/schemas/status.ex old mode 100755 new mode 100644 index 698f117..6e537b5 --- a/lib/pleroma/web/api_spec/schemas/status.ex +++ b/lib/pleroma/web/api_spec/schemas/status.ex @@ -58,6 +58,10 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do format: :uri, description: "Preview thumbnail" }, + image_description: %Schema{ + type: :string, + description: "Alternate text that describes what is in the thumbnail" + }, title: %Schema{type: :string, description: "Title of linked resource"}, description: %Schema{type: :string, description: "Description of preview"} } @@ -144,7 +148,11 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do properties: %{ content: %Schema{ type: :object, - additionalProperties: %Schema{type: :string}, + additionalProperties: %Schema{ + type: :string, + description: "Alternate representation in the MIME type specified", + extensions: %{"x-additionalPropertiesName": "MIME type"} + }, description: "A map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`" }, @@ -189,13 +197,41 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do nullable: true, description: "The `acct` property of User entity for replied user (if any)" }, + quote: %Schema{ + allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}], + nullable: true, + description: "Quoted status (if any)" + }, + quote_id: %Schema{ + nullable: true, + allOf: [FlakeID], + description: "ID of the status being quoted, if any" + }, + quote_url: %Schema{ + type: :string, + format: :uri, + nullable: true, + description: "URL of the quoted status" + }, + quote_visible: %Schema{ + type: :boolean, + description: "`true` if the quoted post is visible to the user" + }, + quotes_count: %Schema{ + type: :integer, + description: "How many statuses quoted this status" + }, local: %Schema{ type: :boolean, description: "`true` if the post was made on the local instance" }, spoiler_text: %Schema{ type: :object, - additionalProperties: %Schema{type: :string}, + additionalProperties: %Schema{ + type: :string, + description: "Alternate representation in the MIME type specified", + extensions: %{"x-additionalPropertiesName": "MIME type"} + }, description: "A map consisting of alternate representations of the `spoiler_text` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain`." }, @@ -339,7 +375,8 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do "in_reply_to_account_acct" => nil, "local" => true, "spoiler_text" => %{"text/plain" => ""}, - "thread_muted" => false + "thread_muted" => false, + "quotes_count" => 0 }, "poll" => nil, "reblog" => nil, diff --git a/lib/pleroma/web/api_spec/schemas/tag.ex b/lib/pleroma/web/api_spec/schemas/tag.ex old mode 100755 new mode 100644 diff --git a/lib/pleroma/web/api_spec/schemas/visibility_scope.ex b/lib/pleroma/web/api_spec/schemas/visibility_scope.ex old mode 100755 new mode 100644 -- cgit v1.2.3