bigbuffet-rw/packages/pl-api/lib/entities/interaction-request.ts
marcin mikołajczak bc65755862 pl-api: Update docs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-11-29 16:01:54 +01:00

28 lines
916 B
TypeScript

import * as v from 'valibot';
import { accountSchema } from './account';
import { statusSchema } from './status';
import { datetimeSchema } from './utils';
/**
* @category Schemas
* @see {@link https://docs.gotosocial.org/en/latest/api/swagger.yaml#/definitions/interactionRequest}
*/
const interactionRequestSchema = v.object({
accepted_at: v.fallback(v.nullable(datetimeSchema), null),
account: accountSchema,
created_at: datetimeSchema,
id: v.string(),
rejected_at: v.fallback(v.nullable(datetimeSchema), null),
reply: v.fallback(v.nullable(statusSchema), null),
status: v.fallback(v.nullable(statusSchema), null),
type: v.picklist(['favourite', 'reply', 'reblog']),
uri: v.fallback(v.nullable(v.string()), null),
});
/**
* @category Entity types
*/
type InteractionRequest = v.InferOutput<typeof interactionRequestSchema>;
export { interactionRequestSchema, type InteractionRequest };