@asstio-dev/storefront 0.13.0 → 0.15.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.
package/dist/index.d.ts CHANGED
@@ -56,4 +56,4 @@ export { brandHead, collectionHead, productHead, toNextMetadata } from "./seo/he
56
56
  export { gtinJsonLd } from "./gtin.js";
57
57
  export { productJsonLd } from "./seo/product.js";
58
58
  export { jsonLdScript } from "./seo/serialize.js";
59
- export { SeoError, type BreadcrumbLink, type CollectionHeadOptions, type HeadOptions, type JsonLd, type NextMetadataLike, type ProductJsonLdOptions, type SchemaProperty, type SeoContext, type SeoHead, type SeoMeta, } from "./seo/types.js";
59
+ 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";
package/dist/schema.d.ts CHANGED
@@ -102,6 +102,22 @@ export interface paths {
102
102
  patch?: never;
103
103
  trace?: never;
104
104
  };
105
+ "/v1/cart/shipping-estimate": {
106
+ parameters: {
107
+ query?: never;
108
+ header?: never;
109
+ path?: never;
110
+ cookie?: never;
111
+ };
112
+ get: operations["GetShippingEstimate"];
113
+ put?: never;
114
+ post?: never;
115
+ delete?: never;
116
+ options?: never;
117
+ head?: never;
118
+ patch?: never;
119
+ trace?: never;
120
+ };
105
121
  "/v1/categories": {
106
122
  parameters: {
107
123
  query?: never;
@@ -456,6 +472,7 @@ export interface components {
456
472
  };
457
473
  CartDto: {
458
474
  currency: string;
475
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
459
476
  grandTotalInc: string;
460
477
  lines: components["schemas"]["CartLineDto"][];
461
478
  market: string;
@@ -467,6 +484,8 @@ export interface components {
467
484
  warnings: components["schemas"]["WarningDto"][];
468
485
  };
469
486
  CartLineDto: {
487
+ availability: components["schemas"]["LineAvailability"];
488
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
470
489
  id: string;
471
490
  image: null | components["schemas"]["MediaDescriptorDto"];
472
491
  price: components["schemas"]["PriceDto"];
@@ -501,6 +520,7 @@ export interface components {
501
520
  };
502
521
  CheckoutCartDto: {
503
522
  currency: string;
523
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
504
524
  grandTotalInc: string;
505
525
  lines: components["schemas"]["CheckoutCartLineDto"][];
506
526
  subtotalInc: string;
@@ -508,6 +528,8 @@ export interface components {
508
528
  version: number | string;
509
529
  };
510
530
  CheckoutCartLineDto: {
531
+ availability: null | components["schemas"]["LineAvailability"];
532
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
511
533
  image: null | components["schemas"]["MediaDescriptorDto"];
512
534
  lineTotalInc: string;
513
535
  name: string;
@@ -568,6 +590,7 @@ export interface components {
568
590
  attemptId: string;
569
591
  order: null | components["schemas"]["CheckoutOrderRefDto"];
570
592
  paymentStatus: null | string;
593
+ promisedDelivery: null | components["schemas"]["DeliveryRangeDto"];
571
594
  status: string;
572
595
  widget: null | components["schemas"]["CheckoutWidgetDto"];
573
596
  };
@@ -611,6 +634,20 @@ export interface components {
611
634
  slug: string;
612
635
  url: string;
613
636
  };
637
+ DeliveryRangeDto: {
638
+ /** Format: int32 */
639
+ max: number;
640
+ /** Format: int32 */
641
+ min: number;
642
+ };
643
+ DeliveryTimeDto: {
644
+ /** Format: int32 */
645
+ maxDays: number | null | string;
646
+ /** Format: int32 */
647
+ minDays: number | null | string;
648
+ mode: string;
649
+ text: null | string;
650
+ };
614
651
  DescriptionDto: {
615
652
  html: string;
616
653
  text: string;
@@ -649,6 +686,13 @@ export interface components {
649
686
  facet: string;
650
687
  values: components["schemas"]["FacetValueDto"][];
651
688
  };
689
+ FreeShippingDto: {
690
+ free: boolean;
691
+ remaining: null | string;
692
+ threshold: null | string;
693
+ };
694
+ /** @enum {unknown} */
695
+ LineAvailability: "backorder" | "inStock";
652
696
  ListingResponse: {
653
697
  appliedFilters: components["schemas"]["AppliedFilterDto"][];
654
698
  facets: components["schemas"]["FacetDto"][];
@@ -774,7 +818,9 @@ export interface components {
774
818
  orderNumber: null | string;
775
819
  /** Format: date-time */
776
820
  placedAt: string;
821
+ promisedDelivery: null | components["schemas"]["DeliveryRangeDto"];
777
822
  reference: string;
823
+ shipping: null | components["schemas"]["OrderShippingDto"];
778
824
  status: components["schemas"]["OrderStatusDto"];
779
825
  test: boolean;
780
826
  totals: components["schemas"]["OrderTotalsDto"];
@@ -796,6 +842,21 @@ export interface components {
796
842
  variantId: null | string;
797
843
  vatRate: string;
798
844
  };
845
+ OrderShippingDto: {
846
+ carrier: string;
847
+ deliveryTime: null | components["schemas"]["DeliveryTimeDto"];
848
+ deliveryType: string;
849
+ fee: string;
850
+ name: string;
851
+ option: string;
852
+ point: null | components["schemas"]["OrderShippingPointDto"];
853
+ };
854
+ OrderShippingPointDto: {
855
+ city: null | string;
856
+ name: string;
857
+ postalCode: null | string;
858
+ street: null | string;
859
+ };
799
860
  OrderStatusDto: {
800
861
  fulfilment: string;
801
862
  order: string;
@@ -827,6 +888,7 @@ export interface components {
827
888
  };
828
889
  ProductCardDto: {
829
890
  brand: null | components["schemas"]["BrandDto"];
891
+ buyable: boolean;
830
892
  collections: string[];
831
893
  id: string;
832
894
  image: null | components["schemas"]["MediaDescriptorDto"];
@@ -897,6 +959,9 @@ export interface components {
897
959
  importer: null | components["schemas"]["PartyDto"];
898
960
  manufacturer: null | components["schemas"]["PartyDto"];
899
961
  };
962
+ SellabilityDto: {
963
+ mode: components["schemas"]["SiteSellabilityMode"];
964
+ };
900
965
  SeoDto: {
901
966
  description: null | string;
902
967
  title: string;
@@ -904,6 +969,27 @@ export interface components {
904
969
  SetCartMarketRequest: {
905
970
  market: string;
906
971
  };
972
+ ShippingEstimateDto: {
973
+ available: boolean;
974
+ freeShipping: null | components["schemas"]["FreeShippingDto"];
975
+ options: components["schemas"]["ShippingEstimateOptionDto"][];
976
+ reason: null | string;
977
+ };
978
+ ShippingEstimateOptionDto: {
979
+ deliveryType: string;
980
+ fee: string;
981
+ key: string;
982
+ labels: components["schemas"]["ShippingLabelDto"][];
983
+ name: string;
984
+ pointsAtCheckout: boolean;
985
+ preselected: boolean;
986
+ regularFee: null | string;
987
+ };
988
+ ShippingLabelDto: {
989
+ color: string;
990
+ icon: null | string;
991
+ name: string;
992
+ };
907
993
  SiteDto: {
908
994
  code: string;
909
995
  configVersion: string;
@@ -912,8 +998,11 @@ export interface components {
912
998
  media: components["schemas"]["MediaDto"];
913
999
  name: string;
914
1000
  preview: boolean;
1001
+ sellability: components["schemas"]["SellabilityDto"];
915
1002
  urlPatterns: components["schemas"]["UrlPatternsDto"];
916
1003
  };
1004
+ /** @enum {unknown} */
1005
+ SiteSellabilityMode: "backorder" | "onHand";
917
1006
  SitemapEntryDto: {
918
1007
  alternateUrls: {
919
1008
  [key: string]: string;
@@ -1003,8 +1092,15 @@ export interface components {
1003
1092
  collection: string;
1004
1093
  product: string;
1005
1094
  };
1095
+ /** @enum {unknown} */
1096
+ VariantAvailability: "backorder" | "inStock" | "unavailable";
1006
1097
  VariantDto: {
1098
+ availability: components["schemas"]["VariantAvailability"];
1099
+ /** Format: int32 */
1100
+ availableUnits: number;
1101
+ backorderDelivery: null | components["schemas"]["DeliveryRangeDto"];
1007
1102
  brand: null | components["schemas"]["BrandDto"];
1103
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
1008
1104
  gtin: null | string;
1009
1105
  gtins: string[];
1010
1106
  hasOwnImages: boolean;
@@ -1829,6 +1925,98 @@ export interface operations {
1829
1925
  };
1830
1926
  };
1831
1927
  };
1928
+ GetShippingEstimate: {
1929
+ parameters: {
1930
+ query?: never;
1931
+ header: {
1932
+ /** @description Publishable, preview or secret site key. Required on every request; secret keys are server-side only. */
1933
+ "X-Site-Key": string;
1934
+ /** @description Market code (e.g. "se"). Omit for the site's default market. */
1935
+ "X-Market"?: string;
1936
+ /** @description BCP-47 language tag. Omit to use the market's language. */
1937
+ "Accept-Language"?: string;
1938
+ /** @description The bearer token returned by POST /v1/cart. Identifies which cart this request reads or mutates. */
1939
+ "X-Cart-Token": string;
1940
+ };
1941
+ path?: never;
1942
+ cookie?: never;
1943
+ };
1944
+ requestBody?: never;
1945
+ responses: {
1946
+ /** @description OK */
1947
+ 200: {
1948
+ headers: {
1949
+ [name: string]: unknown;
1950
+ };
1951
+ content: {
1952
+ "application/json": components["schemas"]["ShippingEstimateDto"];
1953
+ };
1954
+ };
1955
+ /** @description problem+json. NOT_FOUND (X-Cart-Token missing). */
1956
+ 400: {
1957
+ headers: {
1958
+ [name: string]: unknown;
1959
+ };
1960
+ content: {
1961
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1962
+ };
1963
+ };
1964
+ /** @description problem+json. SITE_KEY_MISSING or SITE_KEY_INVALID. */
1965
+ 401: {
1966
+ headers: {
1967
+ [name: string]: unknown;
1968
+ };
1969
+ content: {
1970
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1971
+ };
1972
+ };
1973
+ /** @description problem+json. SECRET_KEY_FROM_BROWSER: a secret key was sent from a browser. */
1974
+ 403: {
1975
+ headers: {
1976
+ [name: string]: unknown;
1977
+ };
1978
+ content: {
1979
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1980
+ };
1981
+ };
1982
+ /** @description problem+json. SITE_INACTIVE, or NOT_FOUND for an unrouted path. */
1983
+ 404: {
1984
+ headers: {
1985
+ [name: string]: unknown;
1986
+ };
1987
+ content: {
1988
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1989
+ };
1990
+ };
1991
+ /** @description problem+json. CART_EXPIRED: this cart token belongs to an expired cart. */
1992
+ 410: {
1993
+ headers: {
1994
+ [name: string]: unknown;
1995
+ };
1996
+ content: {
1997
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1998
+ };
1999
+ };
2000
+ /** @description problem+json. RATE_LIMITED; retryAfterSeconds and the Retry-After header say how long to wait. */
2001
+ 429: {
2002
+ headers: {
2003
+ [name: string]: unknown;
2004
+ };
2005
+ content: {
2006
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
2007
+ };
2008
+ };
2009
+ /** @description problem+json. SITE_REGISTRY_WARMING or INDEX_UNAVAILABLE — retry, the request was not wrong. */
2010
+ 503: {
2011
+ headers: {
2012
+ [name: string]: unknown;
2013
+ };
2014
+ content: {
2015
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
2016
+ };
2017
+ };
2018
+ };
2019
+ };
1832
2020
  GetCategories: {
1833
2021
  parameters: {
1834
2022
  query?: never;
@@ -2013,7 +2201,7 @@ export interface operations {
2013
2201
  "application/problem+json": components["schemas"]["StorefrontProblem"];
2014
2202
  };
2015
2203
  };
2016
- /** @description problem+json. CHECKOUT_UNAVAILABLE or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
2204
+ /** @description problem+json. CHECKOUT_UNAVAILABLE, SHIPPING_UNAVAILABLE (the market's shipping configuration cannot be served) or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
2017
2205
  503: {
2018
2206
  headers: {
2019
2207
  [name: string]: unknown;
@@ -3,7 +3,15 @@ import { jsonLdDescription, pickImages, productDescription, rejectRedirect, requ
3
3
  import { SeoError } from "./types.js";
4
4
  const PROPERTIES = ["size", "color", "material", "pattern"];
5
5
  const IN_STOCK = "https://schema.org/InStock";
6
+ const BACK_ORDER = "https://schema.org/BackOrder";
6
7
  const OUT_OF_STOCK = "https://schema.org/OutOfStock";
8
+ const SCHEMA_AVAILABILITY = { inStock: IN_STOCK, backorder: BACK_ORDER, unavailable: OUT_OF_STOCK };
9
+ /** Sellability C1 §6: the caller's answer, else the variant's own; a response from an API older than 0.14 has no
10
+ * `availability` and falls back to `inStock`. */
11
+ function availabilityOf(v, ctx) {
12
+ const state = ctx.availability?.(v) ?? v.availability ?? (v.inStock ? "inStock" : "unavailable");
13
+ return SCHEMA_AVAILABILITY[state] ?? OUT_OF_STOCK;
14
+ }
7
15
  const brandNode = (label) => ({ "@type": "Brand", name: label });
8
16
  /** Spec §4.12: absolute http(s), distinct per variant; checked for every emitted variant, single path included. */
9
17
  function checkVariantUrls(variants, variantUrl) {
@@ -77,7 +85,7 @@ export function productJsonLd(p, ctx) {
77
85
  "@type": "Offer",
78
86
  price: v.price.amount,
79
87
  priceCurrency: v.price.currency,
80
- availability: v.inStock ? IN_STOCK : OUT_OF_STOCK,
88
+ availability: availabilityOf(v, ctx),
81
89
  url,
82
90
  ...offerExtras(ctx),
83
91
  });
@@ -4,6 +4,7 @@ export type SiteDto = Schemas["SiteDto"];
4
4
  export type MarketDto = Schemas["MarketDto"];
5
5
  export type ProductDto = Schemas["ProductDto"];
6
6
  export type VariantDto = Schemas["VariantDto"];
7
+ export type VariantAvailability = Schemas["VariantAvailability"];
7
8
  export type CollectionListingResponse = Schemas["CollectionListingResponse"];
8
9
  export type CollectionCrumbDto = Schemas["CollectionCrumbDto"];
9
10
  export type BrandDetailDto = Schemas["BrandDetailDto"];
@@ -43,6 +44,9 @@ export type ProductJsonLdOptions = SeoContext & {
43
44
  variants?: VariantDto[];
44
45
  /** Overrides the GTIN per variant; return `undefined` to omit. Defaults to the variant's `gtin`. */
45
46
  gtin?: (v: VariantDto) => string | undefined;
47
+ /** Sellability C1 §6: the availability for the quantity this page sells (e.g. a pair of the same lens needs two units).
48
+ * Return `undefined` to use the variant's own `availability` (its state for quantity 1). */
49
+ availability?: (v: VariantDto) => VariantAvailability | undefined;
46
50
  seller?: {
47
51
  name: string;
48
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asstio-dev/storefront",
3
- "version": "0.13.0",
3
+ "version": "0.15.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
@@ -102,6 +102,22 @@ export interface paths {
102
102
  patch?: never;
103
103
  trace?: never;
104
104
  };
105
+ "/v1/cart/shipping-estimate": {
106
+ parameters: {
107
+ query?: never;
108
+ header?: never;
109
+ path?: never;
110
+ cookie?: never;
111
+ };
112
+ get: operations["GetShippingEstimate"];
113
+ put?: never;
114
+ post?: never;
115
+ delete?: never;
116
+ options?: never;
117
+ head?: never;
118
+ patch?: never;
119
+ trace?: never;
120
+ };
105
121
  "/v1/categories": {
106
122
  parameters: {
107
123
  query?: never;
@@ -456,6 +472,7 @@ export interface components {
456
472
  };
457
473
  CartDto: {
458
474
  currency: string;
475
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
459
476
  grandTotalInc: string;
460
477
  lines: components["schemas"]["CartLineDto"][];
461
478
  market: string;
@@ -467,6 +484,8 @@ export interface components {
467
484
  warnings: components["schemas"]["WarningDto"][];
468
485
  };
469
486
  CartLineDto: {
487
+ availability: components["schemas"]["LineAvailability"];
488
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
470
489
  id: string;
471
490
  image: null | components["schemas"]["MediaDescriptorDto"];
472
491
  price: components["schemas"]["PriceDto"];
@@ -501,6 +520,7 @@ export interface components {
501
520
  };
502
521
  CheckoutCartDto: {
503
522
  currency: string;
523
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
504
524
  grandTotalInc: string;
505
525
  lines: components["schemas"]["CheckoutCartLineDto"][];
506
526
  subtotalInc: string;
@@ -508,6 +528,8 @@ export interface components {
508
528
  version: number | string;
509
529
  };
510
530
  CheckoutCartLineDto: {
531
+ availability: null | components["schemas"]["LineAvailability"];
532
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
511
533
  image: null | components["schemas"]["MediaDescriptorDto"];
512
534
  lineTotalInc: string;
513
535
  name: string;
@@ -568,6 +590,7 @@ export interface components {
568
590
  attemptId: string;
569
591
  order: null | components["schemas"]["CheckoutOrderRefDto"];
570
592
  paymentStatus: null | string;
593
+ promisedDelivery: null | components["schemas"]["DeliveryRangeDto"];
571
594
  status: string;
572
595
  widget: null | components["schemas"]["CheckoutWidgetDto"];
573
596
  };
@@ -611,6 +634,20 @@ export interface components {
611
634
  slug: string;
612
635
  url: string;
613
636
  };
637
+ DeliveryRangeDto: {
638
+ /** Format: int32 */
639
+ max: number;
640
+ /** Format: int32 */
641
+ min: number;
642
+ };
643
+ DeliveryTimeDto: {
644
+ /** Format: int32 */
645
+ maxDays: number | null | string;
646
+ /** Format: int32 */
647
+ minDays: number | null | string;
648
+ mode: string;
649
+ text: null | string;
650
+ };
614
651
  DescriptionDto: {
615
652
  html: string;
616
653
  text: string;
@@ -649,6 +686,13 @@ export interface components {
649
686
  facet: string;
650
687
  values: components["schemas"]["FacetValueDto"][];
651
688
  };
689
+ FreeShippingDto: {
690
+ free: boolean;
691
+ remaining: null | string;
692
+ threshold: null | string;
693
+ };
694
+ /** @enum {unknown} */
695
+ LineAvailability: "backorder" | "inStock";
652
696
  ListingResponse: {
653
697
  appliedFilters: components["schemas"]["AppliedFilterDto"][];
654
698
  facets: components["schemas"]["FacetDto"][];
@@ -774,7 +818,9 @@ export interface components {
774
818
  orderNumber: null | string;
775
819
  /** Format: date-time */
776
820
  placedAt: string;
821
+ promisedDelivery: null | components["schemas"]["DeliveryRangeDto"];
777
822
  reference: string;
823
+ shipping: null | components["schemas"]["OrderShippingDto"];
778
824
  status: components["schemas"]["OrderStatusDto"];
779
825
  test: boolean;
780
826
  totals: components["schemas"]["OrderTotalsDto"];
@@ -796,6 +842,21 @@ export interface components {
796
842
  variantId: null | string;
797
843
  vatRate: string;
798
844
  };
845
+ OrderShippingDto: {
846
+ carrier: string;
847
+ deliveryTime: null | components["schemas"]["DeliveryTimeDto"];
848
+ deliveryType: string;
849
+ fee: string;
850
+ name: string;
851
+ option: string;
852
+ point: null | components["schemas"]["OrderShippingPointDto"];
853
+ };
854
+ OrderShippingPointDto: {
855
+ city: null | string;
856
+ name: string;
857
+ postalCode: null | string;
858
+ street: null | string;
859
+ };
799
860
  OrderStatusDto: {
800
861
  fulfilment: string;
801
862
  order: string;
@@ -827,6 +888,7 @@ export interface components {
827
888
  };
828
889
  ProductCardDto: {
829
890
  brand: null | components["schemas"]["BrandDto"];
891
+ buyable: boolean;
830
892
  collections: string[];
831
893
  id: string;
832
894
  image: null | components["schemas"]["MediaDescriptorDto"];
@@ -897,6 +959,9 @@ export interface components {
897
959
  importer: null | components["schemas"]["PartyDto"];
898
960
  manufacturer: null | components["schemas"]["PartyDto"];
899
961
  };
962
+ SellabilityDto: {
963
+ mode: components["schemas"]["SiteSellabilityMode"];
964
+ };
900
965
  SeoDto: {
901
966
  description: null | string;
902
967
  title: string;
@@ -904,6 +969,27 @@ export interface components {
904
969
  SetCartMarketRequest: {
905
970
  market: string;
906
971
  };
972
+ ShippingEstimateDto: {
973
+ available: boolean;
974
+ freeShipping: null | components["schemas"]["FreeShippingDto"];
975
+ options: components["schemas"]["ShippingEstimateOptionDto"][];
976
+ reason: null | string;
977
+ };
978
+ ShippingEstimateOptionDto: {
979
+ deliveryType: string;
980
+ fee: string;
981
+ key: string;
982
+ labels: components["schemas"]["ShippingLabelDto"][];
983
+ name: string;
984
+ pointsAtCheckout: boolean;
985
+ preselected: boolean;
986
+ regularFee: null | string;
987
+ };
988
+ ShippingLabelDto: {
989
+ color: string;
990
+ icon: null | string;
991
+ name: string;
992
+ };
907
993
  SiteDto: {
908
994
  code: string;
909
995
  configVersion: string;
@@ -912,8 +998,11 @@ export interface components {
912
998
  media: components["schemas"]["MediaDto"];
913
999
  name: string;
914
1000
  preview: boolean;
1001
+ sellability: components["schemas"]["SellabilityDto"];
915
1002
  urlPatterns: components["schemas"]["UrlPatternsDto"];
916
1003
  };
1004
+ /** @enum {unknown} */
1005
+ SiteSellabilityMode: "backorder" | "onHand";
917
1006
  SitemapEntryDto: {
918
1007
  alternateUrls: {
919
1008
  [key: string]: string;
@@ -1003,8 +1092,15 @@ export interface components {
1003
1092
  collection: string;
1004
1093
  product: string;
1005
1094
  };
1095
+ /** @enum {unknown} */
1096
+ VariantAvailability: "backorder" | "inStock" | "unavailable";
1006
1097
  VariantDto: {
1098
+ availability: components["schemas"]["VariantAvailability"];
1099
+ /** Format: int32 */
1100
+ availableUnits: number;
1101
+ backorderDelivery: null | components["schemas"]["DeliveryRangeDto"];
1007
1102
  brand: null | components["schemas"]["BrandDto"];
1103
+ delivery: null | components["schemas"]["DeliveryRangeDto"];
1008
1104
  gtin: null | string;
1009
1105
  gtins: string[];
1010
1106
  hasOwnImages: boolean;
@@ -1829,6 +1925,98 @@ export interface operations {
1829
1925
  };
1830
1926
  };
1831
1927
  };
1928
+ GetShippingEstimate: {
1929
+ parameters: {
1930
+ query?: never;
1931
+ header: {
1932
+ /** @description Publishable, preview or secret site key. Required on every request; secret keys are server-side only. */
1933
+ "X-Site-Key": string;
1934
+ /** @description Market code (e.g. "se"). Omit for the site's default market. */
1935
+ "X-Market"?: string;
1936
+ /** @description BCP-47 language tag. Omit to use the market's language. */
1937
+ "Accept-Language"?: string;
1938
+ /** @description The bearer token returned by POST /v1/cart. Identifies which cart this request reads or mutates. */
1939
+ "X-Cart-Token": string;
1940
+ };
1941
+ path?: never;
1942
+ cookie?: never;
1943
+ };
1944
+ requestBody?: never;
1945
+ responses: {
1946
+ /** @description OK */
1947
+ 200: {
1948
+ headers: {
1949
+ [name: string]: unknown;
1950
+ };
1951
+ content: {
1952
+ "application/json": components["schemas"]["ShippingEstimateDto"];
1953
+ };
1954
+ };
1955
+ /** @description problem+json. NOT_FOUND (X-Cart-Token missing). */
1956
+ 400: {
1957
+ headers: {
1958
+ [name: string]: unknown;
1959
+ };
1960
+ content: {
1961
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1962
+ };
1963
+ };
1964
+ /** @description problem+json. SITE_KEY_MISSING or SITE_KEY_INVALID. */
1965
+ 401: {
1966
+ headers: {
1967
+ [name: string]: unknown;
1968
+ };
1969
+ content: {
1970
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1971
+ };
1972
+ };
1973
+ /** @description problem+json. SECRET_KEY_FROM_BROWSER: a secret key was sent from a browser. */
1974
+ 403: {
1975
+ headers: {
1976
+ [name: string]: unknown;
1977
+ };
1978
+ content: {
1979
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1980
+ };
1981
+ };
1982
+ /** @description problem+json. SITE_INACTIVE, or NOT_FOUND for an unrouted path. */
1983
+ 404: {
1984
+ headers: {
1985
+ [name: string]: unknown;
1986
+ };
1987
+ content: {
1988
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1989
+ };
1990
+ };
1991
+ /** @description problem+json. CART_EXPIRED: this cart token belongs to an expired cart. */
1992
+ 410: {
1993
+ headers: {
1994
+ [name: string]: unknown;
1995
+ };
1996
+ content: {
1997
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
1998
+ };
1999
+ };
2000
+ /** @description problem+json. RATE_LIMITED; retryAfterSeconds and the Retry-After header say how long to wait. */
2001
+ 429: {
2002
+ headers: {
2003
+ [name: string]: unknown;
2004
+ };
2005
+ content: {
2006
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
2007
+ };
2008
+ };
2009
+ /** @description problem+json. SITE_REGISTRY_WARMING or INDEX_UNAVAILABLE — retry, the request was not wrong. */
2010
+ 503: {
2011
+ headers: {
2012
+ [name: string]: unknown;
2013
+ };
2014
+ content: {
2015
+ "application/problem+json": components["schemas"]["StorefrontProblem"];
2016
+ };
2017
+ };
2018
+ };
2019
+ };
1832
2020
  GetCategories: {
1833
2021
  parameters: {
1834
2022
  query?: never;
@@ -2013,7 +2201,7 @@ export interface operations {
2013
2201
  "application/problem+json": components["schemas"]["StorefrontProblem"];
2014
2202
  };
2015
2203
  };
2016
- /** @description problem+json. CHECKOUT_UNAVAILABLE or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
2204
+ /** @description problem+json. CHECKOUT_UNAVAILABLE, SHIPPING_UNAVAILABLE (the market's shipping configuration cannot be served) or CHECKOUT_PROVIDER_UNAVAILABLE (Retry-After); SITE_REGISTRY_WARMING. */
2017
2205
  503: {
2018
2206
  headers: {
2019
2207
  [name: string]: unknown;