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';
|
2024-10-16 08:03:27 -07:00
|
|
|
import { datetimeSchema } from './utils';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
/** @see {@link https://docs.joinmastodon.org/entities/Report/} */
|
2024-10-13 15:25:30 -07:00
|
|
|
const reportSchema = v.object({
|
|
|
|
id: v.string(),
|
|
|
|
action_taken: v.fallback(v.optional(v.boolean()), undefined),
|
2024-10-16 08:03:27 -07:00
|
|
|
action_taken_at: v.fallback(v.nullable(datetimeSchema), null),
|
2024-10-13 15:25:30 -07:00
|
|
|
category: v.fallback(v.optional(v.string()), undefined),
|
|
|
|
comment: v.fallback(v.optional(v.string()), undefined),
|
|
|
|
forwarded: v.fallback(v.optional(v.boolean()), undefined),
|
2024-10-16 08:03:27 -07:00
|
|
|
created_at: v.fallback(v.optional(datetimeSchema), undefined),
|
2024-10-14 11:54:44 -07:00
|
|
|
status_ids: v.fallback(v.nullable(v.string()), null),
|
|
|
|
rule_ids: v.fallback(v.nullable(v.string()), null),
|
2024-10-13 15:25:30 -07:00
|
|
|
target_account: v.fallback(v.nullable(accountSchema), null),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-10-13 15:25:30 -07:00
|
|
|
type Report = v.InferOutput<typeof reportSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { reportSchema, type Report };
|