lemmy-js-client 0.17.0-rc.13 → 0.17.0-rc.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/http.d.ts +74 -0
- package/dist/http.js +171 -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,138 +1,154 @@
|
|
1
|
+
import { Option } from "@sniptt/monads";
|
1
2
|
import { ListingType, SiteMetadata, SortType } from "../others";
|
2
3
|
import { CommentView, CommunityModeratorView, CommunityView, PostReportView, PostView } from "../views";
|
3
|
-
export
|
4
|
+
export declare class CreatePost {
|
4
5
|
name: string;
|
5
|
-
url
|
6
|
-
body
|
7
|
-
nsfw
|
6
|
+
url: Option<string>;
|
7
|
+
body: Option<string>;
|
8
|
+
nsfw: Option<boolean>;
|
8
9
|
community_id: number;
|
10
|
+
honeypot: Option<string>;
|
9
11
|
auth: string;
|
10
|
-
honeypot
|
12
|
+
constructor(name: string, url: Option<string>, body: Option<string>, nsfw: Option<boolean>, community_id: number, honeypot: Option<string>, auth: string);
|
11
13
|
}
|
12
|
-
export
|
14
|
+
export declare class PostResponse {
|
13
15
|
post_view: PostView;
|
14
16
|
}
|
15
|
-
export
|
17
|
+
export declare class GetPost {
|
16
18
|
id: number;
|
17
|
-
auth
|
19
|
+
auth: Option<string>;
|
20
|
+
constructor(id: number, auth: Option<string>);
|
18
21
|
}
|
19
|
-
export
|
22
|
+
export declare class GetPostResponse {
|
20
23
|
post_view: PostView;
|
21
24
|
community_view: CommunityView;
|
22
25
|
comments: CommentView[];
|
23
26
|
moderators: CommunityModeratorView[];
|
24
27
|
online: number;
|
25
28
|
}
|
26
|
-
export
|
27
|
-
type_
|
28
|
-
sort
|
29
|
-
page
|
30
|
-
limit
|
31
|
-
community_id
|
29
|
+
export declare class GetPosts {
|
30
|
+
type_: Option<ListingType>;
|
31
|
+
sort: Option<SortType>;
|
32
|
+
page: Option<number>;
|
33
|
+
limit: Option<number>;
|
34
|
+
community_id: Option<number>;
|
32
35
|
/**
|
33
36
|
* To get posts for a federated community by name, use `name@instance.tld` .
|
34
37
|
*/
|
35
|
-
community_name
|
36
|
-
saved_only
|
37
|
-
auth
|
38
|
+
community_name: Option<string>;
|
39
|
+
saved_only: Option<boolean>;
|
40
|
+
auth: Option<string>;
|
41
|
+
constructor(type_: Option<ListingType>, sort: Option<SortType>, page: Option<number>, limit: Option<number>, community_id: Option<number>, community_name: Option<string>, saved_only: Option<boolean>, auth: Option<string>);
|
38
42
|
}
|
39
|
-
export
|
43
|
+
export declare class GetPostsResponse {
|
40
44
|
posts: PostView[];
|
41
45
|
}
|
42
|
-
export
|
46
|
+
export declare class CreatePostLike {
|
43
47
|
post_id: number;
|
44
48
|
/**
|
45
49
|
* `score` can be 0, -1, or 1. Anything else will be rejected.
|
46
50
|
*/
|
47
51
|
score: number;
|
48
52
|
auth: string;
|
53
|
+
constructor(post_id: number, score: number, auth: string);
|
49
54
|
}
|
50
|
-
export
|
55
|
+
export declare class EditPost {
|
51
56
|
post_id: number;
|
52
|
-
name
|
53
|
-
url
|
54
|
-
body
|
55
|
-
nsfw
|
57
|
+
name: Option<string>;
|
58
|
+
url: Option<string>;
|
59
|
+
body: Option<string>;
|
60
|
+
nsfw: Option<boolean>;
|
56
61
|
auth: string;
|
62
|
+
constructor(post_id: number, name: Option<string>, url: Option<string>, body: Option<string>, nsfw: Option<boolean>, auth: string);
|
57
63
|
}
|
58
|
-
export
|
64
|
+
export declare class DeletePost {
|
59
65
|
post_id: number;
|
60
66
|
deleted: boolean;
|
61
67
|
auth: string;
|
68
|
+
constructor(post_id: number, deleted: boolean, auth: string);
|
62
69
|
}
|
63
70
|
/**
|
64
71
|
* Only admins and mods can remove a post.
|
65
72
|
*/
|
66
|
-
export
|
73
|
+
export declare class RemovePost {
|
67
74
|
post_id: number;
|
68
75
|
removed: boolean;
|
69
|
-
reason
|
76
|
+
reason: Option<string>;
|
70
77
|
auth: string;
|
78
|
+
constructor(post_id: number, removed: boolean, reason: Option<string>, auth: string);
|
71
79
|
}
|
72
80
|
/**
|
73
81
|
* Marks a post as read.
|
74
82
|
*/
|
75
|
-
export
|
83
|
+
export declare class MarkPostAsRead {
|
76
84
|
post_id: number;
|
77
85
|
read: boolean;
|
78
86
|
auth: string;
|
87
|
+
constructor(post_id: number, read: boolean, auth: string);
|
79
88
|
}
|
80
89
|
/**
|
81
90
|
* Only admins and mods can lock a post.
|
82
91
|
*/
|
83
|
-
export
|
92
|
+
export declare class LockPost {
|
84
93
|
post_id: number;
|
85
94
|
locked: boolean;
|
86
95
|
auth: string;
|
96
|
+
constructor(post_id: number, locked: boolean, auth: string);
|
87
97
|
}
|
88
98
|
/**
|
89
99
|
* Only admins and mods can sticky a post.
|
90
100
|
*/
|
91
|
-
export
|
101
|
+
export declare class StickyPost {
|
92
102
|
post_id: number;
|
93
103
|
stickied: boolean;
|
94
104
|
auth: string;
|
105
|
+
constructor(post_id: number, stickied: boolean, auth: string);
|
95
106
|
}
|
96
|
-
export
|
107
|
+
export declare class SavePost {
|
97
108
|
post_id: number;
|
98
109
|
save: boolean;
|
99
110
|
auth: string;
|
111
|
+
constructor(post_id: number, save: boolean, auth: string);
|
100
112
|
}
|
101
|
-
export
|
113
|
+
export declare class CreatePostReport {
|
102
114
|
post_id: number;
|
103
115
|
reason: string;
|
104
116
|
auth: string;
|
117
|
+
constructor(post_id: number, reason: string, auth: string);
|
105
118
|
}
|
106
|
-
export
|
119
|
+
export declare class PostReportResponse {
|
107
120
|
post_report_view: PostReportView;
|
108
121
|
}
|
109
|
-
export
|
122
|
+
export declare class ResolvePostReport {
|
110
123
|
report_id: number;
|
111
124
|
/**
|
112
125
|
* Either resolve or unresolve a report.
|
113
126
|
*/
|
114
127
|
resolved: boolean;
|
115
128
|
auth: string;
|
129
|
+
constructor(report_id: number, resolved: boolean, auth: string);
|
116
130
|
}
|
117
|
-
export
|
118
|
-
page
|
119
|
-
limit
|
131
|
+
export declare class ListPostReports {
|
132
|
+
page: Option<number>;
|
133
|
+
limit: Option<number>;
|
120
134
|
/**
|
121
135
|
* if no community is given, it returns reports for all communities moderated by the auth user.
|
122
136
|
*/
|
123
|
-
community_id
|
137
|
+
community_id: Option<number>;
|
124
138
|
/**
|
125
139
|
* Only shows the unresolved reports.
|
126
140
|
*/
|
127
|
-
unresolved_only
|
141
|
+
unresolved_only: Option<boolean>;
|
128
142
|
auth: string;
|
143
|
+
constructor(page: Option<number>, limit: Option<number>, community_id: Option<number>, unresolved_only: Option<boolean>, auth: string);
|
129
144
|
}
|
130
|
-
export
|
145
|
+
export declare class ListPostReportsResponse {
|
131
146
|
post_reports: PostReportView[];
|
132
147
|
}
|
133
|
-
export
|
148
|
+
export declare class GetSiteMetadata {
|
134
149
|
url: string;
|
150
|
+
constructor(url: string);
|
135
151
|
}
|
136
|
-
export
|
152
|
+
export declare class GetSiteMetadataResponse {
|
137
153
|
metadata: SiteMetadata;
|
138
154
|
}
|
@@ -1,2 +1,449 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
+
exports.GetSiteMetadataResponse = exports.GetSiteMetadata = exports.ListPostReportsResponse = exports.ListPostReports = exports.ResolvePostReport = exports.PostReportResponse = exports.CreatePostReport = exports.SavePost = exports.StickyPost = exports.LockPost = exports.MarkPostAsRead = exports.RemovePost = exports.DeletePost = exports.EditPost = exports.CreatePostLike = exports.GetPostsResponse = exports.GetPosts = exports.GetPostResponse = exports.GetPost = exports.PostResponse = exports.CreatePost = void 0;
|
10
|
+
var monads_1 = require("@sniptt/monads");
|
11
|
+
var class_transformer_1 = require("class-transformer");
|
12
|
+
var utils_1 = require("../../utils");
|
13
|
+
var CreatePost = /** @class */ (function () {
|
14
|
+
function CreatePost(name, url, body, nsfw, community_id, honeypot, auth) {
|
15
|
+
this.name = name;
|
16
|
+
this.url = url;
|
17
|
+
this.body = body;
|
18
|
+
this.nsfw = nsfw;
|
19
|
+
this.community_id = community_id;
|
20
|
+
this.honeypot = honeypot;
|
21
|
+
this.auth = auth;
|
22
|
+
}
|
23
|
+
__decorate([
|
24
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
25
|
+
var value = _a.value;
|
26
|
+
return (0, monads_1.Some)(value);
|
27
|
+
}, { toClassOnly: true }),
|
28
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
29
|
+
var value = _a.value;
|
30
|
+
return (0, utils_1.toUndefined)(value);
|
31
|
+
}, { toPlainOnly: true }),
|
32
|
+
(0, class_transformer_1.Expose)()
|
33
|
+
], CreatePost.prototype, "url", void 0);
|
34
|
+
__decorate([
|
35
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
36
|
+
var value = _a.value;
|
37
|
+
return (0, monads_1.Some)(value);
|
38
|
+
}, { toClassOnly: true }),
|
39
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
40
|
+
var value = _a.value;
|
41
|
+
return (0, utils_1.toUndefined)(value);
|
42
|
+
}, { toPlainOnly: true }),
|
43
|
+
(0, class_transformer_1.Expose)()
|
44
|
+
], CreatePost.prototype, "body", void 0);
|
45
|
+
__decorate([
|
46
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
47
|
+
var value = _a.value;
|
48
|
+
return (0, monads_1.Some)(value);
|
49
|
+
}, { toClassOnly: true }),
|
50
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
51
|
+
var value = _a.value;
|
52
|
+
return (0, utils_1.toUndefined)(value);
|
53
|
+
}, { toPlainOnly: true }),
|
54
|
+
(0, class_transformer_1.Expose)()
|
55
|
+
], CreatePost.prototype, "nsfw", void 0);
|
56
|
+
__decorate([
|
57
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
58
|
+
var value = _a.value;
|
59
|
+
return (0, monads_1.Some)(value);
|
60
|
+
}, { toClassOnly: true }),
|
61
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
62
|
+
var value = _a.value;
|
63
|
+
return (0, utils_1.toUndefined)(value);
|
64
|
+
}, { toPlainOnly: true }),
|
65
|
+
(0, class_transformer_1.Expose)()
|
66
|
+
], CreatePost.prototype, "honeypot", void 0);
|
67
|
+
return CreatePost;
|
68
|
+
}());
|
69
|
+
exports.CreatePost = CreatePost;
|
70
|
+
var PostResponse = /** @class */ (function () {
|
71
|
+
function PostResponse() {
|
72
|
+
}
|
73
|
+
return PostResponse;
|
74
|
+
}());
|
75
|
+
exports.PostResponse = PostResponse;
|
76
|
+
var GetPost = /** @class */ (function () {
|
77
|
+
function GetPost(id, auth) {
|
78
|
+
this.id = id;
|
79
|
+
this.auth = auth;
|
80
|
+
}
|
81
|
+
__decorate([
|
82
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
83
|
+
var value = _a.value;
|
84
|
+
return (0, monads_1.Some)(value);
|
85
|
+
}, { toClassOnly: true }),
|
86
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
87
|
+
var value = _a.value;
|
88
|
+
return (0, utils_1.toUndefined)(value);
|
89
|
+
}, { toPlainOnly: true }),
|
90
|
+
(0, class_transformer_1.Expose)()
|
91
|
+
], GetPost.prototype, "auth", void 0);
|
92
|
+
return GetPost;
|
93
|
+
}());
|
94
|
+
exports.GetPost = GetPost;
|
95
|
+
var GetPostResponse = /** @class */ (function () {
|
96
|
+
function GetPostResponse() {
|
97
|
+
}
|
98
|
+
return GetPostResponse;
|
99
|
+
}());
|
100
|
+
exports.GetPostResponse = GetPostResponse;
|
101
|
+
var GetPosts = /** @class */ (function () {
|
102
|
+
function GetPosts(type_, sort, page, limit, community_id, community_name, saved_only, auth) {
|
103
|
+
this.type_ = type_;
|
104
|
+
this.sort = sort;
|
105
|
+
this.page = page;
|
106
|
+
this.limit = limit;
|
107
|
+
this.community_id = community_id;
|
108
|
+
this.community_name = community_name;
|
109
|
+
this.saved_only = saved_only;
|
110
|
+
this.auth = auth;
|
111
|
+
}
|
112
|
+
__decorate([
|
113
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
114
|
+
var value = _a.value;
|
115
|
+
return (0, monads_1.Some)(value);
|
116
|
+
}, { toClassOnly: true }),
|
117
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
118
|
+
var value = _a.value;
|
119
|
+
return (0, utils_1.toUndefined)(value);
|
120
|
+
}, { toPlainOnly: true }),
|
121
|
+
(0, class_transformer_1.Expose)()
|
122
|
+
], GetPosts.prototype, "type_", void 0);
|
123
|
+
__decorate([
|
124
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
125
|
+
var value = _a.value;
|
126
|
+
return (0, monads_1.Some)(value);
|
127
|
+
}, { toClassOnly: true }),
|
128
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
129
|
+
var value = _a.value;
|
130
|
+
return (0, utils_1.toUndefined)(value);
|
131
|
+
}, { toPlainOnly: true }),
|
132
|
+
(0, class_transformer_1.Expose)()
|
133
|
+
], GetPosts.prototype, "sort", void 0);
|
134
|
+
__decorate([
|
135
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
136
|
+
var value = _a.value;
|
137
|
+
return (0, monads_1.Some)(value);
|
138
|
+
}, { toClassOnly: true }),
|
139
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
140
|
+
var value = _a.value;
|
141
|
+
return (0, utils_1.toUndefined)(value);
|
142
|
+
}, { toPlainOnly: true }),
|
143
|
+
(0, class_transformer_1.Expose)()
|
144
|
+
], GetPosts.prototype, "page", void 0);
|
145
|
+
__decorate([
|
146
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
147
|
+
var value = _a.value;
|
148
|
+
return (0, monads_1.Some)(value);
|
149
|
+
}, { toClassOnly: true }),
|
150
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
151
|
+
var value = _a.value;
|
152
|
+
return (0, utils_1.toUndefined)(value);
|
153
|
+
}, { toPlainOnly: true }),
|
154
|
+
(0, class_transformer_1.Expose)()
|
155
|
+
], GetPosts.prototype, "limit", void 0);
|
156
|
+
__decorate([
|
157
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
158
|
+
var value = _a.value;
|
159
|
+
return (0, monads_1.Some)(value);
|
160
|
+
}, { toClassOnly: true }),
|
161
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
162
|
+
var value = _a.value;
|
163
|
+
return (0, utils_1.toUndefined)(value);
|
164
|
+
}, { toPlainOnly: true }),
|
165
|
+
(0, class_transformer_1.Expose)()
|
166
|
+
], GetPosts.prototype, "community_id", void 0);
|
167
|
+
__decorate([
|
168
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
169
|
+
var value = _a.value;
|
170
|
+
return (0, monads_1.Some)(value);
|
171
|
+
}, { toClassOnly: true }),
|
172
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
173
|
+
var value = _a.value;
|
174
|
+
return (0, utils_1.toUndefined)(value);
|
175
|
+
}, { toPlainOnly: true }),
|
176
|
+
(0, class_transformer_1.Expose)()
|
177
|
+
], GetPosts.prototype, "community_name", void 0);
|
178
|
+
__decorate([
|
179
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
180
|
+
var value = _a.value;
|
181
|
+
return (0, monads_1.Some)(value);
|
182
|
+
}, { toClassOnly: true }),
|
183
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
184
|
+
var value = _a.value;
|
185
|
+
return (0, utils_1.toUndefined)(value);
|
186
|
+
}, { toPlainOnly: true }),
|
187
|
+
(0, class_transformer_1.Expose)()
|
188
|
+
], GetPosts.prototype, "saved_only", void 0);
|
189
|
+
__decorate([
|
190
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
191
|
+
var value = _a.value;
|
192
|
+
return (0, monads_1.Some)(value);
|
193
|
+
}, { toClassOnly: true }),
|
194
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
195
|
+
var value = _a.value;
|
196
|
+
return (0, utils_1.toUndefined)(value);
|
197
|
+
}, { toPlainOnly: true }),
|
198
|
+
(0, class_transformer_1.Expose)()
|
199
|
+
], GetPosts.prototype, "auth", void 0);
|
200
|
+
return GetPosts;
|
201
|
+
}());
|
202
|
+
exports.GetPosts = GetPosts;
|
203
|
+
var GetPostsResponse = /** @class */ (function () {
|
204
|
+
function GetPostsResponse() {
|
205
|
+
}
|
206
|
+
return GetPostsResponse;
|
207
|
+
}());
|
208
|
+
exports.GetPostsResponse = GetPostsResponse;
|
209
|
+
var CreatePostLike = /** @class */ (function () {
|
210
|
+
function CreatePostLike(post_id, score, auth) {
|
211
|
+
this.post_id = post_id;
|
212
|
+
this.score = score;
|
213
|
+
this.auth = auth;
|
214
|
+
}
|
215
|
+
return CreatePostLike;
|
216
|
+
}());
|
217
|
+
exports.CreatePostLike = CreatePostLike;
|
218
|
+
var EditPost = /** @class */ (function () {
|
219
|
+
function EditPost(post_id, name, url, body, nsfw, auth) {
|
220
|
+
this.post_id = post_id;
|
221
|
+
this.name = name;
|
222
|
+
this.url = url;
|
223
|
+
this.body = body;
|
224
|
+
this.nsfw = nsfw;
|
225
|
+
this.auth = auth;
|
226
|
+
}
|
227
|
+
__decorate([
|
228
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
229
|
+
var value = _a.value;
|
230
|
+
return (0, monads_1.Some)(value);
|
231
|
+
}, { toClassOnly: true }),
|
232
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
233
|
+
var value = _a.value;
|
234
|
+
return (0, utils_1.toUndefined)(value);
|
235
|
+
}, { toPlainOnly: true }),
|
236
|
+
(0, class_transformer_1.Expose)()
|
237
|
+
], EditPost.prototype, "name", void 0);
|
238
|
+
__decorate([
|
239
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
240
|
+
var value = _a.value;
|
241
|
+
return (0, monads_1.Some)(value);
|
242
|
+
}, { toClassOnly: true }),
|
243
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
244
|
+
var value = _a.value;
|
245
|
+
return (0, utils_1.toUndefined)(value);
|
246
|
+
}, { toPlainOnly: true }),
|
247
|
+
(0, class_transformer_1.Expose)()
|
248
|
+
], EditPost.prototype, "url", void 0);
|
249
|
+
__decorate([
|
250
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
251
|
+
var value = _a.value;
|
252
|
+
return (0, monads_1.Some)(value);
|
253
|
+
}, { toClassOnly: true }),
|
254
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
255
|
+
var value = _a.value;
|
256
|
+
return (0, utils_1.toUndefined)(value);
|
257
|
+
}, { toPlainOnly: true }),
|
258
|
+
(0, class_transformer_1.Expose)()
|
259
|
+
], EditPost.prototype, "body", void 0);
|
260
|
+
__decorate([
|
261
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
262
|
+
var value = _a.value;
|
263
|
+
return (0, monads_1.Some)(value);
|
264
|
+
}, { toClassOnly: true }),
|
265
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
266
|
+
var value = _a.value;
|
267
|
+
return (0, utils_1.toUndefined)(value);
|
268
|
+
}, { toPlainOnly: true }),
|
269
|
+
(0, class_transformer_1.Expose)()
|
270
|
+
], EditPost.prototype, "nsfw", void 0);
|
271
|
+
return EditPost;
|
272
|
+
}());
|
273
|
+
exports.EditPost = EditPost;
|
274
|
+
var DeletePost = /** @class */ (function () {
|
275
|
+
function DeletePost(post_id, deleted, auth) {
|
276
|
+
this.post_id = post_id;
|
277
|
+
this.deleted = deleted;
|
278
|
+
this.auth = auth;
|
279
|
+
}
|
280
|
+
return DeletePost;
|
281
|
+
}());
|
282
|
+
exports.DeletePost = DeletePost;
|
283
|
+
/**
|
284
|
+
* Only admins and mods can remove a post.
|
285
|
+
*/
|
286
|
+
var RemovePost = /** @class */ (function () {
|
287
|
+
function RemovePost(post_id, removed, reason, auth) {
|
288
|
+
this.post_id = post_id;
|
289
|
+
this.removed = removed;
|
290
|
+
this.reason = reason;
|
291
|
+
this.auth = auth;
|
292
|
+
}
|
293
|
+
__decorate([
|
294
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
295
|
+
var value = _a.value;
|
296
|
+
return (0, monads_1.Some)(value);
|
297
|
+
}, { toClassOnly: true }),
|
298
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
299
|
+
var value = _a.value;
|
300
|
+
return (0, utils_1.toUndefined)(value);
|
301
|
+
}, { toPlainOnly: true }),
|
302
|
+
(0, class_transformer_1.Expose)()
|
303
|
+
], RemovePost.prototype, "reason", void 0);
|
304
|
+
return RemovePost;
|
305
|
+
}());
|
306
|
+
exports.RemovePost = RemovePost;
|
307
|
+
/**
|
308
|
+
* Marks a post as read.
|
309
|
+
*/
|
310
|
+
var MarkPostAsRead = /** @class */ (function () {
|
311
|
+
function MarkPostAsRead(post_id, read, auth) {
|
312
|
+
this.post_id = post_id;
|
313
|
+
this.read = read;
|
314
|
+
this.auth = auth;
|
315
|
+
}
|
316
|
+
return MarkPostAsRead;
|
317
|
+
}());
|
318
|
+
exports.MarkPostAsRead = MarkPostAsRead;
|
319
|
+
/**
|
320
|
+
* Only admins and mods can lock a post.
|
321
|
+
*/
|
322
|
+
var LockPost = /** @class */ (function () {
|
323
|
+
function LockPost(post_id, locked, auth) {
|
324
|
+
this.post_id = post_id;
|
325
|
+
this.locked = locked;
|
326
|
+
this.auth = auth;
|
327
|
+
}
|
328
|
+
return LockPost;
|
329
|
+
}());
|
330
|
+
exports.LockPost = LockPost;
|
331
|
+
/**
|
332
|
+
* Only admins and mods can sticky a post.
|
333
|
+
*/
|
334
|
+
var StickyPost = /** @class */ (function () {
|
335
|
+
function StickyPost(post_id, stickied, auth) {
|
336
|
+
this.post_id = post_id;
|
337
|
+
this.stickied = stickied;
|
338
|
+
this.auth = auth;
|
339
|
+
}
|
340
|
+
return StickyPost;
|
341
|
+
}());
|
342
|
+
exports.StickyPost = StickyPost;
|
343
|
+
var SavePost = /** @class */ (function () {
|
344
|
+
function SavePost(post_id, save, auth) {
|
345
|
+
this.post_id = post_id;
|
346
|
+
this.save = save;
|
347
|
+
this.auth = auth;
|
348
|
+
}
|
349
|
+
return SavePost;
|
350
|
+
}());
|
351
|
+
exports.SavePost = SavePost;
|
352
|
+
var CreatePostReport = /** @class */ (function () {
|
353
|
+
function CreatePostReport(post_id, reason, auth) {
|
354
|
+
this.post_id = post_id;
|
355
|
+
this.reason = reason;
|
356
|
+
this.auth = auth;
|
357
|
+
}
|
358
|
+
return CreatePostReport;
|
359
|
+
}());
|
360
|
+
exports.CreatePostReport = CreatePostReport;
|
361
|
+
var PostReportResponse = /** @class */ (function () {
|
362
|
+
function PostReportResponse() {
|
363
|
+
}
|
364
|
+
return PostReportResponse;
|
365
|
+
}());
|
366
|
+
exports.PostReportResponse = PostReportResponse;
|
367
|
+
var ResolvePostReport = /** @class */ (function () {
|
368
|
+
function ResolvePostReport(report_id, resolved, auth) {
|
369
|
+
this.report_id = report_id;
|
370
|
+
this.resolved = resolved;
|
371
|
+
this.auth = auth;
|
372
|
+
}
|
373
|
+
return ResolvePostReport;
|
374
|
+
}());
|
375
|
+
exports.ResolvePostReport = ResolvePostReport;
|
376
|
+
var ListPostReports = /** @class */ (function () {
|
377
|
+
function ListPostReports(page, limit, community_id, unresolved_only, auth) {
|
378
|
+
this.page = page;
|
379
|
+
this.limit = limit;
|
380
|
+
this.community_id = community_id;
|
381
|
+
this.unresolved_only = unresolved_only;
|
382
|
+
this.auth = auth;
|
383
|
+
}
|
384
|
+
__decorate([
|
385
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
386
|
+
var value = _a.value;
|
387
|
+
return (0, monads_1.Some)(value);
|
388
|
+
}, { toClassOnly: true }),
|
389
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
390
|
+
var value = _a.value;
|
391
|
+
return (0, utils_1.toUndefined)(value);
|
392
|
+
}, { toPlainOnly: true }),
|
393
|
+
(0, class_transformer_1.Expose)()
|
394
|
+
], ListPostReports.prototype, "page", void 0);
|
395
|
+
__decorate([
|
396
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
397
|
+
var value = _a.value;
|
398
|
+
return (0, monads_1.Some)(value);
|
399
|
+
}, { toClassOnly: true }),
|
400
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
401
|
+
var value = _a.value;
|
402
|
+
return (0, utils_1.toUndefined)(value);
|
403
|
+
}, { toPlainOnly: true }),
|
404
|
+
(0, class_transformer_1.Expose)()
|
405
|
+
], ListPostReports.prototype, "limit", void 0);
|
406
|
+
__decorate([
|
407
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
408
|
+
var value = _a.value;
|
409
|
+
return (0, monads_1.Some)(value);
|
410
|
+
}, { toClassOnly: true }),
|
411
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
412
|
+
var value = _a.value;
|
413
|
+
return (0, utils_1.toUndefined)(value);
|
414
|
+
}, { toPlainOnly: true }),
|
415
|
+
(0, class_transformer_1.Expose)()
|
416
|
+
], ListPostReports.prototype, "community_id", void 0);
|
417
|
+
__decorate([
|
418
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
419
|
+
var value = _a.value;
|
420
|
+
return (0, monads_1.Some)(value);
|
421
|
+
}, { toClassOnly: true }),
|
422
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
423
|
+
var value = _a.value;
|
424
|
+
return (0, utils_1.toUndefined)(value);
|
425
|
+
}, { toPlainOnly: true }),
|
426
|
+
(0, class_transformer_1.Expose)()
|
427
|
+
], ListPostReports.prototype, "unresolved_only", void 0);
|
428
|
+
return ListPostReports;
|
429
|
+
}());
|
430
|
+
exports.ListPostReports = ListPostReports;
|
431
|
+
var ListPostReportsResponse = /** @class */ (function () {
|
432
|
+
function ListPostReportsResponse() {
|
433
|
+
}
|
434
|
+
return ListPostReportsResponse;
|
435
|
+
}());
|
436
|
+
exports.ListPostReportsResponse = ListPostReportsResponse;
|
437
|
+
var GetSiteMetadata = /** @class */ (function () {
|
438
|
+
function GetSiteMetadata(url) {
|
439
|
+
this.url = url;
|
440
|
+
}
|
441
|
+
return GetSiteMetadata;
|
442
|
+
}());
|
443
|
+
exports.GetSiteMetadata = GetSiteMetadata;
|
444
|
+
var GetSiteMetadataResponse = /** @class */ (function () {
|
445
|
+
function GetSiteMetadataResponse() {
|
446
|
+
}
|
447
|
+
return GetSiteMetadataResponse;
|
448
|
+
}());
|
449
|
+
exports.GetSiteMetadataResponse = GetSiteMetadataResponse;
|