1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 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"
80 description: "The date when this status was last edited"
85 description: "Custom emoji to be used when rendering status content"
87 favourited: %Schema{type: :boolean, description: "Have you favourited this status?"},
88 favourites_count: %Schema{
90 description: "How many favourites this status has received"
93 in_reply_to_account_id: %Schema{
96 description: "ID of the account being replied to"
98 in_reply_to_id: %Schema{
101 description: "ID of the status being replied"
106 description: "Primary language of this status"
108 media_attachments: %Schema{
111 description: "Media that is attached to this status"
115 description: "Mentions of users within the status content",
119 id: %Schema{allOf: [FlakeID], description: "The account id of the mentioned user"},
123 "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users."
125 username: %Schema{type: :string, description: "The username of the mentioned user"},
129 description: "The location of the mentioned user's profile"
136 description: "Have you muted notifications for this status's conversation?"
140 description: "Have you pinned this status? Only appears if the status is pinnable."
147 additionalProperties: %Schema{type: :string},
149 "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`"
153 description: "The thread identifier the status is associated with"
155 conversation_id: %Schema{
159 "The ID of the AP context the status is associated with (if any); deprecated, please use `context` instead"
161 direct_conversation_id: %Schema{
165 "The ID of the Mastodon direct message conversation the status is associated with (if any)"
167 emoji_reactions: %Schema{
170 "A list with emoji / reaction maps. Contains no information about the reacting users, for that use the /statuses/:id/reactions endpoint.",
174 name: %Schema{type: :string},
175 count: %Schema{type: :integer},
176 me: %Schema{type: :boolean}
185 "A datetime (ISO 8601) that states when the post will expire (be deleted automatically), or empty if the post won't expire"
187 in_reply_to_account_acct: %Schema{
190 description: "The `acct` property of User entity for replied user (if any)"
194 description: "`true` if the post was made on the local instance"
196 spoiler_text: %Schema{
198 additionalProperties: %Schema{type: :string},
200 "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`."
202 thread_muted: %Schema{
204 description: "`true` if the thread the post belongs to is muted"
206 parent_visible: %Schema{
208 description: "`true` if the parent post is visible to the user"
215 "A datetime (ISO 8601) that states when the post was pinned or `null` if the post is not pinned"
219 poll: %Schema{allOf: [Poll], nullable: true, description: "The poll attached to the status"},
221 allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
223 description: "The status being reblogged"
225 reblogged: %Schema{type: :boolean, description: "Have you boosted this status?"},
226 reblogs_count: %Schema{
228 description: "How many boosts this status has received"
230 replies_count: %Schema{
232 description: "How many replies this status has received"
236 description: "Is this status marked as sensitive content?"
238 spoiler_text: %Schema{
241 "Subject or summary line, below which status content is collapsed until expanded"
243 tags: %Schema{type: :array, items: Tag},
247 description: "URI of the status used for federation"
253 description: "A link to the status's HTML representation"
256 allOf: [VisibilityScope],
257 description: "Visibility of this status"
263 "avatar" => "http://localhost:4001/images/avi.png",
264 "avatar_static" => "http://localhost:4001/images/avi.png",
266 "created_at" => "2020-04-07T19:48:51.000Z",
267 "display_name" => "Test テスト User 6",
270 "followers_count" => 1,
271 "following_count" => 0,
272 "header" => "http://localhost:4001/images/banner.png",
273 "header_static" => "http://localhost:4001/images/banner.png",
274 "id" => "9toJCsKN7SmSf3aj5c",
275 "is_locked" => false,
276 "note" => "Tester Number 6",
278 "background_image" => nil,
279 "is_confirmed" => true,
280 "hide_favorites" => true,
281 "hide_followers" => false,
282 "hide_followers_count" => false,
283 "hide_follows" => false,
284 "hide_follows_count" => false,
286 "is_moderator" => false,
288 "blocked_by" => false,
290 "domain_blocking" => false,
292 "followed_by" => false,
294 "id" => "9toJCsKN7SmSf3aj5c",
296 "muting_notifications" => false,
298 "requested" => false,
299 "showing_reblogs" => true,
300 "subscribing" => false,
303 "skip_thread_containment" => false,
308 "note" => "Tester Number 6",
309 "pleroma" => %{"actor_type" => "Person", "discoverable" => false},
312 "statuses_count" => 1,
313 "url" => "http://localhost:4001/users/nick6",
314 "username" => "nick6"
316 "application" => nil,
317 "bookmarked" => false,
319 "content" => "foobar",
320 "created_at" => "2020-04-07T19:48:51.000Z",
322 "favourited" => false,
323 "favourites_count" => 0,
324 "id" => "9toJCu5YZW7O7gfvH6",
325 "in_reply_to_account_id" => nil,
326 "in_reply_to_id" => nil,
328 "media_attachments" => [],
333 "content" => %{"text/plain" => "foobar"},
334 "context" => "http://localhost:4001/objects/8b4c0c80-6a37-4d2a-b1b9-05a19e3875aa",
335 "conversation_id" => 345_972,
336 "direct_conversation_id" => nil,
337 "emoji_reactions" => [],
339 "in_reply_to_account_acct" => nil,
341 "spoiler_text" => %{"text/plain" => ""},
342 "thread_muted" => false
346 "reblogged" => false,
347 "reblogs_count" => 0,
348 "replies_count" => 0,
349 "sensitive" => false,
350 "spoiler_text" => "",
352 "uri" => "http://localhost:4001/objects/0f5dad44-0e9e-4610-b377-a2631e499190",
353 "url" => "http://localhost:4001/notice/9toJCu5YZW7O7gfvH6",
354 "visibility" => "private"