@simpleapps-com/augur-utils 2026.11.3 → 2026.11.4

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/rules.d.ts CHANGED
@@ -34,6 +34,20 @@ export declare function isBusinessDayName(dayName: string): boolean;
34
34
  export type Availability = "InStock" | "OutOfStock" | "BackOrder";
35
35
  /** In stock, else discontinued is out of stock, else back order (also with no stock record). */
36
36
  export declare function availabilityOf(isInStock: boolean, isDiscontinued: boolean): Availability;
37
+ /**
38
+ * The first key from `i` whose value is present (neither null nor undefined), or −1:
39
+ * `transformShipToAddress` reads that key ("" for −1), and a record is physical when any physical
40
+ * marker is present.
41
+ *
42
+ * @ensures exactly the model's PresentIndexFrom (PresentIndexIsFirst: present, none before it)
43
+ */
44
+ export declare function presentIndexFrom(present: boolean[], i: number): number;
45
+ /**
46
+ * `getShippingLeadDate`'s text: "from - to" when the lead has a second day, else the one date.
47
+ *
48
+ * @ensures result = from + " - " + to when hasTo, else from: the model's LeadDateText
49
+ */
50
+ export declare function leadDateText(from: string, hasTo: boolean, to: string): string;
37
51
  /** The order taker: the caller's, else "ESTORE". */
38
52
  export declare function takerOf(taker: string | undefined): string;
39
53
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAMzC,8DAA8D;AAC9D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,MAAM,GACjB,aAAa,CAQf;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAIzE;AAED,qEAAqE;AACrE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B,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKhF;AAED,kCAAkC;AAClC,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAYjD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAYrD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAI7E"}
@@ -1 +1 @@
1
- {"version":3,"file":"transform-ship-to-address.d.ts","sourceRoot":"","sources":["../src/transform-ship-to-address.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAgDzC,oIAAoI;AACpI,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,SAAS,GAAG,aAAa,CAqBpE"}
1
+ {"version":3,"file":"transform-ship-to-address.d.ts","sourceRoot":"","sources":["../src/transform-ship-to-address.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAmDzC,oIAAoI;AACpI,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,SAAS,GAAG,aAAa,CAqBpE"}
package/llms.txt CHANGED
@@ -30,7 +30,7 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
30
30
  - const: breadcrumbLd - A breadcrumb trail's BreadcrumbList as text.
31
31
  - function: buildCheckoutPayload - Builds the oe_hdr + oe_line payload required by the commerce checkout API from cart data.
32
32
  - function: buildImageLoader - Returns a loader function compatible with Next.js `<Image loader={...}>`.
33
- - function: buildTrackingData - Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and prices.
33
+ - function: buildTrackingData - Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and each line's own price.
34
34
  - const: CACHE_CONFIG - Centralized cache configuration for React Query (TanStack Query)
35
35
  - function: categorySortBy - serializeCategoryFilters' sortBy: the prefix applied only when both are non-empty.
36
36
  - function: cleanMoney - Remove JS float noise from a money product or sum.
@@ -56,6 +56,8 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
56
56
  - const: idRef - A reference to another node by its @id, as JSON text.
57
57
  - 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).
58
58
  - function: isServerRuntime - Returns true when running outside a browser (Node SSR, edge, Deno). Mirrors `isServer` in `@tanstack/query-core` (`build/modern/utils.js`). Evaluated per call, not at module scope, so `"use client"` modules that also run during SSR resolve correctly on each pass.
59
+ - function: lineHasQuantity - Whether a cart line has a quantity (augur always stores one; the type allows null).
60
+ - function: linePriceAt - Line `i`'s unit price from the per-line list (cart order): its own, fetched at its own quantity, so one item on two lines (two units of measure) keeps two prices; 0 past the end.
59
61
  - const: millis - `n` milliseconds, for a duration under a second.
60
62
  - const: millisOf - `n` as `Millis`, or null unless it is a safe integer at least 0.
61
63
  - const: minusMillis - A reading less a duration, never below 0.
@@ -63,6 +65,10 @@ The docs are at https://augur.build/docs/packages (the API reference lists every
63
65
  - const: nodeHead - The schema.org context and a node's type: its first two members, as JSON text.
64
66
  - 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.
65
67
  - function: paginateOffset - Returns a copy of filters with offset adjusted for the given page.
68
+ - function: priceQueryRuns - Whether a line's price query runs: a customer, an itemId, and a quantity (the price engine is never asked for a quantity nobody entered).
69
+ - function: priceQueryUnit - The unit of measure a line's price query asks for: the line's own, so a CASE/6 line is priced per case, not as one EACH (the price engine prices a query without a unit in the item's default selling unit); null for a missing or blank unit (a line saved before the client required one).
70
+ - function: pricingLoadingFrom - Cart pricing is loading when any query that runs is loading.
71
+ - function: pricingSettledFrom - Cart pricing is settled when every query that runs has succeeded: a line whose query never runs (no quantity, no itemId, no customer) can't hold it back (its query stays pending and idle).
66
72
  - function: pushTrackingData - Push ecommerce tracking data to window.dataLayer using the GA4 clear-then-push pattern.
67
73
  - function: resolveGcTime - Returns the React Query `gcTime` to use for a query built in this runtime. On the server returns `Infinity`, which query-core treats as "schedule no GC timer", so a per-request QueryClient is freed when the request ends. A finite value would start a timer that pins the whole request cache. In the browser returns `clientGcTime` unchanged. The result is a `number`, not `Millis`: `Infinity` is no whole number of milliseconds.
68
74
  - function: resolveStock - Pure stock resolution -- usable in hooks AND server components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleapps-com/augur-utils",
3
- "version": "2026.11.3",
3
+ "version": "2026.11.4",
4
4
  "description": "Shared types, cache configuration, and utility functions for Augur ecommerce sites",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -65,7 +65,7 @@
65
65
  "@atlas/foundation": "0.0.0",
66
66
  "@atlas/utils": "0.0.0",
67
67
  "@atlas/vitest-config": "0.0.0",
68
- "@simpleapps-com/augur-api": "2026.11.3"
68
+ "@simpleapps-com/augur-api": "2026.11.5"
69
69
  },
70
70
  "engines": {
71
71
  "node": ">=22.0.0"