@shoppexio/storefront 1.0.71 → 1.0.73

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
@@ -10,12 +10,21 @@ export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, P
10
10
  interface ShoppexConfig {
11
11
  storeSlug: string;
12
12
  locale?: string;
13
+ /** Normalized (upper-case ISO 4217) buyer currency, or undefined when unset. */
13
14
  currency?: string;
14
15
  apiBaseUrl?: string;
15
16
  checkoutBaseUrl?: string;
16
17
  }
17
18
  interface ShoppexInitOptions {
18
19
  locale?: string;
20
+ /**
21
+ * Buyer currency for every priced read (storefront, products, product) and
22
+ * for cart quotes and checkout. Must be one of the currencies enabled in
23
+ * the shop's settings: the API prices in it or refuses with
24
+ * `errors.storefront.currency_unavailable` (listing the enabled ones) —
25
+ * it never silently falls back to the shop default. Omit it to let the
26
+ * shop's own default / country auto-detection decide.
27
+ */
19
28
  currency?: string;
20
29
  apiBaseUrl?: string;
21
30
  checkoutBaseUrl?: string;
@@ -41,10 +50,6 @@ interface ApiResponse<T> {
41
50
  error_code?: string | null;
42
51
  error_params?: Record<string, unknown> | null;
43
52
  }
44
- interface ApiChallenge {
45
- provider: 'turnstile';
46
- siteKey: string;
47
- }
48
53
  interface SDKResponse<T> {
49
54
  success: boolean;
50
55
  data?: T;
@@ -87,8 +92,6 @@ interface SDKResponse<T> {
87
92
  * received.
88
93
  */
89
94
  responseDefinitive?: boolean;
90
- /** A renewable human-verification challenge returned with a refusal. */
91
- challenge?: ApiChallenge;
92
95
  }
93
96
  interface Shop {
94
97
  id: string;
@@ -107,7 +110,20 @@ interface Shop {
107
110
  products_sold_count?: number;
108
111
  customers_count?: number;
109
112
  hide_products_sold?: boolean;
113
+ /**
114
+ * The currency THIS response is priced in: the requested one, else the
115
+ * shop default or its country auto-detection. Every `price` in the same
116
+ * payload is denominated in it.
117
+ */
110
118
  currency: string;
119
+ /** The merchant's configured default currency. */
120
+ default_currency?: string;
121
+ /**
122
+ * Currencies the merchant enabled, exactly as stored (an array, or the
123
+ * legacy comma-separated string). Empty means "default only". A
124
+ * `currency` request outside this set is refused.
125
+ */
126
+ available_currencies?: string[] | string | null;
111
127
  tos_enabled?: boolean;
112
128
  dark_mode?: boolean;
113
129
  search_enabled?: boolean;
@@ -1058,6 +1074,12 @@ declare function getTypedClient(token?: string): ApiClient;
1058
1074
  /**
1059
1075
  * SDK Error Classes
1060
1076
  */
1077
+ /**
1078
+ * `SDKResponse.code` of a priced read that asked for a currency the shop does
1079
+ * not sell in (ADR-0066). `errorParams.requested` names the currency,
1080
+ * `errorParams.available` lists the enabled ones.
1081
+ */
1082
+ declare const CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
1061
1083
  declare class ShoppexError extends Error {
1062
1084
  readonly code: string;
1063
1085
  readonly statusCode?: number;
@@ -1395,6 +1417,8 @@ declare function mergeBaskets(items: CartBasketMergeLine[]): CartItem[];
1395
1417
  declare function moveBasketItem(fromProductId: string, fromVariantId: string, toProductId: string, toVariantId: string): void;
1396
1418
  declare function validateCartIntegrity(): boolean;
1397
1419
  declare function getCartStats(): CartStats;
1420
+ /** @internal — read by checkout(); exported only across module boundaries. */
1421
+ declare function getLatestQuoteToken(): string | null;
1398
1422
  declare function quoteCart(coupon?: string, currency?: string): Promise<src.SDKResponse<CartQuote>>;
1399
1423
 
1400
1424
  type CartLineIdentityInput = Pick<CartItem, 'product_id' | 'variant_id' | 'price_variant_id' | 'addons' | 'custom_fields' | 'price_data' | 'pay_what_you_want_price'>;
@@ -1421,14 +1445,11 @@ interface CheckoutOptions {
1421
1445
  */
1422
1446
  redirectUrl?: string;
1423
1447
  /**
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.
1448
+ * Pin the quote proof this hand-off submits, as a tri-state: `undefined`
1449
+ * lets the SDK read the latest settled quote from storage, `null` submits
1450
+ * explicitly none, and a string submits exactly that token.
1430
1451
  */
1431
- turnstileToken?: string;
1452
+ quoteToken?: string | null;
1432
1453
  /**
1433
1454
  * Referral (affiliate) code to submit, as a tri-state:
1434
1455
  *
@@ -1499,28 +1520,24 @@ interface CheckoutResult {
1499
1520
  * cart caught client-side).
1500
1521
  */
1501
1522
  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
1523
  }
1509
1524
  /**
1510
1525
  * 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`.
1526
+ * throw-based contract while preserving the server error code and status.
1513
1527
  */
1514
1528
  declare class CheckoutCreateError extends Error {
1515
- readonly challenge?: ApiChallenge;
1516
1529
  readonly code?: string;
1517
1530
  readonly status?: number;
1518
1531
  constructor(message: string, options?: {
1519
- challenge?: ApiChallenge;
1520
1532
  code?: string;
1521
1533
  status?: number;
1522
1534
  });
1523
1535
  }
1536
+ /**
1537
+ * The currency an option-less checkout would request right now (location,
1538
+ * then config).
1539
+ */
1540
+ declare function getRequestedCheckoutCurrency(): string | null;
1524
1541
  declare function checkout(couponOrOptions?: string | CheckoutOptions, options?: CheckoutOptions): Promise<CheckoutResult>;
1525
1542
  /**
1526
1543
  * Build checkout URL by creating invoice first.
@@ -1545,19 +1562,6 @@ declare function buildCheckoutUrl(couponOrOptions?: string | CheckoutOptions, op
1545
1562
  */
1546
1563
  declare function buildCheckoutUrlSync(): never;
1547
1564
 
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
1565
  interface SearchOptions {
1562
1566
  hideOutOfStock?: boolean;
1563
1567
  maxResults?: number;
@@ -1906,11 +1910,12 @@ declare const shoppex: {
1906
1910
  getCartStats: typeof getCartStats;
1907
1911
  validateCartIntegrity: typeof validateCartIntegrity;
1908
1912
  quoteCart: typeof quoteCart;
1913
+ getLatestQuoteToken: typeof getLatestQuoteToken;
1909
1914
  resolveCartLineId: typeof resolveCartLineId;
1910
1915
  checkout: typeof checkout;
1911
1916
  buildCheckoutUrl: typeof buildCheckoutUrl;
1912
1917
  buildCheckoutUrlSync: typeof buildCheckoutUrlSync;
1913
- mountCheckoutChallenge: typeof mountCheckoutChallenge;
1918
+ getRequestedCheckoutCurrency: typeof getRequestedCheckoutCurrency;
1914
1919
  captureAffiliateFromUrl: typeof captureAffiliateFromUrl;
1915
1920
  validateAffiliateCode: typeof validateAffiliateCode;
1916
1921
  applyAffiliateCode: typeof applyAffiliateCode;
@@ -1989,4 +1994,4 @@ declare const shoppex: {
1989
1994
  mergeSettings: typeof mergeSettings;
1990
1995
  };
1991
1996
 
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 };
1997
+ export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, 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
@@ -10,12 +10,21 @@ export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, P
10
10
  interface ShoppexConfig {
11
11
  storeSlug: string;
12
12
  locale?: string;
13
+ /** Normalized (upper-case ISO 4217) buyer currency, or undefined when unset. */
13
14
  currency?: string;
14
15
  apiBaseUrl?: string;
15
16
  checkoutBaseUrl?: string;
16
17
  }
17
18
  interface ShoppexInitOptions {
18
19
  locale?: string;
20
+ /**
21
+ * Buyer currency for every priced read (storefront, products, product) and
22
+ * for cart quotes and checkout. Must be one of the currencies enabled in
23
+ * the shop's settings: the API prices in it or refuses with
24
+ * `errors.storefront.currency_unavailable` (listing the enabled ones) —
25
+ * it never silently falls back to the shop default. Omit it to let the
26
+ * shop's own default / country auto-detection decide.
27
+ */
19
28
  currency?: string;
20
29
  apiBaseUrl?: string;
21
30
  checkoutBaseUrl?: string;
@@ -41,10 +50,6 @@ interface ApiResponse<T> {
41
50
  error_code?: string | null;
42
51
  error_params?: Record<string, unknown> | null;
43
52
  }
44
- interface ApiChallenge {
45
- provider: 'turnstile';
46
- siteKey: string;
47
- }
48
53
  interface SDKResponse<T> {
49
54
  success: boolean;
50
55
  data?: T;
@@ -87,8 +92,6 @@ interface SDKResponse<T> {
87
92
  * received.
88
93
  */
89
94
  responseDefinitive?: boolean;
90
- /** A renewable human-verification challenge returned with a refusal. */
91
- challenge?: ApiChallenge;
92
95
  }
93
96
  interface Shop {
94
97
  id: string;
@@ -107,7 +110,20 @@ interface Shop {
107
110
  products_sold_count?: number;
108
111
  customers_count?: number;
109
112
  hide_products_sold?: boolean;
113
+ /**
114
+ * The currency THIS response is priced in: the requested one, else the
115
+ * shop default or its country auto-detection. Every `price` in the same
116
+ * payload is denominated in it.
117
+ */
110
118
  currency: string;
119
+ /** The merchant's configured default currency. */
120
+ default_currency?: string;
121
+ /**
122
+ * Currencies the merchant enabled, exactly as stored (an array, or the
123
+ * legacy comma-separated string). Empty means "default only". A
124
+ * `currency` request outside this set is refused.
125
+ */
126
+ available_currencies?: string[] | string | null;
111
127
  tos_enabled?: boolean;
112
128
  dark_mode?: boolean;
113
129
  search_enabled?: boolean;
@@ -1058,6 +1074,12 @@ declare function getTypedClient(token?: string): ApiClient;
1058
1074
  /**
1059
1075
  * SDK Error Classes
1060
1076
  */
1077
+ /**
1078
+ * `SDKResponse.code` of a priced read that asked for a currency the shop does
1079
+ * not sell in (ADR-0066). `errorParams.requested` names the currency,
1080
+ * `errorParams.available` lists the enabled ones.
1081
+ */
1082
+ declare const CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
1061
1083
  declare class ShoppexError extends Error {
1062
1084
  readonly code: string;
1063
1085
  readonly statusCode?: number;
@@ -1395,6 +1417,8 @@ declare function mergeBaskets(items: CartBasketMergeLine[]): CartItem[];
1395
1417
  declare function moveBasketItem(fromProductId: string, fromVariantId: string, toProductId: string, toVariantId: string): void;
1396
1418
  declare function validateCartIntegrity(): boolean;
1397
1419
  declare function getCartStats(): CartStats;
1420
+ /** @internal — read by checkout(); exported only across module boundaries. */
1421
+ declare function getLatestQuoteToken(): string | null;
1398
1422
  declare function quoteCart(coupon?: string, currency?: string): Promise<src.SDKResponse<CartQuote>>;
1399
1423
 
1400
1424
  type CartLineIdentityInput = Pick<CartItem, 'product_id' | 'variant_id' | 'price_variant_id' | 'addons' | 'custom_fields' | 'price_data' | 'pay_what_you_want_price'>;
@@ -1421,14 +1445,11 @@ interface CheckoutOptions {
1421
1445
  */
1422
1446
  redirectUrl?: string;
1423
1447
  /**
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.
1448
+ * Pin the quote proof this hand-off submits, as a tri-state: `undefined`
1449
+ * lets the SDK read the latest settled quote from storage, `null` submits
1450
+ * explicitly none, and a string submits exactly that token.
1430
1451
  */
1431
- turnstileToken?: string;
1452
+ quoteToken?: string | null;
1432
1453
  /**
1433
1454
  * Referral (affiliate) code to submit, as a tri-state:
1434
1455
  *
@@ -1499,28 +1520,24 @@ interface CheckoutResult {
1499
1520
  * cart caught client-side).
1500
1521
  */
1501
1522
  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
1523
  }
1509
1524
  /**
1510
1525
  * 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`.
1526
+ * throw-based contract while preserving the server error code and status.
1513
1527
  */
1514
1528
  declare class CheckoutCreateError extends Error {
1515
- readonly challenge?: ApiChallenge;
1516
1529
  readonly code?: string;
1517
1530
  readonly status?: number;
1518
1531
  constructor(message: string, options?: {
1519
- challenge?: ApiChallenge;
1520
1532
  code?: string;
1521
1533
  status?: number;
1522
1534
  });
1523
1535
  }
1536
+ /**
1537
+ * The currency an option-less checkout would request right now (location,
1538
+ * then config).
1539
+ */
1540
+ declare function getRequestedCheckoutCurrency(): string | null;
1524
1541
  declare function checkout(couponOrOptions?: string | CheckoutOptions, options?: CheckoutOptions): Promise<CheckoutResult>;
1525
1542
  /**
1526
1543
  * Build checkout URL by creating invoice first.
@@ -1545,19 +1562,6 @@ declare function buildCheckoutUrl(couponOrOptions?: string | CheckoutOptions, op
1545
1562
  */
1546
1563
  declare function buildCheckoutUrlSync(): never;
1547
1564
 
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
1565
  interface SearchOptions {
1562
1566
  hideOutOfStock?: boolean;
1563
1567
  maxResults?: number;
@@ -1906,11 +1910,12 @@ declare const shoppex: {
1906
1910
  getCartStats: typeof getCartStats;
1907
1911
  validateCartIntegrity: typeof validateCartIntegrity;
1908
1912
  quoteCart: typeof quoteCart;
1913
+ getLatestQuoteToken: typeof getLatestQuoteToken;
1909
1914
  resolveCartLineId: typeof resolveCartLineId;
1910
1915
  checkout: typeof checkout;
1911
1916
  buildCheckoutUrl: typeof buildCheckoutUrl;
1912
1917
  buildCheckoutUrlSync: typeof buildCheckoutUrlSync;
1913
- mountCheckoutChallenge: typeof mountCheckoutChallenge;
1918
+ getRequestedCheckoutCurrency: typeof getRequestedCheckoutCurrency;
1914
1919
  captureAffiliateFromUrl: typeof captureAffiliateFromUrl;
1915
1920
  validateAffiliateCode: typeof validateAffiliateCode;
1916
1921
  applyAffiliateCode: typeof applyAffiliateCode;
@@ -1989,4 +1994,4 @@ declare const shoppex: {
1989
1994
  mergeSettings: typeof mergeSettings;
1990
1995
  };
1991
1996
 
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 };
1997
+ export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, 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 };