@behio/storefront-sdk 2.30.0 → 2.31.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.
@@ -2326,12 +2326,23 @@ var NewsletterModule = class {
2326
2326
  auth: false
2327
2327
  });
2328
2328
  }
2329
+ /**
2330
+ * An address proves nothing, so this changes nothing yet: if the address is on
2331
+ * the list, its owner receives a signed link. The answer is the same either way.
2332
+ */
2329
2333
  async unsubscribe(email) {
2334
+ return this.requestUnsubscribe({ email });
2335
+ }
2336
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
2337
+ async unsubscribeWithToken(token) {
2338
+ return this.requestUnsubscribe({ token });
2339
+ }
2340
+ requestUnsubscribe(input) {
2330
2341
  return this.client.request(
2331
2342
  "POST",
2332
2343
  "/newsletter/unsubscribe",
2333
2344
  {
2334
- body: { email },
2345
+ body: input,
2335
2346
  auth: false
2336
2347
  }
2337
2348
  );
@@ -2379,6 +2390,25 @@ function emitCartEvent(data) {
2379
2390
  publishCartSummary({ total: cart.grandTotal, currency: typeof cart.currency === "string" ? cart.currency : null, itemCount: cart.itemCount });
2380
2391
  }
2381
2392
 
2393
+ // src/visitor-ip.ts
2394
+ var IP_SHAPE = /^[0-9a-fA-F:.]{3,45}$/;
2395
+ function ipOf(value) {
2396
+ const trimmed = _optionalChain([value, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59()]);
2397
+ return trimmed && IP_SHAPE.test(trimmed) ? trimmed : void 0;
2398
+ }
2399
+ function sameSecret(given, secret) {
2400
+ if (typeof given !== "string" || given.length !== secret.length) return false;
2401
+ let diff = 0;
2402
+ for (let i = 0; i < secret.length; i++) diff |= given.charCodeAt(i) ^ secret.charCodeAt(i);
2403
+ return diff === 0;
2404
+ }
2405
+ function trustedVisitorIp(headers, originSecret) {
2406
+ const realIp = ipOf(headers.get("x-real-ip"));
2407
+ if (originSecret && !sameSecret(headers.get("x-behio-origin"), originSecret)) return realIp;
2408
+ return _nullishCoalesce(ipOf(headers.get("cf-connecting-ip")), () => ( realIp));
2409
+ }
2410
+
2411
+
2382
2412
 
2383
2413
 
2384
2414
 
@@ -2393,4 +2423,4 @@ function emitCartEvent(data) {
2393
2423
 
2394
2424
 
2395
2425
 
2396
- exports.ProductSort = ProductSort; exports.OrderStatuses = OrderStatuses; exports.PaymentStatuses = PaymentStatuses; exports.FulfillmentStatuses = FulfillmentStatuses; exports.AddressTypes = AddressTypes; exports.BehioApiError = BehioApiError; exports.BehioNetworkError = BehioNetworkError; exports.ok = ok; exports.err = err; exports.toSdkError = toSdkError; exports.BehioStorefront = BehioStorefront; exports.clearCartSummary = clearCartSummary; exports.publishCartSummary = publishCartSummary;
2426
+ exports.ProductSort = ProductSort; exports.OrderStatuses = OrderStatuses; exports.PaymentStatuses = PaymentStatuses; exports.FulfillmentStatuses = FulfillmentStatuses; exports.AddressTypes = AddressTypes; exports.BehioApiError = BehioApiError; exports.BehioNetworkError = BehioNetworkError; exports.ok = ok; exports.err = err; exports.toSdkError = toSdkError; exports.BehioStorefront = BehioStorefront; exports.clearCartSummary = clearCartSummary; exports.publishCartSummary = publishCartSummary; exports.trustedVisitorIp = trustedVisitorIp;
@@ -2326,12 +2326,23 @@ var NewsletterModule = class {
2326
2326
  auth: false
2327
2327
  });
2328
2328
  }
