lemmy-js-client 0.17.0-rc.5 → 0.17.0-rc.50
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +196 -14
- package/dist/http.js +332 -98
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/dist/interfaces/aggregates.d.ts +1 -0
- package/dist/interfaces/api/comment.d.ts +54 -46
- package/dist/interfaces/api/comment.js +393 -0
- package/dist/interfaces/api/community.d.ts +56 -48
- package/dist/interfaces/api/community.js +433 -0
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +159 -102
- package/dist/interfaces/api/person.js +1004 -0
- package/dist/interfaces/api/post.d.ts +73 -54
- package/dist/interfaces/api/post.js +475 -0
- package/dist/interfaces/api/site.d.ts +182 -99
- package/dist/interfaces/api/site.js +1552 -0
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +122 -90
- package/dist/interfaces/others.js +187 -59
- package/dist/interfaces/source.d.ts +178 -83
- package/dist/interfaces/source.js +899 -0
- package/dist/interfaces/views.d.ts +99 -50
- package/dist/interfaces/views.js +761 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +18 -0
- package/dist/websocket.d.ts +43 -12
- package/dist/websocket.js +64 -16
- package/package.json +17 -14
@@ -1,32 +1,28 @@
|
|
1
|
-
import {
|
1
|
+
import { Option } from "@sniptt/monads";
|
2
|
+
import "reflect-metadata";
|
3
|
+
import { ListingType, ModlogActionType, SearchType, SortType } from "../others";
|
4
|
+
import { Language } from "../source";
|
5
|
+
import { AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView, CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
|
2
6
|
/**
|
3
7
|
* Search lemmy for different types of data.
|
4
8
|
*/
|
5
|
-
export
|
9
|
+
export declare class Search {
|
6
10
|
/**
|
7
11
|
* The search query string.
|
8
12
|
*/
|
9
13
|
q: string;
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
sort?: string;
|
21
|
-
/**
|
22
|
-
* The [[ListingType]].
|
23
|
-
*/
|
24
|
-
listing_type?: string;
|
25
|
-
page?: number;
|
26
|
-
limit?: number;
|
27
|
-
auth?: string;
|
14
|
+
type_: Option<SearchType>;
|
15
|
+
community_id: Option<number>;
|
16
|
+
community_name: Option<string>;
|
17
|
+
creator_id: Option<number>;
|
18
|
+
sort: Option<SortType>;
|
19
|
+
listing_type: Option<ListingType>;
|
20
|
+
page: Option<number>;
|
21
|
+
limit: Option<number>;
|
22
|
+
auth: Option<string>;
|
23
|
+
constructor(init: Search);
|
28
24
|
}
|
29
|
-
export
|
25
|
+
export declare class SearchResponse {
|
30
26
|
/**
|
31
27
|
* The [[SearchType]].
|
32
28
|
*/
|
@@ -36,14 +32,17 @@ export interface SearchResponse {
|
|
36
32
|
communities: CommunityView[];
|
37
33
|
users: PersonViewSafe[];
|
38
34
|
}
|
39
|
-
export
|
40
|
-
mod_person_id
|
41
|
-
community_id
|
42
|
-
page
|
43
|
-
limit
|
44
|
-
auth
|
35
|
+
export declare class GetModlog {
|
36
|
+
mod_person_id: Option<number>;
|
37
|
+
community_id: Option<number>;
|
38
|
+
page: Option<number>;
|
39
|
+
limit: Option<number>;
|
40
|
+
auth: Option<string>;
|
41
|
+
type_: ModlogActionType;
|
42
|
+
other_person_id: Option<number>;
|
43
|
+
constructor(init: GetModlog);
|
45
44
|
}
|
46
|
-
export
|
45
|
+
export declare class GetModlogResponse {
|
47
46
|
removed_posts: ModRemovePostView[];
|
48
47
|
locked_posts: ModLockPostView[];
|
49
48
|
stickied_posts: ModStickyPostView[];
|
@@ -54,125 +53,209 @@ export interface GetModlogResponse {
|
|
54
53
|
added_to_community: ModAddCommunityView[];
|
55
54
|
transferred_to_community: ModTransferCommunityView[];
|
56
55
|
added: ModAddView[];
|
56
|
+
admin_purged_persons: AdminPurgePersonView[];
|
57
|
+
admin_purged_communities: AdminPurgeCommunityView[];
|
58
|
+
admin_purged_posts: AdminPurgePostView[];
|
59
|
+
admin_purged_comments: AdminPurgeCommentView[];
|
57
60
|
}
|
58
|
-
export
|
61
|
+
export declare class CreateSite {
|
59
62
|
name: string;
|
60
|
-
sidebar
|
61
|
-
description
|
62
|
-
icon
|
63
|
-
banner
|
64
|
-
enable_downvotes
|
65
|
-
open_registration
|
66
|
-
enable_nsfw
|
67
|
-
community_creation_admin_only
|
68
|
-
require_email_verification
|
69
|
-
require_application
|
70
|
-
application_question
|
71
|
-
private_instance
|
72
|
-
default_theme
|
73
|
-
default_post_listing_type
|
63
|
+
sidebar: Option<string>;
|
64
|
+
description: Option<string>;
|
65
|
+
icon: Option<string>;
|
66
|
+
banner: Option<string>;
|
67
|
+
enable_downvotes: Option<boolean>;
|
68
|
+
open_registration: Option<boolean>;
|
69
|
+
enable_nsfw: Option<boolean>;
|
70
|
+
community_creation_admin_only: Option<boolean>;
|
71
|
+
require_email_verification: Option<boolean>;
|
72
|
+
require_application: Option<boolean>;
|
73
|
+
application_question: Option<string>;
|
74
|
+
private_instance: Option<boolean>;
|
75
|
+
default_theme: Option<string>;
|
76
|
+
default_post_listing_type: Option<string>;
|
77
|
+
application_email_admins: Option<boolean>;
|
74
78
|
auth: string;
|
79
|
+
hide_modlog_mod_names: Option<boolean>;
|
80
|
+
discussion_languages: Option<number[]>;
|
81
|
+
legal_information: Option<string>;
|
82
|
+
slur_filter_regex: Option<string>;
|
83
|
+
actor_name_max_length: Option<number>;
|
84
|
+
rate_limit_message: Option<number>;
|
85
|
+
rate_limit_message_per_second: Option<number>;
|
86
|
+
rate_limit_post: Option<number>;
|
87
|
+
rate_limit_post_per_second: Option<number>;
|
88
|
+
rate_limit_register: Option<number>;
|
89
|
+
rate_limit_register_per_second: Option<number>;
|
90
|
+
rate_limit_image: Option<number>;
|
91
|
+
rate_limit_image_per_second: Option<number>;
|
92
|
+
rate_limit_comment: Option<number>;
|
93
|
+
rate_limit_comment_per_second: Option<number>;
|
94
|
+
rate_limit_search: Option<number>;
|
95
|
+
rate_limit_search_per_second: Option<number>;
|
96
|
+
federation_enabled: Option<boolean>;
|
97
|
+
federation_debug: Option<boolean>;
|
98
|
+
federation_strict_allowlist: Option<boolean>;
|
99
|
+
federation_http_fetch_retry_limit: Option<number>;
|
100
|
+
federation_worker_count: Option<number>;
|
101
|
+
captcha_enabled: Option<boolean>;
|
102
|
+
captcha_difficulty: Option<string>;
|
103
|
+
allowed_instances: Option<string[]>;
|
104
|
+
blocked_instances: Option<string[]>;
|
105
|
+
constructor(init: CreateSite);
|
75
106
|
}
|
76
|
-
export
|
77
|
-
name
|
78
|
-
sidebar
|
79
|
-
description
|
80
|
-
icon
|
81
|
-
banner
|
82
|
-
enable_downvotes
|
83
|
-
open_registration
|
84
|
-
enable_nsfw
|
85
|
-
community_creation_admin_only
|
86
|
-
require_email_verification
|
87
|
-
require_application
|
88
|
-
application_question
|
89
|
-
private_instance
|
90
|
-
default_theme
|
91
|
-
default_post_listing_type
|
107
|
+
export declare class EditSite {
|
108
|
+
name: Option<string>;
|
109
|
+
sidebar: Option<string>;
|
110
|
+
description: Option<string>;
|
111
|
+
icon: Option<string>;
|
112
|
+
banner: Option<string>;
|
113
|
+
enable_downvotes: Option<boolean>;
|
114
|
+
open_registration: Option<boolean>;
|
115
|
+
enable_nsfw: Option<boolean>;
|
116
|
+
community_creation_admin_only: Option<boolean>;
|
117
|
+
require_email_verification: Option<boolean>;
|
118
|
+
require_application: Option<boolean>;
|
119
|
+
application_question: Option<string>;
|
120
|
+
private_instance: Option<boolean>;
|
121
|
+
default_theme: Option<string>;
|
122
|
+
default_post_listing_type: Option<string>;
|
123
|
+
legal_information: Option<string>;
|
124
|
+
application_email_admins: Option<boolean>;
|
125
|
+
hide_modlog_mod_names: Option<boolean>;
|
126
|
+
discussion_languages: Option<number[]>;
|
127
|
+
slur_filter_regex: Option<string>;
|
128
|
+
actor_name_max_length: Option<number>;
|
129
|
+
rate_limit_message: Option<number>;
|
130
|
+
rate_limit_message_per_second: Option<number>;
|
131
|
+
rate_limit_post: Option<number>;
|
132
|
+
rate_limit_post_per_second: Option<number>;
|
133
|
+
rate_limit_register: Option<number>;
|
134
|
+
rate_limit_register_per_second: Option<number>;
|
135
|
+
rate_limit_image: Option<number>;
|
136
|
+
rate_limit_image_per_second: Option<number>;
|
137
|
+
rate_limit_comment: Option<number>;
|
138
|
+
rate_limit_comment_per_second: Option<number>;
|
139
|
+
rate_limit_search: Option<number>;
|
140
|
+
rate_limit_search_per_second: Option<number>;
|
141
|
+
federation_enabled: Option<boolean>;
|
142
|
+
federation_debug: Option<boolean>;
|
143
|
+
federation_strict_allowlist: Option<boolean>;
|
144
|
+
federation_http_fetch_retry_limit: Option<number>;
|
145
|
+
federation_worker_count: Option<number>;
|
146
|
+
captcha_enabled: Option<boolean>;
|
147
|
+
captcha_difficulty: Option<string>;
|
148
|
+
allowed_instances: Option<string[]>;
|
149
|
+
blocked_instances: Option<string[]>;
|
92
150
|
auth: string;
|
151
|
+
constructor(init: EditSite);
|
93
152
|
}
|
94
|
-
export
|
95
|
-
auth
|
153
|
+
export declare class GetSite {
|
154
|
+
auth: Option<string>;
|
155
|
+
constructor(init: GetSite);
|
96
156
|
}
|
97
|
-
export
|
157
|
+
export declare class SiteResponse {
|
98
158
|
site_view: SiteView;
|
99
159
|
}
|
100
|
-
export
|
101
|
-
|
102
|
-
* Optional, because the site might not be set up yet.
|
103
|
-
*/
|
104
|
-
site_view?: SiteView;
|
160
|
+
export declare class GetSiteResponse {
|
161
|
+
site_view: SiteView;
|
105
162
|
admins: PersonViewSafe[];
|
106
163
|
online: number;
|
107
164
|
version: string;
|
108
165
|
/**
|
109
166
|
* If you're logged in, you'll get back extra user info.
|
110
167
|
*/
|
111
|
-
my_user
|
112
|
-
federated_instances
|
168
|
+
my_user: Option<MyUserInfo>;
|
169
|
+
federated_instances: Option<FederatedInstances>;
|
170
|
+
all_languages: Language[];
|
171
|
+
discussion_languages: number[];
|
113
172
|
}
|
114
173
|
/**
|
115
174
|
* Your user info, such as blocks, follows, etc.
|
116
175
|
*/
|
117
|
-
export
|
176
|
+
export declare class MyUserInfo {
|
118
177
|
local_user_view: LocalUserSettingsView;
|
119
178
|
follows: CommunityFollowerView[];
|
120
179
|
moderates: CommunityModeratorView[];
|
121
180
|
community_blocks: CommunityBlockView[];
|
122
181
|
person_blocks: PersonBlockView[];
|
182
|
+
discussion_languages: Language[];
|
123
183
|
}
|
124
|
-
export
|
184
|
+
export declare class LeaveAdmin {
|
125
185
|
auth: string;
|
186
|
+
constructor(init: LeaveAdmin);
|
126
187
|
}
|
127
|
-
export
|
128
|
-
|
188
|
+
export declare class FederatedInstances {
|
189
|
+
linked: string[];
|
190
|
+
allowed: Option<string[]>;
|
191
|
+
blocked: Option<string[]>;
|
192
|
+
constructor(init: FederatedInstances);
|
129
193
|
}
|
130
|
-
export
|
131
|
-
|
194
|
+
export declare class ResolveObject {
|
195
|
+
q: string;
|
196
|
+
auth: Option<string>;
|
197
|
+
constructor(init: ResolveObject);
|
132
198
|
}
|
133
|
-
export
|
134
|
-
|
199
|
+
export declare class ResolveObjectResponse {
|
200
|
+
comment: Option<CommentView>;
|
201
|
+
post: Option<PostView>;
|
202
|
+
community: Option<CommunityView>;
|
203
|
+
person: Option<PersonViewSafe>;
|
204
|
+
}
|
205
|
+
export declare class PurgePerson {
|
206
|
+
person_id: number;
|
207
|
+
reason: Option<string>;
|
135
208
|
auth: string;
|
209
|
+
constructor(init: PurgePerson);
|
136
210
|
}
|
137
|
-
export
|
138
|
-
|
139
|
-
|
140
|
-
|
211
|
+
export declare class PurgeCommunity {
|
212
|
+
community_id: number;
|
213
|
+
reason: Option<string>;
|
214
|
+
auth: string;
|
215
|
+
constructor(init: PurgeCommunity);
|
141
216
|
}
|
142
|
-
export
|
143
|
-
|
144
|
-
|
217
|
+
export declare class PurgePost {
|
218
|
+
post_id: number;
|
219
|
+
reason: Option<string>;
|
220
|
+
auth: string;
|
221
|
+
constructor(init: PurgePost);
|
222
|
+
}
|
223
|
+
export declare class PurgeComment {
|
224
|
+
comment_id: number;
|
225
|
+
reason: Option<string>;
|
226
|
+
auth: string;
|
227
|
+
constructor(init: PurgeComment);
|
145
228
|
}
|
146
|
-
export
|
147
|
-
|
148
|
-
post?: PostView;
|
149
|
-
community?: CommunityView;
|
150
|
-
person?: PersonViewSafe;
|
229
|
+
export declare class PurgeItemResponse {
|
230
|
+
success: boolean;
|
151
231
|
}
|
152
|
-
export
|
232
|
+
export declare class ListRegistrationApplications {
|
153
233
|
/**
|
154
234
|
* Only shows the unread applications (IE those without an admin actor)
|
155
235
|
*/
|
156
|
-
unread_only
|
157
|
-
page
|
158
|
-
limit
|
236
|
+
unread_only: Option<boolean>;
|
237
|
+
page: Option<number>;
|
238
|
+
limit: Option<number>;
|
159
239
|
auth: string;
|
240
|
+
constructor(init: ListRegistrationApplications);
|
160
241
|
}
|
161
|
-
export
|
242
|
+
export declare class ListRegistrationApplicationsResponse {
|
162
243
|
registration_applications: RegistrationApplicationView[];
|
163
244
|
}
|
164
|
-
export
|
245
|
+
export declare class ApproveRegistrationApplication {
|
165
246
|
id: number;
|
166
247
|
approve: boolean;
|
167
|
-
deny_reason
|
248
|
+
deny_reason: Option<string>;
|
168
249
|
auth: string;
|
250
|
+
constructor(init: ApproveRegistrationApplication);
|
169
251
|
}
|
170
|
-
export
|
252
|
+
export declare class RegistrationApplicationResponse {
|
171
253
|
registration_application: RegistrationApplicationView;
|
172
254
|
}
|
173
|
-
export
|
255
|
+
export declare class GetUnreadRegistrationApplicationCount {
|
174
256
|
auth: string;
|
257
|
+
constructor(init: GetUnreadRegistrationApplicationCount);
|
175
258
|
}
|
176
|
-
export
|
259
|
+
export declare class GetUnreadRegistrationApplicationCountResponse {
|
177
260
|
registration_applications: number;
|
178
261
|
}
|