@simpleapps-com/augur-utils 2026.11.1 → 2026.11.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/EXPORTS.md +5 -1
- package/dist/index.cjs +198 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +197 -22
- package/dist/index.js.map +1 -1
- package/dist/json-ld.d.ts +13 -0
- package/dist/json-ld.d.ts.map +1 -1
- package/llms.txt +5 -0
- package/package.json +1 -1
package/dist/json-ld.d.ts
CHANGED
|
@@ -5,6 +5,19 @@ export interface BreadcrumbJsonLdItem {
|
|
|
5
5
|
}
|
|
6
6
|
/** Generates a Schema.org BreadcrumbList JSON-LD object from an array of breadcrumb items. */
|
|
7
7
|
export declare function generateBreadcrumbJsonLd(items: BreadcrumbJsonLdItem[]): Record<string, unknown>;
|
|
8
|
+
/** A FAQ entry: the question and its plain-text answer, as the page shows them. */
|
|
9
|
+
export interface Faq {
|
|
10
|
+
question: string;
|
|
11
|
+
answer: string;
|
|
12
|
+
}
|
|
13
|
+
/** A breadcrumb trail's BreadcrumbList as text. */
|
|
14
|
+
export declare const breadcrumbLd: (items: BreadcrumbJsonLdItem[]) => string;
|
|
15
|
+
/** A FAQ page's FAQPage markup as text: one Question per entry. */
|
|
16
|
+
export declare const faqLd: (faqs: Faq[]) => string;
|
|
17
|
+
/** The schema.org context and a node's type: its first two members, as JSON text. */
|
|
18
|
+
export declare const nodeHead: (type: string) => string[];
|
|
19
|
+
/** A reference to another node by its @id, as JSON text. */
|
|
20
|
+
export declare const idRef: (id: string) => string;
|
|
8
21
|
export interface ProductJsonLdAggregateRating {
|
|
9
22
|
ratingValue: number;
|
|
10
23
|
reviewCount: number;
|
package/dist/json-ld.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-ld.d.ts","sourceRoot":"","sources":["../src/json-ld.ts"],"names":[],"m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7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,4BAA4B,CAAC;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAqHD,kJAAkJ;AAClJ,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,oBAAoB,GAC5B,MAAM,GAAG,IAAI,CA+Bf"}
|
package/llms.txt
CHANGED
|
@@ -26,6 +26,7 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
|
|
|
26
26
|
- const: BillingAddressInvoiceSchema - Valibot schema for billing address with required PO number (invoice payments).
|
|
27
27
|
- const: BillingAddressSchema - Valibot schema for billing address validation. Less strict than shipping: allows PO Box, no email/phone required.
|
|
28
28
|
- const: BLUR_DATA_URL - 1x1 transparent PNG for Next.js `<Image blurDataURL={...}>` placeholders.
|
|
29
|
+
- const: breadcrumbLd - A breadcrumb trail's BreadcrumbList as text.
|
|
29
30
|
- function: buildCheckoutPayload - Builds the oe_hdr + oe_line payload required by the commerce checkout API from cart data.
|
|
30
31
|
- function: buildImageLoader - Returns a loader function compatible with Next.js `<Image loader={...}>`.
|
|
31
32
|
- function: buildTrackingData - Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and prices.
|
|
@@ -36,6 +37,7 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
|
|
|
36
37
|
- const: CONTIGUOUS_STATES - Lower 48 contiguous states.
|
|
37
38
|
- function: createImageConfig - Creates a frozen ImageConfig object.
|
|
38
39
|
- function: derivePrice - Pure price derivation — usable in hooks AND server components.
|
|
40
|
+
- const: faqLd - A FAQ page's FAQPage markup as text: one Question per entry.
|
|
39
41
|
- function: formatPrice - Locale-aware currency formatting. Defaults to USD -- consumers can override locale and currency.
|
|
40
42
|
- function: generateBreadcrumbJsonLd - Generates a Schema.org BreadcrumbList JSON-LD object from an array of breadcrumb items.
|
|
41
43
|
- 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.
|
|
@@ -47,7 +49,9 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
|
|
|
47
49
|
- function: getSchemaAvailability - Maps resolved stock to a Schema.org availability URL.
|
|
48
50
|
- function: getShippingLeadDate - Get shipping lead date estimate based on days string (the table is `shippingLeadOf`).
|
|
49
51
|
- function: hasPriceBreaks - Type guard: true when `libraryPriceData` is the price-page shape with quantity `breaks`.
|
|
52
|
+
- const: idRef - A reference to another node by its @id, as JSON text.
|
|
50
53
|
- function: isAddressDifferent - Compares a user-entered address with a SmartyStreets-validated address. Returns true if any field differs (case-insensitive for address/city, exact match for state abbreviation and zip code).
|
|
54
|
+
- const: nodeHead - The schema.org context and a node's type: its first two members, as JSON text.
|
|
51
55
|
- function: normalizePath - Normalizes an image path by: 1. Returning it as-is if it starts with `http` (external URL). 2. Stripping configured prefixes (defaults: `/images`, `images`). 3. Prepending `defaultPath` for bare filenames (no `/`). 4. Stripping leading slashes.
|
|
52
56
|
- function: paginateOffset - Returns a copy of filters with offset adjusted for the given page.
|
|
53
57
|
- function: pushTrackingData - Push ecommerce tracking data to window.dataLayer using the GA4 clear-then-push pattern.
|
|
@@ -78,6 +82,7 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
|
|
|
78
82
|
- type: CustomerDocument
|
|
79
83
|
- type: DerivedPrice
|
|
80
84
|
- type: DerivePriceInput
|
|
85
|
+
- type: Faq
|
|
81
86
|
- type: ImageConfig
|
|
82
87
|
- type: ImageTransforms
|
|
83
88
|
- type: ImageUrlOptions
|