@shoppexio/storefront 1.0.88 → 1.0.90

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,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.90
4
+
5
+ Types only; no runtime change. (1.0.86 was skipped; 1.0.87 to 1.0.89 are other releases, all included.)
6
+
7
+ - `Shop.payment_methods`: the public payment methods the backend derives from
8
+ the shop's live gateways, `{ id, label, kind }` in display order (cards,
9
+ wallets, crypto). `Shop.stock_alerts_enabled`: whether sold-out products may
10
+ offer "Notify me".
11
+ - `Product.short_description`, `Product.label_singular` /
12
+ `Product.label_plural` (the merchant's unit words) and
13
+ `Product.service_status` (`operational`, `updating`, `detected` or
14
+ `offline`, with an optional note, for storefront `/status` pages; null when
15
+ the merchant set none).
16
+ - `PriceVariant.description`: the merchant's one-line note on an option.
17
+
18
+ ## 1.0.89
19
+
20
+ - `getShopReviewsPage(cursor, { product })` fails with `code: "reviews_product_filter_unsupported"` (exported as `PRODUCT_FILTER_UNSUPPORTED`) when the API answers without echoing the filter it applied, instead of returning the whole shop's reviews as if they were the product's. `ShopReviewsPage.product` carries the echoed id.
21
+
3
22
  ## 1.0.88
4
23
 
5
24
  - Cart pings carry `cart_seq` and `cart_seq_scope`, a sequence number taken when the cart state is reported and shared by all tabs of the shop (the current time in ms, or one above the highest sequence any tab handed out). The counter record holds the scope (created on first use) and is updated under a Web Lock (`navigator.locks`), so two tabs never hand out the same sequence or create two scopes; where Web Locks are unavailable it is updated without the lock. The server keeps the cart with the highest sequence of the scope and ignores an older one that arrives later, so a slow ping from one tab can no longer overwrite a newer cart another tab already reported.
package/dist/index.cjs CHANGED
@@ -29,6 +29,7 @@ __export(src_exports, {
29
29
  NetworkError: () => NetworkError,
30
30
  NotInitializedError: () => NotInitializedError,
31
31
  PAYABLE_AMOUNT_DECIMAL_PLACES: () => PAYABLE_AMOUNT_DECIMAL_PLACES,
32
+ PRODUCT_FILTER_UNSUPPORTED: () => PRODUCT_FILTER_UNSUPPORTED,
32
33
  ShoppexError: () => ShoppexError,
33
34
  ValidationError: () => ValidationError,
34
35
  acceptResellerInvite: () => acceptResellerInvite,
@@ -25924,6 +25925,7 @@ function normalizeFeedback(raw, index) {
25924
25925
  created_at
25925
25926
  };
25926
25927
  }
25928
+ var PRODUCT_FILTER_UNSUPPORTED = "reviews_product_filter_unsupported";
25927
25929
  async function getShopReviewsPage(cursor, options = {}) {
25928
25930
  const config2 = getConfig();
25929
25931
  const query = new URLSearchParams();
@@ -25949,6 +25951,15 @@ async function getShopReviewsPage(cursor, options = {}) {
25949
25951
  }
25950
25952
  );
25951
25953
  if (response.success && response.data) {
25954
+ if (product && response.data.product !== product) {
25955
+ return {
25956
+ success: false,
25957
+ message: "Reviews for a single product are not available from this store yet.",
25958
+ code: PRODUCT_FILTER_UNSUPPORTED,
25959
+ status: 200,
25960
+ responseReceived: true
25961
+ };
25962
+ }
25952
25963
  return {
25953
25964
  success: true,
25954
25965
  data: {
@@ -27107,6 +27118,7 @@ if (typeof window !== "undefined") {
27107
27118
  NetworkError,
27108
27119
  NotInitializedError,
27109
27120
  PAYABLE_AMOUNT_DECIMAL_PLACES,
27121
+ PRODUCT_FILTER_UNSUPPORTED,
27110
27122
  ShoppexError,
27111
27123
  ValidationError,
27112
27124
  acceptResellerInvite,