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"
190 poll: %Schema{allOf: [Poll], nullable: true, description: "The poll attached to the status"},
192 allOf: [%OpenApiSpex.Reference{"$ref": "#/components/schemas/Status"}],
194 description: "The status being reblogged"
196 reblogged: %Schema{type: :boolean, description: "Have you boosted this status?"},
197 reblogs_count: %Schema{
199 description: "How many boosts this status has received"
201 replies_count: %Schema{
203 description: "How many replies this status has received"
207 description: "Is this status marked as sensitive content?"
209 spoiler_text: %Schema{
212 "Subject or summary line, below which status content is collapsed until expanded"
214 tags: %Schema{type: :array, items: Tag},
218 description: "URI of the status used for federation"
224 description: "A link to the status's HTML representation"
227 allOf: [VisibilityScope],
228 description: "Visibility of this status"
234 "avatar" => "http://localhost:4001/images/avi.png",
235 "avatar_static" => "http://localhost:4001/images/avi.png",
237 "created_at" => "2020-04-07T19:48:51.000Z",
238 "display_name" => "Test テスト User 6",
241 "followers_count" => 1,
242 "following_count" => 0,
243 "header" => "http://localhost:4001/images/banner.png",
244 "header_static" => "http://localhost:4001/images/banner.png",
245 "id" => "9toJCsKN7SmSf3aj5c",
247 "note" => "Tester Number 6",
249 "background_image" => nil,
250 "confirmation_pending" => false,
251 "hide_favorites" => true,
252 "hide_followers" => false,
253 "hide_followers_count" => false,
254 "hide_follows" => false,
255 "hide_follows_count" => false,
257 "is_moderator" => false,
259 "blocked_by" => false,
261 "domain_blocking" => false,
263 "followed_by" => false,
265 "id" => "9toJCsKN7SmSf3aj5c",
267 "muting_notifications" => false,
268 "requested" => false,
269 "showing_reblogs" => true,
270 "subscribing" => false
272 "skip_thread_containment" => false,
277 "note" => "Tester Number 6",
278 "pleroma" => %{"actor_type" => "Person", "discoverable" => false},
281 "statuses_count" => 1,
282 "url" => "http://localhost:4001/users/nick6",
283 "username" => "nick6"
285 "application" => %{"name" => "Web", "website" => nil},
286 "bookmarked" => false,
288 "content" => "foobar",
289 "created_at" => "2020-04-07T19:48:51.000Z",
291 "favourited" => false,
292 "favourites_count" => 0,
293 "id" => "9toJCu5YZW7O7gfvH6",
294 "in_reply_to_account_id" => nil,
295 "in_reply_to_id" => nil,
297 "media_attachments" => [],
302 "content" => %{"text/plain" => "foobar"},
303 "conversation_id" => 345_972,
304 "direct_conversation_id" => nil,
305 "emoji_reactions" => [],
307 "in_reply_to_account_acct" => nil,
309 "spoiler_text" => %{"text/plain" => ""},
310 "thread_muted" => false
314 "reblogged" => false,
315 "reblogs_count" => 0,
316 "replies_count" => 0,
317 "sensitive" => false,
318 "spoiler_text" => "",
320 "uri" => "http://localhost:4001/objects/0f5dad44-0e9e-4610-b377-a2631e499190",
321 "url" => "http://localhost:4001/notice/9toJCu5YZW7O7gfvH6",
322 "visibility" => "private"