@behio/storefront-sdk 0.27.0 → 0.29.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.
@@ -589,11 +589,18 @@ var CatalogModule = class {
589
589
  query: { locale: _optionalChain([options, 'optionalAccess', _25 => _25.locale]), currency: _optionalChain([options, 'optionalAccess', _26 => _26.currency]) }
590
590
  });
591
591
  }
592
- /** Cross-sell / related / upsell products for a product */
593
- async getCrossSell(productSlug) {
592
+ /**
593
+ * Cross-sell / related / upsell products for a product. Returns three
594
+ * separate lists: `related` (podobné produkty), `upsell` (dražší
595
+ * alternativy) and `crossSell` (doporučené k nákupu). Items are localized
596
+ * and priced in the requested currency, ready to render with the same card
597
+ * component as `getFeatured` / `getProductGroup`.
598
+ */
599
+ async getCrossSell(productSlug, options) {
594
600
  return this.client.request(
595
601
  "GET",
596
- `/catalog/products/${productSlug}/cross-sell`
602
+ `/catalog/products/${encodeURIComponent(productSlug)}/cross-sell`,
603
+ { query: { locale: _optionalChain([options, 'optionalAccess', _27 => _27.locale]), currency: _optionalChain([options, 'optionalAccess', _28 => _28.currency]) } }
597
604
  );
598
605
  }
599
606
  /** Active promotions applicable to a product (with countdown end time) */
@@ -615,7 +622,7 @@ var CatalogModule = class {
615
622
  /** List configured payment methods (filtered by currency). */
616
623
  async listPaymentMethods(opts) {
617
624
  const query = {};
618
- if (_optionalChain([opts, 'optionalAccess', _27 => _27.currency])) query.currency = opts.currency;
625
+ if (_optionalChain([opts, 'optionalAccess', _29 => _29.currency])) query.currency = opts.currency;
619
626
  return this.client.request("GET", "/catalog/payment-methods", { query });
620
627
  }
621
628
  };
@@ -861,7 +868,7 @@ var OrdersModule = class {
861
868
  /** List customer orders (requires auth) */
862
869
  async list(options) {
863
870
  return this.client.request("GET", "/orders", {
864
- query: { page: _optionalChain([options, 'optionalAccess', _28 => _28.page]), limit: _optionalChain([options, 'optionalAccess', _29 => _29.limit]) }
871
+ query: { page: _optionalChain([options, 'optionalAccess', _30 => _30.page]), limit: _optionalChain([options, 'optionalAccess', _31 => _31.limit]) }
865
872
  });
866
873
  }
867
874
  /** Get order detail (requires auth) */
@@ -1084,10 +1091,10 @@ var ShippingModule = class {
1084
1091
  */
1085
1092
  async listMethods(opts) {
1086
1093
  const query = {};
1087
- if (_optionalChain([opts, 'optionalAccess', _30 => _30.currency])) query.currency = opts.currency;
1088
- if (_optionalChain([opts, 'optionalAccess', _31 => _31.country])) query.country = opts.country;
1089
- if (_optionalChain([opts, 'optionalAccess', _32 => _32.cartTotal]) != null) query.cartTotal = String(opts.cartTotal);
1090
- if (_optionalChain([opts, 'optionalAccess', _33 => _33.cartWeightKg]) != null) query.cartWeightKg = String(opts.cartWeightKg);
1094
+ if (_optionalChain([opts, 'optionalAccess', _32 => _32.currency])) query.currency = opts.currency;
1095
+ if (_optionalChain([opts, 'optionalAccess', _33 => _33.country])) query.country = opts.country;
1096
+ if (_optionalChain([opts, 'optionalAccess', _34 => _34.cartTotal]) != null) query.cartTotal = String(opts.cartTotal);
1097
+ if (_optionalChain([opts, 'optionalAccess', _35 => _35.cartWeightKg]) != null) query.cartWeightKg = String(opts.cartWeightKg);
1091
1098
  return this.client.request(
1092
1099
  "GET",
1093
1100
  "/catalog/shipping-methods",
@@ -589,11 +589,18 @@ var CatalogModule = class {
589
589
  query: { locale: options?.locale, currency: options?.currency }
590
590
  });
591
591
  }
592
- /** Cross-sell / related / upsell products for a product */
593
- async getCrossSell(productSlug) {
592
+ /**
593
+ * Cross-sell / related / upsell products for a product. Returns three
594
+ * separate lists: `related` (podobné produkty), `upsell` (dražší
595
+ * alternativy) and `crossSell` (doporučené k nákupu). Items are localized
596
+ * and priced in the requested currency, ready to render with the same card
597
+ * component as `getFeatured` / `getProductGroup`.
598
+ */
599
+ async getCrossSell(productSlug, options) {
594
600
  return this.client.request(
595
601
  "GET",
596
- `/catalog/products/${productSlug}/cross-sell`
602
+ `/catalog/products/${encodeURIComponent(productSlug)}/cross-sell`,
603
+ { query: { locale: options?.locale, currency: options?.currency } }
597
604
  );
598
605
  }
599
606
  /** Active promotions applicable to a product (with countdown end time) */
@@ -48,6 +48,14 @@ interface ShopInfo {
48
48
  metaTitle?: string;
49
49
  metaDescription?: string;
50
50
  allowGuestCheckout: boolean;
51
+ /** Shop runs in B2B / wholesale mode (unlocks B2B-oriented UX). */
52
+ b2bMode: boolean;
53
+ /**
54
+ * Whether quote requests ("Poptat množstevní cenu") make sense for this shop.
55
+ * Currently follows B2B mode. Gate the request-quote CTA on this flag rather
56
+ * than hardcoded template config.
57
+ */
58
+ quotesEnabled: boolean;
51
59
  }
52
60
  interface ShopSeo {
53
61
  locale: string;
@@ -455,6 +463,15 @@ interface CartDiscount {
455
463
  type: string;
456
464
  value: number;
457
465
  }
466
+ /** One automatically applied promotion, surfaced as a discount line on the cart.
467
+ * Covers PERCENTAGE / FIXED_AMOUNT / BUY_X_GET_Y promos; the amount is already
468
+ * netted into `grandTotal`. */
469
+ interface CartPromotion {
470
+ slug: string;
471
+ name: string;
472
+ /** Total money saved on the cart by this promotion. */
473
+ discountAmount: number;
474
+ }
458
475
  interface Cart {
459
476
  id: string;
460
477
  sessionToken?: string;
@@ -462,6 +479,10 @@ interface Cart {
462
479
  subtotal: number;
463
480
  discountTotal: number;
464
481
  discount?: CartDiscount;
482
+ /** Auto-apply promotion discount lines (sale/BOGO). */
483
+ appliedPromotions: CartPromotion[];
484
+ /** Sum of `appliedPromotions[].discountAmount`; already reflected in `grandTotal`. */
485
+ promotionDiscountTotal: number;
465
486
  grandTotal: number;
466
487
  currency: string;
467
488
  itemCount: number;
@@ -872,11 +893,22 @@ interface ShippingQuote extends ShippingMethodSummary {
872
893
  interface CrossSellItem {
873
894
  productId: string;
874
895
  slug: string | null;
896
+ /** Localized product name (resolved for the requested locale, falls back to
897
+ * the eshop default language). */
875
898
  name: string;
876
899
  sku: string;
900
+ /** Price in the requested currency (or eshop default), including any price
901
+ * list override for the authenticated customer. `null` when hidden (B2B). */
877
902
  price: number | null;
903
+ /** Original (crossed-out) price in the same currency, when on sale. */
904
+ compareAtPrice: number | null;
905
+ /** Currency code the `price` / `compareAtPrice` are expressed in. */
906
+ currency: string;
878
907
  imageUrl: string | null;
908
+ /** Cached stock quantity of the recommended product. */
879
909
  stockCached: number;
910
+ /** Convenience flag: `stockCached > 0`. */
911
+ inStock: boolean;
880
912
  }
881
913
  interface ActivePromotion {
882
914
  id: string;
@@ -1304,8 +1336,17 @@ declare class CatalogModule {
1304
1336
  locale?: string;
1305
1337
  currency?: string;
1306
1338
  }): Promise<SdkResult<ProductGroup>>;
1307
- /** Cross-sell / related / upsell products for a product */
1308
- getCrossSell(productSlug: string): Promise<SdkResult<{
1339
+ /**
1340
+ * Cross-sell / related / upsell products for a product. Returns three
1341
+ * separate lists: `related` (podobné produkty), `upsell` (dražší
1342
+ * alternativy) and `crossSell` (doporučené k nákupu). Items are localized
1343
+ * and priced in the requested currency, ready to render with the same card
1344
+ * component as `getFeatured` / `getProductGroup`.
1345
+ */
1346
+ getCrossSell(productSlug: string, options?: {
1347
+ locale?: string;
1348
+ currency?: string;
1349
+ }): Promise<SdkResult<{
1309
1350
  related: CrossSellItem[];
1310
1351
  upsell: CrossSellItem[];
1311
1352
  crossSell: CrossSellItem[];
@@ -1603,4 +1644,4 @@ declare class ShippingModule {
1603
1644
  }>>;
1604
1645
  }
1605
1646
 
1606
- export { type MessageResponse as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type ReturnRequest as D, type SubmitReturnInput as E, type FilterField as F, type GiftCardBalance as G, type CookieConsent as H, type CookieConsentInput as I, type SubmitQuoteInput as J, type BackInStockSubscription as K, type AddToCartInput as L, type Menu as M, type AuthTokens as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, BehioApiError as T, type BundleItem as U, type CartDiscount as V, type WishlistItem as W, type CartItem as X, type CheckoutAddress as Y, type FulfillmentStatus as Z, type LoginInput as _, BehioStorefront as a, type OrderItem as a0, type OrderStatus as a1, type PaymentStatus as a2, type ProductPrice as a3, type ProductReview as a4, type ProductVariant as a5, type AddressType as a6, AddressTypes as a7, type BadgeTone as a8, type BehioErrorCode as a9, type RequestInterceptorConfig as aA, type ResponseInterceptor as aB, type ResponseInterceptorData as aC, type ReturnRequestItem as aD, type ReturnStatusItem as aE, type ReturnableOrderItem as aF, type SdkError as aG, type SdkResult as aH, type ShippingMethodSummary as aI, type ShippingQuote as aJ, type ShippingQuoteInput as aK, type ShopScript as aL, type ShopScriptPlacement as aM, type ShopScriptType as aN, err as aO, ok as aP, toSdkError as aQ, type BehioEventHandler as aa, type BehioEventType as ab, BehioNetworkError as ac, type CartBundleLine as ad, type CartBundleLineItem as ae, type CartItemProduct as af, type CheckoutPaymentMethod as ag, type DataGroupFieldType as ah, FulfillmentStatuses as ai, type GiftCardSummary as aj, type MenuItem as ak, type MenuItemRef as al, type MenuItemType as am, type OrderStatusHistory as an, OrderStatuses as ao, type OrderTracking as ap, type PageAttachment as aq, PaymentStatuses as ar, type ProductMedia as as, type ProductMediaVariant as at, ProductSort as au, type ProductSortValue as av, type ProductVolumePrice as aw, type QuoteItem as ax, type RegisterResult as ay, type RequestInterceptor as az, type PaginatedResponse as b, type ProductListItem as c, type ProductDetail as d, type CategoryDetail as e, type ProductLabel as f, type Cart as g, type CustomerProfile as h, type CustomerAddress as i, type AddressDetail as j, type OrderDetail as k, type OrderAccessRequestResponse as l, type OrderAccessVerifyResponse as m, type CheckoutInput as n, type PageDetail as o, type Page as p, type ShopScripts as q, type ShopSeo as r, type Bundle as s, type ProductGroup as t, type CrossSellItem as u, type ActivePromotion as v, type ProductReviewsResponse as w, type SubmitReviewInput as x, type ReturnableOrder as y, type ReturnStatus as z };
1647
+ export { type MessageResponse as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type ReturnRequest as D, type SubmitReturnInput as E, type FilterField as F, type GiftCardBalance as G, type CookieConsent as H, type CookieConsentInput as I, type SubmitQuoteInput as J, type BackInStockSubscription as K, type AddToCartInput as L, type Menu as M, type AuthTokens as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, BehioApiError as T, type BundleItem as U, type CartDiscount as V, type WishlistItem as W, type CartItem as X, type CheckoutAddress as Y, type FulfillmentStatus as Z, type LoginInput as _, BehioStorefront as a, type OrderItem as a0, type OrderStatus as a1, type PaymentStatus as a2, type ProductPrice as a3, type ProductReview as a4, type ProductVariant as a5, type AddressType as a6, AddressTypes as a7, type BadgeTone as a8, type BehioErrorCode as a9, type RequestInterceptor as aA, type RequestInterceptorConfig as aB, type ResponseInterceptor as aC, type ResponseInterceptorData as aD, type ReturnRequestItem as aE, type ReturnStatusItem as aF, type ReturnableOrderItem as aG, type SdkError as aH, type SdkResult as aI, type ShippingMethodSummary as aJ, type ShippingQuote as aK, type ShippingQuoteInput as aL, type ShopScript as aM, type ShopScriptPlacement as aN, type ShopScriptType as aO, err as aP, ok as aQ, toSdkError as aR, type BehioEventHandler as aa, type BehioEventType as ab, BehioNetworkError as ac, type CartBundleLine as ad, type CartBundleLineItem as ae, type CartItemProduct as af, type CartPromotion as ag, type CheckoutPaymentMethod as ah, type DataGroupFieldType as ai, FulfillmentStatuses as aj, type GiftCardSummary as ak, type MenuItem as al, type MenuItemRef as am, type MenuItemType as an, type OrderStatusHistory as ao, OrderStatuses as ap, type OrderTracking as aq, type PageAttachment as ar, PaymentStatuses as as, type ProductMedia as at, type ProductMediaVariant as au, ProductSort as av, type ProductSortValue as aw, type ProductVolumePrice as ax, type QuoteItem as ay, type RegisterResult as az, type PaginatedResponse as b, type ProductListItem as c, type ProductDetail as d, type CategoryDetail as e, type ProductLabel as f, type Cart as g, type CustomerProfile as h, type CustomerAddress as i, type AddressDetail as j, type OrderDetail as k, type OrderAccessRequestResponse as l, type OrderAccessVerifyResponse as m, type CheckoutInput as n, type PageDetail as o, type Page as p, type ShopScripts as q, type ShopSeo as r, type Bundle as s, type ProductGroup as t, type CrossSellItem as u, type ActivePromotion as v, type ProductReviewsResponse as w, type SubmitReviewInput as x, type ReturnableOrder as y, type ReturnStatus as z };
@@ -48,6 +48,14 @@ interface ShopInfo {
48
48
  metaTitle?: string;
49
49
  metaDescription?: string;
50
50
  allowGuestCheckout: boolean;
51
+ /** Shop runs in B2B / wholesale mode (unlocks B2B-oriented UX). */
52
+ b2bMode: boolean;
53
+ /**
54
+ * Whether quote requests ("Poptat množstevní cenu") make sense for this shop.
55
+ * Currently follows B2B mode. Gate the request-quote CTA on this flag rather
56
+ * than hardcoded template config.
57
+ */
58
+ quotesEnabled: boolean;
51
59
  }
52
60
  interface ShopSeo {
53
61
  locale: string;
@@ -455,6 +463,15 @@ interface CartDiscount {
455
463
  type: string;
456
464
  value: number;
457
465
  }
466
+ /** One automatically applied promotion, surfaced as a discount line on the cart.
467
+ * Covers PERCENTAGE / FIXED_AMOUNT / BUY_X_GET_Y promos; the amount is already
468
+ * netted into `grandTotal`. */
469
+ interface CartPromotion {
470
+ slug: string;
471
+ name: string;
472
+ /** Total money saved on the cart by this promotion. */
473
+ discountAmount: number;
474
+ }
458
475
  interface Cart {
459
476
  id: string;
460
477
  sessionToken?: string;
@@ -462,6 +479,10 @@ interface Cart {
462
479
  subtotal: number;
463
480
  discountTotal: number;
464
481
  discount?: CartDiscount;
482
+ /** Auto-apply promotion discount lines (sale/BOGO). */
483
+ appliedPromotions: CartPromotion[];
484
+ /** Sum of `appliedPromotions[].discountAmount`; already reflected in `grandTotal`. */
485
+ promotionDiscountTotal: number;
465
486
  grandTotal: number;
466
487
  currency: string;
467
488
  itemCount: number;
@@ -872,11 +893,22 @@ interface ShippingQuote extends ShippingMethodSummary {
872
893
  interface CrossSellItem {
873
894
  productId: string;
874
895
  slug: string | null;
896
+ /** Localized product name (resolved for the requested locale, falls back to
897
+ * the eshop default language). */
875
898
  name: string;
876
899
  sku: string;
900
+ /** Price in the requested currency (or eshop default), including any price
901
+ * list override for the authenticated customer. `null` when hidden (B2B). */
877
902
  price: number | null;
903
+ /** Original (crossed-out) price in the same currency, when on sale. */
904
+ compareAtPrice: number | null;
905
+ /** Currency code the `price` / `compareAtPrice` are expressed in. */
906
+ currency: string;
878
907
  imageUrl: string | null;
908
+ /** Cached stock quantity of the recommended product. */
879
909
  stockCached: number;
910
+ /** Convenience flag: `stockCached > 0`. */
911
+ inStock: boolean;
880
912
  }
881
913
  interface ActivePromotion {
882
914
  id: string;
@@ -1304,8 +1336,17 @@ declare class CatalogModule {
1304
1336
  locale?: string;
1305
1337
  currency?: string;
1306
1338
  }): Promise<SdkResult<ProductGroup>>;
1307
- /** Cross-sell / related / upsell products for a product */
1308
- getCrossSell(productSlug: string): Promise<SdkResult<{
1339
+ /**
1340
+ * Cross-sell / related / upsell products for a product. Returns three
1341
+ * separate lists: `related` (podobné produkty), `upsell` (dražší
1342
+ * alternativy) and `crossSell` (doporučené k nákupu). Items are localized
1343
+ * and priced in the requested currency, ready to render with the same card
1344
+ * component as `getFeatured` / `getProductGroup`.
1345
+ */
1346
+ getCrossSell(productSlug: string, options?: {
1347
+ locale?: string;
1348
+ currency?: string;
1349
+ }): Promise<SdkResult<{
1309
1350
  related: CrossSellItem[];
1310
1351
  upsell: CrossSellItem[];
1311
1352
  crossSell: CrossSellItem[];
@@ -1603,4 +1644,4 @@ declare class ShippingModule {
1603
1644
  }>>;
1604
1645
  }
1605
1646
 
1606
- export { type MessageResponse as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type ReturnRequest as D, type SubmitReturnInput as E, type FilterField as F, type GiftCardBalance as G, type CookieConsent as H, type CookieConsentInput as I, type SubmitQuoteInput as J, type BackInStockSubscription as K, type AddToCartInput as L, type Menu as M, type AuthTokens as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, BehioApiError as T, type BundleItem as U, type CartDiscount as V, type WishlistItem as W, type CartItem as X, type CheckoutAddress as Y, type FulfillmentStatus as Z, type LoginInput as _, BehioStorefront as a, type OrderItem as a0, type OrderStatus as a1, type PaymentStatus as a2, type ProductPrice as a3, type ProductReview as a4, type ProductVariant as a5, type AddressType as a6, AddressTypes as a7, type BadgeTone as a8, type BehioErrorCode as a9, type RequestInterceptorConfig as aA, type ResponseInterceptor as aB, type ResponseInterceptorData as aC, type ReturnRequestItem as aD, type ReturnStatusItem as aE, type ReturnableOrderItem as aF, type SdkError as aG, type SdkResult as aH, type ShippingMethodSummary as aI, type ShippingQuote as aJ, type ShippingQuoteInput as aK, type ShopScript as aL, type ShopScriptPlacement as aM, type ShopScriptType as aN, err as aO, ok as aP, toSdkError as aQ, type BehioEventHandler as aa, type BehioEventType as ab, BehioNetworkError as ac, type CartBundleLine as ad, type CartBundleLineItem as ae, type CartItemProduct as af, type CheckoutPaymentMethod as ag, type DataGroupFieldType as ah, FulfillmentStatuses as ai, type GiftCardSummary as aj, type MenuItem as ak, type MenuItemRef as al, type MenuItemType as am, type OrderStatusHistory as an, OrderStatuses as ao, type OrderTracking as ap, type PageAttachment as aq, PaymentStatuses as ar, type ProductMedia as as, type ProductMediaVariant as at, ProductSort as au, type ProductSortValue as av, type ProductVolumePrice as aw, type QuoteItem as ax, type RegisterResult as ay, type RequestInterceptor as az, type PaginatedResponse as b, type ProductListItem as c, type ProductDetail as d, type CategoryDetail as e, type ProductLabel as f, type Cart as g, type CustomerProfile as h, type CustomerAddress as i, type AddressDetail as j, type OrderDetail as k, type OrderAccessRequestResponse as l, type OrderAccessVerifyResponse as m, type CheckoutInput as n, type PageDetail as o, type Page as p, type ShopScripts as q, type ShopSeo as r, type Bundle as s, type ProductGroup as t, type CrossSellItem as u, type ActivePromotion as v, type ProductReviewsResponse as w, type SubmitReviewInput as x, type ReturnableOrder as y, type ReturnStatus as z };
1647
+ export { type MessageResponse as $, type AddressSuggestion as A, type BehioStorefrontConfig as B, type Category as C, type ReturnRequest as D, type SubmitReturnInput as E, type FilterField as F, type GiftCardBalance as G, type CookieConsent as H, type CookieConsentInput as I, type SubmitQuoteInput as J, type BackInStockSubscription as K, type AddToCartInput as L, type Menu as M, type AuthTokens as N, type OrderListItem as O, type ProductsQuery as P, type QuoteRequest as Q, type RegisterInput as R, type ShopInfo as S, BehioApiError as T, type BundleItem as U, type CartDiscount as V, type WishlistItem as W, type CartItem as X, type CheckoutAddress as Y, type FulfillmentStatus as Z, type LoginInput as _, BehioStorefront as a, type OrderItem as a0, type OrderStatus as a1, type PaymentStatus as a2, type ProductPrice as a3, type ProductReview as a4, type ProductVariant as a5, type AddressType as a6, AddressTypes as a7, type BadgeTone as a8, type BehioErrorCode as a9, type RequestInterceptor as aA, type RequestInterceptorConfig as aB, type ResponseInterceptor as aC, type ResponseInterceptorData as aD, type ReturnRequestItem as aE, type ReturnStatusItem as aF, type ReturnableOrderItem as aG, type SdkError as aH, type SdkResult as aI, type ShippingMethodSummary as aJ, type ShippingQuote as aK, type ShippingQuoteInput as aL, type ShopScript as aM, type ShopScriptPlacement as aN, type ShopScriptType as aO, err as aP, ok as aQ, toSdkError as aR, type BehioEventHandler as aa, type BehioEventType as ab, BehioNetworkError as ac, type CartBundleLine as ad, type CartBundleLineItem as ae, type CartItemProduct as af, type CartPromotion as ag, type CheckoutPaymentMethod as ah, type DataGroupFieldType as ai, FulfillmentStatuses as aj, type GiftCardSummary as ak, type MenuItem as al, type MenuItemRef as am, type MenuItemType as an, type OrderStatusHistory as ao, OrderStatuses as ap, type OrderTracking as aq, type PageAttachment as ar, PaymentStatuses as as, type ProductMedia as at, type ProductMediaVariant as au, ProductSort as av, type ProductSortValue as aw, type ProductVolumePrice as ax, type QuoteItem as ay, type RegisterResult as az, type PaginatedResponse as b, type ProductListItem as c, type ProductDetail as d, type CategoryDetail as e, type ProductLabel as f, type Cart as g, type CustomerProfile as h, type CustomerAddress as i, type AddressDetail as j, type OrderDetail as k, type OrderAccessRequestResponse as l, type OrderAccessVerifyResponse as m, type CheckoutInput as n, type PageDetail as o, type Page as p, type ShopScripts as q, type ShopSeo as r, type Bundle as s, type ProductGroup as t, type CrossSellItem as u, type ActivePromotion as v, type ProductReviewsResponse as w, type SubmitReviewInput as x, type ReturnableOrder as y, type ReturnStatus as z };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { v as ActivePromotion, L as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a6 as AddressType, a7 as AddressTypes, N as AuthTokens, K as BackInStockSubscription, a8 as BadgeTone, T as BehioApiError, a9 as BehioErrorCode, aa as BehioEventHandler, ab as BehioEventType, ac as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, s as Bundle, U as BundleItem, g as Cart, ad as CartBundleLine, ae as CartBundleLineItem, V as CartDiscount, X as CartItem, af as CartItemProduct, C as Category, e as CategoryDetail, Y as CheckoutAddress, n as CheckoutInput, ag as CheckoutPaymentMethod, H as CookieConsent, I as CookieConsentInput, u as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ah as DataGroupFieldType, F as FilterField, Z as FulfillmentStatus, ai as FulfillmentStatuses, G as GiftCardBalance, aj as GiftCardSummary, _ as LoginInput, M as Menu, ak as MenuItem, al as MenuItemRef, am as MenuItemType, $ as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, a0 as OrderItem, O as OrderListItem, a1 as OrderStatus, an as OrderStatusHistory, ao as OrderStatuses, ap as OrderTracking, p as Page, aq as PageAttachment, o as PageDetail, b as PaginatedResponse, a2 as PaymentStatus, ar as PaymentStatuses, d as ProductDetail, t as ProductGroup, f as ProductLabel, c as ProductListItem, as as ProductMedia, at as ProductMediaVariant, a3 as ProductPrice, a4 as ProductReview, w as ProductReviewsResponse, au as ProductSort, av as ProductSortValue, a5 as ProductVariant, aw as ProductVolumePrice, P as ProductsQuery, ax as QuoteItem, Q as QuoteRequest, R as RegisterInput, ay as RegisterResult, az as RequestInterceptor, aA as RequestInterceptorConfig, aB as ResponseInterceptor, aC as ResponseInterceptorData, D as ReturnRequest, aD as ReturnRequestItem, z as ReturnStatus, aE as ReturnStatusItem, y as ReturnableOrder, aF as ReturnableOrderItem, aG as SdkError, aH as SdkResult, aI as ShippingMethodSummary, aJ as ShippingQuote, aK as ShippingQuoteInput, S as ShopInfo, aL as ShopScript, aM as ShopScriptPlacement, aN as ShopScriptType, q as ShopScripts, r as ShopSeo, J as SubmitQuoteInput, E as SubmitReturnInput, x as SubmitReviewInput, W as WishlistItem, aO as err, aP as ok, aQ as toSdkError } from './client-DL533jvY.mjs';
1
+ export { v as ActivePromotion, L as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a6 as AddressType, a7 as AddressTypes, N as AuthTokens, K as BackInStockSubscription, a8 as BadgeTone, T as BehioApiError, a9 as BehioErrorCode, aa as BehioEventHandler, ab as BehioEventType, ac as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, s as Bundle, U as BundleItem, g as Cart, ad as CartBundleLine, ae as CartBundleLineItem, V as CartDiscount, X as CartItem, af as CartItemProduct, ag as CartPromotion, C as Category, e as CategoryDetail, Y as CheckoutAddress, n as CheckoutInput, ah as CheckoutPaymentMethod, H as CookieConsent, I as CookieConsentInput, u as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ai as DataGroupFieldType, F as FilterField, Z as FulfillmentStatus, aj as FulfillmentStatuses, G as GiftCardBalance, ak as GiftCardSummary, _ as LoginInput, M as Menu, al as MenuItem, am as MenuItemRef, an as MenuItemType, $ as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, a0 as OrderItem, O as OrderListItem, a1 as OrderStatus, ao as OrderStatusHistory, ap as OrderStatuses, aq as OrderTracking, p as Page, ar as PageAttachment, o as PageDetail, b as PaginatedResponse, a2 as PaymentStatus, as as PaymentStatuses, d as ProductDetail, t as ProductGroup, f as ProductLabel, c as ProductListItem, at as ProductMedia, au as ProductMediaVariant, a3 as ProductPrice, a4 as ProductReview, w as ProductReviewsResponse, av as ProductSort, aw as ProductSortValue, a5 as ProductVariant, ax as ProductVolumePrice, P as ProductsQuery, ay as QuoteItem, Q as QuoteRequest, R as RegisterInput, az as RegisterResult, aA as RequestInterceptor, aB as RequestInterceptorConfig, aC as ResponseInterceptor, aD as ResponseInterceptorData, D as ReturnRequest, aE as ReturnRequestItem, z as ReturnStatus, aF as ReturnStatusItem, y as ReturnableOrder, aG as ReturnableOrderItem, aH as SdkError, aI as SdkResult, aJ as ShippingMethodSummary, aK as ShippingQuote, aL as ShippingQuoteInput, S as ShopInfo, aM as ShopScript, aN as ShopScriptPlacement, aO as ShopScriptType, q as ShopScripts, r as ShopSeo, J as SubmitQuoteInput, E as SubmitReturnInput, x as SubmitReviewInput, W as WishlistItem, aP as err, aQ as ok, aR as toSdkError } from './client-BQroQWyY.mjs';
2
2
 
3
3
  /**
4
4
  * Format a price amount with currency using Intl.NumberFormat.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { v as ActivePromotion, L as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a6 as AddressType, a7 as AddressTypes, N as AuthTokens, K as BackInStockSubscription, a8 as BadgeTone, T as BehioApiError, a9 as BehioErrorCode, aa as BehioEventHandler, ab as BehioEventType, ac as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, s as Bundle, U as BundleItem, g as Cart, ad as CartBundleLine, ae as CartBundleLineItem, V as CartDiscount, X as CartItem, af as CartItemProduct, C as Category, e as CategoryDetail, Y as CheckoutAddress, n as CheckoutInput, ag as CheckoutPaymentMethod, H as CookieConsent, I as CookieConsentInput, u as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ah as DataGroupFieldType, F as FilterField, Z as FulfillmentStatus, ai as FulfillmentStatuses, G as GiftCardBalance, aj as GiftCardSummary, _ as LoginInput, M as Menu, ak as MenuItem, al as MenuItemRef, am as MenuItemType, $ as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, a0 as OrderItem, O as OrderListItem, a1 as OrderStatus, an as OrderStatusHistory, ao as OrderStatuses, ap as OrderTracking, p as Page, aq as PageAttachment, o as PageDetail, b as PaginatedResponse, a2 as PaymentStatus, ar as PaymentStatuses, d as ProductDetail, t as ProductGroup, f as ProductLabel, c as ProductListItem, as as ProductMedia, at as ProductMediaVariant, a3 as ProductPrice, a4 as ProductReview, w as ProductReviewsResponse, au as ProductSort, av as ProductSortValue, a5 as ProductVariant, aw as ProductVolumePrice, P as ProductsQuery, ax as QuoteItem, Q as QuoteRequest, R as RegisterInput, ay as RegisterResult, az as RequestInterceptor, aA as RequestInterceptorConfig, aB as ResponseInterceptor, aC as ResponseInterceptorData, D as ReturnRequest, aD as ReturnRequestItem, z as ReturnStatus, aE as ReturnStatusItem, y as ReturnableOrder, aF as ReturnableOrderItem, aG as SdkError, aH as SdkResult, aI as ShippingMethodSummary, aJ as ShippingQuote, aK as ShippingQuoteInput, S as ShopInfo, aL as ShopScript, aM as ShopScriptPlacement, aN as ShopScriptType, q as ShopScripts, r as ShopSeo, J as SubmitQuoteInput, E as SubmitReturnInput, x as SubmitReviewInput, W as WishlistItem, aO as err, aP as ok, aQ as toSdkError } from './client-DL533jvY.js';
1
+ export { v as ActivePromotion, L as AddToCartInput, j as AddressDetail, A as AddressSuggestion, a6 as AddressType, a7 as AddressTypes, N as AuthTokens, K as BackInStockSubscription, a8 as BadgeTone, T as BehioApiError, a9 as BehioErrorCode, aa as BehioEventHandler, ab as BehioEventType, ac as BehioNetworkError, a as BehioStorefront, B as BehioStorefrontConfig, s as Bundle, U as BundleItem, g as Cart, ad as CartBundleLine, ae as CartBundleLineItem, V as CartDiscount, X as CartItem, af as CartItemProduct, ag as CartPromotion, C as Category, e as CategoryDetail, Y as CheckoutAddress, n as CheckoutInput, ah as CheckoutPaymentMethod, H as CookieConsent, I as CookieConsentInput, u as CrossSellItem, i as CustomerAddress, h as CustomerProfile, ai as DataGroupFieldType, F as FilterField, Z as FulfillmentStatus, aj as FulfillmentStatuses, G as GiftCardBalance, ak as GiftCardSummary, _ as LoginInput, M as Menu, al as MenuItem, am as MenuItemRef, an as MenuItemType, $ as MessageResponse, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, k as OrderDetail, a0 as OrderItem, O as OrderListItem, a1 as OrderStatus, ao as OrderStatusHistory, ap as OrderStatuses, aq as OrderTracking, p as Page, ar as PageAttachment, o as PageDetail, b as PaginatedResponse, a2 as PaymentStatus, as as PaymentStatuses, d as ProductDetail, t as ProductGroup, f as ProductLabel, c as ProductListItem, at as ProductMedia, au as ProductMediaVariant, a3 as ProductPrice, a4 as ProductReview, w as ProductReviewsResponse, av as ProductSort, aw as ProductSortValue, a5 as ProductVariant, ax as ProductVolumePrice, P as ProductsQuery, ay as QuoteItem, Q as QuoteRequest, R as RegisterInput, az as RegisterResult, aA as RequestInterceptor, aB as RequestInterceptorConfig, aC as ResponseInterceptor, aD as ResponseInterceptorData, D as ReturnRequest, aE as ReturnRequestItem, z as ReturnStatus, aF as ReturnStatusItem, y as ReturnableOrder, aG as ReturnableOrderItem, aH as SdkError, aI as SdkResult, aJ as ShippingMethodSummary, aK as ShippingQuote, aL as ShippingQuoteInput, S as ShopInfo, aM as ShopScript, aN as ShopScriptPlacement, aO as ShopScriptType, q as ShopScripts, r as ShopSeo, J as SubmitQuoteInput, E as SubmitReturnInput, x as SubmitReviewInput, W as WishlistItem, aP as err, aQ as ok, aR as toSdkError } from './client-BQroQWyY.js';
2
2
 
3
3
  /**
4
4
  * Format a price amount with currency using Intl.NumberFormat.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var _chunkJIAOZ5YWjs = require('./chunk-JIAOZ5YW.js');
14
14
 
15
15
 
16
16
 
17
- var _chunkHOL6WRHRjs = require('./chunk-HOL6WRHR.js');
17
+ var _chunkCXKZLKUYjs = require('./chunk-CXKZLKUY.js');
18
18
 
19
19
 
20
20
 
@@ -29,4 +29,4 @@ var _chunkHOL6WRHRjs = require('./chunk-HOL6WRHR.js');
29
29
 
30
30
 
31
31
 
32
- exports.AddressTypes = _chunkHOL6WRHRjs.AddressTypes; exports.BehioApiError = _chunkHOL6WRHRjs.BehioApiError; exports.BehioNetworkError = _chunkHOL6WRHRjs.BehioNetworkError; exports.BehioStorefront = _chunkHOL6WRHRjs.BehioStorefront; exports.FulfillmentStatuses = _chunkHOL6WRHRjs.FulfillmentStatuses; exports.OrderStatuses = _chunkHOL6WRHRjs.OrderStatuses; exports.PaymentStatuses = _chunkHOL6WRHRjs.PaymentStatuses; exports.ProductSort = _chunkHOL6WRHRjs.ProductSort; exports.err = _chunkHOL6WRHRjs.err; exports.formatPrice = _chunkJIAOZ5YWjs.formatPrice; exports.ok = _chunkHOL6WRHRjs.ok; exports.toSdkError = _chunkHOL6WRHRjs.toSdkError; exports.trackEcommerceEvent = _chunkJIAOZ5YWjs.trackEcommerceEvent;
32
+ exports.AddressTypes = _chunkCXKZLKUYjs.AddressTypes; exports.BehioApiError = _chunkCXKZLKUYjs.BehioApiError; exports.BehioNetworkError = _chunkCXKZLKUYjs.BehioNetworkError; exports.BehioStorefront = _chunkCXKZLKUYjs.BehioStorefront; exports.FulfillmentStatuses = _chunkCXKZLKUYjs.FulfillmentStatuses; exports.OrderStatuses = _chunkCXKZLKUYjs.OrderStatuses; exports.PaymentStatuses = _chunkCXKZLKUYjs.PaymentStatuses; exports.ProductSort = _chunkCXKZLKUYjs.ProductSort; exports.err = _chunkCXKZLKUYjs.err; exports.formatPrice = _chunkJIAOZ5YWjs.formatPrice; exports.ok = _chunkCXKZLKUYjs.ok; exports.toSdkError = _chunkCXKZLKUYjs.toSdkError; exports.trackEcommerceEvent = _chunkJIAOZ5YWjs.trackEcommerceEvent;
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  err,
15
15
  ok,
16
16
  toSdkError
17
- } from "./chunk-O5UHKZPG.mjs";
17
+ } from "./chunk-TN5C6CAB.mjs";
18
18
  export {
19
19
  AddressTypes,
20
20
  BehioApiError,
package/dist/next.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-DL533jvY.mjs';
1
+ import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-BQroQWyY.mjs';
2
2
 
3
3
  interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
4
4
  /** Override the cart session cookie name (default: "behio_cart_session"). */
package/dist/next.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-DL533jvY.js';
1
+ import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-BQroQWyY.js';
2
2
 
3
3
  interface GetBehioOptions extends Partial<BehioStorefrontConfig> {
4
4
  /** Override the cart session cookie name (default: "behio_cart_session"). */
package/dist/next.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkHOL6WRHRjs = require('./chunk-HOL6WRHR.js');
3
+ var _chunkCXKZLKUYjs = require('./chunk-CXKZLKUY.js');
4
4
 
5
5
  // src/next.ts
6
6
  var _headers = require('next/headers');
@@ -18,7 +18,7 @@ async function getBehio(options = {}) {
18
18
  const locale = _nullishCoalesce(options.locale, () => ( process.env.BEHIO_LOCALE));
19
19
  const currency = _nullishCoalesce(options.currency, () => ( process.env.BEHIO_CURRENCY));
20
20
  const cookieName = _nullishCoalesce(options.cartCookieName, () => ( CART_COOKIE_NAME));
21
- const client = new (0, _chunkHOL6WRHRjs.BehioStorefront)({
21
+ const client = new (0, _chunkCXKZLKUYjs.BehioStorefront)({
22
22
  apiKey,
23
23
  ...baseUrl ? { baseUrl } : {},
24
24
  ...locale ? { locale } : {},
package/dist/next.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BehioStorefront
3
- } from "./chunk-O5UHKZPG.mjs";
3
+ } from "./chunk-TN5C6CAB.mjs";
4
4
 
5
5
  // src/next.ts
6
6
  import { cookies } from "next/headers";
package/dist/react.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
- import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, M as Menu, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopScripts, r as ShopSeo, s as Bundle, t as ProductGroup, u as CrossSellItem, v as ActivePromotion, G as GiftCardBalance, W as WishlistItem, w as ProductReviewsResponse, x as SubmitReviewInput, y as ReturnableOrder, z as ReturnStatus, D as ReturnRequest, E as SubmitReturnInput, H as CookieConsent, I as CookieConsentInput, Q as QuoteRequest, J as SubmitQuoteInput, K as BackInStockSubscription } from './client-DL533jvY.mjs';
5
- export { L as AddToCartInput, N as AuthTokens, T as BehioApiError, U as BundleItem, V as CartDiscount, X as CartItem, Y as CheckoutAddress, Z as FulfillmentStatus, _ as LoginInput, $ as MessageResponse, a0 as OrderItem, a1 as OrderStatus, a2 as PaymentStatus, a3 as ProductPrice, a4 as ProductReview, a5 as ProductVariant } from './client-DL533jvY.mjs';
4
+ import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, M as Menu, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopScripts, r as ShopSeo, s as Bundle, t as ProductGroup, u as CrossSellItem, v as ActivePromotion, G as GiftCardBalance, W as WishlistItem, w as ProductReviewsResponse, x as SubmitReviewInput, y as ReturnableOrder, z as ReturnStatus, D as ReturnRequest, E as SubmitReturnInput, H as CookieConsent, I as CookieConsentInput, Q as QuoteRequest, J as SubmitQuoteInput, K as BackInStockSubscription } from './client-BQroQWyY.mjs';
5
+ export { L as AddToCartInput, N as AuthTokens, T as BehioApiError, U as BundleItem, V as CartDiscount, X as CartItem, Y as CheckoutAddress, Z as FulfillmentStatus, _ as LoginInput, $ as MessageResponse, a0 as OrderItem, a1 as OrderStatus, a2 as PaymentStatus, a3 as ProductPrice, a4 as ProductReview, a5 as ProductVariant } from './client-BQroQWyY.mjs';
6
6
  import * as _tanstack_query_core from '@tanstack/query-core';
7
7
  export { EcommerceEventName, EcommerceItem, EcommercePayload, formatPrice, trackEcommerceEvent } from './index.mjs';
8
8
 
@@ -571,6 +571,8 @@ type CrossSellResponse = {
571
571
  * different sections on the product detail page.
572
572
  */
573
573
  declare function useCrossSell(productSlug: string | undefined, options?: {
574
+ locale?: string;
575
+ currency?: string;
574
576
  enabled?: boolean;
575
577
  initialData?: CrossSellResponse;
576
578
  }): _tanstack_react_query.UseQueryResult<NoInfer<CrossSellResponse>, Error>;
package/dist/react.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { QueryClient } from '@tanstack/react-query';
4
- import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, M as Menu, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopScripts, r as ShopSeo, s as Bundle, t as ProductGroup, u as CrossSellItem, v as ActivePromotion, G as GiftCardBalance, W as WishlistItem, w as ProductReviewsResponse, x as SubmitReviewInput, y as ReturnableOrder, z as ReturnStatus, D as ReturnRequest, E as SubmitReturnInput, H as CookieConsent, I as CookieConsentInput, Q as QuoteRequest, J as SubmitQuoteInput, K as BackInStockSubscription } from './client-DL533jvY.js';
5
- export { L as AddToCartInput, N as AuthTokens, T as BehioApiError, U as BundleItem, V as CartDiscount, X as CartItem, Y as CheckoutAddress, Z as FulfillmentStatus, _ as LoginInput, $ as MessageResponse, a0 as OrderItem, a1 as OrderStatus, a2 as PaymentStatus, a3 as ProductPrice, a4 as ProductReview, a5 as ProductVariant } from './client-DL533jvY.js';
4
+ import { a as BehioStorefront, P as ProductsQuery, b as PaginatedResponse, c as ProductListItem, d as ProductDetail, C as Category, e as CategoryDetail, M as Menu, f as ProductLabel, F as FilterField, g as Cart, h as CustomerProfile, R as RegisterInput, i as CustomerAddress, A as AddressSuggestion, j as AddressDetail, O as OrderListItem, k as OrderDetail, l as OrderAccessRequestResponse, m as OrderAccessVerifyResponse, n as CheckoutInput, o as PageDetail, p as Page, S as ShopInfo, q as ShopScripts, r as ShopSeo, s as Bundle, t as ProductGroup, u as CrossSellItem, v as ActivePromotion, G as GiftCardBalance, W as WishlistItem, w as ProductReviewsResponse, x as SubmitReviewInput, y as ReturnableOrder, z as ReturnStatus, D as ReturnRequest, E as SubmitReturnInput, H as CookieConsent, I as CookieConsentInput, Q as QuoteRequest, J as SubmitQuoteInput, K as BackInStockSubscription } from './client-BQroQWyY.js';
5
+ export { L as AddToCartInput, N as AuthTokens, T as BehioApiError, U as BundleItem, V as CartDiscount, X as CartItem, Y as CheckoutAddress, Z as FulfillmentStatus, _ as LoginInput, $ as MessageResponse, a0 as OrderItem, a1 as OrderStatus, a2 as PaymentStatus, a3 as ProductPrice, a4 as ProductReview, a5 as ProductVariant } from './client-BQroQWyY.js';
6
6
  import * as _tanstack_query_core from '@tanstack/query-core';
7
7
  export { EcommerceEventName, EcommerceItem, EcommercePayload, formatPrice, trackEcommerceEvent } from './index.js';
8
8
 
@@ -571,6 +571,8 @@ type CrossSellResponse = {
571
571
  * different sections on the product detail page.
572
572
  */
573
573
  declare function useCrossSell(productSlug: string | undefined, options?: {
574
+ locale?: string;
575
+ currency?: string;
574
576
  enabled?: boolean;
575
577
  initialData?: CrossSellResponse;
576
578
  }): _tanstack_react_query.UseQueryResult<NoInfer<CrossSellResponse>, Error>;
package/dist/react.js CHANGED
@@ -4,7 +4,7 @@
4
4
  var _chunkJIAOZ5YWjs = require('./chunk-JIAOZ5YW.js');
5
5
 
6
6
 
7
- var _chunkHOL6WRHRjs = require('./chunk-HOL6WRHR.js');
7
+ var _chunkCXKZLKUYjs = require('./chunk-CXKZLKUY.js');
8
8
 
9
9
  // src/react/provider.tsx
10
10
  var _react = require('react');
@@ -134,7 +134,7 @@ function BehioProvider({
134
134
  const [activeCurrency, setActiveCurrency] = _react.useState.call(void 0, resolveInitialCurrency);
135
135
  const clientRef = _react.useRef.call(void 0, null);
136
136
  if (!clientRef.current) {
137
- clientRef.current = new (0, _chunkHOL6WRHRjs.BehioStorefront)({
137
+ clientRef.current = new (0, _chunkCXKZLKUYjs.BehioStorefront)({
138
138
  apiKey,
139
139
  baseUrl,
140
140
  ...shopDomain ? { shopDomain } : {},
@@ -1550,10 +1550,15 @@ function useProductGroup(slug, options) {
1550
1550
  function useCrossSell(productSlug, options) {
1551
1551
  const { client } = useBehio();
1552
1552
  return _reactquery.useQuery.call(void 0, {
1553
- queryKey: ["behio", "cross-sell", productSlug],
1554
- queryFn: () => unwrap(client.catalog.getCrossSell(productSlug)),
1555
- enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _90 => _90.enabled]), () => ( true))),
1556
- initialData: _optionalChain([options, 'optionalAccess', _91 => _91.initialData])
1553
+ queryKey: ["behio", "cross-sell", productSlug, _optionalChain([options, 'optionalAccess', _90 => _90.locale]), _optionalChain([options, 'optionalAccess', _91 => _91.currency])],
1554
+ queryFn: () => unwrap(
1555
+ client.catalog.getCrossSell(productSlug, {
1556
+ locale: _optionalChain([options, 'optionalAccess', _92 => _92.locale]),
1557
+ currency: _optionalChain([options, 'optionalAccess', _93 => _93.currency])
1558
+ })
1559
+ ),
1560
+ enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _94 => _94.enabled]), () => ( true))),
1561
+ initialData: _optionalChain([options, 'optionalAccess', _95 => _95.initialData])
1557
1562
  });
1558
1563
  }
1559
1564
 
@@ -1564,8 +1569,8 @@ function useProductPromotions(productSlug, options) {
1564
1569
  return _reactquery.useQuery.call(void 0, {
1565
1570
  queryKey: ["behio", "product-promotions", productSlug],
1566
1571
  queryFn: () => unwrap(client.catalog.getProductPromotions(productSlug)),
1567
- enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _92 => _92.enabled]), () => ( true))),
1568
- refetchInterval: _optionalChain([options, 'optionalAccess', _93 => _93.refetchIntervalMs])
1572
+ enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _96 => _96.enabled]), () => ( true))),
1573
+ refetchInterval: _optionalChain([options, 'optionalAccess', _97 => _97.refetchIntervalMs])
1569
1574
  });
1570
1575
  }
1571
1576
 
@@ -1573,11 +1578,11 @@ function useProductPromotions(productSlug, options) {
1573
1578
 
1574
1579
  function useGiftCardBalance(code, options) {
1575
1580
  const { client } = useBehio();
1576
- const trimmed = _optionalChain([code, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]);
1581
+ const trimmed = _optionalChain([code, 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
1577
1582
  return _reactquery.useQuery.call(void 0, {
1578
1583
  queryKey: ["behio", "gift-card-balance", trimmed],
1579
1584
  queryFn: () => unwrap(client.catalog.checkGiftCard(trimmed)),
1580
- enabled: Boolean(trimmed && trimmed.length >= 6) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _96 => _96.enabled]), () => ( true)))
1585
+ enabled: Boolean(trimmed && trimmed.length >= 6) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _100 => _100.enabled]), () => ( true)))
1581
1586
  });
1582
1587
  }
1583
1588
 
@@ -1589,7 +1594,7 @@ function useWishlist(options) {
1589
1594
  const query = _reactquery.useQuery.call(void 0, {
1590
1595
  queryKey: ["behio", "wishlist"],
1591
1596
  queryFn: () => unwrap(client.wishlist.get()),
1592
- enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _97 => _97.enabled]), () => ( true))
1597
+ enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _101 => _101.enabled]), () => ( true))
1593
1598
  });
