@simpleapps-com/augur-utils 2.0.10 → 2.0.11

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.
Files changed (3) hide show
  1. package/EXPORTS.md +64 -0
  2. package/llms.txt +126 -0
  3. package/package.json +4 -2
package/EXPORTS.md ADDED
@@ -0,0 +1,64 @@
1
+ # @simpleapps-com/augur-utils exports
2
+
3
+ Version: 2.0.9
4
+
5
+ > Auto-generated from built type declarations. Do not edit manually.
6
+ > Regenerate with: `pnpm run generate-exports`
7
+
8
+ ## `@simpleapps-com/augur-utils`
9
+
10
+ ### Values
11
+
12
+ | Export | Kind | Description |
13
+ |--------|------|-------------|
14
+ | `BLUR_DATA_URL` | const | 1x1 transparent PNG for Next.js `<Image blurDataURL={...}>` placeholders. |
15
+ | `BillingAddressInvoiceSchema` | const | Valibot schema for billing address with required PO number (invoice payments). |
16
+ | `BillingAddressSchema` | const | Valibot schema for billing address validation. |
17
+ | `CACHE_CONFIG` | const | Centralized cache configuration for React Query (TanStack Query) |
18
+ | `ShippingAddressSchema` | const | Valibot schema for shipping address validation. |
19
+ | `US_STATES` | const | US states and territories for address validation. |
20
+ | `VALIDATION_PATTERNS` | const | Common regex patterns used for form validation across augur-hosted sites. |
21
+ | `buildCheckoutPayload` | function | |
22
+ | `buildImageLoader` | function | Returns a loader function compatible with Next.js `<Image loader={...}>`. |
23
+ | `cn` | value | |
24
+ | `createImageConfig` | function | Creates a frozen ImageConfig object. |
25
+ | `derivePrice` | function | Pure price derivation — usable in hooks AND server components. |
26
+ | `formatPrice` | function | Locale-aware currency formatting. |
27
+ | `generateBreadcrumbJsonLd` | function | |
28
+ | `getBusinessDay` | function | Get the Nth business day from today (skipping weekends). |
29
+ | `getDefaultImageUrl` | function | Returns the default/placeholder image URL. |
30
+ | `getImageSrcSet` | function | Generates a `srcset` string for responsive images. |
31
+ | `getImageUrl` | function | Builds a full agr.media URL for the given image path and transforms. |
32
+ | `getPaymentStatus` | function | |
33
+ | `getSchemaAvailability` | function | Maps resolved stock to a Schema.org availability URL. |
34
+ | `getShippingLeadDate` | function | Get shipping lead date estimate based on days string. |
35
+ | `isAddressDifferent` | function | Compares a user-entered address with a SmartyStreets-validated address. |
36
+ | `normalizePath` | function | Normalizes an image path by: |
37
+ | `resolveStock` | function | Pure stock resolution -- usable in hooks AND server components. |
38
+ | `sanitizeHtmlImages` | function | Rewrites `<img src="...">` attributes in an HTML string to use agr.media URLs. |
39
+ | `serializeTransforms` | function | Serializes transform options into the CDN path segment. |
40
+ | `trackAddToCart` | function | Track add_to_cart event to Google Analytics dataLayer. |
41
+ | `trackViewItem` | function | Track view_item event to Google Analytics dataLayer. |
42
+ | `transformShipToAddress` | function | |
43
+ | `unwrap` | function | Extracts the data from a `SafeActionResult`, throwing on error. |
44
+ | `unwrapOr` | function | Extracts the data from a `SafeActionResult`, returning `null` on error. |
45
+
46
+ ### Types
47
+
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`
49
+
50
+ ```ts
51
+ import { BLUR_DATA_URL, BillingAddressInvoiceSchema, BillingAddressSchema } from "@simpleapps-com/augur-utils";
52
+ ```
53
+
54
+ ## `@simpleapps-com/augur-utils/web`
55
+
56
+ ### Values
57
+
58
+ | Export | Kind | Description |
59
+ |--------|------|-------------|
60
+ | `cn` | function | Merge Tailwind classes without conflicts. Web only (tailwind-merge is meaningless in RN). |
61
+
62
+ ```ts
63
+ import { cn } from "@simpleapps-com/augur-utils/web";
64
+ ```
package/llms.txt ADDED
@@ -0,0 +1,126 @@
1
+ # @simpleapps-com/augur-utils
2
+
3
+ > Shared types, cache configuration, and utility functions for Augur ecommerce sites
4
+
5
+ Version: 2.0.9
6
+
7
+ ## @simpleapps-com/augur-utils
8
+
9
+ - const: BLUR_DATA_URL - 1x1 transparent PNG for Next.js `<Image blurDataURL={...}>` placeholders.
10
+ - const: BillingAddressInvoiceSchema - Valibot schema for billing address with required PO number (invoice payments).
11
+ - const: BillingAddressSchema - Valibot schema for billing address validation.
12
+ - const: CACHE_CONFIG - Centralized cache configuration for React Query (TanStack Query)
13
+ - const: ShippingAddressSchema - Valibot schema for shipping address validation.
14
+ - const: US_STATES - US states and territories for address validation.
15
+ - const: VALIDATION_PATTERNS - Common regex patterns used for form validation across augur-hosted sites.
16
+ - function: buildCheckoutPayload
17
+ - function: buildImageLoader - Returns a loader function compatible with Next.js `<Image loader={...}>`.
18
+ - value: cn
19
+ - function: createImageConfig - Creates a frozen ImageConfig object.
20
+ - function: derivePrice - Pure price derivation — usable in hooks AND server components.
21
+ - function: formatPrice - Locale-aware currency formatting.
22
+ - function: generateBreadcrumbJsonLd
23
+ - function: getBusinessDay - Get the Nth business day from today (skipping weekends).
24
+ - function: getDefaultImageUrl - Returns the default/placeholder image URL.
25
+ - function: getImageSrcSet - Generates a `srcset` string for responsive images.
26
+ - function: getImageUrl - Builds a full agr.media URL for the given image path and transforms.
27
+ - function: getPaymentStatus
28
+ - function: getSchemaAvailability - Maps resolved stock to a Schema.org availability URL.
29
+ - function: getShippingLeadDate - Get shipping lead date estimate based on days string.
30
+ - function: isAddressDifferent - Compares a user-entered address with a SmartyStreets-validated address.
31
+ - function: normalizePath - Normalizes an image path by:
32
+ - function: resolveStock - Pure stock resolution -- usable in hooks AND server components.
33
+ - function: sanitizeHtmlImages - Rewrites `<img src="...">` attributes in an HTML string to use agr.media URLs.
34
+ - function: serializeTransforms - Serializes transform options into the CDN path segment.
35
+ - function: trackAddToCart - Track add_to_cart event to Google Analytics dataLayer.
36
+ - function: trackViewItem - Track view_item event to Google Analytics dataLayer.
37
+ - function: transformShipToAddress
38
+ - function: unwrap - Extracts the data from a `SafeActionResult`, throwing on error.
39
+ - function: unwrapOr - Extracts the data from a `SafeActionResult`, returning `null` on error.
40
+ - type: AddToCartEventParams
41
+ - type: BillingAddress
42
+ - type: BreadcrumbJsonLdItem
43
+ - type: CacheTier
44
+ - type: CheckoutInput
45
+ - type: CustomerDocument
46
+ - type: DerivePriceInput
47
+ - type: DerivedPrice
48
+ - type: ImageConfig
49
+ - type: ImageTransforms
50
+ - type: ImageUrlOptions
51
+ - type: MenuItem
52
+ - type: OeHdr
53
+ - type: OeLine
54
+ - type: OrderHeader
55
+ - type: OrderLine
56
+ - type: OrderNote
57
+ - type: OrderPayment
58
+ - type: PaymentStatus
59
+ - type: PaymentStatusInvoice
60
+ - type: ResolveStockInput
61
+ - type: ResolvedStock
62
+ - type: SafeActionResult
63
+ - type: SchemaAvailability
64
+ - type: ShipToAddress
65
+ - type: ShippingAddress
66
+ - type: TAccountQuery
67
+ - type: TApiResponse
68
+ - type: TAttribute
69
+ - type: TAttributeValue
70
+ - type: TBillingUpdate
71
+ - type: TCardInfo
72
+ - type: TCartHdrUid
73
+ - type: TCartLine
74
+ - type: TCartLookUp
75
+ - type: TCategory
76
+ - type: TCategoryChild
77
+ - type: TCategoryItemsResult
78
+ - type: TCheckoutResult
79
+ - type: TInvMast
80
+ - type: TInvMastDoc
81
+ - type: TInventorySupplier
82
+ - type: TItemAccessory
83
+ - type: TItemAttribute
84
+ - type: TItemAttributes
85
+ - type: TItemCategory
86
+ - type: TItemDetails
87
+ - type: TItemRelatedProduct
88
+ - type: TItemUom
89
+ - type: TItemsFilters
90
+ - type: TJoomlaContent
91
+ - type: TJoomlaContentFilters
92
+ - type: TLibraryPriceBreak
93
+ - type: TLibraryPriceData
94
+ - type: TLtlRatesResponse
95
+ - type: TLtlShipmentData
96
+ - type: TMenu
97
+ - type: TMenuFilters
98
+ - type: TMetaTags
99
+ - type: TOrderCartLine
100
+ - type: TPasswordVerification
101
+ - type: TPaymentValidation
102
+ - type: TPriceData
103
+ - type: TProductCategory
104
+ - type: TProductItem
105
+ - type: TProductStockData
106
+ - type: TProfileValues
107
+ - type: TRelatedProduct
108
+ - type: TSearchSuggestion
109
+ - type: TSearchSuggestionsResponse
110
+ - type: TShippingMethod
111
+ - type: TSmartyStreets
112
+ - type: TStock
113
+ - type: TStockData
114
+ - type: TSurcharge
115
+ - type: TTax
116
+ - type: TTaxItem
117
+ - type: TTransactionSetup
118
+ - type: TUserProfile
119
+ - type: TWebDesc
120
+ - type: USStateCode
121
+ - type: UserAddress
122
+ - type: ViewItemEventParams
123
+
124
+ ## @simpleapps-com/augur-utils/web
125
+
126
+ - function: cn - Merge Tailwind classes without conflicts. Web only (tailwind-merge is meaningless in RN).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleapps-com/augur-utils",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "Shared types, cache configuration, and utility functions for Augur ecommerce sites",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -23,7 +23,9 @@
23
23
  },
24
24
  "sideEffects": false,
25
25
  "files": [
26
- "dist"
26
+ "dist",
27
+ "EXPORTS.md",
28
+ "llms.txt"
27
29
  ],
28
30
  "dependencies": {},
29
31
  "peerDependencies": {