UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

37 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ItemSearchResponseSchema = exports.ItemSearchDataSchema = exports.SearchItemSchema = exports.ItemSearchParamsSchema = void 0; const zod_1 = require("zod"); const schemas_1 = require("../../../core/schemas"); const common_1 = require("./common"); // Item search params exports.ItemSearchParamsSchema = 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.coerce.number().optional().default(0), classId5ExcludeList: zod_1.z.string().optional(), classId5List: zod_1.z.string().optional(), fields: zod_1.z.string().optional(), filters: zod_1.z.string().optional(), from: zod_1.z.coerce.number().optional(), itemCategoryUidList: zod_1.z.string().optional(), operator: common_1.OperatorSchema, parentCategoryUid: zod_1.z.coerce.number().optional(), size: zod_1.z.coerce.number().optional(), sort: zod_1.z.string().optional(), sourceFieldsList: zod_1.z.string().optional(), tags: zod_1.z.string().optional(), useBrandFolderDoc: zod_1.z.union([zod_1.z.literal('Y'), zod_1.z.literal('N')]).default('N'), }); /** Search item - key field only, passthrough for API flexibility */ exports.SearchItemSchema = zod_1.z.object({ invMastUid: zod_1.z.number() }).passthrough(); /** Item search data - passthrough for API flexibility */ exports.ItemSearchDataSchema = zod_1.z .object({ items: zod_1.z.array(exports.SearchItemSchema), totalResults: zod_1.z.number(), }) .passthrough(); exports.ItemSearchResponseSchema = (0, schemas_1.BaseResponseSchema)(exports.ItemSearchDataSchema); //# sourceMappingURL=search.js.map