1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 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",
28 name: %Schema{type: :string},
29 website: %Schema{type: :string, format: :uri}
32 bookmarked: %Schema{type: :boolean, description: "Have you bookmarked this status?"},
36 description: "Preview card for links included within status content",
37 required: [:url, :title, :description, :type],
41 enum: ["link", "photo", "video", "rich"],
42 description: "The type of the preview card"
44 provider_name: %Schema{
47 description: "The provider of the original resource"
49 provider_url: %Schema{
52 description: "A link to the provider of the original resource"
54 url: %Schema{type: :string, format: :uri, description: "Location of linked resource"},
59 description: "Preview thumbnail"
61 title: %Schema{type: :string, description: "Title of linked resource"},
62 description: %Schema{type: :string, description: "Description of preview"}
65 content: %Schema{type: :string, format: :html, description: "HTML-encoded status content"},
68 description: "Original unformatted content in plain text",
74 description: "The date when this status was created"
79 description: "Custom emoji to be used when rendering status content"
81 favourited: %Schema{type: :boolean, description: "Have you favourited this status?"},
82 favourites_count: %Schema{
84 description: "How many favourites this status has received"
87 in_reply_to_account_id: %Schema{
90 description: "ID of the account being replied to"
92 in_reply_to_id: %Schema{
95 description: "ID of the status being replied"
100 description: "Primary language of this status"
102 media_attachments: %Schema{
105 description: "Media that is attached to this status"
109 description: "Mentions of users within the status content",
113 id: %Schema{allOf: [FlakeID], description: "The account id of the mentioned user"},
117 "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users."
119 username: %Schema{type: :string, description: "The username of the mentioned user"},
123 description: "The location of the mentioned user's profile"
130 description: "Have you muted notifications for this status's conversation?"
134 description: "Have you pinned this status? Only appears if the status is pinnable."
138 description: "ID of the status being quoted",
142 allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
144 description: "Quoted status (if any)"
151 additionalProperties: %Schema{type: :string},
153 "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`"
157 description: "The thread identifier the status is associated with"
159 conversation_id: %Schema{
163 "The ID of the AP context the status is associated with (if any); deprecated, please use `context` instead"
165 direct_conversation_id: %Schema{
169 "The ID of the Mastodon direct message conversation the status is associated with (if any)"
171 emoji_reactions: %Schema{
174 "A list with emoji / reaction maps. Contains no information about the reacting users, for that use the /statuses/:id/reactions endpoint.",
178 name: %Schema{type: :string},
179 count: %Schema{type: :integer},
180 me: %Schema{type: :boolean}
189 "A datetime (ISO 8601) that states when the post will expire (be deleted automatically), or empty if the post won't expire"
191 in_reply_to_account_acct: %Schema{
194 description: "The `acct` property of User entity for replied user (if any)"
198 description: "`true` if the post was made on the local instance"
200 spoiler_text: %Schema{
202 additionalProperties: %Schema{type: :string},
204 "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`."
206 thread_muted: %Schema{
208 description: "`true` if the thread the post belongs to is muted"
210 parent_visible: %Schema{
212 description: "`true` if the parent post is visible to the user"
219 "A datetime (ISO 8601) that states when the post was pinned or `null` if the post is not pinned"
229 %Schema{type: :string, example: 'plaintext content'},
235 description: "The source content of the status",
240 description: "The source MIME type of the status",
241 example: "text/plain",
250 poll: %Schema{allOf: [Poll], nullable: true, description: "The poll attached to the status"},
252 allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
254 description: "The status being reblogged"
256 reblogged: %Schema{type: :boolean, description: "Have you boosted this status?"},
257 reblogs_count: %Schema{
259 description: "How many boosts this status has received"
261 replies_count: %Schema{
263 description: "How many replies this status has received"
267 description: "Is this status marked as sensitive content?"
269 spoiler_text: %Schema{
272 "Subject or summary line, below which status content is collapsed until expanded"
274 tags: %Schema{type: :array, items: Tag},
278 description: "URI of the status used for federation"
284 description: "A link to the status's HTML representation"
287 allOf: [VisibilityScope],
288 description: "Visibility of this status"
294 "avatar" => "http://localhost:4001/images/avi.png",
295 "avatar_static" => "http://localhost:4001/images/avi.png",
297 "created_at" => "2020-04-07T19:48:51.000Z",
298 "display_name" => "Test テスト User 6",
301 "followers_count" => 1,
302 "following_count" => 0,
303 "header" => "http://localhost:4001/images/banner.png",
304 "header_static" => "http://localhost:4001/images/banner.png",
305 "id" => "9toJCsKN7SmSf3aj5c",
306 "is_locked" => false,
307 "note" => "Tester Number 6",
309 "background_image" => nil,
310 "is_confirmed" => true,
311 "hide_favorites" => true,
312 "hide_followers" => false,
313 "hide_followers_count" => false,
314 "hide_follows" => false,
315 "hide_follows_count" => false,
317 "is_moderator" => false,
319 "blocked_by" => false,
321 "domain_blocking" => false,
323 "followed_by" => false,
325 "id" => "9toJCsKN7SmSf3aj5c",
327 "muting_notifications" => false,
329 "requested" => false,
330 "showing_reblogs" => true,
331 "subscribing" => false,
334 "skip_thread_containment" => false,
339 "note" => "Tester Number 6",
340 "pleroma" => %{"actor_type" => "Person", "discoverable" => false},
343 "statuses_count" => 1,
344 "url" => "http://localhost:4001/users/nick6",
345 "username" => "nick6"
347 "application" => nil,
348 "bookmarked" => false,
350 "content" => "foobar",
351 "created_at" => "2020-04-07T19:48:51.000Z",
353 "favourited" => false,
354 "favourites_count" => 0,
355 "id" => "9toJCu5YZW7O7gfvH6",
356 "in_reply_to_account_id" => nil,
357 "in_reply_to_id" => nil,
359 "media_attachments" => [],
364 "content" => %{"text/plain" => "foobar"},
365 "context" => "http://localhost:4001/objects/8b4c0c80-6a37-4d2a-b1b9-05a19e3875aa",
366 "conversation_id" => 345_972,
367 "direct_conversation_id" => nil,
368 "emoji_reactions" => [],
370 "in_reply_to_account_acct" => nil,
372 "spoiler_text" => %{"text/plain" => ""},
373 "thread_muted" => false
377 "reblogged" => false,
378 "reblogs_count" => 0,
379 "replies_count" => 0,
380 "sensitive" => false,
381 "spoiler_text" => "",
383 "uri" => "http://localhost:4001/objects/0f5dad44-0e9e-4610-b377-a2631e499190",
384 "url" => "http://localhost:4001/notice/9toJCu5YZW7O7gfvH6",
385 "visibility" => "private"