@behio/storefront-sdk 2.4.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -252,6 +252,13 @@ A failed price entitlement lookup returns HTTP 503 with `be.storefront.pricingUn
252
252
 
253
253
  `catalog.getCategoryProducts(slug, query)` shares the full `ProductsQuery` serializer with `getProducts`. Price bounds retain zero, boolean filters retain false, arrays use repeated parameters and public parameter/facet selections use JSON. Category, main-list and featured availability follow the same published-variant and stock-mode rules in the backend.
254
254
 
255
+ ### One of a kind (2.5)
256
+
257
+ `ProductListItem.isUnique` marks a handmade original: one piece, never
258
+ restocked, never sold beyond stock. `soldAt` is set once it sells and the
259
+ availability label reads "Sold". Hide quantity steppers, never offer
260
+ back-in-stock watching for originals, offer "I want a similar one" instead.
261
+
255
262
  ### Cart links from Behio Chat (2.4)
256
263
 
257
264
  `cart.claimLink(token)` adds the products of a prepared cart link (created by
@@ -1307,9 +1307,12 @@ var CartModule = class {
1307
1307
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
1308
1308
  * server (Server Action or route handler, so the session cookie can be
1309
1309
  * written) and redirects to checkout. Items are ADDED, never replacing the
1310
- * cart; opening the link twice does not double quantities. A discount code
1310
+ * cart; repeated and concurrent claims raise each quantity to at least the
1311
+ * link target, never add a previously calculated delta. A discount code
1311
1312
  * carried by the link is applied with the normal validation. An expired or
1312
1313
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
1314
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
1315
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
1313
1316
  */
1314
1317
  async claimLink(token) {
1315
1318
  const res = await this.client.request("POST", `/cart/links/${encodeURIComponent(token)}/claim`, {});
@@ -1307,9 +1307,12 @@ var CartModule = class {
1307
1307
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
1308
1308
  * server (Server Action or route handler, so the session cookie can be
1309
1309
  * written) and redirects to checkout. Items are ADDED, never replacing the
1310
- * cart; opening the link twice does not double quantities. A discount code
1310
+ * cart; repeated and concurrent claims raise each quantity to at least the
1311
+ * link target, never add a previously calculated delta. A discount code
1311
1312
  * carried by the link is applied with the normal validation. An expired or
1312
1313
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
1314
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
1315
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
1313
1316
  */
1314
1317
  async claimLink(token) {
1315
1318
  const res = await this.client.request("POST", `/cart/links/${encodeURIComponent(token)}/claim`, {});
@@ -572,6 +572,19 @@ interface ProductListItem {
572
572
  * never turn it on.
573
573
  */
574
574
  variantsOnly: boolean;
575
+ /**
576
+ * One of a kind (handmade original, SDK 2.5): exactly one piece exists and it
577
+ * is never restocked. While available, show it as a one-off (the server label
578
+ * already says so in `availability.label`) and hide the quantity stepper.
579
+ * Once sold, `soldAt` is set, `availability.label` reads "Sold" and the
580
+ * product is not purchasable: never offer back-in-stock watching (the server
581
+ * refuses it), offer "I want a similar one" instead. The merchant decides
582
+ * whether sold originals stay listed (N days, forever) or disappear at once;
583
+ * in the last case the product page returns 404.
584
+ */
585
+ isUnique: boolean;
586
+ /** When the one-of-a-kind piece sold (epoch ms); null while available. */
587
+ soldAt: number | null;
575
588
  /**
576
589
  * "From" price: the CHEAPEST variant price, in the requested currency, or
577
590
  * null when the product has no variants (or prices are gated behind login in
@@ -2860,6 +2873,7 @@ interface CartLinkClaimed extends Cart {
2860
2873
  linkSkippedItems: number;
2861
2874
  /** A discount code carried by the link was applied. */
2862
2875
  linkDiscountApplied: boolean;
2876
+ /** Code carried by the link, including a refused code. Null means no code was offered. */
2863
2877
  linkDiscountCode: string | null;
2864
2878
  }
2865
2879
 
@@ -3366,9 +3380,12 @@ declare class CartModule {
3366
3380
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
3367
3381
  * server (Server Action or route handler, so the session cookie can be
3368
3382
  * written) and redirects to checkout. Items are ADDED, never replacing the
3369
- * cart; opening the link twice does not double quantities. A discount code
3383
+ * cart; repeated and concurrent claims raise each quantity to at least the
3384
+ * link target, never add a previously calculated delta. A discount code
3370
3385
  * carried by the link is applied with the normal validation. An expired or
3371
3386
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
3387
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
3388
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
3372
3389
  */
3373
3390
  claimLink(token: string): Promise<SdkResult<CartLinkClaimed>>;
3374
3391
  /** Remove discount code */
@@ -572,6 +572,19 @@ interface ProductListItem {
572
572
  * never turn it on.
573
573
  */
574
574
  variantsOnly: boolean;
575
+ /**
576
+ * One of a kind (handmade original, SDK 2.5): exactly one piece exists and it
577
+ * is never restocked. While available, show it as a one-off (the server label
578
+ * already says so in `availability.label`) and hide the quantity stepper.
579
+ * Once sold, `soldAt` is set, `availability.label` reads "Sold" and the
580
+ * product is not purchasable: never offer back-in-stock watching (the server
581
+ * refuses it), offer "I want a similar one" instead. The merchant decides
582
+ * whether sold originals stay listed (N days, forever) or disappear at once;
583
+ * in the last case the product page returns 404.
584
+ */
585
+ isUnique: boolean;
586
+ /** When the one-of-a-kind piece sold (epoch ms); null while available. */
587
+ soldAt: number | null;
575
588
  /**
576
589
  * "From" price: the CHEAPEST variant price, in the requested currency, or
577
590
  * null when the product has no variants (or prices are gated behind login in
@@ -2860,6 +2873,7 @@ interface CartLinkClaimed extends Cart {
2860
2873
  linkSkippedItems: number;
2861
2874
  /** A discount code carried by the link was applied. */
2862
2875
  linkDiscountApplied: boolean;
2876
+ /** Code carried by the link, including a refused code. Null means no code was offered. */
2863
2877
  linkDiscountCode: string | null;
2864
2878
  }
2865
2879
 
@@ -3366,9 +3380,12 @@ declare class CartModule {
3366
3380
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
3367
3381
  * server (Server Action or route handler, so the session cookie can be
3368
3382
  * written) and redirects to checkout. Items are ADDED, never replacing the
3369
- * cart; opening the link twice does not double quantities. A discount code
3383
+ * cart; repeated and concurrent claims raise each quantity to at least the
3384
+ * link target, never add a previously calculated delta. A discount code
3370
3385
  * carried by the link is applied with the normal validation. An expired or
3371
3386
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
3387
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
3388
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
3372
3389
  */
3373
3390
  claimLink(token: string): Promise<SdkResult<CartLinkClaimed>>;
3374
3391
  /** Remove discount code */
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, b as StorefrontFormFieldError } from './client-udU7tGhi.mjs';
2
- export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerProfile, ad as DigitalDownload, ae as DownloadUrl, af as Facet, ag as FacetAvailability, ah as FacetCategory, ai as FacetLabel, aj as FacetPriceRange, ak as FacetRange, al as FacetRatingBucket, am as FacetValue, an as FacetsResponse, ao as FilterField, ap as FulfillmentStatus, aq as FulfillmentStatuses, ar as GiftCardBalance, as as GiftCardPurchaseInput, at as GiftCardPurchaseResult, au as GiftCardSummary, av as LessonNote, aw as LessonQuiz, ax as LoginInput, ay as LoyaltyBalance, az as LoyaltyNextTier, aA as LoyaltyProgram, aB as LoyaltySummary, aC as LoyaltyTier, aD as LoyaltyTierPerks, aE as LoyaltyTransaction, aF as Menu, aG as MenuItem, aH as MenuItemRef, aI as MenuItemType, aJ as MessageResponse, aK as NewsletterOptInDefault, aL as NewsletterSubscribeInput, aM as NewsletterSubscribeResult, aN as NewsletterUnsubscribeResult, aO as OrderAccessRequestResponse, aP as OrderAccessVerifyResponse, aQ as OrderDetail, aR as OrderItem, aS as OrderListItem, aT as OrderStatus, aU as OrderStatusHistory, aV as OrderStatuses, aW as OrderTracking, aX as Page, aY as PageAttachment, aZ as PageDetail, a_ as PaginatedResponse, a$ as PaymentInstrument, b0 as PaymentStatus, b1 as PaymentStatuses, b2 as PaymentSwift, b3 as PickupPoint, b4 as PickupPointHours, b5 as PickupPointsInput, b6 as PickupWidgetConfig, b7 as PriceDisplay, b8 as ProductAssetGroup, b9 as ProductAssetItem, ba as ProductAvailability, bb as ProductGroup, bc as ProductLabel, bd as ProductListItem, be as ProductMedia, bf as ProductMediaVariant, bg as ProductParameter, bh as ProductParameterGroup, bi as ProductParametersResponse, bj as ProductPrice, bk as ProductPromotionSummary, bl as ProductReview, bm as ProductReviewsResponse, bn as ProductSibling, bo as ProductSort, bp as ProductSortValue, bq as ProductVolumePrice, br as ProductsQuery, bs as QuizAnswerInput, bt as QuizAnswerResult, bu as QuizQuestion, bv as QuizResult, bw as QuoteItem, bx as QuoteRequest, by as RegisterInput, bz as RegisterResult, bA as RequestInterceptor, bB as RequestInterceptorConfig, bC as ResponseInterceptor, bD as ResponseInterceptorData, bE as ReturnRequest, bF as ReturnRequestItem, bG as ReturnStatus, bH as ReturnStatusItem, bI as ReturnableOrder, bJ as ReturnableOrderItem, bK as SdkError, bL as ShippingMethodSummary, bM as ShippingQuote, bN as ShippingQuoteInput, bO as ShopAppearance, bP as ShopInfo, bQ as ShopScript, bR as ShopScriptPlacement, bS as ShopScriptType, bT as ShopScripts, bU as ShopSeo, bV as ShopSeoIdentity, bW as SiteFormField, bX as SiteFormFieldOption, bY as SiteFormFieldType, bZ as Sitemap, b_ as SitemapEntry, b$ as StockBehavior, c0 as StockMode, c1 as StorefrontForm, c2 as StorefrontFormFieldErrorCode, c3 as StorefrontFormFile, c4 as StorefrontFormSettings, c5 as StorefrontFormSubmitInput, c6 as StorefrontFormSubmitResult, c7 as StorefrontFormUpload, c8 as SubmitQuoteInput, c9 as SubmitReturnInput, ca as SubmitReviewInput, cb as Subscription, cc as SubscriptionAction, cd as SubscriptionFrequency, ce as SubscriptionItem, cf as SubscriptionStatus, cg as TaxBreakdownLine, ch as VariantAxis, ci as VariantAxisValue, cj as WishlistItem, ck as err, cl as ok, cm as publishCartSummary, cn as toSdkError } from './client-udU7tGhi.mjs';
1
+ import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-DEE8yg6v.mjs';
2
+ export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerProfile, ad as DigitalDownload, ae as DownloadUrl, af as Facet, ag as FacetAvailability, ah as FacetCategory, ai as FacetLabel, aj as FacetPriceRange, ak as FacetRange, al as FacetRatingBucket, am as FacetValue, an as FacetsResponse, ao as FilterField, ap as FulfillmentStatus, aq as FulfillmentStatuses, ar as GiftCardBalance, as as GiftCardPurchaseInput, at as GiftCardPurchaseResult, au as GiftCardSummary, av as LessonNote, aw as LessonQuiz, ax as LoginInput, ay as LoyaltyBalance, az as LoyaltyNextTier, aA as LoyaltyProgram, aB as LoyaltySummary, aC as LoyaltyTier, aD as LoyaltyTierPerks, aE as LoyaltyTransaction, aF as Menu, aG as MenuItem, aH as MenuItemRef, aI as MenuItemType, aJ as MessageResponse, aK as NewsletterOptInDefault, aL as NewsletterSubscribeInput, aM as NewsletterSubscribeResult, aN as NewsletterUnsubscribeResult, aO as OrderAccessRequestResponse, aP as OrderAccessVerifyResponse, aQ as OrderDetail, aR as OrderItem, aS as OrderListItem, aT as OrderStatus, aU as OrderStatusHistory, aV as OrderStatuses, aW as OrderTracking, aX as Page, aY as PageAttachment, aZ as PageDetail, a_ as PaginatedResponse, a$ as PaymentInstrument, b0 as PaymentStatus, b1 as PaymentStatuses, b2 as PaymentSwift, b3 as PickupPoint, b4 as PickupPointHours, b5 as PickupPointsInput, b6 as PickupWidgetConfig, b7 as PriceDisplay, b8 as ProductAssetGroup, b9 as ProductAssetItem, ba as ProductAvailability, bb as ProductGroup, bc as ProductLabel, bd as ProductListItem, be as ProductMedia, bf as ProductMediaVariant, bg as ProductParameter, bh as ProductParameterGroup, bi as ProductParametersResponse, bj as ProductPrice, bk as ProductPromotionSummary, bl as ProductReview, bm as ProductReviewsResponse, bn as ProductSibling, bo as ProductSort, bp as ProductSortValue, bq as ProductVolumePrice, br as ProductsQuery, bs as QuizAnswerInput, bt as QuizAnswerResult, bu as QuizQuestion, bv as QuizResult, bw as QuoteItem, bx as QuoteRequest, by as RegisterInput, bz as RegisterResult, bA as RequestInterceptor, bB as RequestInterceptorConfig, bC as ResponseInterceptor, bD as ResponseInterceptorData, bE as ReturnRequest, bF as ReturnRequestItem, bG as ReturnStatus, bH as ReturnStatusItem, bI as ReturnableOrder, bJ as ReturnableOrderItem, bK as SdkError, bL as ShippingMethodSummary, bM as ShippingQuote, bN as ShippingQuoteInput, bO as ShopAppearance, bP as ShopInfo, bQ as ShopScript, bR as ShopScriptPlacement, bS as ShopScriptType, bT as ShopScripts, bU as ShopSeo, bV as ShopSeoIdentity, bW as SiteFormField, bX as SiteFormFieldOption, bY as SiteFormFieldType, bZ as Sitemap, b_ as SitemapEntry, b$ as StockBehavior, c0 as StockMode, c1 as StorefrontForm, c2 as StorefrontFormFieldErrorCode, c3 as StorefrontFormFile, c4 as StorefrontFormSettings, c5 as StorefrontFormSubmitInput, c6 as StorefrontFormSubmitResult, c7 as StorefrontFormUpload, c8 as SubmitQuoteInput, c9 as SubmitReturnInput, ca as SubmitReviewInput, cb as Subscription, cc as SubscriptionAction, cd as SubscriptionFrequency, ce as SubscriptionItem, cf as SubscriptionStatus, cg as TaxBreakdownLine, ch as VariantAxis, ci as VariantAxisValue, cj as WishlistItem, ck as err, cl as ok, cm as publishCartSummary, cn as toSdkError } from './client-DEE8yg6v.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, b as StorefrontFormFieldError } from './client-udU7tGhi.js';
2
- export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerProfile, ad as DigitalDownload, ae as DownloadUrl, af as Facet, ag as FacetAvailability, ah as FacetCategory, ai as FacetLabel, aj as FacetPriceRange, ak as FacetRange, al as FacetRatingBucket, am as FacetValue, an as FacetsResponse, ao as FilterField, ap as FulfillmentStatus, aq as FulfillmentStatuses, ar as GiftCardBalance, as as GiftCardPurchaseInput, at as GiftCardPurchaseResult, au as GiftCardSummary, av as LessonNote, aw as LessonQuiz, ax as LoginInput, ay as LoyaltyBalance, az as LoyaltyNextTier, aA as LoyaltyProgram, aB as LoyaltySummary, aC as LoyaltyTier, aD as LoyaltyTierPerks, aE as LoyaltyTransaction, aF as Menu, aG as MenuItem, aH as MenuItemRef, aI as MenuItemType, aJ as MessageResponse, aK as NewsletterOptInDefault, aL as NewsletterSubscribeInput, aM as NewsletterSubscribeResult, aN as NewsletterUnsubscribeResult, aO as OrderAccessRequestResponse, aP as OrderAccessVerifyResponse, aQ as OrderDetail, aR as OrderItem, aS as OrderListItem, aT as OrderStatus, aU as OrderStatusHistory, aV as OrderStatuses, aW as OrderTracking, aX as Page, aY as PageAttachment, aZ as PageDetail, a_ as PaginatedResponse, a$ as PaymentInstrument, b0 as PaymentStatus, b1 as PaymentStatuses, b2 as PaymentSwift, b3 as PickupPoint, b4 as PickupPointHours, b5 as PickupPointsInput, b6 as PickupWidgetConfig, b7 as PriceDisplay, b8 as ProductAssetGroup, b9 as ProductAssetItem, ba as ProductAvailability, bb as ProductGroup, bc as ProductLabel, bd as ProductListItem, be as ProductMedia, bf as ProductMediaVariant, bg as ProductParameter, bh as ProductParameterGroup, bi as ProductParametersResponse, bj as ProductPrice, bk as ProductPromotionSummary, bl as ProductReview, bm as ProductReviewsResponse, bn as ProductSibling, bo as ProductSort, bp as ProductSortValue, bq as ProductVolumePrice, br as ProductsQuery, bs as QuizAnswerInput, bt as QuizAnswerResult, bu as QuizQuestion, bv as QuizResult, bw as QuoteItem, bx as QuoteRequest, by as RegisterInput, bz as RegisterResult, bA as RequestInterceptor, bB as RequestInterceptorConfig, bC as ResponseInterceptor, bD as ResponseInterceptorData, bE as ReturnRequest, bF as ReturnRequestItem, bG as ReturnStatus, bH as ReturnStatusItem, bI as ReturnableOrder, bJ as ReturnableOrderItem, bK as SdkError, bL as ShippingMethodSummary, bM as ShippingQuote, bN as ShippingQuoteInput, bO as ShopAppearance, bP as ShopInfo, bQ as ShopScript, bR as ShopScriptPlacement, bS as ShopScriptType, bT as ShopScripts, bU as ShopSeo, bV as ShopSeoIdentity, bW as SiteFormField, bX as SiteFormFieldOption, bY as SiteFormFieldType, bZ as Sitemap, b_ as SitemapEntry, b$ as StockBehavior, c0 as StockMode, c1 as StorefrontForm, c2 as StorefrontFormFieldErrorCode, c3 as StorefrontFormFile, c4 as StorefrontFormSettings, c5 as StorefrontFormSubmitInput, c6 as StorefrontFormSubmitResult, c7 as StorefrontFormUpload, c8 as SubmitQuoteInput, c9 as SubmitReturnInput, ca as SubmitReviewInput, cb as Subscription, cc as SubscriptionAction, cd as SubscriptionFrequency, ce as SubscriptionItem, cf as SubscriptionStatus, cg as TaxBreakdownLine, ch as VariantAxis, ci as VariantAxisValue, cj as WishlistItem, ck as err, cl as ok, cm as publishCartSummary, cn as toSdkError } from './client-udU7tGhi.js';
1
+ import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError } from './client-DEE8yg6v.js';
2
+ export { A as ActivePromotion, c as AddToCartInput, d as AddressDetail, e as AddressSuggestion, f as AddressType, g as AddressTypes, h as AuthTokens, i as BackInStockSubscription, j as BadgeTone, k as BehioApiError, l as BehioErrorCode, m as BehioEventHandler, n as BehioEventType, o as BehioNetworkError, p as BehioStorefrontConfig, q as Blog, r as BlogPostDetail, s as BlogPostListItem, t as BlogPostsPage, u as BlogPostsQuery, v as BlogSettings, w as BlogTag, x as Bundle, y as BundleCatalogQuery, z as BundleItem, D as Cart, E as CartBundleLine, F as CartBundleLineItem, G as CartDiscount, H as CartItem, I as CartItemProduct, J as CartLinkClaimed, K as CartPromotion, L as CartSummaryEvent, M as Category, N as CategoryDetail, O as CertificateVerification, Q as CheckoutAddress, R as CheckoutInput, T as CheckoutPaymentMethod, U as CheckoutPreview, V as CheckoutResult, W as CheckoutSettings, X as CookieConsentInput, Y as CourseAttachment, Z as CourseCertificate, _ as CourseComment, $ as CourseCommentReply, a0 as CourseCommentsList, a1 as CourseDetail, a2 as CourseLesson, a3 as CourseListItem, a4 as CourseModule, a5 as CoursePostedComment, a6 as CourseProgress, a7 as CourseTutorMessage, a8 as CourseTutorThread, a9 as CrossSellItem, aa as CurrencyDisplayFormat, ab as CustomerAddress, ac as CustomerProfile, ad as DigitalDownload, ae as DownloadUrl, af as Facet, ag as FacetAvailability, ah as FacetCategory, ai as FacetLabel, aj as FacetPriceRange, ak as FacetRange, al as FacetRatingBucket, am as FacetValue, an as FacetsResponse, ao as FilterField, ap as FulfillmentStatus, aq as FulfillmentStatuses, ar as GiftCardBalance, as as GiftCardPurchaseInput, at as GiftCardPurchaseResult, au as GiftCardSummary, av as LessonNote, aw as LessonQuiz, ax as LoginInput, ay as LoyaltyBalance, az as LoyaltyNextTier, aA as LoyaltyProgram, aB as LoyaltySummary, aC as LoyaltyTier, aD as LoyaltyTierPerks, aE as LoyaltyTransaction, aF as Menu, aG as MenuItem, aH as MenuItemRef, aI as MenuItemType, aJ as MessageResponse, aK as NewsletterOptInDefault, aL as NewsletterSubscribeInput, aM as NewsletterSubscribeResult, aN as NewsletterUnsubscribeResult, aO as OrderAccessRequestResponse, aP as OrderAccessVerifyResponse, aQ as OrderDetail, aR as OrderItem, aS as OrderListItem, aT as OrderStatus, aU as OrderStatusHistory, aV as OrderStatuses, aW as OrderTracking, aX as Page, aY as PageAttachment, aZ as PageDetail, a_ as PaginatedResponse, a$ as PaymentInstrument, b0 as PaymentStatus, b1 as PaymentStatuses, b2 as PaymentSwift, b3 as PickupPoint, b4 as PickupPointHours, b5 as PickupPointsInput, b6 as PickupWidgetConfig, b7 as PriceDisplay, b8 as ProductAssetGroup, b9 as ProductAssetItem, ba as ProductAvailability, bb as ProductGroup, bc as ProductLabel, bd as ProductListItem, be as ProductMedia, bf as ProductMediaVariant, bg as ProductParameter, bh as ProductParameterGroup, bi as ProductParametersResponse, bj as ProductPrice, bk as ProductPromotionSummary, bl as ProductReview, bm as ProductReviewsResponse, bn as ProductSibling, bo as ProductSort, bp as ProductSortValue, bq as ProductVolumePrice, br as ProductsQuery, bs as QuizAnswerInput, bt as QuizAnswerResult, bu as QuizQuestion, bv as QuizResult, bw as QuoteItem, bx as QuoteRequest, by as RegisterInput, bz as RegisterResult, bA as RequestInterceptor, bB as RequestInterceptorConfig, bC as ResponseInterceptor, bD as ResponseInterceptorData, bE as ReturnRequest, bF as ReturnRequestItem, bG as ReturnStatus, bH as ReturnStatusItem, bI as ReturnableOrder, bJ as ReturnableOrderItem, bK as SdkError, bL as ShippingMethodSummary, bM as ShippingQuote, bN as ShippingQuoteInput, bO as ShopAppearance, bP as ShopInfo, bQ as ShopScript, bR as ShopScriptPlacement, bS as ShopScriptType, bT as ShopScripts, bU as ShopSeo, bV as ShopSeoIdentity, bW as SiteFormField, bX as SiteFormFieldOption, bY as SiteFormFieldType, bZ as Sitemap, b_ as SitemapEntry, b$ as StockBehavior, c0 as StockMode, c1 as StorefrontForm, c2 as StorefrontFormFieldErrorCode, c3 as StorefrontFormFile, c4 as StorefrontFormSettings, c5 as StorefrontFormSubmitInput, c6 as StorefrontFormSubmitResult, c7 as StorefrontFormUpload, c8 as SubmitQuoteInput, c9 as SubmitReturnInput, ca as SubmitReviewInput, cb as Subscription, cc as SubscriptionAction, cd as SubscriptionFrequency, ce as SubscriptionItem, cf as SubscriptionStatus, cg as TaxBreakdownLine, ch as VariantAxis, ci as VariantAxisValue, cj as WishlistItem, ck as err, cl as ok, cm as publishCartSummary, cn as toSdkError } from './client-DEE8yg6v.js';
3
3
 
4
4
  /**
5
5
  * Format a price amount with currency using Intl.NumberFormat.
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkXVKKDVOOjs = require('./chunk-XVKKDVOO.js');
14
+ var _chunkAD2VKVVMjs = require('./chunk-AD2VKVVM.js');
15
15
 
16
16
  // src/react/utils/format-price.ts
17
17
  function formatPrice(amount, currency, locale, display) {
@@ -949,7 +949,7 @@ var GENERIC = {
949
949
  en: "Something went wrong, please try again."
950
950
  };
951
951
  function bodyOf(err2) {
952
- const body = err2 instanceof _chunkXVKKDVOOjs.BehioApiError ? err2.body : err2 && typeof err2 === "object" && "body" in err2 ? err2.body : err2;
952
+ const body = err2 instanceof _chunkAD2VKVVMjs.BehioApiError ? err2.body : err2 && typeof err2 === "object" && "body" in err2 ? err2.body : err2;
953
953
  return body && typeof body === "object" ? body : null;
954
954
  }
955
955
  function errorCode(err2) {
@@ -1062,4 +1062,4 @@ function formFieldErrors(err2) {
1062
1062
 
1063
1063
 
1064
1064
 
1065
- exports.AddressTypes = _chunkXVKKDVOOjs.AddressTypes; exports.BehioApiError = _chunkXVKKDVOOjs.BehioApiError; exports.BehioNetworkError = _chunkXVKKDVOOjs.BehioNetworkError; exports.BehioStorefront = _chunkXVKKDVOOjs.BehioStorefront; exports.FulfillmentStatuses = _chunkXVKKDVOOjs.FulfillmentStatuses; exports.OrderStatuses = _chunkXVKKDVOOjs.OrderStatuses; exports.PaymentStatuses = _chunkXVKKDVOOjs.PaymentStatuses; exports.ProductSort = _chunkXVKKDVOOjs.ProductSort; exports.VARIANT_QUERY_PARAM = VARIANT_QUERY_PARAM; exports.availableAxisValues = availableAxisValues; exports.buildVariantComparison = buildVariantComparison; exports.err = _chunkXVKKDVOOjs.err; exports.errorCode = errorCode; exports.errorMessage = errorMessage; exports.errorParams = errorParams; exports.findVariantByAttributes = findVariantByAttributes; exports.formFieldErrors = formFieldErrors; exports.formatPrice = formatPrice; exports.generateVisitorId = generateVisitorId; exports.getStoredVisitorId = getStoredVisitorId; exports.grantAnalyticsConsent = grantAnalyticsConsent; exports.ok = _chunkXVKKDVOOjs.ok; exports.publishCartSummary = _chunkXVKKDVOOjs.publishCartSummary; exports.resolveVariantContent = resolveVariantContent; exports.revokeAnalyticsConsent = revokeAnalyticsConsent; exports.toSdkError = _chunkXVKKDVOOjs.toSdkError; exports.trackEcommerceEvent = trackEcommerceEvent; exports.validationFieldMessages = validationFieldMessages; exports.variantFromQuery = variantFromQuery; exports.variantHref = variantHref;
1065
+ exports.AddressTypes = _chunkAD2VKVVMjs.AddressTypes; exports.BehioApiError = _chunkAD2VKVVMjs.BehioApiError; exports.BehioNetworkError = _chunkAD2VKVVMjs.BehioNetworkError; exports.BehioStorefront = _chunkAD2VKVVMjs.BehioStorefront; exports.FulfillmentStatuses = _chunkAD2VKVVMjs.FulfillmentStatuses; exports.OrderStatuses = _chunkAD2VKVVMjs.OrderStatuses; exports.PaymentStatuses = _chunkAD2VKVVMjs.PaymentStatuses; exports.ProductSort = _chunkAD2VKVVMjs.ProductSort; exports.VARIANT_QUERY_PARAM = VARIANT_QUERY_PARAM; exports.availableAxisValues = availableAxisValues; exports.buildVariantComparison = buildVariantComparison; exports.err = _chunkAD2VKVVMjs.err; exports.errorCode = errorCode; exports.errorMessage = errorMessage; exports.errorParams = errorParams; exports.findVariantByAttributes = findVariantByAttributes; exports.formFieldErrors = formFieldErrors; exports.formatPrice = formatPrice; exports.generateVisitorId = generateVisitorId; exports.getStoredVisitorId = getStoredVisitorId; exports.grantAnalyticsConsent = grantAnalyticsConsent; exports.ok = _chunkAD2VKVVMjs.ok; exports.publishCartSummary = _chunkAD2VKVVMjs.publishCartSummary; exports.resolveVariantContent = resolveVariantContent; exports.revokeAnalyticsConsent = revokeAnalyticsConsent; exports.toSdkError = _chunkAD2VKVVMjs.toSdkError; exports.trackEcommerceEvent = trackEcommerceEvent; exports.validationFieldMessages = validationFieldMessages; exports.variantFromQuery = variantFromQuery; exports.variantHref = variantHref;
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  ok,
12
12
  publishCartSummary,
13
13
  toSdkError
14
- } from "./chunk-5WHX5QA4.mjs";
14
+ } from "./chunk-L5QBTEJ4.mjs";
15
15
 
16
16
  // src/react/utils/format-price.ts
17
17
  function formatPrice(amount, currency, locale, display) {
package/dist/next.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-udU7tGhi.mjs';
1
+ import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-DEE8yg6v.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 { p as BehioStorefrontConfig, B as BehioStorefront } from './client-udU7tGhi.js';
1
+ import { p as BehioStorefrontConfig, B as BehioStorefront } from './client-DEE8yg6v.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 _chunkXVKKDVOOjs = require('./chunk-XVKKDVOO.js');
3
+ var _chunkAD2VKVVMjs = require('./chunk-AD2VKVVM.js');
4
4
 
5
5
  // src/next.ts
6
6
  var _headers = require('next/headers');
@@ -19,7 +19,7 @@ async function getBehio(options = {}) {
19
19
  const locale = _nullishCoalesce(options.locale, () => ( process.env.BEHIO_LOCALE));
20
20
  const currency = _nullishCoalesce(options.currency, () => ( process.env.BEHIO_CURRENCY));
21
21
  const cookieName = _nullishCoalesce(options.cartCookieName, () => ( CART_COOKIE_NAME));
22
- const client = new (0, _chunkXVKKDVOOjs.BehioStorefront)({
22
+ const client = new (0, _chunkAD2VKVVMjs.BehioStorefront)({
23
23
  apiKey,
24
24
  ...baseUrl ? { baseUrl } : {},
25
25
  ...locale ? { locale } : {},
package/dist/next.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BehioStorefront
3
- } from "./chunk-5WHX5QA4.mjs";
3
+ } from "./chunk-L5QBTEJ4.mjs";
4
4
 
5
5
  // src/next.ts
6
6
  import { cookies, headers } from "next/headers";
package/dist/react.d.mts CHANGED
@@ -628,6 +628,19 @@ interface ProductListItem {
628
628
  * never turn it on.
629
629
  */
630
630
  variantsOnly: boolean;
631
+ /**
632
+ * One of a kind (handmade original, SDK 2.5): exactly one piece exists and it
633
+ * is never restocked. While available, show it as a one-off (the server label
634
+ * already says so in `availability.label`) and hide the quantity stepper.
635
+ * Once sold, `soldAt` is set, `availability.label` reads "Sold" and the
636
+ * product is not purchasable: never offer back-in-stock watching (the server
637
+ * refuses it), offer "I want a similar one" instead. The merchant decides
638
+ * whether sold originals stay listed (N days, forever) or disappear at once;
639
+ * in the last case the product page returns 404.
640
+ */
641
+ isUnique: boolean;
642
+ /** When the one-of-a-kind piece sold (epoch ms); null while available. */
643
+ soldAt: number | null;
631
644
  /**
632
645
  * "From" price: the CHEAPEST variant price, in the requested currency, or
633
646
  * null when the product has no variants (or prices are gated behind login in
@@ -2870,6 +2883,7 @@ interface CartLinkClaimed extends Cart {
2870
2883
  linkSkippedItems: number;
2871
2884
  /** A discount code carried by the link was applied. */
2872
2885
  linkDiscountApplied: boolean;
2886
+ /** Code carried by the link, including a refused code. Null means no code was offered. */
2873
2887
  linkDiscountCode: string | null;
2874
2888
  }
2875
2889
 
@@ -3376,9 +3390,12 @@ declare class CartModule {
3376
3390
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
3377
3391
  * server (Server Action or route handler, so the session cookie can be
3378
3392
  * written) and redirects to checkout. Items are ADDED, never replacing the
3379
- * cart; opening the link twice does not double quantities. A discount code
3393
+ * cart; repeated and concurrent claims raise each quantity to at least the
3394
+ * link target, never add a previously calculated delta. A discount code
3380
3395
  * carried by the link is applied with the normal validation. An expired or
3381
3396
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
3397
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
3398
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
3382
3399
  */
3383
3400
  claimLink(token: string): Promise<SdkResult<CartLinkClaimed>>;
3384
3401
  /** Remove discount code */
package/dist/react.d.ts CHANGED
@@ -628,6 +628,19 @@ interface ProductListItem {
628
628
  * never turn it on.
629
629
  */
630
630
  variantsOnly: boolean;
631
+ /**
632
+ * One of a kind (handmade original, SDK 2.5): exactly one piece exists and it
633
+ * is never restocked. While available, show it as a one-off (the server label
634
+ * already says so in `availability.label`) and hide the quantity stepper.
635
+ * Once sold, `soldAt` is set, `availability.label` reads "Sold" and the
636
+ * product is not purchasable: never offer back-in-stock watching (the server
637
+ * refuses it), offer "I want a similar one" instead. The merchant decides
638
+ * whether sold originals stay listed (N days, forever) or disappear at once;
639
+ * in the last case the product page returns 404.
640
+ */
641
+ isUnique: boolean;
642
+ /** When the one-of-a-kind piece sold (epoch ms); null while available. */
643
+ soldAt: number | null;
631
644
  /**
632
645
  * "From" price: the CHEAPEST variant price, in the requested currency, or
633
646
  * null when the product has no variants (or prices are gated behind login in
@@ -2870,6 +2883,7 @@ interface CartLinkClaimed extends Cart {
2870
2883
  linkSkippedItems: number;
2871
2884
  /** A discount code carried by the link was applied. */
2872
2885
  linkDiscountApplied: boolean;
2886
+ /** Code carried by the link, including a refused code. Null means no code was offered. */
2873
2887
  linkDiscountCode: string | null;
2874
2888
  }
2875
2889
 
@@ -3376,9 +3390,12 @@ declare class CartModule {
3376
3390
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
3377
3391
  * server (Server Action or route handler, so the session cookie can be
3378
3392
  * written) and redirects to checkout. Items are ADDED, never replacing the
3379
- * cart; opening the link twice does not double quantities. A discount code
3393
+ * cart; repeated and concurrent claims raise each quantity to at least the
3394
+ * link target, never add a previously calculated delta. A discount code
3380
3395
  * carried by the link is applied with the normal validation. An expired or
3381
3396
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
3397
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
3398
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
3382
3399
  */
3383
3400
  claimLink(token: string): Promise<SdkResult<CartLinkClaimed>>;
3384
3401
  /** Remove discount code */
package/dist/react.js CHANGED
@@ -1386,9 +1386,12 @@ var CartModule = class {
1386
1386
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
1387
1387
  * server (Server Action or route handler, so the session cookie can be
1388
1388
  * written) and redirects to checkout. Items are ADDED, never replacing the
1389
- * cart; opening the link twice does not double quantities. A discount code
1389
+ * cart; repeated and concurrent claims raise each quantity to at least the
1390
+ * link target, never add a previously calculated delta. A discount code
1390
1391
  * carried by the link is applied with the normal validation. An expired or
1391
1392
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
1393
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
1394
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
1392
1395
  */
1393
1396
  async claimLink(token) {
1394
1397
  const res = await this.client.request("POST", `/cart/links/${encodeURIComponent(token)}/claim`, {});
package/dist/react.mjs CHANGED
@@ -1276,9 +1276,12 @@ var CartModule = class {
1276
1276
  * visitor; the storefront handles `/cart/link/<token>`, calls this on the
1277
1277
  * server (Server Action or route handler, so the session cookie can be
1278
1278
  * written) and redirects to checkout. Items are ADDED, never replacing the
1279
- * cart; opening the link twice does not double quantities. A discount code
1279
+ * cart; repeated and concurrent claims raise each quantity to at least the
1280
+ * link target, never add a previously calculated delta. A discount code
1280
1281
  * carried by the link is applied with the normal validation. An expired or
1281
1282
  * unknown link fails with `be.storefront.cartLinkExpired` (404).
1283
+ * Other failures need retry, not an expiry notice. Check linkSkippedItems
1284
+ * and linkDiscountCode/linkDiscountApplied before redirecting to checkout.
1282
1285
  */
1283
1286
  async claimLink(token) {
1284
1287
  const res = await this.client.request("POST", `/cart/links/${encodeURIComponent(token)}/claim`, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behio/storefront-sdk",
3
- "version": "2.4.0",
3
+ "version": "2.5.1",
4
4
  "description": "TypeScript SDK for Behio headless e-commerce: core client + React hooks",
5
5
  "author": "Behio",
6
6
  "license": "MIT",