From 87e24cb21941dc49c152c5f2c9723ad8732b30d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Fri, 31 Oct 2025 16:20:48 +0100 Subject: [PATCH] pl-api: update allowed quote statuses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-api/lib/entities/quote.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/pl-api/lib/entities/quote.ts b/packages/pl-api/lib/entities/quote.ts index 2465d724d..ae246a352 100644 --- a/packages/pl-api/lib/entities/quote.ts +++ b/packages/pl-api/lib/entities/quote.ts @@ -2,12 +2,14 @@ import * as v from 'valibot'; import { statusSchema } from './status'; +const quoteStateSchema = v.picklist(['pending', 'accepted', 'rejected', 'revoked', 'deleted', 'unauthorized', 'blocked_account', 'blocked_domain', 'muted-account']); + /** * @category Schemas * @see {@link https://docs.joinmastodon.org/entities/Quote/} */ const quoteSchema = v.object({ - state: v.fallback(v.picklist(['pending', 'accepted', 'rejected', 'revoked', 'deleted', 'unauthorized']), 'accepted'), + state: v.fallback(quoteStateSchema, 'accepted'), quoted_status: v.fallback(v.nullable(v.lazy(() => statusSchema)), null), }); @@ -21,7 +23,7 @@ type Quote = v.InferOutput; * @see {@link https://docs.joinmastodon.org/entities/ShallowQuote/} */ const shallowQuoteSchema = v.object({ - state: v.fallback(v.picklist(['pending', 'accepted', 'rejected', 'revoked', 'deleted', 'unauthorized']), 'accepted'), + state: v.fallback(quoteStateSchema, 'accepted'), quoted_status_id: v.fallback(v.nullable(v.string()), null), });