@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
65 lines • 3.18 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AlsoBoughtResponseSchema = exports.AlsoBoughtItemSchema = exports.InvMastTextSchema = exports.ItemUomSchema = exports.AlsoBoughtParamsSchema = void 0;
const zod_1 = require("zod");
const schemas_1 = require("../../../core/schemas");
// Also-bought schemas - per CartHdr.json alsoBoughtProduct definition
exports.AlsoBoughtParamsSchema = schemas_1.BaseGetParamsSchema.extend({
limit: zod_1.z.coerce.number().optional().default(10),
offset: zod_1.z.coerce.number().optional().default(0),
});
// Item UOM schema
exports.ItemUomSchema = zod_1.z.object({
unitOfMeasure: zod_1.z.string(),
unitSize: zod_1.z.number(),
});
// Inventory master text schema
exports.InvMastTextSchema = zod_1.z.object({
sequenceNo: zod_1.z.number(),
displayOnWebFlag: zod_1.z.string(),
textTypeCd: zod_1.z.number(),
textTypeDesc: zod_1.z.string().nullable().optional(),
webDisplayTypeUid: zod_1.z.number(),
webDisplayTypeId: zod_1.z.string(),
webDisplayTypeDesc: zod_1.z.string(),
textValue: zod_1.z.string(),
});
// Rich also-bought product schema per CartHdr.json specification
exports.AlsoBoughtItemSchema = zod_1.z.object({
invMastUid: zod_1.z.number(),
itemId: zod_1.z.string(),
itemDesc: zod_1.z.string().nullable().optional(),
displayDesc: zod_1.z.string().nullable().optional(),
extendedDesc: zod_1.z.string().nullable().optional(),
defaultSellingUnit: zod_1.z.string().nullable().optional(),
defaultPurchasingUnit: zod_1.z.string().nullable().optional(),
deleteFlag: zod_1.z.string(),
baseUnit: zod_1.z.string(),
vndrStock: zod_1.z.number().nullable().optional(),
classId1: zod_1.z.string().nullable().optional(),
classId2: zod_1.z.string().nullable().optional(),
classId3: zod_1.z.string().nullable().optional(),
classId4: zod_1.z.string().nullable().optional(),
classId5: zod_1.z.string().nullable().optional(),
serialized: zod_1.z.string(),
trackLots: zod_1.z.string(),
defaultProductGroup: zod_1.z.string().nullable().optional(),
upcOrEan: zod_1.z.string().nullable().optional(),
upcOrEanId: zod_1.z.string().nullable().optional(),
weight: zod_1.z.number().nullable().optional(),
length: zod_1.z.number().nullable().optional(),
width: zod_1.z.number().nullable().optional(),
height: zod_1.z.number().nullable().optional(),
inventorySupplier: zod_1.z.array(zod_1.z.unknown()),
itemUom: zod_1.z.array(exports.ItemUomSchema),
alternateCodes: zod_1.z.array(zod_1.z.string()),
legacyTags: zod_1.z.array(zod_1.z.string()),
attributes: zod_1.z.array(zod_1.z.unknown()),
images: zod_1.z.array(zod_1.z.string()),
categoryList: zod_1.z.array(zod_1.z.number()),
userDefined: zod_1.z.union([zod_1.z.record(zod_1.z.unknown()), zod_1.z.array(zod_1.z.unknown())]),
invMastText: zod_1.z.array(exports.InvMastTextSchema),
});
// Updated to use BaseResponseSchema (8-field format) as required
exports.AlsoBoughtResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(exports.AlsoBoughtItemSchema));
//# sourceMappingURL=recommendations.js.map