@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
34 lines • 1.47 kB
JavaScript
import { z } from 'zod';
import { BaseResponseSchema, BaseGetParamsSchema } from '../../../core/schemas';
import { SearchTypeSchema, OperatorSchema } from './common';
// Item search params
export const ItemSearchParamsSchema = BaseGetParamsSchema.extend({
q: z.string().min(1, 'Search query is required'),
searchType: SearchTypeSchema,
cacheSiteId: z.string().optional(),
cacheTtl: z.coerce.number().optional().default(0),
classId5ExcludeList: z.string().optional(),
classId5List: z.string().optional(),
fields: z.string().optional(),
filters: z.string().optional(),
from: z.coerce.number().optional(),
itemCategoryUidList: z.string().optional(),
operator: OperatorSchema,
parentCategoryUid: z.coerce.number().optional(),
size: z.coerce.number().optional(),
sort: z.string().optional(),
sourceFieldsList: z.string().optional(),
tags: z.string().optional(),
useBrandFolderDoc: z.union([z.literal('Y'), z.literal('N')]).default('N'),
});
/** Search item - key field only, passthrough for API flexibility */
export const SearchItemSchema = z.object({ invMastUid: z.number() }).passthrough();
/** Item search data - passthrough for API flexibility */
export const ItemSearchDataSchema = z
.object({
items: z.array(SearchItemSchema),
totalResults: z.number(),
})
.passthrough();
export const ItemSearchResponseSchema = BaseResponseSchema(ItemSearchDataSchema);
//# sourceMappingURL=search.js.map