@simpleapps-com/augur-utils 2.2.28 → 2.3.0

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/EXPORTS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @simpleapps-com/augur-utils exports
2
2
 
3
- Version: 2.2.10
3
+ Version: 2.2.29
4
4
 
5
5
  > Auto-generated from built type declarations. Do not edit manually.
6
6
  > Regenerate with: `pnpm run generate-exports`
@@ -22,20 +22,20 @@ Version: 2.2.10
22
22
  | `US_STATES_FULL` | const | All US states and territories — full data from states-us. |
23
23
  | `US_TERRITORIES` | const | US territories (PR, GU, VI, AS, MP). |
24
24
  | `VALIDATION_PATTERNS` | const | Common regex patterns used for form validation across augur-hosted sites. |
25
- | `buildCheckoutPayload` | function | |
25
+ | `buildCheckoutPayload` | function | Builds the oe_hdr + oe_line payload required by the commerce checkout API from cart data. |
26
26
  | `buildImageLoader` | function | Returns a loader function compatible with Next.js `<Image loader={...}>`. |
27
27
  | `buildTrackingData` | function | Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and prices. |
28
28
  | `cn` | value | |
29
29
  | `createImageConfig` | function | Creates a frozen ImageConfig object. |
30
30
  | `derivePrice` | function | Pure price derivation — usable in hooks AND server components. |
31
31
  | `formatPrice` | function | Locale-aware currency formatting. |
32
- | `generateBreadcrumbJsonLd` | function | |
33
- | `generateProductJsonLd` | function | |
32
+ | `generateBreadcrumbJsonLd` | function | Generates a Schema.org BreadcrumbList JSON-LD object from an array of breadcrumb items. |
33
+ | `generateProductJsonLd` | function | Generates a Schema.org Product JSON-LD string from an inventory document. Returns null if the item is suppressed, unnamed, or has no price. |
34
34
  | `getBusinessDay` | function | Get the Nth business day from today (skipping weekends). |
35
35
  | `getDefaultImageUrl` | function | Returns the default/placeholder image URL. |
36
36
  | `getImageSrcSet` | function | Generates a `srcset` string for responsive images. |
37
37
  | `getImageUrl` | function | Builds a full agr.media URL for the given image path and transforms. |
38
- | `getPaymentStatus` | function | |
38
+ | `getPaymentStatus` | function | Returns "Paid", "Partially Paid", or "Unpaid" based on invoice payment flags and amounts. |
39
39
  | `getSchemaAvailability` | function | Maps resolved stock to a Schema.org availability URL. |
40
40
  | `getShippingLeadDate` | function | Get shipping lead date estimate based on days string. |
41
41
  | `isAddressDifferent` | function | Compares a user-entered address with a SmartyStreets-validated address. |
@@ -49,7 +49,7 @@ Version: 2.2.10
49
49
  | `serializeTransforms` | function | Serializes transform options into the CDN path segment. |
50
50
  | `trackAddToCart` | function | Track add_to_cart event to Google Analytics dataLayer. |
51
51
  | `trackViewItem` | function | Track view_item event to Google Analytics dataLayer. |
52
- | `transformShipToAddress` | function | |
52
+ | `transformShipToAddress` | function | Normalizes a raw ship-to address object (camelCase or snake_case, physical or mailing) into a consistent ShipToAddress shape. |
53
53
  | `unwrap` | function | Extracts the data from a `SafeActionResult`, throwing on error. |
54
54
  | `unwrapOr` | function | Extracts the data from a `SafeActionResult`, returning `null` on error. |
55
55
 
package/README.md CHANGED
@@ -66,7 +66,7 @@ pnpm add @simpleapps-com/augur-utils
66
66
 
67
67
  | Export | Kind | Description |
68
68
  |--------|------|-------------|
69
- | `generateProductJsonLd` | function | |
69
+ | `generateProductJsonLd` | function | Generates a Schema.org Product JSON-LD string from an inventory document. Returns null if the item is suppressed, unnamed, or has no price. |
70
70
  | `serializeCategoryFilters` | function | Converts TItemsFilters to the SDK params shape for category item endpoints. |
71
71
  | `trackViewItem` | function | Track view_item event to Google Analytics dataLayer. |
72
72
 
@@ -76,8 +76,8 @@ pnpm add @simpleapps-com/augur-utils
76
76
  |--------|------|-------------|
77
77
  | `BillingAddressInvoiceSchema` | const | Valibot schema for billing address with required PO number (invoice payments). |
78
78
  | `BillingAddressSchema` | const | Valibot schema for billing address validation. |
79
- | `buildCheckoutPayload` | function | |
80
- | `getPaymentStatus` | function | |
79
+ | `buildCheckoutPayload` | function | Builds the oe_hdr + oe_line payload required by the commerce checkout API from cart data. |
80
+ | `getPaymentStatus` | function | Returns "Paid", "Partially Paid", or "Unpaid" based on invoice payment flags and amounts. |
81
81
 