2329
+ /**
2330
+ * An address proves nothing, so this changes nothing yet: if the address is on
2331
+ * the list, its owner receives a signed link. The answer is the same either way.
2332
+ */
2329
2333
  async unsubscribe(email) {
2334
+ return this.requestUnsubscribe({ email });
2335
+ }
2336
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
2337
+ async unsubscribeWithToken(token) {
2338
+ return this.requestUnsubscribe({ token });
2339
+ }
2340
+ requestUnsubscribe(input) {
2330
2341
  return this.client.request(
2331
2342
  "POST",
2332
2343
  "/newsletter/unsubscribe",
2333
2344
  {
2334
- body: { email },
2345
+ body: input,
2335
2346
  auth: false
2336
2347
  }
2337
2348
  );
@@ -2379,6 +2390,24 @@ function emitCartEvent(data) {
2379
2390
  publishCartSummary({ total: cart.grandTotal, currency: typeof cart.currency === "string" ? cart.currency : null, itemCount: cart.itemCount });
2380
2391
  }
2381
2392
 
2393
+ // src/visitor-ip.ts
2394
+ var IP_SHAPE = /^[0-9a-fA-F:.]{3,45}$/;
2395
+ function ipOf(value) {
2396
+ const trimmed = value?.trim();
2397
+ return trimmed && IP_SHAPE.test(trimmed) ? trimmed : void 0;
2398
+ }
2399
+ function sameSecret(given, secret) {
2400
+ if (typeof given !== "string" || given.length !== secret.length) return false;
2401
+ let diff = 0;
2402
+ for (let i = 0; i < secret.length; i++) diff |= given.charCodeAt(i) ^ secret.charCodeAt(i);
2403
+ return diff === 0;
2404
+ }
2405
+ function trustedVisitorIp(headers, originSecret) {
2406
+ const realIp = ipOf(headers.get("x-real-ip"));
2407
+ if (originSecret && !sameSecret(headers.get("x-behio-origin"), originSecret)) return realIp;
2408
+ return ipOf(headers.get("cf-connecting-ip")) ?? realIp;
2409
+ }
2410
+
2382
2411
  export {
2383
2412
  ProductSort,
2384
2413
  OrderStatuses,
@@ -2392,5 +2421,6 @@ export {
2392
2421
  toSdkError,
2393
2422
  BehioStorefront,
2394
2423
  clearCartSummary,
2395
- publishCartSummary
2424
+ publishCartSummary,
2425
+ trustedVisitorIp
2396
2426
  };
@@ -300,12 +300,14 @@ interface NewsletterSubscribeInput {
300
300
  source?: string;
301
301
  /** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
302
302
  website?: string;
303
+ /** The consent wording shown to the visitor. Only its hash is stored, as proof. */
304
+ consentText?: string;
303
305
  }
304
306
  interface NewsletterSubscribeResult {
305
307
  success: boolean;
306
308
  /** Confirm the email before the subscription becomes active. */
307
309
  confirmationRequired?: boolean;
308
- /** True when this email was already an active subscriber. */
310
+ /** Always false: the answer never reveals who is on the list. */
309
311
  alreadySubscribed: boolean;
310
312
  }
311
313
  interface NewsletterConfirmResult {
@@ -313,8 +315,15 @@ interface NewsletterConfirmResult {
313
315
  /** The actual code is delivered by email, never returned to the browser. */
314
316
  welcomeDiscountIssued: boolean;
315
317
  }
318
+ /** Send exactly one: `token` unsubscribes, `email` only mails a signed link. */
319
+ interface NewsletterUnsubscribeInput {
320
+ email?: string;
321
+ token?: string;
322
+ }
316
323
  interface NewsletterUnsubscribeResult {
317
324
  success: boolean;
325
+ /** True for a bare email: its owner gets a signed link, nothing has changed yet. */
326
+ confirmationRequired: boolean;
318
327
  }
319
328
  interface ShopSeo {
320
329
  robotsTxt?: string | null;
@@ -1624,6 +1633,8 @@ interface CheckoutInput {
1624
1633
  termsConsent?: boolean;
1625
1634
  gdprConsent?: boolean;
1626
1635
  newsletterOptIn?: boolean;
1636
+ /** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
1637
+ newsletterConsentText?: string;
1627
1638
  /**
1628
1639
  * Consent to start delivering digital content (courses, downloads,
1629
1640
  * services) before the withdrawal period ends, which waives the right of
@@ -4658,8 +4669,8 @@ declare class ShippingModule {
4658
4669
  /**
4659
4670
  * First-party newsletter opt-in. Use for the footer signup block and the
4660
4671
  * checkout newsletter checkbox (render its default from
4661
- * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
4662
- * re-activates a previously unsubscribed email. Pass the hidden `website`
4672
+ * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
4673
+ * answer never reveals who is on the list. Pass the hidden `website`
4663
4674
  * honeypot field straight through from your form: a filled value is silently
4664
4675
  * accepted but stored nowhere.
4665
4676
  */
@@ -4668,7 +4679,14 @@ declare class NewsletterModule {
4668
4679
  constructor(client: BehioStorefront);
4669
4680
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
4670
4681
  confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
4682
+ /**
4683
+ * An address proves nothing, so this changes nothing yet: if the address is on
4684
+ * the list, its owner receives a signed link. The answer is the same either way.
4685
+ */
4671
4686
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4687
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
4688
+ unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4689
+ private requestUnsubscribe;
4672
4690
  }
4673
4691
  /** Souhrn kosiku pro skripty na strance (Behio Chat, analytika). */
4674
4692
  interface CartSummaryEvent {
@@ -4681,4 +4699,4 @@ declare function clearCartSummary(): void;
4681
4699
  /** Publish only authoritative current totals; server cart consumers call this after hydration and revalidation. */
4682
4700
  declare function publishCartSummary(summary: CartSummaryEvent): void;
4683
4701
 
4684
- export { type CartLinkClaimed as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type BookingCategory as D, type BookingConfig as E, type BookingCreateInput as F, type BookingCreated as G, type BookingLocale as H, type BookingLocation as I, type BookingManageSlotsQuery as J, type BookingService as K, type BookingSlot as L, type BookingSlots as M, type BookingSlotsQuery as N, type BookingStaff as O, type ProductDetail as P, type BookingStatus as Q, type Bundle as R, type SdkResult as S, type BundleCatalogQuery as T, type BundleItem as U, type Cart as V, type CartBundleLine as W, type CartBundleLineItem as X, type CartDiscount as Y, type CartItem as Z, type CartItemProduct as _, type ProductVariant as a, type LoyaltyTransaction as a$, type CartPromotion as a0, type CartSummaryEvent as a1, type Category as a2, type CategoryDetail as a3, type CertificateVerification as a4, type CheckoutAddress as a5, type CheckoutInput as a6, type CheckoutPaymentMethod as a7, type CheckoutPreview as a8, type CheckoutResult as a9, type FacetAvailability as aA, type FacetCategory as aB, type FacetLabel as aC, type FacetPriceRange as aD, type FacetRange as aE, type FacetRatingBucket as aF, type FacetValue as aG, type FacetsResponse as aH, type FilterField as aI, type FulfillmentStatus as aJ, FulfillmentStatuses as aK, type GamificationRefreshResult as aL, type GiftCardBalance as aM, type GiftCardPurchaseInput as aN, type GiftCardPurchaseResult as aO, type GiftCardSummary as aP, type LessonNote as aQ, type LessonQuiz as aR, type LoginInput as aS, type LoyaltyBalance as aT, type LoyaltyNextTier as aU, type LoyaltyProgram as aV, type LoyaltyQuery as aW, type LoyaltyReferralResult as aX, type LoyaltySummary as aY, type LoyaltyTier as aZ, type LoyaltyTierPerks as a_, type CheckoutSettings as aa, type CookieConsentInput as ab, type CourseAttachment as ac, type CourseCertificate as ad, type CourseComment as ae, type CourseCommentReply as af, type CourseCommentsList as ag, type CourseDetail as ah, type CourseLesson as ai, type CourseListItem as aj, type CourseModule as ak, type CoursePostedComment as al, type CourseProgress as am, type CourseTutorMessage as an, type CourseTutorThread as ao, type CrossSellItem as ap, type CurrencyDisplayFormat as aq, type CustomerAddress as ar, type CustomerBadge as as, type CustomerChallenge as at, type CustomerGamification as au, type CustomerGamificationQuery as av, type CustomerProfile as aw, type DigitalDownload as ax, type DownloadUrl as ay, type Facet as az, type StorefrontFormFieldError as b, type RegisterInput as b$, type Menu as b0, type MenuItem as b1, type MenuItemRef as b2, type MenuItemType as b3, type MessageResponse as b4, type NewsletterConfirmResult as b5, type NewsletterOptInDefault as b6, type NewsletterSubscribeInput as b7, type NewsletterSubscribeResult as b8, type NewsletterUnsubscribeResult as b9, type PriceDisplay as bA, type ProductAssetGroup as bB, type ProductAssetItem as bC, type ProductAvailability as bD, type ProductGroup as bE, type ProductLabel as bF, type ProductListItem as bG, type ProductMedia as bH, type ProductMediaVariant as bI, type ProductParameter as bJ, type ProductParameterGroup as bK, type ProductParametersResponse as bL, type ProductPrice as bM, type ProductPromotionSummary as bN, type ProductReview as bO, type ProductReviewsResponse as bP, type ProductSibling as bQ, ProductSort as bR, type ProductSortValue as bS, type ProductVolumePrice as bT, type ProductsQuery as bU, type QuizAnswerInput as bV, type QuizAnswerResult as bW, type QuizQuestion as bX, type QuizResult as bY, type QuoteItem as bZ, type QuoteRequest as b_, type OrderAccessRequestResponse as ba, type OrderAccessVerifyResponse as bb, type OrderDetail as bc, type OrderDiscount as bd, type OrderDocument as be, type OrderItem as bf, type OrderListItem as bg, type OrderPaymentInstructions as bh, type OrderPickupPoint as bi, type OrderShipment as bj, type OrderStatus as bk, type OrderStatusHistory as bl, OrderStatuses as bm, type OrderTracking as bn, type Page as bo, type PageAttachment as bp, type PageDetail as bq, type PaginatedResponse as br, type PaymentInstrument as bs, type PaymentStatus as bt, PaymentStatuses as bu, type PaymentSwift as bv, type PickupPoint as bw, type PickupPointHours as bx, type PickupPointsInput as by, type PickupWidgetConfig as bz, type StorefrontFormPlacement as c, type WithdrawalAcknowledgement as c$, type RegisterResult as c0, type RequestInterceptor as c1, type RequestInterceptorConfig as c2, type ResponseInterceptor as c3, type ResponseInterceptorData as c4, type ReturnRequest as c5, type ReturnRequestItem as c6, type ReturnStatus as c7, type ReturnStatusItem as c8, type ReturnableOrder as c9, type StorefrontCollectionQuery as cA, type StorefrontFaqGroup as cB, type StorefrontFaqGroupSummary as cC, type StorefrontFaqGroups as cD, type StorefrontFaqItem as cE, type StorefrontFaqQuery as cF, type StorefrontForm as cG, type StorefrontFormFieldErrorCode as cH, type StorefrontFormFile as cI, type StorefrontFormPresentation as cJ, type StorefrontFormSettings as cK, type StorefrontFormSubmitInput as cL, type StorefrontFormSubmitResult as cM, type StorefrontFormUpload as cN, type SubmitQuoteInput as cO, type SubmitReturnInput as cP, type SubmitReviewInput as cQ, type SubmitWithdrawalInput as cR, type Subscription as cS, type SubscriptionAction as cT, type SubscriptionFrequency as cU, type SubscriptionItem as cV, type SubscriptionStatus as cW, type TaxBreakdownLine as cX, type VariantAxis as cY, type VariantAxisValue as cZ, type WishlistItem as c_, type ReturnableOrderItem as ca, type SdkError as cb, type ShippingMethodSummary as cc, type ShippingPublicConfig as cd, type ShippingQuote as ce, type ShippingQuoteInput as cf, type ShopAppearance as cg, type ShopCommerce as ch, type ShopInfo as ci, type ShopScript as cj, type ShopScriptPlacement as ck, type ShopScriptType as cl, type ShopScripts as cm, type ShopSeo as cn, type ShopSeoIdentity as co, type SiteFormField as cp, type SiteFormFieldOption as cq, type SiteFormFieldType as cr, type Sitemap as cs, type SitemapEntry as ct, type StockBehavior as cu, type StockMode as cv, type StorefrontCollection as cw, type StorefrontCollectionField as cx, type StorefrontCollectionFieldType as cy, type StorefrontCollectionItem as cz, type AddToCartInput as d, type WithdrawalFlag as d0, type WithdrawalSettings as d1, type WithdrawalWindow as d2, clearCartSummary as d3, err as d4, ok as d5, publishCartSummary as d6, toSdkError as d7, type AddToCartItemsInput as e, type AddressDetail as f, type AddressSuggestion as g, type AddressType as h, AddressTypes as i, type AuthTokens as j, type BackInStockSubscription as k, type BadgeTone as l, BehioApiError as m, type BehioErrorCode as n, type BehioEventHandler as o, type BehioEventType as p, BehioNetworkError as q, type BehioStorefrontConfig as r, type Blog as s, type BlogPostDetail as t, type BlogPostListItem as u, type BlogPostsPage as v, type BlogPostsQuery as w, type BlogSettings as x, type BlogTag as y, type Booking as z };
4702
+ export { type CartLinkClaimed as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type BookingCategory as D, type BookingConfig as E, type BookingCreateInput as F, type BookingCreated as G, type BookingLocale as H, type BookingLocation as I, type BookingManageSlotsQuery as J, type BookingService as K, type BookingSlot as L, type BookingSlots as M, type BookingSlotsQuery as N, type BookingStaff as O, type ProductDetail as P, type BookingStatus as Q, type Bundle as R, type SdkResult as S, type BundleCatalogQuery as T, type BundleItem as U, type Cart as V, type CartBundleLine as W, type CartBundleLineItem as X, type CartDiscount as Y, type CartItem as Z, type CartItemProduct as _, type ProductVariant as a, type LoyaltyTransaction as a$, type CartPromotion as a0, type CartSummaryEvent as a1, type Category as a2, type CategoryDetail as a3, type CertificateVerification as a4, type CheckoutAddress as a5, type CheckoutInput as a6, type CheckoutPaymentMethod as a7, type CheckoutPreview as a8, type CheckoutResult as a9, type FacetAvailability as aA, type FacetCategory as aB, type FacetLabel as aC, type FacetPriceRange as aD, type FacetRange as aE, type FacetRatingBucket as aF, type FacetValue as aG, type FacetsResponse as aH, type FilterField as aI, type FulfillmentStatus as aJ, FulfillmentStatuses as aK, type GamificationRefreshResult as aL, type GiftCardBalance as aM, type GiftCardPurchaseInput as aN, type GiftCardPurchaseResult as aO, type GiftCardSummary as aP, type LessonNote as aQ, type LessonQuiz as aR, type LoginInput as aS, type LoyaltyBalance as aT, type LoyaltyNextTier as aU, type LoyaltyProgram as aV, type LoyaltyQuery as aW, type LoyaltyReferralResult as aX, type LoyaltySummary as aY, type LoyaltyTier as aZ, type LoyaltyTierPerks as a_, type CheckoutSettings as aa, type CookieConsentInput as ab, type CourseAttachment as ac, type CourseCertificate as ad, type CourseComment as ae, type CourseCommentReply as af, type CourseCommentsList as ag, type CourseDetail as ah, type CourseLesson as ai, type CourseListItem as aj, type CourseModule as ak, type CoursePostedComment as al, type CourseProgress as am, type CourseTutorMessage as an, type CourseTutorThread as ao, type CrossSellItem as ap, type CurrencyDisplayFormat as aq, type CustomerAddress as ar, type CustomerBadge as as, type CustomerChallenge as at, type CustomerGamification as au, type CustomerGamificationQuery as av, type CustomerProfile as aw, type DigitalDownload as ax, type DownloadUrl as ay, type Facet as az, type StorefrontFormFieldError as b, type QuoteRequest as b$, type Menu as b0, type MenuItem as b1, type MenuItemRef as b2, type MenuItemType as b3, type MessageResponse as b4, type NewsletterConfirmResult as b5, type NewsletterOptInDefault as b6, type NewsletterSubscribeInput as b7, type NewsletterSubscribeResult as b8, type NewsletterUnsubscribeInput as b9, type PickupWidgetConfig as bA, type PriceDisplay as bB, type ProductAssetGroup as bC, type ProductAssetItem as bD, type ProductAvailability as bE, type ProductGroup as bF, type ProductLabel as bG, type ProductListItem as bH, type ProductMedia as bI, type ProductMediaVariant as bJ, type ProductParameter as bK, type ProductParameterGroup as bL, type ProductParametersResponse as bM, type ProductPrice as bN, type ProductPromotionSummary as bO, type ProductReview as bP, type ProductReviewsResponse as bQ, type ProductSibling as bR, ProductSort as bS, type ProductSortValue as bT, type ProductVolumePrice as bU, type ProductsQuery as bV, type QuizAnswerInput as bW, type QuizAnswerResult as bX, type QuizQuestion as bY, type QuizResult as bZ, type QuoteItem as b_, type NewsletterUnsubscribeResult as ba, type OrderAccessRequestResponse as bb, type OrderAccessVerifyResponse as bc, type OrderDetail as bd, type OrderDiscount as be, type OrderDocument as bf, type OrderItem as bg, type OrderListItem as bh, type OrderPaymentInstructions as bi, type OrderPickupPoint as bj, type OrderShipment as bk, type OrderStatus as bl, type OrderStatusHistory as bm, OrderStatuses as bn, type OrderTracking as bo, type Page as bp, type PageAttachment as bq, type PageDetail as br, type PaginatedResponse as bs, type PaymentInstrument as bt, type PaymentStatus as bu, PaymentStatuses as bv, type PaymentSwift as bw, type PickupPoint as bx, type PickupPointHours as by, type PickupPointsInput as bz, type StorefrontFormPlacement as c, type WishlistItem as c$, type RegisterInput as c0, type RegisterResult as c1, type RequestInterceptor as c2, type RequestInterceptorConfig as c3, type ResponseInterceptor as c4, type ResponseInterceptorData as c5, type ReturnRequest as c6, type ReturnRequestItem as c7, type ReturnStatus as c8, type ReturnStatusItem as c9, type StorefrontCollectionItem as cA, type StorefrontCollectionQuery as cB, type StorefrontFaqGroup as cC, type StorefrontFaqGroupSummary as cD, type StorefrontFaqGroups as cE, type StorefrontFaqItem as cF, type StorefrontFaqQuery as cG, type StorefrontForm as cH, type StorefrontFormFieldErrorCode as cI, type StorefrontFormFile as cJ, type StorefrontFormPresentation as cK, type StorefrontFormSettings as cL, type StorefrontFormSubmitInput as cM, type StorefrontFormSubmitResult as cN, type StorefrontFormUpload as cO, type SubmitQuoteInput as cP, type SubmitReturnInput as cQ, type SubmitReviewInput as cR, type SubmitWithdrawalInput as cS, type Subscription as cT, type SubscriptionAction as cU, type SubscriptionFrequency as cV, type SubscriptionItem as cW, type SubscriptionStatus as cX, type TaxBreakdownLine as cY, type VariantAxis as cZ, type VariantAxisValue as c_, type ReturnableOrder as ca, type ReturnableOrderItem as cb, type SdkError as cc, type ShippingMethodSummary as cd, type ShippingPublicConfig as ce, type ShippingQuote as cf, type ShippingQuoteInput as cg, type ShopAppearance as ch, type ShopCommerce as ci, type ShopInfo as cj, type ShopScript as ck, type ShopScriptPlacement as cl, type ShopScriptType as cm, type ShopScripts as cn, type ShopSeo as co, type ShopSeoIdentity as cp, type SiteFormField as cq, type SiteFormFieldOption as cr, type SiteFormFieldType as cs, type Sitemap as ct, type SitemapEntry as cu, type StockBehavior as cv, type StockMode as cw, type StorefrontCollection as cx, type StorefrontCollectionField as cy, type StorefrontCollectionFieldType as cz, type AddToCartInput as d, type WithdrawalAcknowledgement as d0, type WithdrawalFlag as d1, type WithdrawalSettings as d2, type WithdrawalWindow as d3, clearCartSummary as d4, err as d5, ok as d6, publishCartSummary as d7, toSdkError as d8, type AddToCartItemsInput as e, type AddressDetail as f, type AddressSuggestion as g, type AddressType as h, AddressTypes as i, type AuthTokens as j, type BackInStockSubscription as k, type BadgeTone as l, BehioApiError as m, type BehioErrorCode as n, type BehioEventHandler as o, type BehioEventType as p, BehioNetworkError as q, type BehioStorefrontConfig as r, type Blog as s, type BlogPostDetail as t, type BlogPostListItem as u, type BlogPostsPage as v, type BlogPostsQuery as w, type BlogSettings as x, type BlogTag as y, type Booking as z };
@@ -300,12 +300,14 @@ interface NewsletterSubscribeInput {
300
300
  source?: string;
301
301
  /** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
302
302
  website?: string;
303
+ /** The consent wording shown to the visitor. Only its hash is stored, as proof. */
304
+ consentText?: string;
303
305
  }
304
306
  interface NewsletterSubscribeResult {
305
307
  success: boolean;
306
308
  /** Confirm the email before the subscription becomes active. */
307
309
  confirmationRequired?: boolean;
308
- /** True when this email was already an active subscriber. */
310
+ /** Always false: the answer never reveals who is on the list. */
309
311
  alreadySubscribed: boolean;
310
312
  }
311
313
  interface NewsletterConfirmResult {
@@ -313,8 +315,15 @@ interface NewsletterConfirmResult {
313
315
  /** The actual code is delivered by email, never returned to the browser. */
314
316
  welcomeDiscountIssued: boolean;
315
317
  }
318
+ /** Send exactly one: `token` unsubscribes, `email` only mails a signed link. */
319
+ interface NewsletterUnsubscribeInput {
320
+ email?: string;
321
+ token?: string;
322
+ }
316
323
  interface NewsletterUnsubscribeResult {
317
324
  success: boolean;
325
+ /** True for a bare email: its owner gets a signed link, nothing has changed yet. */
326
+ confirmationRequired: boolean;
318
327
  }
319
328
  interface ShopSeo {
320
329
  robotsTxt?: string | null;
@@ -1624,6 +1633,8 @@ interface CheckoutInput {
1624
1633
  termsConsent?: boolean;
1625
1634
  gdprConsent?: boolean;
1626
1635
  newsletterOptIn?: boolean;
1636
+ /** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
1637
+ newsletterConsentText?: string;
1627
1638
  /**
1628
1639
  * Consent to start delivering digital content (courses, downloads,
1629
1640
  * services) before the withdrawal period ends, which waives the right of
@@ -4658,8 +4669,8 @@ declare class ShippingModule {
4658
4669
  /**
4659
4670
  * First-party newsletter opt-in. Use for the footer signup block and the
4660
4671
  * checkout newsletter checkbox (render its default from
4661
- * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
4662
- * re-activates a previously unsubscribed email. Pass the hidden `website`
4672
+ * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
4673
+ * answer never reveals who is on the list. Pass the hidden `website`
4663
4674
  * honeypot field straight through from your form: a filled value is silently
4664
4675
  * accepted but stored nowhere.
4665
4676
  */
@@ -4668,7 +4679,14 @@ declare class NewsletterModule {
4668
4679
  constructor(client: BehioStorefront);
4669
4680
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
4670
4681
  confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
4682
+ /**
4683
+ * An address proves nothing, so this changes nothing yet: if the address is on
4684
+ * the list, its owner receives a signed link. The answer is the same either way.
4685
+ */
4671
4686
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4687
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
4688
+ unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4689
+ private requestUnsubscribe;
4672
4690
  }
4673
4691
  /** Souhrn kosiku pro skripty na strance (Behio Chat, analytika). */
4674
4692
  interface CartSummaryEvent {
@@ -4681,4 +4699,4 @@ declare function clearCartSummary(): void;
4681
4699
  /** Publish only authoritative current totals; server cart consumers call this after hydration and revalidation. */
4682
4700
  declare function publishCartSummary(summary: CartSummaryEvent): void;
4683
4701
 
4684
- export { type CartLinkClaimed as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type BookingCategory as D, type BookingConfig as E, type BookingCreateInput as F, type BookingCreated as G, type BookingLocale as H, type BookingLocation as I, type BookingManageSlotsQuery as J, type BookingService as K, type BookingSlot as L, type BookingSlots as M, type BookingSlotsQuery as N, type BookingStaff as O, type ProductDetail as P, type BookingStatus as Q, type Bundle as R, type SdkResult as S, type BundleCatalogQuery as T, type BundleItem as U, type Cart as V, type CartBundleLine as W, type CartBundleLineItem as X, type CartDiscount as Y, type CartItem as Z, type CartItemProduct as _, type ProductVariant as a, type LoyaltyTransaction as a$, type CartPromotion as a0, type CartSummaryEvent as a1, type Category as a2, type CategoryDetail as a3, type CertificateVerification as a4, type CheckoutAddress as a5, type CheckoutInput as a6, type CheckoutPaymentMethod as a7, type CheckoutPreview as a8, type CheckoutResult as a9, type FacetAvailability as aA, type FacetCategory as aB, type FacetLabel as aC, type FacetPriceRange as aD, type FacetRange as aE, type FacetRatingBucket as aF, type FacetValue as aG, type FacetsResponse as aH, type FilterField as aI, type FulfillmentStatus as aJ, FulfillmentStatuses as aK, type GamificationRefreshResult as aL, type GiftCardBalance as aM, type GiftCardPurchaseInput as aN, type GiftCardPurchaseResult as aO, type GiftCardSummary as aP, type LessonNote as aQ, type LessonQuiz as aR, type LoginInput as aS, type LoyaltyBalance as aT, type LoyaltyNextTier as aU, type LoyaltyProgram as aV, type LoyaltyQuery as aW, type LoyaltyReferralResult as aX, type LoyaltySummary as aY, type LoyaltyTier as aZ, type LoyaltyTierPerks as a_, type CheckoutSettings as aa, type CookieConsentInput as ab, type CourseAttachment as ac, type CourseCertificate as ad, type CourseComment as ae, type CourseCommentReply as af, type CourseCommentsList as ag, type CourseDetail as ah, type CourseLesson as ai, type CourseListItem as aj, type CourseModule as ak, type CoursePostedComment as al, type CourseProgress as am, type CourseTutorMessage as an, type CourseTutorThread as ao, type CrossSellItem as ap, type CurrencyDisplayFormat as aq, type CustomerAddress as ar, type CustomerBadge as as, type CustomerChallenge as at, type CustomerGamification as au, type CustomerGamificationQuery as av, type CustomerProfile as aw, type DigitalDownload as ax, type DownloadUrl as ay, type Facet as az, type StorefrontFormFieldError as b, type RegisterInput as b$, type Menu as b0, type MenuItem as b1, type MenuItemRef as b2, type MenuItemType as b3, type MessageResponse as b4, type NewsletterConfirmResult as b5, type NewsletterOptInDefault as b6, type NewsletterSubscribeInput as b7, type NewsletterSubscribeResult as b8, type NewsletterUnsubscribeResult as b9, type PriceDisplay as bA, type ProductAssetGroup as bB, type ProductAssetItem as bC, type ProductAvailability as bD, type ProductGroup as bE, type ProductLabel as bF, type ProductListItem as bG, type ProductMedia as bH, type ProductMediaVariant as bI, type ProductParameter as bJ, type ProductParameterGroup as bK, type ProductParametersResponse as bL, type ProductPrice as bM, type ProductPromotionSummary as bN, type ProductReview as bO, type ProductReviewsResponse as bP, type ProductSibling as bQ, ProductSort as bR, type ProductSortValue as bS, type ProductVolumePrice as bT, type ProductsQuery as bU, type QuizAnswerInput as bV, type QuizAnswerResult as bW, type QuizQuestion as bX, type QuizResult as bY, type QuoteItem as bZ, type QuoteRequest as b_, type OrderAccessRequestResponse as ba, type OrderAccessVerifyResponse as bb, type OrderDetail as bc, type OrderDiscount as bd, type OrderDocument as be, type OrderItem as bf, type OrderListItem as bg, type OrderPaymentInstructions as bh, type OrderPickupPoint as bi, type OrderShipment as bj, type OrderStatus as bk, type OrderStatusHistory as bl, OrderStatuses as bm, type OrderTracking as bn, type Page as bo, type PageAttachment as bp, type PageDetail as bq, type PaginatedResponse as br, type PaymentInstrument as bs, type PaymentStatus as bt, PaymentStatuses as bu, type PaymentSwift as bv, type PickupPoint as bw, type PickupPointHours as bx, type PickupPointsInput as by, type PickupWidgetConfig as bz, type StorefrontFormPlacement as c, type WithdrawalAcknowledgement as c$, type RegisterResult as c0, type RequestInterceptor as c1, type RequestInterceptorConfig as c2, type ResponseInterceptor as c3, type ResponseInterceptorData as c4, type ReturnRequest as c5, type ReturnRequestItem as c6, type ReturnStatus as c7, type ReturnStatusItem as c8, type ReturnableOrder as c9, type StorefrontCollectionQuery as cA, type StorefrontFaqGroup as cB, type StorefrontFaqGroupSummary as cC, type StorefrontFaqGroups as cD, type StorefrontFaqItem as cE, type StorefrontFaqQuery as cF, type StorefrontForm as cG, type StorefrontFormFieldErrorCode as cH, type StorefrontFormFile as cI, type StorefrontFormPresentation as cJ, type StorefrontFormSettings as cK, type StorefrontFormSubmitInput as cL, type StorefrontFormSubmitResult as cM, type StorefrontFormUpload as cN, type SubmitQuoteInput as cO, type SubmitReturnInput as cP, type SubmitReviewInput as cQ, type SubmitWithdrawalInput as cR, type Subscription as cS, type SubscriptionAction as cT, type SubscriptionFrequency as cU, type SubscriptionItem as cV, type SubscriptionStatus as cW, type TaxBreakdownLine as cX, type VariantAxis as cY, type VariantAxisValue as cZ, type WishlistItem as c_, type ReturnableOrderItem as ca, type SdkError as cb, type ShippingMethodSummary as cc, type ShippingPublicConfig as cd, type ShippingQuote as ce, type ShippingQuoteInput as cf, type ShopAppearance as cg, type ShopCommerce as ch, type ShopInfo as ci, type ShopScript as cj, type ShopScriptPlacement as ck, type ShopScriptType as cl, type ShopScripts as cm, type ShopSeo as cn, type ShopSeoIdentity as co, type SiteFormField as cp, type SiteFormFieldOption as cq, type SiteFormFieldType as cr, type Sitemap as cs, type SitemapEntry as ct, type StockBehavior as cu, type StockMode as cv, type StorefrontCollection as cw, type StorefrontCollectionField as cx, type StorefrontCollectionFieldType as cy, type StorefrontCollectionItem as cz, type AddToCartInput as d, type WithdrawalFlag as d0, type WithdrawalSettings as d1, type WithdrawalWindow as d2, clearCartSummary as d3, err as d4, ok as d5, publishCartSummary as d6, toSdkError as d7, type AddToCartItemsInput as e, type AddressDetail as f, type AddressSuggestion as g, type AddressType as h, AddressTypes as i, type AuthTokens as j, type BackInStockSubscription as k, type BadgeTone as l, BehioApiError as m, type BehioErrorCode as n, type BehioEventHandler as o, type BehioEventType as p, BehioNetworkError as q, type BehioStorefrontConfig as r, type Blog as s, type BlogPostDetail as t, type BlogPostListItem as u, type BlogPostsPage as v, type BlogPostsQuery as w, type BlogSettings as x, type BlogTag as y, type Booking as z };
4702
+ export { type CartLinkClaimed as $, type ActivePromotion as A, BehioStorefront as B, type CookieConsent as C, type BookingCategory as D, type BookingConfig as E, type BookingCreateInput as F, type BookingCreated as G, type BookingLocale as H, type BookingLocation as I, type BookingManageSlotsQuery as J, type BookingService as K, type BookingSlot as L, type BookingSlots as M, type BookingSlotsQuery as N, type BookingStaff as O, type ProductDetail as P, type BookingStatus as Q, type Bundle as R, type SdkResult as S, type BundleCatalogQuery as T, type BundleItem as U, type Cart as V, type CartBundleLine as W, type CartBundleLineItem as X, type CartDiscount as Y, type CartItem as Z, type CartItemProduct as _, type ProductVariant as a, type LoyaltyTransaction as a$, type CartPromotion as a0, type CartSummaryEvent as a1, type Category as a2, type CategoryDetail as a3, type CertificateVerification as a4, type CheckoutAddress as a5, type CheckoutInput as a6, type CheckoutPaymentMethod as a7, type CheckoutPreview as a8, type CheckoutResult as a9, type FacetAvailability as aA, type FacetCategory as aB, type FacetLabel as aC, type FacetPriceRange as aD, type FacetRange as aE, type FacetRatingBucket as aF, type FacetValue as aG, type FacetsResponse as aH, type FilterField as aI, type FulfillmentStatus as aJ, FulfillmentStatuses as aK, type GamificationRefreshResult as aL, type GiftCardBalance as aM, type GiftCardPurchaseInput as aN, type GiftCardPurchaseResult as aO, type GiftCardSummary as aP, type LessonNote as aQ, type LessonQuiz as aR, type LoginInput as aS, type LoyaltyBalance as aT, type LoyaltyNextTier as aU, type LoyaltyProgram as aV, type LoyaltyQuery as aW, type LoyaltyReferralResult as aX, type LoyaltySummary as aY, type LoyaltyTier as aZ, type LoyaltyTierPerks as a_, type CheckoutSettings as aa, type CookieConsentInput as ab, type CourseAttachment as ac, type CourseCertificate as ad, type CourseComment as ae, type CourseCommentReply as af, type CourseCommentsList as ag, type CourseDetail as ah, type CourseLesson as ai, type CourseListItem as aj, type CourseModule as ak, type CoursePostedComment as al, type CourseProgress as am, type CourseTutorMessage as an, type CourseTutorThread as ao, type CrossSellItem as ap, type CurrencyDisplayFormat as aq, type CustomerAddress as ar, type CustomerBadge as as, type CustomerChallenge as at, type CustomerGamification as au, type CustomerGamificationQuery as av, type CustomerProfile as aw, type DigitalDownload as ax, type DownloadUrl as ay, type Facet as az, type StorefrontFormFieldError as b, type QuoteRequest as b$, type Menu as b0, type MenuItem as b1, type MenuItemRef as b2, type MenuItemType as b3, type MessageResponse as b4, type NewsletterConfirmResult as b5, type NewsletterOptInDefault as b6, type NewsletterSubscribeInput as b7, type NewsletterSubscribeResult as b8, type NewsletterUnsubscribeInput as b9, type PickupWidgetConfig as bA, type PriceDisplay as bB, type ProductAssetGroup as bC, type ProductAssetItem as bD, type ProductAvailability as bE, type ProductGroup as bF, type ProductLabel as bG, type ProductListItem as bH, type ProductMedia as bI, type ProductMediaVariant as bJ, type ProductParameter as bK, type ProductParameterGroup as bL, type ProductParametersResponse as bM, type ProductPrice as bN, type ProductPromotionSummary as bO, type ProductReview as bP, type ProductReviewsResponse as bQ, type ProductSibling as bR, ProductSort as bS, type ProductSortValue as bT, type ProductVolumePrice as bU, type ProductsQuery as bV, type QuizAnswerInput as bW, type QuizAnswerResult as bX, type QuizQuestion as bY, type QuizResult as bZ, type QuoteItem as b_, type NewsletterUnsubscribeResult as ba, type OrderAccessRequestResponse as bb, type OrderAccessVerifyResponse as bc, type OrderDetail as bd, type OrderDiscount as be, type OrderDocument as bf, type OrderItem as bg, type OrderListItem as bh, type OrderPaymentInstructions as bi, type OrderPickupPoint as bj, type OrderShipment as bk, type OrderStatus as bl, type OrderStatusHistory as bm, OrderStatuses as bn, type OrderTracking as bo, type Page as bp, type PageAttachment as bq, type PageDetail as br, type PaginatedResponse as bs, type PaymentInstrument as bt, type PaymentStatus as bu, PaymentStatuses as bv, type PaymentSwift as bw, type PickupPoint as bx, type PickupPointHours as by, type PickupPointsInput as bz, type StorefrontFormPlacement as c, type WishlistItem as c$, type RegisterInput as c0, type RegisterResult as c1, type RequestInterceptor as c2, type RequestInterceptorConfig as c3, type ResponseInterceptor as c4, type ResponseInterceptorData as c5, type ReturnRequest as c6, type ReturnRequestItem as c7, type ReturnStatus as c8, type ReturnStatusItem as c9, type StorefrontCollectionItem as cA, type StorefrontCollectionQuery as cB, type StorefrontFaqGroup as cC, type StorefrontFaqGroupSummary as cD, type StorefrontFaqGroups as cE, type StorefrontFaqItem as cF, type StorefrontFaqQuery as cG, type StorefrontForm as cH, type StorefrontFormFieldErrorCode as cI, type StorefrontFormFile as cJ, type StorefrontFormPresentation as cK, type StorefrontFormSettings as cL, type StorefrontFormSubmitInput as cM, type StorefrontFormSubmitResult as cN, type StorefrontFormUpload as cO, type SubmitQuoteInput as cP, type SubmitReturnInput as cQ, type SubmitReviewInput as cR, type SubmitWithdrawalInput as cS, type Subscription as cT, type SubscriptionAction as cU, type SubscriptionFrequency as cV, type SubscriptionItem as cW, type SubscriptionStatus as cX, type TaxBreakdownLine as cY, type VariantAxis as cZ, type VariantAxisValue as c_, type ReturnableOrder as ca, type ReturnableOrderItem as cb, type SdkError as cc, type ShippingMethodSummary as cd, type ShippingPublicConfig as ce, type ShippingQuote as cf, type ShippingQuoteInput as cg, type ShopAppearance as ch, type ShopCommerce as ci, type ShopInfo as cj, type ShopScript as ck, type ShopScriptPlacement as cl, type ShopScriptType as cm, type ShopScripts as cn, type ShopSeo as co, type ShopSeoIdentity as cp, type SiteFormField as cq, type SiteFormFieldOption as cr, type SiteFormFieldType as cs, type Sitemap as ct, type SitemapEntry as cu, type StockBehavior as cv, type StockMode as cw, type StorefrontCollection as cx, type StorefrontCollectionField as cy, type StorefrontCollectionFieldType as cz, type AddToCartInput as d, type WithdrawalAcknowledgement as d0, type WithdrawalFlag as d1, type WithdrawalSettings as d2, type WithdrawalWindow as d3, clearCartSummary as d4, err as d5, ok as d6, publishCartSummary as d7, toSdkError as d8, type AddToCartItemsInput as e, type AddressDetail as f, type AddressSuggestion as g, type AddressType as h, AddressTypes as i, type AuthTokens as j, type BackInStockSubscription as k, type BadgeTone as l, BehioApiError as m, type BehioErrorCode as n, type BehioEventHandler as o, type BehioEventType as p, BehioNetworkError as q, type BehioStorefrontConfig as r, type Blog as s, type BlogPostDetail as t, type BlogPostListItem as u, type BlogPostsPage as v, type BlogPostsQuery as w, type BlogSettings as x, type BlogTag as y, type Booking as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,10 @@
1
- import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError, c as StorefrontFormPlacement } from './client-DtAz0rDJ.mjs';
2
- export { A as ActivePromotion, d as AddToCartInput, e as AddToCartItemsInput, f as AddressDetail, g as AddressSuggestion, h as AddressType, i as AddressTypes, j as AuthTokens, k as BackInStockSubscription, l as BadgeTone, m as BehioApiError, n as BehioErrorCode, o as BehioEventHandler, p as BehioEventType, q as BehioNetworkError, r as BehioStorefrontConfig, s as Blog, t as BlogPostDetail, u as BlogPostListItem, v as BlogPostsPage, w as BlogPostsQuery, x as BlogSettings, y as BlogTag, z as Booking, D as BookingCategory, E as BookingConfig, F as BookingCreateInput, G as BookingCreated, H as BookingLocale, I as BookingLocation, J as BookingManageSlotsQuery, K as BookingService, L as BookingSlot, M as BookingSlots, N as BookingSlotsQuery, O as BookingStaff, Q as BookingStatus, R as Bundle, T as BundleCatalogQuery, U as BundleItem, V as Cart, W as CartBundleLine, X as CartBundleLineItem, Y as CartDiscount, Z as CartItem, _ as CartItemProduct, $ as CartLinkClaimed, a0 as CartPromotion, a1 as CartSummaryEvent, a2 as Category, a3 as CategoryDetail, a4 as CertificateVerification, a5 as CheckoutAddress, a6 as CheckoutInput, a7 as CheckoutPaymentMethod, a8 as CheckoutPreview, a9 as CheckoutResult, aa as CheckoutSettings, ab as CookieConsentInput, ac as CourseAttachment, ad as CourseCertificate, ae as CourseComment, af as CourseCommentReply, ag as CourseCommentsList, ah as CourseDetail, ai as CourseLesson, aj as CourseListItem, ak as CourseModule, al as CoursePostedComment, am as CourseProgress, an as CourseTutorMessage, ao as CourseTutorThread, ap as CrossSellItem, aq as CurrencyDisplayFormat, ar as CustomerAddress, as as CustomerBadge, at as CustomerChallenge, au as CustomerGamification, av as CustomerGamificationQuery, aw as CustomerProfile, ax as DigitalDownload, ay as DownloadUrl, az as Facet, aA as FacetAvailability, aB as FacetCategory, aC as FacetLabel, aD as FacetPriceRange, aE as FacetRange, aF as FacetRatingBucket, aG as FacetValue, aH as FacetsResponse, aI as FilterField, aJ as FulfillmentStatus, aK as FulfillmentStatuses, aL as GamificationRefreshResult, aM as GiftCardBalance, aN as GiftCardPurchaseInput, aO as GiftCardPurchaseResult, aP as GiftCardSummary, aQ as LessonNote, aR as LessonQuiz, aS as LoginInput, aT as LoyaltyBalance, aU as LoyaltyNextTier, aV as LoyaltyProgram, aW as LoyaltyQuery, aX as LoyaltyReferralResult, aY as LoyaltySummary, aZ as LoyaltyTier, a_ as LoyaltyTierPerks, a$ as LoyaltyTransaction, b0 as Menu, b1 as MenuItem, b2 as MenuItemRef, b3 as MenuItemType, b4 as MessageResponse, b5 as NewsletterConfirmResult, b6 as NewsletterOptInDefault, b7 as NewsletterSubscribeInput, b8 as NewsletterSubscribeResult, b9 as NewsletterUnsubscribeResult, ba as OrderAccessRequestResponse, bb as OrderAccessVerifyResponse, bc as OrderDetail, bd as OrderDiscount, be as OrderDocument, bf as OrderItem, bg as OrderListItem, bh as OrderPaymentInstructions, bi as OrderPickupPoint, bj as OrderShipment, bk as OrderStatus, bl as OrderStatusHistory, bm as OrderStatuses, bn as OrderTracking, bo as Page, bp as PageAttachment, bq as PageDetail, br as PaginatedResponse, bs as PaymentInstrument, bt as PaymentStatus, bu as PaymentStatuses, bv as PaymentSwift, bw as PickupPoint, bx as PickupPointHours, by as PickupPointsInput, bz as PickupWidgetConfig, bA as PriceDisplay, bB as ProductAssetGroup, bC as ProductAssetItem, bD as ProductAvailability, bE as ProductGroup, bF as ProductLabel, bG as ProductListItem, bH as ProductMedia, bI as ProductMediaVariant, bJ as ProductParameter, bK as ProductParameterGroup, bL as ProductParametersResponse, bM as ProductPrice, bN as ProductPromotionSummary, bO as ProductReview, bP as ProductReviewsResponse, bQ as ProductSibling, bR as ProductSort, bS as ProductSortValue, bT as ProductVolumePrice, bU as ProductsQuery, bV as QuizAnswerInput, bW as QuizAnswerResult, bX as QuizQuestion, bY as QuizResult, bZ as QuoteItem, b_ as QuoteRequest, b$ as RegisterInput, c0 as RegisterResult, c1 as RequestInterceptor, c2 as RequestInterceptorConfig, c3 as ResponseInterceptor, c4 as ResponseInterceptorData, c5 as ReturnRequest, c6 as ReturnRequestItem, c7 as ReturnStatus, c8 as ReturnStatusItem, c9 as ReturnableOrder, ca as ReturnableOrderItem, cb as SdkError, cc as ShippingMethodSummary, cd as ShippingPublicConfig, ce as ShippingQuote, cf as ShippingQuoteInput, cg as ShopAppearance, ch as ShopCommerce, ci as ShopInfo, cj as ShopScript, ck as ShopScriptPlacement, cl as ShopScriptType, cm as ShopScripts, cn as ShopSeo, co as ShopSeoIdentity, cp as SiteFormField, cq as SiteFormFieldOption, cr as SiteFormFieldType, cs as Sitemap, ct as SitemapEntry, cu as StockBehavior, cv as StockMode, cw as StorefrontCollection, cx as StorefrontCollectionField, cy as StorefrontCollectionFieldType, cz as StorefrontCollectionItem, cA as StorefrontCollectionQuery, cB as StorefrontFaqGroup, cC as StorefrontFaqGroupSummary, cD as StorefrontFaqGroups, cE as StorefrontFaqItem, cF as StorefrontFaqQuery, cG as StorefrontForm, cH as StorefrontFormFieldErrorCode, cI as StorefrontFormFile, cJ as StorefrontFormPresentation, cK as StorefrontFormSettings, cL as StorefrontFormSubmitInput, cM as StorefrontFormSubmitResult, cN as StorefrontFormUpload, cO as SubmitQuoteInput, cP as SubmitReturnInput, cQ as SubmitReviewInput, cR as SubmitWithdrawalInput, cS as Subscription, cT as SubscriptionAction, cU as SubscriptionFrequency, cV as SubscriptionItem, cW as SubscriptionStatus, cX as TaxBreakdownLine, cY as VariantAxis, cZ as VariantAxisValue, c_ as WishlistItem, c$ as WithdrawalAcknowledgement, d0 as WithdrawalFlag, d1 as WithdrawalSettings, d2 as WithdrawalWindow, d3 as clearCartSummary, d4 as err, d5 as ok, d6 as publishCartSummary, d7 as toSdkError } from './client-DtAz0rDJ.mjs';
1
+ import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError, c as StorefrontFormPlacement } from './client-DeAREmgD.mjs';
2
+ export { A as ActivePromotion, d as AddToCartInput, e as AddToCartItemsInput, f as AddressDetail, g as AddressSuggestion, h as AddressType, i as AddressTypes, j as AuthTokens, k as BackInStockSubscription, l as BadgeTone, m as BehioApiError, n as BehioErrorCode, o as BehioEventHandler, p as BehioEventType, q as BehioNetworkError, r as BehioStorefrontConfig, s as Blog, t as BlogPostDetail, u as BlogPostListItem, v as BlogPostsPage, w as BlogPostsQuery, x as BlogSettings, y as BlogTag, z as Booking, D as BookingCategory, E as BookingConfig, F as BookingCreateInput, G as BookingCreated, H as BookingLocale, I as BookingLocation, J as BookingManageSlotsQuery, K as BookingService, L as BookingSlot, M as BookingSlots, N as BookingSlotsQuery, O as BookingStaff, Q as BookingStatus, R as Bundle, T as BundleCatalogQuery, U as BundleItem, V as Cart, W as CartBundleLine, X as CartBundleLineItem, Y as CartDiscount, Z as CartItem, _ as CartItemProduct, $ as CartLinkClaimed, a0 as CartPromotion, a1 as CartSummaryEvent, a2 as Category, a3 as CategoryDetail, a4 as CertificateVerification, a5 as CheckoutAddress, a6 as CheckoutInput, a7 as CheckoutPaymentMethod, a8 as CheckoutPreview, a9 as CheckoutResult, aa as CheckoutSettings, ab as CookieConsentInput, ac as CourseAttachment, ad as CourseCertificate, ae as CourseComment, af as CourseCommentReply, ag as CourseCommentsList, ah as CourseDetail, ai as CourseLesson, aj as CourseListItem, ak as CourseModule, al as CoursePostedComment, am as CourseProgress, an as CourseTutorMessage, ao as CourseTutorThread, ap as CrossSellItem, aq as CurrencyDisplayFormat, ar as CustomerAddress, as as CustomerBadge, at as CustomerChallenge, au as CustomerGamification, av as CustomerGamificationQuery, aw as CustomerProfile, ax as DigitalDownload, ay as DownloadUrl, az as Facet, aA as FacetAvailability, aB as FacetCategory, aC as FacetLabel, aD as FacetPriceRange, aE as FacetRange, aF as FacetRatingBucket, aG as FacetValue, aH as FacetsResponse, aI as FilterField, aJ as FulfillmentStatus, aK as FulfillmentStatuses, aL as GamificationRefreshResult, aM as GiftCardBalance, aN as GiftCardPurchaseInput, aO as GiftCardPurchaseResult, aP as GiftCardSummary, aQ as LessonNote, aR as LessonQuiz, aS as LoginInput, aT as LoyaltyBalance, aU as LoyaltyNextTier, aV as LoyaltyProgram, aW as LoyaltyQuery, aX as LoyaltyReferralResult, aY as LoyaltySummary, aZ as LoyaltyTier, a_ as LoyaltyTierPerks, a$ as LoyaltyTransaction, b0 as Menu, b1 as MenuItem, b2 as MenuItemRef, b3 as MenuItemType, b4 as MessageResponse, b5 as NewsletterConfirmResult, b6 as NewsletterOptInDefault, b7 as NewsletterSubscribeInput, b8 as NewsletterSubscribeResult, b9 as NewsletterUnsubscribeInput, ba as NewsletterUnsubscribeResult, bb as OrderAccessRequestResponse, bc as OrderAccessVerifyResponse, bd as OrderDetail, be as OrderDiscount, bf as OrderDocument, bg as OrderItem, bh as OrderListItem, bi as OrderPaymentInstructions, bj as OrderPickupPoint, bk as OrderShipment, bl as OrderStatus, bm as OrderStatusHistory, bn as OrderStatuses, bo as OrderTracking, bp as Page, bq as PageAttachment, br as PageDetail, bs as PaginatedResponse, bt as PaymentInstrument, bu as PaymentStatus, bv as PaymentStatuses, bw as PaymentSwift, bx as PickupPoint, by as PickupPointHours, bz as PickupPointsInput, bA as PickupWidgetConfig, bB as PriceDisplay, bC as ProductAssetGroup, bD as ProductAssetItem, bE as ProductAvailability, bF as ProductGroup, bG as ProductLabel, bH as ProductListItem, bI as ProductMedia, bJ as ProductMediaVariant, bK as ProductParameter, bL as ProductParameterGroup, bM as ProductParametersResponse, bN as ProductPrice, bO as ProductPromotionSummary, bP as ProductReview, bQ as ProductReviewsResponse, bR as ProductSibling, bS as ProductSort, bT as ProductSortValue, bU as ProductVolumePrice, bV as ProductsQuery, bW as QuizAnswerInput, bX as QuizAnswerResult, bY as QuizQuestion, bZ as QuizResult, b_ as QuoteItem, b$ as QuoteRequest, c0 as RegisterInput, c1 as RegisterResult, c2 as RequestInterceptor, c3 as RequestInterceptorConfig, c4 as ResponseInterceptor, c5 as ResponseInterceptorData, c6 as ReturnRequest, c7 as ReturnRequestItem, c8 as ReturnStatus, c9 as ReturnStatusItem, ca as ReturnableOrder, cb as ReturnableOrderItem, cc as SdkError, cd as ShippingMethodSummary, ce as ShippingPublicConfig, cf as ShippingQuote, cg as ShippingQuoteInput, ch as ShopAppearance, ci as ShopCommerce, cj as ShopInfo, ck as ShopScript, cl as ShopScriptPlacement, cm as ShopScriptType, cn as ShopScripts, co as ShopSeo, cp as ShopSeoIdentity, cq as SiteFormField, cr as SiteFormFieldOption, cs as SiteFormFieldType, ct as Sitemap, cu as SitemapEntry, cv as StockBehavior, cw as StockMode, cx as StorefrontCollection, cy as StorefrontCollectionField, cz as StorefrontCollectionFieldType, cA as StorefrontCollectionItem, cB as StorefrontCollectionQuery, cC as StorefrontFaqGroup, cD as StorefrontFaqGroupSummary, cE as StorefrontFaqGroups, cF as StorefrontFaqItem, cG as StorefrontFaqQuery, cH as StorefrontForm, cI as StorefrontFormFieldErrorCode, cJ as StorefrontFormFile, cK as StorefrontFormPresentation, cL as StorefrontFormSettings, cM as StorefrontFormSubmitInput, cN as StorefrontFormSubmitResult, cO as StorefrontFormUpload, cP as SubmitQuoteInput, cQ as SubmitReturnInput, cR as SubmitReviewInput, cS as SubmitWithdrawalInput, cT as Subscription, cU as SubscriptionAction, cV as SubscriptionFrequency, cW as SubscriptionItem, cX as SubscriptionStatus, cY as TaxBreakdownLine, cZ as VariantAxis, c_ as VariantAxisValue, c$ as WishlistItem, d0 as WithdrawalAcknowledgement, d1 as WithdrawalFlag, d2 as WithdrawalSettings, d3 as WithdrawalWindow, d4 as clearCartSummary, d5 as err, d6 as ok, d7 as publishCartSummary, d8 as toSdkError } from './client-DeAREmgD.mjs';
3
+
4
+ interface HeaderReader {
5
+ get(name: string): string | null;
6
+ }
7
+ declare function trustedVisitorIp(headers: HeaderReader, originSecret?: string | null): string | undefined;
3
8
 
4
9
  /**
5
10
  * Format a price amount with currency using Intl.NumberFormat.
@@ -303,4 +308,4 @@ declare class FormPopupPreferences {
303
308
  dismiss(slug: string, days: number): void;
304
309
  }
305
310
 
306
- export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type ErrorMessageLocale, FormPopupClock, FormPopupPreferences, NEWSLETTER_REQUESTED_EVENT, ProductDetail, ProductVariant, type ResolvedVariantContent, SdkResult, StorefrontFormFieldError, StorefrontFormPlacement, VARIANT_QUERY_PARAM, type VariantComparisonRow, availableAxisValues, buildVariantComparison, errorCode, errorMessage, errorParams, findVariantByAttributes, formFieldErrors, formPopupRouteAllowed, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, markNewsletterRequested, matchesFormPath, newsletterWasRequested, resolveVariantContent, revokeAnalyticsConsent, trackEcommerceEvent, validationFieldMessages, variantFromQuery, variantHref };
311
+ export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type ErrorMessageLocale, FormPopupClock, FormPopupPreferences, type HeaderReader, NEWSLETTER_REQUESTED_EVENT, ProductDetail, ProductVariant, type ResolvedVariantContent, SdkResult, StorefrontFormFieldError, StorefrontFormPlacement, VARIANT_QUERY_PARAM, type VariantComparisonRow, availableAxisValues, buildVariantComparison, errorCode, errorMessage, errorParams, findVariantByAttributes, formFieldErrors, formPopupRouteAllowed, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, markNewsletterRequested, matchesFormPath, newsletterWasRequested, resolveVariantContent, revokeAnalyticsConsent, trackEcommerceEvent, trustedVisitorIp, validationFieldMessages, variantFromQuery, variantHref };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
- import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError, c as StorefrontFormPlacement } from './client-DtAz0rDJ.js';
2
- export { A as ActivePromotion, d as AddToCartInput, e as AddToCartItemsInput, f as AddressDetail, g as AddressSuggestion, h as AddressType, i as AddressTypes, j as AuthTokens, k as BackInStockSubscription, l as BadgeTone, m as BehioApiError, n as BehioErrorCode, o as BehioEventHandler, p as BehioEventType, q as BehioNetworkError, r as BehioStorefrontConfig, s as Blog, t as BlogPostDetail, u as BlogPostListItem, v as BlogPostsPage, w as BlogPostsQuery, x as BlogSettings, y as BlogTag, z as Booking, D as BookingCategory, E as BookingConfig, F as BookingCreateInput, G as BookingCreated, H as BookingLocale, I as BookingLocation, J as BookingManageSlotsQuery, K as BookingService, L as BookingSlot, M as BookingSlots, N as BookingSlotsQuery, O as BookingStaff, Q as BookingStatus, R as Bundle, T as BundleCatalogQuery, U as BundleItem, V as Cart, W as CartBundleLine, X as CartBundleLineItem, Y as CartDiscount, Z as CartItem, _ as CartItemProduct, $ as CartLinkClaimed, a0 as CartPromotion, a1 as CartSummaryEvent, a2 as Category, a3 as CategoryDetail, a4 as CertificateVerification, a5 as CheckoutAddress, a6 as CheckoutInput, a7 as CheckoutPaymentMethod, a8 as CheckoutPreview, a9 as CheckoutResult, aa as CheckoutSettings, ab as CookieConsentInput, ac as CourseAttachment, ad as CourseCertificate, ae as CourseComment, af as CourseCommentReply, ag as CourseCommentsList, ah as CourseDetail, ai as CourseLesson, aj as CourseListItem, ak as CourseModule, al as CoursePostedComment, am as CourseProgress, an as CourseTutorMessage, ao as CourseTutorThread, ap as CrossSellItem, aq as CurrencyDisplayFormat, ar as CustomerAddress, as as CustomerBadge, at as CustomerChallenge, au as CustomerGamification, av as CustomerGamificationQuery, aw as CustomerProfile, ax as DigitalDownload, ay as DownloadUrl, az as Facet, aA as FacetAvailability, aB as FacetCategory, aC as FacetLabel, aD as FacetPriceRange, aE as FacetRange, aF as FacetRatingBucket, aG as FacetValue, aH as FacetsResponse, aI as FilterField, aJ as FulfillmentStatus, aK as FulfillmentStatuses, aL as GamificationRefreshResult, aM as GiftCardBalance, aN as GiftCardPurchaseInput, aO as GiftCardPurchaseResult, aP as GiftCardSummary, aQ as LessonNote, aR as LessonQuiz, aS as LoginInput, aT as LoyaltyBalance, aU as LoyaltyNextTier, aV as LoyaltyProgram, aW as LoyaltyQuery, aX as LoyaltyReferralResult, aY as LoyaltySummary, aZ as LoyaltyTier, a_ as LoyaltyTierPerks, a$ as LoyaltyTransaction, b0 as Menu, b1 as MenuItem, b2 as MenuItemRef, b3 as MenuItemType, b4 as MessageResponse, b5 as NewsletterConfirmResult, b6 as NewsletterOptInDefault, b7 as NewsletterSubscribeInput, b8 as NewsletterSubscribeResult, b9 as NewsletterUnsubscribeResult, ba as OrderAccessRequestResponse, bb as OrderAccessVerifyResponse, bc as OrderDetail, bd as OrderDiscount, be as OrderDocument, bf as OrderItem, bg as OrderListItem, bh as OrderPaymentInstructions, bi as OrderPickupPoint, bj as OrderShipment, bk as OrderStatus, bl as OrderStatusHistory, bm as OrderStatuses, bn as OrderTracking, bo as Page, bp as PageAttachment, bq as PageDetail, br as PaginatedResponse, bs as PaymentInstrument, bt as PaymentStatus, bu as PaymentStatuses, bv as PaymentSwift, bw as PickupPoint, bx as PickupPointHours, by as PickupPointsInput, bz as PickupWidgetConfig, bA as PriceDisplay, bB as ProductAssetGroup, bC as ProductAssetItem, bD as ProductAvailability, bE as ProductGroup, bF as ProductLabel, bG as ProductListItem, bH as ProductMedia, bI as ProductMediaVariant, bJ as ProductParameter, bK as ProductParameterGroup, bL as ProductParametersResponse, bM as ProductPrice, bN as ProductPromotionSummary, bO as ProductReview, bP as ProductReviewsResponse, bQ as ProductSibling, bR as ProductSort, bS as ProductSortValue, bT as ProductVolumePrice, bU as ProductsQuery, bV as QuizAnswerInput, bW as QuizAnswerResult, bX as QuizQuestion, bY as QuizResult, bZ as QuoteItem, b_ as QuoteRequest, b$ as RegisterInput, c0 as RegisterResult, c1 as RequestInterceptor, c2 as RequestInterceptorConfig, c3 as ResponseInterceptor, c4 as ResponseInterceptorData, c5 as ReturnRequest, c6 as ReturnRequestItem, c7 as ReturnStatus, c8 as ReturnStatusItem, c9 as ReturnableOrder, ca as ReturnableOrderItem, cb as SdkError, cc as ShippingMethodSummary, cd as ShippingPublicConfig, ce as ShippingQuote, cf as ShippingQuoteInput, cg as ShopAppearance, ch as ShopCommerce, ci as ShopInfo, cj as ShopScript, ck as ShopScriptPlacement, cl as ShopScriptType, cm as ShopScripts, cn as ShopSeo, co as ShopSeoIdentity, cp as SiteFormField, cq as SiteFormFieldOption, cr as SiteFormFieldType, cs as Sitemap, ct as SitemapEntry, cu as StockBehavior, cv as StockMode, cw as StorefrontCollection, cx as StorefrontCollectionField, cy as StorefrontCollectionFieldType, cz as StorefrontCollectionItem, cA as StorefrontCollectionQuery, cB as StorefrontFaqGroup, cC as StorefrontFaqGroupSummary, cD as StorefrontFaqGroups, cE as StorefrontFaqItem, cF as StorefrontFaqQuery, cG as StorefrontForm, cH as StorefrontFormFieldErrorCode, cI as StorefrontFormFile, cJ as StorefrontFormPresentation, cK as StorefrontFormSettings, cL as StorefrontFormSubmitInput, cM as StorefrontFormSubmitResult, cN as StorefrontFormUpload, cO as SubmitQuoteInput, cP as SubmitReturnInput, cQ as SubmitReviewInput, cR as SubmitWithdrawalInput, cS as Subscription, cT as SubscriptionAction, cU as SubscriptionFrequency, cV as SubscriptionItem, cW as SubscriptionStatus, cX as TaxBreakdownLine, cY as VariantAxis, cZ as VariantAxisValue, c_ as WishlistItem, c$ as WithdrawalAcknowledgement, d0 as WithdrawalFlag, d1 as WithdrawalSettings, d2 as WithdrawalWindow, d3 as clearCartSummary, d4 as err, d5 as ok, d6 as publishCartSummary, d7 as toSdkError } from './client-DtAz0rDJ.js';
1
+ import { P as ProductDetail, a as ProductVariant, B as BehioStorefront, S as SdkResult, C as CookieConsent, b as StorefrontFormFieldError, c as StorefrontFormPlacement } from './client-DeAREmgD.js';
2
+ export { A as ActivePromotion, d as AddToCartInput, e as AddToCartItemsInput, f as AddressDetail, g as AddressSuggestion, h as AddressType, i as AddressTypes, j as AuthTokens, k as BackInStockSubscription, l as BadgeTone, m as BehioApiError, n as BehioErrorCode, o as BehioEventHandler, p as BehioEventType, q as BehioNetworkError, r as BehioStorefrontConfig, s as Blog, t as BlogPostDetail, u as BlogPostListItem, v as BlogPostsPage, w as BlogPostsQuery, x as BlogSettings, y as BlogTag, z as Booking, D as BookingCategory, E as BookingConfig, F as BookingCreateInput, G as BookingCreated, H as BookingLocale, I as BookingLocation, J as BookingManageSlotsQuery, K as BookingService, L as BookingSlot, M as BookingSlots, N as BookingSlotsQuery, O as BookingStaff, Q as BookingStatus, R as Bundle, T as BundleCatalogQuery, U as BundleItem, V as Cart, W as CartBundleLine, X as CartBundleLineItem, Y as CartDiscount, Z as CartItem, _ as CartItemProduct, $ as CartLinkClaimed, a0 as CartPromotion, a1 as CartSummaryEvent, a2 as Category, a3 as CategoryDetail, a4 as CertificateVerification, a5 as CheckoutAddress, a6 as CheckoutInput, a7 as CheckoutPaymentMethod, a8 as CheckoutPreview, a9 as CheckoutResult, aa as CheckoutSettings, ab as CookieConsentInput, ac as CourseAttachment, ad as CourseCertificate, ae as CourseComment, af as CourseCommentReply, ag as CourseCommentsList, ah as CourseDetail, ai as CourseLesson, aj as CourseListItem, ak as CourseModule, al as CoursePostedComment, am as CourseProgress, an as CourseTutorMessage, ao as CourseTutorThread, ap as CrossSellItem, aq as CurrencyDisplayFormat, ar as CustomerAddress, as as CustomerBadge, at as CustomerChallenge, au as CustomerGamification, av as CustomerGamificationQuery, aw as CustomerProfile, ax as DigitalDownload, ay as DownloadUrl, az as Facet, aA as FacetAvailability, aB as FacetCategory, aC as FacetLabel, aD as FacetPriceRange, aE as FacetRange, aF as FacetRatingBucket, aG as FacetValue, aH as FacetsResponse, aI as FilterField, aJ as FulfillmentStatus, aK as FulfillmentStatuses, aL as GamificationRefreshResult, aM as GiftCardBalance, aN as GiftCardPurchaseInput, aO as GiftCardPurchaseResult, aP as GiftCardSummary, aQ as LessonNote, aR as LessonQuiz, aS as LoginInput, aT as LoyaltyBalance, aU as LoyaltyNextTier, aV as LoyaltyProgram, aW as LoyaltyQuery, aX as LoyaltyReferralResult, aY as LoyaltySummary, aZ as LoyaltyTier, a_ as LoyaltyTierPerks, a$ as LoyaltyTransaction, b0 as Menu, b1 as MenuItem, b2 as MenuItemRef, b3 as MenuItemType, b4 as MessageResponse, b5 as NewsletterConfirmResult, b6 as NewsletterOptInDefault, b7 as NewsletterSubscribeInput, b8 as NewsletterSubscribeResult, b9 as NewsletterUnsubscribeInput, ba as NewsletterUnsubscribeResult, bb as OrderAccessRequestResponse, bc as OrderAccessVerifyResponse, bd as OrderDetail, be as OrderDiscount, bf as OrderDocument, bg as OrderItem, bh as OrderListItem, bi as OrderPaymentInstructions, bj as OrderPickupPoint, bk as OrderShipment, bl as OrderStatus, bm as OrderStatusHistory, bn as OrderStatuses, bo as OrderTracking, bp as Page, bq as PageAttachment, br as PageDetail, bs as PaginatedResponse, bt as PaymentInstrument, bu as PaymentStatus, bv as PaymentStatuses, bw as PaymentSwift, bx as PickupPoint, by as PickupPointHours, bz as PickupPointsInput, bA as PickupWidgetConfig, bB as PriceDisplay, bC as ProductAssetGroup, bD as ProductAssetItem, bE as ProductAvailability, bF as ProductGroup, bG as ProductLabel, bH as ProductListItem, bI as ProductMedia, bJ as ProductMediaVariant, bK as ProductParameter, bL as ProductParameterGroup, bM as ProductParametersResponse, bN as ProductPrice, bO as ProductPromotionSummary, bP as ProductReview, bQ as ProductReviewsResponse, bR as ProductSibling, bS as ProductSort, bT as ProductSortValue, bU as ProductVolumePrice, bV as ProductsQuery, bW as QuizAnswerInput, bX as QuizAnswerResult, bY as QuizQuestion, bZ as QuizResult, b_ as QuoteItem, b$ as QuoteRequest, c0 as RegisterInput, c1 as RegisterResult, c2 as RequestInterceptor, c3 as RequestInterceptorConfig, c4 as ResponseInterceptor, c5 as ResponseInterceptorData, c6 as ReturnRequest, c7 as ReturnRequestItem, c8 as ReturnStatus, c9 as ReturnStatusItem, ca as ReturnableOrder, cb as ReturnableOrderItem, cc as SdkError, cd as ShippingMethodSummary, ce as ShippingPublicConfig, cf as ShippingQuote, cg as ShippingQuoteInput, ch as ShopAppearance, ci as ShopCommerce, cj as ShopInfo, ck as ShopScript, cl as ShopScriptPlacement, cm as ShopScriptType, cn as ShopScripts, co as ShopSeo, cp as ShopSeoIdentity, cq as SiteFormField, cr as SiteFormFieldOption, cs as SiteFormFieldType, ct as Sitemap, cu as SitemapEntry, cv as StockBehavior, cw as StockMode, cx as StorefrontCollection, cy as StorefrontCollectionField, cz as StorefrontCollectionFieldType, cA as StorefrontCollectionItem, cB as StorefrontCollectionQuery, cC as StorefrontFaqGroup, cD as StorefrontFaqGroupSummary, cE as StorefrontFaqGroups, cF as StorefrontFaqItem, cG as StorefrontFaqQuery, cH as StorefrontForm, cI as StorefrontFormFieldErrorCode, cJ as StorefrontFormFile, cK as StorefrontFormPresentation, cL as StorefrontFormSettings, cM as StorefrontFormSubmitInput, cN as StorefrontFormSubmitResult, cO as StorefrontFormUpload, cP as SubmitQuoteInput, cQ as SubmitReturnInput, cR as SubmitReviewInput, cS as SubmitWithdrawalInput, cT as Subscription, cU as SubscriptionAction, cV as SubscriptionFrequency, cW as SubscriptionItem, cX as SubscriptionStatus, cY as TaxBreakdownLine, cZ as VariantAxis, c_ as VariantAxisValue, c$ as WishlistItem, d0 as WithdrawalAcknowledgement, d1 as WithdrawalFlag, d2 as WithdrawalSettings, d3 as WithdrawalWindow, d4 as clearCartSummary, d5 as err, d6 as ok, d7 as publishCartSummary, d8 as toSdkError } from './client-DeAREmgD.js';
3
+
4
+ interface HeaderReader {
5
+ get(name: string): string | null;
6
+ }
7
+ declare function trustedVisitorIp(headers: HeaderReader, originSecret?: string | null): string | undefined;
3
8
 
4
9
  /**
5
10
  * Format a price amount with currency using Intl.NumberFormat.
@@ -303,4 +308,4 @@ declare class FormPopupPreferences {
303
308
  dismiss(slug: string, days: number): void;
304
309
  }
305
310
 
306
- export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type ErrorMessageLocale, FormPopupClock, FormPopupPreferences, NEWSLETTER_REQUESTED_EVENT, ProductDetail, ProductVariant, type ResolvedVariantContent, SdkResult, StorefrontFormFieldError, StorefrontFormPlacement, VARIANT_QUERY_PARAM, type VariantComparisonRow, availableAxisValues, buildVariantComparison, errorCode, errorMessage, errorParams, findVariantByAttributes, formFieldErrors, formPopupRouteAllowed, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, markNewsletterRequested, matchesFormPath, newsletterWasRequested, resolveVariantContent, revokeAnalyticsConsent, trackEcommerceEvent, validationFieldMessages, variantFromQuery, variantHref };
311
+ export { BehioStorefront, CookieConsent, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type ErrorMessageLocale, FormPopupClock, FormPopupPreferences, type HeaderReader, NEWSLETTER_REQUESTED_EVENT, ProductDetail, ProductVariant, type ResolvedVariantContent, SdkResult, StorefrontFormFieldError, StorefrontFormPlacement, VARIANT_QUERY_PARAM, type VariantComparisonRow, availableAxisValues, buildVariantComparison, errorCode, errorMessage, errorParams, findVariantByAttributes, formFieldErrors, formPopupRouteAllowed, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, markNewsletterRequested, matchesFormPath, newsletterWasRequested, resolveVariantContent, revokeAnalyticsConsent, trackEcommerceEvent, trustedVisitorIp, validationFieldMessages, variantFromQuery, variantHref };
package/dist/index.js CHANGED
@@ -12,7 +12,8 @@
12
12
 
13
13
 
14
14
 
15
- var _chunkOUPCGMSRjs = require('./chunk-OUPCGMSR.js');
15
+
16
+ var _chunkQU4OFGKKjs = require('./chunk-QU4OFGKK.js');
16
17
 
17
18
  // src/react/utils/format-price.ts
18
19
  function formatPrice(amount, currency, locale, display) {
@@ -1118,7 +1119,7 @@ var GENERIC = {
1118
1119
  en: "Something went wrong, please try again."
1119
1120
  };
1120
1121
  function bodyOf(err2) {
1121
- const body = err2 instanceof _chunkOUPCGMSRjs.BehioApiError ? err2.body : err2 && typeof err2 === "object" && "body" in err2 ? err2.body : err2;
1122
+ const body = err2 instanceof _chunkQU4OFGKKjs.BehioApiError ? err2.body : err2 && typeof err2 === "object" && "body" in err2 ? err2.body : err2;
1122
1123
  return body && typeof body === "object" ? body : null;
1123
1124
  }
1124
1125
  function errorCode(err2) {
@@ -1384,4 +1385,5 @@ var FormPopupPreferences = class {
1384
1385
 
1385
1386
 
1386
1387
 
1387
- exports.AddressTypes = _chunkOUPCGMSRjs.AddressTypes; exports.BehioApiError = _chunkOUPCGMSRjs.BehioApiError; exports.BehioNetworkError = _chunkOUPCGMSRjs.BehioNetworkError; exports.BehioStorefront = _chunkOUPCGMSRjs.BehioStorefront; exports.FormPopupClock = FormPopupClock; exports.FormPopupPreferences = FormPopupPreferences; exports.FulfillmentStatuses = _chunkOUPCGMSRjs.FulfillmentStatuses; exports.NEWSLETTER_REQUESTED_EVENT = NEWSLETTER_REQUESTED_EVENT; exports.OrderStatuses = _chunkOUPCGMSRjs.OrderStatuses; exports.PaymentStatuses = _chunkOUPCGMSRjs.PaymentStatuses; exports.ProductSort = _chunkOUPCGMSRjs.ProductSort; exports.VARIANT_QUERY_PARAM = VARIANT_QUERY_PARAM; exports.availableAxisValues = availableAxisValues; exports.buildVariantComparison = buildVariantComparison; exports.clearCartSummary = _chunkOUPCGMSRjs.clearCartSummary; exports.err = _chunkOUPCGMSRjs.err; exports.errorCode = errorCode; exports.errorMessage = errorMessage; exports.errorParams = errorParams; exports.findVariantByAttributes = findVariantByAttributes; exports.formFieldErrors = formFieldErrors; exports.formPopupRouteAllowed = formPopupRouteAllowed; exports.formatPrice = formatPrice; exports.generateVisitorId = generateVisitorId; exports.getStoredVisitorId = getStoredVisitorId; exports.grantAnalyticsConsent = grantAnalyticsConsent; exports.markNewsletterRequested = markNewsletterRequested; exports.matchesFormPath = matchesFormPath; exports.newsletterWasRequested = newsletterWasRequested; exports.ok = _chunkOUPCGMSRjs.ok; exports.publishCartSummary = _chunkOUPCGMSRjs.publishCartSummary; exports.resolveVariantContent = resolveVariantContent; exports.revokeAnalyticsConsent = revokeAnalyticsConsent; exports.toSdkError = _chunkOUPCGMSRjs.toSdkError; exports.trackEcommerceEvent = trackEcommerceEvent; exports.validationFieldMessages = validationFieldMessages; exports.variantFromQuery = variantFromQuery; exports.variantHref = variantHref;
1388
+
1389
+ exports.AddressTypes = _chunkQU4OFGKKjs.AddressTypes; exports.BehioApiError = _chunkQU4OFGKKjs.BehioApiError; exports.BehioNetworkError = _chunkQU4OFGKKjs.BehioNetworkError; exports.BehioStorefront = _chunkQU4OFGKKjs.BehioStorefront; exports.FormPopupClock = FormPopupClock; exports.FormPopupPreferences = FormPopupPreferences; exports.FulfillmentStatuses = _chunkQU4OFGKKjs.FulfillmentStatuses; exports.NEWSLETTER_REQUESTED_EVENT = NEWSLETTER_REQUESTED_EVENT; exports.OrderStatuses = _chunkQU4OFGKKjs.OrderStatuses; exports.PaymentStatuses = _chunkQU4OFGKKjs.PaymentStatuses; exports.ProductSort = _chunkQU4OFGKKjs.ProductSort; exports.VARIANT_QUERY_PARAM = VARIANT_QUERY_PARAM; exports.availableAxisValues = availableAxisValues; exports.buildVariantComparison = buildVariantComparison; exports.clearCartSummary = _chunkQU4OFGKKjs.clearCartSummary; exports.err = _chunkQU4OFGKKjs.err; exports.errorCode = errorCode; exports.errorMessage = errorMessage; exports.errorParams = errorParams; exports.findVariantByAttributes = findVariantByAttributes; exports.formFieldErrors = formFieldErrors; exports.formPopupRouteAllowed = formPopupRouteAllowed; exports.formatPrice = formatPrice; exports.generateVisitorId = generateVisitorId; exports.getStoredVisitorId = getStoredVisitorId; exports.grantAnalyticsConsent = grantAnalyticsConsent; exports.markNewsletterRequested = markNewsletterRequested; exports.matchesFormPath = matchesFormPath; exports.newsletterWasRequested = newsletterWasRequested; exports.ok = _chunkQU4OFGKKjs.ok; exports.publishCartSummary = _chunkQU4OFGKKjs.publishCartSummary; exports.resolveVariantContent = resolveVariantContent; exports.revokeAnalyticsConsent = revokeAnalyticsConsent; exports.toSdkError = _chunkQU4OFGKKjs.toSdkError; exports.trackEcommerceEvent = trackEcommerceEvent; exports.trustedVisitorIp = _chunkQU4OFGKKjs.trustedVisitorIp; exports.validationFieldMessages = validationFieldMessages; exports.variantFromQuery = variantFromQuery; exports.variantHref = variantHref;
package/dist/index.mjs CHANGED
@@ -11,8 +11,9 @@ import {
11
11
  err,
12
12
  ok,
13
13
  publishCartSummary,
14
- toSdkError
15
- } from "./chunk-25UM2XCS.mjs";
14
+ toSdkError,
15
+ trustedVisitorIp
16
+ } from "./chunk-SGMFDMIW.mjs";
16
17
 
17
18
  // src/react/utils/format-price.ts
18
19
  function formatPrice(amount, currency, locale, display) {
@@ -1381,6 +1382,7 @@ export {
1381
1382
  revokeAnalyticsConsent,
1382
1383
  toSdkError,
1383
1384
  trackEcommerceEvent,
1385
+ trustedVisitorIp,
1384
1386
  validationFieldMessages,
1385
1387
  variantFromQuery,
1386
1388
  variantHref
package/dist/next.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as BehioStorefrontConfig, B as BehioStorefront } from './client-DtAz0rDJ.mjs';
1
+ import { r as BehioStorefrontConfig, B as BehioStorefront } from './client-DeAREmgD.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 { r as BehioStorefrontConfig, B as BehioStorefront } from './client-DtAz0rDJ.js';
1
+ import { r as BehioStorefrontConfig, B as BehioStorefront } from './client-DeAREmgD.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,7 @@
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 _chunkOUPCGMSRjs = require('./chunk-OUPCGMSR.js');
3
+
4
+ var _chunkQU4OFGKKjs = require('./chunk-QU4OFGKK.js');
4
5
 
5
6
  // src/next.ts
6
7
  var _headers = require('next/headers');
@@ -19,7 +20,7 @@ async function getBehio(options = {}) {
19
20
  const locale = _nullishCoalesce(options.locale, () => ( process.env.BEHIO_LOCALE));
20
21
  const currency = _nullishCoalesce(options.currency, () => ( process.env.BEHIO_CURRENCY));
21
22
  const cookieName = _nullishCoalesce(options.cartCookieName, () => ( CART_COOKIE_NAME));
22
- const client = new (0, _chunkOUPCGMSRjs.BehioStorefront)({
23
+ const client = new (0, _chunkQU4OFGKKjs.BehioStorefront)({
23
24
  apiKey,
24
25
  ...baseUrl ? { baseUrl } : {},
25
26
  ...locale ? { locale } : {},
@@ -36,16 +37,14 @@ async function getBehio(options = {}) {
36
37
  }
37
38
  if (!options.visitorIp) {
38
39
  try {
39
- const h = await _headers.headers.call(void 0, );
40
- const xff = h.get("x-forwarded-for");
41
- const ip = (_nullishCoalesce(_nullishCoalesce(_optionalChain([xff, 'optionalAccess', _7 => _7.split, 'call', _8 => _8(","), 'access', _9 => _9[0]]), () => ( h.get("x-real-ip"))), () => ( ""))).trim();
40
+ const ip = _chunkQU4OFGKKjs.trustedVisitorIp.call(void 0, await _headers.headers.call(void 0, ), process.env.CF_ORIGIN_SECRET);
42
41
  if (ip) client.setVisitorIp(ip);
43
42
  } catch (e) {
44
43
  }
45
44
  }
46
45
  if (!currency) {
47
46
  const currencyCookieName = _nullishCoalesce(options.currencyCookieName, () => ( CURRENCY_COOKIE_NAME));
48
- const chosenCurrency = _optionalChain([cookieStore, 'access', _10 => _10.get, 'call', _11 => _11(currencyCookieName), 'optionalAccess', _12 => _12.value]);
47
+ const chosenCurrency = _optionalChain([cookieStore, 'access', _7 => _7.get, 'call', _8 => _8(currencyCookieName), 'optionalAccess', _9 => _9.value]);
49
48
  if (chosenCurrency) {
50
49
  client.setCurrency(chosenCurrency);
51
50
  }
package/dist/next.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
- BehioStorefront
3
- } from "./chunk-25UM2XCS.mjs";
2
+ BehioStorefront,
3
+ trustedVisitorIp
4
+ } from "./chunk-SGMFDMIW.mjs";
4
5
 
5
6
  // src/next.ts
6
7
  import { cookies, headers } from "next/headers";
@@ -36,9 +37,7 @@ async function getBehio(options = {}) {
36
37
  }
37
38
  if (!options.visitorIp) {
38
39
  try {
39
- const h = await headers();
40
- const xff = h.get("x-forwarded-for");
41
- const ip = (xff?.split(",")[0] ?? h.get("x-real-ip") ?? "").trim();
40
+ const ip = trustedVisitorIp(await headers(), process.env.CF_ORIGIN_SECRET);
42
41
  if (ip) client.setVisitorIp(ip);
43
42
  } catch {
44
43
  }
package/dist/react.d.mts CHANGED
@@ -357,12 +357,14 @@ interface NewsletterSubscribeInput {
357
357
  source?: string;
358
358
  /** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
359
359
  website?: string;
360
+ /** The consent wording shown to the visitor. Only its hash is stored, as proof. */
361
+ consentText?: string;
360
362
  }
361
363
  interface NewsletterSubscribeResult {
362
364
  success: boolean;
363
365
  /** Confirm the email before the subscription becomes active. */
364
366
  confirmationRequired?: boolean;
365
- /** True when this email was already an active subscriber. */
367
+ /** Always false: the answer never reveals who is on the list. */
366
368
  alreadySubscribed: boolean;
367
369
  }
368
370
  interface NewsletterConfirmResult {
@@ -372,6 +374,8 @@ interface NewsletterConfirmResult {
372
374
  }
373
375
  interface NewsletterUnsubscribeResult {
374
376
  success: boolean;
377
+ /** True for a bare email: its owner gets a signed link, nothing has changed yet. */
378
+ confirmationRequired: boolean;
375
379
  }
376
380
  interface ShopSeo {
377
381
  robotsTxt?: string | null;
@@ -1681,6 +1685,8 @@ interface CheckoutInput {
1681
1685
  termsConsent?: boolean;
1682
1686
  gdprConsent?: boolean;
1683
1687
  newsletterOptIn?: boolean;
1688
+ /** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
1689
+ newsletterConsentText?: string;
1684
1690
  /**
1685
1691
  * Consent to start delivering digital content (courses, downloads,
1686
1692
  * services) before the withdrawal period ends, which waives the right of
@@ -4695,8 +4701,8 @@ declare class ShippingModule {
4695
4701
  /**
4696
4702
  * First-party newsletter opt-in. Use for the footer signup block and the
4697
4703
  * checkout newsletter checkbox (render its default from
4698
- * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
4699
- * re-activates a previously unsubscribed email. Pass the hidden `website`
4704
+ * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
4705
+ * answer never reveals who is on the list. Pass the hidden `website`
4700
4706
  * honeypot field straight through from your form: a filled value is silently
4701
4707
  * accepted but stored nowhere.
4702
4708
  */
@@ -4705,7 +4711,14 @@ declare class NewsletterModule {
4705
4711
  constructor(client: BehioStorefront);
4706
4712
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
4707
4713
  confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
4714
+ /**
4715
+ * An address proves nothing, so this changes nothing yet: if the address is on
4716
+ * the list, its owner receives a signed link. The answer is the same either way.
4717
+ */
4708
4718
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4719
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
4720
+ unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4721
+ private requestUnsubscribe;
4709
4722
  }
4710
4723
 
4711
4724
  interface BehioContextValue {
@@ -5416,11 +5429,16 @@ declare function useAnalyticsEvents(): {
5416
5429
  * Subscribe an email to the shop newsletter (first-party opt-in, GAP-08).
5417
5430
  * Use for the footer signup block; the checkout opt-in checkbox goes through
5418
5431
  * the checkout input's `newsletterOptIn` instead. Subscribing is idempotent
5419
- * and re-activates a previously unsubscribed email.
5432
+ * and the answer never reveals who is on the list.
5420
5433
  */
5421
5434
  declare function useNewsletterSubscribe(): _tanstack_react_query.UseMutationResult<NewsletterSubscribeResult, Error, NewsletterSubscribeInput, unknown>;
5422
- /** Unsubscribe an email from the shop newsletter (idempotent). */
5423
- declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string, unknown>;
5435
+ /**
5436
+ * Opt-out. An email only sends its owner a signed link; `{token}` from a
5437
+ * newsletter e-mail unsubscribes at once.
5438
+ */
5439
+ declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string | {
5440
+ token: string;
5441
+ }, unknown>;
5424
5442
  /** Explicit confirmation only. Never call on page load or link prefetch. */
5425
5443
  declare function useNewsletterConfirm(): _tanstack_react_query.UseMutationResult<NewsletterConfirmResult, Error, string, unknown>;
5426
5444
 
package/dist/react.d.ts CHANGED
@@ -357,12 +357,14 @@ interface NewsletterSubscribeInput {
357
357
  source?: string;
358
358
  /** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
359
359
  website?: string;
360
+ /** The consent wording shown to the visitor. Only its hash is stored, as proof. */
361
+ consentText?: string;
360
362
  }
361
363
  interface NewsletterSubscribeResult {
362
364
  success: boolean;
363
365
  /** Confirm the email before the subscription becomes active. */
364
366
  confirmationRequired?: boolean;
365
- /** True when this email was already an active subscriber. */
367
+ /** Always false: the answer never reveals who is on the list. */
366
368
  alreadySubscribed: boolean;
367
369
  }
368
370
  interface NewsletterConfirmResult {
@@ -372,6 +374,8 @@ interface NewsletterConfirmResult {
372
374
  }
373
375
  interface NewsletterUnsubscribeResult {
374
376
  success: boolean;
377
+ /** True for a bare email: its owner gets a signed link, nothing has changed yet. */
378
+ confirmationRequired: boolean;
375
379
  }
376
380
  interface ShopSeo {
377
381
  robotsTxt?: string | null;
@@ -1681,6 +1685,8 @@ interface CheckoutInput {
1681
1685
  termsConsent?: boolean;
1682
1686
  gdprConsent?: boolean;
1683
1687
  newsletterOptIn?: boolean;
1688
+ /** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
1689
+ newsletterConsentText?: string;
1684
1690
  /**
1685
1691
  * Consent to start delivering digital content (courses, downloads,
1686
1692
  * services) before the withdrawal period ends, which waives the right of
@@ -4695,8 +4701,8 @@ declare class ShippingModule {
4695
4701
  /**
4696
4702
  * First-party newsletter opt-in. Use for the footer signup block and the
4697
4703
  * checkout newsletter checkbox (render its default from
4698
- * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
4699
- * re-activates a previously unsubscribed email. Pass the hidden `website`
4704
+ * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
4705
+ * answer never reveals who is on the list. Pass the hidden `website`
4700
4706
  * honeypot field straight through from your form: a filled value is silently
4701
4707
  * accepted but stored nowhere.
4702
4708
  */
@@ -4705,7 +4711,14 @@ declare class NewsletterModule {
4705
4711
  constructor(client: BehioStorefront);
4706
4712
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
4707
4713
  confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
4714
+ /**
4715
+ * An address proves nothing, so this changes nothing yet: if the address is on
4716
+ * the list, its owner receives a signed link. The answer is the same either way.
4717
+ */
4708
4718
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4719
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
4720
+ unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4721
+ private requestUnsubscribe;
4709
4722
  }
4710
4723
 
4711
4724
  interface BehioContextValue {
@@ -5416,11 +5429,16 @@ declare function useAnalyticsEvents(): {
5416
5429
  * Subscribe an email to the shop newsletter (first-party opt-in, GAP-08).
5417
5430
  * Use for the footer signup block; the checkout opt-in checkbox goes through
5418
5431
  * the checkout input's `newsletterOptIn` instead. Subscribing is idempotent
5419
- * and re-activates a previously unsubscribed email.
5432
+ * and the answer never reveals who is on the list.
5420
5433
  */
5421
5434
  declare function useNewsletterSubscribe(): _tanstack_react_query.UseMutationResult<NewsletterSubscribeResult, Error, NewsletterSubscribeInput, unknown>;
5422
- /** Unsubscribe an email from the shop newsletter (idempotent). */
5423
- declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string, unknown>;
5435
+ /**
5436
+ * Opt-out. An email only sends its owner a signed link; `{token}` from a
5437
+ * newsletter e-mail unsubscribes at once.
5438
+ */
5439
+ declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string | {
5440
+ token: string;
5441
+ }, unknown>;
5424
5442
  /** Explicit confirmation only. Never call on page load or link prefetch. */
5425
5443
  declare function useNewsletterConfirm(): _tanstack_react_query.UseMutationResult<NewsletterConfirmResult, Error, string, unknown>;
5426
5444
 
package/dist/react.js CHANGED
@@ -2421,12 +2421,23 @@ var NewsletterModule = class {
2421
2421
  auth: false
2422
2422
  });
2423
2423
  }
2424
+ /**
2425
+ * An address proves nothing, so this changes nothing yet: if the address is on
2426
+ * the list, its owner receives a signed link. The answer is the same either way.
2427
+ */
2424
2428
  async unsubscribe(email) {
2429
+ return this.requestUnsubscribe({ email });
2430
+ }
2431
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
2432
+ async unsubscribeWithToken(token) {
2433
+ return this.requestUnsubscribe({ token });
2434
+ }
2435
+ requestUnsubscribe(input) {
2425
2436
  return this.client.request(
2426
2437
  "POST",
2427
2438
  "/newsletter/unsubscribe",
2428
2439
  {
2429
- body: { email },
2440
+ body: input,
2430
2441
  auth: false
2431
2442
  }
2432
2443
  );
@@ -4108,7 +4119,9 @@ function useNewsletterSubscribe() {
4108
4119
  function useNewsletterUnsubscribe() {
4109
4120
  const { client } = useBehio();
4110
4121
  return (0, import_react_query30.useMutation)({
4111
- mutationFn: (email) => unwrap(client.newsletter.unsubscribe(email))
4122
+ mutationFn: (input) => unwrap(
4123
+ typeof input === "string" ? client.newsletter.unsubscribe(input) : client.newsletter.unsubscribeWithToken(input.token)
4124
+ )
4112
4125
  });
4113
4126
  }
4114
4127
  function useNewsletterConfirm() {
package/dist/react.mjs CHANGED
@@ -2295,12 +2295,23 @@ var NewsletterModule = class {
2295
2295
  auth: false
2296
2296
  });
2297
2297
  }
2298
+ /**
2299
+ * An address proves nothing, so this changes nothing yet: if the address is on
2300
+ * the list, its owner receives a signed link. The answer is the same either way.
2301
+ */
2298
2302
  async unsubscribe(email) {
2303
+ return this.requestUnsubscribe({ email });
2304
+ }
2305
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
2306
+ async unsubscribeWithToken(token) {
2307
+ return this.requestUnsubscribe({ token });
2308
+ }
2309
+ requestUnsubscribe(input) {
2299
2310
  return this.client.request(
2300
2311
  "POST",
2301
2312
  "/newsletter/unsubscribe",
2302
2313
  {
2303
- body: { email },
2314
+ body: input,
2304
2315
  auth: false
2305
2316
  }
2306
2317
  );
@@ -3982,7 +3993,9 @@ function useNewsletterSubscribe() {
3982
3993
  function useNewsletterUnsubscribe() {
3983
3994
  const { client } = useBehio();
3984
3995
  return useMutation11({
3985
- mutationFn: (email) => unwrap(client.newsletter.unsubscribe(email))
3996
+ mutationFn: (input) => unwrap(
3997
+ typeof input === "string" ? client.newsletter.unsubscribe(input) : client.newsletter.unsubscribeWithToken(input.token)
3998
+ )
3986
3999
  });
3987
4000
  }
3988
4001
  function useNewsletterConfirm() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behio/storefront-sdk",
3
- "version": "2.30.0",
3
+ "version": "2.31.0",
4
4
  "description": "TypeScript SDK for Behio headless e-commerce: core client + React hooks",
5
5
  "author": "Behio",
6
6
  "license": "MIT",