Merge branch 'main' into restore_content_on_unban

This commit is contained in:
Dessalines 2024-09-13 19:54:49 -04:00
commit 8ad283a832
13 changed files with 663 additions and 619 deletions

View file

@ -1,7 +1,7 @@
{
"name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy",
"version": "0.20.0-alpha.1",
"version": "0.20.0-alpha.2",
"author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0",
"main": "./dist/index.js",
@ -19,23 +19,23 @@
"url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
},
"devDependencies": {
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"eslint": "^9.0.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"@types/node": "^22.1.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^9.8.0",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.4",
"lint-staged": "^15.2.7",
"prettier": "^3.3.3",
"prettier-plugin-import-sort": "^0.0.7",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-packagejson": "^2.4.11",
"prettier-plugin-organize-imports": "^4.0.0",
"prettier-plugin-packagejson": "^2.5.1",
"sortpack": "^2.4.0",
"typedoc": "^0.25.8",
"typescript": "^5.3.3",
"typescript-eslint": "^7.9.0"
"typedoc": "^0.26.5",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0"
},
"packageManager": "pnpm@9.1.4",
"packageManager": "pnpm@9.9.0",
"types": "./dist/index.d.ts",
"lint-staged": {
"*.{ts,tsx,js}": [

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"schedule": ["before 4am on the first day of the month"]
"schedule": ["before 4am on Monday"],
"automerge": true
}

View file

@ -139,6 +139,7 @@ import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
import { HidePost } from "./types/HidePost";
import { ListMedia } from "./types/ListMedia";
import { ListMediaResponse } from "./types/ListMediaResponse";
import { GetRegistrationApplication } from "./types/GetRegistrationApplication";
enum HttpType {
Get = "GET",
@ -1330,6 +1331,18 @@ export class LemmyHttp {
>(HttpType.Put, "/admin/registration_application/approve", form);
}
/**
* Get the application a user submitted when they first registered their account
*
* `HTTP.GET /admin/registration_application`
*/
getRegistrationApplication(form: GetRegistrationApplication) {
return this.#wrapper<
GetRegistrationApplication,
RegistrationApplicationResponse
>(HttpType.Get, "/admin/registration_application", form);
}
/**
* Purge / Delete a person from the database.
*
@ -1526,7 +1539,7 @@ export class LemmyHttp {
try {
json = await response.json();
} catch (error) {
} catch {
throw new Error(response.statusText);
}

View file

@ -100,6 +100,7 @@ export { GetPostResponse } from "./types/GetPostResponse";
export { GetPosts } from "./types/GetPosts";
export { GetPostsResponse } from "./types/GetPostsResponse";
export { GetPrivateMessages } from "./types/GetPrivateMessages";
export { GetRegistrationApplication } from "./types/GetRegistrationApplication";
export { GetReplies } from "./types/GetReplies";
export { GetRepliesResponse } from "./types/GetRepliesResponse";
export { GetReportCount } from "./types/GetReportCount";
@ -111,6 +112,7 @@ export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
export { HideCommunity } from "./types/HideCommunity";
export { HidePost } from "./types/HidePost";
export { ImageDetails } from "./types/ImageDetails";
export { Instance } from "./types/Instance";
export { InstanceBlockView } from "./types/InstanceBlockView";
export { InstanceId } from "./types/InstanceId";
@ -185,7 +187,6 @@ export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
export { PasswordReset } from "./types/PasswordReset";
export { Person } from "./types/Person";
export { PersonAggregates } from "./types/PersonAggregates";
export { PersonBlockId } from "./types/PersonBlockId";
export { PersonBlockView } from "./types/PersonBlockView";
export { PersonId } from "./types/PersonId";
export { PersonMention } from "./types/PersonMention";
@ -220,6 +221,7 @@ export { PurgePost } from "./types/PurgePost";
export { ReadableFederationState } from "./types/ReadableFederationState";
export { Register } from "./types/Register";
export { RegistrationApplication } from "./types/RegistrationApplication";
export { RegistrationApplicationId } from "./types/RegistrationApplicationId";
export { RegistrationApplicationResponse } from "./types/RegistrationApplicationResponse";
export { RegistrationApplicationView } from "./types/RegistrationApplicationView";
export { RegistrationMode } from "./types/RegistrationMode";

View file

@ -1,7 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { RegistrationApplicationId } from "./RegistrationApplicationId";
export interface ApproveRegistrationApplication {
id: number;
id: RegistrationApplicationId;
approve: boolean;
deny_reason?: string;
}

View file

@ -15,5 +15,7 @@ export interface GetPosts {
liked_only?: boolean;
disliked_only?: boolean;
show_hidden?: boolean;
show_read?: boolean;
show_nsfw?: boolean;
page_cursor?: PaginationCursor;
}

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId";
export interface GetRegistrationApplication {
person_id: PersonId;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface ImageDetails {
link: string;
width: number;
height: number;
content_type: string;
}

View file

@ -29,6 +29,8 @@ export type LemmyErrorType =
| { error: "not_top_admin" }
| { error: "not_top_mod" }
| { error: "not_logged_in" }
| { error: "not_higher_mod" }
| { error: "not_higher_admin" }
| { error: "site_ban" }
| { error: "deleted" }
| { error: "banned_from_community" }
@ -164,4 +166,5 @@ export type LemmyErrorType =
| { error: "cant_block_local_instance" }
| { error: "url_without_domain" }
| { error: "inbox_timeout" }
| { error: "unknown"; message: string };
| { error: "unknown"; message: string }
| { error: "cant_delete_site" };

View file

@ -1,5 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Community } from "./Community";
import type { ImageDetails } from "./ImageDetails";
import type { Person } from "./Person";
import type { Post } from "./Post";
import type { PostAggregates } from "./PostAggregates";
@ -9,6 +10,7 @@ export interface PostView {
post: Post;
creator: Person;
community: Community;
image_details?: ImageDetails;
creator_banned_from_community: boolean;
banned_from_community: boolean;
creator_is_moderator: boolean;

View file

@ -1,9 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LocalUserId } from "./LocalUserId";
import type { PersonId } from "./PersonId";
import type { RegistrationApplicationId } from "./RegistrationApplicationId";
export interface RegistrationApplication {
id: number;
id: RegistrationApplicationId;
local_user_id: LocalUserId;
answer: string;
admin_id?: PersonId;

View file

@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type PersonBlockId = number;
export type RegistrationApplicationId = number;