@lightspeed/ecom-headless 1.1.4 → 1.1.5-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.5 - 2026-08-26
4
+
5
+ ### Changed
6
+
7
+ - align Cart and Customer callback and multi-select product option types with the Storefront runtime contract; see `packages/ecom-headless/UPGRADE.md`
8
+ - Increase the main ESM gzip budget from 3 KB to 3.3 KB for callback-aware Cart and Customer operations.
9
+
10
+ ### Fixed
11
+
12
+ - await Storefront Cart and Customer operation callbacks before resolving
13
+
3
14
  ## 1.1.4 - 2026-05-21
4
15
 
5
16
  ### Added
package/UPGRADE.md CHANGED
@@ -0,0 +1,31 @@
1
+ # Upgrades
2
+
3
+ ## 1.1.4 to next patch release
4
+
5
+ ### Cart and Customer callback types now match their runtime arguments
6
+
7
+ The Storefront runtime has always called `Cart.removeProduct` and `Cart.removeProducts` callbacks with the removed product data before the removed quantity. The previous TypeScript declarations documented those two arguments in the opposite order and described the plural operation with the single-product callback type.
8
+
9
+ Update explicitly typed callbacks to use the runtime order:
10
+
11
+ ```ts
12
+ Cart.removeProduct(0, (success, product, itemsRemovedQuantity, cart, error) => {
13
+ // ...
14
+ })
15
+
16
+ Cart.removeProducts([0, 1], (success, products, itemsRemovedQuantity, cart, error) => {
17
+ // ...
18
+ })
19
+ ```
20
+
21
+ Failure callbacks also expose the nullable values already returned by Storefront:
22
+
23
+ - `Cart.addProduct` can return `product: null` and `error: null`;
24
+ - `Cart.clear` can return `error: null`;
25
+ - `Customer.signOut` can return `error: null`.
26
+
27
+ `Cart.addProduct` now types `selectedPrice` as a number and accepts array values for multi-select product options, matching the Storefront input contract.
28
+
29
+ No runtime callback order or value has changed. Consumers that relied on inferred callback types only need to handle the newly visible nullable failure values. Consumers with explicit callback annotations must update them to the signatures exported by this release.
30
+
31
+ This is released as a patch because it corrects declarations to the existing Storefront runtime contract without changing runtime callback order or values.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { downloadProductFile, getApiConfig, getProduct, getProductType, getProductVariation, getReviews, getStoreProfile, initStorefrontApi, searchCategories, searchCategoriesByPath, searchProductBrands, searchProductTypes, searchProductVariations, searchProducts } from './api/index.cjs';
2
- export { i as Cart, a as Customer, E as EcwidWidgetValues, O as OnCartChanged, b as OnConsentChanged, c as OnPageLoad, d as OnPageLoaded, e as OnPageSwitch, f as OnSetProfile, g as formatCurrency, h as getAppPublicConfig, j as getAppPublicToken, k as getInitializedWidgets, l as getOwnerId, m as getStoreId, n as getStorefrontLang, o as getTrackingConsent, p as getVisitorLocation, q as isStorefrontV3, r as openPage, s as setTrackingConsent } from './shared/ecom-headless.CdAf5aSI.cjs';
3
- export { A as AddProductData, a as AddProductParameter, b as AddProductRecurringChargeSettings, B as BaseJsApiPage, c as BillingPerson, C as CartAddProductCallback, d as CartApi, e as CartCalculateTotalCallback, f as CartClearCallback, g as CartData, h as CartDominatingColor, i as CartGetCallback, j as CartGoToCheckoutCallback, k as CartImageBorderInfo, l as CartItem, m as CartMediaItem, n as CartProduct, o as CartRemoveProductCallback, p as CartVideoInfo, q as CustomerApi, r as CustomerCookieConsentValues, s as CustomerData, t as CustomerGetCallback, u as CustomerSignOutCallback, E as EcwidApiPromise, J as JsApiFilterParams, v as JsApiPage, w as JsApiPageValues, L as LegalPageTypeValues, O as Order, R as RecurringChargeSettings, S as ShippingAddress, T as TrackingConsent, V as VisitorLocation, x as VisitorLocationSourceValues } from './shared/ecom-headless.BTXuBMcG.cjs';
2
+ export { i as Cart, a as Customer, E as EcwidWidgetValues, O as OnCartChanged, b as OnConsentChanged, c as OnPageLoad, d as OnPageLoaded, e as OnPageSwitch, f as OnSetProfile, g as formatCurrency, h as getAppPublicConfig, j as getAppPublicToken, k as getInitializedWidgets, l as getOwnerId, m as getStoreId, n as getStorefrontLang, o as getTrackingConsent, p as getVisitorLocation, q as isStorefrontV3, r as openPage, s as setTrackingConsent } from './shared/ecom-headless.C9ivNZI7.cjs';
3
+ export { A as AddProductData, a as AddProductParameter, b as AddProductRecurringChargeSettings, B as BaseJsApiPage, c as BillingPerson, C as CartAddProductCallback, d as CartApi, e as CartCalculateTotalCallback, f as CartClearCallback, g as CartData, h as CartDominatingColor, i as CartGetCallback, j as CartGoToCheckoutCallback, k as CartImageBorderInfo, l as CartItem, m as CartMediaItem, n as CartProduct, o as CartRemoveProductCallback, p as CartRemoveProductsCallback, q as CartVideoInfo, r as CustomerApi, s as CustomerCookieConsentValues, t as CustomerData, u as CustomerGetCallback, v as CustomerSignOutCallback, E as EcwidApiPromise, J as JsApiFilterParams, w as JsApiPage, x as JsApiPageValues, L as LegalPageTypeValues, O as Order, R as RecurringChargeSettings, S as ShippingAddress, T as TrackingConsent, V as VisitorLocation, y as VisitorLocationSourceValues } from './shared/ecom-headless.DGDJogyS.cjs';
4
4
  export { A as AbandonedSales, a as Account, b as AccountBilling, c as AddressFormat, d as AdminMessages, e as ApiConfig, f as ApplePay, g as ApplePayOptions, h as AsQueryParams, B as BlackoutDates, i as BusinessHours, j as BusinessRegistrationID, C as CarrierMethod, k as CarrierSettings, l as Category, m as CategoryImage, n as CategoryImageAlt, o as Company, p as CustomTipSettings, q as CustomerMarketingMessages, r as CustomerOrderMessages, D as DesignSettings, s as DownloadProductFileParams, t as DownloadProductFileResponse, F as FbMessengerSettings, u as FeatureToggle, v as FilterSection, w as FlatRate, x as FormatsAndUnits, G as GeneralInfo, y as GeoPolygon, z as GetProductParams, E as GetProductResponse, H as GetProductTypeParams, I as GetProductTypeResponse, J as GetProductVariationParams, K as GetProductVariationResponse, L as GetReviewsParams, M as GetReviewsResponse, N as GetStoreProfileParams, O as GetStoreProfileResponse, P as GiftCardProduct, Q as GiftCardSettings, R as HandlingFee, S as InstructionsForCustomer, T as Languages, U as LegalPage, V as LegalPagesSettings, W as LimitsAndRestrictions, X as LowestPriceSettings, Y as MailNotifications, Z as MailNotificationsSettings, _ as MailchimpSettings, $ as OrderInvoiceSettings, a0 as PaginatedResponse, a1 as Payment, a2 as PaymentOption, a3 as PaymentShippingSettings, a4 as PaymentSurcharge, a5 as PhoneNotifications, a6 as PostageDimensions, a7 as Product, a8 as ProductAttribute, a9 as ProductAttributeType, aa as ProductAttributeVisibility, ab as ProductBorderInfo, ac as ProductBrand, ad as ProductCategory, ae as ProductCombination, af as ProductCombinationOption, ag as ProductCompositeComponent, ah as ProductDimensions, ai as ProductDominatingColor, aj as ProductFavorites, ak as ProductFile, al as ProductFiltersSettings, am as ProductGalleryImage, an as ProductImage, ao as ProductImageAlt, ap as ProductMedia, aq as ProductMediaImage, ar as ProductMediaVideo, as as ProductOption, at as ProductOptionChoice, au as ProductRecurringChargeSettings, av as ProductRelatedCategory, aw as ProductRelatedProducts, ax as ProductShipping, ay as ProductSubscriptionSettings, az as ProductTax, aA as ProductType, aB as QueryParams, aC as Rate, aD as RateCondition, aE as Rates, aF as RatesTable, aG as RecurringSubscriptionsSettings, aH as RegistrationAnswers, aI as SalePrice, aJ as SearchCategoriesByPathParams, aK as SearchCategoriesByPathResponse, aL as SearchCategoriesParams, aM as SearchCategoriesResponse, aN as SearchProductBrandsParams, aO as SearchProductBrandsResponse, aP as SearchProductTypesResponse, aQ as SearchProductVariationsParams, aR as SearchProductVariationsResponse, aS as SearchProductsParams, aT as SearchProductsResponse, aU as Shipping, aV as ShippingOption, aW as SocialLink, aX as SocialLinksSettings, aY as SortByValues, aZ as StarterSite, a_ as StoreProfile, a$ as StoreSettings, b0 as StoreZone, b1 as SupportedPaymentMethodsStatuses, b2 as Tax, b3 as TaxRule, b4 as TaxSettings, b5 as TipsSettings, b6 as Translations, b7 as WholesalePrice } from './shared/ecom-headless.Bm1MKC5K.cjs';
