2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
import { accountSchema } from './account';
|
|
|
|
import { statusSchema } from './status';
|
|
|
|
|
|
|
|
/** @see {@link https://docs.gotosocial.org/en/latest/api/swagger.yaml#/definitions/interactionRequest} */
|
2024-10-13 15:25:30 -07:00
|
|
|
const interactionRequestSchema = v.object({
|
2024-10-14 11:54:44 -07:00
|
|
|
accepted_at: v.fallback(v.nullable(z.string().datetime()), null),
|
2024-08-28 04:43:23 -07:00
|
|
|
account: accountSchema,
|
|
|
|
created_at: z.string().datetime(),
|
2024-10-13 15:25:30 -07:00
|
|
|
id: v.string(),
|
2024-10-14 11:54:44 -07:00
|
|
|
rejected_at: v.fallback(v.nullable(z.string().datetime()), null),
|
2024-10-13 15:25:30 -07:00
|
|
|
reply: v.fallback(v.nullable(statusSchema), null),
|
|
|
|
status: v.fallback(v.nullable(statusSchema), null),
|
2024-10-14 11:54:44 -07:00
|
|
|
type: v.picklist(['favourite', 'reply', 'reblog']),
|
2024-10-13 15:25:30 -07:00
|
|
|
uri: v.fallback(v.nullable(v.string()), null),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type InteractionRequest = v.InferOutput<typeof interactionRequestSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { interactionRequestSchema, type InteractionRequest };
|