|
| 1 | +import { type HttpMetaParams } from "../../../interfaces/index.js"; |
| 2 | +import { |
| 3 | + type AccountCredentials, |
| 4 | + type AccountField, |
| 5 | + type Profile, |
| 6 | +} from "../../entities/v1/index.js"; |
1 | 7 | import { type Method } from "../../method.js"; |
2 | 8 |
|
| 9 | +export interface UpdateProfileParams { |
| 10 | + /** The display name to use for the profile. */ |
| 11 | + readonly displayName?: string | null; |
| 12 | + /** The account bio. */ |
| 13 | + readonly note?: string | null; |
| 14 | + /** Avatar image encoded using multipart/form-data */ |
| 15 | + readonly avatar?: Blob | string | null; |
| 16 | + /** A textual description of the avatar. */ |
| 17 | + readonly avatarDescription?: string | null; |
| 18 | + /** Header image encoded using multipart/form-data */ |
| 19 | + readonly header?: Blob | string | null; |
| 20 | + /** A textual description of the header. */ |
| 21 | + readonly headerDescription?: string | null; |
| 22 | + /** Whether manual approval of follow requests is required. */ |
| 23 | + readonly locked?: boolean | null; |
| 24 | + /** Whether the account has a bot flag. */ |
| 25 | + readonly bot?: boolean | null; |
| 26 | + /** Whether the account should be shown in the profile directory. */ |
| 27 | + readonly discoverable?: boolean | null; |
| 28 | + /** Whether you want to hide followers and followings on your profile. */ |
| 29 | + readonly hideCollections?: boolean | null; |
| 30 | + /** Whether the account allows indexing by search engines. */ |
| 31 | + readonly indexable?: boolean | null; |
| 32 | + /** Whether the account wishes to have a "Media" tab with media attachments on their profile. */ |
| 33 | + readonly showMedia?: boolean | null; |
| 34 | + /** Whether the account wishes to have replies in the "Media" tab on their profile. */ |
| 35 | + readonly showMediaReplies?: boolean | null; |
| 36 | + /** Whether the account wishes to have a "Featured" tab on their profile. */ |
| 37 | + readonly showFeatured?: boolean | null; |
| 38 | + /** Domains of websites allowed to credit the account. */ |
| 39 | + readonly attributionDomains?: string[] | null; |
| 40 | + /** Profile metadata `name` and `value`. */ |
| 41 | + readonly fieldsAttributes?: AccountField[] | null; |
| 42 | +} |
| 43 | + |
3 | 44 | export interface ProfileAvatarResource { |
4 | | - /**https://github.com/mastodon/mastodon/pull/25124 */ |
5 | | - remove: Method<void>; |
| 45 | + /** @see https://docs.joinmastodon.org/methods/profile/#delete-profile-avatar */ |
| 46 | + remove: Method<AccountCredentials>; |
6 | 47 | } |
7 | 48 |
|
8 | 49 | export interface ProfileHeaderResource { |
9 | | - /**https://github.com/mastodon/mastodon/pull/25124 */ |
10 | | - remove: Method<void>; |
| 50 | + /** @see https://docs.joinmastodon.org/methods/profile/#delete-profile-header */ |
| 51 | + remove: Method<AccountCredentials>; |
11 | 52 | } |
12 | 53 |
|
13 | 54 | export interface ProfileResource { |
14 | 55 | avatar: ProfileAvatarResource; |
15 | 56 | header: ProfileHeaderResource; |
| 57 | + |
| 58 | + /** |
| 59 | + * Get the current user's profile. |
| 60 | + * @return Profile |
| 61 | + * @see https://docs.joinmastodon.org/methods/profile/ |
| 62 | + */ |
| 63 | + fetch: Method<Profile>; |
| 64 | + |
| 65 | + /** |
| 66 | + * Update the current user's profile. |
| 67 | + * @param params Parameters |
| 68 | + * @return Profile |
| 69 | + * @see https://docs.joinmastodon.org/methods/profile/ |
| 70 | + */ |
| 71 | + update: Method< |
| 72 | + Profile, |
| 73 | + UpdateProfileParams, |
| 74 | + HttpMetaParams<"multipart-form"> |
| 75 | + >; |
16 | 76 | } |
17 | 77 |
|
18 | 78 | /** @deprecated Use `ProfileResource` instead. */ |
|
0 commit comments