@simpleapps-com/augur-utils 2.0.23 → 2.1.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 +10 -3
- package/llms.txt +16 -2
- package/package.json +1 -1
package/EXPORTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @simpleapps-com/augur-utils exports
|
|
2
2
|
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.21
|
|
4
4
|
|
|
5
5
|
> Auto-generated from built type declarations. Do not edit manually.
|
|
6
6
|
> Regenerate with: `pnpm run generate-exports`
|
|
@@ -15,16 +15,22 @@ Version: 2.0.9
|
|
|
15
15
|
| `BillingAddressInvoiceSchema` | const | Valibot schema for billing address with required PO number (invoice payments). |
|
|
16
16
|
| `BillingAddressSchema` | const | Valibot schema for billing address validation. |
|
|
17
17
|
| `CACHE_CONFIG` | const | Centralized cache configuration for React Query (TanStack Query) |
|
|
18
|
+
| `CONTIGUOUS_STATES` | const | Lower 48 contiguous states. |
|
|
18
19
|
| `ShippingAddressSchema` | const | Valibot schema for shipping address validation. |
|
|
19
|
-
| `
|
|
20
|
+
| `USState` | value | |
|
|
21
|
+
| `US_STATES` | const | All US states and territories — backward-compatible {code, name} shape. |
|
|
22
|
+
| `US_STATES_FULL` | const | All US states and territories — full data from states-us. |
|
|
23
|
+
| `US_TERRITORIES` | const | US territories (PR, GU, VI, AS, MP). |
|
|
20
24
|
| `VALIDATION_PATTERNS` | const | Common regex patterns used for form validation across augur-hosted sites. |
|
|
21
25
|
| `buildCheckoutPayload` | function | |
|
|
22
26
|
| `buildImageLoader` | function | Returns a loader function compatible with Next.js `<Image loader={...}>`. |
|
|
27
|
+
| `buildTrackingData` | function | Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and prices. |
|
|
23
28
|
| `cn` | value | |
|
|
24
29
|
| `createImageConfig` | function | Creates a frozen ImageConfig object. |
|
|
25
30
|
| `derivePrice` | function | Pure price derivation — usable in hooks AND server components. |
|
|
26
31
|
| `formatPrice` | function | Locale-aware currency formatting. |
|
|
27
32
|
| `generateBreadcrumbJsonLd` | function | |
|
|
33
|
+
| `generateProductJsonLd` | function | |
|
|
28
34
|
| `getBusinessDay` | function | Get the Nth business day from today (skipping weekends). |
|
|
29
35
|
| `getDefaultImageUrl` | function | Returns the default/placeholder image URL. |
|
|
30
36
|
| `getImageSrcSet` | function | Generates a `srcset` string for responsive images. |
|
|
@@ -34,6 +40,7 @@ Version: 2.0.9
|
|
|
34
40
|
| `getShippingLeadDate` | function | Get shipping lead date estimate based on days string. |
|
|
35
41
|
| `isAddressDifferent` | function | Compares a user-entered address with a SmartyStreets-validated address. |
|
|
36
42
|
| `normalizePath` | function | Normalizes an image path by: |
|
|
43
|
+
| `pushTrackingData` | function | Push ecommerce tracking data to window.dataLayer using the GA4 clear-then-push pattern. |
|
|
37
44
|
| `resolveStock` | function | Pure stock resolution -- usable in hooks AND server components. |
|
|
38
45
|
| `sanitizeHtmlImages` | function | Rewrites `<img src="...">` attributes in an HTML string to use agr.media URLs. |
|
|
39
46
|
| `serializeTransforms` | function | Serializes transform options into the CDN path segment. |
|
|
@@ -45,7 +52,7 @@ Version: 2.0.9
|
|
|
45
52
|
|
|
46
53
|
### Types
|
|
47
54
|
|
|
48
|
-
`AddToCartEventParams`, `BillingAddress`, `BreadcrumbJsonLdItem`, `CacheTier`, `CheckoutInput`, `CustomerDocument`, `DerivePriceInput`, `DerivedPrice`, `ImageConfig`, `ImageTransforms`, `ImageUrlOptions`, `MenuItem`, `OeHdr`, `OeLine`, `OrderHeader`, `OrderLine`, `OrderNote`, `OrderPayment`, `PaymentStatus`, `PaymentStatusInvoice`, `ResolveStockInput`, `ResolvedStock`, `SafeActionResult`, `SchemaAvailability`, `ShipToAddress`, `ShippingAddress`, `TAccountQuery`, `TApiResponse`, `TAttribute`, `TAttributeValue`, `TBillingUpdate`, `TCardInfo`, `TCartHdrUid`, `TCartLine`, `TCartLookUp`, `TCategory`, `TCategoryChild`, `TCategoryItemsResult`, `TCheckoutResult`, `TInvMast`, `TInvMastDoc`, `TInventorySupplier`, `TItemAccessory`, `TItemAttribute`, `TItemAttributes`, `TItemCategory`, `TItemDetails`, `TItemRelatedProduct`, `TItemUom`, `TItemsFilters`, `TJoomlaContent`, `TJoomlaContentFilters`, `TLibraryPriceBreak`, `TLibraryPriceData`, `TLtlRatesResponse`, `TLtlShipmentData`, `TMenu`, `TMenuFilters`, `TMetaTags`, `TOrderCartLine`, `TPasswordVerification`, `TPaymentValidation`, `TPriceData`, `TProductCategory`, `TProductItem`, `TProductStockData`, `TProfileValues`, `TRelatedProduct`, `TSearchSuggestion`, `TSearchSuggestionsResponse`, `TShippingMethod`, `TSmartyStreets`, `TStock`, `TStockData`, `TSurcharge`, `TTax`, `TTaxItem`, `TTransactionSetup`, `TUserProfile`, `TWebDesc`, `USStateCode`, `UserAddress`, `ViewItemEventParams`
|
|
55
|
+
`AddToCartEventParams`, `BillingAddress`, `BreadcrumbJsonLdItem`, `BuildTrackingDataInput`, `CacheTier`, `CheckoutInput`, `CheckoutPayment`, `CustomerDocument`, `DerivePriceInput`, `DerivedPrice`, `ImageConfig`, `ImageTransforms`, `ImageUrlOptions`, `MenuItem`, `OeHdr`, `OeLine`, `OrderHeader`, `OrderLine`, `OrderNote`, `OrderPayment`, `PaymentStatus`, `PaymentStatusInvoice`, `ProductJsonLdAggregateRating`, `ProductJsonLdOptions`, `ProductJsonLdSeller`, `ResolveStockInput`, `ResolvedStock`, `SafeActionResult`, `SchemaAvailability`, `ShipToAddress`, `ShippingAddress`, `TAccountQuery`, `TApiResponse`, `TAttribute`, `TAttributeValue`, `TBillingUpdate`, `TCardInfo`, `TCartHdrUid`, `TCartLine`, `TCartLookUp`, `TCategory`, `TCategoryChild`, `TCategoryItemsResult`, `TCheckoutResult`, `TInvMast`, `TInvMastDoc`, `TInventorySupplier`, `TItemAccessory`, `TItemAttribute`, `TItemAttributes`, `TItemCategory`, `TItemDetails`, `TItemRelatedProduct`, `TItemUom`, `TItemsFilters`, `TJoomlaContent`, `TJoomlaContentFilters`, `TLibraryPriceBreak`, `TLibraryPriceData`, `TLtlRatesResponse`, `TLtlShipmentData`, `TMenu`, `TMenuFilters`, `TMetaTags`, `TOrderCartLine`, `TPasswordVerification`, `TPaymentValidation`, `TPriceData`, `TProductCategory`, `TProductItem`, `TProductStockData`, `TProfileValues`, `TRelatedProduct`, `TSearchSuggestion`, `TSearchSuggestionsResponse`, `TShippingMethod`, `TSmartyStreets`, `TStock`, `TStockData`, `TSurcharge`, `TTax`, `TTaxItem`, `TTransactionSetup`, `TUserProfile`, `TWebDesc`, `TrackingData`, `TrackingItem`, `USStateCode`, `UserAddress`, `ViewItemEventParams`
|
|
49
56
|
|
|
50
57
|
```ts
|
|
51
58
|
import { BLUR_DATA_URL, BillingAddressInvoiceSchema, BillingAddressSchema } from "@simpleapps-com/augur-utils";
|
package/llms.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Shared types, cache configuration, and utility functions for Augur ecommerce sites
|
|
4
4
|
|
|
5
|
-
Version: 2.0.
|
|
5
|
+
Version: 2.0.21
|
|
6
6
|
|
|
7
7
|
## @simpleapps-com/augur-utils
|
|
8
8
|
|
|
@@ -10,16 +10,22 @@ Version: 2.0.9
|
|
|
10
10
|
- const: BillingAddressInvoiceSchema - Valibot schema for billing address with required PO number (invoice payments).
|
|
11
11
|
- const: BillingAddressSchema - Valibot schema for billing address validation.
|
|
12
12
|
- const: CACHE_CONFIG - Centralized cache configuration for React Query (TanStack Query)
|
|
13
|
+
- const: CONTIGUOUS_STATES - Lower 48 contiguous states.
|
|
13
14
|
- const: ShippingAddressSchema - Valibot schema for shipping address validation.
|
|
14
|
-
-
|
|
15
|
+
- value: USState
|
|
16
|
+
- const: US_STATES - All US states and territories — backward-compatible {code, name} shape.
|
|
17
|
+
- const: US_STATES_FULL - All US states and territories — full data from states-us.
|
|
18
|
+
- const: US_TERRITORIES - US territories (PR, GU, VI, AS, MP).
|
|
15
19
|
- const: VALIDATION_PATTERNS - Common regex patterns used for form validation across augur-hosted sites.
|
|
16
20
|
- function: buildCheckoutPayload
|
|
17
21
|
- function: buildImageLoader - Returns a loader function compatible with Next.js `<Image loader={...}>`.
|
|
22
|
+
- function: buildTrackingData - Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and prices.
|
|
18
23
|
- value: cn
|
|
19
24
|
- function: createImageConfig - Creates a frozen ImageConfig object.
|
|
20
25
|
- function: derivePrice - Pure price derivation — usable in hooks AND server components.
|
|
21
26
|
- function: formatPrice - Locale-aware currency formatting.
|
|
22
27
|
- function: generateBreadcrumbJsonLd
|
|
28
|
+
- function: generateProductJsonLd
|
|
23
29
|
- function: getBusinessDay - Get the Nth business day from today (skipping weekends).
|
|
24
30
|
- function: getDefaultImageUrl - Returns the default/placeholder image URL.
|
|
25
31
|
- function: getImageSrcSet - Generates a `srcset` string for responsive images.
|
|
@@ -29,6 +35,7 @@ Version: 2.0.9
|
|
|
29
35
|
- function: getShippingLeadDate - Get shipping lead date estimate based on days string.
|
|
30
36
|
- function: isAddressDifferent - Compares a user-entered address with a SmartyStreets-validated address.
|
|
31
37
|
- function: normalizePath - Normalizes an image path by:
|
|
38
|
+
- function: pushTrackingData - Push ecommerce tracking data to window.dataLayer using the GA4 clear-then-push pattern.
|
|
32
39
|
- function: resolveStock - Pure stock resolution -- usable in hooks AND server components.
|
|
33
40
|
- function: sanitizeHtmlImages - Rewrites `<img src="...">` attributes in an HTML string to use agr.media URLs.
|
|
34
41
|
- function: serializeTransforms - Serializes transform options into the CDN path segment.
|
|
@@ -40,8 +47,10 @@ Version: 2.0.9
|
|
|
40
47
|
- type: AddToCartEventParams
|
|
41
48
|
- type: BillingAddress
|
|
42
49
|
- type: BreadcrumbJsonLdItem
|
|
50
|
+
- type: BuildTrackingDataInput
|
|
43
51
|
- type: CacheTier
|
|
44
52
|
- type: CheckoutInput
|
|
53
|
+
- type: CheckoutPayment
|
|
45
54
|
- type: CustomerDocument
|
|
46
55
|
- type: DerivePriceInput
|
|
47
56
|
- type: DerivedPrice
|
|
@@ -57,6 +66,9 @@ Version: 2.0.9
|
|
|
57
66
|
- type: OrderPayment
|
|
58
67
|
- type: PaymentStatus
|
|
59
68
|
- type: PaymentStatusInvoice
|
|
69
|
+
- type: ProductJsonLdAggregateRating
|
|
70
|
+
- type: ProductJsonLdOptions
|
|
71
|
+
- type: ProductJsonLdSeller
|
|
60
72
|
- type: ResolveStockInput
|
|
61
73
|
- type: ResolvedStock
|
|
62
74
|
- type: SafeActionResult
|
|
@@ -117,6 +129,8 @@ Version: 2.0.9
|
|
|
117
129
|
- type: TTransactionSetup
|
|
118
130
|
- type: TUserProfile
|
|
119
131
|
- type: TWebDesc
|
|
132
|
+
- type: TrackingData
|
|
133
|
+
- type: TrackingItem
|
|
120
134
|
- type: USStateCode
|
|
121
135
|
- type: UserAddress
|
|
122
136
|
- type: ViewItemEventParams
|