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.
- package/dist/http.d.ts +178 -14
- package/dist/http.js +296 -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 +47 -45
- package/dist/interfaces/api/comment.js +349 -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 +132 -102
- package/dist/interfaces/api/person.js +910 -0
- package/dist/interfaces/api/post.d.ts +71 -54
- package/dist/interfaces/api/post.js +453 -0
- package/dist/interfaces/api/site.d.ts +125 -98
- package/dist/interfaces/api/site.js +963 -0
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +101 -93
- package/dist/interfaces/others.js +162 -59
- package/dist/interfaces/source.d.ts +112 -77
- package/dist/interfaces/source.js +809 -0
- package/dist/interfaces/views.d.ts +80 -40
- package/dist/interfaces/views.js +599 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +18 -0
- package/dist/websocket.d.ts +33 -14
- package/dist/websocket.js +49 -19
- package/package.json +17 -14
@@ -1,32 +1,27 @@
|
|
1
|
-
import {
|
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
|
8
|
+
export declare class Search {
|
6
9
|
/**
|
7
10
|
* The search query string.
|
8
11
|
*/
|
9
12
|
q: string;
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
40
|
-
mod_person_id
|
41
|
-
community_id
|
42
|
-
page
|
43
|
-
limit
|
44
|
-
auth
|
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
|
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
|
58
|
+
export declare class CreateSite {
|
59
59
|
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
|
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
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
95
|
-
auth
|
97
|
+
export declare class GetSite {
|
98
|
+
auth: Option<string>;
|
99
|
+
constructor(init: GetSite);
|
96
100
|
}
|
97
|
-
export
|
101
|
+
export declare class SiteResponse {
|
98
102
|
site_view: SiteView;
|
99
103
|
}
|
100
|
-
export
|
104
|
+
export declare class GetSiteResponse {
|
101
105
|
/**
|
102
106
|
* Optional, because the site might not be set up yet.
|
103
107
|
*/
|
104
|
-
site_view
|
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
|
112
|
-
federated_instances
|
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
|
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
|
128
|
+
export declare class LeaveAdmin {
|
125
129
|
auth: string;
|
130
|
+
constructor(init: LeaveAdmin);
|
126
131
|
}
|
127
|
-
export
|
128
|
-
|
132
|
+
export declare class FederatedInstances {
|
133
|
+
linked: string[];
|
134
|
+
allowed: Option<string[]>;
|
135
|
+
blocked: Option<string[]>;
|
136
|
+
constructor(init: FederatedInstances);
|
129
137
|
}
|
130
|
-
export
|
131
|
-
|
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
|
134
|
-
|
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
|
138
|
-
|
139
|
-
|
140
|
-
|
161
|
+
export declare class PurgePost {
|
162
|
+
post_id: number;
|
163
|
+
reason: Option<string>;
|
164
|
+
auth: string;
|
165
|
+
constructor(init: PurgePost);
|
141
166
|
}
|
142
|
-
export
|
143
|
-
|
144
|
-
|
167
|
+
export declare class PurgeComment {
|
168
|
+
comment_id: number;
|
169
|
+
reason: Option<string>;
|
170
|
+
auth: string;
|
171
|
+
constructor(init: PurgeComment);
|
145
172
|
}
|
146
|
-
export
|
147
|
-
|
148
|
-
post?: PostView;
|
149
|
-
community?: CommunityView;
|
150
|
-
person?: PersonViewSafe;
|
173
|
+
export declare class PurgeItemResponse {
|
174
|
+
success: boolean;
|
151
175
|
}
|
152
|
-
export
|
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
|
157
|
-
page
|
158
|
-
limit
|
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
|
186
|
+
export declare class ListRegistrationApplicationsResponse {
|
162
187
|
registration_applications: RegistrationApplicationView[];
|
163
188
|
}
|
164
|
-
export
|
189
|
+
export declare class ApproveRegistrationApplication {
|
165
190
|
id: number;
|
166
191
|
approve: boolean;
|
167
|
-
deny_reason
|
192
|
+
deny_reason: Option<string>;
|
168
193
|
auth: string;
|
194
|
+
constructor(init: ApproveRegistrationApplication);
|
169
195
|
}
|
170
|
-
export
|
196
|
+
export declare class RegistrationApplicationResponse {
|
171
197
|
registration_application: RegistrationApplicationView;
|
172
198
|
}
|
173
|
-
export
|
199
|
+
export declare class GetUnreadRegistrationApplicationCount {
|
174
200
|
auth: string;
|
201
|
+
constructor(init: GetUnreadRegistrationApplicationCount);
|
175
202
|
}
|
176
|
-
export
|
203
|
+
export declare class GetUnreadRegistrationApplicationCountResponse {
|
177
204
|
registration_applications: number;
|
178
205
|
}
|