82
82
  ### Pricing
83
83
 
@@ -96,7 +96,7 @@ pnpm add @simpleapps-com/augur-utils
96
96
 
97
97
  | Export | Kind | Description |
98
98
  |--------|------|-------------|
99
- | `generateBreadcrumbJsonLd` | function | |
99
+ | `generateBreadcrumbJsonLd` | function | Generates a Schema.org BreadcrumbList JSON-LD object from an array of breadcrumb items. |
100
100
 
101
101
  ### Shipping & Address
102
102
 
@@ -105,7 +105,7 @@ pnpm add @simpleapps-com/augur-utils
105
105
  | `ShippingAddressSchema` | const | Valibot schema for shipping address validation. |
106
106
  | `getShippingLeadDate` | function | Get shipping lead date estimate based on days string. |
107
107
  | `isAddressDifferent` | function | Compares a user-entered address with a SmartyStreets-validated address. |
108
- | `transformShipToAddress` | function | |
108
+ | `transformShipToAddress` | function | Normalizes a raw ship-to address object (camelCase or snake_case, physical or mailing) into a consistent ShipToAddress shape. |
109
109
 
110
110
  ### Stock
111
111
 
package/llms.txt CHANGED
@@ -24,7 +24,7 @@ Each package ships its own llms.txt with exports and usage patterns.
24
24
 
25
25
  > Shared types, cache configuration, and utility functions for Augur ecommerce sites
26
26
 
27
- Version: 2.2.10
27
+ Version: 2.2.29
28
28
 
29
29
  ## @simpleapps-com/augur-utils
30
30
 
@@ -39,20 +39,20 @@ Version: 2.2.10
39
39
  - const: US_STATES_FULL - All US states and territories — full data from states-us.
40
40
  - const: US_TERRITORIES - US territories (PR, GU, VI, AS, MP).
41
41
  - const: VALIDATION_PATTERNS - Common regex patterns used for form validation across augur-hosted sites.
42
- - function: buildCheckoutPayload
42
+ - function: buildCheckoutPayload - Builds the oe_hdr + oe_line payload required by the commerce checkout API from cart data.
43
43
  - function: buildImageLoader - Returns a loader function compatible with Next.js `<Image loader={...}>`.
44
44
  - function: buildTrackingData - Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and prices.
45
45
  - value: cn
46
46
  - function: createImageConfig - Creates a frozen ImageConfig object.
47
47
  - function: derivePrice - Pure price derivation — usable in hooks AND server components.
48
48
  - function: formatPrice - Locale-aware currency formatting.
49
- - function: generateBreadcrumbJsonLd
50
- - function: generateProductJsonLd
49
+ - function: generateBreadcrumbJsonLd - Generates a Schema.org BreadcrumbList JSON-LD object from an array of breadcrumb items.
50
+ - function: generateProductJsonLd - Generates a Schema.org Product JSON-LD string from an inventory document. Returns null if the item is suppressed, unnamed, or has no price.
51
51
  - function: getBusinessDay - Get the Nth business day from today (skipping weekends).
52
52
  - function: getDefaultImageUrl - Returns the default/placeholder image URL.
53
53
  - function: getImageSrcSet - Generates a `srcset` string for responsive images.
54
54
  - function: getImageUrl - Builds a full agr.media URL for the given image path and transforms.
55
- - function: getPaymentStatus
55
+ - function: getPaymentStatus - Returns "Paid", "Partially Paid", or "Unpaid" based on invoice payment flags and amounts.
56
56
  - function: getSchemaAvailability - Maps resolved stock to a Schema.org availability URL.
57
57
  - function: getShippingLeadDate - Get shipping lead date estimate based on days string.
58
58
  - function: isAddressDifferent - Compares a user-entered address with a SmartyStreets-validated address.
@@ -66,7 +66,7 @@ Version: 2.2.10
66
66
  - function: serializeTransforms - Serializes transform options into the CDN path segment.
67
67
  - function: trackAddToCart - Track add_to_cart event to Google Analytics dataLayer.
68
68
  - function: trackViewItem - Track view_item event to Google Analytics dataLayer.
69
- - function: transformShipToAddress
69
+ - function: transformShipToAddress - Normalizes a raw ship-to address object (camelCase or snake_case, physical or mailing) into a consistent ShipToAddress shape.
70
70
  - function: unwrap - Extracts the data from a `SafeActionResult`, throwing on error.
71
71
  - function: unwrapOr - Extracts the data from a `SafeActionResult`, returning `null` on error.
72
72
  - type: AddToCartEventParams
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleapps-com/augur-utils",
3
- "version": "2.2.28",
3
+ "version": "2.3.0",
4
4
  "description": "Shared types, cache configuration, and utility functions for Augur ecommerce sites",
5
5
  "license": "MIT",
6
6
  "repository": {