@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
31 lines • 1.41 kB
JavaScript
import { z } from 'zod';
import { BaseResponseSchema, BaseGetParamsSchema } from '../../../core/schemas';
import { SearchTypeSchema } from './common';
/** Search attributes params */
export const SearchAttributesParamsSchema = BaseGetParamsSchema.extend({
q: z.string().min(1, 'Search query is required'),
searchType: SearchTypeSchema,
cacheSiteId: z.string().optional(),
cacheTtl: z.number().optional().default(0),
filters: z.string().optional(),
classId5List: z.string().optional(),
classidList: z.string().optional(),
fields: z.string().optional(),
from: z.number().optional(),
operator: z.string().optional(),
size: z.number().optional(),
sort: z.string().optional(),
sourceFieldsList: z.string().optional(),
});
/** Attribute value - key field only, passthrough for API flexibility */
export const AttributeValueSchema = z.object({ attributeValueUid: z.number() }).passthrough();
/** Attribute - key field only, passthrough for API flexibility */
export const AttributeSchema = z.object({ attributeUid: z.number() }).passthrough();
/** Search attributes data - passthrough for API flexibility */
export const SearchAttributesDataSchema = z
.object({
attributes: z.array(AttributeSchema),
})
.passthrough();
export const SearchAttributesResponseSchema = BaseResponseSchema(SearchAttributesDataSchema);
//# sourceMappingURL=attributes.js.map