@asstio-dev/storefront 0.59.0 → 0.60.1

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.
@@ -1,12 +1,17 @@
1
- import { type CartLineDto, type CheckoutCartLineDto, type OrderLineDto, type ProductCardDto, type ProductCardV2Dto, type ProductDto, type ProductFacts, type SelectedVariant } from "./types.js";
1
+ import { type BrandDto, type CartLineDto, type CheckoutCartLineDto, type LeanProductFacts, type ListingBrandV2, type OrderLineDto, type ProductCardDto, type ProductCardV2Dto, type ProductDto, type ProductFacts, type SelectedVariant } from "./types.js";
2
2
  /**
3
3
  * The product facts of a card, a product page (with or without a selected variant), a cart line, a checkout cart line or an order line, so a
4
4
  * frontend never needs to know where a surface keeps them. Returns the DTO's own arrays and objects — never copies,
5
5
  * filters or mutates them. `brand` is the item's brand: a selected or purchased variant's own, with no fallback to the
6
6
  * family brand (null can mean an explicit "none"). An order line that is not a product line throws.
7
+ *
8
+ * A lean v2 listing card (recognized by a string `id`, `slug`, `sku` and `url` and an object `offer`) gives `LeanProductFacts`: its
9
+ * brand has no `logo`, an absent member reads `null`, and `categories` reads `[]` unless the listing asked for `include=categories`.
10
+ * Its `primaryCategory` is independent of `categories`. A bare variant is not a source and throws.
7
11
  */
8
12
  export declare function productFacts(source: ProductCardDto): ProductFacts;
9
- export declare function productFacts(source: ProductCardV2Dto): ProductFacts;
13
+ export declare function productFacts(source: ProductCardV2Dto): LeanProductFacts;
14
+ export declare function productFacts(source: ProductCardDto | ProductCardV2Dto): ProductFacts<BrandDto | ListingBrandV2>;
10
15
  export declare function productFacts(source: ProductDto): ProductFacts;
11
16
  export declare function productFacts(source: SelectedVariant): ProductFacts;
12
17
  export declare function productFacts(source: CartLineDto): ProductFacts;
@@ -23,14 +23,19 @@ export function productFacts(source) {
23
23
  };
24
24
  }
25
25
  const flat = source;
26
+ // A lean v2 card (lean card spec §2.3) is recognized by its required family members before a missing `categories` (no
27
+ // include=categories) defaults to `[]`; a bare variant has no `slug` and is not one.
28
+ const lean = typeof s.id === "string" && typeof s.slug === "string" && typeof s.sku === "string" && typeof s.url === "string" && isObject(s.offer);
29
+ const categories = lean ? flat.categories ?? [] : flat.categories;
26
30
  // A v2 card has no `attributes` (spec §6.9): a valid card (a string `sku`, an array `categories`) reads them as `[]`, "not supplied by
27
31
  // this representation". Anything else, and an `attributes` that is present but not an array, is not a source.
28
32
  const attributes = "attributes" in flat && flat.attributes !== undefined ? flat.attributes : typeof flat.sku === "string" ? [] : undefined;
29
- if (!Array.isArray(flat.categories) || !Array.isArray(attributes))
33
+ if (!Array.isArray(categories) || !Array.isArray(attributes))
30
34
  throw new AnalyticsError("not a product facts source");
31
35
  const short = flat.shortDescription;
36
+ const brand = flat.brand ?? null;
32
37
  return {
33
- brand: flat.brand, productBrand: flat.brand, categories: flat.categories, primaryCategory: flat.primaryCategory ?? null, attributes,
38
+ brand, productBrand: brand, categories, primaryCategory: flat.primaryCategory ?? null, attributes,
34
39
  shortDescription: short ?? null,
35
40
  };
36
41
  }
@@ -1,5 +1,10 @@
1
1
  import { type Rational } from "./decimal.js";
2
- import { type CartDto, type CategoryRefDto, type CheckoutCartDto, type Ga4Ecommerce, type Ga4Item, type Ga4ItemOptions, type Ga4ItemSource, type Ga4Purchase, type Ga4SharedOptions, type OrderDto } from "./types.js";
2
+ import { type BrandDto, type CartDto, type CartLineDto, type CategoryRefDto, type CheckoutCartDto, type CheckoutCartLineDto, type Ga4CardLike, type Ga4Ecommerce, type Ga4Item, type Ga4ItemOptions, type Ga4ItemSource, type Ga4Purchase, type Ga4SharedOptions, type LeanProductFacts, type ListingBrandV2, type OrderDto, type OrderLineDto, type ProductCardDto, type ProductCardV2Dto, type ProductFacts, type SelectedVariant } from "./types.js";
3
+ /** The facts of a source that may be either card shape: its brand is a full or a lean one. */
4
+ type AnyCardFacts = ProductFacts<BrandDto | ListingBrandV2>;
5
+ /** Options with a `pickCategory` for any facts type: the overloads pair each source with its own facts, and `mapItem` passes each
6
+ * source's own facts to it. */
7
+ type AnyItemOptions = Ga4ItemOptions<never>;
3
8
  /** An item and its exact unit price, so a payload's `value` sums exact amounts rather than re-reading floats. */
