lemmy-js-client 0.17.0-rc.3 → 0.17.0-rc.32
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 +153 -13
- package/dist/http.js +249 -98
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/dist/interfaces/api/comment.d.ts +46 -38
- package/dist/interfaces/api/comment.js +326 -0
- package/dist/interfaces/api/community.d.ts +57 -55
- package/dist/interfaces/api/community.js +433 -0
- package/dist/interfaces/api/index.js +5 -1
- package/dist/interfaces/api/person.d.ts +121 -100
- package/dist/interfaces/api/person.js +894 -0
- package/dist/interfaces/api/post.d.ts +68 -51
- package/dist/interfaces/api/post.js +434 -0
- package/dist/interfaces/api/site.d.ts +95 -97
- package/dist/interfaces/api/site.js +873 -0
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/others.d.ts +65 -89
- package/dist/interfaces/others.js +125 -55
- package/dist/interfaces/source.d.ts +79 -76
- package/dist/interfaces/source.js +746 -0
- package/dist/interfaces/views.d.ts +42 -41
- package/dist/interfaces/views.js +522 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +18 -0
- package/dist/websocket.d.ts +14 -11
- package/dist/websocket.js +23 -17
- 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,124 @@ 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
|
123
|
-
auth: string;
|
124
|
-
}
|
125
|
-
export interface GetSiteConfig {
|
126
|
-
auth: string;
|
127
|
-
}
|
128
|
-
export interface GetSiteConfigResponse {
|
129
|
-
config_hjson: string;
|
130
|
-
}
|
131
|
-
export interface SaveSiteConfig {
|
132
|
-
config_hjson: string;
|
124
|
+
export declare class LeaveAdmin {
|
133
125
|
auth: string;
|
126
|
+
constructor(init: LeaveAdmin);
|
134
127
|
}
|
135
|
-
export
|
128
|
+
export declare class FederatedInstances {
|
136
129
|
linked: string[];
|
137
|
-
allowed
|
138
|
-
blocked
|
130
|
+
allowed: Option<string[]>;
|
131
|
+
blocked: Option<string[]>;
|
132
|
+
constructor(init: FederatedInstances);
|
139
133
|
}
|
140
|
-
export
|
134
|
+
export declare class ResolveObject {
|
141
135
|
q: string;
|
142
|
-
auth
|
136
|
+
auth: Option<string>;
|
137
|
+
constructor(init: ResolveObject);
|
143
138
|
}
|
144
|
-
export
|
145
|
-
comment
|
146
|
-
post
|
147
|
-
community
|
148
|
-
person
|
139
|
+
export declare class ResolveObjectResponse {
|
140
|
+
comment: Option<CommentView>;
|
141
|
+
post: Option<PostView>;
|
142
|
+
community: Option<CommunityView>;
|
143
|
+
person: Option<PersonViewSafe>;
|
149
144
|
}
|
150
|
-
export
|
145
|
+
export declare class ListRegistrationApplications {
|
151
146
|
/**
|
152
147
|
* Only shows the unread applications (IE those without an admin actor)
|
153
148
|
*/
|
154
|
-
unread_only
|
155
|
-
page
|
156
|
-
limit
|
149
|
+
unread_only: Option<boolean>;
|
150
|
+
page: Option<number>;
|
151
|
+
limit: Option<number>;
|
157
152
|
auth: string;
|
153
|
+
constructor(init: ListRegistrationApplications);
|
158
154
|
}
|
159
|
-
export
|
155
|
+
export declare class ListRegistrationApplicationsResponse {
|
160
156
|
registration_applications: RegistrationApplicationView[];
|
161
157
|
}
|
162
|
-
export
|
158
|
+
export declare class ApproveRegistrationApplication {
|
163
159
|
id: number;
|
164
160
|
approve: boolean;
|
165
|
-
deny_reason
|
161
|
+
deny_reason: Option<string>;
|
166
162
|
auth: string;
|
163
|
+
constructor(init: ApproveRegistrationApplication);
|
167
164
|
}
|
168
|
-
export
|
165
|
+
export declare class RegistrationApplicationResponse {
|
169
166
|
registration_application: RegistrationApplicationView;
|
170
167
|
}
|
171
|
-
export
|
168
|
+
export declare class GetUnreadRegistrationApplicationCount {
|
172
169
|
auth: string;
|
170
|
+
constructor(init: GetUnreadRegistrationApplicationCount);
|
173
171
|
}
|
174
|
-
export
|
172
|
+
export declare class GetUnreadRegistrationApplicationCountResponse {
|
175
173
|
registration_applications: number;
|
176
174
|
}
|