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

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,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,158 @@ 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
+ application_email_admins: Option<boolean>;
74
75
  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;
76
+ constructor(init: CreateSite);
77
+ }
78
+ export declare class EditSite {
79
+ name: Option<string>;
80
+ sidebar: Option<string>;
81
+ description: Option<string>;
82
+ icon: Option<string>;
83
+ banner: Option<string>;
84
+ enable_downvotes: Option<boolean>;
85
+ open_registration: Option<boolean>;
86
+ enable_nsfw: Option<boolean>;
87
+ community_creation_admin_only: Option<boolean>;
88
+ require_email_verification: Option<boolean>;
89
+ require_application: Option<boolean>;
90
+ application_question: Option<string>;
91
+ private_instance: Option<boolean>;
92
+ default_theme: Option<string>;
93
+ legal_information: Option<string>;
94
+ default_post_listing_type: Option<string>;
95
+ application_email_admins: Option<boolean>;
92
96
  auth: string;
97
+ constructor(init: EditSite);
93
98
  }
94
- export interface GetSite {
95
- auth?: string;
99
+ export declare class GetSite {
100
+ auth: Option<string>;
101
+ constructor(init: GetSite);
96
102
  }
97
- export interface SiteResponse {
103
+ export declare class SiteResponse {
98
104
  site_view: SiteView;
99
105
  }
100
- export interface GetSiteResponse {
106
+ export declare class GetSiteResponse {
101
107
  /**
102
108
  * Optional, because the site might not be set up yet.
103
109
  */
104
- site_view?: SiteView;
110
+ site_view: Option<SiteView>;
105
111
  admins: PersonViewSafe[];
106
112
  online: number;
107
113
  version: string;
108
114
  /**
109
115
  * If you're logged in, you'll get back extra user info.
110
116
  */
111
- my_user?: MyUserInfo;
112
- federated_instances?: FederatedInstances;
117
+ my_user: Option<MyUserInfo>;
118
+ federated_instances: Option<FederatedInstances>;
113
119
  }
114
120
  /**
115
121
  * Your user info, such as blocks, follows, etc.
116
122
  */
117
- export interface MyUserInfo {
123
+ export declare class MyUserInfo {
118
124
  local_user_view: LocalUserSettingsView;
119
125
  follows: CommunityFollowerView[];
120
126
  moderates: CommunityModeratorView[];
121
127
  community_blocks: CommunityBlockView[];
122
128
  person_blocks: PersonBlockView[];
123
129
  }
124
- export interface LeaveAdmin {
130
+ export declare class LeaveAdmin {
125
131
  auth: string;
132
+ constructor(init: LeaveAdmin);
126
133
  }
127
- export interface GetSiteConfig {
128
- auth: string;
134
+ export declare class FederatedInstances {
135
+ linked: string[];
136
+ allowed: Option<string[]>;
137
+ blocked: Option<string[]>;
138
+ constructor(init: FederatedInstances);
129
139
  }
130
- export interface GetSiteConfigResponse {
131
- config_hjson: string;
140
+ export declare class ResolveObject {
141
+ q: string;
142
+ auth: Option<string>;
143
+ constructor(init: ResolveObject);
144
+ }
145
+ export declare class ResolveObjectResponse {
146
+ comment: Option<CommentView>;
147
+ post: Option<PostView>;
148
+ community: Option<CommunityView>;
149
+ person: Option<PersonViewSafe>;
150
+ }
151
+ export declare class PurgePerson {
152
+ person_id: number;
153
+ reason: Option<string>;
154
+ auth: string;
155
+ constructor(init: PurgePerson);
132
156
  }
133
- export interface SaveSiteConfig {
134
- config_hjson: string;
157
+ export declare class PurgeCommunity {
158
+ community_id: number;
159
+ reason: Option<string>;
135
160
  auth: string;
161
+ constructor(init: PurgeCommunity);
136
162
  }
137
- export interface FederatedInstances {
138
- linked: string[];
139
- allowed?: string[];
140
- blocked?: string[];
163
+ export declare class PurgePost {
164
+ post_id: number;
165
+ reason: Option<string>;
166
+ auth: string;
167
+ constructor(init: PurgePost);
141
168
  }
142
- export interface ResolveObject {
143
- q: string;
144
- auth?: string;
169
+ export declare class PurgeComment {
170
+ comment_id: number;
171
+ reason: Option<string>;
172
+ auth: string;
173
+ constructor(init: PurgeComment);
145
174
  }
146
- export interface ResolveObjectResponse {
147
- comment?: CommentView;
148
- post?: PostView;
149
- community?: CommunityView;
150
- person?: PersonViewSafe;
175
+ export declare class PurgeItemResponse {
176
+ success: boolean;
151
177
  }
152
- export interface ListRegistrationApplications {
178
+ export declare class ListRegistrationApplications {
153
179
  /**
154
180
  * Only shows the unread applications (IE those without an admin actor)
155
181
  */
156
- unread_only?: boolean;
157
- page?: number;
158
- limit?: number;
182
+ unread_only: Option<boolean>;
183
+ page: Option<number>;
184
+ limit: Option<number>;
159
185
  auth: string;
186
+ constructor(init: ListRegistrationApplications);
160
187
  }
161
- export interface ListRegistrationApplicationsResponse {
188
+ export declare class ListRegistrationApplicationsResponse {
162
189
  registration_applications: RegistrationApplicationView[];
163
190
  }
164
- export interface ApproveRegistrationApplication {
191
+ export declare class ApproveRegistrationApplication {
165
192
  id: number;
166
193
  approve: boolean;
167
- deny_reason?: string;
194
+ deny_reason: Option<string>;
168
195
  auth: string;
196
+ constructor(init: ApproveRegistrationApplication);
169
197
  }
170
- export interface RegistrationApplicationResponse {
198
+ export declare class RegistrationApplicationResponse {
171
199
  registration_application: RegistrationApplicationView;
172
200
  }
173
- export interface GetUnreadRegistrationApplicationCount {
201
+ export declare class GetUnreadRegistrationApplicationCount {
174
202
  auth: string;
203
+ constructor(init: GetUnreadRegistrationApplicationCount);
175
204
  }
176
- export interface GetUnreadRegistrationApplicationCountResponse {
205
+ export declare class GetUnreadRegistrationApplicationCountResponse {
177
206
  registration_applications: number;
178
207
  }