lemmy-js-client 0.20.0-private-community.6 → 0.20.0-private-community.9
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.js
CHANGED
@@ -58,32 +58,32 @@ class LemmyHttp {
|
|
58
58
|
*
|
59
59
|
* `HTTP.GET /site`
|
60
60
|
*/
|
61
|
-
getSite() {
|
62
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/site", {});
|
61
|
+
getSite(options) {
|
62
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/site", {}, options);
|
63
63
|
}
|
64
64
|
/**
|
65
65
|
* Create your site.
|
66
66
|
*
|
67
67
|
* `HTTP.POST /site`
|
68
68
|
*/
|
69
|
-
createSite(form) {
|
70
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site", form);
|
69
|
+
createSite(form, options) {
|
70
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site", form, options);
|
71
71
|
}
|
72
72
|
/**
|
73
73
|
* Edit your site.
|
74
74
|
*
|
75
75
|
* `HTTP.PUT /site`
|
76
76
|
*/
|
77
|
-
editSite(form) {
|
78
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/site", form);
|
77
|
+
editSite(form, options) {
|
78
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/site", form, options);
|
79
79
|
}
|
80
80
|
/**
|
81
81
|
* Leave the Site admins.
|
82
82
|
*
|
83
83
|
* `HTTP.POST /user/leave_admin`
|
84
84
|
*/
|
85
|
-
leaveAdmin() {
|
86
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/leave_admin", {});
|
85
|
+
leaveAdmin(options) {
|
86
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/leave_admin", {}, options);
|
87
87
|
}
|
88
88
|
/**
|
89
89
|
* Generate a TOTP / two-factor secret.
|
@@ -92,8 +92,8 @@ class LemmyHttp {
|
|
92
92
|
*
|
93
93
|
* `HTTP.POST /user/totp/generate`
|
94
94
|
*/
|
95
|
-
generateTotpSecret() {
|
96
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/generate", {});
|
95
|
+
generateTotpSecret(options) {
|
96
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/generate", {}, options);
|
97
97
|
}
|
98
98
|
/**
|
99
99
|
* Export a backup of your user settings, including your saved content,
|
@@ -101,48 +101,48 @@ class LemmyHttp {
|
|
101
101
|
*
|
102
102
|
* `HTTP.GET /user/export_settings`
|
103
103
|
*/
|
104
|
-
exportSettings() {
|
105
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/export_settings", {});
|
104
|
+
exportSettings(options) {
|
105
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/export_settings", {}, options);
|
106
106
|
}
|
107
107
|
/**
|
108
108
|
* Import a backup of your user settings.
|
109
109
|
*
|
110
110
|
* `HTTP.POST /user/import_settings`
|
111
111
|
*/
|
112
|
-
importSettings(form) {
|
113
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/import_settings", form);
|
112
|
+
importSettings(form, options) {
|
113
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/import_settings", form, options);
|
114
114
|
}
|
115
115
|
/**
|
116
116
|
* List login tokens for your user
|
117
117
|
*
|
118
118
|
* `HTTP.GET /user/list_logins`
|
119
119
|
*/
|
120
|
-
listLogins() {
|
121
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/list_logins", {});
|
120
|
+
listLogins(options) {
|
121
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/list_logins", {}, options);
|
122
122
|
}
|
123
123
|
/**
|
124
124
|
* Returns an error message if your auth token is invalid
|
125
125
|
*
|
126
126
|
* `HTTP.GET /user/validate_auth`
|
127
127
|
*/
|
128
|
-
validateAuth() {
|
129
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/validate_auth", {});
|
128
|
+
validateAuth(options) {
|
129
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/validate_auth", {}, options);
|
130
130
|
}
|
131
131
|
/**
|
132
132
|
* List all the media for your user
|
133
133
|
*
|
134
134
|
* `HTTP.GET /account/list_media`
|
135
135
|
*/
|
136
|
-
listMedia(form = {}) {
|
137
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/list_media", form);
|
136
|
+
listMedia(form = {}, options) {
|
137
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/list_media", form, options);
|
138
138
|
}
|
139
139
|
/**
|
140
140
|
* List all the media known to your instance.
|
141
141
|
*
|
142
142
|
* `HTTP.GET /admin/list_all_media`
|
143
143
|
*/
|
144
|
-
listAllMedia(form = {}) {
|
145
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/list_all_media", form);
|
144
|
+
listAllMedia(form = {}, options) {
|
145
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/list_all_media", form, options);
|
146
146
|
}
|
147
147
|
/**
|
148
148
|
* Enable / Disable TOTP / two-factor authentication.
|
@@ -153,816 +153,812 @@ class LemmyHttp {
|
|
153
153
|
*
|
154
154
|
* `HTTP.POST /user/totp/update`
|
155
155
|
*/
|
156
|
-
updateTotp(form) {
|
157
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/update", form);
|
156
|
+
updateTotp(form, options) {
|
157
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/totp/update", form, options);
|
158
158
|
}
|
159
159
|
/**
|
160
160
|
* Get the modlog.
|
161
161
|
*
|
162
162
|
* `HTTP.GET /modlog`
|
163
163
|
*/
|
164
|
-
getModlog(form = {}) {
|
165
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/modlog", form);
|
164
|
+
getModlog(form = {}, options) {
|
165
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/modlog", form, options);
|
166
166
|
}
|
167
167
|
/**
|
168
168
|
* Search lemmy.
|
169
169
|
*
|
170
170
|
* `HTTP.GET /search`
|
171
171
|
*/
|
172
|
-
search(form) {
|
173
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/search", form);
|
172
|
+
search(form, options) {
|
173
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/search", form, options);
|
174
174
|
}
|
175
175
|
/**
|
176
176
|
* Fetch a non-local / federated object.
|
177
177
|
*
|
178
178
|
* `HTTP.GET /resolve_object`
|
179
179
|
*/
|
180
|
-
resolveObject(form) {
|
181
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/resolve_object", form);
|
180
|
+
resolveObject(form, options) {
|
181
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/resolve_object", form, options);
|
182
182
|
}
|
183
183
|
/**
|
184
184
|
* Create a new community.
|
185
185
|
*
|
186
186
|
* `HTTP.POST /community`
|
187
187
|
*/
|
188
|
-
createCommunity(form) {
|
189
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community", form);
|
188
|
+
createCommunity(form, options) {
|
189
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community", form, options);
|
190
190
|
}
|
191
191
|
/**
|
192
192
|
* Get / fetch a community.
|
193
193
|
*
|
194
194
|
* `HTTP.GET /community`
|
195
195
|
*/
|
196
|
-
getCommunity(form = {}) {
|
197
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community", form);
|
196
|
+
getCommunity(form = {}, options) {
|
197
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community", form, options);
|
198
198
|
}
|
199
199
|
/**
|
200
200
|
* Edit a community.
|
201
201
|
*
|
202
202
|
* `HTTP.PUT /community`
|
203
203
|
*/
|
204
|
-
editCommunity(form) {
|
205
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community", form);
|
204
|
+
editCommunity(form, options) {
|
205
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community", form, options);
|
206
206
|
}
|
207
207
|
/**
|
208
208
|
* List communities, with various filters.
|
209
209
|
*
|
210
210
|
* `HTTP.GET /community/list`
|
211
211
|
*/
|
212
|
-
listCommunities(form = {}) {
|
213
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/list", form);
|
212
|
+
listCommunities(form = {}, options) {
|
213
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/list", form, options);
|
214
214
|
}
|
215
215
|
/**
|
216
216
|
* Follow / subscribe to a community.
|
217
217
|
*
|
218
218
|
* `HTTP.POST /community/follow`
|
219
219
|
*/
|
220
|
-
followCommunity(form) {
|
221
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/follow", form);
|
220
|
+
followCommunity(form, options) {
|
221
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/follow", form, options);
|
222
222
|
}
|
223
|
-
getCommunityPendingFollowsCount(community_id) {
|
223
|
+
getCommunityPendingFollowsCount(community_id, options) {
|
224
224
|
const form = { community_id };
|
225
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/count", form);
|
225
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/count", form, options);
|
226
226
|
}
|
227
|
-
listCommunityPendingFollows(form) {
|
228
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/list", form);
|
227
|
+
listCommunityPendingFollows(form, options) {
|
228
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/list", form, options);
|
229
229
|
}
|
230
|
-
approveCommunityPendingFollow(form) {
|
231
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/pending_follows/approve", form);
|
230
|
+
approveCommunityPendingFollow(form, options) {
|
231
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/pending_follows/approve", form, options);
|
232
232
|
}
|
233
233
|
/**
|
234
234
|
* Block a community.
|
235
235
|
*
|
236
236
|
* `HTTP.POST /community/block`
|
237
237
|
*/
|
238
|
-
blockCommunity(form) {
|
239
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/block", form);
|
238
|
+
blockCommunity(form, options) {
|
239
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/block", form, options);
|
240
240
|
}
|
241
241
|
/**
|
242
242
|
* Delete a community.
|
243
243
|
*
|
244
244
|
* `HTTP.POST /community/delete`
|
245
245
|
*/
|
246
|
-
deleteCommunity(form) {
|
247
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/delete", form);
|
246
|
+
deleteCommunity(form, options) {
|
247
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/delete", form, options);
|
248
248
|
}
|
249
249
|
/**
|
250
250
|
* Hide a community from public / "All" view. Admins only.
|
251
251
|
*
|
252
252
|
* `HTTP.PUT /community/hide`
|
253
253
|
*/
|
254
|
-
hideCommunity(form) {
|
255
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community/hide", form);
|
254
|
+
hideCommunity(form, options) {
|
255
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community/hide", form, options);
|
256
256
|
}
|
257
257
|
/**
|
258
258
|
* A moderator remove for a community.
|
259
259
|
*
|
260
260
|
* `HTTP.POST /community/remove`
|
261
261
|
*/
|
262
|
-
removeCommunity(form) {
|
263
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/remove", form);
|
262
|
+
removeCommunity(form, options) {
|
263
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/remove", form, options);
|
264
264
|
}
|
265
265
|
/**
|
266
266
|
* Transfer your community to an existing moderator.
|
267
267
|
*
|
268
268
|
* `HTTP.POST /community/transfer`
|
269
269
|
*/
|
270
|
-
transferCommunity(form) {
|
271
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/transfer", form);
|
270
|
+
transferCommunity(form, options) {
|
271
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/transfer", form, options);
|
272
272
|
}
|
273
273
|
/**
|
274
274
|
* Ban a user from a community.
|
275
275
|
*
|
276
276
|
* `HTTP.POST /community/ban_user`
|
277
277
|
*/
|
278
|
-
banFromCommunity(form) {
|
279
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/ban_user", form);
|
278
|
+
banFromCommunity(form, options) {
|
279
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/ban_user", form, options);
|
280
280
|
}
|
281
281
|
/**
|
282
282
|
* Add a moderator to your community.
|
283
283
|
*
|
284
284
|
* `HTTP.POST /community/mod`
|
285
285
|
*/
|
286
|
-
addModToCommunity(form) {
|
287
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/mod", form);
|
286
|
+
addModToCommunity(form, options) {
|
287
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/mod", form, options);
|
288
288
|
}
|
289
289
|
/**
|
290
290
|
* Get a random community.
|
291
291
|
*
|
292
292
|
* `HTTP.GET /community/random`
|
293
293
|
*/
|
294
|
-
getRandomCommunity(form) {
|
295
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/random", form);
|
294
|
+
getRandomCommunity(form, options) {
|
295
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/random", form, options);
|
296
296
|
}
|
297
297
|
/**
|
298
298
|
* Create a post.
|
299
299
|
*
|
300
300
|
* `HTTP.POST /post`
|
301
301
|
*/
|
302
|
-
createPost(form) {
|
303
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post", form);
|
302
|
+
createPost(form, options) {
|
303
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post", form, options);
|
304
304
|
}
|
305
305
|
/**
|
306
306
|
* Get / fetch a post.
|
307
307
|
*
|
308
308
|
* `HTTP.GET /post`
|
309
309
|
*/
|
310
|
-
getPost(form = {}) {
|
311
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post", form);
|
310
|
+
getPost(form = {}, options) {
|
311
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post", form, options);
|
312
312
|
}
|
313
313
|
/**
|
314
314
|
* Edit a post.
|
315
315
|
*
|
316
316
|
* `HTTP.PUT /post`
|
317
317
|
*/
|
318
|
-
editPost(form) {
|
319
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post", form);
|
318
|
+
editPost(form, options) {
|
319
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post", form, options);
|
320
320
|
}
|
321
321
|
/**
|
322
322
|
* Delete a post.
|
323
323
|
*
|
324
324
|
* `HTTP.POST /post/delete`
|
325
325
|
*/
|
326
|
-
deletePost(form) {
|
327
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/delete", form);
|
326
|
+
deletePost(form, options) {
|
327
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/delete", form, options);
|
328
328
|
}
|
329
329
|
/**
|
330
330
|
* A moderator remove for a post.
|
331
331
|
*
|
332
332
|
* `HTTP.POST /post/remove`
|
333
333
|
*/
|
334
|
-
removePost(form) {
|
335
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/remove", form);
|
334
|
+
removePost(form, options) {
|
335
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/remove", form, options);
|
336
336
|
}
|
337
337
|
/**
|
338
338
|
* Mark a post as read.
|
339
339
|
*
|
340
340
|
* `HTTP.POST /post/mark_as_read`
|
341
341
|
*/
|
342
|
-
markPostAsRead(form) {
|
343
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/mark_as_read", form);
|
342
|
+
markPostAsRead(form, options) {
|
343
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/mark_as_read", form, options);
|
344
344
|
}
|
345
345
|
/**
|
346
346
|
* Hide a post from list views.
|
347
347
|
*
|
348
348
|
* `HTTP.POST /post/hide`
|
349
349
|
*/
|
350
|
-
hidePost(form) {
|
351
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/hide", form);
|
350
|
+
hidePost(form, options) {
|
351
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/hide", form, options);
|
352
352
|
}
|
353
353
|
/**
|
354
354
|
* A moderator can lock a post ( IE disable new comments ).
|
355
355
|
*
|
356
356
|
* `HTTP.POST /post/lock`
|
357
357
|
*/
|
358
|
-
lockPost(form) {
|
359
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/lock", form);
|
358
|
+
lockPost(form, options) {
|
359
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/lock", form, options);
|
360
360
|
}
|
361
361
|
/**
|
362
362
|
* A moderator can feature a community post ( IE stick it to the top of a community ).
|
363
363
|
*
|
364
364
|
* `HTTP.POST /post/feature`
|
365
365
|
*/
|
366
|
-
featurePost(form) {
|
367
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/feature", form);
|
366
|
+
featurePost(form, options) {
|
367
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/feature", form, options);
|
368
368
|
}
|
369
369
|
/**
|
370
370
|
* Get / fetch posts, with various filters.
|
371
371
|
*
|
372
372
|
* `HTTP.GET /post/list`
|
373
373
|
*/
|
374
|
-
getPosts(form = {}) {
|
375
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/list", form);
|
374
|
+
getPosts(form = {}, options) {
|
375
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/list", form, options);
|
376
376
|
}
|
377
377
|
/**
|
378
378
|
* Like / vote on a post.
|
379
379
|
*
|
380
380
|
* `HTTP.POST /post/like`
|
381
381
|
*/
|
382
|
-
likePost(form) {
|
383
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/like", form);
|
382
|
+
likePost(form, options) {
|
383
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/like", form, options);
|
384
384
|
}
|
385
385
|
/**
|
386
386
|
* List a post's likes. Admin-only.
|
387
387
|
*
|
388
388
|
* `HTTP.GET /post/like/list`
|
389
389
|
*/
|
390
|
-
listPostLikes(form) {
|
391
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/like/list", form);
|
390
|
+
listPostLikes(form, options) {
|
391
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/like/list", form, options);
|
392
392
|
}
|
393
393
|
/**
|
394
394
|
* Save a post.
|
395
395
|
*
|
396
396
|
* `HTTP.PUT /post/save`
|
397
397
|
*/
|
398
|
-
savePost(form) {
|
399
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/save", form);
|
398
|
+
savePost(form, options) {
|
399
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/save", form, options);
|
400
400
|
}
|
401
401
|
/**
|
402
402
|
* Report a post.
|
403
403
|
*
|
404
404
|
* `HTTP.POST /post/report`
|
405
405
|
*/
|
406
|
-
createPostReport(form) {
|
407
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/report", form);
|
406
|
+
createPostReport(form, options) {
|
407
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/report", form, options);
|
408
408
|
}
|
409
409
|
/**
|
410
410
|
* Resolve a post report. Only a mod can do this.
|
411
411
|
*
|
412
412
|
* `HTTP.PUT /post/report/resolve`
|
413
413
|
*/
|
414
|
-
resolvePostReport(form) {
|
415
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/report/resolve", form);
|
414
|
+
resolvePostReport(form, options) {
|
415
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/report/resolve", form, options);
|
416
416
|
}
|
417
417
|
/**
|
418
418
|
* List post reports.
|
419
419
|
*
|
420
420
|
* `HTTP.GET /post/report/list`
|
421
421
|
*/
|
422
|
-
listPostReports(form) {
|
423
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/report/list", form);
|
422
|
+
listPostReports(form, options) {
|
423
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/report/list", form, options);
|
424
424
|
}
|
425
425
|
/**
|
426
426
|
* Fetch metadata for any given site.
|
427
427
|
*
|
428
428
|
* `HTTP.GET /post/site_metadata`
|
429
429
|
*/
|
430
|
-
getSiteMetadata(form) {
|
431
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/site_metadata", form);
|
430
|
+
getSiteMetadata(form, options) {
|
431
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/post/site_metadata", form, options);
|
432
432
|
}
|
433
433
|
/**
|
434
434
|
* Create a comment.
|
435
435
|
*
|
436
436
|
* `HTTP.POST /comment`
|
437
437
|
*/
|
438
|
-
createComment(form) {
|
439
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment", form);
|
438
|
+
createComment(form, options) {
|
439
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment", form, options);
|
440
440
|
}
|
441
441
|
/**
|
442
442
|
* Edit a comment.
|
443
443
|
*
|
444
444
|
* `HTTP.PUT /comment`
|
445
445
|
*/
|
446
|
-
editComment(form) {
|
447
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment", form);
|
446
|
+
editComment(form, options) {
|
447
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment", form, options);
|
448
448
|
}
|
449
449
|
/**
|
450
450
|
* Delete a comment.
|
451
451
|
*
|
452
452
|
* `HTTP.POST /comment/delete`
|
453
453
|
*/
|
454
|
-
deleteComment(form) {
|
455
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/delete", form);
|
454
|
+
deleteComment(form, options) {
|
455
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/delete", form, options);
|
456
456
|
}
|
457
457
|
/**
|
458
458
|
* A moderator remove for a comment.
|
459
459
|
*
|
460
460
|
* `HTTP.POST /comment/remove`
|
461
461
|
*/
|
462
|
-
removeComment(form) {
|
463
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/remove", form);
|
462
|
+
removeComment(form, options) {
|
463
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/remove", form, options);
|
464
464
|
}
|
465
465
|
/**
|
466
466
|
* Mark a comment as read.
|
467
467
|
*
|
468
468
|
* `HTTP.POST /comment/mark_as_read`
|
469
469
|
*/
|
470
|
-
markCommentReplyAsRead(form) {
|
471
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/mark_as_read", form);
|
470
|
+
markCommentReplyAsRead(form, options) {
|
471
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/mark_as_read", form, options);
|
472
472
|
}
|
473
473
|
/**
|
474
474
|
* Like / vote on a comment.
|
475
475
|
*
|
476
476
|
* `HTTP.POST /comment/like`
|
477
477
|
*/
|
478
|
-
likeComment(form) {
|
479
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/like", form);
|
478
|
+
likeComment(form, options) {
|
479
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/like", form, options);
|
480
480
|
}
|
481
481
|
/**
|
482
482
|
* List a comment's likes. Admin-only.
|
483
483
|
*
|
484
484
|
* `HTTP.GET /comment/like/list`
|
485
485
|
*/
|
486
|
-
listCommentLikes(form) {
|
487
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/like/list", form);
|
486
|
+
listCommentLikes(form, options) {
|
487
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/like/list", form, options);
|
488
488
|
}
|
489
489
|
/**
|
490
490
|
* Save a comment.
|
491
491
|
*
|
492
492
|
* `HTTP.PUT /comment/save`
|
493
493
|
*/
|
494
|
-
saveComment(form) {
|
495
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/save", form);
|
494
|
+
saveComment(form, options) {
|
495
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/save", form, options);
|
496
496
|
}
|
497
497
|
/**
|
498
498
|
* Distinguishes a comment (speak as moderator)
|
499
499
|
*
|
500
500
|
* `HTTP.POST /comment/distinguish`
|
501
501
|
*/
|
502
|
-
distinguishComment(form) {
|
503
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/distinguish", form);
|
502
|
+
distinguishComment(form, options) {
|
503
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/distinguish", form, options);
|
504
504
|
}
|
505
505
|
/**
|
506
506
|
* Get / fetch comments.
|
507
507
|
*
|
508
508
|
* `HTTP.GET /comment/list`
|
509
509
|
*/
|
510
|
-
getComments(form = {}) {
|
511
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/list", form);
|
510
|
+
getComments(form = {}, options) {
|
511
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/list", form, options);
|
512
512
|
}
|
513
513
|
/**
|
514
514
|
* Get / fetch comment.
|
515
515
|
*
|
516
516
|
* `HTTP.GET /comment`
|
517
517
|
*/
|
518
|
-
getComment(form) {
|
519
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment", form);
|
518
|
+
getComment(form, options) {
|
519
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment", form, options);
|
520
520
|
}
|
521
521
|
/**
|
522
522
|
* Report a comment.
|
523
523
|
*
|
524
524
|
* `HTTP.POST /comment/report`
|
525
525
|
*/
|
526
|
-
createCommentReport(form) {
|
527
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/report", form);
|
526
|
+
createCommentReport(form, options) {
|
527
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/report", form, options);
|
528
528
|
}
|
529
529
|
/**
|
530
530
|
* Resolve a comment report. Only a mod can do this.
|
531
531
|
*
|
532
532
|
* `HTTP.PUT /comment/report/resolve`
|
533
533
|
*/
|
534
|
-
resolveCommentReport(form) {
|
535
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/report/resolve", form);
|
534
|
+
resolveCommentReport(form, options) {
|
535
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/report/resolve", form, options);
|
536
536
|
}
|
537
537
|
/**
|
538
538
|
* List comment reports.
|
539
539
|
*
|
540
540
|
* `HTTP.GET /comment/report/list`
|
541
541
|
*/
|
542
|
-
listCommentReports(form) {
|
543
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/report/list", form);
|
542
|
+
listCommentReports(form, options) {
|
543
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/comment/report/list", form, options);
|
544
544
|
}
|
545
545
|
/**
|
546
546
|
* Get / fetch private messages.
|
547
547
|
*
|
548
548
|
* `HTTP.GET /private_message/list`
|
549
549
|
*/
|
550
|
-
getPrivateMessages(form) {
|
551
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/list", form);
|
550
|
+
getPrivateMessages(form, options) {
|
551
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/list", form, options);
|
552
552
|
}
|
553
553
|
/**
|
554
554
|
* Create a private message.
|
555
555
|
*
|
556
556
|
* `HTTP.POST /private_message`
|
557
557
|
*/
|
558
|
-
createPrivateMessage(form) {
|
559
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message", form);
|
558
|
+
createPrivateMessage(form, options) {
|
559
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message", form, options);
|
560
560
|
}
|
561
561
|
/**
|
562
562
|
* Edit a private message.
|
563
563
|
*
|
564
564
|
* `HTTP.PUT /private_message`
|
565
565
|
*/
|
566
|
-
editPrivateMessage(form) {
|
567
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message", form);
|
566
|
+
editPrivateMessage(form, options) {
|
567
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message", form, options);
|
568
568
|
}
|
569
569
|
/**
|
570
570
|
* Delete a private message.
|
571
571
|
*
|
572
572
|
* `HTTP.POST /private_message/delete`
|
573
573
|
*/
|
574
|
-
deletePrivateMessage(form) {
|
575
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/delete", form);
|
574
|
+
deletePrivateMessage(form, options) {
|
575
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/delete", form, options);
|
576
576
|
}
|
577
577
|
/**
|
578
578
|
* Mark a private message as read.
|
579
579
|
*
|
580
580
|
* `HTTP.POST /private_message/mark_as_read`
|
581
581
|
*/
|
582
|
-
markPrivateMessageAsRead(form) {
|
583
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form);
|
582
|
+
markPrivateMessageAsRead(form, options) {
|
583
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form, options);
|
584
584
|
}
|
585
585
|
/**
|
586
586
|
* Create a report for a private message.
|
587
587
|
*
|
588
588
|
* `HTTP.POST /private_message/report`
|
589
589
|
*/
|
590
|
-
createPrivateMessageReport(form) {
|
591
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/report", form);
|
590
|
+
createPrivateMessageReport(form, options) {
|
591
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/report", form, options);
|
592
592
|
}
|
593
593
|
/**
|
594
594
|
* Resolve a report for a private message.
|
595
595
|
*
|
596
596
|
* `HTTP.PUT /private_message/report/resolve`
|
597
597
|
*/
|
598
|
-
resolvePrivateMessageReport(form) {
|
599
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message/report/resolve", form);
|
598
|
+
resolvePrivateMessageReport(form, options) {
|
599
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/private_message/report/resolve", form, options);
|
600
600
|
}
|
601
601
|
/**
|
602
602
|
* List private message reports.
|
603
603
|
*
|
604
604
|
* `HTTP.GET /private_message/report/list`
|
605
605
|
*/
|
606
|
-
listPrivateMessageReports(form) {
|
607
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/report/list", form);
|
606
|
+
listPrivateMessageReports(form, options) {
|
607
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/report/list", form, options);
|
608
608
|
}
|
609
609
|
/**
|
610
610
|
* Register a new user.
|
611
611
|
*
|
612
612
|
* `HTTP.POST /user/register`
|
613
613
|
*/
|
614
|
-
register(form) {
|
615
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/register", form);
|
614
|
+
register(form, options) {
|
615
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/register", form, options);
|
616
616
|
}
|
617
617
|
/**
|
618
618
|
* Log into lemmy.
|
619
619
|
*
|
620
620
|
* `HTTP.POST /user/login`
|
621
621
|
*/
|
622
|
-
login(form) {
|
623
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/login", form);
|
622
|
+
login(form, options) {
|
623
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/login", form, options);
|
624
624
|
}
|
625
625
|
/**
|
626
626
|
* Invalidate the currently used auth token.
|
627
627
|
*
|
628
628
|
* `HTTP.POST /user/logout`
|
629
629
|
*/
|
630
|
-
logout() {
|
631
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/logout", {});
|
630
|
+
logout(options) {
|
631
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/logout", {}, options);
|
632
632
|
}
|
633
633
|
/**
|
634
634
|
* Get the details for a person.
|
635
635
|
*
|
636
636
|
* `HTTP.GET /user`
|
637
637
|
*/
|
638
|
-
getPersonDetails(form = {}) {
|
639
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user", form);
|
638
|
+
getPersonDetails(form = {}, options) {
|
639
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user", form, options);
|
640
640
|
}
|
641
641
|
/**
|
642
642
|
* Get mentions for your user.
|
643
643
|
*
|
644
644
|
* `HTTP.GET /user/mention`
|
645
645
|
*/
|
646
|
-
getPersonMentions(form) {
|
647
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/mention", form);
|
646
|
+
getPersonMentions(form, options) {
|
647
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/mention", form, options);
|
648
648
|
}
|
649
649
|
/**
|
650
650
|
* Mark a person mention as read.
|
651
651
|
*
|
652
652
|
* `HTTP.POST /user/mention/mark_as_read`
|
653
653
|
*/
|
654
|
-
markPersonMentionAsRead(form) {
|
655
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mention/mark_as_read", form);
|
654
|
+
markPersonMentionAsRead(form, options) {
|
655
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mention/mark_as_read", form, options);
|
656
656
|
}
|
657
657
|
/**
|
658
658
|
* Get comment replies.
|
659
659
|
*
|
660
660
|
* `HTTP.GET /user/replies`
|
661
661
|
*/
|
662
|
-
getReplies(form) {
|
663
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/replies", form);
|
662
|
+
getReplies(form, options) {
|
663
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/replies", form, options);
|
664
664
|
}
|
665
665
|
/**
|
666
666
|
* Ban a person from your site.
|
667
667
|
*
|
668
668
|
* `HTTP.POST /user/ban`
|
669
669
|
*/
|
670
|
-
banPerson(form) {
|
671
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/ban", form);
|
670
|
+
banPerson(form, options) {
|
671
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/ban", form, options);
|
672
672
|
}
|
673
673
|
/**
|
674
674
|
* Get a list of banned users
|
675
675
|
*
|
676
676
|
* `HTTP.GET /user/banned`
|
677
677
|
*/
|
678
|
-
getBannedPersons() {
|
679
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/banned", {});
|
678
|
+
getBannedPersons(options) {
|
679
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/banned", {}, options);
|
680
680
|
}
|
681
681
|
/**
|
682
682
|
* Block a person.
|
683
683
|
*
|
684
684
|
* `HTTP.POST /user/block`
|
685
685
|
*/
|
686
|
-
blockPerson(form) {
|
687
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/block", form);
|
686
|
+
blockPerson(form, options) {
|
687
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/block", form, options);
|
688
688
|
}
|
689
689
|
/**
|
690
690
|
* Fetch a Captcha.
|
691
691
|
*
|
692
692
|
* `HTTP.GET /user/get_captcha`
|
693
693
|
*/
|
694
|
-
getCaptcha() {
|
695
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/get_captcha", {});
|
694
|
+
getCaptcha(options) {
|
695
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/get_captcha", {}, options);
|
696
696
|
}
|
697
697
|
/**
|
698
698
|
* Delete your account.
|
699
699
|
*
|
700
700
|
* `HTTP.POST /user/delete_account`
|
701
701
|
*/
|
702
|
-
deleteAccount(form) {
|
703
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/delete_account", form);
|
702
|
+
deleteAccount(form, options) {
|
703
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/delete_account", form, options);
|
704
704
|
}
|
705
705
|
/**
|
706
706
|
* Reset your password.
|
707
707
|
*
|
708
708
|
* `HTTP.POST /user/password_reset`
|
709
709
|
*/
|
710
|
-
passwordReset(form) {
|
711
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/password_reset", form);
|
710
|
+
passwordReset(form, options) {
|
711
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/password_reset", form, options);
|
712
712
|
}
|
713
713
|
/**
|
714
714
|
* Change your password from an email / token based reset.
|
715
715
|
*
|
716
716
|
* `HTTP.POST /user/password_change`
|
717
717
|
*/
|
718
|
-
passwordChangeAfterReset(form) {
|
719
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/password_change", form);
|
718
|
+
passwordChangeAfterReset(form, options) {
|
719
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/password_change", form, options);
|
720
720
|
}
|
721
721
|
/**
|
722
722
|
* Mark all replies as read.
|
723
723
|
*
|
724
724
|
* `HTTP.POST /user/mark_all_as_read`
|
725
725
|
*/
|
726
|
-
markAllAsRead() {
|
727
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mark_all_as_read", {});
|
726
|
+
markAllAsRead(options) {
|
727
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mark_all_as_read", {}, options);
|
728
728
|
}
|
729
729
|
/**
|
730
730
|
* Save your user settings.
|
731
731
|
*
|
732
732
|
* `HTTP.PUT /user/save_user_settings`
|
733
733
|
*/
|
734
|
-
saveUserSettings(form) {
|
735
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/user/save_user_settings", form);
|
734
|
+
saveUserSettings(form, options) {
|
735
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/user/save_user_settings", form, options);
|
736
736
|
}
|
737
737
|
/**
|
738
738
|
* Change your user password.
|
739
739
|
*
|
740
740
|
* `HTTP.PUT /user/change_password`
|
741
741
|
*/
|
742
|
-
changePassword(form) {
|
743
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/user/change_password", form);
|
742
|
+
changePassword(form, options) {
|
743
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/user/change_password", form, options);
|
744
744
|
}
|
745
745
|
/**
|
746
746
|
* Get counts for your reports
|
747
747
|
*
|
748
748
|
* `HTTP.GET /user/report_count`
|
749
749
|
*/
|
750
|
-
getReportCount(form) {
|
751
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/report_count", form);
|
750
|
+
getReportCount(form, options) {
|
751
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/report_count", form, options);
|
752
752
|
}
|
753
753
|
/**
|
754
754
|
* Get your unread counts
|
755
755
|
*
|
756
756
|
* `HTTP.GET /user/unread_count`
|
757
757
|
*/
|
758
|
-
getUnreadCount() {
|
759
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/unread_count", {});
|
758
|
+
getUnreadCount(options) {
|
759
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/unread_count", {}, options);
|
760
760
|
}
|
761
761
|
/**
|
762
762
|
* Verify your email
|
763
763
|
*
|
764
764
|
* `HTTP.POST /user/verify_email`
|
765
765
|
*/
|
766
|
-
verifyEmail(form) {
|
767
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/verify_email", form);
|
766
|
+
verifyEmail(form, options) {
|
767
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/verify_email", form, options);
|
768
768
|
}
|
769
769
|
/**
|
770
770
|
* Add an admin to your site.
|
771
771
|
*
|
772
772
|
* `HTTP.POST /admin/add`
|
773
773
|
*/
|
774
|
-
addAdmin(form) {
|
775
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/add", form);
|
774
|
+
addAdmin(form, options) {
|
775
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/add", form, options);
|
776
776
|
}
|
777
777
|
/**
|
778
778
|
* Get the unread registration applications count.
|
779
779
|
*
|
780
780
|
* `HTTP.GET /admin/registration_application/count`
|
781
781
|
*/
|
782
|
-
getUnreadRegistrationApplicationCount() {
|
783
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/count", {});
|
782
|
+
getUnreadRegistrationApplicationCount(options) {
|
783
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/count", {}, options);
|
784
784
|
}
|
785
785
|
/**
|
786
786
|
* List the registration applications.
|
787
787
|
*
|
788
788
|
* `HTTP.GET /admin/registration_application/list`
|
789
789
|
*/
|
790
|
-
listRegistrationApplications(form) {
|
791
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/list", form);
|
790
|
+
listRegistrationApplications(form, options) {
|
791
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/list", form, options);
|
792
792
|
}
|
793
793
|
/**
|
794
794
|
* Approve a registration application
|
795
795
|
*
|
796
796
|
* `HTTP.PUT /admin/registration_application/approve`
|
797
797
|
*/
|
798
|
-
approveRegistrationApplication(form) {
|
799
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/admin/registration_application/approve", form);
|
798
|
+
approveRegistrationApplication(form, options) {
|
799
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/admin/registration_application/approve", form, options);
|
800
800
|
}
|
801
801
|
/**
|
802
802
|
* Get the application a user submitted when they first registered their account
|
803
803
|
*
|
804
804
|
* `HTTP.GET /admin/registration_application`
|
805
805
|
*/
|
806
|
-
getRegistrationApplication(form) {
|
807
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application", form);
|
806
|
+
getRegistrationApplication(form, options) {
|
807
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application", form, options);
|
808
808
|
}
|
809
809
|
/**
|
810
810
|
* Purge / Delete a person from the database.
|
811
811
|
*
|
812
812
|
* `HTTP.POST /admin/purge/person`
|
813
813
|
*/
|
814
|
-
purgePerson(form) {
|
815
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/person", form);
|
814
|
+
purgePerson(form, options) {
|
815
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/person", form, options);
|
816
816
|
}
|
817
817
|
/**
|
818
818
|
* Purge / Delete a community from the database.
|
819
819
|
*
|
820
820
|
* `HTTP.POST /admin/purge/community`
|
821
821
|
*/
|
822
|
-
purgeCommunity(form) {
|
823
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/community", form);
|
822
|
+
purgeCommunity(form, options) {
|
823
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/community", form, options);
|
824
824
|
}
|
825
825
|
/**
|
826
826
|
* Purge / Delete a post from the database.
|
827
827
|
*
|
828
828
|
* `HTTP.POST /admin/purge/post`
|
829
829
|
*/
|
830
|
-
purgePost(form) {
|
831
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/post", form);
|
830
|
+
purgePost(form, options) {
|
831
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/post", form, options);
|
832
832
|
}
|
833
833
|
/**
|
834
834
|
* Purge / Delete a comment from the database.
|
835
835
|
*
|
836
836
|
* `HTTP.POST /admin/purge/comment`
|
837
837
|
*/
|
838
|
-
purgeComment(form) {
|
839
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/comment", form);
|
838
|
+
purgeComment(form, options) {
|
839
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/purge/comment", form, options);
|
840
840
|
}
|
841
841
|
/**
|
842
842
|
* Create a new custom emoji
|
843
843
|
*
|
844
844
|
* `HTTP.POST /custom_emoji`
|
845
845
|
*/
|
846
|
-
createCustomEmoji(form) {
|
847
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji", form);
|
846
|
+
createCustomEmoji(form, options) {
|
847
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji", form, options);
|
848
848
|
}
|
849
849
|
/**
|
850
850
|
* Edit an existing custom emoji
|
851
851
|
*
|
852
852
|
* `HTTP.PUT /custom_emoji`
|
853
853
|
*/
|
854
|
-
editCustomEmoji(form) {
|
855
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/custom_emoji", form);
|
854
|
+
editCustomEmoji(form, options) {
|
855
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/custom_emoji", form, options);
|
856
856
|
}
|
857
857
|
/**
|
858
858
|
* Delete a custom emoji
|
859
859
|
*
|
860
860
|
* `HTTP.Post /custom_emoji/delete`
|
861
861
|
*/
|
862
|
-
deleteCustomEmoji(form) {
|
863
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form);
|
862
|
+
deleteCustomEmoji(form, options) {
|
863
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form, options);
|
864
864
|
}
|
865
865
|
/**
|
866
866
|
* List custom emojis
|
867
867
|
*
|
868
868
|
* `HTTP.GET /custom_emoji/list`
|
869
869
|
*/
|
870
|
-
listCustomEmojis(form) {
|
871
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/custom_emoji/list", form);
|
870
|
+
listCustomEmojis(form, options) {
|
871
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/custom_emoji/list", form, options);
|
872
872
|
}
|
873
873
|
/**
|
874
874
|
* Create a new tagline
|
875
875
|
*
|
876
876
|
* `HTTP.POST /admin/tagline`
|
877
877
|
*/
|
878
|
-
createTagline(form) {
|
879
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/tagline", form);
|
878
|
+
createTagline(form, options) {
|
879
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/tagline", form, options);
|
880
880
|
}
|
881
881
|
/**
|
882
882
|
* Edit an existing tagline
|
883
883
|
*
|
884
884
|
* `HTTP.PUT /admin/tagline`
|
885
885
|
*/
|
886
|
-
editTagline(form) {
|
887
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/admin/tagline", form);
|
886
|
+
editTagline(form, options) {
|
887
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/admin/tagline", form, options);
|
888
888
|
}
|
889
889
|
/**
|
890
890
|
* Delete a tagline
|
891
891
|
*
|
892
892
|
* `HTTP.Post /admin/tagline/delete`
|
893
893
|
*/
|
894
|
-
deleteTagline(form) {
|
895
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/tagline/delete", form);
|
894
|
+
deleteTagline(form, options) {
|
895
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/tagline/delete", form, options);
|
896
896
|
}
|
897
897
|
/**
|
898
898
|
* List taglines
|
899
899
|
*
|
900
900
|
* `HTTP.GET /admin/tagline/list`
|
901
901
|
*/
|
902
|
-
listTaglines(form) {
|
903
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/tagline/list", form);
|
902
|
+
listTaglines(form, options) {
|
903
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/tagline/list", form, options);
|
904
904
|
}
|
905
905
|
/**
|
906
906
|
* Create a new oauth provider method
|
907
907
|
*
|
908
908
|
* `HTTP.POST /oauth_provider`
|
909
909
|
*/
|
910
|
-
createOAuthProvider(form) {
|
911
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth_provider", form);
|
910
|
+
createOAuthProvider(form, options) {
|
911
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth_provider", form, options);
|
912
912
|
}
|
913
913
|
/**
|
914
914
|
* Edit an existing oauth provider method
|
915
915
|
*
|
916
916
|
* `HTTP.PUT /oauth_provider`
|
917
917
|
*/
|
918
|
-
editOAuthProvider(form) {
|
919
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/oauth_provider", form);
|
918
|
+
editOAuthProvider(form, options) {
|
919
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/oauth_provider", form, options);
|
920
920
|
}
|
921
921
|
/**
|
922
922
|
* Delete an oauth provider method
|
923
923
|
*
|
924
924
|
* `HTTP.Post /oauth_provider/delete`
|
925
925
|
*/
|
926
|
-
deleteOAuthProvider(form) {
|
927
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth_provider/delete", form);
|
926
|
+
deleteOAuthProvider(form, options) {
|
927
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth_provider/delete", form, options);
|
928
928
|
}
|
929
929
|
/**
|
930
930
|
* Authenticate with OAuth
|
931
931
|
*
|
932
932
|
* `HTTP.Post /oauth/authenticate`
|
933
933
|
*/
|
934
|
-
authenticateWithOAuth(form) {
|
935
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth/authenticate", form);
|
934
|
+
authenticateWithOAuth(form, options) {
|
935
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/oauth/authenticate", form, options);
|
936
936
|
}
|
937
937
|
/**
|
938
938
|
* Fetch federated instances.
|
939
939
|
*
|
940
940
|
* `HTTP.Get /federated_instances`
|
941
941
|
*/
|
942
|
-
getFederatedInstances() {
|
943
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {});
|
942
|
+
getFederatedInstances(options) {
|
943
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {}, options);
|
944
944
|
}
|
945
945
|
/**
|
946
946
|
* Block an instance.
|
947
947
|
*
|
948
948
|
* `HTTP.Post /site/block`
|
949
949
|
*/
|
950
|
-
blockInstance(form) {
|
951
|
-
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site/block", form);
|
950
|
+
blockInstance(form, options) {
|
951
|
+
return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/site/block", form, options);
|
952
952
|
}
|
953
953
|
/**
|
954
954
|
* Upload an image to the server.
|
955
955
|
*/
|
956
|
-
uploadImage(_a) {
|
957
|
-
return __awaiter(this, arguments, void 0, function* ({ image }) {
|
956
|
+
uploadImage(_a, options_1) {
|
957
|
+
return __awaiter(this, arguments, void 0, function* ({ image }, options) {
|
958
958
|
const formData = createFormData(image);
|
959
959
|
let url = undefined;
|
960
960
|
let delete_url = undefined;
|
961
|
-
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f"), {
|
962
|
-
method: HttpType.Post,
|
963
|
-
body: formData,
|
964
|
-
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
965
|
-
});
|
961
|
+
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f"), Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
|
966
962
|
if (response.status === 413) {
|
967
963
|
return { msg: "too_large" };
|
968
964
|
}
|
@@ -979,13 +975,10 @@ class LemmyHttp {
|
|
979
975
|
/**
|
980
976
|
* Delete a pictrs image
|
981
977
|
*/
|
982
|
-
deleteImage(_a) {
|
983
|
-
return __awaiter(this, arguments, void 0, function* ({ token, filename }) {
|
978
|
+
deleteImage(_a, options_1) {
|
979
|
+
return __awaiter(this, arguments, void 0, function* ({ token, filename }, options) {
|
984
980
|
const deleteUrl = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/delete/${token}/${filename}`;
|
985
|
-
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, deleteUrl, {
|
986
|
-
method: HttpType.Get,
|
987
|
-
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
988
|
-
});
|
981
|
+
const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, deleteUrl, Object.assign(Object.assign({}, options), { method: HttpType.Get, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
|
989
982
|
return response.status == 204;
|
990
983
|
});
|
991
984
|
}
|
@@ -999,23 +992,16 @@ class LemmyHttp {
|
|
999
992
|
exports.LemmyHttp = LemmyHttp;
|
1000
993
|
_LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHttp_pictrsUrl = new WeakMap(), _LemmyHttp_fetchFunction = new WeakMap(), _LemmyHttp_instances = new WeakSet(), _LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
|
1001
994
|
return `${__classPrivateFieldGet(this, _LemmyHttp_apiUrl, "f")}${endpoint}`;
|
1002
|
-
}, _LemmyHttp_wrapper = function _LemmyHttp_wrapper(type_, endpoint, form) {
|
995
|
+
}, _LemmyHttp_wrapper = function _LemmyHttp_wrapper(type_, endpoint, form, options) {
|
1003
996
|
return __awaiter(this, void 0, void 0, function* () {
|
1004
997
|
var _a;
|
1005
998
|
let response;
|
1006
999
|
if (type_ === HttpType.Get) {
|
1007
1000
|
const getUrl = `${__classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint)}?${encodeGetParams(form)}`;
|
1008
|
-
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, getUrl, {
|
1009
|
-
method: HttpType.Get,
|
1010
|
-
headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
|
1011
|
-
});
|
1001
|
+
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, getUrl, Object.assign(Object.assign({}, options), { method: HttpType.Get, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
|
1012
1002
|
}
|
1013
1003
|
else {
|
1014
|
-
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint), {
|
1015
|
-
method: type_,
|
1016
|
-
headers: Object.assign({ "Content-Type": "application/json" }, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")),
|
1017
|
-
body: JSON.stringify(form),
|
1018
|
-
});
|
1004
|
+
response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, endpoint), Object.assign(Object.assign({}, options), { method: type_, headers: Object.assign({ "Content-Type": "application/json" }, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")), body: JSON.stringify(form) }));
|
1019
1005
|
}
|
1020
1006
|
let json = undefined;
|
1021
1007
|
try {
|