Skip to content

Commit 88703ac

Browse files
committed
feat: Mastodon 4.2.0 beta
1 parent c985d31 commit 88703ac

10 files changed

Lines changed: 74 additions & 2 deletions

File tree

src/mastodon/entities/v1/account.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export interface Account {
9393
followingCount: number;
9494
/** Roles that have been granted to this account. */
9595
roles: Pick<Role, "id" | "name" | "color">[]; // TODO: Create an entity when documentation is updated
96+
/** https://github.com/mastodon/mastodon/pull/23591 */
97+
memorial?: boolean | null;
9698
}
9799

98100
/**

src/mastodon/entities/v1/list.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ export interface List {
1919
* `none` = Show replies to no one
2020
*/
2121
repliesPolicy: ListRepliesPolicy;
22+
/** https://github.com/mastodon/mastodon/pull/22048/files */
23+
isExclusive: boolean;
2224
}

src/mastodon/entities/v1/report.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type Account } from "./account";
22

3-
export type ReportCategory = "spam" | "violation" | "other";
3+
export type ReportCategory = "spam" | "violation" | "legal" | "other";
44

55
/**
66
* Reports filed against users and/or statuses, to be taken action on by moderators.

src/mastodon/rest/v1/account-repository.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export interface CreateAccountParams {
2828
readonly locale: string;
2929
/** Text that will be reviewed by moderators if registrations require manual approval. */
3030
readonly reason?: string;
31+
/** https://github.com/mastodon/mastodon/pull/25342 */
32+
readonly timeZone?: string;
3133
}
3234

3335
export interface UpdateCredentialsParams {

src/mastodon/rest/v1/admin/trend-repository.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ export interface TrendRepository {
99
* @see https://docs.joinmastodon.org/methods/admin/trends/#links
1010
*/
1111
list(meta?: HttpMetaParams): Paginator<TrendLink[]>;
12+
13+
/** https://github.com/mastodon/mastodon/pull/24257 */
14+
$select(id: string): {
15+
approve(meta?: HttpMetaParams): Promise<TrendLink>;
16+
reject(meta?: HttpMetaParams): Promise<TrendLink>;
17+
};
18+
19+
/** https://github.com/mastodon/mastodon/pull/24257 */
20+
publishers: {
21+
list(meta?: HttpMetaParams): Paginator<TrendLink[]>;
22+
$select(id: string): {
23+
approve(meta?: HttpMetaParams): Promise<TrendLink>;
24+
reject(meta?: HttpMetaParams): Promise<TrendLink>;
25+
};
26+
};
1227
};
1328

1429
statuses: {
@@ -17,6 +32,12 @@ export interface TrendRepository {
1732
* @see https://docs.joinmastodon.org/methods/admin/trends/#statuses
1833
*/
1934
list(meta?: HttpMetaParams): Paginator<Status[]>;
35+
36+
/** https://github.com/mastodon/mastodon/pull/24257 */
37+
$select(id: string): {
38+
approve(meta?: HttpMetaParams): Promise<Status>;
39+
reject(meta?: HttpMetaParams): Promise<Status>;
40+
};
2041
};
2142

2243
tags: {
@@ -25,5 +46,11 @@ export interface TrendRepository {
2546
* @see https://docs.joinmastodon.org/methods/admin/trends/#tags
2647
*/
2748
list(meta?: HttpMetaParams): Paginator<Admin.Tag[]>;
49+
50+
/** https://github.com/mastodon/mastodon/pull/24257 */
51+
$select(id: string): {
52+
approve(meta?: HttpMetaParams): Promise<Admin.Tag>;
53+
reject(meta?: HttpMetaParams): Promise<Admin.Tag>;
54+
};
2855
};
2956
}

src/mastodon/rest/v1/conversation-repository.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ export interface ConversationRepository {
2929
* @see https://docs.joinmastodon.org/methods/timelines/conversations/#post
3030
*/
3131
read(meta?: HttpMetaParams): Promise<Conversation>;
32+
33+
/** https://github.com/mastodon/mastodon/pull/25509 */
34+
unread(meta?: HttpMetaParams): Promise<Conversation>;
3235
};
3336
}

src/mastodon/rest/v1/instance-repository.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,14 @@ export interface InstanceRepository {
2727
*/
2828
list(meta?: HttpMetaParams): Paginator<Activity[]>;
2929
};
30+
31+
languages: {
32+
/** https://github.com/mastodon/mastodon/pull/24443 */
33+
list(meta?: HttpMetaParams): Promise<string[]>;
34+
};
35+
36+
translationLanguages: {
37+
/** https://github.com/mastodon/mastodon/pull/24037 */
38+
list(meta?: HttpMetaParams): Promise<Record<string, string[]>>;
39+
};
3040
}

src/mastodon/rest/v1/report-repository.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export interface ReportAccountParams {
1414
readonly category?: ReportCategory | null;
1515
/** must reference rules returned in GET /api/v1/instance */
1616
readonly ruleIds?: readonly string[] | null;
17+
/** https://github.com/mastodon/mastodon/pull/25866 */
18+
readonly forwardToDomains?: readonly string[] | null;
1719
}
1820

1921
export interface ReportRepository {

tests/rest/v1/conversations.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@ describe("conversations", () => {
2222
});
2323

2424
assert(conversation != undefined);
25-
await alice.rest.v1.conversations.$select(conversation.id).read();
25+
26+
conversation = await alice.rest.v1.conversations
27+
.$select(conversation.id)
28+
.read();
29+
expect(conversation.unread).toBe(false);
30+
31+
conversation = await alice.rest.v1.conversations
32+
.$select(conversation.id)
33+
.unread();
34+
expect(conversation.unread).toBe(true);
35+
2636
await alice.rest.v1.conversations.$select(conversation.id).remove();
2737
});
2838
});

tests/rest/v1/instance.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,17 @@ it("lists peers", () => {
1111
expect(peers).toEqual(expect.any(Array));
1212
});
1313
});
14+
15+
it("lists languages", () => {
16+
return sessions.use(async (client) => {
17+
const languages = await client.rest.v1.instance.languages.list();
18+
expect(languages).toEqual(expect.any(Array));
19+
});
20+
});
21+
22+
it("lists translatable languages", () => {
23+
return sessions.use(async (client) => {
24+
const languages = await client.rest.v1.instance.translationLanguages.list();
25+
expect(languages).toMatchInlineSnapshot();
26+
});
27+
});

0 commit comments

Comments
 (0)