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