@lightspeed/ecom-headless 1.1.2 → 1.1.4-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.
Files changed (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -3
  3. package/dist/api/index.cjs +1 -1
  4. package/dist/api/index.cjs.map +1 -1
  5. package/dist/api/index.d.cts +24 -2
  6. package/dist/api/index.d.mts +24 -2
  7. package/dist/api/index.d.ts +24 -2
  8. package/dist/api/index.mjs +1 -1
  9. package/dist/api/index.mjs.map +1 -1
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.d.cts +4 -4
  12. package/dist/index.d.mts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.mjs +1 -1
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/plugin-visualizer/bundle.html +1 -1
  17. package/dist/shared/{ecom-headless.D2QPHn5F.d.ts → ecom-headless.B47rEAOn.d.ts} +2 -2
  18. package/dist/shared/{ecom-headless.BTRqua6N.d.cts → ecom-headless.BTXuBMcG.d.cts} +2 -2
  19. package/dist/shared/{ecom-headless.BTRqua6N.d.mts → ecom-headless.BTXuBMcG.d.mts} +2 -2
  20. package/dist/shared/{ecom-headless.BTRqua6N.d.ts → ecom-headless.BTXuBMcG.d.ts} +2 -2
  21. package/dist/shared/{ecom-headless.DTL4WyVk.d.cts → ecom-headless.Bm1MKC5K.d.cts} +264 -38
  22. package/dist/shared/{ecom-headless.DTL4WyVk.d.mts → ecom-headless.Bm1MKC5K.d.mts} +264 -38
  23. package/dist/shared/{ecom-headless.DTL4WyVk.d.ts → ecom-headless.Bm1MKC5K.d.ts} +264 -38
  24. package/dist/shared/{ecom-headless.fwEDqznC.d.mts → ecom-headless.CdAf5aSI.d.cts} +2 -2
  25. package/dist/shared/ecom-headless.CiGkSfL9.cjs.map +1 -1
  26. package/dist/shared/ecom-headless.biFHUae1.mjs.map +1 -1
  27. package/dist/shared/{ecom-headless.n2b3FM61.d.cts → ecom-headless.r8wgepwM.d.mts} +2 -2
  28. package/dist/storefront/index.cjs.map +1 -1
  29. package/dist/storefront/index.d.cts +2 -2
  30. package/dist/storefront/index.d.mts +2 -2
  31. package/dist/storefront/index.d.ts +2 -2
  32. package/dist/storefront/index.mjs.map +1 -1
  33. package/dist/types/index.d.cts +3 -3
  34. package/dist/types/index.d.mts +3 -3
  35. package/dist/types/index.d.ts +3 -3
  36. package/package.json +2 -2
@@ -108,6 +108,12 @@ type SearchCategoriesResponse = PaginatedResponse<Category>;
108
108
  * @see {@link https://docs.ecwid.com/api-reference/rest-api/categories/search-categories#query-params | Ecwid API Documentation}
109
109
  */
110
110
  type SearchCategoriesParams = AsQueryParams<{
111
+ /**
112
+ * A keyword to search for in category names.
113
+ *
114
+ * @remarks
115
+ * If this field is specified, search result will contain only categories with names containing the specified keyword.
116
+ */
111
117
  keyword?: string;
112
118
  /**
113
119
  * Parent category ID.
@@ -124,29 +130,74 @@ type SearchCategoriesParams = AsQueryParams<{
124
130
  */
125
131
  parentIds?: string;
126
132
  /**
127
- * Set `true` to receive full categories structure (subcategories of subcategories, etc.)
133
+ * Flag indicating whether only direct or all descendants should be included in response.
128
134
  *
129
135
  * @remarks
130
- * If `false` or not specified, only direct descendants of specified category IDs from `parent` and `parentIds` parameters are returned.
136
+ * - `false` (default): only direct descendants of categories in `parent` and `parentIds` parameters are returned.
137
+ * - `true`: all descendants of categories in `parent` and `parentIds` parameters are returned (full categories structure).
131
138
  */
132
139
  withSubcategories?: boolean;
133
- /** Set `true` to include disabled categories. */
140
+ /**
141
+ * Set `true` to include disabled categories in the response.
142
+ *
143
+ * @remarks
144
+ * If `false` or not specified, only enabled categories are returned.
145
+ */
134
146
  hidden_categories?: boolean;
135
147
  /**
136
- * Offset from the beginning of the returned items list.
137
- * Used when the response contains more items than `limit` allows to receive in one request.
148
+ * List of category identifiers.
149
+ *
150
+ * @remarks
151
+ * If this field is specified, search result will contain only categories with identifiers from the specified list.
152
+ *
153
+ * @example "123,456,789"
138
154
  */
139
- offset?: number;
155
+ categoryIds?: string;
156
+ /**
157
+ * Set `true` to include product IDs list for each category.
158
+ *
159
+ * @remarks
160
+ * If `true`, each category in the response will contain a list of product identifiers that belong to it.
161
+ *
162
+ * @default false
163
+ */
164
+ productIds?: boolean;
165
+ /**
166
+ * Set `true` to fetch enabled products count for each category.
167
+ *
168
+ * @remarks
169
+ * If `true`, each category in the response will include the count of enabled products.
170
+ *
171
+ * @default false
172
+ */
173
+ fetchEnabledProductsCount?: boolean;
174
+ /**
175
+ * Country code for serving statics from the correct CDN.
176
+ *
177
+ * @example "US", "GB", "FR"
178
+ */
179
+ countryCode?: string;
140
180
  /**
141
181
  * Limit to the number of returned items.
142
- * Maximum and default value (if not specified) is 100.
182
+ *
183
+ * @remarks
184
+ * Maximum and default value (if not specified) is `100`.
143
185
  */
144
186
  limit?: number;
145
187
  /**
146
- * Language ISO code for translations in JSON response, e.g. `en`, `fr`.
188
+ * Offset from the beginning of the returned items list.
147
189
  *
148
190
  * @remarks
149
- * If not specified, the default store language is used.
191
+ * Used when the response contains more items than `limit` allows to receive in one request.
192
+ */
193
+ offset?: number;
194
+ /**
195
+ * The language in which to get the translation of the entity.
196
+ *
197
+ * @remarks
198
+ * Language ISO code for translations in JSON response. If not specified, the default store language is used.
199
+ *
200
+ * @example "en", "nl", "fr"
150
201
  */
151
202
  lang?: string;
152
203
  /**
@@ -170,9 +221,23 @@ type SearchCategoriesByPathResponse = PaginatedResponse<Category>;
170
221
  * @see {@link https://docs.ecwid.com/api-reference/rest-api/categories/search-categories-by-path#query-params | Ecwid API Documentation}
171
222
  */
172
223
  type SearchCategoriesByPathParams = AsQueryParams<{
173
- /** Full path separated by a delimiter. Spaces around the delimiter and empty path elements are ignored. */
224
+ /**
225
+ * Full path to the category being searched.
226
+ *
227
+ * @remarks
228
+ * Spaces around the delimiter and empty path elements are ignored.
229
+ *
230
+ * @example "Electronics/Computers/Laptops"
231
+ */
174
232
  path: string;
175
- /** A string of 1 or more characters used as a path delimiter. */
233
+ /**
234
+ * Delimiter used to separate path elements.
235
+ *
236
+ * @remarks
237
+ * A string of 1 or more characters used as a path delimiter.
238
+ *
239
+ * @example "/", ">", " > "
240
+ */
176
241
  delimiter: string;
177
242
  /** Search term for category name and description. */
178
243
  keyword?: string;
@@ -204,20 +269,32 @@ type SearchCategoriesByPathParams = AsQueryParams<{
204
269
  * If not specified, Ecwid checks URL settings automatically and responds with matching URLs. */
205
270
  slugsWithoutIds?: boolean;
206
271
  /**
207
- * Offset from the beginning of the returned items list.
208
- * Used when the response contains more items than `limit` allows to receive in one request.
272
+ * Country code for serving statics from the correct CDN.
273
+ *
274
+ * @example "US", "GB", "FR"
209
275
  */
210
- offset?: number;
276
+ countryCode?: string;
211
277
  /**
212
278
  * Limit to the number of returned items.
213
- * Maximum and default value (if not specified) is 100.
279
+ *
280
+ * @remarks
281
+ * Maximum and default value (if not specified) is `100`.
214
282
  */
215
283
  limit?: number;
216
284
  /**
217
- * Language ISO code for translations in JSON response, e.g. `en`, `fr`.
285
+ * Offset from the beginning of the returned items list.
218
286
  *
219
287
  * @remarks
220
- * If not specified, the default store language is used.
288
+ * Used when the response contains more items than `limit` allows to receive in one request.
289
+ */
290
+ offset?: number;
291
+ /**
292
+ * The language in which to get the translation of the entity.
293
+ *
294
+ * @remarks
295
+ * Language ISO code for translations in JSON response. If not specified, the default store language is used.
296
+ *
297
+ * @example "en", "nl", "fr"
221
298
  */
222
299
  lang?: string;
223
300
  /**
@@ -1299,6 +1376,18 @@ type SearchProductsParams = AsQueryParams<{
1299
1376
  * Set `outofstock` to get only out-of-stock products.
1300
1377
  */
1301
1378
  inventory?: 'instock' | 'outofstock';
1379
+ /**
1380
+ * Country code to be used for tax calculation.
1381
+ *
1382
+ * @example "US"
1383
+ */
1384
+ countryCode?: string;
1385
+ /**
1386
+ * State or province code to be used for tax calculation.
1387
+ *
1388
+ * @example "NY"
1389
+ */
1390
+ stateOrProvinceCode?: string;
1302
1391
  /**
1303
1392
  * Set base URL for URLs in response.
1304
1393
  * If not specified, Ecwid will use the main URL from store settings.
@@ -1332,6 +1421,13 @@ type SearchProductsParams = AsQueryParams<{
1332
1421
  * Find tax classes and their codes in the {@link https://docs.ecwid.com/api-reference/rest-api/dictionaries/tax-classes-by-country | Tax classes by country}.
1333
1422
  */
1334
1423
  taxClassCodes?: string;
1424
+ /**
1425
+ * Set `true` to search for products that belong only to the basic category and not to any other.
1426
+ *
1427
+ * @remarks
1428
+ * When set to `true`, returns products that are not assigned to any category except the root category.
1429
+ */
1430
+ uncategorized?: boolean;
1335
1431
  /**
1336
1432
  * Limit to the number of returned items.
1337
1433
  *
@@ -1352,6 +1448,15 @@ type SearchProductsParams = AsQueryParams<{
1352
1448
  * @example "total,items(id,name,price,quantity)"
1353
1449
  */
1354
1450
  responseFields?: string;
1451
+ /**
1452
+ * The language in which to get the translation of the entity.
1453
+ *
1454
+ * @remarks
1455
+ * Supports any language enabled in the store. If not specified, the default store language is used.
1456
+ *
1457
+ * @example "en", "nl", "fr"
1458
+ */
1459
+ lang?: string;
1355
1460
  /**
1356
1461
  * Filter by product option name and one or several comma-separated values for that option.
1357
1462
  * A product will appear in the response if it has an option with a specified name that has any of the specified values.
@@ -1383,19 +1488,37 @@ type GetProductResponse = Product;
1383
1488
  * @see {@link https://docs.ecwid.com/api-reference/rest-api/products/get-product#query-params | Ecwid API Documentation}
1384
1489
  */
1385
1490
  type GetProductParams = AsQueryParams<{
1386
- /** Internal product ID. */
1491
+ /**
1492
+ * Internal product ID.
1493
+ *
1494
+ * @remarks
1495
+ * The identifier of the requested product.
1496
+ */
1387
1497
  productId: number;
1388
1498
  /**
1389
- * Set base URL for links in response.
1499
+ * Country code to be used for tax calculation.
1500
+ *
1501
+ * @example "US", "GB", "FR"
1502
+ */
1503
+ countryCode?: string;
1504
+ /**
1505
+ * State or province code to be used for tax calculation.
1506
+ *
1507
+ * @example "NY", "CA"
1508
+ */
1509
+ stateOrProvinceCode?: string;
1510
+ /**
1511
+ * Set base URL for product links in response.
1390
1512
  *
1391
1513
  * @remarks
1392
1514
  * If not specified, Ecwid will use the main URL from store settings.
1393
1515
  */
1394
1516
  baseUrl?: string;
1395
1517
  /**
1396
- * Set to `true` to force receiving clean URLs – catalog links without hashbang (`/#!/`).
1518
+ * Set to `true` to generate SEO-friendly URLs.
1397
1519
  *
1398
1520
  * @remarks
1521
+ * If `true`, forces receiving clean URLs – catalog links without hashbang (`/#!/`).
1399
1522
  * By default Ecwid checks if this setting is enabled for the store and responds with matching URLs.
1400
1523
  */
1401
1524
  cleanUrls?: boolean;
@@ -1406,10 +1529,12 @@ type GetProductParams = AsQueryParams<{
1406
1529
  */
1407
1530
  slugsWithoutIds?: boolean;
1408
1531
  /**
1409
- * Language ISO code for translations in JSON response, e.g. `en`, `fr`.
1532
+ * The language in which to get the translation of the entity.
1410
1533
  *
1411
1534
  * @remarks
1412
- * If not specified, the default store language is used.
1535
+ * Language ISO code for translations in JSON response. If not specified, the default store language is used.
1536
+ *
1537
+ * @example "en", "nl", "fr"
1413
1538
  */
1414
1539
  lang?: string;
1415
1540
  /**
@@ -1547,34 +1672,52 @@ type SearchProductBrandsParams = AsQueryParams<{
1547
1672
  * Used when the response contains more items than {@link limit} allows to receive in one request.
1548
1673
  */
1549
1674
  offset?: number;
1550
- /** Sorting order for the results. */
1551
- sortBy?: 'PRODUCT_COUNT_DESC' | 'PRODUCT_COUNT_ASC' | 'NAME_DESC' | 'NAME_ASC';
1552
1675
  /**
1553
- * Defines if the response should contain brands of disabled products.
1554
- * Set `true` to get such brands.
1676
+ * Sort order for the results.
1555
1677
  *
1556
- * Default value: `false`
1678
+ * @remarks
1679
+ * Supported values:
1680
+ * - `NAME_ASC` - sort by name (ascending)
1681
+ * - `NAME_DESC` - sort by name (descending)
1682
+ * - `PRODUCT_COUNT_ASC` - sort by product count (ascending)
1683
+ * - `PRODUCT_COUNT_DESC` - sort by product count (descending)
1684
+ *
1685
+ * @default "PRODUCT_COUNT_DESC"
1557
1686
  */
1558
- hidden_brands?: boolean;
1687
+ sortBy?: 'PRODUCT_COUNT_DESC' | 'PRODUCT_COUNT_ASC' | 'NAME_DESC' | 'NAME_ASC';
1559
1688
  /**
1560
- * Language ISO code for translations in JSON response, e.g. `en`, `fr`.
1689
+ * Set `true` to include brands that have no products.
1561
1690
  *
1562
1691
  * @remarks
1563
- * If not specified, the default store language is used.
1692
+ * Flag indicating whether to return brands without products in the response.
1693
+ *
1694
+ * @default false
1564
1695
  */
1565
- lang?: string;
1696
+ hidden_brands?: boolean;
1566
1697
  /**
1567
- * Set base URL for URLs in response.
1698
+ * Set base URL for storefront URLs in the returned brands.
1568
1699
  *
1569
1700
  * @remarks
1570
- * If not specified, Ecwid will use the main URL from store settings. */
1701
+ * If not specified, Ecwid will use the main URL from store settings.
1702
+ */
1571
1703
  baseUrl?: string;
1572
1704
  /**
1573
- * Set `true` to force receiving clean URLs – catalog links without hashbang (/#!/).
1705
+ * Set `true` to return SEO-friendly URLs.
1574
1706
  *
1707
+ * @remarks
1708
+ * If `true`, forces receiving clean URLs – catalog links without hashbang (/#!/).
1575
1709
  * By default Ecwid checks if this setting is enabled for the store and responds with matching URLs.
1576
1710
  */
1577
1711
  cleanURLs?: boolean;
1712
+ /**
1713
+ * The language in which to get the translation of the entity.
1714
+ *
1715
+ * @remarks
1716
+ * Language ISO code for translations in JSON response. If not specified, the default store language is used.
1717
+ *
1718
+ * @example "en", "nl", "fr"
1719
+ */
1720
+ lang?: string;
1578
1721
  }>;
1579
1722
 
1580
1723
  /**
@@ -1624,6 +1767,57 @@ interface Translations {
1624
1767
  [languageCode: string]: string;
1625
1768
  }
1626
1769
 
1770
+ type GetReviewsResponse = {
1771
+ /** Total number of reviews in store */
1772
+ total: number;
1773
+ /** Number of reviews in this response */
1774
+ count: number;
1775
+ /** Pagination offset */
1776
+ offset: number;
1777
+ /** Pagination limit */
1778
+ limit: number;
1779
+ /** Array of review items */
1780
+ items: Array<{
1781
+ /** Unique review identifier */
1782
+ id: number;
1783
+ /** Product ID associated with the review */
1784
+ productId: number;
1785
+ /** Product name at time of review */
1786
+ productName: string;
1787
+ /** Product SKU at time of review */
1788
+ productSku: string;
1789
+ /** Review rating (1-5 stars) */
1790
+ rating: number;
1791
+ /** Review text content */
1792
+ review: string;
1793
+ /** Review status: PUBLISHED or MODERATED */
1794
+ status: 'PUBLISHED' | 'MODERATED';
1795
+ /** Review creation date (ISO format) */
1796
+ createDate: string;
1797
+ /** Review creation timestamp (Unix) */
1798
+ createTimestamp: number;
1799
+ /** Last update date (ISO format) */
1800
+ updateDate: string;
1801
+ /** Last update timestamp (Unix) */
1802
+ updateTimestamp: number;
1803
+ /** Language code */
1804
+ lang: string;
1805
+ /** Reviewer information */
1806
+ reviewerInfo: {
1807
+ name: string;
1808
+ country: string;
1809
+ };
1810
+ }>;
1811
+ };
1812
+ type GetReviewsParams = AsQueryParams<{
1813
+ /** Number of reviews to skip (default: 0) */
1814
+ offset?: number;
1815
+ /** Maximum number of reviews to return (default: 20, max: 100) */
1816
+ limit?: number;
1817
+ /** Filter reviews by product ID */
1818
+ productId?: number;
1819
+ }>;
1820
+
1627
1821
  interface Account {
1628
1822
  /** Full store owner name */
1629
1823
  accountName: string;
@@ -2790,10 +2984,42 @@ type GetStoreProfileParams = AsQueryParams<{
2790
2984
  */
2791
2985
  showExtendedInfo?: boolean;
2792
2986
  /**
2793
- * Language ISO code for translations in JSON response, e.g. `en`, `fr`.
2987
+ * Set `true` to include `externalStoreIp` in the response.
2794
2988
  *
2795
2989
  * @remarks
2796
- * If not specified, the default store language is used.
2990
+ * If `true`, the response will contain the external store IP address.
2991
+ */
2992
+ withExternalStoreIp?: boolean;
2993
+ /**
2994
+ * Set `true` to include `lastLoginIp` in the response.
2995
+ *
2996
+ * @remarks
2997
+ * If `true`, the response will contain the last login IP address.
2998
+ */
2999
+ withLastLoginIp?: boolean;
3000
+ /**
3001
+ * Set `true` to include `channelId` in the response.
3002
+ *
3003
+ * @remarks
3004
+ * If `true`, the response will contain the channel ID.
3005
+ */
3006
+ withChannelId?: boolean;
3007
+ /**
3008
+ * Set `true` to include `reportAvailabilityDetails` in `accountInfo` in the response.
3009
+ *
3010
+ * @remarks
3011
+ * If `true`, returns report availability status details in the account information.
3012
+ *
3013
+ * @default false
3014
+ */
3015
+ getReportAvailabilityStatus?: boolean;
3016
+ /**
3017
+ * The language in which to get the translation of the entity.
3018
+ *
3019
+ * @remarks
3020
+ * Language ISO code for translations in JSON response. If not specified, the default store language is used.
3021
+ *
3022
+ * @example "en", "nl", "fr"
2797
3023
  */
2798
3024
  lang?: string;
2799
3025
  /**
@@ -2820,5 +3046,5 @@ interface ApiConfig {
2820
3046
  baseURL?: string;
2821
3047
  }
2822
3048
 
2823
- export { SortByValues as S };
2824
- export type { SearchProductBrandsParams as $, ProductRelatedCategory as A, ProductRelatedProducts as B, Category as C, ProductShipping as D, ProductRecurringChargeSettings as E, ProductSubscriptionSettings as F, ProductTax as G, ProductType as H, Product as I, SearchProductsResponse as J, SearchProductsParams as K, LowestPriceSettings as L, GetProductResponse as M, GetProductParams as N, DownloadProductFileResponse as O, ProductAttributeVisibility as P, DownloadProductFileParams as Q, SearchProductVariationsResponse as R, SearchProductVariationsParams as T, GetProductVariationResponse as U, GetProductVariationParams as V, WholesalePrice as W, SearchProductTypesResponse as X, GetProductTypeResponse as Y, GetProductTypeParams as Z, SearchProductBrandsResponse as _, CategoryImage as a, Tax as a$, PaginatedResponse as a0, QueryParams as a1, AsQueryParams as a2, Translations as a3, Account as a4, LimitsAndRestrictions as a5, AccountBilling as a6, BusinessRegistrationID as a7, Company as a8, DesignSettings as a9, ProductFiltersSettings as aA, FlatRate as aB, RatesTable as aC, Rates as aD, RateCondition as aE, Rate as aF, RegistrationAnswers as aG, SalePrice as aH, HandlingFee as aI, CarrierMethod as aJ, PostageDimensions as aK, CarrierSettings as aL, BusinessHours as aM, BlackoutDates as aN, ShippingOption as aO, Shipping as aP, GeoPolygon as aQ, StoreZone as aR, SocialLink as aS, SocialLinksSettings as aT, StarterSite as aU, StoreProfile as aV, AbandonedSales as aW, StoreSettings as aX, RecurringSubscriptionsSettings as aY, SupportedPaymentMethodsStatuses as aZ, TaxRule as a_, FbMessengerSettings as aa, FeatureToggle as ab, AddressFormat as ac, FormatsAndUnits as ad, GeneralInfo as ae, GiftCardProduct as af, GiftCardSettings as ag, Languages as ah, LegalPage as ai, LegalPagesSettings as aj, MailNotificationsSettings as ak, CustomerMarketingMessages as al, AdminMessages as am, CustomerOrderMessages as an, MailNotifications as ao, MailchimpSettings as ap, OrderInvoiceSettings as aq, PaymentShippingSettings as ar, InstructionsForCustomer as as, PaymentSurcharge as at, PaymentOption as au, ApplePay as av, ApplePayOptions as aw, Payment as ax, PhoneNotifications as ay, FilterSection as az, CategoryImageAlt as b, TaxSettings as b0, CustomTipSettings as b1, TipsSettings as b2, GetStoreProfileResponse as b3, GetStoreProfileParams as b4, ApiConfig as b5, SearchCategoriesResponse as c, SearchCategoriesParams as d, SearchCategoriesByPathResponse as e, SearchCategoriesByPathParams as f, ProductAttributeType as g, ProductAttribute as h, ProductBrand as i, ProductCategory as j, ProductCombinationOption as k, ProductCombination as l, ProductCompositeComponent as m, ProductDimensions as n, ProductFavorites as o, ProductFile as p, ProductDominatingColor as q, ProductBorderInfo as r, ProductGalleryImage as s, ProductImage as t, ProductImageAlt as u, ProductMediaImage as v, ProductMediaVideo as w, ProductMedia as x, ProductOptionChoice as y, ProductOption as z };
3049
+ export { SortByValues as aY };
3050
+ export type { OrderInvoiceSettings as $, AbandonedSales as A, BlackoutDates as B, CarrierMethod as C, DesignSettings as D, GetProductResponse as E, FbMessengerSettings as F, GeneralInfo as G, GetProductTypeParams as H, GetProductTypeResponse as I, GetProductVariationParams as J, GetProductVariationResponse as K, GetReviewsParams as L, GetReviewsResponse as M, GetStoreProfileParams as N, GetStoreProfileResponse as O, GiftCardProduct as P, GiftCardSettings as Q, HandlingFee as R, InstructionsForCustomer as S, Languages as T, LegalPage as U, LegalPagesSettings as V, LimitsAndRestrictions as W, LowestPriceSettings as X, MailNotifications as Y, MailNotificationsSettings as Z, MailchimpSettings as _, Account as a, StoreSettings as a$, PaginatedResponse as a0, Payment as a1, PaymentOption as a2, PaymentShippingSettings as a3, PaymentSurcharge as a4, PhoneNotifications as a5, PostageDimensions as a6, Product as a7, ProductAttribute as a8, ProductAttributeType as a9, ProductType as aA, QueryParams as aB, Rate as aC, RateCondition as aD, Rates as aE, RatesTable as aF, RecurringSubscriptionsSettings as aG, RegistrationAnswers as aH, SalePrice as aI, SearchCategoriesByPathParams as aJ, SearchCategoriesByPathResponse as aK, SearchCategoriesParams as aL, SearchCategoriesResponse as aM, SearchProductBrandsParams as aN, SearchProductBrandsResponse as aO, SearchProductTypesResponse as aP, SearchProductVariationsParams as aQ, SearchProductVariationsResponse as aR, SearchProductsParams as aS, SearchProductsResponse as aT, Shipping as aU, ShippingOption as aV, SocialLink as aW, SocialLinksSettings as aX, StarterSite as aZ, StoreProfile as a_, ProductAttributeVisibility as aa, ProductBorderInfo as ab, ProductBrand as ac, ProductCategory as ad, ProductCombination as ae, ProductCombinationOption as af, ProductCompositeComponent as ag, ProductDimensions as ah, ProductDominatingColor as ai, ProductFavorites as aj, ProductFile as ak, ProductFiltersSettings as al, ProductGalleryImage as am, ProductImage as an, ProductImageAlt as ao, ProductMedia as ap, ProductMediaImage as aq, ProductMediaVideo as ar, ProductOption as as, ProductOptionChoice as at, ProductRecurringChargeSettings as au, ProductRelatedCategory as av, ProductRelatedProducts as aw, ProductShipping as ax, ProductSubscriptionSettings as ay, ProductTax as az, AccountBilling as b, StoreZone as b0, SupportedPaymentMethodsStatuses as b1, Tax as b2, TaxRule as b3, TaxSettings as b4, TipsSettings as b5, Translations as b6, WholesalePrice as b7, AddressFormat as c, AdminMessages as d, ApiConfig as e, ApplePay as f, ApplePayOptions as g, AsQueryParams as h, BusinessHours as i, BusinessRegistrationID as j, CarrierSettings as k, Category as l, CategoryImage as m, CategoryImageAlt as n, Company as o, CustomTipSettings as p, CustomerMarketingMessages as q, CustomerOrderMessages as r, DownloadProductFileParams as s, DownloadProductFileResponse as t, FeatureToggle as u, FilterSection as v, FlatRate as w, FormatsAndUnits as x, GeoPolygon as y, GetProductParams as z };
@@ -1,4 +1,4 @@
1
- import { E as EcwidApiPromise, p as CartData, y as CustomerCookieConsentType, u as JsApiPage, t as CustomerData, T as TrackingConsent, x as VisitorLocation, c as CartGetCallback, b as AddProductParameter, d as CartAddProductCallback, e as CartRemoveProductCallback, f as CartClearCallback, g as CartCalculateTotalCallback, h as CartGoToCheckoutCallback, q as CustomerGetCallback, r as CustomerSignOutCallback } from './ecom-headless.BTRqua6N.mjs';
1
+ import { E as EcwidApiPromise, g as CartData, y as CustomerCookieConsentType, v as JsApiPage, s as CustomerData, T as TrackingConsent, V as VisitorLocation, i as CartGetCallback, a as AddProductParameter, C as CartAddProductCallback, o as CartRemoveProductCallback, f as CartClearCallback, e as CartCalculateTotalCallback, j as CartGoToCheckoutCallback, t as CustomerGetCallback, u as CustomerSignOutCallback } from './ecom-headless.BTXuBMcG.cjs';
2
2
 
3
3
  declare const EcwidWidgetValues: {
4
4
  /** Minicart widget */
@@ -673,4 +673,4 @@ declare namespace index {
673
673
  };
674
674
  }
675
675
 
676
- export { EcwidWidgetValues as E, OnCartChanged as O, getAppPublicToken as a, getInitializedWidgets as b, getOwnerId as c, getStoreId as d, getStorefrontLang as e, formatCurrency as f, getAppPublicConfig as g, getTrackingConsent as h, getVisitorLocation as i, isStorefrontV3 as j, OnConsentChanged as k, OnPageLoad as l, OnPageLoaded as m, OnPageSwitch as n, openPage as o, OnSetProfile as p, index$1 as q, index as r, setTrackingConsent as s };
676
+ export { EcwidWidgetValues as E, OnCartChanged as O, index as a, OnConsentChanged as b, OnPageLoad as c, OnPageLoaded as d, OnPageSwitch as e, OnSetProfile as f, formatCurrency as g, getAppPublicConfig as h, index$1 as i, getAppPublicToken as j, getInitializedWidgets as k, getOwnerId as l, getStoreId as m, getStorefrontLang as n, getTrackingConsent as o, getVisitorLocation as p, isStorefrontV3 as q, openPage as r, setTrackingConsent as s };
@@ -1 +1 @@
1
- {"version":3,"file":"ecom-headless.CiGkSfL9.cjs","sources":["../../src/client/constants.ts","../../src/storefront/utils/get-ecwid-window-method.ts","../../src/storefront/utils/wait-ecwid-api-loaded.ts","../../src/storefront/methods/get-store-id.ts"],"sourcesContent":["export const ERROR_MESSAGES = {\n FETCH_API_NOT_AVAILABLE: [\n 'Cannot initialize the API client.',\n 'Please use Node 18+ or a runtime with fetch() support. ',\n 'For older Node.js versions, consider using a fetch polyfill.',\n ].join('\\n'),\n CONFIG_NOT_INITIALIZED: 'Error initializing Storefront API: Please call initStorefrontApi() method first.',\n CONFIG_PUBLIC_TOKEN_REQUIRED: 'Error initializing Storefront API: publicToken is required',\n CONFIG_STORE_ID_NOT_FOUND: 'Error initializing Storefront API: storeId not found',\n STOREFRONT_JS_API_NOT_AVAILABLE: [\n 'Ecwid JS API not found on window object.',\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n STOREFRONT_JS_API_METHOD_NOT_AVAILABLE: (methodName: string) => [\n `Ecwid JS API method \"${methodName}\" is not available.`,\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n} as const;\n","import { ERROR_MESSAGES } from '@/client/constants';\n\ntype EcwidJsApi = NonNullable<typeof globalThis.window.Ecwid>;\n\ntype EcwidJsApiMethod = keyof EcwidJsApi;\n\nexport function getEcwidWindowMethod<K extends EcwidJsApiMethod>(methodName: K): NonNullable<EcwidJsApi[K]> {\n const ecwidJsApi = globalThis.window?.Ecwid;\n const methodFunction = ecwidJsApi?.[methodName];\n\n if (ecwidJsApi === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_NOT_AVAILABLE);\n }\n\n if (methodFunction === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_METHOD_NOT_AVAILABLE(methodName));\n }\n\n return methodFunction;\n}\n","export async function waitEcwidApiLoaded<T>(callback: () => T): Promise<T> {\n const invokeCallback = (\n resolve: (value: T | PromiseLike<T>) => void,\n reject: (reason: unknown) => void,\n ) => {\n try {\n resolve(callback());\n } catch (error) {\n reject(error);\n }\n };\n\n return new Promise((resolve, reject) => {\n const OnAPILoaded = globalThis.window?.Ecwid?.OnAPILoaded;\n\n if (OnAPILoaded !== undefined) {\n OnAPILoaded.add(() => invokeCallback(resolve, reject));\n } else {\n invokeCallback(resolve, reject);\n }\n });\n}\n","import { getEcwidWindowMethod, waitEcwidApiLoaded } from '@/storefront/utils';\n\nasync function getOwnerIdInternal(): Promise<number> {\n return waitEcwidApiLoaded(\n () => getEcwidWindowMethod('getOwnerId')(),\n );\n}\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getStoreId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getStoreId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getStoreId = getOwnerIdInternal;\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getOwnerId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getOwnerId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getOwnerId = getOwnerIdInternal;\n"],"names":["methodName","ecwidJsApi","methodFunction","ERROR_MESSAGES","callback","invokeCallback","resolve","reject","error","OnAPILoaded","getOwnerIdInternal","waitEcwidApiLoaded","getEcwidWindowMethod"],"mappings":"aAAa,MAAA,eAAiB,CAC5B,wBAAyB,CACvB,oCACA,0DACA,8DACF,EAAE,KAAK;AAAA,CAAI,EACX,uBAAwB,mFACxB,6BAA8B,6DAC9B,0BAA2B,uDAC3B,gCAAiC,CAC/B,2CACA,+CACF,EAAE,KAAK;AAAA,CAAI,EACX,uCAAyCA,GAAuB,CAC9D,wBAAwBA,CAAU,sBAClC,+CACF,EAAE,KAAK;AAAA,CAAI,CACb,ECXgB,SAAA,qBAAiDA,EAA2C,CAC1G,MAAMC,EAAa,WAAW,QAAQ,MAChCC,EAAiBD,IAAaD,CAAU,EAE9C,GAAIC,IAAe,OACjB,MAAM,IAAI,MAAME,eAAe,+BAA+B,EAGhE,GAAID,IAAmB,OACrB,MAAM,IAAI,MAAMC,eAAe,uCAAuCH,CAAU,CAAC,EAGnF,OAAOE,CACT,CCnBsB,eAAA,mBAAsBE,EAA+B,CACzE,MAAMC,EAAiB,CACrBC,EACAC,IACG,CACH,GAAI,CACFD,EAAQF,EAAS,CAAC,CACpB,OAASI,EAAO,CACdD,EAAOC,CAAK,CACd,CACF,EAEA,OAAO,IAAI,QAAQ,CAACF,EAASC,IAAW,CACtC,MAAME,EAAc,WAAW,QAAQ,OAAO,YAE1CA,IAAgB,OAClBA,EAAY,IAAI,IAAMJ,EAAeC,EAASC,CAAM,CAAC,EAErDF,EAAeC,EAASC,CAAM,CAElC,CAAC,CACH,CCnBA,eAAeG,GAAsC,CACnD,OAAOC,mBACL,IAAMC,qBAAqB,YAAY,EACzC,CAAA,CACF,CAea,MAAA,WAAaF,EAeb,WAAaA"}
1
+ {"version":3,"file":"ecom-headless.CiGkSfL9.cjs","sources":["../../src/client/constants.ts","../../src/storefront/utils/get-ecwid-window-method.ts","../../src/storefront/utils/wait-ecwid-api-loaded.ts","../../src/storefront/methods/get-store-id.ts"],"sourcesContent":["export const ERROR_MESSAGES = {\n FETCH_API_NOT_AVAILABLE: [\n 'Cannot initialize the API client.',\n 'Please use Node 18+ or a runtime with fetch() support. ',\n 'For older Node.js versions, consider using a fetch polyfill.',\n ].join('\\n'),\n CONFIG_NOT_INITIALIZED: 'Error initializing Storefront API: Please call initStorefrontApi() method first.',\n CONFIG_PUBLIC_TOKEN_REQUIRED: 'Error initializing Storefront API: publicToken is required',\n CONFIG_STORE_ID_NOT_FOUND: 'Error initializing Storefront API: storeId not found',\n STOREFRONT_JS_API_NOT_AVAILABLE: [\n 'Ecwid JS API not found on window object.',\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n STOREFRONT_JS_API_METHOD_NOT_AVAILABLE: (methodName: string) => [\n `Ecwid JS API method \"${methodName}\" is not available.`,\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n} as const;\n","import { ERROR_MESSAGES } from '@/client/constants';\n\ntype EcwidJsApi = NonNullable<typeof globalThis.window.Ecwid>;\n\ntype EcwidJsApiMethod = keyof EcwidJsApi;\n\nexport function getEcwidWindowMethod<K extends EcwidJsApiMethod>(methodName: K): NonNullable<EcwidJsApi[K]> {\n const ecwidJsApi = globalThis.window?.Ecwid;\n const methodFunction = ecwidJsApi?.[methodName];\n\n if (ecwidJsApi === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_NOT_AVAILABLE);\n }\n\n if (methodFunction === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_METHOD_NOT_AVAILABLE(methodName));\n }\n\n return methodFunction;\n}\n","export async function waitEcwidApiLoaded<T>(callback: () => T): Promise<T> {\n const invokeCallback = (\n resolve: (value: T | PromiseLike<T>) => void,\n reject: (reason: unknown) => void,\n ) => {\n try {\n resolve(callback());\n } catch (error) {\n reject(error);\n }\n };\n\n return new Promise((resolve, reject) => {\n const OnAPILoaded = globalThis.window?.Ecwid?.OnAPILoaded;\n\n if (OnAPILoaded !== undefined) {\n OnAPILoaded.add(() => invokeCallback(resolve, reject));\n } else {\n invokeCallback(resolve, reject);\n }\n });\n}\n","import { getEcwidWindowMethod, waitEcwidApiLoaded } from '@/storefront/utils';\n\nasync function getOwnerIdInternal(): Promise<number> {\n return waitEcwidApiLoaded(\n () => getEcwidWindowMethod('getOwnerId')(),\n );\n}\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getStoreId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getStoreId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getStoreId = getOwnerIdInternal;\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getOwnerId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getOwnerId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getOwnerId = getOwnerIdInternal;\n"],"names":["methodName","ecwidJsApi","methodFunction","ERROR_MESSAGES","callback","invokeCallback","resolve","reject","error","OnAPILoaded","getOwnerIdInternal","waitEcwidApiLoaded","getEcwidWindowMethod"],"mappings":"aAAO,MAAM,eAAiB,CAC5B,wBAAyB,CACvB,oCACA,0DACA,8DACF,EAAE,KAAK;AAAA,CAAI,EACX,uBAAwB,mFACxB,6BAA8B,6DAC9B,0BAA2B,uDAC3B,gCAAiC,CAC/B,2CACA,+CACF,EAAE,KAAK;AAAA,CAAI,EACX,uCAAyCA,GAAuB,CAC9D,wBAAwBA,CAAU,sBAClC,+CACF,EAAE,KAAK;AAAA,CAAI,CACb,ECXO,SAAS,qBAAiDA,EAA2C,CAC1G,MAAMC,EAAa,WAAW,QAAQ,MAChCC,EAAiBD,IAAaD,CAAU,EAE9C,GAAIC,IAAe,OACjB,MAAM,IAAI,MAAME,eAAe,+BAA+B,EAGhE,GAAID,IAAmB,OACrB,MAAM,IAAI,MAAMC,eAAe,uCAAuCH,CAAU,CAAC,EAGnF,OAAOE,CACT,CCnBA,eAAsB,mBAAsBE,EAA+B,CACzE,MAAMC,EAAiB,CACrBC,EACAC,IACG,CACH,GAAI,CACFD,EAAQF,EAAAA,CAAU,CACpB,OAASI,EAAO,CACdD,EAAOC,CAAK,CACd,CACF,EAEA,OAAO,IAAI,QAAQ,CAACF,EAASC,IAAW,CACtC,MAAME,EAAc,WAAW,QAAQ,OAAO,YAE1CA,IAAgB,OAClBA,EAAY,IAAI,IAAMJ,EAAeC,EAASC,CAAM,CAAC,EAErDF,EAAeC,EAASC,CAAM,CAElC,CAAC,CACH,CCnBA,eAAeG,GAAsC,CACnD,OAAOC,mBACL,IAAMC,qBAAqB,YAAY,GACzC,CACF,CAeO,MAAM,WAAaF,EAeb,WAAaA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ecom-headless.biFHUae1.mjs","sources":["../../src/client/constants.ts","../../src/storefront/utils/get-ecwid-window-method.ts","../../src/storefront/utils/wait-ecwid-api-loaded.ts","../../src/storefront/methods/get-store-id.ts"],"sourcesContent":["export const ERROR_MESSAGES = {\n FETCH_API_NOT_AVAILABLE: [\n 'Cannot initialize the API client.',\n 'Please use Node 18+ or a runtime with fetch() support. ',\n 'For older Node.js versions, consider using a fetch polyfill.',\n ].join('\\n'),\n CONFIG_NOT_INITIALIZED: 'Error initializing Storefront API: Please call initStorefrontApi() method first.',\n CONFIG_PUBLIC_TOKEN_REQUIRED: 'Error initializing Storefront API: publicToken is required',\n CONFIG_STORE_ID_NOT_FOUND: 'Error initializing Storefront API: storeId not found',\n STOREFRONT_JS_API_NOT_AVAILABLE: [\n 'Ecwid JS API not found on window object.',\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n STOREFRONT_JS_API_METHOD_NOT_AVAILABLE: (methodName: string) => [\n `Ecwid JS API method \"${methodName}\" is not available.`,\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n} as const;\n","import { ERROR_MESSAGES } from '@/client/constants';\n\ntype EcwidJsApi = NonNullable<typeof globalThis.window.Ecwid>;\n\ntype EcwidJsApiMethod = keyof EcwidJsApi;\n\nexport function getEcwidWindowMethod<K extends EcwidJsApiMethod>(methodName: K): NonNullable<EcwidJsApi[K]> {\n const ecwidJsApi = globalThis.window?.Ecwid;\n const methodFunction = ecwidJsApi?.[methodName];\n\n if (ecwidJsApi === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_NOT_AVAILABLE);\n }\n\n if (methodFunction === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_METHOD_NOT_AVAILABLE(methodName));\n }\n\n return methodFunction;\n}\n","export async function waitEcwidApiLoaded<T>(callback: () => T): Promise<T> {\n const invokeCallback = (\n resolve: (value: T | PromiseLike<T>) => void,\n reject: (reason: unknown) => void,\n ) => {\n try {\n resolve(callback());\n } catch (error) {\n reject(error);\n }\n };\n\n return new Promise((resolve, reject) => {\n const OnAPILoaded = globalThis.window?.Ecwid?.OnAPILoaded;\n\n if (OnAPILoaded !== undefined) {\n OnAPILoaded.add(() => invokeCallback(resolve, reject));\n } else {\n invokeCallback(resolve, reject);\n }\n });\n}\n","import { getEcwidWindowMethod, waitEcwidApiLoaded } from '@/storefront/utils';\n\nasync function getOwnerIdInternal(): Promise<number> {\n return waitEcwidApiLoaded(\n () => getEcwidWindowMethod('getOwnerId')(),\n );\n}\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getStoreId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getStoreId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getStoreId = getOwnerIdInternal;\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getOwnerId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getOwnerId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getOwnerId = getOwnerIdInternal;\n"],"names":["ERROR_MESSAGES","methodName","getEcwidWindowMethod","ecwidJsApi","methodFunction","waitEcwidApiLoaded","callback","invokeCallback","resolve","reject","error","OnAPILoaded","getOwnerIdInternal","getStoreId","getOwnerId"],"mappings":"AAAa,MAAAA,EAAiB,CAC5B,wBAAyB,CACvB,oCACA,0DACA,8DACF,EAAE,KAAK;AAAA,CAAI,EACX,uBAAwB,mFACxB,6BAA8B,6DAC9B,0BAA2B,uDAC3B,gCAAiC,CAC/B,2CACA,+CACF,EAAE,KAAK;AAAA,CAAI,EACX,uCAAyCC,GAAuB,CAC9D,wBAAwBA,CAAU,sBAClC,+CACF,EAAE,KAAK;AAAA,CAAI,CACb,ECXgB,SAAAC,EAAiDD,EAA2C,CAC1G,MAAME,EAAa,WAAW,QAAQ,MAChCC,EAAiBD,IAAaF,CAAU,EAE9C,GAAIE,IAAe,OACjB,MAAM,IAAI,MAAMH,EAAe,+BAA+B,EAGhE,GAAII,IAAmB,OACrB,MAAM,IAAI,MAAMJ,EAAe,uCAAuCC,CAAU,CAAC,EAGnF,OAAOG,CACT,CCnBsB,eAAAC,EAAsBC,EAA+B,CACzE,MAAMC,EAAiB,CACrBC,EACAC,IACG,CACH,GAAI,CACFD,EAAQF,EAAS,CAAC,CACpB,OAASI,EAAO,CACdD,EAAOC,CAAK,CACd,CACF,EAEA,OAAO,IAAI,QAAQ,CAACF,EAASC,IAAW,CACtC,MAAME,EAAc,WAAW,QAAQ,OAAO,YAE1CA,IAAgB,OAClBA,EAAY,IAAI,IAAMJ,EAAeC,EAASC,CAAM,CAAC,EAErDF,EAAeC,EAASC,CAAM,CAElC,CAAC,CACH,CCnBA,eAAeG,GAAsC,CACnD,OAAOP,EACL,IAAMH,EAAqB,YAAY,EACzC,CAAA,CACF,CAea,MAAAW,EAAaD,EAebE,EAAaF"}
1
+ {"version":3,"file":"ecom-headless.biFHUae1.mjs","sources":["../../src/client/constants.ts","../../src/storefront/utils/get-ecwid-window-method.ts","../../src/storefront/utils/wait-ecwid-api-loaded.ts","../../src/storefront/methods/get-store-id.ts"],"sourcesContent":["export const ERROR_MESSAGES = {\n FETCH_API_NOT_AVAILABLE: [\n 'Cannot initialize the API client.',\n 'Please use Node 18+ or a runtime with fetch() support. ',\n 'For older Node.js versions, consider using a fetch polyfill.',\n ].join('\\n'),\n CONFIG_NOT_INITIALIZED: 'Error initializing Storefront API: Please call initStorefrontApi() method first.',\n CONFIG_PUBLIC_TOKEN_REQUIRED: 'Error initializing Storefront API: publicToken is required',\n CONFIG_STORE_ID_NOT_FOUND: 'Error initializing Storefront API: storeId not found',\n STOREFRONT_JS_API_NOT_AVAILABLE: [\n 'Ecwid JS API not found on window object.',\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n STOREFRONT_JS_API_METHOD_NOT_AVAILABLE: (methodName: string) => [\n `Ecwid JS API method \"${methodName}\" is not available.`,\n 'Ensure the Ecwid storefront script is loaded.',\n ].join('\\n'),\n} as const;\n","import { ERROR_MESSAGES } from '@/client/constants';\n\ntype EcwidJsApi = NonNullable<typeof globalThis.window.Ecwid>;\n\ntype EcwidJsApiMethod = keyof EcwidJsApi;\n\nexport function getEcwidWindowMethod<K extends EcwidJsApiMethod>(methodName: K): NonNullable<EcwidJsApi[K]> {\n const ecwidJsApi = globalThis.window?.Ecwid;\n const methodFunction = ecwidJsApi?.[methodName];\n\n if (ecwidJsApi === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_NOT_AVAILABLE);\n }\n\n if (methodFunction === undefined) {\n throw new Error(ERROR_MESSAGES.STOREFRONT_JS_API_METHOD_NOT_AVAILABLE(methodName));\n }\n\n return methodFunction;\n}\n","export async function waitEcwidApiLoaded<T>(callback: () => T): Promise<T> {\n const invokeCallback = (\n resolve: (value: T | PromiseLike<T>) => void,\n reject: (reason: unknown) => void,\n ) => {\n try {\n resolve(callback());\n } catch (error) {\n reject(error);\n }\n };\n\n return new Promise((resolve, reject) => {\n const OnAPILoaded = globalThis.window?.Ecwid?.OnAPILoaded;\n\n if (OnAPILoaded !== undefined) {\n OnAPILoaded.add(() => invokeCallback(resolve, reject));\n } else {\n invokeCallback(resolve, reject);\n }\n });\n}\n","import { getEcwidWindowMethod, waitEcwidApiLoaded } from '@/storefront/utils';\n\nasync function getOwnerIdInternal(): Promise<number> {\n return waitEcwidApiLoaded(\n () => getEcwidWindowMethod('getOwnerId')(),\n );\n}\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getStoreId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getStoreId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getStoreId = getOwnerIdInternal;\n\n/**\n * This method allows you to receive the store ID. Works on any opened storefront page.\n *\n * @example\n *\n * ```ts\n * import { getOwnerId } from '@lightspeed/ecom-headless';\n *\n * const storeId = await getOwnerId();\n * console.log(storeId);\n * // 1003\n * ```\n */\nexport const getOwnerId = getOwnerIdInternal;\n"],"names":["ERROR_MESSAGES","methodName","getEcwidWindowMethod","ecwidJsApi","methodFunction","waitEcwidApiLoaded","callback","invokeCallback","resolve","reject","error","OnAPILoaded","getOwnerIdInternal","getStoreId","getOwnerId"],"mappings":"AAAO,MAAMA,EAAiB,CAC5B,wBAAyB,CACvB,oCACA,0DACA,8DACF,EAAE,KAAK;AAAA,CAAI,EACX,uBAAwB,mFACxB,6BAA8B,6DAC9B,0BAA2B,uDAC3B,gCAAiC,CAC/B,2CACA,+CACF,EAAE,KAAK;AAAA,CAAI,EACX,uCAAyCC,GAAuB,CAC9D,wBAAwBA,CAAU,sBAClC,+CACF,EAAE,KAAK;AAAA,CAAI,CACb,ECXO,SAASC,EAAiDD,EAA2C,CAC1G,MAAME,EAAa,WAAW,QAAQ,MAChCC,EAAiBD,IAAaF,CAAU,EAE9C,GAAIE,IAAe,OACjB,MAAM,IAAI,MAAMH,EAAe,+BAA+B,EAGhE,GAAII,IAAmB,OACrB,MAAM,IAAI,MAAMJ,EAAe,uCAAuCC,CAAU,CAAC,EAGnF,OAAOG,CACT,CCnBA,eAAsBC,EAAsBC,EAA+B,CACzE,MAAMC,EAAiB,CACrBC,EACAC,IACG,CACH,GAAI,CACFD,EAAQF,EAAAA,CAAU,CACpB,OAASI,EAAO,CACdD,EAAOC,CAAK,CACd,CACF,EAEA,OAAO,IAAI,QAAQ,CAACF,EAASC,IAAW,CACtC,MAAME,EAAc,WAAW,QAAQ,OAAO,YAE1CA,IAAgB,OAClBA,EAAY,IAAI,IAAMJ,EAAeC,EAASC,CAAM,CAAC,EAErDF,EAAeC,EAASC,CAAM,CAElC,CAAC,CACH,CCnBA,eAAeG,GAAsC,CACnD,OAAOP,EACL,IAAMH,EAAqB,YAAY,GACzC,CACF,CAeO,MAAMW,EAAaD,EAebE,EAAaF"}
@@ -1,4 +1,4 @@
1
- import { E as EcwidApiPromise, p as CartData, y as CustomerCookieConsentType, u as JsApiPage, t as CustomerData, T as TrackingConsent, x as VisitorLocation, c as CartGetCallback, b as AddProductParameter, d as CartAddProductCallback, e as CartRemoveProductCallback, f as CartClearCallback, g as CartCalculateTotalCallback, h as CartGoToCheckoutCallback, q as CustomerGetCallback, r as CustomerSignOutCallback } from './ecom-headless.BTRqua6N.cjs';
1
+ import { E as EcwidApiPromise, g as CartData, y as CustomerCookieConsentType, v as JsApiPage, s as CustomerData, T as TrackingConsent, V as VisitorLocation, i as CartGetCallback, a as AddProductParameter, C as CartAddProductCallback, o as CartRemoveProductCallback, f as CartClearCallback, e as CartCalculateTotalCallback, j as CartGoToCheckoutCallback, t as CustomerGetCallback, u as CustomerSignOutCallback } from './ecom-headless.BTXuBMcG.mjs';
2
2
 
3
3
  declare const EcwidWidgetValues: {
4
4
  /** Minicart widget */
@@ -673,4 +673,4 @@ declare namespace index {
673
673
  };
674
674
  }
675
675
 
676
- export { EcwidWidgetValues as E, OnCartChanged as O, getAppPublicToken as a, getInitializedWidgets as b, getOwnerId as c, getStoreId as d, getStorefrontLang as e, formatCurrency as f, getAppPublicConfig as g, getTrackingConsent as h, getVisitorLocation as i, isStorefrontV3 as j, OnConsentChanged as k, OnPageLoad as l, OnPageLoaded as m, OnPageSwitch as n, openPage as o, OnSetProfile as p, index$1 as q, index as r, setTrackingConsent as s };
676
+ export { EcwidWidgetValues as E, OnCartChanged as O, index as a, OnConsentChanged as b, OnPageLoad as c, OnPageLoaded as d, OnPageSwitch as e, OnSetProfile as f, formatCurrency as g, getAppPublicConfig as h, index$1 as i, getAppPublicToken as j, getInitializedWidgets as k, getOwnerId as l, getStoreId as m, getStorefrontLang as n, getTrackingConsent as o, getVisitorLocation as p, isStorefrontV3 as q, openPage as r, setTrackingConsent as s };