mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-12-05 02:31:12 +00:00
Merge remote-tracking branch 'origin/main' into combined_reports
This commit is contained in:
commit
c4acf02b89
2 changed files with 47 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "lemmy-js-client",
|
||||
"description": "A javascript / typescript client for Lemmy",
|
||||
"version": "0.20.0-alpha.18",
|
||||
"version": "0.20.0-pkce.1",
|
||||
"author": "Dessalines <tyhou13@gmx.com>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "./dist/index.js",
|
||||
|
|
47
src/http.ts
47
src/http.ts
|
@ -154,6 +154,9 @@ import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows
|
|||
import { CommunityId } from "./types/CommunityId";
|
||||
import { ListReports } from "./types/ListReports";
|
||||
import { ListReportsResponse } from "./types/ListReportsResponse";
|
||||
import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
|
||||
import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
|
||||
import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
|
||||
|
||||
enum HttpType {
|
||||
Get = "GET",
|
||||
|
@ -1739,7 +1742,7 @@ export class LemmyHttp {
|
|||
/**
|
||||
* List post reports.
|
||||
*
|
||||
* `HTTP.GET //report/list`
|
||||
* `HTTP.GET /report/list`
|
||||
*/
|
||||
listReports(form: ListReports, options?: RequestOptions) {
|
||||
return this.#wrapper<ListReports, ListReportsResponse>(
|
||||
|
@ -1750,6 +1753,48 @@ export class LemmyHttp {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Block an instance as user.
|
||||
*
|
||||
* `HTTP.Post /site/block`
|
||||
*/
|
||||
userBlockInstance(form: UserBlockInstanceParams, options?: RequestOptions) {
|
||||
return this.#wrapper<UserBlockInstanceParams, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/site/block",
|
||||
form,
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Globally block an instance as admin.
|
||||
*
|
||||
* `HTTP.Post /admin/block_instance`
|
||||
*/
|
||||
adminBlockInstance(form: AdminBlockInstanceParams, options?: RequestOptions) {
|
||||
return this.#wrapper<AdminBlockInstanceParams, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/block_instance",
|
||||
form,
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Globally allow an instance as admin.
|
||||
*
|
||||
* `HTTP.Post /admin/allow_instance`
|
||||
*/
|
||||
adminAllowInstance(form: AdminAllowInstanceParams, options?: RequestOptions) {
|
||||
return this.#wrapper<AdminAllowInstanceParams, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/allow_instance",
|
||||
form,
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload an image to the server.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue