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.Account do
6 alias OpenApiSpex.Schema
7 alias Pleroma.Web.ApiSpec.Schemas.AccountField
8 alias Pleroma.Web.ApiSpec.Schemas.AccountRelationship
9 alias Pleroma.Web.ApiSpec.Schemas.ActorType
10 alias Pleroma.Web.ApiSpec.Schemas.Emoji
11 alias Pleroma.Web.ApiSpec.Schemas.FlakeID
12 alias Pleroma.Web.ApiSpec.Schemas.VisibilityScope
18 description: "Response schema for an account",
21 acct: %Schema{type: :string},
22 avatar_static: %Schema{type: :string, format: :uri},
23 avatar: %Schema{type: :string, format: :uri},
24 bot: %Schema{type: :boolean},
25 created_at: %Schema{type: :string, format: "date-time"},
26 display_name: %Schema{type: :string},
27 emojis: %Schema{type: :array, items: Emoji},
28 fields: %Schema{type: :array, items: AccountField},
29 follow_requests_count: %Schema{type: :integer},
30 followers_count: %Schema{type: :integer},
31 following_count: %Schema{type: :integer},
32 header_static: %Schema{type: :string, format: :uri},
33 header: %Schema{type: :string, format: :uri},
35 locked: %Schema{type: :boolean},
36 note: %Schema{type: :string, format: :html},
37 statuses_count: %Schema{type: :integer},
38 url: %Schema{type: :string, format: :uri},
39 username: %Schema{type: :string},
43 allow_following_move: %Schema{
45 description: "whether the user allows automatically follow moved following accounts"
47 background_image: %Schema{type: :string, nullable: true, format: :uri},
48 chat_token: %Schema{type: :string},
49 confirmation_pending: %Schema{
52 "whether the user account is waiting on email confirmation to be activated"
54 hide_favorites: %Schema{type: :boolean},
55 hide_followers_count: %Schema{
57 description: "whether the user has follower stat hiding enabled"
59 hide_followers: %Schema{
61 description: "whether the user has follower hiding enabled"
63 hide_follows_count: %Schema{
65 description: "whether the user has follow stat hiding enabled"
67 hide_follows: %Schema{
69 description: "whether the user has follow hiding enabled"
73 description: "whether the user is an admin of the local instance"
75 is_moderator: %Schema{
77 description: "whether the user is a moderator of the local instance"
79 skip_thread_containment: %Schema{type: :boolean},
82 items: %Schema{type: :string},
84 "List of tags being used for things like extra roles or moderation(ie. marking all media as nsfw all)."
86 unread_conversation_count: %Schema{
88 description: "The count of unread conversations. Only returned to the account owner."
90 notification_settings: %Schema{
93 block_from_strangers: %Schema{type: :boolean},
94 hide_notification_contents: %Schema{type: :boolean}
97 relationship: AccountRelationship,
98 settings_store: %Schema{
101 "A generic map of settings for frontends. Opaque to the backend. Only returned in `verify_credentials` and `update_credentials`"
103 accepts_chat_messages: %Schema{type: :boolean, nullable: true},
108 description: "Favicon image of the user's instance"
115 fields: %Schema{type: :array, items: AccountField},
119 "Plaintext version of the bio without formatting applied by the backend, used for editing the bio."
121 privacy: VisibilityScope,
122 sensitive: %Schema{type: :boolean},
126 actor_type: ActorType,
127 discoverable: %Schema{
130 "whether the user allows indexing / listing of the account by external services (search engines etc.)."
132 no_rich_text: %Schema{
135 "whether the HTML tags for rich-text formatting are stripped from all statuses requested from the API."
140 "whether the user wants their role (e.g admin, moderator) to be shown"
149 "avatar" => "https://mypleroma.com/images/avi.png",
150 "avatar_static" => "https://mypleroma.com/images/avi.png",
152 "created_at" => "2020-03-24T13:05:58.000Z",
153 "display_name" => "foobar",
156 "follow_requests_count" => 0,
157 "followers_count" => 0,
158 "following_count" => 1,
159 "header" => "https://mypleroma.com/images/banner.png",
160 "header_static" => "https://mypleroma.com/images/banner.png",
161 "id" => "9tKi3esbG7OQgZ2920",
165 "allow_following_move" => true,
166 "background_image" => nil,
167 "confirmation_pending" => true,
168 "hide_favorites" => true,
169 "hide_followers" => false,
170 "hide_followers_count" => false,
171 "hide_follows" => false,
172 "hide_follows_count" => false,
174 "is_moderator" => false,
175 "skip_thread_containment" => false,
176 "accepts_chat_messages" => true,
178 "SFMyNTY.g3QAAAACZAAEZGF0YW0AAAASOXRLaTNlc2JHN09RZ1oyOTIwZAAGc2lnbmVkbgYARNplS3EB.Mb_Iaqew2bN1I1o79B_iP7encmVCpTKC4OtHZRxdjKc",
179 "unread_conversation_count" => 0,
181 "notification_settings" => %{
182 "block_from_strangers" => false,
183 "hide_notification_contents" => false
186 "blocked_by" => false,
188 "domain_blocking" => false,
190 "followed_by" => false,
191 "following" => false,
192 "id" => "9tKi3esbG7OQgZ2920",
194 "muting_notifications" => false,
195 "requested" => false,
196 "showing_reblogs" => true,
197 "subscribing" => false
199 "settings_store" => %{
207 "actor_type" => "Person",
208 "discoverable" => false,
209 "no_rich_text" => false,
212 "privacy" => "public",
215 "statuses_count" => 0,
216 "url" => "https://mypleroma.com/users/foobar",
217 "username" => "foobar"