@shoppexio/storefront 1.0.71 → 1.0.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -41,10 +41,6 @@ interface ApiResponse<T> {
41
41
  error_code?: string | null;
42
42
  error_params?: Record<string, unknown> | null;
43
43
  }
44
- interface ApiChallenge {
45
- provider: 'turnstile';
46
- siteKey: string;
47
- }
48
44
  interface SDKResponse<T> {
49
45
  success: boolean;
50
46
  data?: T;
@@ -87,8 +83,6 @@ interface SDKResponse<T> {
87
83
  * received.
88
84
  */
89
85
  responseDefinitive?: boolean;
90
- /** A renewable human-verification challenge returned with a refusal. */
91
- challenge?: ApiChallenge;
92
86
  }
93
87
  interface Shop {
94
88
  id: string;
@@ -1395,6 +1389,8 @@ declare function mergeBaskets(items: CartBasketMergeLine[]): CartItem[];
1395
1389
  declare function moveBasketItem(fromProductId: string, fromVariantId: string, toProductId: string, toVariantId: string): void;
1396
1390
  declare function validateCartIntegrity(): boolean;
1397
1391
  declare function getCartStats(): CartStats;
1392
+ /** @internal — read by checkout(); exported only across module boundaries. */
1393
+ declare function getLatestQuoteToken(): string | null;
1398
1394
  declare function quoteCart(coupon?: string, currency?: string): Promise<src.SDKResponse<CartQuote>>;
1399
1395
 
1400
1396
  type CartLineIdentityInput = Pick<CartItem, 'product_id' | 'variant_id' | 'price_variant_id' | 'addons' | 'custom_fields' | 'price_data' | 'pay_what_you_want_price'>;
@@ -1421,14 +1417,11 @@ interface CheckoutOptions {
1421
1417
  */
1422
1418
  redirectUrl?: string;
1423
1419
  /**
1424
- * A Cloudflare Turnstile proof for the `storefront_checkout` action.
1425
- *
1426
- * Normally omitted. When checkout returns a challenge, mount the hosted
1427
- * broker with `mountCheckoutChallenge()` and retry with its renewed proof.
1428
- * The proof is transport-only and does not change the checkout intent or its
1429
- * idempotency key.
1420
+ * Pin the quote proof this hand-off submits, as a tri-state: `undefined`
1421
+ * lets the SDK read the latest settled quote from storage, `null` submits
1422
+ * explicitly none, and a string submits exactly that token.
1430
1423
  */
1431
- turnstileToken?: string;
1424
+ quoteToken?: string | null;
1432
1425
  /**
1433
1426
  * Referral (affiliate) code to submit, as a tri-state:
1434
1427
  *
@@ -1499,28 +1492,24 @@ interface CheckoutResult {
1499
1492
  * cart caught client-side).
1500
1493
  */
1501
1494
  code?: string;
1502
- /**
1503
- * Human-verification challenge required before creating the invoice. Mount
1504
- * it with `mountCheckoutChallenge()`, then retry with its proof as
1505
- * `turnstileToken`.
1506
- */
1507
- challenge?: ApiChallenge;
1508
1495
  }
1509
1496
  /**
1510
1497
  * Typed refusal from {@link buildCheckoutUrl}. The function keeps its existing
1511
- * throw-based contract while exposing a server-requested human-verification
1512
- * challenge so callers can render it and retry with `turnstileToken`.
1498
+ * throw-based contract while preserving the server error code and status.
1513
1499
  */
1514
1500
  declare class CheckoutCreateError extends Error {
1515
- readonly challenge?: ApiChallenge;
1516
1501
  readonly code?: string;
1517
1502
  readonly status?: number;
1518
1503
  constructor(message: string, options?: {
1519
- challenge?: ApiChallenge;
1520
1504
  code?: string;
1521
1505
  status?: number;
1522
1506
  });
1523
1507
  }
1508
+ /**
1509
+ * The currency an option-less checkout would request right now (location,
1510
+ * then config).
1511
+ */
1512
+ declare function getRequestedCheckoutCurrency(): string | null;
1524
1513
  declare function checkout(couponOrOptions?: string | CheckoutOptions, options?: CheckoutOptions): Promise<CheckoutResult>;
1525
1514
  /**
1526
1515
  * Build checkout URL by creating invoice first.
@@ -1545,19 +1534,6 @@ declare function buildCheckoutUrl(couponOrOptions?: string | CheckoutOptions, op
1545
1534
  */
1546
1535
  declare function buildCheckoutUrlSync(): never;
1547
1536
 
1548
- interface CheckoutChallengeCallbacks {
1549
- onSuccess(token: string): void;
1550
- onExpired?(): void;
1551
- onUnavailable?(): void;
1552
- /** Fired when the widget switches between the invisible run and an interactive challenge. */
1553
- onVisibilityChange?(visible: boolean): void;
1554
- }
1555
- interface CheckoutChallengeFrame {
1556
- element: HTMLIFrameElement;
1557
- dispose(): void;
1558
- }
1559
- declare function mountCheckoutChallenge(container: HTMLElement, challenge: ApiChallenge, callbacks: CheckoutChallengeCallbacks): CheckoutChallengeFrame;
1560
-
1561
1537
  interface SearchOptions {
1562
1538
  hideOutOfStock?: boolean;
1563
1539
  maxResults?: number;
@@ -1906,11 +1882,12 @@ declare const shoppex: {
1906
1882
  getCartStats: typeof getCartStats;
1907
1883
  validateCartIntegrity: typeof validateCartIntegrity;
1908
1884
  quoteCart: typeof quoteCart;
1885
+ getLatestQuoteToken: typeof getLatestQuoteToken;
1909
1886
  resolveCartLineId: typeof resolveCartLineId;
1910
1887
  checkout: typeof checkout;
1911
1888
  buildCheckoutUrl: typeof buildCheckoutUrl;
1912
1889
  buildCheckoutUrlSync: typeof buildCheckoutUrlSync;
1913
- mountCheckoutChallenge: typeof mountCheckoutChallenge;
1890
+ getRequestedCheckoutCurrency: typeof getRequestedCheckoutCurrency;
1914
1891
  captureAffiliateFromUrl: typeof captureAffiliateFromUrl;
1915
1892
  validateAffiliateCode: typeof validateAffiliateCode;
1916
1893
  applyAffiliateCode: typeof applyAffiliateCode;
@@ -1989,4 +1966,4 @@ declare const shoppex: {
1989
1966
  mergeSettings: typeof mergeSettings;
1990
1967
  };
1991
1968
 
1992
- export { type AffiliateValidation, type ApiChallenge, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, type CheckoutChallengeCallbacks, type CheckoutChallengeFrame, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerEmailPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, mountCheckoutChallenge, normalizeSearchQuery, normalizeStorefrontCustomFields, order, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackPageView, updateAvatar, updateEmailPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
1969
+ export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerEmailPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, order, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackPageView, updateAvatar, updateEmailPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
package/dist/index.d.ts CHANGED
@@ -41,10 +41,6 @@ interface ApiResponse<T> {
41
41
  error_code?: string | null;
42
42
  error_params?: Record<string, unknown> | null;
43
43
  }
44
- interface ApiChallenge {
45
- provider: 'turnstile';
46
- siteKey: string;
47
- }
48
44
  interface SDKResponse<T> {
49
45
  success: boolean;
50
46
  data?: T;
@@ -87,8 +83,6 @@ interface SDKResponse<T> {
87
83
  * received.
88
84
  */
89
85
  responseDefinitive?: boolean;
90
- /** A renewable human-verification challenge returned with a refusal. */
91
- challenge?: ApiChallenge;
92
86
  }
93
87
  interface Shop {
94
88
  id: string;
@@ -1395,6 +1389,8 @@ declare function mergeBaskets(items: CartBasketMergeLine[]): CartItem[];
1395
1389
  declare function moveBasketItem(fromProductId: string, fromVariantId: string, toProductId: string, toVariantId: string): void;
1396
1390
  declare function validateCartIntegrity(): boolean;
1397
1391
  declare function getCartStats(): CartStats;
1392
+ /** @internal — read by checkout(); exported only across module boundaries. */
1393
+ declare function getLatestQuoteToken(): string | null;
1398
1394
  declare function quoteCart(coupon?: string, currency?: string): Promise<src.SDKResponse<CartQuote>>;
1399
1395
 
1400
1396
  type CartLineIdentityInput = Pick<CartItem, 'product_id' | 'variant_id' | 'price_variant_id' | 'addons' | 'custom_fields' | 'price_data' | 'pay_what_you_want_price'>;
@@ -1421,14 +1417,11 @@ interface CheckoutOptions {
1421
1417
  */
1422
1418
  redirectUrl?: string;
1423
1419
  /**
1424
- * A Cloudflare Turnstile proof for the `storefront_checkout` action.
1425
- *
1426
- * Normally omitted. When checkout returns a challenge, mount the hosted
1427
- * broker with `mountCheckoutChallenge()` and retry with its renewed proof.
1428
- * The proof is transport-only and does not change the checkout intent or its
1429
- * idempotency key.
1420
+ * Pin the quote proof this hand-off submits, as a tri-state: `undefined`
1421
+ * lets the SDK read the latest settled quote from storage, `null` submits
1422
+ * explicitly none, and a string submits exactly that token.
1430
1423
  */
1431
- turnstileToken?: string;
1424
+ quoteToken?: string | null;
1432
1425
  /**
1433
1426
  * Referral (affiliate) code to submit, as a tri-state:
1434
1427
  *
@@ -1499,28 +1492,24 @@ interface CheckoutResult {
1499
1492
  * cart caught client-side).
1500
1493
  */
1501
1494
  code?: string;
1502
- /**
1503
- * Human-verification challenge required before creating the invoice. Mount
1504
- * it with `mountCheckoutChallenge()`, then retry with its proof as
1505
- * `turnstileToken`.
1506
- */
1507
- challenge?: ApiChallenge;
1508
1495
  }
1509
1496
  /**
1510
1497
  * Typed refusal from {@link buildCheckoutUrl}. The function keeps its existing
1511
- * throw-based contract while exposing a server-requested human-verification
1512
- * challenge so callers can render it and retry with `turnstileToken`.
1498
+ * throw-based contract while preserving the server error code and status.
1513
1499
  */
1514
1500
  declare class CheckoutCreateError extends Error {
1515
- readonly challenge?: ApiChallenge;
1516
1501
  readonly code?: string;
1517
1502
  readonly status?: number;
1518
1503
  constructor(message: string, options?: {
1519
- challenge?: ApiChallenge;
1520
1504
  code?: string;
1521
1505
  status?: number;
1522
1506
  });
1523
1507
  }
1508
+ /**
1509
+ * The currency an option-less checkout would request right now (location,
1510
+ * then config).
1511
+ */
1512
+ declare function getRequestedCheckoutCurrency(): string | null;
1524
1513
  declare function checkout(couponOrOptions?: string | CheckoutOptions, options?: CheckoutOptions): Promise<CheckoutResult>;
1525
1514
  /**
1526
1515
  * Build checkout URL by creating invoice first.
@@ -1545,19 +1534,6 @@ declare function buildCheckoutUrl(couponOrOptions?: string | CheckoutOptions, op
1545
1534
  */
1546
1535
  declare function buildCheckoutUrlSync(): never;
1547
1536
 
1548
- interface CheckoutChallengeCallbacks {
1549
- onSuccess(token: string): void;
1550
- onExpired?(): void;
1551
- onUnavailable?(): void;
1552
- /** Fired when the widget switches between the invisible run and an interactive challenge. */
1553
- onVisibilityChange?(visible: boolean): void;
1554
- }
1555
- interface CheckoutChallengeFrame {
1556
- element: HTMLIFrameElement;
1557
- dispose(): void;
1558
- }
1559
- declare function mountCheckoutChallenge(container: HTMLElement, challenge: ApiChallenge, callbacks: CheckoutChallengeCallbacks): CheckoutChallengeFrame;
1560
-
1561
1537
  interface SearchOptions {
1562
1538
  hideOutOfStock?: boolean;
1563
1539
  maxResults?: number;
@@ -1906,11 +1882,12 @@ declare const shoppex: {
1906
1882
  getCartStats: typeof getCartStats;
1907
1883
  validateCartIntegrity: typeof validateCartIntegrity;
1908
1884
  quoteCart: typeof quoteCart;
1885
+ getLatestQuoteToken: typeof getLatestQuoteToken;
1909
1886
  resolveCartLineId: typeof resolveCartLineId;
1910
1887
  checkout: typeof checkout;
1911
1888
  buildCheckoutUrl: typeof buildCheckoutUrl;
1912
1889
  buildCheckoutUrlSync: typeof buildCheckoutUrlSync;
1913
- mountCheckoutChallenge: typeof mountCheckoutChallenge;
1890
+ getRequestedCheckoutCurrency: typeof getRequestedCheckoutCurrency;
1914
1891
  captureAffiliateFromUrl: typeof captureAffiliateFromUrl;
1915
1892
  validateAffiliateCode: typeof validateAffiliateCode;
1916
1893
  applyAffiliateCode: typeof applyAffiliateCode;
@@ -1989,4 +1966,4 @@ declare const shoppex: {
1989
1966
  mergeSettings: typeof mergeSettings;
1990
1967
  };
1991
1968
 
1992
- export { type AffiliateValidation, type ApiChallenge, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, type CheckoutChallengeCallbacks, type CheckoutChallengeFrame, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerEmailPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, mountCheckoutChallenge, normalizeSearchQuery, normalizeStorefrontCustomFields, order, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackPageView, updateAvatar, updateEmailPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
1969
+ export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerEmailPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, order, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackPageView, updateAvatar, updateEmailPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  union,
23
23
  unknown,
24
24
  url
25
- } from "./chunk-ZVOFFURI.js";
25
+ } from "./chunk-UHEFHGZ3.js";
26
26
 
27
27
  // ../sdk/src/core/cache.ts
28
28
  var cache = /* @__PURE__ */ new Map();
@@ -161,7 +161,7 @@ var CartError = class _CartError extends ShoppexError {
161
161
  }
162
162
  };
163
163
 
164
- // ../../node_modules/.bun/openapi-fetch@0.17.0/node_modules/openapi-fetch/dist/index.mjs
164
+ // ../../../../../node_modules/.bun/openapi-fetch@0.17.0/node_modules/openapi-fetch/dist/index.mjs
165
165
  var PATH_PARAM_RE = /\{[^{}]+\}/g;
166
166
  var supportsRequestInitExt = () => {
167
167
  return typeof process === "object" && Number.parseInt(process?.versions?.node?.substring(0, 2)) >= 18 && process.versions.undici;
@@ -3183,7 +3183,6 @@ async function request(endpoint, options = {}) {
3183
3183
  for (let attempt = 0; attempt <= retryCount; attempt++) {
3184
3184
  let responseReceived = false;
3185
3185
  let responseDefinitive = false;
3186
- let responseChallenge;
3187
3186
  try {
3188
3187
  const controller = new AbortController();
3189
3188
  const timeoutId = setTimeout(() => controller.abort(), timeout);
@@ -3196,7 +3195,6 @@ async function request(endpoint, options = {}) {
3196
3195
  responseReceived = true;
3197
3196
  clearTimeout(timeoutId);
3198
3197
  const payload = await parseResponsePayload(response);
3199
- responseChallenge = readResponseChallenge(payload.data);
3200
3198
  if (!response.ok) {
3201
3199
  responseDefinitive = isDefinitiveHttpRefusal(payload.data) && response.status >= 400 && response.status < 500 && response.status !== 408;
3202
3200
  const fallbackHttpMessage = response.statusText ? `HTTP ${response.status}: ${response.statusText}` : `HTTP ${response.status}`;
@@ -3221,8 +3219,7 @@ async function request(endpoint, options = {}) {
3221
3219
  ...mapped,
3222
3220
  responseReceived: true,
3223
3221
  responseDefinitive: data.status >= 400 && data.status < 500 && data.status !== 408,
3224
- status: response.status,
3225
- ...responseChallenge ? { challenge: responseChallenge } : {}
3222
+ status: response.status
3226
3223
  };
3227
3224
  } catch (error) {
3228
3225
  let normalizedError = error instanceof Error ? error : new Error(String(error));
@@ -3236,7 +3233,6 @@ async function request(endpoint, options = {}) {
3236
3233
  isTransport: statusCode === void 0 || statusCode === 408,
3237
3234
  responseReceived,
3238
3235
  responseDefinitive,
3239
- ...responseChallenge ? { challenge: responseChallenge } : {},
3240
3236
  ...normalizedError instanceof ApiError ? {
3241
3237
  code: normalizedError.code,
3242
3238
  ...normalizedError.errorParams ? { errorParams: normalizedError.errorParams } : {}
@@ -3258,7 +3254,6 @@ async function request(endpoint, options = {}) {
3258
3254
  ...lastFailure ? { responseReceived: lastFailure.responseReceived } : {},
3259
3255
  ...lastFailure?.responseDefinitive ? { responseDefinitive: true } : {},
3260
3256
  ...lastFailure?.responseReceived && lastFailure.statusCode !== void 0 ? { status: lastFailure.statusCode } : {},
3261
- ...lastFailure?.challenge ? { challenge: lastFailure.challenge } : {},
3262
3257
  ...lastFailure?.code ? { code: lastFailure.code } : {},
3263
3258
  ...lastFailure?.errorParams ? { errorParams: lastFailure.errorParams } : {}
3264
3259
  };
@@ -3319,25 +3314,6 @@ async function parseResponsePayload(response) {
3319
3314
  return { data: null, rawText: null };
3320
3315
  }
3321
3316
  }
3322
- function readResponseChallenge(payload) {
3323
- if (!payload || typeof payload !== "object") {
3324
- return void 0;
3325
- }
3326
- const data = payload.data;
3327
- if (!data || typeof data !== "object") {
3328
- return void 0;
3329
- }
3330
- const challenge = data.challenge;
3331
- if (!challenge || typeof challenge !== "object") {
3332
- return void 0;
3333
- }
3334
- const provider = challenge.provider;
3335
- const siteKey = challenge.site_key;
3336
- if (provider !== "turnstile" || typeof siteKey !== "string" || !siteKey.trim()) {
3337
- return void 0;
3338
- }
3339
- return { provider, siteKey: siteKey.trim() };
3340
- }
3341
3317
  function isDefinitiveHttpRefusal(payload) {
3342
3318
  if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
3343
3319
  return false;
@@ -4539,158 +4515,11 @@ async function quoteCart(coupon, currency) {
4539
4515
  return response;
4540
4516
  }
4541
4517
 
4542
- // ../sdk/src/modules/checkout-challenge.ts
4543
- var TURNSTILE_FRAME_MESSAGE_SOURCE = "shoppex-turnstile";
4544
- var TURNSTILE_FRAME_MESSAGE_VERSION = 1;
4545
- var TURNSTILE_FRAME_READY_TIMEOUT_MS = 1e4;
4546
- function readFrameMessage(value, nonce) {
4547
- if (!value || typeof value !== "object" || Array.isArray(value)) return null;
4548
- const record2 = value;
4549
- if (record2.source !== TURNSTILE_FRAME_MESSAGE_SOURCE || record2.version !== TURNSTILE_FRAME_MESSAGE_VERSION || record2.nonce !== nonce || !["ready", "visible", "hidden", "success", "expired", "timeout", "error"].includes(String(record2.type))) return null;
4550
- if (record2.type === "success" && (typeof record2.token !== "string" || !record2.token.trim())) {
4551
- return null;
4552
- }
4553
- return {
4554
- type: record2.type,
4555
- ...typeof record2.token === "string" ? { token: record2.token.trim() } : {}
4556
- };
4557
- }
4558
- var AUTO_CHALLENGE_INVISIBLE_TIMEOUT_MS = 3e4;
4559
- async function resolveCheckoutChallengeProof(challenge) {
4560
- if (typeof document === "undefined" || challenge.provider !== "turnstile" || !challenge.siteKey.trim()) {
4561
- return null;
4562
- }
4563
- const host = document.createElement("div");
4564
- host.setAttribute("data-shoppex-checkout-challenge", "");
4565
- host.style.position = "fixed";
4566
- host.style.inset = "0";
4567
- host.style.display = "none";
4568
- host.style.alignItems = "center";
4569
- host.style.justifyContent = "center";
4570
- host.style.background = "rgba(0, 0, 0, 0.55)";
4571
- host.style.zIndex = "2147483646";
4572
- const card = document.createElement("div");
4573
- card.style.width = "min(340px, 90vw)";
4574
- card.style.background = "#ffffff";
4575
- card.style.borderRadius = "12px";
4576
- card.style.padding = "16px";
4577
- card.style.boxShadow = "0 12px 40px rgba(0, 0, 0, 0.35)";
4578
- host.appendChild(card);
4579
- document.body.appendChild(host);
4580
- return new Promise((resolve) => {
4581
- let settled = false;
4582
- let timeoutId = null;
4583
- let frame = null;
4584
- const finish = (token) => {
4585
- if (settled) return;
4586
- settled = true;
4587
- if (timeoutId !== null) window.clearTimeout(timeoutId);
4588
- frame?.dispose();
4589
- host.remove();
4590
- resolve(token);
4591
- };
4592
- const armTimeout = () => {
4593
- timeoutId = window.setTimeout(() => finish(null), AUTO_CHALLENGE_INVISIBLE_TIMEOUT_MS);
4594
- };
4595
- try {
4596
- frame = mountCheckoutChallenge(card, challenge, {
4597
- onSuccess: (token) => finish(token),
4598
- // `refresh-expired: auto` renews expired runs on its own; the
4599
- // invisible-run timeout stays the bound.
4600
- onExpired: () => {
4601
- },
4602
- onUnavailable: () => finish(null),
4603
- onVisibilityChange: (visible) => {
4604
- host.style.display = visible ? "flex" : "none";
4605
- if (visible) {
4606
- if (timeoutId !== null) {
4607
- window.clearTimeout(timeoutId);
4608
- timeoutId = null;
4609
- }
4610
- } else if (timeoutId === null && !settled) {
4611
- armTimeout();
4612
- }
4613
- }
4614
- });
4615
- } catch {
4616
- host.remove();
4617
- resolve(null);
4618
- return;
4619
- }
4620
- armTimeout();
4621
- });
4622
- }
4623
- function mountCheckoutChallenge(container, challenge, callbacks) {
4624
- if (challenge.provider !== "turnstile" || !challenge.siteKey.trim()) {
4625
- throw new Error("Checkout challenge is invalid.");
4626
- }
4627
- const win = container.ownerDocument.defaultView;
4628
- if (!win) throw new Error("Checkout challenge requires a browser document.");
4629
- const checkoutBaseUrl = getConfig().checkoutBaseUrl;
4630
- const frameUrl = new URL("/turnstile", checkoutBaseUrl);
4631
- if (frameUrl.protocol !== "https:" && frameUrl.protocol !== "http:") {
4632
- throw new Error("Checkout base URL must use http or https.");
4633
- }
4634
- const nonce = win.crypto.randomUUID();
4635
- frameUrl.searchParams.set("site_key", challenge.siteKey.trim());
4636
- frameUrl.searchParams.set("nonce", nonce);
4637
- const frame = container.ownerDocument.createElement("iframe");
4638
- frame.src = frameUrl.toString();
4639
- frame.title = "Checkout verification";
4640
- frame.referrerPolicy = "no-referrer";
4641
- frame.style.border = "0";
4642
- frame.style.width = "100%";
4643
- frame.style.height = "0";
4644
- let disposed = false;
4645
- let ready = false;
4646
- const readyTimeout = win.setTimeout(() => {
4647
- if (!disposed && !ready) callbacks.onUnavailable?.();
4648
- }, TURNSTILE_FRAME_READY_TIMEOUT_MS);
4649
- const onMessage = (event) => {
4650
- if (disposed || event.origin !== frameUrl.origin || event.source !== frame.contentWindow) return;
4651
- const message = readFrameMessage(event.data, nonce);
4652
- if (!message) return;
4653
- ready = true;
4654
- win.clearTimeout(readyTimeout);
4655
- if (message.type === "visible") {
4656
- frame.style.height = "72px";
4657
- callbacks.onVisibilityChange?.(true);
4658
- }
4659
- if (message.type === "hidden") {
4660
- frame.style.height = "0";
4661
- callbacks.onVisibilityChange?.(false);
4662
- }
4663
- if (message.type === "success") {
4664
- frame.style.height = "0";
4665
- callbacks.onVisibilityChange?.(false);
4666
- callbacks.onSuccess(message.token);
4667
- }
4668
- if (message.type === "expired" || message.type === "timeout") callbacks.onExpired?.();
4669
- if (message.type === "error") callbacks.onUnavailable?.();
4670
- };
4671
- const onFrameError = () => callbacks.onUnavailable?.();
4672
- win.addEventListener("message", onMessage);
4673
- frame.addEventListener("error", onFrameError, { once: true });
4674
- container.appendChild(frame);
4675
- return {
4676
- element: frame,
4677
- dispose() {
4678
- if (disposed) return;
4679
- disposed = true;
4680
- win.clearTimeout(readyTimeout);
4681
- win.removeEventListener("message", onMessage);
4682
- frame.removeEventListener("error", onFrameError);
4683
- frame.remove();
4684
- }
4685
- };
4686
- }
4687
-
4688
4518
  // ../sdk/src/modules/checkout.ts
4689
4519
  var CheckoutCreateError = class _CheckoutCreateError extends Error {
4690
4520
  constructor(message, options = {}) {
4691
4521
  super(message);
4692
4522
  this.name = "CheckoutCreateError";
4693
- this.challenge = options.challenge;
4694
4523
  this.code = options.code;
4695
4524
  this.status = options.status;
4696
4525
  Object.setPrototypeOf(this, _CheckoutCreateError.prototype);
@@ -4741,7 +4570,7 @@ function acquireCheckoutCreateIdempotency(requestTarget, createIntent) {
4741
4570
  return attempt;
4742
4571
  }
4743
4572
  function releaseCheckoutCreateIdempotency(attempt, outcomeDefinitive) {
4744
- if (outcomeDefinitive && pendingCheckoutCreates.get(attempt.fingerprint) === attempt) {
4573
+ if (outcomeDefinitive && pendingCheckoutCreates.get(attempt.fingerprint)?.key === attempt.key) {
4745
4574
  pendingCheckoutCreates.delete(attempt.fingerprint);
4746
4575
  }
4747
4576
  }
@@ -4755,7 +4584,13 @@ function resolveCustomerCheckoutRequestTarget(options) {
4755
4584
  return { endpoint: "/v1/storefront/invoices/from-cart" };
4756
4585
  }
4757
4586
  function resolveRequestedCheckoutCurrency(options) {
4758
- return normalizeRequestedCurrency(options.currency) ?? getRequestedCurrencyFromLocation() ?? normalizeRequestedCurrency(getConfig().currency);
4587
+ if (options.currency !== void 0) {
4588
+ return normalizeRequestedCurrency(options.currency);
4589
+ }
4590
+ return getRequestedCurrencyFromLocation() ?? normalizeRequestedCurrency(getConfig().currency);
4591
+ }
4592
+ function getRequestedCheckoutCurrency() {
4593
+ return getRequestedCurrencyFromLocation() ?? normalizeRequestedCurrency(getConfig().currency);
4759
4594
  }
4760
4595
  function normalizeCheckoutFailureMessage(rawMessage) {
4761
4596
  const message = rawMessage?.trim() ?? "";
@@ -4927,14 +4762,7 @@ function mapCartItemsForApi(items) {
4927
4762
  }
4928
4763
  async function checkout(couponOrOptions, options) {
4929
4764
  const resolvedOptions = resolveCheckoutOptions(couponOrOptions, options);
4930
- const firstAttempt = await performCheckout(resolvedOptions);
4931
- if (!firstAttempt.success && firstAttempt.challenge?.provider === "turnstile" && !resolvedOptions.turnstileToken && typeof document !== "undefined") {
4932
- const proof = await resolveCheckoutChallengeProof(firstAttempt.challenge);
4933
- if (proof) {
4934
- return performCheckout({ ...resolvedOptions, turnstileToken: proof });
4935
- }
4936
- }
4937
- return firstAttempt;
4765
+ return performCheckout(resolvedOptions);
4938
4766
  }
4939
4767
  async function performCheckout(resolvedOptions) {
4940
4768
  const { autoRedirect = true, email: email2 } = resolvedOptions;
@@ -4978,16 +4806,12 @@ async function performCheckout(resolvedOptions) {
4978
4806
  // automatically so the server can refuse an invoice priced above it.
4979
4807
  // Undefined when nothing has been quoted this session — the endpoint
4980
4808
  // treats that exactly as an older SDK.
4981
- quote_token: getLatestQuoteToken() ?? void 0
4982
- };
4983
- const createCommand = {
4984
- ...createIntent,
4985
- turnstile_token: resolvedOptions.turnstileToken?.trim() || void 0
4809
+ quote_token: resolvedOptions.quoteToken !== void 0 ? resolvedOptions.quoteToken ?? void 0 : getLatestQuoteToken() ?? void 0
4986
4810
  };
4987
4811
  const createAttempt = acquireCheckoutCreateIdempotency(checkoutRequestTarget, createIntent);
4988
4812
  const response = await post(
4989
4813
  checkoutRequestTarget.endpoint,
4990
- createCommand,
4814
+ createIntent,
4991
4815
  {
4992
4816
  retries: 0,
4993
4817
  baseUrl: checkoutRequestTarget.baseUrl,
@@ -5007,8 +4831,7 @@ async function performCheckout(resolvedOptions) {
5007
4831
  // The server's machine-readable refusal, preserved so callers can react
5008
4832
  // to e.g. `errors.checkout.price_increased_since_quote` without matching
5009
4833
  // localized copy.
5010
- ...response.code ? { code: response.code } : {},
5011
- ...response.challenge ? { challenge: response.challenge } : {}
4834
+ ...response.code ? { code: response.code } : {}
5012
4835
  };
5013
4836
  }
5014
4837
  const checkoutData = normalizeCheckoutResponse(response.data, config.checkoutBaseUrl);
@@ -5054,17 +4877,7 @@ async function performCheckout(resolvedOptions) {
5054
4877
  }
5055
4878
  async function buildCheckoutUrl(couponOrOptions, options) {
5056
4879
  const resolvedOptions = resolveCheckoutOptions(couponOrOptions, options);
5057
- try {
5058
- return await performBuildCheckoutUrl(resolvedOptions);
5059
- } catch (error) {
5060
- if (error instanceof CheckoutCreateError && error.challenge?.provider === "turnstile" && !resolvedOptions.turnstileToken && typeof document !== "undefined") {
5061
- const proof = await resolveCheckoutChallengeProof(error.challenge);
5062
- if (proof) {
5063
- return performBuildCheckoutUrl({ ...resolvedOptions, turnstileToken: proof });
5064
- }
5065
- }
5066
- throw error;
5067
- }
4880
+ return performBuildCheckoutUrl(resolvedOptions);
5068
4881
  }
5069
4882
  async function performBuildCheckoutUrl(resolvedOptions) {
5070
4883
  const { email: email2 } = resolvedOptions;
@@ -5100,16 +4913,12 @@ async function performBuildCheckoutUrl(resolvedOptions) {
5100
4913
  // token here left a public path on which the server had nothing to check
5101
4914
  // the invoice against. Same optional semantics: undefined when nothing
5102
4915
  // was quoted this session.
5103
- quote_token: getLatestQuoteToken() ?? void 0
5104
- };
5105
- const createCommand = {
5106
- ...createIntent,
5107
- turnstile_token: resolvedOptions.turnstileToken?.trim() || void 0
4916
+ quote_token: resolvedOptions.quoteToken !== void 0 ? resolvedOptions.quoteToken ?? void 0 : getLatestQuoteToken() ?? void 0
5108
4917
  };
5109
4918
  const createAttempt = acquireCheckoutCreateIdempotency(checkoutRequestTarget, createIntent);
5110
4919
  const response = await post(
5111
4920
  checkoutRequestTarget.endpoint,
5112
- createCommand,
4921
+ createIntent,
5113
4922
  {
5114
4923
  retries: 0,
5115
4924
  baseUrl: checkoutRequestTarget.baseUrl,
@@ -5124,7 +4933,6 @@ async function performBuildCheckoutUrl(resolvedOptions) {
5124
4933
  clearCart();
5125
4934
  }
5126
4935
  throw new CheckoutCreateError(normalizeCheckoutFailureMessage(response.message), {
5127
- ...response.challenge ? { challenge: response.challenge } : {},
5128
4936
  ...response.code ? { code: response.code } : {},
5129
4937
  ...response.status !== void 0 ? { status: response.status } : {}
5130
4938
  });
@@ -6159,12 +5967,13 @@ var shoppex = {
6159
5967
  getCartStats,
6160
5968
  validateCartIntegrity,
6161
5969
  quoteCart,
5970
+ getLatestQuoteToken,
6162
5971
  resolveCartLineId,
6163
5972
  // Checkout
6164
5973
  checkout,
6165
5974
  buildCheckoutUrl,
6166
5975
  buildCheckoutUrlSync,
6167
- mountCheckoutChallenge,
5976
+ getRequestedCheckoutCurrency,
6168
5977
  // Affiliates
6169
5978
  captureAffiliateFromUrl,
6170
5979
  validateAffiliateCode,
@@ -6313,7 +6122,6 @@ export {
6313
6122
  loyalty,
6314
6123
  me,
6315
6124
  mergeSettings,
6316
- mountCheckoutChallenge,
6317
6125
  normalizeSearchQuery,
6318
6126
  normalizeStorefrontCustomFields,
6319
6127
  order,