UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

1,233 lines 249 kB
import { BaseServiceClient } from '../../core/base-client'; import type { HTTPClient } from '../../core/client'; import { PingResponse, ProductSearchParams, ProductListParams, ProductLookupParams, CategoryDetailsParams, CategoryItemsParams, CategoryListParams, CategoryLookupParams, AttributeGroupListParams, BrandListParams, GetStockParams, ItemFavoritesListParams, ItemWishlistListParams, ItemWishlistLineListParams, ItemVariantListParams, ItemFaqListParams, ItemFaqVoteRequest, BrandItemListParams, ProductLinkListParams, SubPartListParams, BinListParams, InventoryLocationBinListParams, CreateItemWishlistLineRequest, UpdateItemWishlistLineRequest, CreateItemVariantLineRequest, UpdateItemVariantLineRequest, CreateItemFaqRequest, UpdateItemFaqRequest, CreateBrandItemRequest, UpdateBrandItemRequest, CreateProductLinkRequest, UpdateProductLinkRequest, CreateSubPartRequest, UpdateSubPartRequest, CreateBinRequest, UpdateBinRequest } from './schemas'; type CreateAttributeValueRequest = { value: string; displayValue?: string; sequenceNo?: number; }; type UpdateAttributeValueRequest = { value?: string; displayValue?: string; sequenceNo?: number; }; type CreateAttributeGroupAttributeRequest = { attributeUid: number; sequenceNo?: number; }; type UpdateAttributeGroupAttributeRequest = { sequenceNo?: number; }; type CreateInternalPdfRequest = { templateId: string; data: Record<string, unknown>; }; type CreateProductAttributeValueRequest = { attributeValueUid: number; customValue?: string; }; type UpdateProductAttributeValueRequest = { customValue?: string; }; type CreateProductAttributeRequest = { attributeUid: number; }; /** * Items API Client * @description Client for interacting with Items microservice API endpoints for comprehensive product catalog, inventory, categories, and attributes management * @fullPath api.items * @service items * @domain inventory-management * @discoverable true * @searchTerms ["items", "products", "inventory", "catalog", "categories", "attributes", "brands", "stock", "product management", "item lookup"] * @relatedEndpoints ["api.commerce.cartHeaders", "api.customers.purchasedItems", "api.nexus.receiving", "api.pricing.priceEngine", "api.opensearch.items"] * @commonPatterns ["Product catalog management", "Inventory tracking", "Category navigation", "Product search", "Stock management"] * @workflow ["product-catalog-management", "inventory-operations", "e-commerce-integration"] * @prerequisites ["Valid authentication token", "Inventory management permissions"] * @nextSteps ["api.commerce.cartHeaders.create for adding to cart", "api.pricing.priceEngine for pricing calculations"] * @businessRules ["Product visibility based on status and online flags", "Category hierarchy enforcement", "Stock validation for purchasing"] * @functionalArea "inventory-and-product-management" * @caching "Product details cached for 10 minutes, categories for 30 minutes" * @performance "Use pagination for large result sets, implement search filters for better performance" * @example * ```typescript * import { HTTPClient } from '@augur/api-client/core'; * import { ItemsClient } from '@augur/api-client/services/items'; * * const http = new HTTPClient('items', { siteId: 'your-site-id', bearerToken: 'your-token' }); * const items = new ItemsClient(http); * * // Get product details * const product = await items.invMast.get(12345); * * // Search products * const results = await items.invMast.search({ q: 'cable', limit: 20 }); * * // Get category with items * const category = await items.categories.get(100); * const categoryItems = await items.categories.getItems(100, { limit: 12 }); * ``` */ export declare class ItemsClient extends BaseServiceClient { /** * Create a new ItemsClient instance * @param http Configured HTTPClient instance * @param baseUrl Base URL for the Items API (default: https://items.augur-api.com) */ constructor(http: HTTPClient, baseUrl?: string); /** * Product catalog endpoints (Inventory Master - inv_mast) * @description Methods for product management including search, details, alternate codes, and accessories */ /** * Category management endpoints * @description Methods for hierarchical product categorization including category details, items, attributes, and filtering */ categories: { /** * List all categories with filtering and pagination * @description Retrieve a paginated list of categories with filtering options * @param params Optional filtering and pagination parameters * @returns Array of category entities * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * const categories = await client.categories.list({ * displayOnWebFlag: 'Y', * limit: 50 * }); * ``` */ list: (params?: CategoryListParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; statusCd: number; updateCd: number; processCd: number; displayOnWebFlag: "Y" | "N"; deleteFlag: "Y" | "N"; createdBy: string; lastMaintainedBy: string; itemCategoryUid: number; itemCategoryId: string; itemCategoryDesc: string; masterCategoryFlag: string; parentCategoryFlag: string; displayMasterProductFlag: string; itemCount: number; catalogPage?: string | null | undefined; subCategoryImageFile?: string | null | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Lookup category with hierarchical structure * @description Retrieve category with subcategories in hierarchical structure * @param params Lookup parameters including category UID or ID * @returns Category with subcategories * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * const categoryLookup = await client.categories.lookup({ * itemCategoryUid: 100, * includeSubCategories: true * }); * ``` */ lookup: (params?: CategoryLookupParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: { fullPath: string | null; displayOnWebFlag: "Y" | "N"; deleteFlag: "Y" | "N"; itemCategoryUid: number; itemCategoryId: string; itemCategoryDesc: string; itemCount: number; subCategories: { fullPath: string | null; displayOnWebFlag: "Y" | "N"; deleteFlag: "Y" | "N"; itemCategoryUid: number; itemCategoryId: string; itemCategoryDesc: string; itemCount: number; }[]; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Pre-cache a single category * @description Trigger pre-caching for a specific category to improve response times * @param itemCategoryUid Category unique identifier * @returns Boolean indicating if pre-cache was queued successfully * @throws ValidationError When response is malformed * @example * ```typescript * const cached = await client.categories.preCache(100); * if (cached.data) { * console.log('Category pre-cache queued successfully'); * } * ``` */ preCache: (itemCategoryUid: number) => Promise<{ params: Record<string, unknown> | unknown[]; data: boolean; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get category details by ID or path * @description Retrieve comprehensive category information including children, attributes, and metadata * @fullPath api.items.categories.get * @service items * @domain inventory-management * @dataMethod categoriesData.get * @discoverable true * @searchTerms ["category details", "category info", "category by id", "category lookup", "hierarchical categories"] * @relatedEndpoints ["api.items.categories.getItems", "api.items.categories.list", "api.items.categories.getAttributes", "api.opensearch.categories"] * @commonPatterns ["Category navigation", "Get category info", "Category detail page", "Hierarchical browsing"] * @workflow ["category-navigation", "product-browsing", "taxonomy-management"] * @prerequisites ["Valid category UID or path", "Category access permissions"] * @nextSteps ["api.items.categories.getItems", "api.items.categories.getAttributes", "api.items.categories.getFilters"] * @businessRules ["Returns category hierarchy", "Includes subcategories if requested", "Respects category visibility settings"] * @functionalArea "category-and-taxonomy-management" * @caching "Cache for 30 minutes, invalidate on category structure changes" * @performance "Optimized for category navigation, supports path-based lookups" * @param itemCategoryUid Category unique identifier (use 0 for path-based lookup) * @param params Optional parameters for path lookup, filtering, and children pagination * @returns Complete category details with children and attributes * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * // Get category by ID * const category = await client.categories.get(100); * console.log(category.data.itemCategoryDesc, category.data.path); * * // Get category by path * const categoryByPath = await client.categories.get(0, { * path: '/Electronics/Cables' * }); * * // Get category with filtered children * const categoryWithChildren = await client.categories.get(100, { * childrenLimit: 10, * childrenFilter: 'audio' * }); * ``` */ get: (itemCategoryUid: number, params?: CategoryDetailsParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: { itemCategoryUid: number; itemCategoryDesc: string; path?: string; parentItemCategoryUid?: number; level?: number; children?: Array<{ itemCategoryUid: number; itemCategoryDesc: string; path?: string; parentItemCategoryUid?: number; level?: number; children?: unknown; attributes?: unknown[]; images?: unknown[]; itemCount?: number; }>; attributes?: unknown[]; images?: unknown[]; itemCount?: number; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get items within a category * @description Retrieve items within a specific category with advanced filtering, sorting, and pagination * @param itemCategoryUid Category unique identifier * @param params Optional filtering, sorting, and pagination parameters * @returns Array of category items with optional stock information * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * // Get category items with basic pagination * const items = await client.categories.getItems(100, { limit: 12 }); * * // Get items with filtering and stock information * const filteredItems = await client.categories.getItems(100, { * limit: 20, * sortBy: 'listPrice|ASC', * includeStock: 'Y', * displayOnWebFlag: 'Y', * filters: JSON.stringify([ * { attributeId: 'color', values: ['red', 'blue'], operator: 'IN' } * ]) * }); * * // Search within category * const searchResults = await client.categories.getItems(100, { * q: 'wireless', * limit: 10 * }); * ``` */ getItems: (itemCategoryUid: number, params?: CategoryItemsParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: { invMastUid: number; itemId: string; itemDesc: string; images?: unknown[] | undefined; attributes?: unknown[] | undefined; listPrice?: number | undefined; stdPrice?: number | undefined; stock?: { qtyOnHand: number; qtyAvailable: number; } | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get attributes available for a category * @description Retrieve attributes available for filtering within a category * @param itemCategoryUid Category unique identifier * @returns Array of category attributes with their available values * @throws ValidationError When response is malformed * @example * ```typescript * const attributes = await client.categories.getAttributes(100); * attributes.data.forEach(attr => { * console.log(`${attr.attributeDesc}: ${attr.values?.join(', ')}`); * }); * ``` */ getAttributes: (itemCategoryUid: number) => Promise<{ params: Record<string, unknown> | unknown[]; data: { attributeId: string; attributeUid: number; attributeDesc: string; dataType: string; values?: string[] | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get available filter options for a category * @description Get available filter options for a category based on its items * @param itemCategoryUid Category unique identifier * @returns Array of filter options with values and counts * @throws ValidationError When response is malformed * @example * ```typescript * const filters = await client.categories.getFilters(100); * filters.data.forEach(filter => { * console.log(`${filter.attributeDesc}:`); * filter.values.forEach(value => { * console.log(` ${value.value} (${value.count})`); * }); * }); * ``` */ getFilters: (itemCategoryUid: number) => Promise<{ params: Record<string, unknown> | unknown[]; data: { values: { value: string; count: number; }[]; attributeId: string; attributeDesc: string; filterType: string; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get images for a category * @description Retrieve images associated with a category * @param itemCategoryUid Category unique identifier * @returns Array of category images * @throws ValidationError When response is malformed * @example * ```typescript * const images = await client.categories.getImages(100); * images.data.forEach(image => { * console.log(`Image: ${image.imagePath} (${image.imageType})`); * }); * ``` */ getImages: (itemCategoryUid: number) => Promise<{ params: Record<string, unknown> | unknown[]; data: { imageUid: number; imagePath: string; imageType: string; altText?: string | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; }; /** * Category data-only endpoints * @description Data-only methods that return just the data portion of category responses */ categoriesData: { /** * Get category details data only * @description Returns only the data portion of category details response * @fullPath api.items.categoriesData.get * @service items * @domain inventory-management * @discoverable true * @searchTerms ["category data", "category details data only"] * @relatedEndpoints ["api.items.categories.get"] * @commonPatterns ["Get category data without metadata"] * @param itemCategoryUid Category unique identifier * @param params Optional parameters * @returns Category data only */ get: (itemCategoryUid: number, params?: CategoryDetailsParams) => Promise<{ itemCategoryUid: number; itemCategoryDesc: string; path?: string; parentItemCategoryUid?: number; level?: number; children?: Array<{ itemCategoryUid: number; itemCategoryDesc: string; path?: string; parentItemCategoryUid?: number; level?: number; children?: unknown; attributes?: unknown[]; images?: unknown[]; itemCount?: number; }>; attributes?: unknown[]; images?: unknown[]; itemCount?: number; }>; /** * List categories data only * @description Returns only the data portion of category list response * @fullPath api.items.categoriesData.list * @service items * @domain inventory-management * @discoverable true * @searchTerms ["category list data", "categories data only"] * @relatedEndpoints ["api.items.categories.list"] * @commonPatterns ["List categories without metadata"] * @param params Optional filtering parameters * @returns Category list data only */ list: (params?: CategoryListParams) => Promise<{ dateCreated: string; dateLastModified: string; statusCd: number; updateCd: number; processCd: number; displayOnWebFlag: "Y" | "N"; deleteFlag: "Y" | "N"; createdBy: string; lastMaintainedBy: string; itemCategoryUid: number; itemCategoryId: string; itemCategoryDesc: string; masterCategoryFlag: string; parentCategoryFlag: string; displayMasterProductFlag: string; itemCount: number; catalogPage?: string | null | undefined; subCategoryImageFile?: string | null | undefined; }[]>; /** * Get category items data only * @description Returns only the data portion of category items response * @fullPath api.items.categoriesData.getItems * @service items * @domain inventory-management * @discoverable true * @searchTerms ["category items data", "items in category data only"] * @relatedEndpoints ["api.items.categories.getItems"] * @commonPatterns ["Get category items without metadata"] * @param itemCategoryUid Category unique identifier * @param params Optional filtering parameters * @returns Category items data only */ getItems: (itemCategoryUid: number, params?: CategoryItemsParams) => Promise<{ invMastUid: number; itemId: string; itemDesc: string; images?: unknown[] | undefined; attributes?: unknown[] | undefined; listPrice?: number | undefined; stdPrice?: number | undefined; stock?: { qtyOnHand: number; qtyAvailable: number; } | undefined; }[]>; }; /** * Attribute management endpoints * @description Methods for managing product attributes including CRUD operations */ attributes: { /** * List all attributes * @description Retrieve a paginated list of available attributes * @param params Optional pagination parameters * @returns Array of attributes * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * const attributes = await client.attributes.list({ limit: 50 }); * attributes.data.forEach(attr => { * console.log(`${attr.attributeId}: ${attr.attributeDesc} (${attr.dataType})`); * }); * ``` */ list: (params?: { limit?: number; offset?: number; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { attributeId: string; statusCd: number; attributeUid: number; attributeDesc: string; dataType: string; sequenceNo?: number | undefined; maxLength?: number | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get attribute details by ID * @description Retrieve details for a specific attribute * @param attributeUid Attribute unique identifier * @returns Attribute details * @throws ValidationError When response is malformed * @example * ```typescript * const attribute = await client.attributes.get(123); * console.log(attribute.attributeDesc, attribute.dataType, attribute.maxLength); * ``` */ get: (id: string | number, params?: import("../../core/base-client").CacheParams | undefined) => Promise<{ params: Record<string, unknown> | unknown[]; data: { attributeId: string; statusCd: number; attributeUid: number; attributeDesc: string; dataType: string; sequenceNo?: number | undefined; maxLength?: number | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Create a new attribute * @description Create a new attribute with specified properties * @param request Attribute creation data * @returns Created attribute information * @throws ValidationError When request is invalid or response is malformed * @example * ```typescript * const newAttribute = await client.attributes.create({ * attributeId: 'material', * attributeDesc: 'Material Type', * dataType: 'string', * maxLength: 100, * sequenceNo: 10 * }); * ``` */ create: (data: { attributeId: string; attributeDesc: string; dataType: string; sequenceNo?: number | undefined; maxLength?: number | undefined; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { attributeId: string; statusCd: number; attributeUid: number; attributeDesc: string; dataType: string; sequenceNo?: number | undefined; maxLength?: number | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Update an existing attribute * @description Update an existing attribute with new information * @param attributeUid Attribute unique identifier * @param request Attribute update data * @returns Updated attribute information * @throws ValidationError When request is invalid or response is malformed * @example * ```typescript * const updated = await client.attributes.update(123, { * attributeDesc: 'Updated Material Type', * maxLength: 150 * }); * ``` */ update: (id: string | number, data: { attributeId?: string | undefined; sequenceNo?: number | undefined; maxLength?: number | undefined; attributeDesc?: string | undefined; dataType?: string | undefined; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { attributeId: string; statusCd: number; attributeUid: number; attributeDesc: string; dataType: string; sequenceNo?: number | undefined; maxLength?: number | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Delete an attribute * @description Soft delete an attribute (sets status to inactive) * @param attributeUid Attribute unique identifier * @returns Boolean indicating successful deletion * @throws ValidationError When response is malformed * @example * ```typescript * const deleted = await client.attributes.delete(123); * if (deleted) { * console.log('Attribute successfully deleted'); * } * ``` */ delete: (attributeUid: number) => Promise<boolean>; }; /** * Stock and location management endpoints * @description Methods for inventory stock information across locations */ stock: { /** * Get comprehensive stock details for an item * @description Retrieve comprehensive stock information for an item across all locations with detailed calculations * @param invMastUid Inventory master unique identifier * @param params Optional parameters for filtering and including additional data * @returns Stock details with location breakdown and company summary * @throws ValidationError When response is malformed * @example * ```typescript * const stockInfo = await client.stock.getDetails(12345); * console.log('Company Summary:', stockInfo.data.companySummary); * * stockInfo.data.stockData.forEach(location => { * console.log(`Location ${location.locationName}: ${location.qtyOnHand} on hand, ${location.qtyAvailable} available`); * console.log(` Calculated: ${location.calcQtyOnHand} (${location.defaultSellingUnit})`); * }); * ``` */ getDetails: (invMastUid: number, params?: GetStockParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: { companySummary: Record<string, number>; stockData: { defaultSellingUnit: string; baseUnit: string; companyId: string; locationId: number; qtyOnHand: number; qtyAllocated: number; qtyAvailable: number; unallocated: number; baseUnitSize: number; defaultSellingUnitSize: number; divisor: number; calcQtyOnHand: number; calcQtyAllocated: number; calcQtyAvailable: number; locationName: string; qtyBackordered?: number | null | undefined; stockable?: string | null | undefined; nextDueInPoDate?: string | null | undefined; primaryBin?: string | null | undefined; discontinued?: string | null | undefined; qtyFrozen?: number | null | undefined; qtyQuarantined?: number | null | undefined; orderQuantity?: number | null | undefined; productGroupId?: string | null | undefined; }[]; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; }; /** * Brand management endpoints * @description Methods for managing product brands including CRUD operations */ brands: { /** * List all brands * @description Retrieve a paginated list of brands with filtering options * @param params Optional filtering and pagination parameters * @returns Array of brands * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * const brands = await client.brands.list({ limit: 50, statusCd: 704 }); * brands.data.forEach(brand => { * console.log(`${brand.brandsId}: ${brand.brandsName}`); * }); * ``` */ list: (params?: BrandListParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; statusCd: number; updateCd: number; processCd: number; brandsUid: number; brandsName: string; brandsId: string; brandsDesc?: string | null | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get brand details by ID * @description Retrieve details for a specific brand * @param brandsUid Brand unique identifier * @returns Brand details * @throws ValidationError When response is malformed * @example * ```typescript * const brand = await client.brands.get(123); * console.log(brand.data.brandsName, brand.data.brandsDesc); * ``` */ get: (id: string | number, params?: import("../../core/base-client").CacheParams | undefined) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; statusCd: number; updateCd: number; processCd: number; brandsUid: number; brandsName: string; brandsId: string; brandsDesc?: string | null | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Create a new brand * @description Create a new brand with specified properties * @param request Brand creation data * @returns Created brand information * @throws ValidationError When request is invalid or response is malformed * @example * ```typescript * const newBrand = await client.brands.create({ * brandsName: 'ACME Corporation', * brandsDesc: 'Leading manufacturer' * }); * ``` */ create: (data: { brandsName: string; brandsDesc?: string | null | undefined; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; statusCd: number; updateCd: number; processCd: number; brandsUid: number; brandsName: string; brandsId: string; brandsDesc?: string | null | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Update an existing brand * @description Update an existing brand with new information * @param brandsUid Brand unique identifier * @param request Brand update data * @returns Updated brand information * @throws ValidationError When request is invalid or response is malformed * @example * ```typescript * const updated = await client.brands.update(123, { * brandsName: 'ACME Corporation LLC', * brandsDesc: 'Updated description' * }); * ``` */ update: (id: string | number, data: { statusCd?: number | undefined; processCd?: number | undefined; brandsName?: string | undefined; brandsDesc?: string | null | undefined; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; statusCd: number; updateCd: number; processCd: number; brandsUid: number; brandsName: string; brandsId: string; brandsDesc?: string | null | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Delete a brand * @description Soft delete a brand (sets status to inactive) * @param brandsUid Brand unique identifier * @returns Boolean indicating successful deletion * @throws ValidationError When response is malformed * @example * ```typescript * const deleted = await client.brands.delete(123); * if (deleted) { * console.log('Brand successfully deleted'); * } * ``` */ delete: (brandsUid: number) => Promise<boolean>; }; /** * Attribute group management endpoints * @description Methods for managing attribute groups with comprehensive CRUD operations */ attributeGroups: { /** * List all attribute groups * @description Retrieve a list of attribute groups with filtering options * @param params Optional filtering and pagination parameters * @returns Array of attribute group summaries * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * const groups = await client.attributeGroups.list({ * statusCd: 704, * limit: 50 * }); * groups.data.forEach(group => { * console.log(`${group.attributeGroupId}: ${group.attributeGroupDesc}`); * }); * ``` */ list: (params?: AttributeGroupListParams) => Promise<{ params: Record<string, unknown> | unknown[]; data: { typeCd: number; attributeGroupUid: number; attributeGroupId: string; attributeGroupDesc: string | null; attributeGroupType: number; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get attribute group details by ID * @description Retrieve details for a specific attribute group * @param attributeGroupUid Attribute group unique identifier * @returns Complete attribute group details * @throws ValidationError When response is malformed * @example * ```typescript * const group = await client.attributeGroups.get(123); * console.log(group.data.attributeGroupDesc, group.data.attributeGroupType); * ``` */ get: (id: string | number, params?: import("../../core/base-client").CacheParams | undefined) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; createdBy: string; lastMaintainedBy: string; attributeGroupUid: number; attributeGroupId: string; rowStatusFlag: number; attributeGroupType: number; statusCd?: number | undefined; updateCd?: number | undefined; processCd?: number | undefined; typeCd?: number | undefined; attributeGroupDesc?: string | null | undefined; searchableCd?: number | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Create a new attribute group * @description Create a new attribute group with specified properties * @param request Attribute group creation data * @returns Created attribute group information * @throws ValidationError When request is invalid or response is malformed * @example * ```typescript * const newGroup = await client.attributeGroups.create({ * attributeGroupDesc: 'Electronics Category', * attributeGroupType: 3526, * statusCd: 704 * }); * ``` */ create: (data: { attributeGroupDesc: string; statusCd?: number | undefined; typeCd?: number | undefined; attributeGroupType?: number | undefined; searchableCd?: number | undefined; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; createdBy: string; lastMaintainedBy: string; attributeGroupUid: number; attributeGroupId: string; rowStatusFlag: number; attributeGroupType: number; statusCd?: number | undefined; updateCd?: number | undefined; processCd?: number | undefined; typeCd?: number | undefined; attributeGroupDesc?: string | null | undefined; searchableCd?: number | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Update an existing attribute group * @description Update an existing attribute group with new information * @param attributeGroupUid Attribute group unique identifier * @param request Attribute group update data * @returns Updated attribute group information * @throws ValidationError When request is invalid or response is malformed * @example * ```typescript * const updated = await client.attributeGroups.update(123, { * attributeGroupDesc: 'Updated Electronics Category', * statusCd: 704 * }); * ``` */ update: (id: string | number, data: { statusCd?: number | undefined; updateCd?: number | undefined; processCd?: number | undefined; typeCd?: number | undefined; attributeGroupDesc?: string | null | undefined; attributeGroupType?: number | undefined; searchableCd?: number | undefined; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; createdBy: string; lastMaintainedBy: string; attributeGroupUid: number; attributeGroupId: string; rowStatusFlag: number; attributeGroupType: number; statusCd?: number | undefined; updateCd?: number | undefined; processCd?: number | undefined; typeCd?: number | undefined; attributeGroupDesc?: string | null | undefined; searchableCd?: number | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Delete an attribute group * @description Soft delete an attribute group (sets status to inactive) * @param attributeGroupUid Attribute group unique identifier * @returns Updated attribute group with deleted status * @throws ValidationError When response is malformed * @example * ```typescript * const deleted = await client.attributeGroups.delete(123); * console.log('Deleted group status:', deleted.data.statusCd); // Should be 700 * ``` */ delete: (attributeGroupUid: number) => Promise<{ params: Record<string, unknown> | unknown[]; data: { dateCreated: string; dateLastModified: string; createdBy: string; lastMaintainedBy: string; attributeGroupUid: number; attributeGroupId: string; rowStatusFlag: number; attributeGroupType: number; statusCd?: number | undefined; updateCd?: number | undefined; processCd?: number | undefined; typeCd?: number | undefined; attributeGroupDesc?: string | null | undefined; searchableCd?: number | undefined; }; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; }; /** * Attribute value management endpoints * @description Methods for managing attribute values */ attributeValues: { /** * List all attribute values * @description Retrieve a list of attribute values * @param params Optional pagination parameters * @returns Array of attribute values * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * const values = await client.attributeValues.list(); * values.data.forEach(value => { * console.log(`${value.attributeValue} (${value.displayValue})`); * }); * ``` */ list: (params?: { limit?: number; offset?: number; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { attributeValueUid: number; attributeValue: string; attributeUid: number; sequenceNo?: number | undefined; displayValue?: string | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Get attribute value details by ID * @description Retrieve details for a specific attribute value * @param attributeValueUid Attribute value unique identifier * @returns Attribute value details * @throws ValidationError When response is malformed * @example * ```typescript * const value = await client.attributeValues.get(123); * console.log(value.attributeValue, value.displayValue); * ``` */ get: (attributeValueUid: number) => Promise<{ attributeValueUid: number; attributeValue: string; attributeUid: number; sequenceNo?: number | undefined; displayValue?: string | undefined; }>; }; /** * Item attribute value management endpoints * @description Methods for managing item-specific attribute values */ itemAttributeValues: { /** * List item attribute values * @description Retrieve a list of item attribute values * @param params Optional pagination parameters * @returns Array of item attribute values * @throws ValidationError When parameters are invalid or response is malformed * @example * ```typescript * const itemValues = await client.itemAttributeValues.list(); * itemValues.data.forEach(value => { * console.log(`Item ${value.invMastUid}, Attribute ${value.attributeUid}: ${value.attributeValue}`); * }); * ``` */ list: (params?: { limit?: number; offset?: number; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { invMastUid: number; attributeValue: string; attributeUid: number; itemAttributeValueUid: number; displayValue?: string | undefined; }[]; options: Record<string, unknown> | unknown[]; status: number; message: string; count: number; total: number; totalResults: number; }>; /** * Create item attribute value * @description Create a new item attribute value relationship * @param request Item attribute value creation data * @returns Created item attribute value information * @throws ValidationError When request is invalid or response is malformed * @example * ```typescript * const newValue = await client.itemAttributeValues.create({ * invMastUid: 12345, * attributeUid: 456, * attributeValue: 'red', * displayValue: 'Red' * }); * ``` */ create: (data: { invMastUid: number; attributeValue: string; attributeUid: number; displayValue?: string | undefined; }) => Promise<{ params: Record<string, unknown> | unknown[]; data: { invMastUid: number; attributeValue