@behio/storefront-sdk 1.5.0 → 1.7.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-OQK7PQYJ.js → chunk-TJ4TZ5FI.js} +23 -0
- package/dist/{chunk-7CFBSRUZ.mjs → chunk-TOSF3K7J.mjs} +23 -0
- package/dist/{client-LetSVGM1.d.mts → client-BSDdOEcK.d.mts} +71 -1
- package/dist/{client-LetSVGM1.d.ts → client-BSDdOEcK.d.ts} +71 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- 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 +70 -0
- package/dist/react.d.ts +70 -0
- package/dist/react.js +32 -2
- package/dist/react.mjs +32 -2
- package/package.json +1 -1
|
@@ -972,6 +972,29 @@ var CartModule = class {
|
|
|
972
972
|
this.client.emit("cart:updated", res.data);
|
|
973
973
|
return res;
|
|
974
974
|
}
|
|
975
|
+
/**
|
|
976
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
977
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
978
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
979
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
980
|
+
* none exists yet.
|
|
981
|
+
*
|
|
982
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
983
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
984
|
+
*
|
|
985
|
+
* ```ts
|
|
986
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
987
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
988
|
+
* ```
|
|
989
|
+
*/
|
|
990
|
+
async setCurrency(currency) {
|
|
991
|
+
const res = await this.client.request("PUT", "/cart/currency", {
|
|
992
|
+
body: { currency }
|
|
993
|
+
});
|
|
994
|
+
if (res.error) return res;
|
|
995
|
+
this.client.emit("cart:updated", res.data);
|
|
996
|
+
return res;
|
|
997
|
+
}
|
|
975
998
|
/** Update item quantity */
|
|
976
999
|
async updateQuantity(itemId, quantity) {
|
|
977
1000
|
const res = await this.client.request(
|
|
@@ -972,6 +972,29 @@ var CartModule = class {
|
|
|
972
972
|
this.client.emit("cart:updated", res.data);
|
|
973
973
|
return res;
|
|
974
974
|
}
|
|
975
|
+
/**
|
|
976
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
977
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
978
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
979
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
980
|
+
* none exists yet.
|
|
981
|
+
*
|
|
982
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
983
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
984
|
+
*
|
|
985
|
+
* ```ts
|
|
986
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
987
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
988
|
+
* ```
|
|
989
|
+
*/
|
|
990
|
+
async setCurrency(currency) {
|
|
991
|
+
const res = await this.client.request("PUT", "/cart/currency", {
|
|
992
|
+
body: { currency }
|
|
993
|
+
});
|
|
994
|
+
if (res.error) return res;
|
|
995
|
+
this.client.emit("cart:updated", res.data);
|
|
996
|
+
return res;
|
|
997
|
+
}
|
|
975
998
|
/** Update item quantity */
|
|
976
999
|
async updateQuantity(itemId, quantity) {
|
|
977
1000
|
const res = await this.client.request(
|
|
@@ -644,6 +644,50 @@ interface ProductParameterGroup {
|
|
|
644
644
|
interface ProductParametersResponse {
|
|
645
645
|
groups: ProductParameterGroup[];
|
|
646
646
|
}
|
|
647
|
+
/**
|
|
648
|
+
* One item of a product asset group: an image, a hosted video, a downloadable
|
|
649
|
+
* file, or an external video embed. Added in SDK 1.7.0.
|
|
650
|
+
*
|
|
651
|
+
* `kind` decides how to render it:
|
|
652
|
+
* - `IMAGE` / `VIDEO` / `FILE`: a file hosted on the Behio CDN (`url` is a
|
|
653
|
+
* direct file URL; `contentType` and `size` describe it).
|
|
654
|
+
* - `EXTERNAL_VIDEO`: an embed URL (YouTube/Vimeo). Render it in an
|
|
655
|
+
* `<iframe>`, never in a `<video>` tag. `size` is null.
|
|
656
|
+
*/
|
|
657
|
+
interface ProductAssetItem {
|
|
658
|
+
id: string;
|
|
659
|
+
kind: "IMAGE" | "VIDEO" | "FILE" | "EXTERNAL_VIDEO";
|
|
660
|
+
url: string;
|
|
661
|
+
/** MIME type ("video/mp4", "application/pdf"); null when unknown or external. */
|
|
662
|
+
contentType?: string | null;
|
|
663
|
+
/** File size in bytes; null for external videos. */
|
|
664
|
+
size?: number | null;
|
|
665
|
+
/** Merchant title in the requested locale, or null when none was written. */
|
|
666
|
+
title?: string | null;
|
|
667
|
+
description?: string | null;
|
|
668
|
+
order: number;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* A merchant-named group of extra product content ("videos", "downloads").
|
|
672
|
+
* Groups only exist while they have items, so empty groups are never emitted.
|
|
673
|
+
* Added in SDK 1.7.0.
|
|
674
|
+
*
|
|
675
|
+
* Example: render a video section from the "videos" group:
|
|
676
|
+
* ```tsx
|
|
677
|
+
* const videos = product.assetGroups.find((g) => g.group === "videos");
|
|
678
|
+
* videos?.items.map((v) =>
|
|
679
|
+
* v.kind === "EXTERNAL_VIDEO"
|
|
680
|
+
* ? <iframe key={v.id} src={v.url} title={v.title ?? undefined} allowFullScreen />
|
|
681
|
+
* : <video key={v.id} controls preload="metadata" src={v.url} />
|
|
682
|
+
* );
|
|
683
|
+
* ```
|
|
684
|
+
*/
|
|
685
|
+
interface ProductAssetGroup {
|
|
686
|
+
/** Merchant-named group slug ("videos", "downloads"). */
|
|
687
|
+
group: string;
|
|
688
|
+
/** Items sorted by `order`. */
|
|
689
|
+
items: ProductAssetItem[];
|
|
690
|
+
}
|
|
647
691
|
interface ProductDetail extends ProductListItem {
|
|
648
692
|
longDescription?: string;
|
|
649
693
|
/**
|
|
@@ -686,6 +730,16 @@ interface ProductDetail extends ProductListItem {
|
|
|
686
730
|
* data groups, which published internal bookkeeping nobody curated.
|
|
687
731
|
*/
|
|
688
732
|
parameterGroups: ProductParameterGroup[];
|
|
733
|
+
/**
|
|
734
|
+
* Merchant-curated extra content in named groups ("videos", "downloads"):
|
|
735
|
+
* images, videos, files and external video embeds attached to the product.
|
|
736
|
+
* Distinct from `images` (roled gallery) and `media` (inventory gallery).
|
|
737
|
+
* Empty array when the merchant attached nothing. Added in SDK 1.7.0.
|
|
738
|
+
*
|
|
739
|
+
* Videos: `kind === "EXTERNAL_VIDEO"` is an embed URL (YouTube/Vimeo) for an
|
|
740
|
+
* `<iframe>`; `kind === "VIDEO"` is a CDN-hosted file for a `<video>` tag.
|
|
741
|
+
*/
|
|
742
|
+
assetGroups: ProductAssetGroup[];
|
|
689
743
|
seo: {
|
|
690
744
|
/**
|
|
691
745
|
* Slug of the page that should be canonical INSTEAD of this one. Empty
|
|
@@ -2616,6 +2670,22 @@ declare class CartModule {
|
|
|
2616
2670
|
addItem(input: AddToCartInput): Promise<SdkResult<Cart & {
|
|
2617
2671
|
newSessionToken?: string;
|
|
2618
2672
|
}>>;
|
|
2673
|
+
/**
|
|
2674
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
2675
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
2676
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
2677
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
2678
|
+
* none exists yet.
|
|
2679
|
+
*
|
|
2680
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
2681
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
2682
|
+
*
|
|
2683
|
+
* ```ts
|
|
2684
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
2685
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
2686
|
+
* ```
|
|
2687
|
+
*/
|
|
2688
|
+
setCurrency(currency: string): Promise<SdkResult<Cart>>;
|
|
2619
2689
|
/** Update item quantity */
|
|
2620
2690
|
updateQuantity(itemId: string, quantity: number): Promise<SdkResult<Cart>>;
|
|
2621
2691
|
/** Remove item from cart */
|
|
@@ -3027,4 +3097,4 @@ declare class NewsletterModule {
|
|
|
3027
3097
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
3028
3098
|
}
|
|
3029
3099
|
|
|
3030
|
-
export { type DigitalDownload as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type CertificateVerification as D, type CheckoutAddress as E, type CheckoutInput as F, type CheckoutPaymentMethod as G, type CheckoutSettings as H, type CookieConsentInput as I, type CourseAttachment as J, type CourseCertificate as K, type CourseComment as L, type CourseCommentReply as M, type CourseCommentsList as N, type CourseDetail as O, type ProductDetail as P, type CourseLesson as Q, type CourseListItem as R, type SdkResult as S, type CourseModule as T, type CoursePostedComment as U, type CourseProgress as V, type CourseTutorMessage as W, type CourseTutorThread as X, type CrossSellItem as Y, type CustomerAddress as Z, type CustomerProfile as _, type ProductVariant as a, type
|
|
3100
|
+
export { type DigitalDownload as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type CertificateVerification as D, type CheckoutAddress as E, type CheckoutInput as F, type CheckoutPaymentMethod as G, type CheckoutSettings as H, type CookieConsentInput as I, type CourseAttachment as J, type CourseCertificate as K, type CourseComment as L, type CourseCommentReply as M, type CourseCommentsList as N, type CourseDetail as O, type ProductDetail as P, type CourseLesson as Q, type CourseListItem as R, type SdkResult as S, type CourseModule as T, type CoursePostedComment as U, type CourseProgress as V, type CourseTutorMessage as W, type CourseTutorThread as X, type CrossSellItem as Y, type CustomerAddress as Z, type CustomerProfile as _, type ProductVariant as a, type ProductParameter as a$, type DownloadUrl as a0, type Facet as a1, type FacetAvailability as a2, type FacetCategory as a3, type FacetLabel as a4, type FacetPriceRange as a5, type FacetRange as a6, type FacetRatingBucket as a7, type FacetValue as a8, type FacetsResponse as a9, type OrderAccessRequestResponse as aA, type OrderAccessVerifyResponse as aB, type OrderDetail as aC, type OrderItem as aD, type OrderListItem as aE, type OrderStatus as aF, type OrderStatusHistory as aG, OrderStatuses as aH, type OrderTracking as aI, type Page as aJ, type PageAttachment as aK, type PageDetail as aL, type PaginatedResponse as aM, type PaymentStatus as aN, PaymentStatuses as aO, type PickupPoint as aP, type PickupPointHours as aQ, type PickupPointsInput as aR, type PriceDisplay as aS, type ProductAssetGroup as aT, type ProductAssetItem as aU, type ProductAvailability as aV, type ProductGroup as aW, type ProductLabel as aX, type ProductListItem as aY, type ProductMedia as aZ, type ProductMediaVariant as a_, type FilterField as aa, type FulfillmentStatus as ab, FulfillmentStatuses as ac, type GiftCardBalance as ad, type GiftCardPurchaseInput as ae, type GiftCardPurchaseResult as af, type GiftCardSummary as ag, type LessonNote as ah, type LessonQuiz as ai, type LoginInput as aj, type LoyaltyBalance as ak, type LoyaltyNextTier as al, type LoyaltyProgram as am, type LoyaltySummary as an, type LoyaltyTier as ao, type LoyaltyTierPerks as ap, type LoyaltyTransaction as aq, type Menu as ar, type MenuItem as as, type MenuItemRef as at, type MenuItemType as au, type MessageResponse as av, type NewsletterOptInDefault as aw, type NewsletterSubscribeInput as ax, type NewsletterSubscribeResult as ay, type NewsletterUnsubscribeResult as az, type AddToCartInput as b, type ProductParameterGroup as b0, type ProductParametersResponse as b1, type ProductPrice as b2, type ProductPromotionSummary as b3, type ProductReview as b4, type ProductReviewsResponse as b5, type ProductSibling as b6, ProductSort as b7, type ProductSortValue as b8, type ProductVolumePrice as b9, type ShopScriptType as bA, type ShopScripts as bB, type ShopSeo as bC, type ShopSeoIdentity as bD, type Sitemap as bE, type SitemapEntry as bF, type StockBehavior as bG, type StockMode as bH, type SubmitQuoteInput as bI, type SubmitReturnInput as bJ, type SubmitReviewInput as bK, type Subscription as bL, type SubscriptionAction as bM, type SubscriptionFrequency as bN, type SubscriptionItem as bO, type SubscriptionStatus as bP, type TaxBreakdownLine as bQ, type VariantAxis as bR, type VariantAxisValue as bS, type WishlistItem as bT, err as bU, ok as bV, toSdkError as bW, type ProductsQuery as ba, type QuizAnswerInput as bb, type QuizAnswerResult as bc, type QuizQuestion as bd, type QuizResult as be, type QuoteItem as bf, type QuoteRequest as bg, type RegisterInput as bh, type RegisterResult as bi, type RequestInterceptor as bj, type RequestInterceptorConfig as bk, type ResponseInterceptor as bl, type ResponseInterceptorData as bm, type ReturnRequest as bn, type ReturnRequestItem as bo, type ReturnStatus as bp, type ReturnStatusItem as bq, type ReturnableOrder as br, type ReturnableOrderItem as bs, type SdkError as bt, type ShippingMethodSummary as bu, type ShippingQuote as bv, type ShippingQuoteInput as bw, type ShopInfo as bx, type ShopScript as by, type ShopScriptPlacement as bz, type AddressDetail as c, type AddressSuggestion as d, type AddressType as e, AddressTypes as f, type AuthTokens as g, type BackInStockSubscription as h, type BadgeTone as i, BehioApiError as j, type BehioErrorCode as k, type BehioEventHandler as l, type BehioEventType as m, BehioNetworkError as n, type BehioStorefrontConfig as o, type Bundle as p, type BundleItem as q, type Cart as r, type CartBundleLine as s, type CartBundleLineItem as t, type CartDiscount as u, type CartItem as v, type CartItemProduct as w, type CartPromotion as x, type Category as y, type CategoryDetail as z };
|
|
@@ -644,6 +644,50 @@ interface ProductParameterGroup {
|
|
|
644
644
|
interface ProductParametersResponse {
|
|
645
645
|
groups: ProductParameterGroup[];
|
|
646
646
|
}
|
|
647
|
+
/**
|
|
648
|
+
* One item of a product asset group: an image, a hosted video, a downloadable
|
|
649
|
+
* file, or an external video embed. Added in SDK 1.7.0.
|
|
650
|
+
*
|
|
651
|
+
* `kind` decides how to render it:
|
|
652
|
+
* - `IMAGE` / `VIDEO` / `FILE`: a file hosted on the Behio CDN (`url` is a
|
|
653
|
+
* direct file URL; `contentType` and `size` describe it).
|
|
654
|
+
* - `EXTERNAL_VIDEO`: an embed URL (YouTube/Vimeo). Render it in an
|
|
655
|
+
* `<iframe>`, never in a `<video>` tag. `size` is null.
|
|
656
|
+
*/
|
|
657
|
+
interface ProductAssetItem {
|
|
658
|
+
id: string;
|
|
659
|
+
kind: "IMAGE" | "VIDEO" | "FILE" | "EXTERNAL_VIDEO";
|
|
660
|
+
url: string;
|
|
661
|
+
/** MIME type ("video/mp4", "application/pdf"); null when unknown or external. */
|
|
662
|
+
contentType?: string | null;
|
|
663
|
+
/** File size in bytes; null for external videos. */
|
|
664
|
+
size?: number | null;
|
|
665
|
+
/** Merchant title in the requested locale, or null when none was written. */
|
|
666
|
+
title?: string | null;
|
|
667
|
+
description?: string | null;
|
|
668
|
+
order: number;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* A merchant-named group of extra product content ("videos", "downloads").
|
|
672
|
+
* Groups only exist while they have items, so empty groups are never emitted.
|
|
673
|
+
* Added in SDK 1.7.0.
|
|
674
|
+
*
|
|
675
|
+
* Example: render a video section from the "videos" group:
|
|
676
|
+
* ```tsx
|
|
677
|
+
* const videos = product.assetGroups.find((g) => g.group === "videos");
|
|
678
|
+
* videos?.items.map((v) =>
|
|
679
|
+
* v.kind === "EXTERNAL_VIDEO"
|
|
680
|
+
* ? <iframe key={v.id} src={v.url} title={v.title ?? undefined} allowFullScreen />
|
|
681
|
+
* : <video key={v.id} controls preload="metadata" src={v.url} />
|
|
682
|
+
* );
|
|
683
|
+
* ```
|
|
684
|
+
*/
|
|
685
|
+
interface ProductAssetGroup {
|
|
686
|
+
/** Merchant-named group slug ("videos", "downloads"). */
|
|
687
|
+
group: string;
|
|
688
|
+
/** Items sorted by `order`. */
|
|
689
|
+
items: ProductAssetItem[];
|
|
690
|
+
}
|
|
647
691
|
interface ProductDetail extends ProductListItem {
|
|
648
692
|
longDescription?: string;
|
|
649
693
|
/**
|
|
@@ -686,6 +730,16 @@ interface ProductDetail extends ProductListItem {
|
|
|
686
730
|
* data groups, which published internal bookkeeping nobody curated.
|
|
687
731
|
*/
|
|
688
732
|
parameterGroups: ProductParameterGroup[];
|
|
733
|
+
/**
|
|
734
|
+
* Merchant-curated extra content in named groups ("videos", "downloads"):
|
|
735
|
+
* images, videos, files and external video embeds attached to the product.
|
|
736
|
+
* Distinct from `images` (roled gallery) and `media` (inventory gallery).
|
|
737
|
+
* Empty array when the merchant attached nothing. Added in SDK 1.7.0.
|
|
738
|
+
*
|
|
739
|
+
* Videos: `kind === "EXTERNAL_VIDEO"` is an embed URL (YouTube/Vimeo) for an
|
|
740
|
+
* `<iframe>`; `kind === "VIDEO"` is a CDN-hosted file for a `<video>` tag.
|
|
741
|
+
*/
|
|
742
|
+
assetGroups: ProductAssetGroup[];
|
|
689
743
|
seo: {
|
|
690
744
|
/**
|
|
691
745
|
* Slug of the page that should be canonical INSTEAD of this one. Empty
|
|
@@ -2616,6 +2670,22 @@ declare class CartModule {
|
|
|
2616
2670
|
addItem(input: AddToCartInput): Promise<SdkResult<Cart & {
|
|
2617
2671
|
newSessionToken?: string;
|
|
2618
2672
|
}>>;
|
|
2673
|
+
/**
|
|
2674
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
2675
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
2676
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
2677
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
2678
|
+
* none exists yet.
|
|
2679
|
+
*
|
|
2680
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
2681
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
2682
|
+
*
|
|
2683
|
+
* ```ts
|
|
2684
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
2685
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
2686
|
+
* ```
|
|
2687
|
+
*/
|
|
2688
|
+
setCurrency(currency: string): Promise<SdkResult<Cart>>;
|
|
2619
2689
|
/** Update item quantity */
|
|
2620
2690
|
updateQuantity(itemId: string, quantity: number): Promise<SdkResult<Cart>>;
|
|
2621
2691
|
/** Remove item from cart */
|
|
@@ -3027,4 +3097,4 @@ declare class NewsletterModule {
|
|
|
3027
3097
|
unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
|
|
3028
3098
|
}
|
|
3029
3099
|
|
|
3030
|
-
export { type DigitalDownload as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type CertificateVerification as D, type CheckoutAddress as E, type CheckoutInput as F, type CheckoutPaymentMethod as G, type CheckoutSettings as H, type CookieConsentInput as I, type CourseAttachment as J, type CourseCertificate as K, type CourseComment as L, type CourseCommentReply as M, type CourseCommentsList as N, type CourseDetail as O, type ProductDetail as P, type CourseLesson as Q, type CourseListItem as R, type SdkResult as S, type CourseModule as T, type CoursePostedComment as U, type CourseProgress as V, type CourseTutorMessage as W, type CourseTutorThread as X, type CrossSellItem as Y, type CustomerAddress as Z, type CustomerProfile as _, type ProductVariant as a, type
|
|
3100
|
+
export { type DigitalDownload as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type CertificateVerification as D, type CheckoutAddress as E, type CheckoutInput as F, type CheckoutPaymentMethod as G, type CheckoutSettings as H, type CookieConsentInput as I, type CourseAttachment as J, type CourseCertificate as K, type CourseComment as L, type CourseCommentReply as M, type CourseCommentsList as N, type CourseDetail as O, type ProductDetail as P, type CourseLesson as Q, type CourseListItem as R, type SdkResult as S, type CourseModule as T, type CoursePostedComment as U, type CourseProgress as V, type CourseTutorMessage as W, type CourseTutorThread as X, type CrossSellItem as Y, type CustomerAddress as Z, type CustomerProfile as _, type ProductVariant as a, type ProductParameter as a$, type DownloadUrl as a0, type Facet as a1, type FacetAvailability as a2, type FacetCategory as a3, type FacetLabel as a4, type FacetPriceRange as a5, type FacetRange as a6, type FacetRatingBucket as a7, type FacetValue as a8, type FacetsResponse as a9, type OrderAccessRequestResponse as aA, type OrderAccessVerifyResponse as aB, type OrderDetail as aC, type OrderItem as aD, type OrderListItem as aE, type OrderStatus as aF, type OrderStatusHistory as aG, OrderStatuses as aH, type OrderTracking as aI, type Page as aJ, type PageAttachment as aK, type PageDetail as aL, type PaginatedResponse as aM, type PaymentStatus as aN, PaymentStatuses as aO, type PickupPoint as aP, type PickupPointHours as aQ, type PickupPointsInput as aR, type PriceDisplay as aS, type ProductAssetGroup as aT, type ProductAssetItem as aU, type ProductAvailability as aV, type ProductGroup as aW, type ProductLabel as aX, type ProductListItem as aY, type ProductMedia as aZ, type ProductMediaVariant as a_, type FilterField as aa, type FulfillmentStatus as ab, FulfillmentStatuses as ac, type GiftCardBalance as ad, type GiftCardPurchaseInput as ae, type GiftCardPurchaseResult as af, type GiftCardSummary as ag, type LessonNote as ah, type LessonQuiz as ai, type LoginInput as aj, type LoyaltyBalance as ak, type LoyaltyNextTier as al, type LoyaltyProgram as am, type LoyaltySummary as an, type LoyaltyTier as ao, type LoyaltyTierPerks as ap, type LoyaltyTransaction as aq, type Menu as ar, type MenuItem as as, type MenuItemRef as at, type MenuItemType as au, type MessageResponse as av, type NewsletterOptInDefault as aw, type NewsletterSubscribeInput as ax, type NewsletterSubscribeResult as ay, type NewsletterUnsubscribeResult as az, type AddToCartInput as b, type ProductParameterGroup as b0, type ProductParametersResponse as b1, type ProductPrice as b2, type ProductPromotionSummary as b3, type ProductReview as b4, type ProductReviewsResponse as b5, type ProductSibling as b6, ProductSort as b7, type ProductSortValue as b8, type ProductVolumePrice as b9, type ShopScriptType as bA, type ShopScripts as bB, type ShopSeo as bC, type ShopSeoIdentity as bD, type Sitemap as bE, type SitemapEntry as bF, type StockBehavior as bG, type StockMode as bH, type SubmitQuoteInput as bI, type SubmitReturnInput as bJ, type SubmitReviewInput as bK, type Subscription as bL, type SubscriptionAction as bM, type SubscriptionFrequency as bN, type SubscriptionItem as bO, type SubscriptionStatus as bP, type TaxBreakdownLine as bQ, type VariantAxis as bR, type VariantAxisValue as bS, type WishlistItem as bT, err as bU, ok as bV, toSdkError as bW, type ProductsQuery as ba, type QuizAnswerInput as bb, type QuizAnswerResult as bc, type QuizQuestion as bd, type QuizResult as be, type QuoteItem as bf, type QuoteRequest as bg, type RegisterInput as bh, type RegisterResult as bi, type RequestInterceptor as bj, type RequestInterceptorConfig as bk, type ResponseInterceptor as bl, type ResponseInterceptorData as bm, type ReturnRequest as bn, type ReturnRequestItem as bo, type ReturnStatus as bp, type ReturnStatusItem as bq, type ReturnableOrder as br, type ReturnableOrderItem as bs, type SdkError as bt, type ShippingMethodSummary as bu, type ShippingQuote as bv, type ShippingQuoteInput as bw, type ShopInfo as bx, type ShopScript as by, type ShopScriptPlacement as bz, type AddressDetail as c, type AddressSuggestion as d, type AddressType as e, AddressTypes as f, type AuthTokens as g, type BackInStockSubscription as h, type BadgeTone as i, BehioApiError as j, type BehioErrorCode as k, type BehioEventHandler as l, type BehioEventType as m, BehioNetworkError as n, type BehioStorefrontConfig as o, type Bundle as p, type BundleItem as q, type Cart as r, type CartBundleLine as s, type CartBundleLineItem as t, type CartDiscount as u, type CartItem as v, type CartItemProduct as w, type CartPromotion as x, type Category as y, type CategoryDetail as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-
|
|
2
|
-
export { A as ActivePromotion, b as AddToCartInput, c as AddressDetail, d as AddressSuggestion, e as AddressType, f as AddressTypes, g as AuthTokens, h as BackInStockSubscription, i as BadgeTone, j as BehioApiError, k as BehioErrorCode, l as BehioEventHandler, m as BehioEventType, n as BehioNetworkError, o as BehioStorefrontConfig, p as Bundle, q as BundleItem, r as Cart, s as CartBundleLine, t as CartBundleLineItem, u as CartDiscount, v as CartItem, w as CartItemProduct, x as CartPromotion, y as Category, z as CategoryDetail, D as CertificateVerification, E as CheckoutAddress, F as CheckoutInput, G as CheckoutPaymentMethod, H as CheckoutSettings, I as CookieConsentInput, J as CourseAttachment, K as CourseCertificate, L as CourseComment, M as CourseCommentReply, N as CourseCommentsList, O as CourseDetail, Q as CourseLesson, R as CourseListItem, T as CourseModule, U as CoursePostedComment, V as CourseProgress, W as CourseTutorMessage, X as CourseTutorThread, Y as CrossSellItem, Z as CustomerAddress, _ as CustomerProfile, $ as DigitalDownload, a0 as DownloadUrl, a1 as Facet, a2 as FacetAvailability, a3 as FacetCategory, a4 as FacetLabel, a5 as FacetPriceRange, a6 as FacetRange, a7 as FacetRatingBucket, a8 as FacetValue, a9 as FacetsResponse, aa as FilterField, ab as FulfillmentStatus, ac as FulfillmentStatuses, ad as GiftCardBalance, ae as GiftCardPurchaseInput, af as GiftCardPurchaseResult, ag as GiftCardSummary, ah as LessonNote, ai as LessonQuiz, aj as LoginInput, ak as LoyaltyBalance, al as LoyaltyNextTier, am as LoyaltyProgram, an as LoyaltySummary, ao as LoyaltyTier, ap as LoyaltyTierPerks, aq as LoyaltyTransaction, ar as Menu, as as MenuItem, at as MenuItemRef, au as MenuItemType, av as MessageResponse, aw as NewsletterOptInDefault, ax as NewsletterSubscribeInput, ay as NewsletterSubscribeResult, az as NewsletterUnsubscribeResult, aA as OrderAccessRequestResponse, aB as OrderAccessVerifyResponse, aC as OrderDetail, aD as OrderItem, aE as OrderListItem, aF as OrderStatus, aG as OrderStatusHistory, aH as OrderStatuses, aI as OrderTracking, aJ as Page, aK as PageAttachment, aL as PageDetail, aM as PaginatedResponse, aN as PaymentStatus, aO as PaymentStatuses, aP as PickupPoint, aQ as PickupPointHours, aR as PickupPointsInput, aS as PriceDisplay, aT as
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-BSDdOEcK.mjs';
|
|
2
|
+
export { A as ActivePromotion, b as AddToCartInput, c as AddressDetail, d as AddressSuggestion, e as AddressType, f as AddressTypes, g as AuthTokens, h as BackInStockSubscription, i as BadgeTone, j as BehioApiError, k as BehioErrorCode, l as BehioEventHandler, m as BehioEventType, n as BehioNetworkError, o as BehioStorefrontConfig, p as Bundle, q as BundleItem, r as Cart, s as CartBundleLine, t as CartBundleLineItem, u as CartDiscount, v as CartItem, w as CartItemProduct, x as CartPromotion, y as Category, z as CategoryDetail, D as CertificateVerification, E as CheckoutAddress, F as CheckoutInput, G as CheckoutPaymentMethod, H as CheckoutSettings, I as CookieConsentInput, J as CourseAttachment, K as CourseCertificate, L as CourseComment, M as CourseCommentReply, N as CourseCommentsList, O as CourseDetail, Q as CourseLesson, R as CourseListItem, T as CourseModule, U as CoursePostedComment, V as CourseProgress, W as CourseTutorMessage, X as CourseTutorThread, Y as CrossSellItem, Z as CustomerAddress, _ as CustomerProfile, $ as DigitalDownload, a0 as DownloadUrl, a1 as Facet, a2 as FacetAvailability, a3 as FacetCategory, a4 as FacetLabel, a5 as FacetPriceRange, a6 as FacetRange, a7 as FacetRatingBucket, a8 as FacetValue, a9 as FacetsResponse, aa as FilterField, ab as FulfillmentStatus, ac as FulfillmentStatuses, ad as GiftCardBalance, ae as GiftCardPurchaseInput, af as GiftCardPurchaseResult, ag as GiftCardSummary, ah as LessonNote, ai as LessonQuiz, aj as LoginInput, ak as LoyaltyBalance, al as LoyaltyNextTier, am as LoyaltyProgram, an as LoyaltySummary, ao as LoyaltyTier, ap as LoyaltyTierPerks, aq as LoyaltyTransaction, ar as Menu, as as MenuItem, at as MenuItemRef, au as MenuItemType, av as MessageResponse, aw as NewsletterOptInDefault, ax as NewsletterSubscribeInput, ay as NewsletterSubscribeResult, az as NewsletterUnsubscribeResult, aA as OrderAccessRequestResponse, aB as OrderAccessVerifyResponse, aC as OrderDetail, aD as OrderItem, aE as OrderListItem, aF as OrderStatus, aG as OrderStatusHistory, aH as OrderStatuses, aI as OrderTracking, aJ as Page, aK as PageAttachment, aL as PageDetail, aM as PaginatedResponse, aN as PaymentStatus, aO as PaymentStatuses, aP as PickupPoint, aQ as PickupPointHours, aR as PickupPointsInput, aS as PriceDisplay, aT as ProductAssetGroup, aU as ProductAssetItem, aV as ProductAvailability, aW as ProductGroup, aX as ProductLabel, aY as ProductListItem, aZ as ProductMedia, a_ as ProductMediaVariant, a$ as ProductParameter, b0 as ProductParameterGroup, b1 as ProductParametersResponse, b2 as ProductPrice, b3 as ProductPromotionSummary, b4 as ProductReview, b5 as ProductReviewsResponse, b6 as ProductSibling, b7 as ProductSort, b8 as ProductSortValue, b9 as ProductVolumePrice, ba as ProductsQuery, bb as QuizAnswerInput, bc as QuizAnswerResult, bd as QuizQuestion, be as QuizResult, bf as QuoteItem, bg as QuoteRequest, bh as RegisterInput, bi as RegisterResult, bj as RequestInterceptor, bk as RequestInterceptorConfig, bl as ResponseInterceptor, bm as ResponseInterceptorData, bn as ReturnRequest, bo as ReturnRequestItem, bp as ReturnStatus, bq as ReturnStatusItem, br as ReturnableOrder, bs as ReturnableOrderItem, bt as SdkError, bu as ShippingMethodSummary, bv as ShippingQuote, bw as ShippingQuoteInput, bx as ShopInfo, by as ShopScript, bz as ShopScriptPlacement, bA as ShopScriptType, bB as ShopScripts, bC as ShopSeo, bD as ShopSeoIdentity, bE as Sitemap, bF as SitemapEntry, bG as StockBehavior, bH as StockMode, bI as SubmitQuoteInput, bJ as SubmitReturnInput, bK as SubmitReviewInput, bL as Subscription, bM as SubscriptionAction, bN as SubscriptionFrequency, bO as SubscriptionItem, bP as SubscriptionStatus, bQ as TaxBreakdownLine, bR as VariantAxis, bS as VariantAxisValue, bT as WishlistItem, bU as err, bV as ok, bW as toSdkError } from './client-BSDdOEcK.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-
|
|
2
|
-
export { A as ActivePromotion, b as AddToCartInput, c as AddressDetail, d as AddressSuggestion, e as AddressType, f as AddressTypes, g as AuthTokens, h as BackInStockSubscription, i as BadgeTone, j as BehioApiError, k as BehioErrorCode, l as BehioEventHandler, m as BehioEventType, n as BehioNetworkError, o as BehioStorefrontConfig, p as Bundle, q as BundleItem, r as Cart, s as CartBundleLine, t as CartBundleLineItem, u as CartDiscount, v as CartItem, w as CartItemProduct, x as CartPromotion, y as Category, z as CategoryDetail, D as CertificateVerification, E as CheckoutAddress, F as CheckoutInput, G as CheckoutPaymentMethod, H as CheckoutSettings, I as CookieConsentInput, J as CourseAttachment, K as CourseCertificate, L as CourseComment, M as CourseCommentReply, N as CourseCommentsList, O as CourseDetail, Q as CourseLesson, R as CourseListItem, T as CourseModule, U as CoursePostedComment, V as CourseProgress, W as CourseTutorMessage, X as CourseTutorThread, Y as CrossSellItem, Z as CustomerAddress, _ as CustomerProfile, $ as DigitalDownload, a0 as DownloadUrl, a1 as Facet, a2 as FacetAvailability, a3 as FacetCategory, a4 as FacetLabel, a5 as FacetPriceRange, a6 as FacetRange, a7 as FacetRatingBucket, a8 as FacetValue, a9 as FacetsResponse, aa as FilterField, ab as FulfillmentStatus, ac as FulfillmentStatuses, ad as GiftCardBalance, ae as GiftCardPurchaseInput, af as GiftCardPurchaseResult, ag as GiftCardSummary, ah as LessonNote, ai as LessonQuiz, aj as LoginInput, ak as LoyaltyBalance, al as LoyaltyNextTier, am as LoyaltyProgram, an as LoyaltySummary, ao as LoyaltyTier, ap as LoyaltyTierPerks, aq as LoyaltyTransaction, ar as Menu, as as MenuItem, at as MenuItemRef, au as MenuItemType, av as MessageResponse, aw as NewsletterOptInDefault, ax as NewsletterSubscribeInput, ay as NewsletterSubscribeResult, az as NewsletterUnsubscribeResult, aA as OrderAccessRequestResponse, aB as OrderAccessVerifyResponse, aC as OrderDetail, aD as OrderItem, aE as OrderListItem, aF as OrderStatus, aG as OrderStatusHistory, aH as OrderStatuses, aI as OrderTracking, aJ as Page, aK as PageAttachment, aL as PageDetail, aM as PaginatedResponse, aN as PaymentStatus, aO as PaymentStatuses, aP as PickupPoint, aQ as PickupPointHours, aR as PickupPointsInput, aS as PriceDisplay, aT as
|
|
1
|
+
import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent } from './client-BSDdOEcK.js';
|
|
2
|
+
export { A as ActivePromotion, b as AddToCartInput, c as AddressDetail, d as AddressSuggestion, e as AddressType, f as AddressTypes, g as AuthTokens, h as BackInStockSubscription, i as BadgeTone, j as BehioApiError, k as BehioErrorCode, l as BehioEventHandler, m as BehioEventType, n as BehioNetworkError, o as BehioStorefrontConfig, p as Bundle, q as BundleItem, r as Cart, s as CartBundleLine, t as CartBundleLineItem, u as CartDiscount, v as CartItem, w as CartItemProduct, x as CartPromotion, y as Category, z as CategoryDetail, D as CertificateVerification, E as CheckoutAddress, F as CheckoutInput, G as CheckoutPaymentMethod, H as CheckoutSettings, I as CookieConsentInput, J as CourseAttachment, K as CourseCertificate, L as CourseComment, M as CourseCommentReply, N as CourseCommentsList, O as CourseDetail, Q as CourseLesson, R as CourseListItem, T as CourseModule, U as CoursePostedComment, V as CourseProgress, W as CourseTutorMessage, X as CourseTutorThread, Y as CrossSellItem, Z as CustomerAddress, _ as CustomerProfile, $ as DigitalDownload, a0 as DownloadUrl, a1 as Facet, a2 as FacetAvailability, a3 as FacetCategory, a4 as FacetLabel, a5 as FacetPriceRange, a6 as FacetRange, a7 as FacetRatingBucket, a8 as FacetValue, a9 as FacetsResponse, aa as FilterField, ab as FulfillmentStatus, ac as FulfillmentStatuses, ad as GiftCardBalance, ae as GiftCardPurchaseInput, af as GiftCardPurchaseResult, ag as GiftCardSummary, ah as LessonNote, ai as LessonQuiz, aj as LoginInput, ak as LoyaltyBalance, al as LoyaltyNextTier, am as LoyaltyProgram, an as LoyaltySummary, ao as LoyaltyTier, ap as LoyaltyTierPerks, aq as LoyaltyTransaction, ar as Menu, as as MenuItem, at as MenuItemRef, au as MenuItemType, av as MessageResponse, aw as NewsletterOptInDefault, ax as NewsletterSubscribeInput, ay as NewsletterSubscribeResult, az as NewsletterUnsubscribeResult, aA as OrderAccessRequestResponse, aB as OrderAccessVerifyResponse, aC as OrderDetail, aD as OrderItem, aE as OrderListItem, aF as OrderStatus, aG as OrderStatusHistory, aH as OrderStatuses, aI as OrderTracking, aJ as Page, aK as PageAttachment, aL as PageDetail, aM as PaginatedResponse, aN as PaymentStatus, aO as PaymentStatuses, aP as PickupPoint, aQ as PickupPointHours, aR as PickupPointsInput, aS as PriceDisplay, aT as ProductAssetGroup, aU as ProductAssetItem, aV as ProductAvailability, aW as ProductGroup, aX as ProductLabel, aY as ProductListItem, aZ as ProductMedia, a_ as ProductMediaVariant, a$ as ProductParameter, b0 as ProductParameterGroup, b1 as ProductParametersResponse, b2 as ProductPrice, b3 as ProductPromotionSummary, b4 as ProductReview, b5 as ProductReviewsResponse, b6 as ProductSibling, b7 as ProductSort, b8 as ProductSortValue, b9 as ProductVolumePrice, ba as ProductsQuery, bb as QuizAnswerInput, bc as QuizAnswerResult, bd as QuizQuestion, be as QuizResult, bf as QuoteItem, bg as QuoteRequest, bh as RegisterInput, bi as RegisterResult, bj as RequestInterceptor, bk as RequestInterceptorConfig, bl as ResponseInterceptor, bm as ResponseInterceptorData, bn as ReturnRequest, bo as ReturnRequestItem, bp as ReturnStatus, bq as ReturnStatusItem, br as ReturnableOrder, bs as ReturnableOrderItem, bt as SdkError, bu as ShippingMethodSummary, bv as ShippingQuote, bw as ShippingQuoteInput, bx as ShopInfo, by as ShopScript, bz as ShopScriptPlacement, bA as ShopScriptType, bB as ShopScripts, bC as ShopSeo, bD as ShopSeoIdentity, bE as Sitemap, bF as SitemapEntry, bG as StockBehavior, bH as StockMode, bI as SubmitQuoteInput, bJ as SubmitReturnInput, bK as SubmitReviewInput, bL as Subscription, bM as SubscriptionAction, bN as SubscriptionFrequency, bO as SubscriptionItem, bP as SubscriptionStatus, bQ as TaxBreakdownLine, bR as VariantAxis, bS as VariantAxisValue, bT as WishlistItem, bU as err, bV as ok, bW as toSdkError } from './client-BSDdOEcK.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Format a price amount with currency using Intl.NumberFormat.
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkTJ4TZ5FIjs = require('./chunk-TJ4TZ5FI.js');
|
|
14
14
|
|
|
15
15
|
// src/react/utils/format-price.ts
|
|
16
16
|
function formatPrice(amount, currency, locale) {
|
|
@@ -243,4 +243,4 @@ async function revokeAnalyticsConsent(client) {
|
|
|
243
243
|
|
|
244
244
|
|
|
245
245
|
|
|
246
|
-
exports.AddressTypes =
|
|
246
|
+
exports.AddressTypes = _chunkTJ4TZ5FIjs.AddressTypes; exports.BehioApiError = _chunkTJ4TZ5FIjs.BehioApiError; exports.BehioNetworkError = _chunkTJ4TZ5FIjs.BehioNetworkError; exports.BehioStorefront = _chunkTJ4TZ5FIjs.BehioStorefront; exports.FulfillmentStatuses = _chunkTJ4TZ5FIjs.FulfillmentStatuses; exports.OrderStatuses = _chunkTJ4TZ5FIjs.OrderStatuses; exports.PaymentStatuses = _chunkTJ4TZ5FIjs.PaymentStatuses; exports.ProductSort = _chunkTJ4TZ5FIjs.ProductSort; exports.VARIANT_QUERY_PARAM = VARIANT_QUERY_PARAM; exports.availableAxisValues = availableAxisValues; exports.buildVariantComparison = buildVariantComparison; exports.err = _chunkTJ4TZ5FIjs.err; exports.findVariantByAttributes = findVariantByAttributes; exports.formatPrice = formatPrice; exports.generateVisitorId = generateVisitorId; exports.getStoredVisitorId = getStoredVisitorId; exports.grantAnalyticsConsent = grantAnalyticsConsent; exports.ok = _chunkTJ4TZ5FIjs.ok; exports.resolveVariantContent = resolveVariantContent; exports.revokeAnalyticsConsent = revokeAnalyticsConsent; exports.toSdkError = _chunkTJ4TZ5FIjs.toSdkError; exports.trackEcommerceEvent = trackEcommerceEvent; exports.variantFromQuery = variantFromQuery; exports.variantHref = variantHref;
|
package/dist/index.mjs
CHANGED
package/dist/next.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { o as BehioStorefrontConfig, B as BehioStorefront } from './client-BSDdOEcK.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 { o as BehioStorefrontConfig, B as BehioStorefront } from './client-
|
|
1
|
+
import { o as BehioStorefrontConfig, B as BehioStorefront } from './client-BSDdOEcK.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 _chunkTJ4TZ5FIjs = require('./chunk-TJ4TZ5FI.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, _chunkTJ4TZ5FIjs.BehioStorefront)({
|
|
22
22
|
apiKey,
|
|
23
23
|
...baseUrl ? { baseUrl } : {},
|
|
24
24
|
...locale ? { locale } : {},
|
package/dist/next.mjs
CHANGED
package/dist/react.d.mts
CHANGED
|
@@ -700,6 +700,50 @@ interface ProductParameterGroup {
|
|
|
700
700
|
interface ProductParametersResponse {
|
|
701
701
|
groups: ProductParameterGroup[];
|
|
702
702
|
}
|
|
703
|
+
/**
|
|
704
|
+
* One item of a product asset group: an image, a hosted video, a downloadable
|
|
705
|
+
* file, or an external video embed. Added in SDK 1.7.0.
|
|
706
|
+
*
|
|
707
|
+
* `kind` decides how to render it:
|
|
708
|
+
* - `IMAGE` / `VIDEO` / `FILE`: a file hosted on the Behio CDN (`url` is a
|
|
709
|
+
* direct file URL; `contentType` and `size` describe it).
|
|
710
|
+
* - `EXTERNAL_VIDEO`: an embed URL (YouTube/Vimeo). Render it in an
|
|
711
|
+
* `<iframe>`, never in a `<video>` tag. `size` is null.
|
|
712
|
+
*/
|
|
713
|
+
interface ProductAssetItem {
|
|
714
|
+
id: string;
|
|
715
|
+
kind: "IMAGE" | "VIDEO" | "FILE" | "EXTERNAL_VIDEO";
|
|
716
|
+
url: string;
|
|
717
|
+
/** MIME type ("video/mp4", "application/pdf"); null when unknown or external. */
|
|
718
|
+
contentType?: string | null;
|
|
719
|
+
/** File size in bytes; null for external videos. */
|
|
720
|
+
size?: number | null;
|
|
721
|
+
/** Merchant title in the requested locale, or null when none was written. */
|
|
722
|
+
title?: string | null;
|
|
723
|
+
description?: string | null;
|
|
724
|
+
order: number;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* A merchant-named group of extra product content ("videos", "downloads").
|
|
728
|
+
* Groups only exist while they have items, so empty groups are never emitted.
|
|
729
|
+
* Added in SDK 1.7.0.
|
|
730
|
+
*
|
|
731
|
+
* Example: render a video section from the "videos" group:
|
|
732
|
+
* ```tsx
|
|
733
|
+
* const videos = product.assetGroups.find((g) => g.group === "videos");
|
|
734
|
+
* videos?.items.map((v) =>
|
|
735
|
+
* v.kind === "EXTERNAL_VIDEO"
|
|
736
|
+
* ? <iframe key={v.id} src={v.url} title={v.title ?? undefined} allowFullScreen />
|
|
737
|
+
* : <video key={v.id} controls preload="metadata" src={v.url} />
|
|
738
|
+
* );
|
|
739
|
+
* ```
|
|
740
|
+
*/
|
|
741
|
+
interface ProductAssetGroup {
|
|
742
|
+
/** Merchant-named group slug ("videos", "downloads"). */
|
|
743
|
+
group: string;
|
|
744
|
+
/** Items sorted by `order`. */
|
|
745
|
+
items: ProductAssetItem[];
|
|
746
|
+
}
|
|
703
747
|
interface ProductDetail extends ProductListItem {
|
|
704
748
|
longDescription?: string;
|
|
705
749
|
/**
|
|
@@ -742,6 +786,16 @@ interface ProductDetail extends ProductListItem {
|
|
|
742
786
|
* data groups, which published internal bookkeeping nobody curated.
|
|
743
787
|
*/
|
|
744
788
|
parameterGroups: ProductParameterGroup[];
|
|
789
|
+
/**
|
|
790
|
+
* Merchant-curated extra content in named groups ("videos", "downloads"):
|
|
791
|
+
* images, videos, files and external video embeds attached to the product.
|
|
792
|
+
* Distinct from `images` (roled gallery) and `media` (inventory gallery).
|
|
793
|
+
* Empty array when the merchant attached nothing. Added in SDK 1.7.0.
|
|
794
|
+
*
|
|
795
|
+
* Videos: `kind === "EXTERNAL_VIDEO"` is an embed URL (YouTube/Vimeo) for an
|
|
796
|
+
* `<iframe>`; `kind === "VIDEO"` is a CDN-hosted file for a `<video>` tag.
|
|
797
|
+
*/
|
|
798
|
+
assetGroups: ProductAssetGroup[];
|
|
745
799
|
seo: {
|
|
746
800
|
/**
|
|
747
801
|
* Slug of the page that should be canonical INSTEAD of this one. Empty
|
|
@@ -2660,6 +2714,22 @@ declare class CartModule {
|
|
|
2660
2714
|
addItem(input: AddToCartInput): Promise<SdkResult<Cart & {
|
|
2661
2715
|
newSessionToken?: string;
|
|
2662
2716
|
}>>;
|
|
2717
|
+
/**
|
|
2718
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
2719
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
2720
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
2721
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
2722
|
+
* none exists yet.
|
|
2723
|
+
*
|
|
2724
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
2725
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
2726
|
+
*
|
|
2727
|
+
* ```ts
|
|
2728
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
2729
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
2730
|
+
* ```
|
|
2731
|
+
*/
|
|
2732
|
+
setCurrency(currency: string): Promise<SdkResult<Cart>>;
|
|
2663
2733
|
/** Update item quantity */
|
|
2664
2734
|
updateQuantity(itemId: string, quantity: number): Promise<SdkResult<Cart>>;
|
|
2665
2735
|
/** Remove item from cart */
|
package/dist/react.d.ts
CHANGED
|
@@ -700,6 +700,50 @@ interface ProductParameterGroup {
|
|
|
700
700
|
interface ProductParametersResponse {
|
|
701
701
|
groups: ProductParameterGroup[];
|
|
702
702
|
}
|
|
703
|
+
/**
|
|
704
|
+
* One item of a product asset group: an image, a hosted video, a downloadable
|
|
705
|
+
* file, or an external video embed. Added in SDK 1.7.0.
|
|
706
|
+
*
|
|
707
|
+
* `kind` decides how to render it:
|
|
708
|
+
* - `IMAGE` / `VIDEO` / `FILE`: a file hosted on the Behio CDN (`url` is a
|
|
709
|
+
* direct file URL; `contentType` and `size` describe it).
|
|
710
|
+
* - `EXTERNAL_VIDEO`: an embed URL (YouTube/Vimeo). Render it in an
|
|
711
|
+
* `<iframe>`, never in a `<video>` tag. `size` is null.
|
|
712
|
+
*/
|
|
713
|
+
interface ProductAssetItem {
|
|
714
|
+
id: string;
|
|
715
|
+
kind: "IMAGE" | "VIDEO" | "FILE" | "EXTERNAL_VIDEO";
|
|
716
|
+
url: string;
|
|
717
|
+
/** MIME type ("video/mp4", "application/pdf"); null when unknown or external. */
|
|
718
|
+
contentType?: string | null;
|
|
719
|
+
/** File size in bytes; null for external videos. */
|
|
720
|
+
size?: number | null;
|
|
721
|
+
/** Merchant title in the requested locale, or null when none was written. */
|
|
722
|
+
title?: string | null;
|
|
723
|
+
description?: string | null;
|
|
724
|
+
order: number;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* A merchant-named group of extra product content ("videos", "downloads").
|
|
728
|
+
* Groups only exist while they have items, so empty groups are never emitted.
|
|
729
|
+
* Added in SDK 1.7.0.
|
|
730
|
+
*
|
|
731
|
+
* Example: render a video section from the "videos" group:
|
|
732
|
+
* ```tsx
|
|
733
|
+
* const videos = product.assetGroups.find((g) => g.group === "videos");
|
|
734
|
+
* videos?.items.map((v) =>
|
|
735
|
+
* v.kind === "EXTERNAL_VIDEO"
|
|
736
|
+
* ? <iframe key={v.id} src={v.url} title={v.title ?? undefined} allowFullScreen />
|
|
737
|
+
* : <video key={v.id} controls preload="metadata" src={v.url} />
|
|
738
|
+
* );
|
|
739
|
+
* ```
|
|
740
|
+
*/
|
|
741
|
+
interface ProductAssetGroup {
|
|
742
|
+
/** Merchant-named group slug ("videos", "downloads"). */
|
|
743
|
+
group: string;
|
|
744
|
+
/** Items sorted by `order`. */
|
|
745
|
+
items: ProductAssetItem[];
|
|
746
|
+
}
|
|
703
747
|
interface ProductDetail extends ProductListItem {
|
|
704
748
|
longDescription?: string;
|
|
705
749
|
/**
|
|
@@ -742,6 +786,16 @@ interface ProductDetail extends ProductListItem {
|
|
|
742
786
|
* data groups, which published internal bookkeeping nobody curated.
|
|
743
787
|
*/
|
|
744
788
|
parameterGroups: ProductParameterGroup[];
|
|
789
|
+
/**
|
|
790
|
+
* Merchant-curated extra content in named groups ("videos", "downloads"):
|
|
791
|
+
* images, videos, files and external video embeds attached to the product.
|
|
792
|
+
* Distinct from `images` (roled gallery) and `media` (inventory gallery).
|
|
793
|
+
* Empty array when the merchant attached nothing. Added in SDK 1.7.0.
|
|
794
|
+
*
|
|
795
|
+
* Videos: `kind === "EXTERNAL_VIDEO"` is an embed URL (YouTube/Vimeo) for an
|
|
796
|
+
* `<iframe>`; `kind === "VIDEO"` is a CDN-hosted file for a `<video>` tag.
|
|
797
|
+
*/
|
|
798
|
+
assetGroups: ProductAssetGroup[];
|
|
745
799
|
seo: {
|
|
746
800
|
/**
|
|
747
801
|
* Slug of the page that should be canonical INSTEAD of this one. Empty
|
|
@@ -2660,6 +2714,22 @@ declare class CartModule {
|
|
|
2660
2714
|
addItem(input: AddToCartInput): Promise<SdkResult<Cart & {
|
|
2661
2715
|
newSessionToken?: string;
|
|
2662
2716
|
}>>;
|
|
2717
|
+
/**
|
|
2718
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
2719
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
2720
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
2721
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
2722
|
+
* none exists yet.
|
|
2723
|
+
*
|
|
2724
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
2725
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
2726
|
+
*
|
|
2727
|
+
* ```ts
|
|
2728
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
2729
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
2730
|
+
* ```
|
|
2731
|
+
*/
|
|
2732
|
+
setCurrency(currency: string): Promise<SdkResult<Cart>>;
|
|
2663
2733
|
/** Update item quantity */
|
|
2664
2734
|
updateQuantity(itemId: string, quantity: number): Promise<SdkResult<Cart>>;
|
|
2665
2735
|
/** Remove item from cart */
|
package/dist/react.js
CHANGED
|
@@ -1044,6 +1044,29 @@ var CartModule = class {
|
|
|
1044
1044
|
this.client.emit("cart:updated", res.data);
|
|
1045
1045
|
return res;
|
|
1046
1046
|
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
1049
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
1050
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
1051
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
1052
|
+
* none exists yet.
|
|
1053
|
+
*
|
|
1054
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
1055
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
1056
|
+
*
|
|
1057
|
+
* ```ts
|
|
1058
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
1059
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
1060
|
+
* ```
|
|
1061
|
+
*/
|
|
1062
|
+
async setCurrency(currency) {
|
|
1063
|
+
const res = await this.client.request("PUT", "/cart/currency", {
|
|
1064
|
+
body: { currency }
|
|
1065
|
+
});
|
|
1066
|
+
if (res.error) return res;
|
|
1067
|
+
this.client.emit("cart:updated", res.data);
|
|
1068
|
+
return res;
|
|
1069
|
+
}
|
|
1047
1070
|
/** Update item quantity */
|
|
1048
1071
|
async updateQuantity(itemId, quantity) {
|
|
1049
1072
|
const res = await this.client.request(
|
|
@@ -2042,9 +2065,16 @@ function BehioProvider({
|
|
|
2042
2065
|
else cookieStorage.remove(currencyCookieName);
|
|
2043
2066
|
}
|
|
2044
2067
|
onCurrencyChange?.(next);
|
|
2045
|
-
|
|
2068
|
+
const cartTarget = next ?? defaultCurrency;
|
|
2069
|
+
if (cartTarget && (client.getCartSession() || client.auth.isLoggedIn())) {
|
|
2070
|
+
void client.cart.setCurrency(cartTarget).finally(() => {
|
|
2071
|
+
void qc.invalidateQueries({ queryKey: ["behio"] });
|
|
2072
|
+
});
|
|
2073
|
+
} else {
|
|
2074
|
+
void qc.invalidateQueries({ queryKey: ["behio"] });
|
|
2075
|
+
}
|
|
2046
2076
|
},
|
|
2047
|
-
[client, qc, persistCurrency, currencyCookieName, onCurrencyChange]
|
|
2077
|
+
[client, qc, persistCurrency, currencyCookieName, onCurrencyChange, defaultCurrency]
|
|
2048
2078
|
);
|
|
2049
2079
|
const ctxValue = (0, import_react2.useMemo)(
|
|
2050
2080
|
() => ({
|
package/dist/react.mjs
CHANGED
|
@@ -941,6 +941,29 @@ var CartModule = class {
|
|
|
941
941
|
this.client.emit("cart:updated", res.data);
|
|
942
942
|
return res;
|
|
943
943
|
}
|
|
944
|
+
/**
|
|
945
|
+
* Switch the CART currency server-side. The backend re-prices every line in
|
|
946
|
+
* the new currency (no FX conversion: a product must have a price configured
|
|
947
|
+
* in that currency, otherwise the call fails with 400 listing the items and
|
|
948
|
+
* the cart stays unchanged). Creates an empty cart in that currency when
|
|
949
|
+
* none exists yet.
|
|
950
|
+
*
|
|
951
|
+
* This is the money-path counterpart of `client.setCurrency()` (which only
|
|
952
|
+
* affects catalog display). Call BOTH from a currency switcher:
|
|
953
|
+
*
|
|
954
|
+
* ```ts
|
|
955
|
+
* client.setCurrency("EUR"); // catalog prices
|
|
956
|
+
* await client.cart.setCurrency("EUR"); // cart + checkout prices
|
|
957
|
+
* ```
|
|
958
|
+
*/
|
|
959
|
+
async setCurrency(currency) {
|
|
960
|
+
const res = await this.client.request("PUT", "/cart/currency", {
|
|
961
|
+
body: { currency }
|
|
962
|
+
});
|
|
963
|
+
if (res.error) return res;
|
|
964
|
+
this.client.emit("cart:updated", res.data);
|
|
965
|
+
return res;
|
|
966
|
+
}
|
|
944
967
|
/** Update item quantity */
|
|
945
968
|
async updateQuantity(itemId, quantity) {
|
|
946
969
|
const res = await this.client.request(
|
|
@@ -1939,9 +1962,16 @@ function BehioProvider({
|
|
|
1939
1962
|
else cookieStorage.remove(currencyCookieName);
|
|
1940
1963
|
}
|
|
1941
1964
|
onCurrencyChange?.(next);
|
|
1942
|
-
|
|
1965
|
+
const cartTarget = next ?? defaultCurrency;
|
|
1966
|
+
if (cartTarget && (client.getCartSession() || client.auth.isLoggedIn())) {
|
|
1967
|
+
void client.cart.setCurrency(cartTarget).finally(() => {
|
|
1968
|
+
void qc.invalidateQueries({ queryKey: ["behio"] });
|
|
1969
|
+
});
|
|
1970
|
+
} else {
|
|
1971
|
+
void qc.invalidateQueries({ queryKey: ["behio"] });
|
|
1972
|
+
}
|
|
1943
1973
|
},
|
|
1944
|
-
[client, qc, persistCurrency, currencyCookieName, onCurrencyChange]
|
|
1974
|
+
[client, qc, persistCurrency, currencyCookieName, onCurrencyChange, defaultCurrency]
|
|
1945
1975
|
);
|
|
1946
1976
|
const ctxValue = useMemo(
|
|
1947
1977
|
() => ({
|