1594
1599
  const addMutation = _reactquery.useMutation.call(void 0, {
1595
1600
  mutationFn: (productId) => unwrap(client.wishlist.add(productId)),
@@ -1621,9 +1626,9 @@ function useIsInWishlist(productId) {
1621
1626
  function useProductReviews(productId, options) {
1622
1627
  const { client } = useBehio();
1623
1628
  return _reactquery.useQuery.call(void 0, {
1624
- queryKey: ["behio", "reviews", productId, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _98 => _98.page]), () => ( 1))],
1625
- queryFn: () => unwrap(client.reviews.getProductReviews(productId, _optionalChain([options, 'optionalAccess', _99 => _99.page]), _optionalChain([options, 'optionalAccess', _100 => _100.limit]))),
1626
- enabled: Boolean(productId) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _101 => _101.enabled]), () => ( true)))
1629
+ queryKey: ["behio", "reviews", productId, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _102 => _102.page]), () => ( 1))],
1630
+ queryFn: () => unwrap(client.reviews.getProductReviews(productId, _optionalChain([options, 'optionalAccess', _103 => _103.page]), _optionalChain([options, 'optionalAccess', _104 => _104.limit]))),
1631
+ enabled: Boolean(productId) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _105 => _105.enabled]), () => ( true)))
1627
1632
  });
