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