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