@behio/storefront-sdk 0.25.0 → 0.27.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-HOL6WRHR.js} +17 -6
- package/dist/{chunk-V5WU3XI4.mjs → chunk-O5UHKZPG.mjs} +11 -0
- package/dist/{client-76vvJ0_n.d.mts → client-DL533jvY.d.mts} +47 -1
- package/dist/{client-76vvJ0_n.d.ts → client-DL533jvY.d.ts} +47 -1
- 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 +11 -3
- package/dist/react.d.ts +11 -3
- package/dist/react.js +31 -13
- package/dist/react.mjs +34 -16
- package/package.json +1 -1
|
@@ -578,6 +578,17 @@ var CatalogModule = class {
|
|
|
578
578
|
async getBundle(slug) {
|
|
579
579
|
return this.client.request("GET", `/catalog/bundles/${slug}`);
|
|
580
580
|
}
|
|
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
|
+
}
|
|
581
592
|
/** Cross-sell / related / upsell products for a product */
|
|
582
593
|
async getCrossSell(productSlug) {
|
|
583
594
|
return this.client.request(
|
|
@@ -604,7 +615,7 @@ var CatalogModule = class {
|
|
|
604
615
|
/** List configured payment methods (filtered by currency). */
|
|
605
616
|
async listPaymentMethods(opts) {
|
|
606
617
|
const query = {};
|
|
607
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
618
|
+
if (_optionalChain([opts, 'optionalAccess', _27 => _27.currency])) query.currency = opts.currency;
|
|
608
619
|
return this.client.request("GET", "/catalog/payment-methods", { query });
|
|
609
620
|
}
|
|
610
621
|
};
|
|
@@ -850,7 +861,7 @@ var OrdersModule = class {
|
|
|
850
861
|
/** List customer orders (requires auth) */
|
|
851
862
|
async list(options) {
|
|
852
863
|
return this.client.request("GET", "/orders", {
|
|
853
|
-
query: { page: _optionalChain([options, 'optionalAccess',
|
|
864
|
+
query: { page: _optionalChain([options, 'optionalAccess', _28 => _28.page]), limit: _optionalChain([options, 'optionalAccess', _29 => _29.limit]) }
|
|
854
865
|
});
|
|
855
866
|
}
|
|
856
867
|
/** Get order detail (requires auth) */
|
|
@@ -1073,10 +1084,10 @@ var ShippingModule = class {
|
|
|
1073
1084
|
*/
|
|
1074
1085
|
async listMethods(opts) {
|
|
1075
1086
|
const query = {};
|
|
1076
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1077
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1078
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
1079
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
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);
|
|
1080
1091
|
return this.client.request(
|
|
1081
1092
|
"GET",
|
|
1082
1093
|
"/catalog/shipping-methods",
|
|
@@ -578,6 +578,17 @@ var CatalogModule = class {
|
|
|
578
578
|
async getBundle(slug) {
|
|
579
579
|
return this.client.request("GET", `/catalog/bundles/${slug}`);
|
|
580
580
|
}
|
|
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
|
+
}
|
|
581
592
|
/** Cross-sell / related / upsell products for a product */
|
|
582
593
|
async getCrossSell(productSlug) {
|
|
583
594
|
return this.client.request(
|
|
@@ -263,6 +263,12 @@ interface MenuItemRef {
|
|
|
263
263
|
type: MenuItemType;
|
|
264
264
|
slug: string;
|
|
265
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Badge tone preset for a menu item chip. Maps to storefront design tokens on
|
|
268
|
+
* the template side (SALE -> danger, NEW -> success, ACCENT -> primary,
|
|
269
|
+
* NEUTRAL -> current text color). Custom hex colors override the preset.
|
|
270
|
+
*/
|
|
271
|
+
type BadgeTone = "NEUTRAL" | "SALE" | "NEW" | "ACCENT";
|
|
266
272
|
interface MenuItem {
|
|
267
273
|
id: string;
|
|
268
274
|
type: MenuItemType;
|
|
@@ -275,6 +281,23 @@ interface MenuItem {
|
|
|
275
281
|
ref?: MenuItemRef | null;
|
|
276
282
|
/** Optional badge chip text (e.g. "Novinka", "Sleva"). */
|
|
277
283
|
badgeText?: string | null;
|
|
284
|
+
/**
|
|
285
|
+
* Badge tone preset driving the chip colors from storefront tokens. Always
|
|
286
|
+
* present. Custom `badgeColor`/`badgeTextColor` override it when set.
|
|
287
|
+
*/
|
|
288
|
+
badgeTone: BadgeTone;
|
|
289
|
+
/** Custom badge background hex (overrides `badgeTone`), or null. */
|
|
290
|
+
badgeColor?: string | null;
|
|
291
|
+
/** Custom badge text hex, or null. */
|
|
292
|
+
badgeTextColor?: string | null;
|
|
293
|
+
/** Custom hex for the item label text itself, or null to inherit. */
|
|
294
|
+
labelColor?: string | null;
|
|
295
|
+
/** Lucide icon slug rendered next to the label, or null. */
|
|
296
|
+
icon?: string | null;
|
|
297
|
+
/** Emphasize this item (bold/accent). */
|
|
298
|
+
isHighlighted: boolean;
|
|
299
|
+
/** LINK items: open the target in a new browser tab. Always false on typed items. */
|
|
300
|
+
openInNewTab: boolean;
|
|
278
301
|
/** Processed image URL for mega-menu tiles (null when no image set). */
|
|
279
302
|
imageUrl?: string | null;
|
|
280
303
|
/** Nested items, up to depth 3. */
|
|
@@ -729,6 +752,19 @@ interface ResponseInterceptorData {
|
|
|
729
752
|
interface ResponseInterceptor {
|
|
730
753
|
(response: ResponseInterceptorData): void | Promise<void>;
|
|
731
754
|
}
|
|
755
|
+
/** One product group ("collection") with its products as standard list items.
|
|
756
|
+
* Groups are curated in the admin (Product groups); storefronts render them
|
|
757
|
+
* as product bands, e.g. a home "collection" section. */
|
|
758
|
+
interface ProductGroup {
|
|
759
|
+
id: string;
|
|
760
|
+
slug: string;
|
|
761
|
+
/** Group type, e.g. "similar" / "upsell" / "recommended" / "collection". */
|
|
762
|
+
type: string;
|
|
763
|
+
/** Name in the requested locale, falling back to the shop default language. */
|
|
764
|
+
name: string;
|
|
765
|
+
description: string | null;
|
|
766
|
+
items: ProductListItem[];
|
|
767
|
+
}
|
|
732
768
|
interface BundleItem {
|
|
733
769
|
productId: string;
|
|
734
770
|
slug: string | null;
|
|
@@ -1258,6 +1294,16 @@ declare class CatalogModule {
|
|
|
1258
1294
|
}>>;
|
|
1259
1295
|
/** Get a single bundle by slug */
|
|
1260
1296
|
getBundle(slug: string): Promise<SdkResult<Bundle>>;
|
|
1297
|
+
/**
|
|
1298
|
+
* One product group ("collection") by slug with its products as standard
|
|
1299
|
+
* list items. Groups are curated in the admin; use this to render curated
|
|
1300
|
+
* product bands. Returns an SdkResult error (404) when the group is
|
|
1301
|
+
* missing or inactive — callers should render nothing in that case.
|
|
1302
|
+
*/
|
|
1303
|
+
getProductGroup(slug: string, options?: {
|
|
1304
|
+
locale?: string;
|
|
1305
|
+
currency?: string;
|
|
1306
|
+
}): Promise<SdkResult<ProductGroup>>;
|
|
1261
1307
|
/** Cross-sell / related / upsell products for a product */
|
|
1262
1308
|
getCrossSell(productSlug: string): Promise<SdkResult<{
|
|
1263
1309
|
related: CrossSellItem[];
|
|
@@ -1557,4 +1603,4 @@ declare class ShippingModule {
|
|
|
1557
1603
|
}>>;
|
|
1558
1604
|
}
|
|
1559
1605
|
|
|
1560
|
-
export { type
|
|
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 };
|
|
@@ -263,6 +263,12 @@ interface MenuItemRef {
|
|
|
263
263
|
type: MenuItemType;
|
|
264
264
|
slug: string;
|
|
265
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Badge tone preset for a menu item chip. Maps to storefront design tokens on
|
|
268
|
+
* the template side (SALE -> danger, NEW -> success, ACCENT -> primary,
|
|
269
|
+
* NEUTRAL -> current text color). Custom hex colors override the preset.
|
|
270
|
+
*/
|
|
271
|
+
type BadgeTone = "NEUTRAL" | "SALE" | "NEW" | "ACCENT";
|
|
266
272
|
interface MenuItem {
|
|
267
273
|
id: string;
|
|
268
274
|
type: MenuItemType;
|
|
@@ -275,6 +281,23 @@ interface MenuItem {
|
|
|
275
281
|
ref?: MenuItemRef | null;
|
|
276
282
|
/** Optional badge chip text (e.g. "Novinka", "Sleva"). */
|
|
277
283
|
badgeText?: string | null;
|
|
284
|
+
/**
|
|
285
|
+
* Badge tone preset driving the chip colors from storefront tokens. Always
|
|
286
|
+
* present. Custom `badgeColor`/`badgeTextColor` override it when set.
|
|
287
|
+
*/
|
|
288
|
+
badgeTone: BadgeTone;
|
|
289
|
+
/** Custom badge background hex (overrides `badgeTone`), or null. */
|
|
290
|
+
badgeColor?: string | null;
|
|
291
|
+
/** Custom badge text hex, or null. */
|
|
292
|
+
badgeTextColor?: string | null;
|
|
293
|
+
/** Custom hex for the item label text itself, or null to inherit. */
|
|
294
|
+
labelColor?: string | null;
|
|
295
|
+
/** Lucide icon slug rendered next to the label, or null. */
|
|
296
|
+
icon?: string | null;
|
|
297
|
+
/** Emphasize this item (bold/accent). */
|
|
298
|
+
isHighlighted: boolean;
|
|
299
|
+
/** LINK items: open the target in a new browser tab. Always false on typed items. */
|
|
300
|
+
openInNewTab: boolean;
|
|
278
301
|
/** Processed image URL for mega-menu tiles (null when no image set). */
|
|
279
302
|
imageUrl?: string | null;
|
|
280
303
|
/** Nested items, up to depth 3. */
|
|
@@ -729,6 +752,19 @@ interface ResponseInterceptorData {
|
|
|
729
752
|
interface ResponseInterceptor {
|
|
730
753
|
(response: ResponseInterceptorData): void | Promise<void>;
|
|
731
754
|
}
|
|
755
|
+
/** One product group ("collection") with its products as standard list items.
|
|
756
|
+
* Groups are curated in the admin (Product groups); storefronts render them
|
|
757
|
+
* as product bands, e.g. a home "collection" section. */
|
|
758
|
+
interface ProductGroup {
|
|
759
|
+
id: string;
|
|
760
|
+
slug: string;
|
|
761
|
+
/** Group type, e.g. "similar" / "upsell" / "recommended" / "collection". */
|
|
762
|
+
type: string;
|
|
763
|
+
/** Name in the requested locale, falling back to the shop default language. */
|
|
764
|
+
name: string;
|
|
765
|
+
description: string | null;
|
|
766
|
+
items: ProductListItem[];
|
|
767
|
+
}
|
|
732
768
|
interface BundleItem {
|
|
733
769
|
productId: string;
|
|
734
770
|
slug: string | null;
|
|
@@ -1258,6 +1294,16 @@ declare class CatalogModule {
|
|
|
1258
1294
|
}>>;
|
|
1259
1295
|
/** Get a single bundle by slug */
|
|
1260
1296
|
getBundle(slug: string): Promise<SdkResult<Bundle>>;
|
|
1297
|
+
/**
|
|
1298
|
+
* One product group ("collection") by slug with its products as standard
|
|
1299
|
+
* list items. Groups are curated in the admin; use this to render curated
|
|
1300
|
+
* product bands. Returns an SdkResult error (404) when the group is
|
|
1301
|
+
* missing or inactive — callers should render nothing in that case.
|
|
1302
|
+
*/
|
|
1303
|
+
getProductGroup(slug: string, options?: {
|
|
1304
|
+
locale?: string;
|
|
1305
|
+
currency?: string;
|
|
1306
|
+
}): Promise<SdkResult<ProductGroup>>;
|
|
1261
1307
|
/** Cross-sell / related / upsell products for a product */
|
|
1262
1308
|
getCrossSell(productSlug: string): Promise<SdkResult<{
|
|
1263
1309
|
related: CrossSellItem[];
|
|
@@ -1557,4 +1603,4 @@ declare class ShippingModule {
|
|
|
1557
1603
|
}>>;
|
|
1558
1604
|
}
|
|
1559
1605
|
|
|
1560
|
-
export { type
|
|
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 };
|
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, 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';
|
|
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, 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';
|
|
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 _chunkHOL6WRHRjs = require('./chunk-HOL6WRHR.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 = _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;
|
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-DL533jvY.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-DL533jvY.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 _chunkHOL6WRHRjs = require('./chunk-HOL6WRHR.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, _chunkHOL6WRHRjs.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-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';
|
|
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[];
|
|
@@ -1061,4 +1069,4 @@ declare function useNotifyWhenAvailable(): _tanstack_react_query.UseMutationResu
|
|
|
1061
1069
|
*/
|
|
1062
1070
|
declare function useBehioClient(): BehioStorefront;
|
|
1063
1071
|
|
|
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 };
|
|
1072
|
+
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-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';
|
|
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[];
|
|
@@ -1061,4 +1069,4 @@ declare function useNotifyWhenAvailable(): _tanstack_react_query.UseMutationResu
|
|
|
1061
1069
|
*/
|
|
1062
1070
|
declare function useBehioClient(): BehioStorefront;
|
|
1063
1071
|
|
|
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 };
|
|
1072
|
+
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 _chunkHOL6WRHRjs = require('./chunk-HOL6WRHR.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, _chunkHOL6WRHRjs.BehioStorefront)({
|
|
138
138
|
apiKey,
|
|
139
139
|
baseUrl,
|
|
140
140
|
...shopDomain ? { shopDomain } : {},
|
|
@@ -1528,6 +1528,23 @@ 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) {
|
|
@@ -1535,8 +1552,8 @@ function useCrossSell(productSlug, options) {
|
|
|
1535
1552
|
return _reactquery.useQuery.call(void 0, {
|
|
1536
1553
|
queryKey: ["behio", "cross-sell", productSlug],
|
|
1537
1554
|
queryFn: () => unwrap(client.catalog.getCrossSell(productSlug)),
|
|
1538
|
-
enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1539
|
-
initialData: _optionalChain([options, 'optionalAccess',
|
|
1555
|
+
enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _90 => _90.enabled]), () => ( true))),
|
|
1556
|
+
initialData: _optionalChain([options, 'optionalAccess', _91 => _91.initialData])
|
|
1540
1557
|
});
|
|
1541
1558
|
}
|
|
1542
1559
|
|
|
@@ -1547,8 +1564,8 @@ function useProductPromotions(productSlug, options) {
|
|
|
1547
1564
|
return _reactquery.useQuery.call(void 0, {
|
|
1548
1565
|
queryKey: ["behio", "product-promotions", productSlug],
|
|
1549
1566
|
queryFn: () => unwrap(client.catalog.getProductPromotions(productSlug)),
|
|
1550
|
-
enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1551
|
-
refetchInterval: _optionalChain([options, 'optionalAccess',
|
|
1567
|
+
enabled: Boolean(productSlug) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _92 => _92.enabled]), () => ( true))),
|
|
1568
|
+
refetchInterval: _optionalChain([options, 'optionalAccess', _93 => _93.refetchIntervalMs])
|
|
1552
1569
|
});
|
|
1553
1570
|
}
|
|
1554
1571
|
|
|
@@ -1556,11 +1573,11 @@ function useProductPromotions(productSlug, options) {
|
|
|
1556
1573
|
|
|
1557
1574
|
function useGiftCardBalance(code, options) {
|
|
1558
1575
|
const { client } = useBehio();
|
|
1559
|
-
const trimmed = _optionalChain([code, 'optionalAccess',
|
|
1576
|
+
const trimmed = _optionalChain([code, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]);
|
|
1560
1577
|
return _reactquery.useQuery.call(void 0, {
|
|
1561
1578
|
queryKey: ["behio", "gift-card-balance", trimmed],
|
|
1562
1579
|
queryFn: () => unwrap(client.catalog.checkGiftCard(trimmed)),
|
|
1563
|
-
enabled: Boolean(trimmed && trimmed.length >= 6) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1580
|
+
enabled: Boolean(trimmed && trimmed.length >= 6) && (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _96 => _96.enabled]), () => ( true)))
|
|
1564
1581
|
});
|
|
1565
1582
|
}
|
|
1566
1583
|
|
|
@@ -1572,7 +1589,7 @@ function useWishlist(options) {
|
|
|
1572
1589
|
const query = _reactquery.useQuery.call(void 0, {
|
|
1573
1590
|
queryKey: ["behio", "wishlist"],
|
|
1574
1591
|
queryFn: () => unwrap(client.wishlist.get()),
|
|
1575
|
-
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1592
|
+
enabled: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _97 => _97.enabled]), () => ( true))
|
|
1576
1593
|
});
|
|
1577
1594
|
const addMutation = _reactquery.useMutation.call(void 0, {
|
|
1578
1595
|
mutationFn: (productId) => unwrap(client.wishlist.add(productId)),
|
|
@@ -1604,9 +1621,9 @@ function useIsInWishlist(productId) {
|
|
|
1604
1621
|
function useProductReviews(productId, options) {
|
|
1605
1622
|
const { client } = useBehio();
|
|
1606
1623
|
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',
|
|
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)))
|
|
1610
1627
|
});
|
|
1611
1628
|
}
|
|
1612
1629
|
function useSubmitReview() {
|
|
@@ -1721,4 +1738,5 @@ function useNotifyWhenAvailable() {
|
|
|
1721
1738
|
|
|
1722
1739
|
|
|
1723
1740
|
|
|
1724
|
-
|
|
1741
|
+
|
|
1742
|
+
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-O5UHKZPG.mjs";
|
|
8
8
|
|
|
9
9
|
// src/react/provider.tsx
|
|
10
10
|
import { useRef, useEffect, useMemo, useState, useCallback } from "react";
|
|
@@ -1528,11 +1528,28 @@ 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", "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({
|
|
1536
1553
|
queryKey: ["behio", "cross-sell", productSlug],
|
|
1537
1554
|
queryFn: () => unwrap(client.catalog.getCrossSell(productSlug)),
|
|
1538
1555
|
enabled: Boolean(productSlug) && (options?.enabled ?? true),
|
|
@@ -1541,10 +1558,10 @@ function useCrossSell(productSlug, options) {
|
|
|
1541
1558
|
}
|
|
1542
1559
|
|
|
1543
1560
|
// src/react/hooks/use-product-promotions.ts
|
|
1544
|
-
import { useQuery as
|
|
1561
|
+
import { useQuery as useQuery23 } from "@tanstack/react-query";
|
|
1545
1562
|
function useProductPromotions(productSlug, options) {
|
|
1546
1563
|
const { client } = useBehio();
|
|
1547
|
-
return
|
|
1564
|
+
return useQuery23({
|
|
1548
1565
|
queryKey: ["behio", "product-promotions", productSlug],
|
|
1549
1566
|
queryFn: () => unwrap(client.catalog.getProductPromotions(productSlug)),
|
|
1550
1567
|
enabled: Boolean(productSlug) && (options?.enabled ?? true),
|
|
@@ -1553,11 +1570,11 @@ function useProductPromotions(productSlug, options) {
|
|
|
1553
1570
|
}
|
|
1554
1571
|
|
|
1555
1572
|
// src/react/hooks/use-gift-card.ts
|
|
1556
|
-
import { useQuery as
|
|
1573
|
+
import { useQuery as useQuery24 } from "@tanstack/react-query";
|
|
1557
1574
|
function useGiftCardBalance(code, options) {
|
|
1558
1575
|
const { client } = useBehio();
|
|
1559
1576
|
const trimmed = code?.trim();
|
|
1560
|
-
return
|
|
1577
|
+
return useQuery24({
|
|
1561
1578
|
queryKey: ["behio", "gift-card-balance", trimmed],
|
|
1562
1579
|
queryFn: () => unwrap(client.catalog.checkGiftCard(trimmed)),
|
|
1563
1580
|
enabled: Boolean(trimmed && trimmed.length >= 6) && (options?.enabled ?? true)
|
|
@@ -1565,11 +1582,11 @@ function useGiftCardBalance(code, options) {
|
|
|
1565
1582
|
}
|
|
1566
1583
|
|
|
1567
1584
|
// src/react/hooks/use-wishlist.ts
|
|
1568
|
-
import { useQuery as
|
|
1585
|
+
import { useQuery as useQuery25, useMutation as useMutation9, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
|
|
1569
1586
|
function useWishlist(options) {
|
|
1570
1587
|
const { client } = useBehio();
|
|
1571
1588
|
const qc = useQueryClient10();
|
|
1572
|
-
const query =
|
|
1589
|
+
const query = useQuery25({
|
|
1573
1590
|
queryKey: ["behio", "wishlist"],
|
|
1574
1591
|
queryFn: () => unwrap(client.wishlist.get()),
|
|
1575
1592
|
enabled: options?.enabled ?? true
|
|
@@ -1592,7 +1609,7 @@ function useWishlist(options) {
|
|
|
1592
1609
|
}
|
|
1593
1610
|
function useIsInWishlist(productId) {
|
|
1594
1611
|
const { client } = useBehio();
|
|
1595
|
-
return
|
|
1612
|
+
return useQuery25({
|
|
1596
1613
|
queryKey: ["behio", "wishlist-check", productId],
|
|
1597
1614
|
queryFn: () => unwrap(client.wishlist.isInWishlist(productId)),
|
|
1598
1615
|
enabled: Boolean(productId)
|
|
@@ -1600,10 +1617,10 @@ function useIsInWishlist(productId) {
|
|
|
1600
1617
|
}
|
|
1601
1618
|
|
|
1602
1619
|
// src/react/hooks/use-reviews.ts
|
|
1603
|
-
import { useQuery as
|
|
1620
|
+
import { useQuery as useQuery26, useMutation as useMutation10, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
|
|
1604
1621
|
function useProductReviews(productId, options) {
|
|
1605
1622
|
const { client } = useBehio();
|
|
1606
|
-
return
|
|
1623
|
+
return useQuery26({
|
|
1607
1624
|
queryKey: ["behio", "reviews", productId, options?.page ?? 1],
|
|
1608
1625
|
queryFn: () => unwrap(client.reviews.getProductReviews(productId, options?.page, options?.limit)),
|
|
1609
1626
|
enabled: Boolean(productId) && (options?.enabled ?? true)
|
|
@@ -1619,7 +1636,7 @@ function useSubmitReview() {
|
|
|
1619
1636
|
}
|
|
1620
1637
|
|
|
1621
1638
|
// src/react/hooks/use-returns.ts
|
|
1622
|
-
import { useQuery as
|
|
1639
|
+
import { useQuery as useQuery27, useMutation as useMutation11 } from "@tanstack/react-query";
|
|
1623
1640
|
function useLookupReturnableOrder() {
|
|
1624
1641
|
const { client } = useBehio();
|
|
1625
1642
|
return useMutation11({
|
|
@@ -1634,7 +1651,7 @@ function useSubmitReturn() {
|
|
|
1634
1651
|
}
|
|
1635
1652
|
function useReturnStatus(returnId, email) {
|
|
1636
1653
|
const { client } = useBehio();
|
|
1637
|
-
return
|
|
1654
|
+
return useQuery27({
|
|
1638
1655
|
queryKey: ["behio", "return-status", returnId],
|
|
1639
1656
|
queryFn: () => unwrap(client.returns.getStatus(returnId, email)),
|
|
1640
1657
|
enabled: Boolean(returnId && email)
|
|
@@ -1642,7 +1659,7 @@ function useReturnStatus(returnId, email) {
|
|
|
1642
1659
|
}
|
|
1643
1660
|
|
|
1644
1661
|
// src/react/hooks/use-quotes.ts
|
|
1645
|
-
import { useMutation as useMutation12, useQuery as
|
|
1662
|
+
import { useMutation as useMutation12, useQuery as useQuery28 } from "@tanstack/react-query";
|
|
1646
1663
|
function useSubmitQuote() {
|
|
1647
1664
|
const { client } = useBehio();
|
|
1648
1665
|
return useMutation12({
|
|
@@ -1651,7 +1668,7 @@ function useSubmitQuote() {
|
|
|
1651
1668
|
}
|
|
1652
1669
|
function useQuoteStatus(quoteId, email) {
|
|
1653
1670
|
const { client } = useBehio();
|
|
1654
|
-
return
|
|
1671
|
+
return useQuery28({
|
|
1655
1672
|
queryKey: ["behio", "quote-status", quoteId],
|
|
1656
1673
|
queryFn: () => unwrap(client.quotes.getStatus(quoteId, email)),
|
|
1657
1674
|
enabled: Boolean(quoteId && email)
|
|
@@ -1708,6 +1725,7 @@ export {
|
|
|
1708
1725
|
usePage,
|
|
1709
1726
|
usePages,
|
|
1710
1727
|
useProduct,
|
|
1728
|
+
useProductGroup,
|
|
1711
1729
|
useProductPromotions,
|
|
1712
1730
|
useProductReviews,
|
|
1713
1731
|
useProducts,
|