From 8fd4367206dfb40b9cdcf6ffc9adf609979e8851 Mon Sep 17 00:00:00 2001 From: flamingos-cant <45780476+flamingo-cant-draw@users.noreply.github.com> Date: Wed, 13 Mar 2024 21:43:31 +0000 Subject: [PATCH] Add URL blocklist (#245) * Add URL blocklist * Regenerate blocklist. * 0.19.4-alpha.8 --------- Co-authored-by: Dessalines --- package.json | 2 +- src/index.ts | 1 + src/types/EditSite.ts | 1 + src/types/GetSiteResponse.ts | 2 ++ src/types/LemmyErrorType.ts | 1 + src/types/LocalSiteUrlBlocklist.ts | 8 ++++++++ 6 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/types/LocalSiteUrlBlocklist.ts diff --git a/package.json b/package.json index 87e4486..3e82c94 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-js-client", "description": "A javascript / typescript client for Lemmy", - "version": "0.19.4-alpha.7", + "version": "0.19.4-alpha.8", "author": "Dessalines ", "license": "AGPL-3.0", "main": "./dist/index.js", diff --git a/src/index.ts b/src/index.ts index 8451c14..515a96f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -137,6 +137,7 @@ export { ListingType } from "./types/ListingType"; export { LocalSite } from "./types/LocalSite"; export { LocalSiteId } from "./types/LocalSiteId"; export { LocalSiteRateLimit } from "./types/LocalSiteRateLimit"; +export { LocalSiteUrlBlocklist } from "./types/LocalSiteUrlBlocklist"; export { LocalUser } from "./types/LocalUser"; export { LocalUserId } from "./types/LocalUserId"; export { LocalUserView } from "./types/LocalUserView"; diff --git a/src/types/EditSite.ts b/src/types/EditSite.ts index b7b312d..ef98f5e 100644 --- a/src/types/EditSite.ts +++ b/src/types/EditSite.ts @@ -44,6 +44,7 @@ export interface EditSite { captcha_difficulty?: string; allowed_instances?: Array; blocked_instances?: Array; + blocked_urls?: Array; taglines?: Array; registration_mode?: RegistrationMode; reports_email_admins?: boolean; diff --git a/src/types/GetSiteResponse.ts b/src/types/GetSiteResponse.ts index ea13890..0419901 100644 --- a/src/types/GetSiteResponse.ts +++ b/src/types/GetSiteResponse.ts @@ -2,6 +2,7 @@ import type { CustomEmojiView } from "./CustomEmojiView"; import type { Language } from "./Language"; import type { LanguageId } from "./LanguageId"; +import type { LocalSiteUrlBlocklist } from "./LocalSiteUrlBlocklist"; import type { MyUserInfo } from "./MyUserInfo"; import type { PersonView } from "./PersonView"; import type { SiteView } from "./SiteView"; @@ -16,4 +17,5 @@ export interface GetSiteResponse { discussion_languages: Array; taglines: Array; custom_emojis: Array; + blocked_urls: Array; } diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index 712e071..885e9ea 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -125,6 +125,7 @@ export type LemmyErrorType = | { error: "couldnt_set_all_registrations_accepted" } | { error: "couldnt_set_all_email_verified" } | { error: "banned" } + | { error: "blocked_url" } | { error: "couldnt_get_comments" } | { error: "couldnt_get_posts" } | { error: "invalid_url" } diff --git a/src/types/LocalSiteUrlBlocklist.ts b/src/types/LocalSiteUrlBlocklist.ts new file mode 100644 index 0000000..063f3d7 --- /dev/null +++ b/src/types/LocalSiteUrlBlocklist.ts @@ -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 LocalSiteUrlBlocklist { + id: number; + url: string; + published: string; + updated?: string; +}