Merge remote-tracking branch 'origin/main' into combined_reports

This commit is contained in:
Dessalines 2024-12-02 17:36:46 -05:00
commit c4acf02b89
2 changed files with 47 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "lemmy-js-client", "name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy", "description": "A javascript / typescript client for Lemmy",
"version": "0.20.0-alpha.18", "version": "0.20.0-pkce.1",
"author": "Dessalines <tyhou13@gmx.com>", "author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "./dist/index.js", "main": "./dist/index.js",

View file

@ -154,6 +154,9 @@ import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows
import { CommunityId } from "./types/CommunityId"; import { CommunityId } from "./types/CommunityId";
import { ListReports } from "./types/ListReports"; import { ListReports } from "./types/ListReports";
import { ListReportsResponse } from "./types/ListReportsResponse"; import { ListReportsResponse } from "./types/ListReportsResponse";
import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
enum HttpType { enum HttpType {
Get = "GET", Get = "GET",
@ -1739,7 +1742,7 @@ export class LemmyHttp {
/** /**
* List post reports. * List post reports.
* *
* `HTTP.GET //report/list` * `HTTP.GET /report/list`
*/ */
listReports(form: ListReports, options?: RequestOptions) { listReports(form: ListReports, options?: RequestOptions) {
return this.#wrapper<ListReports, ListReportsResponse>( 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. * Upload an image to the server.
*/ */