4
9
  export type MappedItem = {
5
10
  item: Ga4Item;
@@ -9,9 +14,17 @@ export type MappedItem = {
9
14
  * One GA4 item from a card (an impression: the family sku and from-price), a product with its selected variant, a cart
10
15
  * line, a checkout cart line or a product order line. `item_brand` and the categories come from `productFacts`, so they never disagree with it.
11
16
  * A source without a price throws — never `price: 0`.
17
+ *
18
+ * A card source with a `priceFrom` member reports its from-price (a v1 card, or a v2 card with `include=priceRange`). A card source
19
+ * without a `priceFrom` member reports its `offer.price` (a bare lean v2 card), under the same `tax` option and missing-side error. To
20
+ * report a concrete variant of either card shape, pass a `Ga4CardLike` with that variant's `sku` and `offer`, and the variant id as
21
+ * `itemId`. A lean v2 card's `pickCategory` receives `LeanProductFacts` (a brand without `logo`).
12
22
  */
13
- export declare function toGa4Item(source: Ga4ItemSource, opts?: Ga4ItemOptions): Ga4Item;
14
- export declare function mapItem(source: Ga4ItemSource, opts?: Ga4ItemOptions): MappedItem;
23
+ export declare function toGa4Item(source: ProductCardV2Dto, opts?: Ga4ItemOptions<LeanProductFacts>): Ga4Item;
24
+ export declare function toGa4Item(source: ProductCardDto | SelectedVariant | CartLineDto | CheckoutCartLineDto | OrderLineDto, opts?: Ga4ItemOptions): Ga4Item;
25
+ export declare function toGa4Item(source: Ga4CardLike | ProductCardDto | ProductCardV2Dto, opts?: Ga4ItemOptions<AnyCardFacts>): Ga4Item;
26
+ export declare function toGa4Item(source: Ga4ItemSource, opts?: Ga4ItemOptions<AnyCardFacts>): Ga4Item;
27
+ export declare function mapItem(source: Ga4ItemSource, opts?: AnyItemOptions): MappedItem;
15
28
  /**
16
29
  * A whole GA4 payload: `{ currency, value, items }` for a cart; plus `transaction_id`, `tax` and `shipping` for an order
17
30
  * (`purchase`). Each line keeps its own quantity and id; `index` is its position. Only product lines are items, and of a cart only the
@@ -24,3 +37,4 @@ export declare function toGa4Ecommerce(source: CheckoutCartDto, opts?: Ga4Shared
24
37
  export declare function toGa4Ecommerce(source: OrderDto, opts?: Ga4SharedOptions): Ga4Purchase;
25
38
  /** The longest path, the first of equals — the default before `primaryCategory` existed. Never mutates the array. */
26
39
  export declare function longestCategory(categories: readonly CategoryRefDto[]): CategoryRefDto | undefined;
40
+ export {};
@@ -1,11 +1,6 @@
1
1
  import { add, centsToNumber, netOf, parseDecimal, toCents, toNumber } from "./decimal.js";
2
2
  import { productFacts } from "./facts.js";
3
3
  import { AnalyticsError, } from "./types.js";
4
- /**
5
- * One GA4 item from a card (an impression: the family sku and from-price), a product with its selected variant, a cart
6
- * line, a checkout cart line or a product order line. `item_brand` and the categories come from `productFacts`, so they never disagree with it.
7
- * A source without a price throws — never `price: 0`.
8
- */
9
4
  export function toGa4Item(source, opts = {}) {
10
5
  return mapItem(source, opts).item;
11
6
  }
@@ -83,8 +78,11 @@ function lineOf(source) {
83
78
  return { id: variant.sku, name: product.name, ...pairMoney(variant.offer.price, `variant ${variant.sku}`), quantity: 1, options: variant.selectedOptions };
84
79
  }
85
80
  // A card: its from-price pair on the response's price basis (market model §8.2), never a computed amount.
81
+ // A lean v2 card without include=priceRange, or a caller's Ga4CardLike, has no `priceFrom` member: its `offer.price` is the pair.
82
+ // `priceFrom: undefined` (Ga4CardLike permits it, e.g. a spread card) reads as omitted; v1's explicit `null` keeps the missing-price error.
86
83
  const c = source;
87
- return { id: c.sku, name: c.name, ...pairMoney(c.priceFrom?.price, `product ${c.sku}`), quantity: 1, options: null };
84
+ const pair = c.priceFrom !== undefined ? c.priceFrom?.price : c.offer?.price;
85
+ return { id: c.sku, name: c.name, ...pairMoney(pair, `product ${c.sku}`), quantity: 1, options: null };
88
86
  }
89
87
  /** A pair's own sides; a partial pair (market model M35) lacks one, and an unpriced one both, which throws. */
90
88
  function pairMoney(pair, what) {
@@ -1,7 +1,9 @@
1
1
  import type { components } from "../schema";
2
+ import type { OfferLike } from "../offer.js";
2
3
  type Schemas = components["schemas"];
3
4
  export type ProductCardDto = Schemas["ProductCardDto"];
4
- /** A v2 listing card (spec §6.9): the same product facts as a v1 card, without `attributes`, `collections`, `updatedAt` and `shortDescription`. */
5
+ /** A lean v2 listing card (lean card spec §2): no `attributes`, `collections`, `updatedAt` or `shortDescription`; a member with no
6
+ * value is absent, never `null`; `categories` only with `include=categories`, the range pairs only with `include=priceRange`. */
5
7
  export type ProductCardV2Dto = Schemas["ProductCardV2Dto"];
6
8
  export type ProductDto = Schemas["ProductDto"];
7
9
  export type VariantDto = Schemas["VariantDto"];
@@ -12,6 +14,8 @@ export type OrderLineDto = Schemas["OrderLineDto"];
12
14
  export type CheckoutCartDto = Schemas["CheckoutCartDto"];
13
15
  export type CheckoutCartLineDto = Schemas["CheckoutCartLineDto"];
14
16
  export type BrandDto = Schemas["BrandDto"];
17
+ /** A lean v2 card's brand (lean card spec §2.3): a label and its links, no `logo`. */
18
+ export type ListingBrandV2 = Schemas["ListingBrandV2Dto"];
15
19
  export type CategoryRefDto = Schemas["CategoryRefDto"];
16
20
  export type AttributeDto = Schemas["AttributeDto"];
17
21
  export type PricePairDto = Schemas["PricePairDto"];
@@ -20,16 +24,19 @@ export type SelectedVariant = {
20
24
  product: ProductDto;
21
25
  variant: VariantDto;
22
26
  };
23
- /** The product facts of one source, whatever surface it came from (product facts spec §5.0). */
24
- export type ProductFacts = {
27
+ /** The product facts of one source, whatever surface it came from (product facts spec §5.0). `B` is the source's brand type: the
28
+ * full `BrandDto`, or `ListingBrandV2` (no `logo`) for a lean v2 card. */
29
+ export type ProductFacts<B = BrandDto> = {
25
30
  /** The item's brand: a card's (family) brand, else the selected or purchased variant's — never a fallback to the family's. */
26
- brand: BrandDto | null;
31
+ brand: B | null;
27
32
  /** The family brand on every source (on a card, the same as `brand`). */
28
- productBrand: BrandDto | null;
29
- /** Classification memberships with no primary meaning; `categories[0]` may be any root. */
33
+ productBrand: B | null;
34
+ /** Classification memberships with no primary meaning; `categories[0]` may be any root. A v2 listing card carries them only with
35
+ * `include=categories`; without it they read `[]`. */
30
36
  categories: CategoryRefDto[];
31
- /** The one category to use for analytics, breadcrumbs and feeds: one of `categories`, chosen by the storefront under the
32
- * site's product-taxonomy root. `null` when the site has none, the product has no category under it, or the line was frozen
37
+ /** The one category to use for analytics, breadcrumbs and feeds, chosen by the storefront under the site's product-taxonomy root.
38
+ * It is independent of `categories`: a v2 listing card carries it whether or not `include=categories` was asked for, so it may be
39
+ * present while `categories` is `[]`. `null` when the site has none, the product has no category under it, or the line was frozen
33
40
  * before it existed. */
34
41
  primaryCategory: CategoryRefDto | null;
35
42
  /** As the source carries them: a `ProductDto` may include `html` attributes; cards, cart and order lines do not. */
@@ -37,6 +44,8 @@ export type ProductFacts = {
37
44
  /** Null on order lines and checkout cart lines. */
38
45
  shortDescription: string | null;
39
46
  };
47
+ /** The facts of a lean v2 card: its brand has no `logo`. */
48
+ export type LeanProductFacts = ProductFacts<ListingBrandV2>;
40
49
  /** A source the analytics helpers cannot map: a non-product order line, an unpriced variant, an invalid quantity. */
41
50
  export declare class AnalyticsError extends Error {
42
51
  name: string;
@@ -60,8 +69,8 @@ export type Ga4Item = {
60
69
  item_list_id?: string;
61
70
  item_list_name?: string;
62
71
  };
63
- /** Options shared by every item of a payload. */
64
- export type Ga4SharedOptions = {
72
+ /** Options shared by every item of a payload. `F` is the facts type `pickCategory` receives: `LeanProductFacts` for a lean v2 card. */
73
+ export type Ga4SharedOptions<F = ProductFacts> = {
65
74
  /** `"exclude"` (default): prices and value net of VAT, as GA4 defines them. `"include"`: gross, for shops that report gross revenue. */
66
75
  tax?: "exclude" | "include";
67
76
  affiliation?: string;
@@ -69,17 +78,36 @@ export type Ga4SharedOptions = {
69
78
  itemListName?: string;
70
79
  /** Which category feeds `item_category`…`item_category5`. Default: `facts.primaryCategory`, and no category fields when it is
71
80
  * null (never a fallback: null can mean "this product has no category under the taxonomy root"). Pass `longestCategory` for
72
- * the longest path. Returning `undefined` means no category fields. The second argument is the line's own facts. */
73
- pickCategory?: (categories: readonly CategoryRefDto[], facts: ProductFacts) => CategoryRefDto | undefined;
81
+ * the longest path. Returning `undefined` means no category fields. The second argument is the line's own facts.
82
+ * `primaryCategory` and `categories` are independent: a v2 listing card carries `categories` only with `include=categories`
83
+ * (else the first argument is `[]`), so a custom membership picker on v2 cards needs that opt-in. */
84
+ pickCategory?: (categories: readonly CategoryRefDto[], facts: F) => CategoryRefDto | undefined;
74
85
  };
75
86
  /** One item's options: `quantity` overrides the source's (for add/remove events: the positive number of units added or
76
87
  * removed), `itemId` its id (e.g. for family-level reporting), `index` its position in a list. */
77
- export type Ga4ItemOptions = Ga4SharedOptions & {
88
+ export type Ga4ItemOptions<F = ProductFacts> = Ga4SharedOptions<F> & {
78
89
  quantity?: number;
79
90
  itemId?: string;
80
91
  index?: number;
81
92
  };
82
- export type Ga4ItemSource = ProductCardDto | ProductCardV2Dto | SelectedVariant | CartLineDto | CheckoutCartLineDto | OrderLineDto;
93
+ /**
94
+ * A card-shaped GA4 source built by the caller: the members `toGa4Item` reads from a card, so a consumer can report a concrete variant
95
+ * of either card shape. Pass the family's `id`, `slug`, `name` and facts with the variant's `sku`, `url` and `offer`, and the variant id
96
+ * as `itemId`. It has no `priceFrom`: it reports its `offer.price`.
97
+ */
98
+ export type Ga4CardLike = {
99
+ id: string;
100
+ slug: string;
101
+ sku: string;
102
+ name: string;
103
+ url: string;
104
+ offer: OfferLike;
105
+ brand?: BrandDto | ListingBrandV2 | null;
106
+ categories?: CategoryRefDto[] | null;
107
+ primaryCategory?: CategoryRefDto | null;
108
+ priceFrom?: undefined;
109
+ };
110
+ export type Ga4ItemSource = ProductCardDto | ProductCardV2Dto | Ga4CardLike | SelectedVariant | CartLineDto | CheckoutCartLineDto | OrderLineDto;
83
111
  /** `view_cart`, `begin_checkout` and the like. */
84
112
  export type Ga4Ecommerce = {
85
113
  currency: string;
package/dist/index.d.ts CHANGED
@@ -46,12 +46,12 @@ export type FilterSelection = NonNullable<NonNullable<paths["/v1/products"]["get
46
46
  export declare function filterQuery(selection: Record<string, string | string[] | undefined>): FilterSelection;
47
47
  export { facetScope, type FacetValuesV2Query, type ListingV2Query } from "./listing.js";
48
48
  export { decodeFilterValues, encodeFilterValues, priceFacetBasis } from "./filters.js";
49
- export { coverOffset, fileUrl, fillFactor, formatFactor, formatImage, imageRect, mediaHash, mediaUrl, MediaUrlError, pickWidth, pictureSources, posterUrl, scaledSizes, srcSet, styleToCss, videoSources, type FormatFit, type FormattedImage, type MediaConfig, type MediaDescriptor, type MediaFormat, type PictureSources, type SlotSize, type VideoSource, } from "./media.js";
49
+ export { coverOffset, fileUrl, fillFactor, formatFactor, formatImage, imageRect, mediaHash, mediaUrl, MediaUrlError, pickWidth, pictureSources, posterUrl, scaledSizes, srcSet, styleToCss, videoSources, type FormatFit, type FormattedImage, type ImageLike, type MediaConfig, type MediaDescriptor, type MediaFormat, type PictureSources, type PosterLike, type SlotSize, type VideoSource, } from "./media.js";
50
50
  export { awaitCompletion, completeCheckout, getCheckoutStatus, getOrder, liveShippingFor, startCheckout, syncCheckout, type CheckoutClient, type ShopperOption, type StartCheckoutOptions, type SyncRetryOptions, type AwaitCompletionOptions } from "./checkout/server.js";
51
51
  export { isCheckoutContextMismatch, retryAfterSeconds, type CheckoutContextMismatchError, type CheckoutDto, type CheckoutOrderRefDto, type CheckoutResult, type CheckoutShippingViewDto, type LiveShippingResult, type CheckoutStatusDto, type CheckoutWidgetDto, type OrderDto, type OrderResult, type StatusResult, type StorefrontProblem } from "./checkout/types.js";
52
52
  export { mountCheckout, type CheckoutHandle, type MountOptions, type MinimalDocument, type MinimalElement, type MinimalScript } from "./checkout/browser.js";
53
53
  export { controllers, type CheckoutController, type ProviderWindow } from "./checkout/controllers.js";
54
- export { displayPrice, isBuyable, isPriceVisible, type DisplayPrice, type OfferDto } from "./offer.js";
54
+ export { displayPrice, isBuyable, isPriceVisible, type ClaimLike, type DisplayPrice, type OfferDto, type OfferLike, type PairLike } from "./offer.js";
55
55
  export { linePriceDisplay, priceDisplay, type LinePriceDisplayOptions, type PriceDisplay, type PriceDisplayOptions, type PriceLabel, type PricePart, type PriceTexts, } from "./price-display.js";
56
56
  export { nextRevalidateSeconds } from "./site.js";
57
57
  export { breadcrumbJsonLd } from "./seo/breadcrumb.js";
@@ -67,7 +67,7 @@ export { longestCategory, toGa4Ecommerce, toGa4Item } from "./analytics/ga4.js";
67
67
  export { trackSearchEvents, type SearchEvent, type SearchEventsResponse } from "./analytics/events.js";
68
68
  export { consentNotice, type ConsentNoticeDto } from "./consent/notice.js";
69
69
  export type { ConsentCookie, Purpose, PurposeState, UnsyncedEntry } from "./consent/codec.js";
70
- export { AnalyticsError, type Ga4Ecommerce, type Ga4Item, type Ga4ItemOptions, type Ga4ItemSource, type Ga4Purchase, type Ga4SharedOptions, type ProductFacts, type SelectedVariant, } from "./analytics/types.js";
70
+ export { AnalyticsError, type Ga4CardLike, type Ga4Ecommerce, type Ga4Item, type Ga4ItemOptions, type Ga4ItemSource, type Ga4Purchase, type Ga4SharedOptions, type LeanProductFacts, type ListingBrandV2, type ProductFacts, type SelectedVariant, } from "./analytics/types.js";
71
71
  export { SeoError, type BreadcrumbLink, type CollectionHeadOptions, type HeadOptions, type JsonLd, type NextMetadataLike, type ProductJsonLdOptions, type SchemaProperty, type SeoContext, type SeoHead, type SeoMeta, type VariantAvailability, } from "./seo/types.js";
72
72
  export { readVariantParam, redirectTarget, VARIANT_PARAM, variantQueryForApi, variantUrl, type QueryInput, type VariantParam, } from "./variant.js";
73
73
  export { sortOptions, type SortOption } from "./sort.js";
package/dist/media.d.ts CHANGED
@@ -1,6 +1,35 @@
1
1
  import type { components } from "./schema";
2
2
  export type MediaDescriptor = components["schemas"]["MediaDescriptorDto"];
3
3
  export type MediaConfig = components["schemas"]["MediaDto"];
4
+ /**
5
+ * An image as the image helpers (`pickWidth`, `mediaUrl`, `srcSet`, `pictureSources`, `formatImage`) read it: a full
6
+ * `MediaDescriptor` and a lean listing thumbnail (`ListingThumbnailV2Dto`, lean card spec §2.3) are both one. An absent member
7
+ * behaves as `null` did.
8
+ */
9
+ export type ImageLike = {
10
+ id: string;
11
+ recipe: number | string;
12
+ kind: string;
13
+ widths: readonly (number | string)[];
14
+ formats: readonly string[];
15
+ w?: number | string | null;
16
+ h?: number | string | null;
17
+ focal?: {
18
+ x: number | string;
19
+ y: number | string;
20
+ } | null;
21
+ showWhole?: boolean;
22
+ bg?: string | null;
23
+ };
24
+ /** What `posterUrl` reads: a full `MediaDescriptor`, a lean listing thumbnail (a video or an animated GIF carries a poster) or a
25
+ * bare object. */
26
+ export type PosterLike = {
27
+ id: string;
28
+ recipe: number | string;
29
+ poster?: {
30
+ widths: readonly (number | string)[];
31
+ } | null;
32
+ };
4
33
  export type PictureSources = {
5
34
  sources: {
6
35
  type: string;
@@ -27,27 +56,31 @@ export declare class MediaUrlError extends Error {
27
56
  constructor(message: string);
28
57
  }
29
58
  /** The descriptor id without its `sha256:` prefix — the `{hash}` of every template. */
30
- export declare function mediaHash(d: MediaDescriptor): string;
59
+ export declare function mediaHash(d: {
60
+ id: string;
61
+ }): string;
31
62
  /** The smallest rendition at or above `width`, else the largest — only ever a width the descriptor announces. */
32
- export declare function pickWidth(d: MediaDescriptor, width: number): number;
63
+ export declare function pickWidth(d: ImageLike, width: number): number;
33
64
  /** One image URL. `format` defaults to the last one announced (jpg, or gif for an animated GIF). */
34
- export declare function mediaUrl(site: MediaConfig, d: MediaDescriptor, opts: {
65
+ export declare function mediaUrl(site: MediaConfig, d: ImageLike, opts: {
35
66
  width: number;
36
67
  format?: string;
37
68
  }): string;
38
69
  /** `srcset` over every actual width of one format. */
39
- export declare function srcSet(site: MediaConfig, d: MediaDescriptor, format: string): string;
70
+ export declare function srcSet(site: MediaConfig, d: ImageLike, format: string): string;
40
71
  /**
41
72
  * Everything a `<picture>` needs: one `<source>` per format except the last (avif first, as the feed lists it),
42
73
  * and the `<img>` in the last format with the middle width as `src`. One format ⇒ no sources, only the img (T15).
43
74
  * `sizes` is mandatory — without it the browser picks the largest candidate.
44
75
  */
45
- export declare function pictureSources(site: MediaConfig, d: MediaDescriptor, sizes: string): PictureSources;
76
+ export declare function pictureSources(site: MediaConfig, d: ImageLike, sizes: string): PictureSources;
46
77
  /** Poster (video, PDF, animated GIF): the poster template over `poster.widths`; always avif. */
47
- export declare function posterUrl(site: MediaConfig, d: MediaDescriptor, width: number): string;
48
- /** The download itself: the file template plus the sanitized filename the descriptor carries. */
78
+ export declare function posterUrl(site: MediaConfig, d: PosterLike, width: number): string;
79
+ /** The download itself: the file template plus the sanitized filename the descriptor carries. A full descriptor only: a listing
80
+ * thumbnail never has a filename. */
49
81
  export declare function fileUrl(site: MediaConfig, d: MediaDescriptor): string;
50
- /** Every encoded rendition of a video, for `<source>` elements. Empty for anything that is not a video. */
82
+ /** Every encoded rendition of a video, for `<source>` elements. Empty for anything that is not a video. A full descriptor only: a
83
+ * listing thumbnail has no playback variants (its poster and poster-frame renditions work through `posterUrl` and the image helpers). */
51
84
  export declare function videoSources(site: MediaConfig, d: MediaDescriptor): VideoSource[];
52
85
  export type FormatFit = "contain" | "cover" | "natural";
53
86
  /** One slot size of the frontend's layout (F6): `{ media: "(min-width: 1080px)", size: "25vw" }`; the last entry
@@ -124,7 +157,7 @@ export type FormattedImage = {
124
157
  * fit) → the placeholder layer and `<picture>` with `sources` and an `<img>` carrying `fallback` and `img`.
125
158
  * `slots` describes your layout's widths for the slot (F6); the SDK scales them into `sizes`.
126
159
  */
127
- export declare function formatImage(site: MediaConfig, d: MediaDescriptor, formatKey: string, slots: SlotSize[]): FormattedImage;
160
+ export declare function formatImage(site: MediaConfig, d: ImageLike, formatKey: string, slots: SlotSize[]): FormattedImage;
128
161
  /** A camelCase style object as a `style` attribute value, for plain HTML and templating engines. Meant for
129
162
  * `formatImage` output, whose values are SDK-generated or a server-validated `#rrggbb`: it does not escape, so
130
163
  * do not pass it values of your own that could hold `"`, `;` or `<`. */
package/dist/media.js CHANGED
@@ -94,13 +94,15 @@ export function posterUrl(site, d, width) {
94
94
  throw new MediaUrlError(`posterUrl: descriptor ${d.id} has no poster`);
95
95
  return fill(site, site.templates.poster, { hash: mediaHash(d), recipe: d.recipe, width: pick(d.poster.widths, width) });
96
96
  }
97
- /** The download itself: the file template plus the sanitized filename the descriptor carries. */
97
+ /** The download itself: the file template plus the sanitized filename the descriptor carries. A full descriptor only: a listing
98
+ * thumbnail never has a filename. */
98
99
  export function fileUrl(site, d) {
99
100
  if (d.kind !== "file" || !d.filename)
100
101
  throw new MediaUrlError(`fileUrl: descriptor ${d.id} is not a file`);
101
102
  return fill(site, site.templates.file, { hash: mediaHash(d), recipe: d.recipe, filename: d.filename });
102
103
  }
103
- /** Every encoded rendition of a video, for `<source>` elements. Empty for anything that is not a video. */
104
+ /** Every encoded rendition of a video, for `<source>` elements. Empty for anything that is not a video. A full descriptor only: a
105
+ * listing thumbnail has no playback variants (its poster and poster-frame renditions work through `posterUrl` and the image helpers). */
104
106
  export function videoSources(site, d) {
105
107
  if (d.kind !== "video" || !d.variants)
106
108
  return [];
package/dist/offer.d.ts CHANGED
@@ -1,5 +1,42 @@
1
1
  import type { components } from "./schema";
2
- export type OfferDto = components["schemas"]["OfferDto"];
2
+ type Schemas = components["schemas"];
3
+ export type OfferDto = Schemas["OfferDto"];
4
+ /**
5
+ * A price pair as the price helpers read it: its currency and the known sides. A full `PricePairDto` and a lean listing pair
6
+ * (`ListingPriceV2Dto`, lean card spec §2.3) are both one. A slim input promises no tax strings and no tax components.
7
+ */
8
+ export type PairLike = {
9
+ currency: string;
10
+ inc?: string | null;
11
+ ex?: string | null;
12
+ };
13
+ /** A price claim as the price helpers read it: a full `PriceClaimDto` and a lean `ListingClaimV2Dto` are both one. */
14
+ export type ClaimLike = {
15
+ labelKey: string;
16
+ percent: number;
17
+ amountOff: PairLike;
18
+ endsAt?: string | null;
19
+ claimEndsAt?: string | null;
20
+ };
21
+ /**
22
+ * An offer as the price helpers read it: only the members they read, each optional and nullable where either shape may leave it out,
23
+ * so a full `OfferDto`, a lean `ListingOfferV2Dto` (lean card spec §2.3) and their union are all one. A lean sale carries no `price`
24
+ * of its own: the sale's price is the offer's `price`.
25
+ */
26
+ export type OfferLike = {
27
+ offerStatus: Schemas["OfferStatusDto"];
28
+ displayBasis: Schemas["DisplayBasisDto"];
29
+ purchaseStatus?: Schemas["PurchaseStatusDto"] | null;
30
+ price?: PairLike | null;
31
+ compareAt?: PairLike | null;
32
+ regular?: PairLike | null;
33
+ reference?: PairLike | null;
34
+ sale?: {
35
+ validTo?: string | null;
36
+ extendedFrom?: string | null;
37
+ } | null;
38
+ claim?: ClaimLike | null;
39
+ };
3
40
  /** One amount to show, on the basis the API chose for this context. */
4
41
  export type DisplayPrice = {
5
42
  amount: string;
@@ -7,10 +44,11 @@ export type DisplayPrice = {
7
44
  currency: string;
8
45
  };
9
46
  /** The amount to show (market model §8.2): the offer's `displayBasis` side of its pair, as the API sent it. Null when the offer is not
10
- * `available`, or when the pair lacks that side: never the other side, and never a computed amount. */
11
- export declare function displayPrice(offer: OfferDto): DisplayPrice | null;
12
- /** Whether a price can be shown: a partial price can be, and still not be buyable. */
13
- export declare function isPriceVisible(offer: OfferDto): boolean;
47
+ * `available`, or when the pair lacks that side: never the other side, and never a computed amount. Takes a full or a lean offer. */
48
+ export declare function displayPrice(offer: OfferLike): DisplayPrice | null;
49
+ /** Whether a price can be shown: a partial price can be, and still not be buyable. Takes a full or a lean offer. */
50
+ export declare function isPriceVisible(offer: OfferLike): boolean;
14
51
  /** Whether the buy button works: the offer is `available` and so is its `purchaseStatus`, which already folds in permission, freshness,
15
- * sellability and a complete price. Never read stock or the price for this. */
16
- export declare function isBuyable(offer: OfferDto): boolean;
52
+ * sellability and a complete price. Never read stock or the price for this. Takes a full or a lean offer. */
53
+ export declare function isBuyable(offer: OfferLike): boolean;
54
+ export {};
package/dist/offer.js CHANGED
@@ -1,17 +1,17 @@
1
1
  /** The amount to show (market model §8.2): the offer's `displayBasis` side of its pair, as the API sent it. Null when the offer is not
2
- * `available`, or when the pair lacks that side: never the other side, and never a computed amount. */
2
+ * `available`, or when the pair lacks that side: never the other side, and never a computed amount. Takes a full or a lean offer. */
3
3
  export function displayPrice(offer) {
4
4
  if (offer.offerStatus !== "available")
5
5
  return null;
6
6
  const amount = offer.price?.[offer.displayBasis];
7
7
  return amount ? { amount, basis: offer.displayBasis, currency: offer.price.currency } : null;
8
8
  }
9
- /** Whether a price can be shown: a partial price can be, and still not be buyable. */
9
+ /** Whether a price can be shown: a partial price can be, and still not be buyable. Takes a full or a lean offer. */
10
10
  export function isPriceVisible(offer) {
11
11
  return displayPrice(offer) !== null;
12
12
  }
13
13
  /** Whether the buy button works: the offer is `available` and so is its `purchaseStatus`, which already folds in permission, freshness,
14
- * sellability and a complete price. Never read stock or the price for this. */
14
+ * sellability and a complete price. Never read stock or the price for this. Takes a full or a lean offer. */
15
15
  export function isBuyable(offer) {
16
16
  return offer.offerStatus === "available" && offer.purchaseStatus === "available";
17
17
  }
@@ -1,7 +1,5 @@
1
1
  import type { components } from "./schema";
2
- type OfferDto = components["schemas"]["OfferDto"];
3
- type PricePairDto = components["schemas"]["PricePairDto"];
4
- type SalePriceDto = components["schemas"]["SalePriceDto"];
2
+ import type { OfferLike } from "./offer.js";
5
3
  type CartLineDto = components["schemas"]["CartLineDto"];
6
4
  type CheckoutCartLineDto = components["schemas"]["CheckoutCartLineDto"];
7
5
  type OrderLineDto = components["schemas"]["OrderLineDto"];
@@ -61,11 +59,12 @@ export type LinePriceDisplayOptions = PriceDisplayOptions & {
61
59
  };
62
60
  /** The language of the default texts: `sv`, else English. */
63
61
  export declare const language: (locale: string | undefined) => "sv" | "en";
64
- /** The sale that applies at `now`, or null: a sale whose exclusive `validTo` has passed is dropped (C8). */
65
- export declare function liveSale(offer: OfferDto, now: Date): SalePriceDto | null;
62
+ /** The sale that applies at `now`, or null: a sale whose exclusive `validTo` has passed is dropped (C8). Returns the input's own
63
+ * sale, so a full offer's caller keeps `SalePriceDto` and a lean offer's `ListingSaleV2Dto` (which has no `price`). */
64
+ export declare function liveSale<O extends OfferLike>(offer: O, now: Date): NonNullable<O["sale"]> | null;
66
65
  /** The pair charged at `now`: the offer's price, or `regular` once its sale has ended (a page served from a cache past the
67
- * end). Null when the offer is not `available`. */
68
- export declare function currentPair(offer: OfferDto, now: Date): PricePairDto | null;
66
+ * end). Null when the offer is not `available`. Returns the input's own pair, so a full offer's caller keeps `PricePairDto`. */
67
+ export declare function currentPair<O extends OfferLike>(offer: O, now: Date): NonNullable<O["price"] | O["regular"]> | null;
69
68
  /**
70
69
  * The price of an offer as parts (C8). Render every price through this on the request, with the request's `now`:
71
70
  * - a `sale` whose `validTo` ≤ now is dropped, and with it the offer's `claim`: `price` is then `regular`;
@@ -73,8 +72,11 @@ export declare function currentPair(offer: OfferDto, now: Date): PricePairDto |
73
72
  * - `rrp` (`compareAt`) shows only with no live sale and no claim shown: never beside a sale, claim or not
74
73
  * (Kristoffer 2026-11-13).
75
74
  * - `endsAt` is the exclusive end: show the date of `endsAt − 1 s` in the site's time zone.
75
+ *
76
+ * Takes a full `OfferDto`, a lean listing offer (`ListingOfferV2Dto`, lean card spec §2.5) or their union: it reads only the members
77
+ * of `OfferLike`, and an absent member behaves as `null` did.
76
78
  */
77
- export declare function priceDisplay(offer: OfferDto, opts: PriceDisplayOptions): PriceDisplay;
79
+ export declare function priceDisplay(offer: OfferLike, opts: PriceDisplayOptions): PriceDisplay;
78
80
  /**
79
81
  * A line's unit price as parts (C8): the unit price charged, and its `claim` striking its `reference` (never
80
82
  * `unitPriceBeforePromotions`). A cart line is live: its claim drops once `endsAt` or `claimEndsAt` ≤ now. A checkout or
@@ -21,19 +21,20 @@ const part = (pair, basis) => {
21
21
  const amount = pair?.[basis];
22
22
  return amount ? { amount, basis, currency: pair.currency } : null;
23
23
  };
24
- /** The sale that applies at `now`, or null: a sale whose exclusive `validTo` has passed is dropped (C8). */
24
+ /** The sale that applies at `now`, or null: a sale whose exclusive `validTo` has passed is dropped (C8). Returns the input's own
25
+ * sale, so a full offer's caller keeps `SalePriceDto` and a lean offer's `ListingSaleV2Dto` (which has no `price`). */
25
26
  export function liveSale(offer, now) {
26
- const sale = offer.sale ?? null;
27
+ const sale = (offer.sale ?? null);
27
28
  return sale !== null && before(sale.validTo, now) ? sale : null;
28
29
  }
29
30
  /** The pair charged at `now`: the offer's price, or `regular` once its sale has ended (a page served from a cache past the
30
- * end). Null when the offer is not `available`. */
31
+ * end). Null when the offer is not `available`. Returns the input's own pair, so a full offer's caller keeps `PricePairDto`. */
31
32
  export function currentPair(offer, now) {
32
33
  if (offer.offerStatus !== "available")
33
34
  return null;
34
35
  if (offer.sale != null && liveSale(offer, now) === null)
35
- return offer.regular ?? null;
36
- return offer.price ?? null;
36
+ return (offer.regular ?? null);
37
+ return (offer.price ?? null);
37
38
  }
38
39
  const NO_CLAIM = { struck: null, badge: null, saving: null };
39
40
  /** A claim strikes its `reference`, never anything else; without the reference amount or a label text it shows nothing. */
@@ -58,6 +59,9 @@ const empty = () => ({ price: null, ...NO_CLAIM, rrp: null, endsAt: null, extend
58
59
  * - `rrp` (`compareAt`) shows only with no live sale and no claim shown: never beside a sale, claim or not
59
60
  * (Kristoffer 2026-11-13).
60
61
  * - `endsAt` is the exclusive end: show the date of `endsAt − 1 s` in the site's time zone.
62
+ *
63
+ * Takes a full `OfferDto`, a lean listing offer (`ListingOfferV2Dto`, lean card spec §2.5) or their union: it reads only the members
64
+ * of `OfferLike`, and an absent member behaves as `null` did.
61
65
  */
62
66
  export function priceDisplay(offer, opts) {
63
67
  const out = empty();
package/dist/schema.d.ts CHANGED
@@ -1159,6 +1159,24 @@ export interface components {
1159
1159
  sku: string;
1160
1160
  url: null | string;
1161
1161
  };
1162
+ CardVariantV2Dto: {
1163
+ attributes: components["schemas"]["ListingAttributeV2Dto"][];
1164
+ /** @description Whether the variant has a gallery of its own; independent of image. With false the card shows the product's image; with true and no image (a gallery of hover or lifestyle media only) it shows none of the variant's own. */
1165
+ hasOwnImages: boolean;
1166
+ id: string;
1167
+ /** @description The variant's own display thumbnail, present exactly when it has one. Absent when it has none. */
1168
+ image?: components["schemas"]["ListingThumbnailV2Dto"];
1169
+ /** @description The variant's own name. Absent when it has none. */
1170
+ name?: string;
1171
+ /** @description The variant's own offer, never inferred from the card's. */
1172
+ offer: components["schemas"]["ListingOfferV2Dto"];
1173
+ selectedOptions: {
1174
+ [key: string]: string;
1175
+ };
1176
+ sku: string;
1177
+ /** @description The variant's page URL. Absent when the variant has no page of its own in the context. */
1178
+ url?: string;
1179
+ };
1162
1180
  CartCodeDto: {
1163
1181
  code: string;
1164
1182
  promotion: components["schemas"]["PromotionRefDto"];
@@ -1689,6 +1707,99 @@ export interface components {
1689
1707
  LinePromotionDto: {
1690
1708
  effectId: string;
1691
1709
  };
1710
+ ListingAttributeV2Dto: {
1711
+ /** @description The facet sharing the attribute's source. Absent when there is none. */
1712
+ facetKey?: string;
1713
+ /** @description The html of an attribute of type html. Absent otherwise. */
1714
+ html?: string;
1715
+ key: string;
1716
+ label: string;
1717
+ type: string;
1718
+ /** @description A single-valued attribute's value. Absent on a list. */
1719
+ value?: string;
1720
+ /** @description The filter keys aligned with values (or the single value's key). Absent when any value has no key of its own. */
1721
+ valueKeys?: string[];
1722
+ /** @description A list attribute's values. Absent on a single value. */
1723
+ values?: string[];
1724
+ };
1725
+ ListingBrandV2Dto: {
1726
+ /** @description A filter link (filter[key]=valueKey) when the shop has a brand facet. Absent otherwise. */
1727
+ facet?: components["schemas"]["ListingFacetLinkV2Dto"];
1728
+ /** @description The brand's id. Absent only on a catalog built before brands. */
1729
+ id?: string;
1730
+ label: string;
1731
+ /** @description The brand's slug. Absent only on a catalog built before brands. */
1732
+ slug?: string;
1733
+ /** @description The brand page on this market. Absent when that page would not resolve here. */
1734
+ url?: string;
1735
+ };
1736
+ ListingClaimV2Dto: {
1737
+ /** @description The difference to reference in the offer's currency; ex is absent (status partial) when the reference has no ex side. Not a tax fact. */
1738
+ amountOff: components["schemas"]["ListingPriceV2Dto"];
1739
+ /**
1740
+ * Format: date-time
1741
+ * @description When the claim may no longer be made. Absent when it may be made beyond the sale's first 30 days.
1742
+ */
1743
+ claimEndsAt?: string;
1744
+ /**
1745
+ * Format: date-time
1746
+ * @description The sale's exclusive display end. Absent for an open-ended sale.
1747
+ */
1748
+ endsAt?: string;
1749
+ labelKey: string;
1750
+ /** Format: int32 */
1751
+ percent: number;
1752
+ /** Format: date-time */
1753
+ since: string;
1754
+ };
1755
+ ListingFacetLinkV2Dto: {
1756
+ key: string;
1757
+ valueKey: string;
1758
+ };
1759
+ ListingFocalV2Dto: {
1760
+ /** Format: double */
1761
+ x: number;
1762
+ /** Format: double */
1763
+ y: number;
1764
+ };
1765
+ ListingOfferV2Dto: {
1766
+ /** @description The honest price claim against reference; only a claim may strike a price. Drop it once endsAt or claimEndsAt has passed. Absent when no claim may be made. */
1767
+ claim?: components["schemas"]["ListingClaimV2Dto"];
1768
+ /** @description The recommended price, when the shop has one. Never shown while sale is present. Absent otherwise. */
1769
+ compareAt?: components["schemas"]["ListingPriceV2Dto"];
1770
+ displayBasis: components["schemas"]["DisplayBasisDto"];
1771
+ offerStatus: components["schemas"]["OfferStatusDto"];
1772
+ /** @description The price shown and charged now: the sale price while a sale step applies. Absent when no price is shown in the context. */
1773
+ price?: components["schemas"]["ListingPriceV2Dto"];
1774
+ purchaseStatus: components["schemas"]["PurchaseStatusDto"];
1775
+ /** @description The sale's reference price (the lowest price before the reduction), when one can be proven, beside a shown price. inc minus ex is not a tax amount here. Absent otherwise. */
1776
+ reference?: components["schemas"]["ListingPriceV2Dto"];
1777
+ /** @description The regular price, present together with sale while a sale step applies to the offer. Absent otherwise. */
1778
+ regular?: components["schemas"]["ListingPriceV2Dto"];
1779
+ /** @description The sale step that applies now, present together with regular. The sale's price is price. Absent when no sale step applies. */
1780
+ sale?: components["schemas"]["ListingSaleV2Dto"];
1781
+ /** @description Stock as the shopper may see it. */
1782
+ stock: components["schemas"]["ListingStockV2Dto"];
1783
+ };
1784
+ ListingPosterV2Dto: {
1785
+ formats: string[];
1786
+ widths: number[];
1787
+ };
1788
+ ListingPriceEndV2Dto: {
1789
+ price: components["schemas"]["ListingPriceV2Dto"];
1790
+ variantId: string;
1791
+ };
1792
+ ListingPriceV2Dto: {
1793
+ currency: string;
1794
+ /** @description The amount excluding tax. Present only when status is complete. */
1795
+ ex?: string;
1796
+ /** @description The amount including tax, a decimal string in the currency's exponent. Absent when status is unavailable. */
1797
+ inc?: string;
1798
+ /** @description complete (both sides known), partial (only inc known) or unavailable (no amount). */
1799
+ status: components["schemas"]["PriceStatusDto"];
1800
+ /** @description Present only when the price is not taxable: reverseCharge, export or exempt. Absent means taxable. */
1801
+ taxTreatment?: components["schemas"]["TaxTreatmentDto"];
1802
+ };
1692
1803
  ListingResponse: {
1693
1804
  appliedFilters: components["schemas"]["AppliedFilterDto"][];
1694
1805
  context: components["schemas"]["ContextDto"];
@@ -1707,6 +1818,66 @@ export interface components {
1707
1818
  total: number | string;
1708
1819
  warnings: components["schemas"]["WarningDto"][];
1709
1820
  };
1821
+ ListingSaleV2Dto: {
1822
+ /**
1823
+ * Format: date-time
1824
+ * @description When the sale was extended; only beside a reference. Absent otherwise.
1825
+ */
1826
+ extendedFrom?: string;
1827
+ /** @description The promotion's public label. Absent when it has none. */
1828
+ label?: string;
1829
+ /**
1830
+ * Format: date-time
1831
+ * @description When the applied sale step started. Absent when unknown.
1832
+ */
1833
+ validFrom?: string;
1834
+ /**
1835
+ * Format: date-time
1836
+ * @description The sale's exclusive display end: show it while now < validTo. Absent for an open-ended sale.
1837
+ */
1838
+ validTo?: string;
1839
+ };
1840
+ ListingStockV2Dto: {
1841
+ /**
1842
+ * Format: int32
1843
+ * @description Whole units in stock, present (0 included) only under the company quantity permission of the shop's offer policy. Absent otherwise.
1844
+ */
1845
+ quantity?: number;
1846
+ status: components["schemas"]["StockStatusDto"];
1847
+ };
1848
+ ListingThumbnailV2Dto: {
1849
+ /** @description Alternative text per language; possibly {}. Fall back to the product name. */
1850
+ alt: {
1851
+ [key: string]: string;
1852
+ };
1853
+ /** @description The background class the image format's background maps. Absent when unknown. */
1854
+ bg?: string;
1855
+ /** @description A blurred placeholder. Absent when unknown. */
1856
+ blurhash?: string;
1857
+ /** @description The dominant colour. Absent when unknown. */
1858
+ color?: string;
1859
+ /** @description The focal point of a cover crop. Absent means the centre. */
1860
+ focal?: components["schemas"]["ListingFocalV2Dto"];
1861
+ formats: string[];
1862
+ /**
1863
+ * Format: int32
1864
+ * @description The original height. Absent when unknown.
1865
+ */
1866
+ h?: number;
1867
+ id: string;
1868
+ kind: string;
1869
+ /** @description The poster renditions, present whenever the descriptor has one: a video or an animated GIF. Absent otherwise. */
1870
+ poster?: components["schemas"]["ListingPosterV2Dto"];
1871
+ /** Format: int32 */
1872
+ recipe: number;
1873
+ showWhole: boolean;
1874
+ /**
1875
+ * Format: int32
1876
+ * @description The original width. Absent when unknown.
1877
+ */
1878
+ w?: number;
1879
+ widths: number[];
1880
+ };
1710
1881
  ListingV2Response: {
1711
1882
  /** @description The selections in effect, as chips: source filter for the request's filters, query for what the search text selected, group for an applied named group (remove it by dropping group[facet]). */
1712
1883
  appliedFilters: components["schemas"]["AppliedFilterDto"][];
@@ -1989,6 +2160,19 @@ export interface components {
1989
2160
  popularGen: number | string;
1990
2161
  reason: string;
1991
2162
  };
2163
+ PlacementV2Dto: {
2164
+ available: boolean;
2165
+ /**
2166
+ * Format: date-time
2167
+ * @description When the product first went live. Absent when unknown.
2168
+ */
2169
+ firstLiveAt?: string;
2170
+ /** Format: float */
2171
+ popular: number;
2172
+ /** Format: int64 */
2173
+ popularGen: number;
2174
+ reason: string;
2175
+ };
1992
2176
  PriceBasisDto: {
1993
2177
  currency: string;
1994
2178
  scope: string;
@@ -2074,28 +2258,30 @@ export interface components {
2074
2258
  variants?: components["schemas"]["CardVariantDto"][] | null;
2075
2259
  };
2076
2260
  ProductCardV2Dto: {
2077
- /** @description The product's brand, or null. */
2078
- brand: null | components["schemas"]["BrandDto"];
2079
- /** @description The product's categories, named in the request's language; always an array, in no meaningful order. */
2080
- categories: components["schemas"]["CategoryRefDto"][];
2261
+ /** @description The product's brand. Absent when it has none. */
2262
+ brand?: components["schemas"]["ListingBrandV2Dto"];
2263
+ /** @description Only with include=categories, and then always an array (possibly empty): every category membership with its full path, named in the request's language, in no meaningful order. Absent without include=categories. */
2264
+ categories?: components["schemas"]["CategoryRefDto"][];
2081
2265
  /** @description The product's id. */
2082
2266
  id: string;
2083
- /** @description The product's display image, or null. */
2084
- image: null | components["schemas"]["MediaDescriptorDto"];
2085
- /** @description With include=matchedVariant and a variant-level condition in effect (a variant facet value or group, the in-stock filter, or listings of orderable products only): the cheapest variant that can be ordered and matches every variant filter, by regular price; its offer is the request-time offer, which can be a sale price. */
2086
- matchedVariant?: components["schemas"]["CardVariantDto"];
2267
+ /** @description The product's display thumbnail (primary, else first gallery, else first swatch). Absent when it has none. */
2268
+ image?: components["schemas"]["ListingThumbnailV2Dto"];
2269
+ /** @description Only with include=matchedVariant and a variant-level condition in effect (a variant facet value or group, the in-stock filter, or listings of orderable products only): the cheapest variant that can be ordered and matches every variant filter, by regular price, with its own offer (the request-time offer, which can be a sale price) and URL. It can lie outside a cut variants list. Absent when no variant qualifies, and without include=matchedVariant. */
2270
+ matchedVariant?: components["schemas"]["CardVariantV2Dto"];
2087
2271
  /** @description The product's name in the request's language. */
2088
2272
  name: string;
2089
- /** @description The card's offer in the request's context, priced at request time: it can show a sale price. */
2090
- offer: components["schemas"]["OfferDto"];
2273
+ /** @description The family's offer in the request's context, priced at request time: it can show a sale price. */
2274
+ offer: components["schemas"]["ListingOfferV2Dto"];
2091
2275
  /** @description Preview keys only: why the card stands where it does (reason pinned, keepVisible or base). Absent otherwise. */
2092
- placement?: components["schemas"]["PlacementDto"];
2093
- /** @description The lowest price on priceBasis.tax, one variant's whole pair; null when the offer shows no price. */
2094
- priceFrom: null | components["schemas"]["PriceFromDto"];
2095
- /** @description The highest price on priceBasis.tax, one variant's whole pair; null when the offer shows no price. Render "from" when priceFrom and priceTo differ. */
2096
- priceTo: null | components["schemas"]["PriceFromDto"];
2097
- /** @description The one category to use for analytics and breadcrumbs, or null. */
2098
- primaryCategory: null | components["schemas"]["CategoryRefDto"];
2276
+ placement?: components["schemas"]["PlacementV2Dto"];
2277
+ /** @description Only with include=priceRange: the lowest price on priceBasis.tax, one variant's pair. Absent when no price is shown here, and without include=priceRange. */
2278
+ priceFrom?: components["schemas"]["ListingPriceEndV2Dto"];
2279
+ /** @description Only with include=priceRange: the highest price on priceBasis.tax, one variant's pair. Absent when no price is shown here, and without include=priceRange. */
2280
+ priceTo?: components["schemas"]["ListingPriceEndV2Dto"];
2281
+ /** @description Whether the family's lowest and highest prices on priceBasis.tax differ: true means render "from" with offer.price. Absent when either end is unknown or no price is shown here, whatever include asks for. Never derive the family's range from variants: a cut list can miss either end. */
2282
+ priceVaries?: boolean;
2283
+ /** @description The one category to use for analytics and breadcrumbs. Absent when there is none. */
2284
+ primaryCategory?: components["schemas"]["CategoryRefDto"];
2099
2285
  /** @description The product's article number. */
2100
2286
  sku: string;
2101
2287
  /** @description The product's slug in the request's language. */
@@ -2104,11 +2290,11 @@ export interface components {
2104
2290
  url: string;
2105
2291
  /**
2106
2292
  * Format: int32
2107
- * @description With include=variants: all visible variants; larger than variants' length when the list was cut.
2293
+ * @description Only with include=variants: all visible variants; larger than variants' length when the list was cut. Absent without include=variants.
2108
2294
  */
2109
2295
  variantCount?: number;
2110
- /** @description With include=variants: the variants visible here, by position, at most the site's card variant count (default 12). */
2111
- variants?: components["schemas"]["CardVariantDto"][];
2296
+ /** @description Only with include=variants, and then always an array (possibly empty): the variants visible here, by position, at most the site's card variant count (default 12). Absent without include=variants. */
2297
+ variants?: components["schemas"]["CardVariantV2Dto"][];
2112
2298
  };
2113
2299
  ProductDto: {
2114
2300
  alternates: components["schemas"]["AlternateDto"][];
@@ -8794,7 +8980,7 @@ export interface operations {
8794
8980
  group?: {
8795
8981
  [key: string]: string;
8796
8982
  };
8797
- /** @description Comma list. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount) and matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter). Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
8983
+ /** @description Comma list, case-sensitive; a repeated value counts once. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount), matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter), categories (each card's category memberships with their full paths) and priceRange (each card's priceFrom and priceTo). A card member that is not asked for is absent. Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
8798
8984
  include?: string;
8799
8985
  };
8800
8986
  header: {
@@ -8903,7 +9089,7 @@ export interface operations {
8903
9089
  group?: {
8904
9090
  [key: string]: string;
8905
9091
  };
8906
- /** @description Comma list. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount) and matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter). Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
9092
+ /** @description Comma list, case-sensitive; a repeated value counts once. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount), matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter), categories (each card's category memberships with their full paths) and priceRange (each card's priceFrom and priceTo). A card member that is not asked for is absent. Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
8907
9093
  include?: string;
8908
9094
  /** @description One collection, by the id the API returns or by the collection's own slug; a slash path names nothing. An id wins over a slug that looks like it; follow-up requests use the returned id. An unknown one is answered with a COLLECTION_UNKNOWN warning and narrows nothing, not a 404. */
8909
9095
  collection?: string;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.59.0";
1
+ export declare const SDK_VERSION = "0.60.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/version-file.mjs from package.json; do not edit or commit.
2
- export const SDK_VERSION = "0.59.0";
2
+ export const SDK_VERSION = "0.60.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asstio-dev/storefront",
3
- "version": "0.59.0",
3
+ "version": "0.60.1",
4
4
  "description": "Typed client for the Asstio Storefront API (generated from OpenAPI).",
5
5
  "repository": {
6
6
  "type": "git",
package/src/schema.d.ts CHANGED
@@ -1159,6 +1159,24 @@ export interface components {
1159
1159
  sku: string;
1160
1160
  url: null | string;
1161
1161
  };
1162
+ CardVariantV2Dto: {
1163
+ attributes: components["schemas"]["ListingAttributeV2Dto"][];
1164
+ /** @description Whether the variant has a gallery of its own; independent of image. With false the card shows the product's image; with true and no image (a gallery of hover or lifestyle media only) it shows none of the variant's own. */
1165
+ hasOwnImages: boolean;
1166
+ id: string;
1167
+ /** @description The variant's own display thumbnail, present exactly when it has one. Absent when it has none. */
1168
+ image?: components["schemas"]["ListingThumbnailV2Dto"];
1169
+ /** @description The variant's own name. Absent when it has none. */
1170
+ name?: string;
1171
+ /** @description The variant's own offer, never inferred from the card's. */
1172
+ offer: components["schemas"]["ListingOfferV2Dto"];
1173
+ selectedOptions: {
1174
+ [key: string]: string;
1175
+ };
1176
+ sku: string;
1177
+ /** @description The variant's page URL. Absent when the variant has no page of its own in the context. */
1178
+ url?: string;
1179
+ };
1162
1180
  CartCodeDto: {
1163
1181
  code: string;
1164
1182
  promotion: components["schemas"]["PromotionRefDto"];
@@ -1689,6 +1707,99 @@ export interface components {
1689
1707
  LinePromotionDto: {
1690
1708
  effectId: string;
1691
1709
  };
1710
+ ListingAttributeV2Dto: {
1711
+ /** @description The facet sharing the attribute's source. Absent when there is none. */
1712
+ facetKey?: string;
1713
+ /** @description The html of an attribute of type html. Absent otherwise. */
1714
+ html?: string;
1715
+ key: string;
1716
+ label: string;
1717
+ type: string;
1718
+ /** @description A single-valued attribute's value. Absent on a list. */
1719
+ value?: string;
1720
+ /** @description The filter keys aligned with values (or the single value's key). Absent when any value has no key of its own. */
1721
+ valueKeys?: string[];
1722
+ /** @description A list attribute's values. Absent on a single value. */
1723
+ values?: string[];
1724
+ };
1725
+ ListingBrandV2Dto: {
1726
+ /** @description A filter link (filter[key]=valueKey) when the shop has a brand facet. Absent otherwise. */
1727
+ facet?: components["schemas"]["ListingFacetLinkV2Dto"];
1728
+ /** @description The brand's id. Absent only on a catalog built before brands. */
1729
+ id?: string;
1730
+ label: string;
1731
+ /** @description The brand's slug. Absent only on a catalog built before brands. */
1732
+ slug?: string;
1733
+ /** @description The brand page on this market. Absent when that page would not resolve here. */
1734
+ url?: string;
1735
+ };
1736
+ ListingClaimV2Dto: {
1737
+ /** @description The difference to reference in the offer's currency; ex is absent (status partial) when the reference has no ex side. Not a tax fact. */
1738
+ amountOff: components["schemas"]["ListingPriceV2Dto"];
1739
+ /**
1740
+ * Format: date-time
1741
+ * @description When the claim may no longer be made. Absent when it may be made beyond the sale's first 30 days.
1742
+ */
1743
+ claimEndsAt?: string;
1744
+ /**
1745
+ * Format: date-time
1746
+ * @description The sale's exclusive display end. Absent for an open-ended sale.
1747
+ */
1748
+ endsAt?: string;
1749
+ labelKey: string;
1750
+ /** Format: int32 */
1751
+ percent: number;
1752
+ /** Format: date-time */
1753
+ since: string;
1754
+ };
1755
+ ListingFacetLinkV2Dto: {
1756
+ key: string;
1757
+ valueKey: string;
1758
+ };
1759
+ ListingFocalV2Dto: {
1760
+ /** Format: double */
1761
+ x: number;
1762
+ /** Format: double */
1763
+ y: number;
1764
+ };
1765
+ ListingOfferV2Dto: {
1766
+ /** @description The honest price claim against reference; only a claim may strike a price. Drop it once endsAt or claimEndsAt has passed. Absent when no claim may be made. */
1767
+ claim?: components["schemas"]["ListingClaimV2Dto"];
1768
+ /** @description The recommended price, when the shop has one. Never shown while sale is present. Absent otherwise. */
1769
+ compareAt?: components["schemas"]["ListingPriceV2Dto"];
1770
+ displayBasis: components["schemas"]["DisplayBasisDto"];
1771
+ offerStatus: components["schemas"]["OfferStatusDto"];
1772
+ /** @description The price shown and charged now: the sale price while a sale step applies. Absent when no price is shown in the context. */
1773
+ price?: components["schemas"]["ListingPriceV2Dto"];
1774
+ purchaseStatus: components["schemas"]["PurchaseStatusDto"];
1775
+ /** @description The sale's reference price (the lowest price before the reduction), when one can be proven, beside a shown price. inc minus ex is not a tax amount here. Absent otherwise. */
1776
+ reference?: components["schemas"]["ListingPriceV2Dto"];
1777
+ /** @description The regular price, present together with sale while a sale step applies to the offer. Absent otherwise. */
1778
+ regular?: components["schemas"]["ListingPriceV2Dto"];
1779
+ /** @description The sale step that applies now, present together with regular. The sale's price is price. Absent when no sale step applies. */
1780
+ sale?: components["schemas"]["ListingSaleV2Dto"];
1781
+ /** @description Stock as the shopper may see it. */
1782
+ stock: components["schemas"]["ListingStockV2Dto"];
1783
+ };
1784
+ ListingPosterV2Dto: {
1785
+ formats: string[];
1786
+ widths: number[];
1787
+ };
1788
+ ListingPriceEndV2Dto: {
1789
+ price: components["schemas"]["ListingPriceV2Dto"];
1790
+ variantId: string;
1791
+ };
1792
+ ListingPriceV2Dto: {
1793
+ currency: string;
1794
+ /** @description The amount excluding tax. Present only when status is complete. */
1795
+ ex?: string;
1796
+ /** @description The amount including tax, a decimal string in the currency's exponent. Absent when status is unavailable. */
1797
+ inc?: string;
1798
+ /** @description complete (both sides known), partial (only inc known) or unavailable (no amount). */
1799
+ status: components["schemas"]["PriceStatusDto"];
1800
+ /** @description Present only when the price is not taxable: reverseCharge, export or exempt. Absent means taxable. */
1801
+ taxTreatment?: components["schemas"]["TaxTreatmentDto"];
1802
+ };
1692
1803
  ListingResponse: {
1693
1804
  appliedFilters: components["schemas"]["AppliedFilterDto"][];
1694
1805
  context: components["schemas"]["ContextDto"];
@@ -1707,6 +1818,66 @@ export interface components {
1707
1818
  total: number | string;
1708
1819
  warnings: components["schemas"]["WarningDto"][];
1709
1820
  };
1821
+ ListingSaleV2Dto: {
1822
+ /**
1823
+ * Format: date-time
1824
+ * @description When the sale was extended; only beside a reference. Absent otherwise.
1825
+ */
1826
+ extendedFrom?: string;
1827
+ /** @description The promotion's public label. Absent when it has none. */
1828
+ label?: string;
1829
+ /**
1830
+ * Format: date-time
1831
+ * @description When the applied sale step started. Absent when unknown.
1832
+ */
1833
+ validFrom?: string;
1834
+ /**
1835
+ * Format: date-time
1836
+ * @description The sale's exclusive display end: show it while now < validTo. Absent for an open-ended sale.
1837
+ */
1838
+ validTo?: string;
1839
+ };
1840
+ ListingStockV2Dto: {
1841
+ /**
1842
+ * Format: int32
1843
+ * @description Whole units in stock, present (0 included) only under the company quantity permission of the shop's offer policy. Absent otherwise.
1844
+ */
1845
+ quantity?: number;
1846
+ status: components["schemas"]["StockStatusDto"];
1847
+ };
1848
+ ListingThumbnailV2Dto: {
1849
+ /** @description Alternative text per language; possibly {}. Fall back to the product name. */
1850
+ alt: {
1851
+ [key: string]: string;
1852
+ };
1853
+ /** @description The background class the image format's background maps. Absent when unknown. */
1854
+ bg?: string;
1855
+ /** @description A blurred placeholder. Absent when unknown. */
1856
+ blurhash?: string;
1857
+ /** @description The dominant colour. Absent when unknown. */
1858
+ color?: string;
1859
+ /** @description The focal point of a cover crop. Absent means the centre. */
1860
+ focal?: components["schemas"]["ListingFocalV2Dto"];
1861
+ formats: string[];
1862
+ /**
1863
+ * Format: int32
1864
+ * @description The original height. Absent when unknown.
1865
+ */
1866
+ h?: number;
1867
+ id: string;
1868
+ kind: string;
1869
+ /** @description The poster renditions, present whenever the descriptor has one: a video or an animated GIF. Absent otherwise. */
1870
+ poster?: components["schemas"]["ListingPosterV2Dto"];
1871
+ /** Format: int32 */
1872
+ recipe: number;
1873
+ showWhole: boolean;
1874
+ /**
1875
+ * Format: int32
1876
+ * @description The original width. Absent when unknown.
1877
+ */
1878
+ w?: number;
1879
+ widths: number[];
1880
+ };
1710
1881
  ListingV2Response: {
1711
1882
  /** @description The selections in effect, as chips: source filter for the request's filters, query for what the search text selected, group for an applied named group (remove it by dropping group[facet]). */
1712
1883
  appliedFilters: components["schemas"]["AppliedFilterDto"][];
@@ -1989,6 +2160,19 @@ export interface components {
1989
2160
  popularGen: number | string;
1990
2161
  reason: string;
1991
2162
  };
2163
+ PlacementV2Dto: {
2164
+ available: boolean;
2165
+ /**
2166
+ * Format: date-time
2167
+ * @description When the product first went live. Absent when unknown.
2168
+ */
2169
+ firstLiveAt?: string;
2170
+ /** Format: float */
2171
+ popular: number;
2172
+ /** Format: int64 */
2173
+ popularGen: number;
2174
+ reason: string;
2175
+ };
1992
2176
  PriceBasisDto: {
1993
2177
  currency: string;
1994
2178
  scope: string;
@@ -2074,28 +2258,30 @@ export interface components {
2074
2258
  variants?: components["schemas"]["CardVariantDto"][] | null;
2075
2259
  };
2076
2260
  ProductCardV2Dto: {
2077
- /** @description The product's brand, or null. */
2078
- brand: null | components["schemas"]["BrandDto"];
2079
- /** @description The product's categories, named in the request's language; always an array, in no meaningful order. */
2080
- categories: components["schemas"]["CategoryRefDto"][];
2261
+ /** @description The product's brand. Absent when it has none. */
2262
+ brand?: components["schemas"]["ListingBrandV2Dto"];
2263
+ /** @description Only with include=categories, and then always an array (possibly empty): every category membership with its full path, named in the request's language, in no meaningful order. Absent without include=categories. */
2264
+ categories?: components["schemas"]["CategoryRefDto"][];
2081
2265
  /** @description The product's id. */
2082
2266
  id: string;
2083
- /** @description The product's display image, or null. */
2084
- image: null | components["schemas"]["MediaDescriptorDto"];
2085
- /** @description With include=matchedVariant and a variant-level condition in effect (a variant facet value or group, the in-stock filter, or listings of orderable products only): the cheapest variant that can be ordered and matches every variant filter, by regular price; its offer is the request-time offer, which can be a sale price. */
2086
- matchedVariant?: components["schemas"]["CardVariantDto"];
2267
+ /** @description The product's display thumbnail (primary, else first gallery, else first swatch). Absent when it has none. */
2268
+ image?: components["schemas"]["ListingThumbnailV2Dto"];
2269
+ /** @description Only with include=matchedVariant and a variant-level condition in effect (a variant facet value or group, the in-stock filter, or listings of orderable products only): the cheapest variant that can be ordered and matches every variant filter, by regular price, with its own offer (the request-time offer, which can be a sale price) and URL. It can lie outside a cut variants list. Absent when no variant qualifies, and without include=matchedVariant. */
2270
+ matchedVariant?: components["schemas"]["CardVariantV2Dto"];
2087
2271
  /** @description The product's name in the request's language. */
2088
2272
  name: string;
2089
- /** @description The card's offer in the request's context, priced at request time: it can show a sale price. */
2090
- offer: components["schemas"]["OfferDto"];
2273
+ /** @description The family's offer in the request's context, priced at request time: it can show a sale price. */
2274
+ offer: components["schemas"]["ListingOfferV2Dto"];
2091
2275
  /** @description Preview keys only: why the card stands where it does (reason pinned, keepVisible or base). Absent otherwise. */
2092
- placement?: components["schemas"]["PlacementDto"];
2093
- /** @description The lowest price on priceBasis.tax, one variant's whole pair; null when the offer shows no price. */
2094
- priceFrom: null | components["schemas"]["PriceFromDto"];
2095
- /** @description The highest price on priceBasis.tax, one variant's whole pair; null when the offer shows no price. Render "from" when priceFrom and priceTo differ. */
2096
- priceTo: null | components["schemas"]["PriceFromDto"];
2097
- /** @description The one category to use for analytics and breadcrumbs, or null. */
2098
- primaryCategory: null | components["schemas"]["CategoryRefDto"];
2276
+ placement?: components["schemas"]["PlacementV2Dto"];
2277
+ /** @description Only with include=priceRange: the lowest price on priceBasis.tax, one variant's pair. Absent when no price is shown here, and without include=priceRange. */
2278
+ priceFrom?: components["schemas"]["ListingPriceEndV2Dto"];
2279
+ /** @description Only with include=priceRange: the highest price on priceBasis.tax, one variant's pair. Absent when no price is shown here, and without include=priceRange. */
2280
+ priceTo?: components["schemas"]["ListingPriceEndV2Dto"];
2281
+ /** @description Whether the family's lowest and highest prices on priceBasis.tax differ: true means render "from" with offer.price. Absent when either end is unknown or no price is shown here, whatever include asks for. Never derive the family's range from variants: a cut list can miss either end. */
2282
+ priceVaries?: boolean;
2283
+ /** @description The one category to use for analytics and breadcrumbs. Absent when there is none. */
2284
+ primaryCategory?: components["schemas"]["CategoryRefDto"];
2099
2285
  /** @description The product's article number. */
2100
2286
  sku: string;
2101
2287
  /** @description The product's slug in the request's language. */
@@ -2104,11 +2290,11 @@ export interface components {
2104
2290
  url: string;
2105
2291
  /**
2106
2292
  * Format: int32
2107
- * @description With include=variants: all visible variants; larger than variants' length when the list was cut.
2293
+ * @description Only with include=variants: all visible variants; larger than variants' length when the list was cut. Absent without include=variants.
2108
2294
  */
2109
2295
  variantCount?: number;
2110
- /** @description With include=variants: the variants visible here, by position, at most the site's card variant count (default 12). */
2111
- variants?: components["schemas"]["CardVariantDto"][];
2296
+ /** @description Only with include=variants, and then always an array (possibly empty): the variants visible here, by position, at most the site's card variant count (default 12). Absent without include=variants. */
2297
+ variants?: components["schemas"]["CardVariantV2Dto"][];
2112
2298
  };
2113
2299
  ProductDto: {
2114
2300
  alternates: components["schemas"]["AlternateDto"][];
@@ -8794,7 +8980,7 @@ export interface operations {
8794
8980
  group?: {
8795
8981
  [key: string]: string;
8796
8982
  };
8797
- /** @description Comma list. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount) and matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter). Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
8983
+ /** @description Comma list, case-sensitive; a repeated value counts once. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount), matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter), categories (each card's category memberships with their full paths) and priceRange (each card's priceFrom and priceTo). A card member that is not asked for is absent. Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
8798
8984
  include?: string;
8799
8985
  };
8800
8986
  header: {
@@ -8903,7 +9089,7 @@ export interface operations {
8903
9089
  group?: {
8904
9090
  [key: string]: string;
8905
9091
  };
8906
- /** @description Comma list. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount) and matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter). Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
9092
+ /** @description Comma list, case-sensitive; a repeated value counts once. Blocks: facets, groups, childCollections. Card data: variants (each card's variants visible here, at most the shop's card variant count, by position, with variantCount), matchedVariant (with a variant-level condition in effect: the cheapest variant that can be ordered and matches every variant-level filter), categories (each card's category memberships with their full paths) and priceRange (each card's priceFrom and priceTo). A card member that is not asked for is absent. Unknown tokens are ignored with an INCLUDE_UNKNOWN warning. */
8907
9093
  include?: string;
8908
9094
  /** @description One collection, by the id the API returns or by the collection's own slug; a slash path names nothing. An id wins over a slug that looks like it; follow-up requests use the returned id. An unknown one is answered with a COLLECTION_UNKNOWN warning and narrows nothing, not a 404. */
8909
9095
  collection?: string;