5
5
  import 'buffer';
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { downloadProductFile, getApiConfig, getProduct, getProductType, getProductVariation, getReviews, getStoreProfile, initStorefrontApi, searchCategories, searchCategoriesByPath, searchProductBrands, searchProductTypes, searchProductVariations, searchProducts } from './api/index.mjs';
2
- export { i as Cart, a as Customer, E as EcwidWidgetValues, O as OnCartChanged, b as OnConsentChanged, c as OnPageLoad, d as OnPageLoaded, e as OnPageSwitch, f as OnSetProfile, g as formatCurrency, h as getAppPublicConfig, j as getAppPublicToken, k as getInitializedWidgets, l as getOwnerId, m as getStoreId, n as getStorefrontLang, o as getTrackingConsent, p as getVisitorLocation, q as isStorefrontV3, r as openPage, s as setTrackingConsent } from './shared/ecom-headless.r8wgepwM.mjs';
3
- export { A as AddProductData, a as AddProductParameter, b as AddProductRecurringChargeSettings, B as BaseJsApiPage, c as BillingPerson, C as CartAddProductCallback, d as CartApi, e as CartCalculateTotalCallback, f as CartClearCallback, g as CartData, h as CartDominatingColor, i as CartGetCallback, j as CartGoToCheckoutCallback, k as CartImageBorderInfo, l as CartItem, m as CartMediaItem, n as CartProduct, o as CartRemoveProductCallback, p as CartVideoInfo, q as CustomerApi, r as CustomerCookieConsentValues, s as CustomerData, t as CustomerGetCallback, u as CustomerSignOutCallback, E as EcwidApiPromise, J as JsApiFilterParams, v as JsApiPage, w as JsApiPageValues, L as LegalPageTypeValues, O as Order, R as RecurringChargeSettings, S as ShippingAddress, T as TrackingConsent, V as VisitorLocation, x as VisitorLocationSourceValues } from './shared/ecom-headless.BTXuBMcG.mjs';
2
+ export { i as Cart, a as Customer, E as EcwidWidgetValues, O as OnCartChanged, b as OnConsentChanged, c as OnPageLoad, d as OnPageLoaded, e as OnPageSwitch, f as OnSetProfile, g as formatCurrency, h as getAppPublicConfig, j as getAppPublicToken, k as getInitializedWidgets, l as getOwnerId, m as getStoreId, n as getStorefrontLang, o as getTrackingConsent, p as getVisitorLocation, q as isStorefrontV3, r as openPage, s as setTrackingConsent } from './shared/ecom-headless.BhIymLsJ.mjs';
3
+ export { A as AddProductData, a as AddProductParameter, b as AddProductRecurringChargeSettings, B as BaseJsApiPage, c as BillingPerson, C as CartAddProductCallback, d as CartApi, e as CartCalculateTotalCallback, f as CartClearCallback, g as CartData, h as CartDominatingColor, i as CartGetCallback, j as CartGoToCheckoutCallback, k as CartImageBorderInfo, l as CartItem, m as CartMediaItem, n as CartProduct, o as CartRemoveProductCallback, p as CartRemoveProductsCallback, q as CartVideoInfo, r as CustomerApi, s as CustomerCookieConsentValues, t as CustomerData, u as CustomerGetCallback, v as CustomerSignOutCallback, E as EcwidApiPromise, J as JsApiFilterParams, w as JsApiPage, x as JsApiPageValues, L as LegalPageTypeValues, O as Order, R as RecurringChargeSettings, S as ShippingAddress, T as TrackingConsent, V as VisitorLocation, y as VisitorLocationSourceValues } from './shared/ecom-headless.DGDJogyS.mjs';
4
4
  export { A as AbandonedSales, a as Account, b as AccountBilling, c as AddressFormat, d as AdminMessages, e as ApiConfig, f as ApplePay, g as ApplePayOptions, h as AsQueryParams, B as BlackoutDates, i as BusinessHours, j as BusinessRegistrationID, C as CarrierMethod, k as CarrierSettings, l as Category, m as CategoryImage, n as CategoryImageAlt, o as Company, p as CustomTipSettings, q as CustomerMarketingMessages, r as CustomerOrderMessages, D as DesignSettings, s as DownloadProductFileParams, t as DownloadProductFileResponse, F as FbMessengerSettings, u as FeatureToggle, v as FilterSection, w as FlatRate, x as FormatsAndUnits, G as GeneralInfo, y as GeoPolygon, z as GetProductParams, E as GetProductResponse, H as GetProductTypeParams, I as GetProductTypeResponse, J as GetProductVariationParams, K as GetProductVariationResponse, L as GetReviewsParams, M as GetReviewsResponse, N as GetStoreProfileParams, O as GetStoreProfileResponse, P as GiftCardProduct, Q as GiftCardSettings, R as HandlingFee, S as InstructionsForCustomer, T as Languages, U as LegalPage, V as LegalPagesSettings, W as LimitsAndRestrictions, X as LowestPriceSettings, Y as MailNotifications, Z as MailNotificationsSettings, _ as MailchimpSettings, $ as OrderInvoiceSettings, a0 as PaginatedResponse, a1 as Payment, a2 as PaymentOption, a3 as PaymentShippingSettings, a4 as PaymentSurcharge, a5 as PhoneNotifications, a6 as PostageDimensions, a7 as Product, a8 as ProductAttribute, a9 as ProductAttributeType, aa as ProductAttributeVisibility, ab as ProductBorderInfo, ac as ProductBrand, ad as ProductCategory, ae as ProductCombination, af as ProductCombinationOption, ag as ProductCompositeComponent, ah as ProductDimensions, ai as ProductDominatingColor, aj as ProductFavorites, ak as ProductFile, al as ProductFiltersSettings, am as ProductGalleryImage, an as ProductImage, ao as ProductImageAlt, ap as ProductMedia, aq as ProductMediaImage, ar as ProductMediaVideo, as as ProductOption, at as ProductOptionChoice, au as ProductRecurringChargeSettings, av as ProductRelatedCategory, aw as ProductRelatedProducts, ax as ProductShipping, ay as ProductSubscriptionSettings, az as ProductTax, aA as ProductType, aB as QueryParams, aC as Rate, aD as RateCondition, aE as Rates, aF as RatesTable, aG as RecurringSubscriptionsSettings, aH as RegistrationAnswers, aI as SalePrice, aJ as SearchCategoriesByPathParams, aK as SearchCategoriesByPathResponse, aL as SearchCategoriesParams, aM as SearchCategoriesResponse, aN as SearchProductBrandsParams, aO as SearchProductBrandsResponse, aP as SearchProductTypesResponse, aQ as SearchProductVariationsParams, aR as SearchProductVariationsResponse, aS as SearchProductsParams, aT as SearchProductsResponse, aU as Shipping, aV as ShippingOption, aW as SocialLink, aX as SocialLinksSettings, aY as SortByValues, aZ as StarterSite, a_ as StoreProfile, a$ as StoreSettings, b0 as StoreZone, b1 as SupportedPaymentMethodsStatuses, b2 as Tax, b3 as TaxRule, b4 as TaxSettings, b5 as TipsSettings, b6 as Translations, b7 as WholesalePrice } from './shared/ecom-headless.Bm1MKC5K.mjs';
