1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ApiSpec.Schemas.Status do
6 alias OpenApiSpex.Schema
7 alias Pleroma.Web.ApiSpec.Schemas.Account
8 alias Pleroma.Web.ApiSpec.Schemas.Attachment
9 alias Pleroma.Web.ApiSpec.Schemas.Emoji
10 alias Pleroma.Web.ApiSpec.Schemas.FlakeID
11 alias Pleroma.Web.ApiSpec.Schemas.Poll
12 alias Pleroma.Web.ApiSpec.Schemas.Tag
13 alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
19 description: "Response schema for a status",
22 account: %Schema{allOf: [Account], description: "The account that authored this status"},
24 description: "The application used to post this status",
27 name: %Schema{type: :string},
28 website: %Schema{type: :string, nullable: true, format: :uri}
31 bookmarked: %Schema{type: :boolean, description: "Have you bookmarked this status?"},
35 description: "Preview card for links included within status content",
36 required: [:url, :title, :description, :type],
40 enum: ["link", "photo", "video", "rich"],
41 description: "The type of the preview card"
43 provider_name: %Schema{
46 description: "The provider of the original resource"
48 provider_url: %Schema{
51 description: "A link to the provider of the original resource"
53 url: %Schema{type: :string, format: :uri, description: "Location of linked resource"},
58 description: "Preview thumbnail"
60 title: %Schema{type: :string, description: "Title of linked resource"},
61 description: %Schema{type: :string, description: "Description of preview"}
64 content: %Schema{type: :string, format: :html, description: "HTML-encoded status content"},
68 description: "The date when this status was created"
73 description: "Custom emoji to be used when rendering status content"
75 favourited: %Schema{type: :boolean, description: "Have you favourited this status?"},
76 favourites_count: %Schema{
78 description: "How many favourites this status has received"
81 in_reply_to_account_id: %Schema{
84 description: "ID of the account being replied to"
86 in_reply_to_id: %Schema{
89 description: "ID of the status being replied"
94 description: "Primary language of this status"
96 media_attachments: %Schema{
99 description: "Media that is attached to this status"
103 description: "Mentions of users within the status content",
107 id: %Schema{allOf: [FlakeID], description: "The account id of the mentioned user"},
111 "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users."
113 username: %Schema{type: :string, description: "The username of the mentioned user"},
117 description: "The location of the mentioned user's profile"
124 description: "Have you muted notifications for this status's conversation?"
128 description: "Have you pinned this status? Only appears if the status is pinnable."
135 additionalProperties: %Schema{type: :string},
137 "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`"
139 conversation_id: %Schema{
141 description: "The ID of the AP context the status is associated with (if any)"
143 direct_conversation_id: %Schema{
147 "The ID of the Mastodon direct message conversation the status is associated with (if any)"
149 emoji_reactions: %Schema{
152 "A list with emoji / reaction maps. Contains no information about the reacting users, for that use the /statuses/:id/reactions endpoint.",
156 name: %Schema{type: :string},
157 count: %Schema{type: :integer},
158 me: %Schema{type: :boolean}
167 "A datetime (ISO 8601) that states when the post will expire (be deleted automatically), or empty if the post won't expire"
169 in_reply_to_account_acct: %Schema{
172 description: "The `acct` property of User entity for replied user (if any)"
176 description: "`true` if the post was made on the local instance"
178 spoiler_text: %Schema{
180 additionalProperties: %Schema{type: :string},
182 "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`."
184 thread_muted: %Schema{
186 description: "`true` if the thread the post belongs to is muted"
188 parent_visible: %Schema{
190 description: "`true` if the parent post is visible to the user"
194 poll: %Schema{allOf: [Poll], nullable: true, description: "The poll attached to the status"},
196 allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
198 description: "The status being reblogged"
200 reblogged: %Schema{type: :boolean, description: "Have you boosted this status?"},
201 reblogs_count: %Schema{
203 description: "How many boosts this status has received"
205 replies_count: %Schema{
207 description: "How many replies this status has received"
211 description: "Is this status marked as sensitive content?"
213 spoiler_text: %Schema{
216 "Subject or summary line, below which status content is collapsed until expanded"
218 tags: %Schema{type: :array, items: Tag},
222 description: "URI of the status used for federation"
228 description: "A link to the status's HTML representation"
231 allOf: [VisibilityScope],
232 description: "Visibility of this status"
238 "avatar" => "http://localhost:4001/images/avi.png",
239 "avatar_static" => "http://localhost:4001/images/avi.png",
241 "created_at" => "2020-04-07T19:48:51.000Z",
242 "display_name" => "Test テスト User 6",
245 "followers_count" => 1,
246 "following_count" => 0,
247 "header" => "http://localhost:4001/images/banner.png",
248 "header_static" => "http://localhost:4001/images/banner.png",
249 "id" => "9toJCsKN7SmSf3aj5c",
251 "note" => "Tester Number 6",
253 "background_image" => nil,
254 "confirmation_pending" => false,
255 "hide_favorites" => true,
256 "hide_followers" => false,
257 "hide_followers_count" => false,
258 "hide_follows" => false,
259 "hide_follows_count" => false,
261 "is_moderator" => false,
263 "blocked_by" => false,
265 "domain_blocking" => false,
267 "followed_by" => false,
269 "id" => "9toJCsKN7SmSf3aj5c",
271 "muting_notifications" => false,
272 "requested" => false,
273 "showing_reblogs" => true,
274 "subscribing" => false
276 "skip_thread_containment" => false,
281 "note" => "Tester Number 6",
282 "pleroma" => %{"actor_type" => "Person", "discoverable" => false},
285 "statuses_count" => 1,
286 "url" => "http://localhost:4001/users/nick6",
287 "username" => "nick6"
289 "application" => %{"name" => "Web", "website" => nil},
290 "bookmarked" => false,
292 "content" => "foobar",
293 "created_at" => "2020-04-07T19:48:51.000Z",
295 "favourited" => false,
296 "favourites_count" => 0,
297 "id" => "9toJCu5YZW7O7gfvH6",
298 "in_reply_to_account_id" => nil,
299 "in_reply_to_id" => nil,
301 "media_attachments" => [],
306 "content" => %{"text/plain" => "foobar"},
307 "conversation_id" => 345_972,
308 "direct_conversation_id" => nil,
309 "emoji_reactions" => [],
311 "in_reply_to_account_acct" => nil,
313 "spoiler_text" => %{"text/plain" => ""},
314 "thread_muted" => false
318 "reblogged" => false,
319 "reblogs_count" => 0,
320 "replies_count" => 0,
321 "sensitive" => false,
322 "spoiler_text" => "",
324 "uri" => "http://localhost:4001/objects/0f5dad44-0e9e-4610-b377-a2631e499190",
325 "url" => "http://localhost:4001/notice/9toJCu5YZW7O7gfvH6",
326 "visibility" => "private"