lemmy-js-client 0.17.0-rc.5 → 0.17.0-rc.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,28 @@
1
- import { CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModStickyPostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
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 interface Search {
9
+ export declare class Search {
6
10
  /**
7
11
  * The search query string.
8
12
  */
9
13
  q: string;
10
- /**
11
- * The [[SearchType]].
12
- */
13
- type_?: string;
14
- community_id?: number;
15
- community_name?: string;
16
- creator_id?: number;
17
- /**
18
- * The [[SortType]].
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 interface SearchResponse {
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 interface GetModlog {
40
- mod_person_id?: number;
41
- community_id?: number;
42
- page?: number;
43
- limit?: number;
44
- auth?: string;
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 interface GetModlogResponse {
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 interface CreateSite {
61
+ export declare class CreateSite {
59
62
  name: string;
60
- sidebar?: string;
61
- description?: string;
62
- icon?: string;
63
- banner?: string;
64
- enable_downvotes?: boolean;
65
- open_registration?: boolean;
66
- enable_nsfw?: boolean;
67
- community_creation_admin_only?: boolean;
68
- require_email_verification?: boolean;
69
- require_application?: boolean;
70
- application_question?: string;
71
- private_instance?: boolean;
72
- default_theme?: string;
73
- default_post_listing_type?: string;
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 interface EditSite {
77
- name?: string;
78
- sidebar?: string;
79
- description?: string;
80
- icon?: string;
81
- banner?: string;
82
- enable_downvotes?: boolean;
83
- open_registration?: boolean;
84
- enable_nsfw?: boolean;
85
- community_creation_admin_only?: boolean;
86
- require_email_verification?: boolean;
87
- require_application?: boolean;
88
- application_question?: string;
89
- private_instance?: boolean;
90
- default_theme?: string;
91
- default_post_listing_type?: string;
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 interface GetSite {
95
- auth?: string;
153
+ export declare class GetSite {
154
+ auth: Option<string>;
155
+ constructor(init: GetSite);
96
156
  }
97
- export interface SiteResponse {
157
+ export declare class SiteResponse {
98
158
  site_view: SiteView;
99
159
  }
100
- export interface GetSiteResponse {
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?: MyUserInfo;
112
- federated_instances?: FederatedInstances;
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 interface MyUserInfo {
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 interface LeaveAdmin {
184
+ export declare class LeaveAdmin {
125
185
  auth: string;
186
+ constructor(init: LeaveAdmin);
126
187
  }
127
- export interface GetSiteConfig {
128
- auth: string;
188
+ export declare class FederatedInstances {
189
+ linked: string[];
190
+ allowed: Option<string[]>;
191
+ blocked: Option<string[]>;
192
+ constructor(init: FederatedInstances);
129
193
  }
130
- export interface GetSiteConfigResponse {
131
- config_hjson: string;
194
+ export declare class ResolveObject {
195
+ q: string;
196
+ auth: Option<string>;
197
+ constructor(init: ResolveObject);
132
198
  }
133
- export interface SaveSiteConfig {
134
- config_hjson: string;
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 interface FederatedInstances {
138
- linked: string[];
139
- allowed?: string[];
140
- blocked?: string[];
211
+ export declare class PurgeCommunity {
212
+ community_id: number;
213
+ reason: Option<string>;
214
+ auth: string;
215
+ constructor(init: PurgeCommunity);
141
216
  }
142
- export interface ResolveObject {
143
- q: string;
144
- auth?: string;
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 interface ResolveObjectResponse {
147
- comment?: CommentView;
148
- post?: PostView;
149
- community?: CommunityView;
150
- person?: PersonViewSafe;
229
+ export declare class PurgeItemResponse {
230
+ success: boolean;
151
231
  }
152
- export interface ListRegistrationApplications {
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?: boolean;
157
- page?: number;
158
- limit?: number;
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 interface ListRegistrationApplicationsResponse {
242
+ export declare class ListRegistrationApplicationsResponse {
162
243
  registration_applications: RegistrationApplicationView[];
163
244
  }
164
- export interface ApproveRegistrationApplication {
245
+ export declare class ApproveRegistrationApplication {
165
246
  id: number;
166
247
  approve: boolean;
167
- deny_reason?: string;
248
+ deny_reason: Option<string>;
168
249
  auth: string;
250
+ constructor(init: ApproveRegistrationApplication);
169
251
  }
170
- export interface RegistrationApplicationResponse {
252
+ export declare class RegistrationApplicationResponse {
171
253
  registration_application: RegistrationApplicationView;
172
254
  }
173
- export interface GetUnreadRegistrationApplicationCount {
255
+ export declare class GetUnreadRegistrationApplicationCount {
174
256
  auth: string;
257
+ constructor(init: GetUnreadRegistrationApplicationCount);
175
258
  }
176
- export interface GetUnreadRegistrationApplicationCountResponse {
259
+ export declare class GetUnreadRegistrationApplicationCountResponse {
177
260
  registration_applications: number;
178
261
  }