@behio/storefront-sdk 2.13.0 → 2.14.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/{client-Cf_xibuw.d.mts → client-DB_ve5Fp.d.mts} +89 -23
- package/dist/{client-Cf_xibuw.d.ts → client-DB_ve5Fp.d.ts} +89 -23
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -3
- package/dist/index.mjs +12 -3
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/react.d.mts +88 -22
- package/dist/react.d.ts +88 -22
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -564,7 +564,7 @@ interface ProductLabel {
|
|
|
564
564
|
id: string;
|
|
565
565
|
slug: string;
|
|
566
566
|
name: string;
|
|
567
|
-
color?: string;
|
|
567
|
+
color?: string | null;
|
|
568
568
|
/** Merchant icon name. Render a trusted local icon, with a safe fallback. */
|
|
569
569
|
iconName?: string | null;
|
|
570
570
|
}
|
|
@@ -594,9 +594,9 @@ interface ProductListItem {
|
|
|
594
594
|
id: string;
|
|
595
595
|
slug: string;
|
|
596
596
|
name: string;
|
|
597
|
-
shortDescription?: string;
|
|
597
|
+
shortDescription?: string | null;
|
|
598
598
|
sku: string;
|
|
599
|
-
gtin?: string;
|
|
599
|
+
gtin?: string | null;
|
|
600
600
|
/** `null` when prices are gated behind login for guests (B2B mode). */
|
|
601
601
|
price: ProductPrice | null;
|
|
602
602
|
inStock: boolean;
|
|
@@ -685,6 +685,9 @@ interface ProductListItem {
|
|
|
685
685
|
url: string;
|
|
686
686
|
alt: string | null;
|
|
687
687
|
order: number;
|
|
688
|
+
/** COVER | LISTING | HOVER | GALLERY when the cover came from a roled
|
|
689
|
+
* product image; absent when it came from the inventory gallery (SDK 2.14.0). */
|
|
690
|
+
role?: string;
|
|
688
691
|
} | null;
|
|
689
692
|
labels: ProductLabel[];
|
|
690
693
|
isFeatured: boolean;
|
|
@@ -899,7 +902,19 @@ interface ProductDetail extends ProductListItem {
|
|
|
899
902
|
* null when uncapped or the shop hides stock counts. Cap the PDP quantity
|
|
900
903
|
* stepper with it, it is exactly the cart rule. SDK 2.13.0. */
|
|
901
904
|
maxPurchasableQuantity?: number | null;
|
|
902
|
-
|
|
905
|
+
/**
|
|
906
|
+
* @deprecated Not sent on the product detail, only on list cards. Use
|
|
907
|
+
* `media` (or `images`) for the gallery.
|
|
908
|
+
*/
|
|
909
|
+
image?: ProductListItem["image"];
|
|
910
|
+
/** @deprecated Not sent on the product detail, only on list cards. */
|
|
911
|
+
hoverImageUrl?: string | null;
|
|
912
|
+
/**
|
|
913
|
+
* @deprecated Not sent on the product detail, only on list cards. Read the
|
|
914
|
+
* PDP promotions with `catalog.getProductPromotions(slug)`.
|
|
915
|
+
*/
|
|
916
|
+
activePromotion?: ProductPromotionSummary | null;
|
|
917
|
+
longDescription?: string | null;
|
|
903
918
|
/**
|
|
904
919
|
* @deprecated Legacy per-listing images. Prefer `media`. Each carries its
|
|
905
920
|
* `role` (COVER | LISTING | HOVER | GALLERY) so the storefront can pick a
|
|
@@ -907,7 +922,7 @@ interface ProductDetail extends ProductListItem {
|
|
|
907
922
|
*/
|
|
908
923
|
images: Array<{
|
|
909
924
|
url: string;
|
|
910
|
-
alt?: string;
|
|
925
|
+
alt?: string | null;
|
|
911
926
|
order: number;
|
|
912
927
|
role?: string;
|
|
913
928
|
}>;
|
|
@@ -975,6 +990,10 @@ interface ProductDetail extends ProductListItem {
|
|
|
975
990
|
ogDescription?: string | null;
|
|
976
991
|
ogImage?: string | null;
|
|
977
992
|
};
|
|
993
|
+
/**
|
|
994
|
+
* @deprecated Never sent by the API. Load a group with
|
|
995
|
+
* `catalog.getProductGroup(slug)`.
|
|
996
|
+
*/
|
|
978
997
|
productGroups?: Array<{
|
|
979
998
|
slug: string;
|
|
980
999
|
name: string;
|
|
@@ -996,8 +1015,8 @@ interface Category {
|
|
|
996
1015
|
id: string;
|
|
997
1016
|
slug: string;
|
|
998
1017
|
name: string;
|
|
999
|
-
description?: string;
|
|
1000
|
-
imageUrl?: string;
|
|
1018
|
+
description?: string | null;
|
|
1019
|
+
imageUrl?: string | null;
|
|
1001
1020
|
children: Category[];
|
|
1002
1021
|
productCount?: number;
|
|
1003
1022
|
}
|
|
@@ -1060,11 +1079,18 @@ interface Menu {
|
|
|
1060
1079
|
locale: string;
|
|
1061
1080
|
items: MenuItem[];
|
|
1062
1081
|
}
|
|
1063
|
-
interface CategoryDetail extends Category {
|
|
1082
|
+
interface CategoryDetail extends Omit<Category, "children"> {
|
|
1083
|
+
/**
|
|
1084
|
+
* @deprecated Never sent on the category detail (it was typed as always
|
|
1085
|
+
* present, so `children.map` crashed). Read subcategories from
|
|
1086
|
+
* `catalog.getCategories()`.
|
|
1087
|
+
*/
|
|
1088
|
+
children?: Category[];
|
|
1064
1089
|
/**
|
|
1065
1090
|
* SEO/Open Graph for the category page. Matches the backend's nested `seo`
|
|
1066
1091
|
* shape (the old flat `seoTitle`/`seoDescription` never matched what the API
|
|
1067
|
-
* returned). `keywords` is always null for categories.
|
|
1092
|
+
* returned). `keywords` is always null for categories. Null when the
|
|
1093
|
+
* category has no text in the requested language (SDK 2.14.0 types it).
|
|
1068
1094
|
*/
|
|
1069
1095
|
seo?: {
|
|
1070
1096
|
title?: string | null;
|
|
@@ -1073,7 +1099,7 @@ interface CategoryDetail extends Category {
|
|
|
1073
1099
|
ogTitle?: string | null;
|
|
1074
1100
|
ogDescription?: string | null;
|
|
1075
1101
|
ogImage?: string | null;
|
|
1076
|
-
};
|
|
1102
|
+
} | null;
|
|
1077
1103
|
}
|
|
1078
1104
|
/**
|
|
1079
1105
|
* One available filter, derived from a curated parameter the merchant marked
|
|
@@ -1091,7 +1117,7 @@ interface FilterField {
|
|
|
1091
1117
|
groupSlug: string;
|
|
1092
1118
|
groupName: string;
|
|
1093
1119
|
unit?: string | null;
|
|
1094
|
-
values?: string[];
|
|
1120
|
+
values?: string[] | null;
|
|
1095
1121
|
}
|
|
1096
1122
|
interface FacetValue {
|
|
1097
1123
|
/** Raw stored value (normalized), for exact filtering. */
|
|
@@ -1342,7 +1368,7 @@ interface CartItemProduct {
|
|
|
1342
1368
|
* arbitrary translation row, so this could come back in another language. */
|
|
1343
1369
|
name: string;
|
|
1344
1370
|
sku: string;
|
|
1345
|
-
imageUrl?: string;
|
|
1371
|
+
imageUrl?: string | null;
|
|
1346
1372
|
inStock: boolean;
|
|
1347
1373
|
/** Pieces left for an "only X left" note on the cart line; null when the
|
|
1348
1374
|
* shop does not track stock, hides the nudge or has plenty. SDK 2.13.0. */
|
|
@@ -1440,7 +1466,7 @@ interface Cart {
|
|
|
1440
1466
|
* 200 net" was 20, now it is 24.20 at 21 %). It lowers base and VAT, see
|
|
1441
1467
|
* `taxBreakdown` and `vatTotal`. */
|
|
1442
1468
|
discountTotal: number;
|
|
1443
|
-
discount?: CartDiscount;
|
|
1469
|
+
discount?: CartDiscount | null;
|
|
1444
1470
|
/** Auto-apply promotion discount lines (sale/BOGO). */
|
|
1445
1471
|
appliedPromotions: CartPromotion[];
|
|
1446
1472
|
/** Sum of `appliedPromotions[].discountAmount`; already reflected in `grandTotal`. */
|
|
@@ -1645,6 +1671,12 @@ interface CheckoutInput {
|
|
|
1645
1671
|
* guests. See `customer.getLoyalty()` for the available balance.
|
|
1646
1672
|
*/
|
|
1647
1673
|
redeemLoyaltyPoints?: number;
|
|
1674
|
+
/**
|
|
1675
|
+
* Cart session to order. The SDK sends it in the `X-Cart-Session` header on
|
|
1676
|
+
* its own, so leave it out; the body field is for clients without the
|
|
1677
|
+
* header (SDK 2.14.0 documents it, the backend has always accepted it).
|
|
1678
|
+
*/
|
|
1679
|
+
sessionToken?: string;
|
|
1648
1680
|
}
|
|
1649
1681
|
type OrderStatus = (typeof OrderStatuses)[keyof typeof OrderStatuses];
|
|
1650
1682
|
type PaymentStatus = (typeof PaymentStatuses)[keyof typeof PaymentStatuses];
|
|
@@ -1660,6 +1692,8 @@ interface OrderListItem {
|
|
|
1660
1692
|
createdAt: number;
|
|
1661
1693
|
}
|
|
1662
1694
|
interface OrderItem {
|
|
1695
|
+
/** Order line id (SDK 2.14.0). */
|
|
1696
|
+
id?: string;
|
|
1663
1697
|
productName: string;
|
|
1664
1698
|
sku: string;
|
|
1665
1699
|
/** Photo snapshot from checkout, or the product's current photo. */
|
|
@@ -1671,9 +1705,23 @@ interface OrderItem {
|
|
|
1671
1705
|
productSlug?: string | null;
|
|
1672
1706
|
quantity: number;
|
|
1673
1707
|
unitPrice: number;
|
|
1708
|
+
/** VAT rate of the line in percent, e.g. 21 (SDK 2.14.0). */
|
|
1709
|
+
taxRate?: number;
|
|
1710
|
+
/** VAT of the whole line (SDK 2.14.0). */
|
|
1711
|
+
taxAmount?: number;
|
|
1674
1712
|
totalPrice: number;
|
|
1675
1713
|
totalPriceWithTax: number;
|
|
1676
1714
|
}
|
|
1715
|
+
/** A discount code applied to an order (SDK 2.14.0). */
|
|
1716
|
+
interface OrderDiscount {
|
|
1717
|
+
code: string;
|
|
1718
|
+
/** PERCENTAGE, FIXED_AMOUNT or FREE_SHIPPING. */
|
|
1719
|
+
type: string;
|
|
1720
|
+
/** Percent or amount as configured on the code. */
|
|
1721
|
+
value: number;
|
|
1722
|
+
/** Money the code took off this order. */
|
|
1723
|
+
appliedAmount: number;
|
|
1724
|
+
}
|
|
1677
1725
|
/**
|
|
1678
1726
|
* PII-minimized order view returned by `orders.track(token)`. The tracking
|
|
1679
1727
|
* token is shared in URLs and e-mails, so this deliberately omits full
|
|
@@ -1726,9 +1774,14 @@ interface OrderShipment {
|
|
|
1726
1774
|
createdAt: number;
|
|
1727
1775
|
}
|
|
1728
1776
|
interface OrderStatusHistory {
|
|
1729
|
-
|
|
1777
|
+
/** Null for the first entry of an order. */
|
|
1778
|
+
fromStatus?: OrderStatus | null;
|
|
1730
1779
|
toStatus: OrderStatus;
|
|
1731
|
-
note?: string;
|
|
1780
|
+
note?: string | null;
|
|
1781
|
+
/**
|
|
1782
|
+
* @deprecated Never sent: who changed the status is internal to the shop.
|
|
1783
|
+
* Kept only so existing templates keep compiling.
|
|
1784
|
+
*/
|
|
1732
1785
|
changedBy?: string;
|
|
1733
1786
|
createdAt: number;
|
|
1734
1787
|
}
|
|
@@ -1765,8 +1818,8 @@ interface OrderDetail extends OrderListItem {
|
|
|
1765
1818
|
shippingAddress: CheckoutAddress;
|
|
1766
1819
|
billingAddress: CheckoutAddress;
|
|
1767
1820
|
email: string;
|
|
1768
|
-
phone?: string;
|
|
1769
|
-
customerNote?: string;
|
|
1821
|
+
phone?: string | null;
|
|
1822
|
+
customerNote?: string | null;
|
|
1770
1823
|
subtotal: number;
|
|
1771
1824
|
/** Goods VAT before order discounts (goods subtotal = `subtotal` + `taxTotal`). */
|
|
1772
1825
|
taxTotal: number;
|
|
@@ -1788,6 +1841,12 @@ interface OrderDetail extends OrderListItem {
|
|
|
1788
1841
|
discountTotal: number;
|
|
1789
1842
|
fulfillmentStatus: FulfillmentStatus;
|
|
1790
1843
|
statusHistory: OrderStatusHistory[];
|
|
1844
|
+
/** Discount codes applied to the order (SDK 2.14.0). */
|
|
1845
|
+
discounts?: OrderDiscount[];
|
|
1846
|
+
/**
|
|
1847
|
+
* @deprecated Not sent on the order detail. Only `checkout.createOrder()`
|
|
1848
|
+
* returns it, see `CheckoutResult.trackingToken`.
|
|
1849
|
+
*/
|
|
1791
1850
|
trackingToken?: string;
|
|
1792
1851
|
/**
|
|
1793
1852
|
* Digital product delivery (GAP-07): download grants for any digital assets
|
|
@@ -2107,10 +2166,12 @@ interface DownloadUrl {
|
|
|
2107
2166
|
interface CustomerProfile {
|
|
2108
2167
|
id: string;
|
|
2109
2168
|
email: string;
|
|
2110
|
-
firstName?: string;
|
|
2111
|
-
lastName?: string;
|
|
2112
|
-
phone?: string;
|
|
2169
|
+
firstName?: string | null;
|
|
2170
|
+
lastName?: string | null;
|
|
2171
|
+
phone?: string | null;
|
|
2113
2172
|
emailVerified: boolean;
|
|
2173
|
+
/** Registration time (Unix ms). */
|
|
2174
|
+
createdAt?: number;
|
|
2114
2175
|
/**
|
|
2115
2176
|
* B2B approval gate (GAP-19). `false` = the account is awaiting merchant
|
|
2116
2177
|
* approval (or was deactivated) — show a "pending approval" banner and gate
|
|
@@ -2126,7 +2187,8 @@ interface CustomerAddress {
|
|
|
2126
2187
|
isDefault: boolean;
|
|
2127
2188
|
firstName: string;
|
|
2128
2189
|
lastName: string;
|
|
2129
|
-
|
|
2190
|
+
/** Null when not set. Send null on update to clear it. */
|
|
2191
|
+
company?: string | null;
|
|
2130
2192
|
street: string;
|
|
2131
2193
|
city: string;
|
|
2132
2194
|
zip: string;
|
|
@@ -2144,7 +2206,8 @@ interface CustomerAddress {
|
|
|
2144
2206
|
vatIdValid?: boolean | null;
|
|
2145
2207
|
/** When the VAT ID was last checked (ms). Read-only. */
|
|
2146
2208
|
vatIdCheckedAt?: number | null;
|
|
2147
|
-
|
|
2209
|
+
/** Null when not set. Send null on update to clear it. */
|
|
2210
|
+
phone?: string | null;
|
|
2148
2211
|
}
|
|
2149
2212
|
interface Page {
|
|
2150
2213
|
slug: string;
|
|
@@ -3199,6 +3262,7 @@ declare class BehioStorefront {
|
|
|
3199
3262
|
visitorId: string;
|
|
3200
3263
|
email: string;
|
|
3201
3264
|
}): Promise<SdkResult<{
|
|
3265
|
+
/** Single-use code for the offered product, issued by this call. */
|
|
3202
3266
|
code: string;
|
|
3203
3267
|
percent: number;
|
|
3204
3268
|
expiresAt: number;
|
|
@@ -3965,6 +4029,8 @@ interface AddressDetail {
|
|
|
3965
4029
|
formattedAddress: string;
|
|
3966
4030
|
lat: number;
|
|
3967
4031
|
lng: number;
|
|
4032
|
+
/** Set (and the address fields empty) when the request had no `placeId`. */
|
|
4033
|
+
error?: string | null;
|
|
3968
4034
|
}
|
|
3969
4035
|
declare class AddressModule {
|
|
3970
4036
|
private client;
|