import * as v from 'valibot'; import { statusSchema } from './status'; /** * @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'), quoted_status: v.fallback(v.nullable(v.lazy(() => statusSchema)), null), }); /** * @category Entity types */ type Quote = v.InferOutput; /** * @category Schemas * @see {@link https://docs.joinmastodon.org/entities/ShallowQuote/} */ const shallowQuoteSchema = v.object({ state: v.fallback(v.picklist(['pending', 'accepted', 'rejected', 'revoked', 'deleted', 'unauthorized']), 'accepted'), quoted_status_id: v.fallback(v.nullable(v.string()), null), }); /** * @category Entity types */ type ShallowQuote = v.InferOutput; export { quoteSchema, shallowQuoteSchema, type Quote, type ShallowQuote };