5
5
  import 'buffer';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { downloadProductFile, getApiConfig, getProduct, getProductType, getProductVariation, getReviews, getStoreProfile, initStorefrontApi, searchCategories, searchCategoriesByPath, searchProductBrands, searchProductTypes, searchProductVariations, searchProducts } from './api/index.js';
2
- export { i as Cart, a as Customer, E as EcwidWidgetValues, O as OnCartChanged, b as OnConsentChanged, c as OnPageLoad, d as OnPageLoaded, e as OnPageSwitch, f as OnSetProfile, g as formatCurrency, h as getAppPublicConfig, j as getAppPublicToken, k as getInitializedWidgets, l as getOwnerId, m as getStoreId, n as getStorefrontLang, o as getTrackingConsent, p as getVisitorLocation, q as isStorefrontV3, r as openPage, s as setTrackingConsent } from './shared/ecom-headless.B47rEAOn.js';
3
- export { A as AddProductData, a as AddProductParameter, b as AddProductRecurringChargeSettings, B as BaseJsApiPage, c as BillingPerson, C as CartAddProductCallback, d as CartApi, e as CartCalculateTotalCallback, f as CartClearCallback, g as CartData, h as CartDominatingColor, i as CartGetCallback, j as CartGoToCheckoutCallback, k as CartImageBorderInfo, l as CartItem, m as CartMediaItem, n as CartProduct, o as CartRemoveProductCallback, p as CartVideoInfo, q as CustomerApi, r as CustomerCookieConsentValues, s as CustomerData, t as CustomerGetCallback, u as CustomerSignOutCallback, E as EcwidApiPromise, J as JsApiFilterParams, v as JsApiPage, w as JsApiPageValues, L as LegalPageTypeValues, O as Order, R as RecurringChargeSettings, S as ShippingAddress, T as TrackingConsent, V as VisitorLocation, x as VisitorLocationSourceValues } from './shared/ecom-headless.BTXuBMcG.js';
2
+ export { i as Cart, a as Customer, E as EcwidWidgetValues, O as OnCartChanged, b as OnConsentChanged, c as OnPageLoad, d as OnPageLoaded, e as OnPageSwitch, f as OnSetProfile, g as formatCurrency, h as getAppPublicConfig, j as getAppPublicToken, k as getInitializedWidgets, l as getOwnerId, m as getStoreId, n as getStorefrontLang, o as getTrackingConsent, p as getVisitorLocation, q as isStorefrontV3, r as openPage, s as setTrackingConsent } from './shared/ecom-headless.DU9eDsgV.js';
3
+ export { A as AddProductData, a as AddProductParameter, b as AddProductRecurringChargeSettings, B as BaseJsApiPage, c as BillingPerson, C as CartAddProductCallback, d as CartApi, e as CartCalculateTotalCallback, f as CartClearCallback, g as CartData, h as CartDominatingColor, i as CartGetCallback, j as CartGoToCheckoutCallback, k as CartImageBorderInfo, l as CartItem, m as CartMediaItem, n as CartProduct, o as CartRemoveProductCallback, p as CartRemoveProductsCallback, q as CartVideoInfo, r as CustomerApi, s as CustomerCookieConsentValues, t as CustomerData, u as CustomerGetCallback, v as CustomerSignOutCallback, E as EcwidApiPromise, J as JsApiFilterParams, w as JsApiPage, x as JsApiPageValues, L as LegalPageTypeValues, O as Order, R as RecurringChargeSettings, S as ShippingAddress, T as TrackingConsent, V as VisitorLocation, y as VisitorLocationSourceValues } from './shared/ecom-headless.DGDJogyS.js';
4
4
  export { A as AbandonedSales, a as Account, b as AccountBilling, c as AddressFormat, d as AdminMessages, e as ApiConfig, f as ApplePay, g as ApplePayOptions, h as AsQueryParams, B as BlackoutDates, i as BusinessHours, j as BusinessRegistrationID, C as CarrierMethod, k as CarrierSettings, l as Category, m as CategoryImage, n as CategoryImageAlt, o as Company, p as CustomTipSettings, q as CustomerMarketingMessages, r as CustomerOrderMessages, D as DesignSettings, s as DownloadProductFileParams, t as DownloadProductFileResponse, F as FbMessengerSettings, u as FeatureToggle, v as FilterSection, w as FlatRate, x as FormatsAndUnits, G as GeneralInfo, y as GeoPolygon, z as GetProductParams, E as GetProductResponse, H as GetProductTypeParams, I as GetProductTypeResponse, J as GetProductVariationParams, K as GetProductVariationResponse, L as GetReviewsParams, M as GetReviewsResponse, N as GetStoreProfileParams, O as GetStoreProfileResponse, P as GiftCardProduct, Q as GiftCardSettings, R as HandlingFee, S as InstructionsForCustomer, T as Languages, U as LegalPage, V as LegalPagesSettings, W as LimitsAndRestrictions, X as LowestPriceSettings, Y as MailNotifications, Z as MailNotificationsSettings, _ as MailchimpSettings, $ as OrderInvoiceSettings, a0 as PaginatedResponse, a1 as Payment, a2 as PaymentOption, a3 as PaymentShippingSettings, a4 as PaymentSurcharge, a5 as PhoneNotifications, a6 as PostageDimensions, a7 as Product, a8 as ProductAttribute, a9 as ProductAttributeType, aa as ProductAttributeVisibility, ab as ProductBorderInfo, ac as ProductBrand, ad as ProductCategory, ae as ProductCombination, af as ProductCombinationOption, ag as ProductCompositeComponent, ah as ProductDimensions, ai as ProductDominatingColor, aj as ProductFavorites, ak as ProductFile, al as ProductFiltersSettings, am as ProductGalleryImage, an as ProductImage, ao as ProductImageAlt, ap as ProductMedia, aq as ProductMediaImage, ar as ProductMediaVideo, as as ProductOption, at as ProductOptionChoice, au as ProductRecurringChargeSettings, av as ProductRelatedCategory, aw as ProductRelatedProducts, ax as ProductShipping, ay as ProductSubscriptionSettings, az as ProductTax, aA as ProductType, aB as QueryParams, aC as Rate, aD as RateCondition, aE as Rates, aF as RatesTable, aG as RecurringSubscriptionsSettings, aH as RegistrationAnswers, aI as SalePrice, aJ as SearchCategoriesByPathParams, aK as SearchCategoriesByPathResponse, aL as SearchCategoriesParams, aM as SearchCategoriesResponse, aN as SearchProductBrandsParams, aO as SearchProductBrandsResponse, aP as SearchProductTypesResponse, aQ as SearchProductVariationsParams, aR as SearchProductVariationsResponse, aS as SearchProductsParams, aT as SearchProductsResponse, aU as Shipping, aV as ShippingOption, aW as SocialLink, aX as SocialLinksSettings, aY as SortByValues, aZ as StarterSite, a_ as StoreProfile, a$ as StoreSettings, b0 as StoreZone, b1 as SupportedPaymentMethodsStatuses, b2 as Tax, b3 as TaxRule, b4 as TaxSettings, b5 as TipsSettings, b6 as Translations, b7 as WholesalePrice } from './shared/ecom-headless.Bm1MKC5K.js';
5
5
  import 'buffer';