@asstio-dev/storefront 0.48.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -244,6 +244,16 @@ export function buyBox(offer: OfferDto) {
244
244
  freshness, sellability and a complete price, so a partial price can be visible and still not buyable. Never decide it
245
245
  from `stock`: the API sends no public stock quantity, and zero stock is buyable on a backorder site.
246
246
 
247
+ ### Variant names
248
+
249
+ `variant.name` (on `VariantDto`, cart lines' `variant` and checkout/order lines' `variant`) is the variant's own name from
250
+ Asstio, for example "Boss Bottled Eau de Parfum 50 ml". It is `null` for a variant without a name, until the site's index
251
+ has been rebuilt on the release that added it, on a cart line whose catalogue facts could not be read, and on frozen
252
+ checkout lines and order lines (only an open checkout's lines resolved live carry it). Fall back like this:
253
+
254
+ - product page and cart: `variant.name ?? product.name`, plus `variant.selectedOptions`;
255
+ - checkout and order lines: `line.variant.name ?? line.name`, plus `line.options` (the line's `product` block has no name).
256
+
247
257
  ### Variant links
248
258
 
249
259
  A link to one variant is the product URL plus `?variant={variantId}` (the id from `variants[].id`); `variant.url` is
package/dist/schema.d.ts CHANGED
@@ -1123,6 +1123,7 @@ export interface components {
1123
1123
  CartLineVariantDto: {
1124
1124
  brand: null | components["schemas"]["BrandDto"];
1125
1125
  id: string;
1126
+ name: null | string;
1126
1127
  selectedOptions: {
1127
1128
  [key: string]: string;
1128
1129
  };
@@ -1700,6 +1701,7 @@ export interface components {
1700
1701
  };
1701
1702
  OrderLineVariantDto: {
1702
1703
  brand: null | components["schemas"]["BrandDto"];
1704
+ name: null | string;
1703
1705
  url: null | string;
1704
1706
  };
1705
1707
  OrderShippingDto: {
@@ -2302,6 +2304,7 @@ export interface components {
2302
2304
  id: string;
2303
2305
  image: null | components["schemas"]["MediaDescriptorDto"];
2304
2306
  images: components["schemas"]["MediaDescriptorDto"][];
2307
+ name: null | string;
2305
2308
  offer: components["schemas"]["OfferDto"];
2306
2309
  responsible: components["schemas"]["ResponsibleDto"];
2307
2310
  selectedOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asstio-dev/storefront",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
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
@@ -1123,6 +1123,7 @@ export interface components {
1123
1123
  CartLineVariantDto: {
1124
1124
  brand: null | components["schemas"]["BrandDto"];
1125
1125
  id: string;
1126
+ name: null | string;
1126
1127
  selectedOptions: {
1127
1128
  [key: string]: string;
1128
1129
  };
@@ -1700,6 +1701,7 @@ export interface components {
1700
1701
  };
1701
1702
  OrderLineVariantDto: {
1702
1703
  brand: null | components["schemas"]["BrandDto"];
1704
+ name: null | string;
1703
1705
  url: null | string;
1704
1706
  };
1705
1707
  OrderShippingDto: {
@@ -2302,6 +2304,7 @@ export interface components {
2302
2304
  id: string;
2303
2305
  image: null | components["schemas"]["MediaDescriptorDto"];
2304
2306
  images: components["schemas"]["MediaDescriptorDto"][];
2307
+ name: null | string;
2305
2308
  offer: components["schemas"]["OfferDto"];
2306
2309
  responsible: components["schemas"]["ResponsibleDto"];
2307
2310
  selectedOptions: {