lemmy-js-client 0.17.0-rc.2 → 0.17.0-rc.22
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 +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 +57 -52
- package/dist/interfaces/api/community.js +412 -0
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +121 -100
- package/dist/interfaces/api/person.js +855 -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 +100 -90
- package/dist/interfaces/api/site.js +825 -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 +37 -37
- package/dist/interfaces/views.js +274 -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 +14 -11
@@ -1,32 +1,27 @@
|
|
1
|
+
import { Option } from "@sniptt/monads";
|
2
|
+
import "reflect-metadata";
|
3
|
+
import { ListingType, SearchType, SortType } from "../others";
|
1
4
|
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
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[];
|
@@ -55,122 +51,136 @@ export interface GetModlogResponse {
|
|
55
51
|
transferred_to_community: ModTransferCommunityView[];
|
56
52
|
added: ModAddView[];
|
57
53
|
}
|
58
|
-
export
|
54
|
+
export declare class CreateSite {
|
59
55
|
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
|
56
|
+
sidebar: Option<string>;
|
57
|
+
description: Option<string>;
|
58
|
+
icon: Option<string>;
|
59
|
+
banner: Option<string>;
|
60
|
+
enable_downvotes: Option<boolean>;
|
61
|
+
open_registration: Option<boolean>;
|
62
|
+
enable_nsfw: Option<boolean>;
|
63
|
+
community_creation_admin_only: Option<boolean>;
|
64
|
+
require_email_verification: Option<boolean>;
|
65
|
+
require_application: Option<boolean>;
|
66
|
+
application_question: Option<string>;
|
67
|
+
private_instance: Option<boolean>;
|
68
|
+
default_theme: Option<string>;
|
69
|
+
default_post_listing_type: Option<string>;
|
73
70
|
auth: string;
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
71
|
+
constructor(init: CreateSite);
|
72
|
+
}
|
73
|
+
export declare class EditSite {
|
74
|
+
name: Option<string>;
|
75
|
+
sidebar: Option<string>;
|
76
|
+
description: Option<string>;
|
77
|
+
icon: Option<string>;
|
78
|
+
banner: Option<string>;
|
79
|
+
enable_downvotes: Option<boolean>;
|
80
|
+
open_registration: Option<boolean>;
|
81
|
+
enable_nsfw: Option<boolean>;
|
82
|
+
community_creation_admin_only: Option<boolean>;
|
83
|
+
require_email_verification: Option<boolean>;
|
84
|
+
require_application: Option<boolean>;
|
85
|
+
application_question: Option<string>;
|
86
|
+
private_instance: Option<boolean>;
|
87
|
+
default_theme: Option<string>;
|
88
|
+
legal_information: Option<string>;
|
89
|
+
default_post_listing_type: Option<string>;
|
90
90
|
auth: string;
|
91
|
+
constructor(init: EditSite);
|
91
92
|
}
|
92
|
-
export
|
93
|
-
auth
|
93
|
+
export declare class GetSite {
|
94
|
+
auth: Option<string>;
|
95
|
+
constructor(init: GetSite);
|
94
96
|
}
|
95
|
-
export
|
97
|
+
export declare class SiteResponse {
|
96
98
|
site_view: SiteView;
|
97
99
|
}
|
98
|
-
export
|
100
|
+
export declare class GetSiteResponse {
|
99
101
|
/**
|
100
102
|
* Optional, because the site might not be set up yet.
|
101
103
|
*/
|
102
|
-
site_view
|
104
|
+
site_view: Option<SiteView>;
|
103
105
|
admins: PersonViewSafe[];
|
104
106
|
online: number;
|
105
107
|
version: string;
|
106
108
|
/**
|
107
109
|
* If you're logged in, you'll get back extra user info.
|
108
110
|
*/
|
109
|
-
my_user
|
110
|
-
federated_instances
|
111
|
+
my_user: Option<MyUserInfo>;
|
112
|
+
federated_instances: Option<FederatedInstances>;
|
111
113
|
}
|
112
114
|
/**
|
113
115
|
* Your user info, such as blocks, follows, etc.
|
114
116
|
*/
|
115
|
-
export
|
117
|
+
export declare class MyUserInfo {
|
116
118
|
local_user_view: LocalUserSettingsView;
|
117
119
|
follows: CommunityFollowerView[];
|
118
120
|
moderates: CommunityModeratorView[];
|
119
121
|
community_blocks: CommunityBlockView[];
|
120
122
|
person_blocks: PersonBlockView[];
|
121
123
|
}
|
122
|
-
export
|
124
|
+
export declare class LeaveAdmin {
|
123
125
|
auth: string;
|
126
|
+
constructor(init: LeaveAdmin);
|
124
127
|
}
|
125
|
-
export
|
128
|
+
export declare class GetSiteConfig {
|
126
129
|
auth: string;
|
130
|
+
constructor(init: GetSiteConfig);
|
127
131
|
}
|
128
|
-
export
|
132
|
+
export declare class GetSiteConfigResponse {
|
129
133
|
config_hjson: string;
|
130
134
|
}
|
131
|
-
export
|
135
|
+
export declare class SaveSiteConfig {
|
132
136
|
config_hjson: string;
|
133
137
|
auth: string;
|
138
|
+
constructor(init: SaveSiteConfig);
|
134
139
|
}
|
135
|
-
export
|
140
|
+
export declare class FederatedInstances {
|
136
141
|
linked: string[];
|
137
|
-
allowed
|
138
|
-
blocked
|
142
|
+
allowed: Option<string[]>;
|
143
|
+
blocked: Option<string[]>;
|
144
|
+
constructor(init: FederatedInstances);
|
139
145
|
}
|
140
|
-
export
|
146
|
+
export declare class ResolveObject {
|
141
147
|
q: string;
|
142
|
-
auth
|
148
|
+
auth: Option<string>;
|
149
|
+
constructor(init: ResolveObject);
|
143
150
|
}
|
144
|
-
export
|
145
|
-
comment
|
146
|
-
post
|
147
|
-
community
|
148
|
-
person
|
151
|
+
export declare class ResolveObjectResponse {
|
152
|
+
comment: Option<CommentView>;
|
153
|
+
post: Option<PostView>;
|
154
|
+
community: Option<CommunityView>;
|
155
|
+
person: Option<PersonViewSafe>;
|
149
156
|
}
|
150
|
-
export
|
157
|
+
export declare class ListRegistrationApplications {
|
151
158
|
/**
|
152
159
|
* Only shows the unread applications (IE those without an admin actor)
|
153
160
|
*/
|
154
|
-
unread_only
|
155
|
-
page
|
156
|
-
limit
|
161
|
+
unread_only: Option<boolean>;
|
162
|
+
page: Option<number>;
|
163
|
+
limit: Option<number>;
|
157
164
|
auth: string;
|
165
|
+
constructor(init: ListRegistrationApplications);
|
158
166
|
}
|
159
|
-
export
|
167
|
+
export declare class ListRegistrationApplicationsResponse {
|
160
168
|
registration_applications: RegistrationApplicationView[];
|
161
169
|
}
|
162
|
-
export
|
170
|
+
export declare class ApproveRegistrationApplication {
|
163
171
|
id: number;
|
164
172
|
approve: boolean;
|
165
|
-
deny_reason
|
173
|
+
deny_reason: Option<string>;
|
166
174
|
auth: string;
|
175
|
+
constructor(init: ApproveRegistrationApplication);
|
167
176
|
}
|
168
|
-
export
|
177
|
+
export declare class RegistrationApplicationResponse {
|
169
178
|
registration_application: RegistrationApplicationView;
|
170
179
|
}
|
171
|
-
export
|
180
|
+
export declare class GetUnreadRegistrationApplicationCount {
|
172
181
|
auth: string;
|
182
|
+
constructor(init: GetUnreadRegistrationApplicationCount);
|
173
183
|
}
|
174
|
-
export
|
184
|
+
export declare class GetUnreadRegistrationApplicationCountResponse {
|
175
185
|
registration_applications: number;
|
176
186
|
}
|