Skip to content

Commit 473d51e

Browse files
authored
feat: update AccountSource type (#1387)
ref. Account - Mastodon documentation - https://docs.joinmastodon.org/entities/Account/
1 parent 097a1d5 commit 473d51e

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

src/mastodon/entities/v1/account.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { type QuoteApprovalPolicy } from "../../rest/v1/statuses.js";
12
import { type CustomEmoji } from "./custom-emoji.js";
23
import { type Role } from "./role.js";
34
import { type StatusVisibility } from "./status.js";
@@ -8,11 +9,12 @@ import { type StatusVisibility } from "./status.js";
89
* @see https://docs.joinmastodon.org/entities/source/
910
*/
1011
export interface AccountSource {
11-
/** Profile bio. */
12+
/** Domains of websites allowed to credit the account. */
13+
attributionDomains: string[];
14+
/** Profile bio, in plain text instead of HTML. */
1215
note: string;
1316
/** Metadata about the account. */
1417
fields: AccountField[];
15-
1618
/** The default post privacy to be used for new statuses. */
1719
privacy?: StatusVisibility | null;
1820
/** Whether new statuses should be marked sensitive by default. */
@@ -21,6 +23,16 @@ export interface AccountSource {
2123
language: string | null;
2224
/** The number of pending follow requests. */
2325
followRequestsCount?: number | null;
26+
/** Whether the user hides the contents of their follows and followers collections. */
27+
hideCollections?: boolean | null;
28+
/** Whether the account has opted into discovery features such as the profile directory. */
29+
discoverable?: boolean | null;
30+
/** Whether public posts should be searchable to anyone. */
31+
indexable: boolean;
32+
/** The default quote policy to be used for new statuses. */
33+
quotePolicy: QuoteApprovalPolicy;
34+
/** The complete role assigned to the currently authorized user, including permissions and highlighted status. */
35+
role: Role;
2436
}
2537

2638
/**
@@ -31,7 +43,6 @@ export interface AccountField {
3143
name: string;
3244
/** The value associated with the `name` key. */
3345
value: string;
34-
3546
/** Timestamp of when the server verified a URL value for a rel="me” link. */
3647
verifiedAt?: string | null;
3748
}

src/mastodon/rest/v1/statuses.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ export interface FetchStatusesParams {
2222
}
2323

2424
export interface QuoteApprovalPolicyRegistry {
25+
/** Anyone is allowed to quote this status and will have their quote automatically accepted, unless they are blocked. */
2526
public: never;
27+
/** Only followers and the author are allowed to quote this status, and will have their quote automatically accepted. */
2628
followers: never;
29+
/** Only the author is allowed to quote the status. */
2730
nobody: never;
2831
}
2932

@@ -34,10 +37,7 @@ export interface CreateStatusParamsBase {
3437
readonly inReplyToId?: string | null;
3538
/** ID of the status being quoted, if any. Will raise an error if the status does not exist, the author does not have access to it, or quoting is denied by Mastodon’s understanding of the attached quote policy. All posts except Private Mentions (direct visibility) are quotable by their author. Quoting a private post will restrict the quoting post’s visibility to private or direct (if the given visibility is public or unlisted, private will be used instead). An error will be returned when making a quote post with direct visibility and the quote author is not explicitly mentioned. If the status text doesn’t include a link to the quoted post, Mastodon will prepend a <p class="quote-inline">RE: <a href="…">…</a></p> paragraph for backward compatibility (such a paragraph will be hidden by Mastodon’s web interface). */
3639
readonly quotedStatusId?: string | null;
37-
/** Sets who is allowed to quote the status. When omitted, the user’s default setting will be used instead. Ignored if visibility is private or direct, in which case the policy will always be set to nobody.
38-
public = Anyone is allowed to quote this status and will have their quote automatically accepted, unless they are blocked.
39-
followers = Only followers and the author are allowed to quote this status, and will have their quote automatically accepted.
40-
nobody = Only the author is allowed to quote the status.*/
40+
/** Sets who is allowed to quote the status. When omitted, the user’s default setting will be used instead. Ignored if visibility is private or direct, in which case the policy will always be set to nobody. */
4141
readonly quoteApprovalPolicy?: QuoteApprovalPolicy | null;
4242
/** Mark status and attached media as sensitive? */
4343
readonly sensitive?: boolean | null;

0 commit comments

Comments
 (0)