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.
- 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 +127 -98
- package/dist/interfaces/api/site.js +985 -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 +113 -77
- package/dist/interfaces/source.js +809 -0
- package/dist/interfaces/views.d.ts +79 -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,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
|
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
|
+
application_email_admins: Option<boolean>;
|
74
75
|
auth: string;
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
95
|
-
auth
|
99
|
+
export declare class GetSite {
|
100
|
+
auth: Option<string>;
|
101
|
+
constructor(init: GetSite);
|
96
102
|
}
|
97
|
-
export
|
103
|
+
export declare class SiteResponse {
|
98
104
|
site_view: SiteView;
|
99
105
|
}
|
100
|
-
export
|
106
|
+
export declare class GetSiteResponse {
|
101
107
|
/**
|
102
108
|
* Optional, because the site might not be set up yet.
|
103
109
|
*/
|
104
|
-
site_view
|
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
|
112
|
-
federated_instances
|
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
|
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
|
130
|
+
export declare class LeaveAdmin {
|
125
131
|
auth: string;
|
132
|
+
constructor(init: LeaveAdmin);
|
126
133
|
}
|
127
|
-
export
|
128
|
-
|
134
|
+
export declare class FederatedInstances {
|
135
|
+
linked: string[];
|
136
|
+
allowed: Option<string[]>;
|
137
|
+
blocked: Option<string[]>;
|
138
|
+
constructor(init: FederatedInstances);
|
129
139
|
}
|
130
|
-
export
|
131
|
-
|
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
|
134
|
-
|
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
|
138
|
-
|
139
|
-
|
140
|
-
|
163
|
+
export declare class PurgePost {
|
164
|
+
post_id: number;
|
165
|
+
reason: Option<string>;
|
166
|
+
auth: string;
|
167
|
+
constructor(init: PurgePost);
|
141
168
|
}
|
142
|
-
export
|
143
|
-
|
144
|
-
|
169
|
+
export declare class PurgeComment {
|
170
|
+
comment_id: number;
|
171
|
+
reason: Option<string>;
|
172
|
+
auth: string;
|
173
|
+
constructor(init: PurgeComment);
|
145
174
|
}
|
146
|
-
export
|
147
|
-
|
148
|
-
post?: PostView;
|
149
|
-
community?: CommunityView;
|
150
|
-
person?: PersonViewSafe;
|
175
|
+
export declare class PurgeItemResponse {
|
176
|
+
success: boolean;
|
151
177
|
}
|
152
|
-
export
|
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
|
157
|
-
page
|
158
|
-
limit
|
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
|
188
|
+
export declare class ListRegistrationApplicationsResponse {
|
162
189
|
registration_applications: RegistrationApplicationView[];
|
163
190
|
}
|
164
|
-
export
|
191
|
+
export declare class ApproveRegistrationApplication {
|
165
192
|
id: number;
|
166
193
|
approve: boolean;
|
167
|
-
deny_reason
|
194
|
+
deny_reason: Option<string>;
|
168
195
|
auth: string;
|
196
|
+
constructor(init: ApproveRegistrationApplication);
|
169
197
|
}
|
170
|
-
export
|
198
|
+
export declare class RegistrationApplicationResponse {
|
171
199
|
registration_application: RegistrationApplicationView;
|
172
200
|
}
|
173
|
-
export
|
201
|
+
export declare class GetUnreadRegistrationApplicationCount {
|
174
202
|
auth: string;
|
203
|
+
constructor(init: GetUnreadRegistrationApplicationCount);
|
175
204
|
}
|
176
|
-
export
|
205
|
+
export declare class GetUnreadRegistrationApplicationCountResponse {
|
177
206
|
registration_applications: number;
|
178
207
|
}
|