pl-api: update allowed quote statuses

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-10-31 16:20:48 +01:00
parent 5179e55750
commit 87e24cb219

View File

@ -2,12 +2,14 @@ import * as v from 'valibot';
import { statusSchema } from './status'; import { statusSchema } from './status';
const quoteStateSchema = v.picklist(['pending', 'accepted', 'rejected', 'revoked', 'deleted', 'unauthorized', 'blocked_account', 'blocked_domain', 'muted-account']);
/** /**
* @category Schemas * @category Schemas
* @see {@link https://docs.joinmastodon.org/entities/Quote/} * @see {@link https://docs.joinmastodon.org/entities/Quote/}
*/ */
const quoteSchema = v.object({ 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), quoted_status: v.fallback(v.nullable(v.lazy(() => statusSchema)), null),
}); });
@ -21,7 +23,7 @@ type Quote = v.InferOutput<typeof quoteSchema>;
* @see {@link https://docs.joinmastodon.org/entities/ShallowQuote/} * @see {@link https://docs.joinmastodon.org/entities/ShallowQuote/}
*/ */
const shallowQuoteSchema = v.object({ 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), quoted_status_id: v.fallback(v.nullable(v.string()), null),
}); });