-
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathoptions.ts
More file actions
168 lines (126 loc) · 4.91 KB
/
options.ts
File metadata and controls
168 lines (126 loc) · 4.91 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import { AccountCredentialsSource, AccountField } from '../entities/Account';
import { FilterContext } from '../entities/Filter';
import { NotificationType } from '../entities/Notification';
import { PushSubscriptionAlerts } from '../entities/PushSubscription';
import { StatusVisibility } from '../entities/Status';
export interface Pagination {
/** Get a list of items with ID less than this value */
max_id?: string | null;
/** Get a list of items with ID greater than this value including this ID */
since_id?: string | null;
/** Get a list of items with ID greater than this value exluding this ID */
min_id?: string | null;
/** Maximum number of items to get */
limit?: number | null;
}
export interface UpdateCredentials {
/** Display name */
display_name?: string | null;
/** Biography */
note?: string | null;
/** Avatar encoded using `multipart/form-data` */
avatar?: File | null;
/** Header image encoded using `multipart/form-data` */
header?: File | null;
/** Enable follow requests */
locked?: boolean | null;
/**
* privacy: Default post privacy preference
* sensitive: Whether to mark statuses as sensitive by default
* language: Override language on statuses by default (ISO6391)
*/
source?: Pick<AccountCredentialsSource, 'privacy'|'sensitive'|'language'> | null;
/** Profile metadata (max. 4) */
fields_attributes?:
[AccountField] |
[AccountField, AccountField] |
[AccountField, AccountField, AccountField] |
[AccountField, AccountField, AccountField, AccountField] |
null;
}
export interface SearchAccounts {
/** Maximum number of matching accounts to return (default: `40`) */
limit?: number | null;
/** Attempt WebFinger look-up */
resolve?: boolean | null;
/** Only who the user is following */
following?: boolean | null;
}
export interface UploadMedia {
/** A plain-text description of the media, for accessibility (max 420 chars) */
descriptions?: string | null;
/** Focal point: Two floating points, comma-delimited */
focus?: string | null;
}
export type UpdateMedia = UploadMedia;
export interface FetchNotifications extends Pagination {
/** Array of notifications to exclude (Allowed values: "follow", "favourite", "reblog", "mention") */
exclude_types?: NotificationType[] | null;
}
export interface CreateStatus {
/** local ID of the status you want to reply to */
in_reply_to_id?: string | null;
/** Array of media IDs to attach to the status (maximum 4) */
media_ids?: string[] | null;
/** Set this to mark the media of the status as NSFW */
sensitive?: boolean | null;
/** Text to be shown as a warning before the actual content */
spoiler_text?: string | null;
/** Either "direct", "private", "unlisted" or "public" */
visibility?: StatusVisibility | null;
/** ISO 639-2 language code of the toot, to skip automatic detection */
language?: string | null;
}
export interface FetchTimeline extends Pagination {
/** Only return statuses originating from this instance (public and tag timelines only) */
local?: boolean | null;
/** Only return statuses that have media attachments */
only_media?: boolean | null;
}
export interface FetchAccountStatuses extends Pagination {
/** Only return statuses that have media attachments */
only_media?: boolean | null;
/** Only return statuses that have been pinned */
pinned?: boolean | null;
/** Skip statuses that reply to other statuses */
exclude_replies?: boolean | null;
}
export interface UpdateFilter {
/** String that contains keyword or phrase */
phrase?: string | null;
/** Array of strings that means filtering context. each string is one of `home`, `notifications`, `public`, `thread`. At least one context must be specified */
context?: FilterContext[] | null;
/** Filtered toots will disappear irreversibly, even if filter is later removed */
irreversible?: boolean | null;
/** Boolean that indicates word match. */
whole_word?: boolean | null;
/** The simestamp for expire time */
expires_in?: number | null;
}
export type CreateFilter = Pick<UpdateFilter, 'irreversible'|'whole_word'|'expires_in'>;
export interface AddPushSubscription {
subscription: {
/** Endpoint URL that called when notification is happen. */
endpoint: string;
keys: {
/** User agent public key. Base64 encoded string of public key of ECDH key that using 'prime256v1' curve. */
p256dh: string;
/** Auth secret. Base64 encoded string of 16 bytes random data. */
auth: string;
}
};
data?: {
alerts?: Partial<PushSubscriptionAlerts> | null,
} | null;
}
export type UpdatePushSubscription = Pick<AddPushSubscription, 'data'>;
export interface CreateAccount {
/** Username to create */
username: string;
/** Password of the user */
password: string;
/** Email of the user */
email: string;
/** Whether the user has been agreed to the agreement of the Mastodon instance */
agreement: boolean;
}