1628
1633
  }
1629
1634
  function useSubmitReview() {
package/dist/react.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-ZOZAJG6T.mjs";
5
5
  import {
6
6
  BehioStorefront
7
- } from "./chunk-O5UHKZPG.mjs";
7
+ } from "./chunk-TN5C6CAB.mjs";
8
8
 
9
9
  // src/react/provider.tsx
10
10
  import { useRef, useEffect, useMemo, useState, useCallback } from "react";
@@ -1550,8 +1550,13 @@ import { useQuery as useQuery22 } from "@tanstack/react-query";
1550
1550
  function useCrossSell(productSlug, options) {
1551
1551
  const { client } = useBehio();
1552
1552
  return useQuery22({
1553
- queryKey: ["behio", "cross-sell", productSlug],
1554
- queryFn: () => unwrap(client.catalog.getCrossSell(productSlug)),
1553
+ queryKey: ["behio", "cross-sell", productSlug, options?.locale, options?.currency],
1554
+ queryFn: () => unwrap(
1555
+ client.catalog.getCrossSell(productSlug, {
1556
+ locale: options?.locale,
1557
+ currency: options?.currency
1558
+ })
1559
+ ),
1555
1560
  enabled: Boolean(productSlug) && (options?.enabled ?? true),
1556
1561
  initialData: options?.initialData
1557
1562
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@behio/storefront-sdk",
3
- "version": "0.27.0",
4
- "description": "TypeScript SDK for Behio Headless E-Shop \u2014 core client + React hooks",
3
+ "version": "0.29.0",
4
+ "description": "TypeScript SDK for Behio Headless E-Shop core client + React hooks",
5
5
  "author": "Behio",
6
6
  "license": "MIT",
7
7
  "main": "./dist/index.js",
@@ -63,4 +63,4 @@
63
63
  "tsup": "^8.0.0",
64
64
  "typescript": "^5.2.0"
65
65
  }
66
- }
66
+ }