@behio/storefront-sdk 0.26.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.
- package/dist/{chunk-MUSTZBNR.js → chunk-CXKZLKUY.js} +27 -9
- package/dist/{chunk-V5WU3XI4.mjs → chunk-TN5C6CAB.mjs} +21 -3
- package/dist/{client-D36fecrZ.d.mts → client-BQroQWyY.d.mts} +67 -3
- package/dist/{client-D36fecrZ.d.ts → client-BQroQWyY.d.ts} +67 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/next.js +2 -2
- package/dist/next.mjs +1 -1
- package/dist/react.d.mts +13 -3
- package/dist/react.d.ts +13 -3
- package/dist/react.js +38 -15
- package/dist/react.mjs +41 -18
- package/package.json +3 -3
|
@@ -578,11 +578,29 @@ var CatalogModule = class {
|
|
|
578
578
|
async getBundle(slug) {
|
|
579
579
|
return this.client.request("GET", `/catalog/bundles/${slug}`);
|
|
580
580
|
}
|
|
581
|
-
/**
|
|
582
|
-
|
|
581
|
+
/**
|
|
582
|
+
* One product group ("collection") by slug with its products as standard
|
|
583
|
+
* list items. Groups are curated in the admin; use this to render curated
|
|
584
|
+
* product bands. Returns an SdkResult error (404) when the group is
|
|
585
|
+
* missing or inactive — callers should render nothing in that case.
|
|
586
|
+
*/
|
|
587
|
+
async getProductGroup(slug, options) {
|
|
588
|
+
return this.client.request("GET", `/catalog/product-groups/${encodeURIComponent(slug)}`, {
|
|
589
|
+
query: { locale: _optionalChain([options, 'optionalAccess', _25 => _25.locale]), currency: _optionalChain([options, 'optionalAccess', _26 => _26.currency]) }
|
|
590
|
+
});
|
|
591
|
+
}
|
|
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) {
|
|
583
600
|
return this.client.request(
|
|
584
601
|
"GET",
|
|
585
|
-
`/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]) } }
|
|
586
604
|
);
|
|
587
605
|
}
|
|
588
606
|
/** Active promotions applicable to a product (with countdown end time) */
|
|
@@ -604,7 +622,7 @@ var CatalogModule = class {
|
|
|
604
622
|
/** List configured payment methods (filtered by currency). */
|
|
605
623
|
async listPaymentMethods(opts) {
|
|
606
624
|
const query = {};
|
|
607
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
625
|
+
if (_optionalChain([opts, 'optionalAccess', _29 => _29.currency])) query.currency = opts.currency;
|
|
608
626
|
return this.client.request("GET", "/catalog/payment-methods", { query });
|
|
609
627
|
}
|
|
610
628
|
};
|
|
@@ -850,7 +868,7 @@ var OrdersModule = class {
|
|
|
850
868
|
/** List customer orders (requires auth) */
|
|
851
869
|
async list(options) {
|
|
852
870
|
return this.client.request("GET", "/orders", {
|
|
853
|
-
query: { page: _optionalChain([options, 'optionalAccess',
|
|
871
|
+
query: { page: _optionalChain([options, 'optionalAccess', _30 => _30.page]), limit: _optionalChain([options, 'optionalAccess', _31 => _31.limit]) }
|
|
854
872
|
});
|
|
855
873
|
}
|
|
856
874
|
/** Get order detail (requires auth) */
|
|
@@ -1073,10 +1091,10 @@ var ShippingModule = class {
|
|
|
1073
1091
|
*/
|
|
1074
1092
|
async listMethods(opts) {
|
|
1075
1093
|
const query = {};
|
|
1076
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1077
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1078
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1079
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
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);
|
|
1080
1098
|
return this.client.request(
|
|
1081
1099
|
"GET",
|
|
1082
1100
|
"/catalog/shipping-methods",
|
|
@@ -578,11 +578,29 @@ var CatalogModule = class {
|
|
|
578
578
|
async getBundle(slug) {
|
|
579
579
|
return this.client.request("GET", `/catalog/bundles/${slug}`);
|
|
580
580
|
}
|
|
581
|
-
/**
|
|
582
|
-
|
|
581
|
+
/**
|
|
582
|
+
* One product group ("collection") by slug with its products as standard
|
|
583
|
+
* list items. Groups are curated in the admin; use this to render curated
|
|
584
|
+
* product bands. Returns an SdkResult error (404) when the group is
|
|
585
|
+
* missing or inactive — callers should render nothing in that case.
|
|
586
|
+
*/
|
|
587
|
+
async getProductGroup(slug, options) {
|
|
588
|
+
return this.client.request("GET", `/catalog/product-groups/${encodeURIComponent(slug)}`, {
|
|
589
|
+
query: { locale: options?.locale, currency: options?.currency }
|
|
590
|
+
});
|
|
591
|
+
}
|
|
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) {
|
|
583
600
|
return this.client.request(
|
|
584
601
|
"GET",
|
|
585
|
-
`/catalog/products/${productSlug}/cross-sell
|
|
602
|
+
`/catalog/products/${encodeURIComponent(productSlug)}/cross-sell`,
|
|
603
|
+
{ query: { locale: options?.locale, currency: options?.currency } }
|
|
586
604
|
);
|
|
587
605
|
}
|
|
588
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;
|
|
@@ -752,6 +773,19 @@ interface ResponseInterceptorData {
|
|
|
752
773
|
interface ResponseInterceptor {
|
|
753
774
|
(response: ResponseInterceptorData): void | Promise<void>;
|
|
754
775
|
}
|
|
776
|
+
/** One product group ("collection") with its products as standard list items.
|
|
777
|
+
* Groups are curated in the admin (Product groups); storefronts render them
|
|
778
|
+
* as product bands, e.g. a home "collection" section. */
|
|
779
|
+
interface ProductGroup {
|
|
780
|
+
id: string;
|
|
781
|
+
slug: string;
|
|
782
|
+
/** Group type, e.g. "similar" / "upsell" / "recommended" / "collection". */
|
|
783
|
+
type: string;
|
|
784
|
+
/** Name in the requested locale, falling back to the shop default language. */
|
|
785
|
+
name: string;
|
|
786
|
+
description: string | null;
|
|
787
|
+
items: ProductListItem[];
|
|
788
|
+
}
|
|
755
789
|
interface BundleItem {
|
|
756
790
|
productId: string;
|
|
757
791
|
slug: string | null;
|
|
@@ -859,11 +893,22 @@ interface ShippingQuote extends ShippingMethodSummary {
|
|
|
859
893
|
interface CrossSellItem {
|
|
860
894
|
productId: string;
|
|
861
895
|
slug: string | null;
|
|
896
|
+
/** Localized product name (resolved for the requested locale, falls back to
|
|
897
|
+
* the eshop default language). */
|
|
862
898
|
name: string;
|
|
863
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). */
|
|
864
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;
|
|
865
907
|
imageUrl: string | null;
|
|
908
|
+
/** Cached stock quantity of the recommended product. */
|
|
866
909
|
stockCached: number;
|
|
910
|
+
/** Convenience flag: `stockCached > 0`. */
|
|
911
|
+
inStock: boolean;
|
|
867
912
|
}
|
|
868
913
|
interface ActivePromotion {
|
|
869
914
|
id: string;
|
|
@@ -1281,8 +1326,27 @@ declare class CatalogModule {
|
|
|
1281
1326
|
}>>;
|
|
1282
1327
|
/** Get a single bundle by slug */
|
|
1283
1328
|
getBundle(slug: string): Promise<SdkResult<Bundle>>;
|
|
1284
|
-
/**
|
|
1285
|
-
|
|
1329
|
+
/**
|
|
1330
|
+
* One product group ("collection") by slug with its products as standard
|
|
1331
|
+
* list items. Groups are curated in the admin; use this to render curated
|
|
1332
|
+
* product bands. Returns an SdkResult error (404) when the group is
|
|
1333
|
+
* missing or inactive — callers should render nothing in that case.
|
|
1334
|
+
*/
|
|
1335
|
+
getProductGroup(slug: string, options?: {
|
|
1336
|
+
locale?: string;
|
|
1337
|
+
currency?: string;
|
|
1338
|
+
}): Promise<SdkResult<ProductGroup>>;
|
|
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<{
|
|
1286
1350
|
related: CrossSellItem[];
|
|
1287
1351
|
upsell: CrossSellItem[];
|
|
1288
1352
|
crossSell: CrossSellItem[];
|
|
@@ -1580,4 +1644,4 @@ declare class ShippingModule {
|
|
|
1580
1644
|
}>>;
|
|
1581
1645
|
}
|
|
1582
1646
|
|
|
1583
|
-
export { type
|
|
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;
|
|
@@ -752,6 +773,19 @@ interface ResponseInterceptorData {
|
|
|
752
773
|
interface ResponseInterceptor {
|
|
753
774
|
(response: ResponseInterceptorData): void | Promise<void>;
|
|
754
775
|
}
|
|
776
|
+
/** One product group ("collection") with its products as standard list items.
|
|
777
|
+
* Groups are curated in the admin (Product groups); storefronts render them
|
|
778
|
+
* as product bands, e.g. a home "collection" section. */
|
|
779
|
+
interface ProductGroup {
|
|
780
|
+
id: string;
|
|
781
|
+
slug: string;
|
|
782
|
+
/** Group type, e.g. "similar" / "upsell" / "recommended" / "collection". */
|
|
783
|
+
type: string;
|
|
784
|
+
/** Name in the requested locale, falling back to the shop default language. */
|
|
785
|
+
name: string;
|
|
786
|
+
description: string | null;
|
|
787
|
+
items: ProductListItem[];
|
|
788
|
+
}
|
|
755
789
|
interface BundleItem {
|
|
756
790
|
productId: string;
|
|
757
791
|
slug: string | null;
|
|
@@ -859,11 +893,22 @@ interface ShippingQuote extends ShippingMethodSummary {
|
|
|
859
893
|
interface CrossSellItem {
|
|
860
894
|
productId: string;
|
|
861
895
|
slug: string | null;
|
|
896
|
+
/** Localized product name (resolved for the requested locale, falls back to
|
|
897
|
+
* the eshop default language). */
|
|
862
898
|
name: string;
|
|
863
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). */
|
|
864
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;
|
|
865
907
|
imageUrl: string | null;
|
|
908
|
+
/** Cached stock quantity of the recommended product. */
|
|
866
909
|
stockCached: number;
|
|
910
|
+
/** Convenience flag: `stockCached > 0`. */
|
|
911
|
+
inStock: boolean;
|
|
867
912
|
}
|
|
868
913
|
interface ActivePromotion {
|
|
869
914
|
id: string;
|
|
@@ -1281,8 +1326,27 @@ declare class CatalogModule {
|
|
|
1281
1326
|
}>>;
|
|
1282
1327
|
/** Get a single bundle by slug */
|
|
1283
1328
|
getBundle(slug: string): Promise<SdkResult<Bundle>>;
|
|
1284
|
-
/**
|
|
1285
|
-
|
|
1329
|
+
/**
|
|
1330
|
+
* One product group ("collection") by slug with its products as standard
|
|
1331
|
+
* list items. Groups are curated in the admin; use this to render curated
|
|
1332
|
+
* product bands. Returns an SdkResult error (404) when the group is
|
|
1333
|
+
* missing or inactive — callers should render nothing in that case.
|
|
1334
|
+
*/
|
|
1335
|
+
getProductGroup(slug: string, options?: {
|
|
1336
|
+
locale?: string;
|
|
1337
|
+
currency?: string;
|
|
1338
|
+
}): Promise<SdkResult<ProductGroup>>;
|
|
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<{
|
|
1286
1350
|
related: CrossSellItem[];
|
|
1287
1351
|
upsell: CrossSellItem[];
|
|
1288
1352
|
crossSell: CrossSellItem[];
|
|
@@ -1580,4 +1644,4 @@ declare class ShippingModule {
|
|
|
1580
1644
|
}>>;
|
|
1581
1645
|
}
|
|
1582
1646
|
|
|
1583
|
-
export { type
|
|
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 {
|
|
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 {
|
|
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
|
|
17
|
+
var _chunkCXKZLKUYjs = require('./chunk-CXKZLKUY.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -29,4 +29,4 @@ var _chunkMUSTZBNRjs = require('./chunk-MUSTZBNR.js');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
exports.AddressTypes =
|
|
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
package/dist/next.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BehioStorefrontConfig, a as BehioStorefront } from './client-
|
|
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-
|
|
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
|
|
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,
|
|
21
|
+
const client = new (0, _chunkCXKZLKUYjs.BehioStorefront)({
|
|
22
22
|
apiKey,
|
|
23
23
|
...baseUrl ? { baseUrl } : {},
|
|
24
24
|
...locale ? { locale } : {},
|
package/dist/next.mjs
CHANGED
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
|
|
5
|
-
export {
|
|
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
|
|
|
@@ -552,6 +552,14 @@ declare function useBundle(slug: string | undefined, options?: {
|
|
|
552
552
|
initialData?: Bundle;
|
|
553
553
|
}): _tanstack_react_query.UseQueryResult<NoInfer<Bundle>, Error>;
|
|
554
554
|
|
|
555
|
+
/** One product group ("collection") by slug with its products as list items. */
|
|
556
|
+
declare function useProductGroup(slug: string | undefined, options?: {
|
|
557
|
+
locale?: string;
|
|
558
|
+
currency?: string;
|
|
559
|
+
enabled?: boolean;
|
|
560
|
+
initialData?: ProductGroup;
|
|
561
|
+
}): _tanstack_react_query.UseQueryResult<NoInfer<ProductGroup>, Error>;
|
|
562
|
+
|
|
555
563
|
type CrossSellResponse = {
|
|
556
564
|
related: CrossSellItem[];
|
|
557
565
|
upsell: CrossSellItem[];
|
|
@@ -563,6 +571,8 @@ type CrossSellResponse = {
|
|
|
563
571
|
* different sections on the product detail page.
|
|
564
572
|
*/
|
|
565
573
|
declare function useCrossSell(productSlug: string | undefined, options?: {
|
|
574
|
+
locale?: string;
|
|
575
|
+
currency?: string;
|
|
566
576
|
enabled?: boolean;
|
|
567
577
|
initialData?: CrossSellResponse;
|
|
568
578
|
}): _tanstack_react_query.UseQueryResult<NoInfer<CrossSellResponse>, Error>;
|
|
@@ -1061,4 +1071,4 @@ declare function useNotifyWhenAvailable(): _tanstack_react_query.UseMutationResu
|
|
|
1061
1071
|
*/
|
|
1062
1072
|
declare function useBehioClient(): BehioStorefront;
|
|
1063
1073
|
|
|
1064
|
-
export { ActivePromotion, BehioAnalyticsTracker, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCrossSell, useCurrency, useCustomer, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLookupReturnableOrder, useMenu, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, useProduct, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useWishlist };
|
|
1074
|
+
export { ActivePromotion, BehioAnalyticsTracker, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCrossSell, useCurrency, useCustomer, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLookupReturnableOrder, useMenu, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, useProduct, useProductGroup, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useWishlist };
|
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
|
|
5
|
-
export {
|
|
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
|
|
|
@@ -552,6 +552,14 @@ declare function useBundle(slug: string | undefined, options?: {
|
|
|
552
552
|
initialData?: Bundle;
|
|
553
553
|
}): _tanstack_react_query.UseQueryResult<NoInfer<Bundle>, Error>;
|
|
554
554
|
|
|
555
|
+
/** One product group ("collection") by slug with its products as list items. */
|
|
556
|
+
declare function useProductGroup(slug: string | undefined, options?: {
|
|
557
|
+
locale?: string;
|
|
558
|
+
currency?: string;
|
|
559
|
+
enabled?: boolean;
|
|
560
|
+
initialData?: ProductGroup;
|
|
561
|
+
}): _tanstack_react_query.UseQueryResult<NoInfer<ProductGroup>, Error>;
|
|
562
|
+
|
|
555
563
|
type CrossSellResponse = {
|
|
556
564
|
related: CrossSellItem[];
|
|
557
565
|
upsell: CrossSellItem[];
|
|
@@ -563,6 +571,8 @@ type CrossSellResponse = {
|
|
|
563
571
|
* different sections on the product detail page.
|
|
564
572
|
*/
|
|
565
573
|
declare function useCrossSell(productSlug: string | undefined, options?: {
|
|
574
|
+
locale?: string;
|
|
575
|
+
currency?: string;
|
|
566
576
|
enabled?: boolean;
|
|
567
577
|
initialData?: CrossSellResponse;
|
|
568
578
|
}): _tanstack_react_query.UseQueryResult<NoInfer<CrossSellResponse>, Error>;
|
|
@@ -1061,4 +1071,4 @@ declare function useNotifyWhenAvailable(): _tanstack_react_query.UseMutationResu
|
|
|
1061
1071
|
*/
|
|
1062
1072
|
declare function useBehioClient(): BehioStorefront;
|
|
1063
1073
|
|
|
1064
|
-
export { ActivePromotion, BehioAnalyticsTracker, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCrossSell, useCurrency, useCustomer, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLookupReturnableOrder, useMenu, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, useProduct, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useWishlist };
|
|
1074
|
+
export { ActivePromotion, BehioAnalyticsTracker, BehioProvider, type BehioProviderProps, Bundle, Cart, Category, CategoryDetail, CheckoutInput, CookieConsent, CookieConsentInput, CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, CustomerAddress, CustomerProfile, FilterField, GiftCardBalance, OrderDetail, OrderListItem, Page, PageDetail, PaginatedResponse, ProductDetail, ProductLabel, ProductListItem, ProductReviewsResponse, ProductsQuery, QuoteRequest, RegisterInput, ReturnRequest, ShopInfo, ShopSeo, type StorageAdapter, StorefrontScripts, type StorefrontScriptsProps, SubmitQuoteInput, SubmitReturnInput, SubmitReviewInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UseProductOptions, type UseProductsOptions, type UseSearchOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, WishlistItem, cookieStorage, createMemoryStorage, detectStorage, localStorageAdapter, memoryStorage, useAddressAutocomplete, useAddresses, useAuth, useBehio, useBehioClient, useBundle, useBundles, useCart, useCartCount, useCategories, useCategory, useCheckout, useCookieConsent, useCrossSell, useCurrency, useCustomer, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLookupReturnableOrder, useMenu, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, useProduct, useProductGroup, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useReturnStatus, useSearch, useShopInfo, useShopScripts, useShopSeo, useSubmitQuote, useSubmitReturn, useSubmitReview, useWishlist };
|
package/dist/react.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkJIAOZ5YWjs = require('./chunk-JIAOZ5YW.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
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,
|
|
137
|
+
clientRef.current = new (0, _chunkCXKZLKUYjs.BehioStorefront)({
|
|
138
138
|
apiKey,
|
|
139
139
|
baseUrl,
|
|
140
140
|
...shopDomain ? { shopDomain } : {},
|
|
@@ -1528,15 +1528,37 @@ function useBundle(slug, options) {
|
|
|
1528
1528
|
});
|
|
1529
1529
|
}
|
|
1530
1530
|
|
|
1531
|
+
// src/react/hooks/use-product-group.ts
|
|
1532
|
+
|
|
1533
|
+
function useProductGroup(slug, options) {
|
|
1534
|
+
const { client } = useBehio();
|
|
1535
|
+
return _reactquery.useQuery.call(void 0, {
|
|
1536
|
+
queryKey: ["behio", "product-group", slug, _optionalChain([options, 'optionalAccess', _84 => _84.locale]), _optionalChain([options, 'optionalAccess', _85 => _85.currency])],
|
|
1537
|
+
queryFn: () => unwrap(
|
|
1538
|
+
client.catalog.getProductGroup(slug, {
|
|
1539
|
+
locale: _optionalChain([options, 'optionalAccess', _86 => _86.locale]),
|
|
1540
|
+
currency: _optionalChain([options, 'optionalAccess', _87 => _87.currency])
|
|
1541
|
+
})
|
|
1542
|
+
),
|
|
1543
|
+
enabled: Boolean(slug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _88 => _88.enabled]), () => ( true))),
|
|
1544
|
+
initialData: _optionalChain([options, 'optionalAccess', _89 => _89.initialData])
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1531
1548
|
// src/react/hooks/use-cross-sell.ts
|
|
1532
1549
|
|
|
1533
1550
|
function useCrossSell(productSlug, options) {
|
|
1534
1551
|
const { client } = useBehio();
|
|
1535
1552
|
return _reactquery.useQuery.call(void 0, {
|
|
1536
|
-
queryKey: ["behio", "cross-sell", productSlug],
|
|
1537
|
-
queryFn: () => unwrap(
|
|
1538
|
-
|
|
1539
|
-
|
|
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])
|
|
1540
1562
|
});
|
|
1541
1563
|
}
|
|
1542
1564
|
|
|
@@ -1547,8 +1569,8 @@ function useProductPromotions(productSlug, options) {
|
|
|
1547
1569
|
return _reactquery.useQuery.call(void 0, {
|
|
1548
1570
|
queryKey: ["behio", "product-promotions", productSlug],
|
|
1549
1571
|
queryFn: () => unwrap(client.catalog.getProductPromotions(productSlug)),
|
|
1550
|
-
enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1551
|
-
refetchInterval: _optionalChain([options, 'optionalAccess',
|
|
1572
|
+
enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _96 => _96.enabled]), () => ( true))),
|
|
1573
|
+
refetchInterval: _optionalChain([options, 'optionalAccess', _97 => _97.refetchIntervalMs])
|
|
1552
1574
|
});
|
|
1553
1575
|
}
|
|
1554
1576
|
|
|
@@ -1556,11 +1578,11 @@ function useProductPromotions(productSlug, options) {
|
|
|
1556
1578
|
|
|
1557
1579
|
function useGiftCardBalance(code, options) {
|
|
1558
1580
|
const { client } = useBehio();
|
|
1559
|
-
const trimmed = _optionalChain([code, 'optionalAccess',
|
|
1581
|
+
const trimmed = _optionalChain([code, 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
|
|
1560
1582
|
return _reactquery.useQuery.call(void 0, {
|
|
1561
1583
|
queryKey: ["behio", "gift-card-balance", trimmed],
|
|
1562
1584
|
queryFn: () => unwrap(client.catalog.checkGiftCard(trimmed)),
|
|
1563
|
-
enabled: Boolean(trimmed && trimmed.length >= 6) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1585
|
+
enabled: Boolean(trimmed && trimmed.length >= 6) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _100 => _100.enabled]), () => ( true)))
|
|
1564
1586
|
});
|
|
1565
1587
|
}
|
|
1566
1588
|
|
|
@@ -1572,7 +1594,7 @@ function useWishlist(options) {
|
|
|
1572
1594
|
const query = _reactquery.useQuery.call(void 0, {
|
|
1573
1595
|
queryKey: ["behio", "wishlist"],
|
|
1574
1596
|
queryFn: () => unwrap(client.wishlist.get()),
|
|
1575
|
-
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1597
|
+
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _101 => _101.enabled]), () => ( true))
|
|
1576
1598
|
});
|
|
1577
1599
|
const addMutation = _reactquery.useMutation.call(void 0, {
|
|
1578
1600
|
mutationFn: (productId) => unwrap(client.wishlist.add(productId)),
|
|
@@ -1604,9 +1626,9 @@ function useIsInWishlist(productId) {
|
|
|
1604
1626
|
function useProductReviews(productId, options) {
|
|
1605
1627
|
const { client } = useBehio();
|
|
1606
1628
|
return _reactquery.useQuery.call(void 0, {
|
|
1607
|
-
queryKey: ["behio", "reviews", productId, _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1608
|
-
queryFn: () => unwrap(client.reviews.getProductReviews(productId, _optionalChain([options, 'optionalAccess',
|
|
1609
|
-
enabled: Boolean(productId) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
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)))
|
|
1610
1632
|
});
|
|
1611
1633
|
}
|
|
1612
1634
|
function useSubmitReview() {
|
|
@@ -1721,4 +1743,5 @@ function useNotifyWhenAvailable() {
|
|
|
1721
1743
|
|
|
1722
1744
|
|
|
1723
1745
|
|
|
1724
|
-
|
|
1746
|
+
|
|
1747
|
+
exports.BehioAnalyticsTracker = BehioAnalyticsTracker; exports.BehioProvider = BehioProvider; exports.CurrencySwitcher = CurrencySwitcher; exports.StorefrontScripts = StorefrontScripts; exports.cookieStorage = cookieStorage; exports.createMemoryStorage = createMemoryStorage; exports.detectStorage = detectStorage; exports.formatPrice = _chunkJIAOZ5YWjs.formatPrice; exports.localStorageAdapter = localStorageAdapter; exports.memoryStorage = memoryStorage; exports.trackEcommerceEvent = _chunkJIAOZ5YWjs.trackEcommerceEvent; exports.useAddressAutocomplete = useAddressAutocomplete; exports.useAddresses = useAddresses; exports.useAuth = useAuth; exports.useBehio = useBehio; exports.useBehioClient = useBehioClient; exports.useBundle = useBundle; exports.useBundles = useBundles; exports.useCart = useCart; exports.useCartCount = useCartCount; exports.useCategories = useCategories; exports.useCategory = useCategory; exports.useCheckout = useCheckout; exports.useCookieConsent = useCookieConsent; exports.useCrossSell = useCrossSell; exports.useCurrency = useCurrency; exports.useCustomer = useCustomer; exports.useFeatured = useFeatured; exports.useFilters = useFilters; exports.useGiftCardBalance = useGiftCardBalance; exports.useIsInWishlist = useIsInWishlist; exports.useLabels = useLabels; exports.useLookupReturnableOrder = useLookupReturnableOrder; exports.useMenu = useMenu; exports.useNotifyWhenAvailable = useNotifyWhenAvailable; exports.useOrder = useOrder; exports.useOrderAccess = useOrderAccess; exports.useOrders = useOrders; exports.usePage = usePage; exports.usePages = usePages; exports.useProduct = useProduct; exports.useProductGroup = useProductGroup; exports.useProductPromotions = useProductPromotions; exports.useProductReviews = useProductReviews; exports.useProducts = useProducts; exports.useQuoteStatus = useQuoteStatus; exports.useReturnStatus = useReturnStatus; exports.useSearch = useSearch; exports.useShopInfo = useShopInfo; exports.useShopScripts = useShopScripts; exports.useShopSeo = useShopSeo; exports.useSubmitQuote = useSubmitQuote; exports.useSubmitReturn = useSubmitReturn; exports.useSubmitReview = useSubmitReview; exports.useWishlist = useWishlist;
|
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-
|
|
7
|
+
} from "./chunk-TN5C6CAB.mjs";
|
|
8
8
|
|
|
9
9
|
// src/react/provider.tsx
|
|
10
10
|
import { useRef, useEffect, useMemo, useState, useCallback } from "react";
|
|
@@ -1528,23 +1528,45 @@ function useBundle(slug, options) {
|
|
|
1528
1528
|
});
|
|
1529
1529
|
}
|
|
1530
1530
|
|
|
1531
|
-
// src/react/hooks/use-
|
|
1531
|
+
// src/react/hooks/use-product-group.ts
|
|
1532
1532
|
import { useQuery as useQuery21 } from "@tanstack/react-query";
|
|
1533
|
-
function
|
|
1533
|
+
function useProductGroup(slug, options) {
|
|
1534
1534
|
const { client } = useBehio();
|
|
1535
1535
|
return useQuery21({
|
|
1536
|
-
queryKey: ["behio", "
|
|
1537
|
-
queryFn: () => unwrap(
|
|
1536
|
+
queryKey: ["behio", "product-group", slug, options?.locale, options?.currency],
|
|
1537
|
+
queryFn: () => unwrap(
|
|
1538
|
+
client.catalog.getProductGroup(slug, {
|
|
1539
|
+
locale: options?.locale,
|
|
1540
|
+
currency: options?.currency
|
|
1541
|
+
})
|
|
1542
|
+
),
|
|
1543
|
+
enabled: Boolean(slug) && (options?.enabled ?? true),
|
|
1544
|
+
initialData: options?.initialData
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
// src/react/hooks/use-cross-sell.ts
|
|
1549
|
+
import { useQuery as useQuery22 } from "@tanstack/react-query";
|
|
1550
|
+
function useCrossSell(productSlug, options) {
|
|
1551
|
+
const { client } = useBehio();
|
|
1552
|
+
return useQuery22({
|
|
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
|
+
),
|
|
1538
1560
|
enabled: Boolean(productSlug) && (options?.enabled ?? true),
|
|
1539
1561
|
initialData: options?.initialData
|
|
1540
1562
|
});
|
|
1541
1563
|
}
|
|
1542
1564
|
|
|
1543
1565
|
// src/react/hooks/use-product-promotions.ts
|
|
1544
|
-
import { useQuery as
|
|
1566
|
+
import { useQuery as useQuery23 } from "@tanstack/react-query";
|
|
1545
1567
|
function useProductPromotions(productSlug, options) {
|
|
1546
1568
|
const { client } = useBehio();
|
|
1547
|
-
return
|
|
1569
|
+
return useQuery23({
|
|
1548
1570
|
queryKey: ["behio", "product-promotions", productSlug],
|
|
1549
1571
|
queryFn: () => unwrap(client.catalog.getProductPromotions(productSlug)),
|
|
1550
1572
|
enabled: Boolean(productSlug) && (options?.enabled ?? true),
|
|
@@ -1553,11 +1575,11 @@ function useProductPromotions(productSlug, options) {
|
|
|
1553
1575
|
}
|
|
1554
1576
|
|
|
1555
1577
|
// src/react/hooks/use-gift-card.ts
|
|
1556
|
-
import { useQuery as
|
|
1578
|
+
import { useQuery as useQuery24 } from "@tanstack/react-query";
|
|
1557
1579
|
function useGiftCardBalance(code, options) {
|
|
1558
1580
|
const { client } = useBehio();
|
|
1559
1581
|
const trimmed = code?.trim();
|
|
1560
|
-
return
|
|
1582
|
+
return useQuery24({
|
|
1561
1583
|
queryKey: ["behio", "gift-card-balance", trimmed],
|
|
1562
1584
|
queryFn: () => unwrap(client.catalog.checkGiftCard(trimmed)),
|
|
1563
1585
|
enabled: Boolean(trimmed && trimmed.length >= 6) && (options?.enabled ?? true)
|
|
@@ -1565,11 +1587,11 @@ function useGiftCardBalance(code, options) {
|
|
|
1565
1587
|
}
|
|
1566
1588
|
|
|
1567
1589
|
// src/react/hooks/use-wishlist.ts
|
|
1568
|
-
import { useQuery as
|
|
1590
|
+
import { useQuery as useQuery25, useMutation as useMutation9, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
|
|
1569
1591
|
function useWishlist(options) {
|
|
1570
1592
|
const { client } = useBehio();
|
|
1571
1593
|
const qc = useQueryClient10();
|
|
1572
|
-
const query =
|
|
1594
|
+
const query = useQuery25({
|
|
1573
1595
|
queryKey: ["behio", "wishlist"],
|
|
1574
1596
|
queryFn: () => unwrap(client.wishlist.get()),
|
|
1575
1597
|
enabled: options?.enabled ?? true
|
|
@@ -1592,7 +1614,7 @@ function useWishlist(options) {
|
|
|
1592
1614
|
}
|
|
1593
1615
|
function useIsInWishlist(productId) {
|
|
1594
1616
|
const { client } = useBehio();
|
|
1595
|
-
return
|
|
1617
|
+
return useQuery25({
|
|
1596
1618
|
queryKey: ["behio", "wishlist-check", productId],
|
|
1597
1619
|
queryFn: () => unwrap(client.wishlist.isInWishlist(productId)),
|
|
1598
1620
|
enabled: Boolean(productId)
|
|
@@ -1600,10 +1622,10 @@ function useIsInWishlist(productId) {
|
|
|
1600
1622
|
}
|
|
1601
1623
|
|
|
1602
1624
|
// src/react/hooks/use-reviews.ts
|
|
1603
|
-
import { useQuery as
|
|
1625
|
+
import { useQuery as useQuery26, useMutation as useMutation10, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
|
|
1604
1626
|
function useProductReviews(productId, options) {
|
|
1605
1627
|
const { client } = useBehio();
|
|
1606
|
-
return
|
|
1628
|
+
return useQuery26({
|
|
1607
1629
|
queryKey: ["behio", "reviews", productId, options?.page ?? 1],
|
|
1608
1630
|
queryFn: () => unwrap(client.reviews.getProductReviews(productId, options?.page, options?.limit)),
|
|
1609
1631
|
enabled: Boolean(productId) && (options?.enabled ?? true)
|
|
@@ -1619,7 +1641,7 @@ function useSubmitReview() {
|
|
|
1619
1641
|
}
|
|
1620
1642
|
|
|
1621
1643
|
// src/react/hooks/use-returns.ts
|
|
1622
|
-
import { useQuery as
|
|
1644
|
+
import { useQuery as useQuery27, useMutation as useMutation11 } from "@tanstack/react-query";
|
|
1623
1645
|
function useLookupReturnableOrder() {
|
|
1624
1646
|
const { client } = useBehio();
|
|
1625
1647
|
return useMutation11({
|
|
@@ -1634,7 +1656,7 @@ function useSubmitReturn() {
|
|
|
1634
1656
|
}
|
|
1635
1657
|
function useReturnStatus(returnId, email) {
|
|
1636
1658
|
const { client } = useBehio();
|
|
1637
|
-
return
|
|
1659
|
+
return useQuery27({
|
|
1638
1660
|
queryKey: ["behio", "return-status", returnId],
|
|
1639
1661
|
queryFn: () => unwrap(client.returns.getStatus(returnId, email)),
|
|
1640
1662
|
enabled: Boolean(returnId && email)
|
|
@@ -1642,7 +1664,7 @@ function useReturnStatus(returnId, email) {
|
|
|
1642
1664
|
}
|
|
1643
1665
|
|
|
1644
1666
|
// src/react/hooks/use-quotes.ts
|
|
1645
|
-
import { useMutation as useMutation12, useQuery as
|
|
1667
|
+
import { useMutation as useMutation12, useQuery as useQuery28 } from "@tanstack/react-query";
|
|
1646
1668
|
function useSubmitQuote() {
|
|
1647
1669
|
const { client } = useBehio();
|
|
1648
1670
|
return useMutation12({
|
|
@@ -1651,7 +1673,7 @@ function useSubmitQuote() {
|
|
|
1651
1673
|
}
|
|
1652
1674
|
function useQuoteStatus(quoteId, email) {
|
|
1653
1675
|
const { client } = useBehio();
|
|
1654
|
-
return
|
|
1676
|
+
return useQuery28({
|
|
1655
1677
|
queryKey: ["behio", "quote-status", quoteId],
|
|
1656
1678
|
queryFn: () => unwrap(client.quotes.getStatus(quoteId, email)),
|
|
1657
1679
|
enabled: Boolean(quoteId && email)
|
|
@@ -1708,6 +1730,7 @@ export {
|
|
|
1708
1730
|
usePage,
|
|
1709
1731
|
usePages,
|
|
1710
1732
|
useProduct,
|
|
1733
|
+
useProductGroup,
|
|
1711
1734
|
useProductPromotions,
|
|
1712
1735
|
useProductReviews,
|
|
1713
1736
|
useProducts,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@behio/storefront-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript SDK for Behio Headless E-Shop
|
|
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
|
+
}
|