/
instance.ts
92 lines (82 loc) 路 2.67 KB
/
instance.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import { type Account } from "./account";
import { type Rule } from "./rule";
export interface InstanceStatusesConfiguration {
maxCharacters: number;
maxMediaAttachments: number;
charactersReservedPerUrl: number;
}
export interface InstanceMediaAttachmentsConfiguration {
supportedMimeTypes: string[];
imageSizeLimit: number;
imageMatrixLimit: number;
videoSizeLimit: number;
videoFrameRateLimit: number;
videoMatrixLimit: number;
}
export interface InstancePollsConfiguration {
maxOptions: number;
maxCharactersPerOption: number;
minExpiration: number;
maxExpiration: number;
}
export interface InstanceAccountsConfiguration {
maxFeaturedTags: number;
}
/**
* @see https://github.com/mastodon/mastodon/pull/16485
*/
export interface InstanceConfiguration {
statuses: InstanceStatusesConfiguration;
mediaAttachments: InstanceMediaAttachmentsConfiguration;
polls: InstancePollsConfiguration;
accounts: InstanceAccountsConfiguration;
}
/**
* Represents the software instance of Mastodon running on this domain.
* @see https://docs.joinmastodon.org/entities/instance/
*/
export interface Instance {
/** The domain name of the instance. */
uri: string;
/** The title of the website. */
title: string;
/** Admin-defined description of the Mastodon site. */
description: string;
/** A shorter description defined by the admin. */
shortDescription: string;
/** An email that may be contacted for any inquiries. */
email: string;
/** The version of Mastodon installed on the instance. */
version: string;
/** Primary languages of the website and its staff. */
languages: string[];
/** Whether registrations are enabled. */
registrations: boolean;
/** Whether registrations require moderator approval. */
approvalRequired: boolean;
/** URLs of interest for clients apps. */
urls: InstanceURLs;
/** Statistics about how much information the instance contains. */
stats: InstanceStats;
/** Whether invitation in enabled */
invitesEnabled: boolean;
/** List various values like file size limits and supported mime types */
configuration: InstanceConfiguration;
/** Banner image for the website. */
thumbnail?: string | null;
/** A user that can be contacted, as an alternative to `email`. */
contactAccount?: Account | null;
rules?: Rule[] | null;
}
export interface InstanceURLs {
/** WebSockets address for push streaming. String (URL). */
streamingApi: string;
}
export interface InstanceStats {
/** Users registered on this instance. Number. */
userCount: number;
/** Statuses authored by users on instance. Number. */
statusCount: number;
/** Domains federated with this instance. Number. */
domainCount: number;
}