@simpleapps-com/augur-utils 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -82,7 +82,7 @@ type TProductCategory = {
82
82
  itemCategoryId: string;
83
83
  itemCategoryUid: number;
84
84
  itemCount: number;
85
- productCollection: any;
85
+ productCollection: string | null;
86
86
  sequenceNo: number;
87
87
  children: TProductCategory[];
88
88
  childrenTotal: number;
@@ -120,6 +120,10 @@ type TAttribute = {
120
120
  valueCount: number;
121
121
  values: TAttributeValue[];
122
122
  };
123
+ /** Wrapper returned by the OpenSearch item category attributes endpoint. */
124
+ type TItemAttributes = {
125
+ attributes: TAttribute[];
126
+ };
123
127
 
124
128
  type TInvMast = {
125
129
  invMastUid: number;
@@ -243,8 +247,8 @@ type TInvMastDoc = {
243
247
  attributes: TItemAttribute[];
244
248
  images: string[];
245
249
  categoryList: number[];
246
- userDefined: any[];
247
- invMastText: any[];
250
+ userDefined: string[];
251
+ invMastText: string[];
248
252
  stock: TStock;
249
253
  };
250
254
 
@@ -293,17 +297,17 @@ type TItemDetails = {
293
297
  classId4: string | null;
294
298
  classId5: string | null;
295
299
  defaultSellingUnit: string;
296
- displayDesc: any;
300
+ displayDesc: string;
297
301
  extendedDesc: string;
298
302
  images: string[];
299
- invMastText: any[];
303
+ invMastText: string[];
300
304
  invMastUid: number;
301
305
  itemDesc: string;
302
306
  itemId: string;
303
307
  itemUom: TItemUom[];
304
308
  length: number;
305
- vndrStock: any;
306
- userDefined: any[];
309
+ vndrStock: number | null;
310
+ userDefined: string[];
307
311
  isWood: boolean;
308
312
  defaultProductGroup: string | null;
309
313
  };
@@ -320,6 +324,26 @@ type TItemRelatedProduct = TItemDetails & {
320
324
  childItemId: string;
321
325
  childImages: string[];
322
326
  };
327
+ /** Flat related product shape from the Items service (also-bought, accessories). */
328
+ type TRelatedProduct = {
329
+ invAccessoryUid: number;
330
+ parentInvMastUid: number;
331
+ childInvMastUid: number;
332
+ childItemId: string;
333
+ childItemDesc: string;
334
+ childDisplayDesc: string;
335
+ childDefaultSellingUnit: string;
336
+ classId1: string;
337
+ classId2: string;
338
+ classId3: string;
339
+ classId4: string;
340
+ classId5: string;
341
+ childItemUom: {
342
+ unitOfMeasure: string;
343
+ unitSize: number;
344
+ }[];
345
+ childImages: string[];
346
+ };
323
347
 
324
348
  type TLibraryPriceBreak = {
325
349
  calculationValue: number;
@@ -394,7 +418,7 @@ type TPriceData = {
394
418
  };
395
419
 
396
420
  type TItemsFilters = {
397
- filters: any[];
421
+ filters: Record<string, string>[];
398
422
  limit: number;
399
423
  offset: number;
400
424
  sortBy: string;
@@ -529,6 +553,75 @@ type TShippingMethod = {
529
553
  transportationCharges: number;
530
554
  };
531
555
 
556
+ type TLtlRatesResponse = {
557
+ vendorContractId: string;
558
+ vendorId: string;
559
+ vendorName: string;
560
+ transitDays: number;
561
+ estimatedDeliveryDate: string;
562
+ milesInTransit: string;
563
+ totalCharges: number;
564
+ };
565
+ type TLtlShipmentData = {
566
+ international: boolean;
567
+ fromAddressLine: string;
568
+ fromCity: string;
569
+ fromState: string;
570
+ fromPostalCode: string;
571
+ fromCountryCode: string;
572
+ fromCompanyName: string;
573
+ fromPhone: string;
574
+ fromFirstName: string;
575
+ fromLastName: string;
576
+ toAddressLine: string;
577
+ toCity: string;
578
+ toRegion: string;
579
+ toPostalCode: string;
580
+ toCountryCode: string;
581
+ toCompanyName: string;
582
+ toPhone: string;
583
+ toFirstName: string;
584
+ toLastName: string;
585
+ totalWeight: number;
586
+ handlingCharge: number;
587
+ handlingChargeUnit: string;
588
+ pickupInstructions: string;
589
+ deliveryInstructions: string;
590
+ packageLength: number;
591
+ packageWidth: number;
592
+ packageHeight: number;
593
+ dimensionUnit: string;
594
+ weightUnit: string;
595
+ quantity: number;
596
+ responseFormat: string;
597
+ version: string;
598
+ siteid: string;
599
+ };
600
+
601
+ type TSearchSuggestion = {
602
+ suggestionsUid: number;
603
+ queryStringUid: number;
604
+ suggestionsString: string;
605
+ suggestionsMetaphone: string | null;
606
+ avgTotalResults: number;
607
+ dateCreated: string;
608
+ dateLastModified: string;
609
+ updateCd: number;
610
+ statusCd: number;
611
+ processCd: number;
612
+ score: number;
613
+ };
614
+ type TSearchSuggestionsResponse = {
615
+ count: number;
616
+ data: TSearchSuggestion[];
617
+ message: string;
618
+ options: unknown[];
619
+ params: unknown[];
620
+ status: number;
621
+ total: number;
622
+ totalResults: number;
623
+ };
624
+
532
625
  type TTaxItem = {
533
626
  itemId: string;
534
627
  quantity: number;
@@ -608,4 +701,4 @@ type CacheTier = keyof typeof CACHE_CONFIG;
608
701
  */
609
702
  declare function formatPrice(price: number, locale?: string, currency?: string): string;
610
703
 
611
- export { CACHE_CONFIG, type CacheTier, type CustomerDocument, type MenuItem, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type TApiResponse, type TAttribute, type TAttributeValue, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TMetaTags, type TOrderCartLine, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TShippingMethod, type TStock, type TStockData, type TTax, type TTaxItem, type TWebDesc, formatPrice };
704
+ export { CACHE_CONFIG, type CacheTier, type CustomerDocument, type MenuItem, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type TApiResponse, type TAttribute, type TAttributeValue, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemAttributes, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TLtlRatesResponse, type TLtlShipmentData, type TMetaTags, type TOrderCartLine, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TRelatedProduct, type TSearchSuggestion, type TSearchSuggestionsResponse, type TShippingMethod, type TStock, type TStockData, type TTax, type TTaxItem, type TWebDesc, formatPrice };
package/dist/index.d.ts CHANGED
@@ -82,7 +82,7 @@ type TProductCategory = {
82
82
  itemCategoryId: string;
83
83
  itemCategoryUid: number;
84
84
  itemCount: number;
85
- productCollection: any;
85
+ productCollection: string | null;
86
86
  sequenceNo: number;
87
87
  children: TProductCategory[];
88
88
  childrenTotal: number;
@@ -120,6 +120,10 @@ type TAttribute = {
120
120
  valueCount: number;
121
121
  values: TAttributeValue[];
122
122
  };
123
+ /** Wrapper returned by the OpenSearch item category attributes endpoint. */
124
+ type TItemAttributes = {
125
+ attributes: TAttribute[];
126
+ };
123
127
 
124
128
  type TInvMast = {
125
129
  invMastUid: number;
@@ -243,8 +247,8 @@ type TInvMastDoc = {
243
247
  attributes: TItemAttribute[];
244
248
  images: string[];
245
249
  categoryList: number[];
246
- userDefined: any[];
247
- invMastText: any[];
250
+ userDefined: string[];
251
+ invMastText: string[];
248
252
  stock: TStock;
249
253
  };
250
254
 
@@ -293,17 +297,17 @@ type TItemDetails = {
293
297
  classId4: string | null;
294
298
  classId5: string | null;
295
299
  defaultSellingUnit: string;
296
- displayDesc: any;
300
+ displayDesc: string;
297
301
  extendedDesc: string;
298
302
  images: string[];
299
- invMastText: any[];
303
+ invMastText: string[];
300
304
  invMastUid: number;
301
305
  itemDesc: string;
302
306
  itemId: string;
303
307
  itemUom: TItemUom[];
304
308
  length: number;
305
- vndrStock: any;
306
- userDefined: any[];
309
+ vndrStock: number | null;
310
+ userDefined: string[];
307
311
  isWood: boolean;
308
312
  defaultProductGroup: string | null;
309
313
  };
@@ -320,6 +324,26 @@ type TItemRelatedProduct = TItemDetails & {
320
324
  childItemId: string;
321
325
  childImages: string[];
322
326
  };
327
+ /** Flat related product shape from the Items service (also-bought, accessories). */
328
+ type TRelatedProduct = {
329
+ invAccessoryUid: number;
330
+ parentInvMastUid: number;
331
+ childInvMastUid: number;
332
+ childItemId: string;
333
+ childItemDesc: string;
334
+ childDisplayDesc: string;
335
+ childDefaultSellingUnit: string;
336
+ classId1: string;
337
+ classId2: string;
338
+ classId3: string;
339
+ classId4: string;
340
+ classId5: string;
341
+ childItemUom: {
342
+ unitOfMeasure: string;
343
+ unitSize: number;
344
+ }[];
345
+ childImages: string[];
346
+ };
323
347
 
324
348
  type TLibraryPriceBreak = {
325
349
  calculationValue: number;
@@ -394,7 +418,7 @@ type TPriceData = {
394
418
  };
395
419
 
396
420
  type TItemsFilters = {
397
- filters: any[];
421
+ filters: Record<string, string>[];
398
422
  limit: number;
399
423
  offset: number;
400
424
  sortBy: string;
@@ -529,6 +553,75 @@ type TShippingMethod = {
529
553
  transportationCharges: number;
530
554
  };
531
555
 
556
+ type TLtlRatesResponse = {
557
+ vendorContractId: string;
558
+ vendorId: string;
559
+ vendorName: string;
560
+ transitDays: number;
561
+ estimatedDeliveryDate: string;
562
+ milesInTransit: string;
563
+ totalCharges: number;
564
+ };
565
+ type TLtlShipmentData = {
566
+ international: boolean;
567
+ fromAddressLine: string;
568
+ fromCity: string;
569
+ fromState: string;
570
+ fromPostalCode: string;
571
+ fromCountryCode: string;
572
+ fromCompanyName: string;
573
+ fromPhone: string;
574
+ fromFirstName: string;
575
+ fromLastName: string;
576
+ toAddressLine: string;
577
+ toCity: string;
578
+ toRegion: string;
579
+ toPostalCode: string;
580
+ toCountryCode: string;
581
+ toCompanyName: string;
582
+ toPhone: string;
583
+ toFirstName: string;
584
+ toLastName: string;
585
+ totalWeight: number;
586
+ handlingCharge: number;
587
+ handlingChargeUnit: string;
588
+ pickupInstructions: string;
589
+ deliveryInstructions: string;
590
+ packageLength: number;
591
+ packageWidth: number;
592
+ packageHeight: number;
593
+ dimensionUnit: string;
594
+ weightUnit: string;
595
+ quantity: number;
596
+ responseFormat: string;
597
+ version: string;
598
+ siteid: string;
599
+ };
600
+
601
+ type TSearchSuggestion = {
602
+ suggestionsUid: number;
603
+ queryStringUid: number;
604
+ suggestionsString: string;
605
+ suggestionsMetaphone: string | null;
606
+ avgTotalResults: number;
607
+ dateCreated: string;
608
+ dateLastModified: string;
609
+ updateCd: number;
610
+ statusCd: number;
611
+ processCd: number;
612
+ score: number;
613
+ };
614
+ type TSearchSuggestionsResponse = {
615
+ count: number;
616
+ data: TSearchSuggestion[];
617
+ message: string;
618
+ options: unknown[];
619
+ params: unknown[];
620
+ status: number;
621
+ total: number;
622
+ totalResults: number;
623
+ };
624
+
532
625
  type TTaxItem = {
533
626
  itemId: string;
534
627
  quantity: number;
@@ -608,4 +701,4 @@ type CacheTier = keyof typeof CACHE_CONFIG;
608
701
  */
609
702
  declare function formatPrice(price: number, locale?: string, currency?: string): string;
610
703
 
611
- export { CACHE_CONFIG, type CacheTier, type CustomerDocument, type MenuItem, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type TApiResponse, type TAttribute, type TAttributeValue, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TMetaTags, type TOrderCartLine, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TShippingMethod, type TStock, type TStockData, type TTax, type TTaxItem, type TWebDesc, formatPrice };
704
+ export { CACHE_CONFIG, type CacheTier, type CustomerDocument, type MenuItem, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type TApiResponse, type TAttribute, type TAttributeValue, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemAttributes, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TLtlRatesResponse, type TLtlShipmentData, type TMetaTags, type TOrderCartLine, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TRelatedProduct, type TSearchSuggestion, type TSearchSuggestionsResponse, type TShippingMethod, type TStock, type TStockData, type TTax, type TTaxItem, type TWebDesc, formatPrice };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleapps-com/augur-utils",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Shared types, cache configuration, and utility functions for Augur ecommerce sites",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "clsx": "^2.1.0",
33
- "tailwind-merge": "^3.0.0"
33
+ "tailwind-merge": "^2.0.0 || ^3.0.0"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "clsx": {
@@ -41,6 +41,9 @@
41
41
  }
42
42
  },
43
43
  "devDependencies": {
44
+ "@vitest/coverage-v8": "^3.2.4",
45
+ "clsx": "^2.1.1",
46
+ "tailwind-merge": "^3.5.0",
44
47
  "tsup": "^8.5.0",
45
48
  "vitest": "^3.2.0",
46
49
  "@augur-packages/tsconfig": "0.0.0"
@@ -49,7 +52,7 @@
49
52
  "build": "tsup",
50
53
  "dev": "tsup --watch",
51
54
  "lint": "eslint src/",
52
- "test": "vitest run --passWithNoTests",
55
+ "test": "vitest run --passWithNoTests --coverage",
53
56
  "typecheck": "tsc --noEmit"
54
57
  }
55
58
  }