2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
2024-10-20 03:53:12 -07:00
|
|
|
import { accountSchema } from './account';
|
|
|
|
import { groupSchema } from './group';
|
|
|
|
import { statusSchema } from './status';
|
|
|
|
import { tagSchema } from './tag';
|
2024-08-28 04:43:23 -07:00
|
|
|
import { filteredArray } from './utils';
|
|
|
|
|
2024-10-29 14:44:28 -07:00
|
|
|
/**
|
|
|
|
* @category Schemas
|
|
|
|
* @see {@link https://docs.joinmastodon.org/entities/Search}
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const searchSchema = v.object({
|
2024-08-28 04:43:23 -07:00
|
|
|
accounts: filteredArray(accountSchema),
|
|
|
|
statuses: filteredArray(statusSchema),
|
|
|
|
hashtags: filteredArray(tagSchema),
|
|
|
|
groups: filteredArray(groupSchema),
|
|
|
|
});
|
|
|
|
|
2024-11-29 07:01:54 -08:00
|
|
|
/**
|
|
|
|
* @category Entity types
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type Search = v.InferOutput<typeof searchSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { searchSchema, type Search };
|