lemmy-js-client 0.17.0-rc.4 → 0.17.0-rc.42

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,32 +1,27 @@
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, SearchType, SortType } from "../others";
4
+ 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
5
  /**
3
6
  * Search lemmy for different types of data.
4
7
  */
5
- export interface Search {
8
+ export declare class Search {
6
9
  /**
7
10
  * The search query string.
8
11
  */
9
12
  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;
28
- }
29
- export interface SearchResponse {
13
+ type_: Option<SearchType>;
14
+ community_id: Option<number>;
15
+ community_name: Option<string>;
16
+ creator_id: Option<number>;
17
+ sort: Option<SortType>;
18
+ listing_type: Option<ListingType>;
19
+ page: Option<number>;
20
+ limit: Option<number>;
21
+ auth: Option<string>;
22
+ constructor(init: Search);
23
+ }
24
+ export declare class SearchResponse {
30
25
  /**
31
26
  * The [[SearchType]].
32
27
  */
@@ -36,14 +31,15 @@ export interface SearchResponse {
36
31
  communities: CommunityView[];
37
32
  users: PersonViewSafe[];
38
33
  }
39
- export interface GetModlog {
40
- mod_person_id?: number;
41
- community_id?: number;
42
- page?: number;
43
- limit?: number;
44
- auth?: string;
34
+ export declare class GetModlog {
35
+ mod_person_id: Option<number>;
36
+ community_id: Option<number>;
37
+ page: Option<number>;
38
+ limit: Option<number>;
39
+ auth: Option<string>;
40
+ constructor(init: GetModlog);
45
41
  }
46
- export interface GetModlogResponse {
42
+ export declare class GetModlogResponse {
47
43
  removed_posts: ModRemovePostView[];
48
44
  locked_posts: ModLockPostView[];
49
45
  stickied_posts: ModStickyPostView[];
@@ -54,125 +50,156 @@ export interface GetModlogResponse {
54
50
  added_to_community: ModAddCommunityView[];
55
51
  transferred_to_community: ModTransferCommunityView[];
56
52
  added: ModAddView[];
53
+ admin_purged_persons: AdminPurgePersonView[];
54
+ admin_purged_communities: AdminPurgeCommunityView[];
55
+ admin_purged_posts: AdminPurgePostView[];
56
+ admin_purged_comments: AdminPurgeCommentView[];
57
57
  }
58
- export interface CreateSite {
58
+ export declare class CreateSite {
59
59
  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;
60
+ sidebar: Option<string>;
61
+ description: Option<string>;
62
+ icon: Option<string>;
63
+ banner: Option<string>;
64
+ enable_downvotes: Option<boolean>;
65
+ open_registration: Option<boolean>;
66
+ enable_nsfw: Option<boolean>;
67
+ community_creation_admin_only: Option<boolean>;
68
+ require_email_verification: Option<boolean>;
69
+ require_application: Option<boolean>;
70
+ application_question: Option<string>;
71
+ private_instance: Option<boolean>;
72
+ default_theme: Option<string>;
73
+ default_post_listing_type: Option<string>;
74
74
  auth: string;
75
- }
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;
75
+ constructor(init: CreateSite);
76
+ }
77
+ export declare class EditSite {
78
+ name: Option<string>;
79
+ sidebar: Option<string>;
80
+ description: Option<string>;
81
+ icon: Option<string>;
82
+ banner: Option<string>;
83
+ enable_downvotes: Option<boolean>;
84
+ open_registration: Option<boolean>;
85
+ enable_nsfw: Option<boolean>;
86
+ community_creation_admin_only: Option<boolean>;
87
+ require_email_verification: Option<boolean>;
88
+ require_application: Option<boolean>;
89
+ application_question: Option<string>;
90
+ private_instance: Option<boolean>;
91
+ default_theme: Option<string>;
92
+ legal_information: Option<string>;
93
+ default_post_listing_type: Option<string>;
92
94
  auth: string;
95
+ constructor(init: EditSite);
93
96
  }
94
- export interface GetSite {
95
- auth?: string;
97
+ export declare class GetSite {
98
+ auth: Option<string>;
99
+ constructor(init: GetSite);
96
100
  }
97
- export interface SiteResponse {
101
+ export declare class SiteResponse {
98
102
  site_view: SiteView;
99
103
  }
100
- export interface GetSiteResponse {
104
+ export declare class GetSiteResponse {
101
105
  /**
102
106
  * Optional, because the site might not be set up yet.
103
107
  */
104
- site_view?: SiteView;
108
+ site_view: Option<SiteView>;
105
109
  admins: PersonViewSafe[];
106
110
  online: number;
107
111
  version: string;
108
112
  /**
109
113
  * If you're logged in, you'll get back extra user info.
110
114
  */
111
- my_user?: MyUserInfo;
112
- federated_instances?: FederatedInstances;
115
+ my_user: Option<MyUserInfo>;
116
+ federated_instances: Option<FederatedInstances>;
113
117
  }
114
118
  /**
115
119
  * Your user info, such as blocks, follows, etc.
116
120
  */
117
- export interface MyUserInfo {
121
+ export declare class MyUserInfo {
118
122
  local_user_view: LocalUserSettingsView;
119
123
  follows: CommunityFollowerView[];
120
124
  moderates: CommunityModeratorView[];
121
125
  community_blocks: CommunityBlockView[];
122
126
  person_blocks: PersonBlockView[];
123
127
  }
124
- export interface LeaveAdmin {
128
+ export declare class LeaveAdmin {
125
129
  auth: string;
130
+ constructor(init: LeaveAdmin);
126
131
  }
127
- export interface GetSiteConfig {
128
- auth: string;
132
+ export declare class FederatedInstances {
133
+ linked: string[];
134
+ allowed: Option<string[]>;
135
+ blocked: Option<string[]>;
136
+ constructor(init: FederatedInstances);
129
137
  }
130
- export interface GetSiteConfigResponse {
131
- config_hjson: string;
138
+ export declare class ResolveObject {
139
+ q: string;
140
+ auth: Option<string>;
141
+ constructor(init: ResolveObject);
142
+ }
143
+ export declare class ResolveObjectResponse {
144
+ comment: Option<CommentView>;
145
+ post: Option<PostView>;
146
+ community: Option<CommunityView>;
147
+ person: Option<PersonViewSafe>;
148
+ }
149
+ export declare class PurgePerson {
150
+ person_id: number;
151
+ reason: Option<string>;
152
+ auth: string;
153
+ constructor(init: PurgePerson);
132
154
  }
133
- export interface SaveSiteConfig {
134
- config_hjson: string;
155
+ export declare class PurgeCommunity {
156
+ community_id: number;
157
+ reason: Option<string>;
135
158
  auth: string;
159
+ constructor(init: PurgeCommunity);
136
160
  }
137
- export interface FederatedInstances {
138
- linked: string[];
139
- allowed?: string[];
140
- blocked?: string[];
161
+ export declare class PurgePost {
162
+ post_id: number;
163
+ reason: Option<string>;
164
+ auth: string;
165
+ constructor(init: PurgePost);
141
166
  }
142
- export interface ResolveObject {
143
- q: string;
144
- auth?: string;
167
+ export declare class PurgeComment {
168
+ comment_id: number;
169
+ reason: Option<string>;
170
+ auth: string;
171
+ constructor(init: PurgeComment);
145
172
  }
146
- export interface ResolveObjectResponse {
147
- comment?: CommentView;
148
- post?: PostView;
149
- community?: CommunityView;
150
- person?: PersonViewSafe;
173
+ export declare class PurgeItemResponse {
174
+ success: boolean;
151
175
  }
152
- export interface ListRegistrationApplications {
176
+ export declare class ListRegistrationApplications {
153
177
  /**
154
178
  * Only shows the unread applications (IE those without an admin actor)
155
179
  */
156
- unread_only?: boolean;
157
- page?: number;
158
- limit?: number;
180
+ unread_only: Option<boolean>;
181
+ page: Option<number>;
182
+ limit: Option<number>;
159
183
  auth: string;
184
+ constructor(init: ListRegistrationApplications);
160
185
  }
161
- export interface ListRegistrationApplicationsResponse {
186
+ export declare class ListRegistrationApplicationsResponse {
162
187
  registration_applications: RegistrationApplicationView[];
163
188
  }
164
- export interface ApproveRegistrationApplication {
189
+ export declare class ApproveRegistrationApplication {
165
190
  id: number;
166
191
  approve: boolean;
167
- deny_reason?: string;
192
+ deny_reason: Option<string>;
168
193
  auth: string;
194
+ constructor(init: ApproveRegistrationApplication);
169
195
  }
170
- export interface RegistrationApplicationResponse {
196
+ export declare class RegistrationApplicationResponse {
171
197
  registration_application: RegistrationApplicationView;
172
198
  }
173
- export interface GetUnreadRegistrationApplicationCount {
199
+ export declare class GetUnreadRegistrationApplicationCount {
174
200
  auth: string;
201
+ constructor(init: GetUnreadRegistrationApplicationCount);
175
202
  }
176
- export interface GetUnreadRegistrationApplicationCountResponse {
203
+ export declare class GetUnreadRegistrationApplicationCountResponse {
177
204
  registration_applications: number;
178
205
  }