@rebuy/rebuy 3.62.0 → 3.62.1

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.
@@ -1433,16 +1433,19 @@ var readOkendoReviews = (find) => {
1433
1433
 
1434
1434
  // src/server/postPurchaseScalarReviews.ts
1435
1435
  var import_zod16 = require("zod");
1436
+ var NO_RATING = "null";
1437
+ var readCount = (value) => PostPurchaseReviewCount.parse(value);
1436
1438
  var readScalarReviews = (find, namespace, ratingKey, countKey) => {
1437
1439
  const rating = find(namespace, ratingKey);
1438
1440
  const count = find(namespace, countKey);
1439
1441
  if (!rating || !count) return null;
1442
+ if (rating.value === NO_RATING && readReviewField(count, readCount) === 0) return null;
1440
1443
  return {
1441
1444
  rating: readReviewField(
1442
1445
  rating,
1443
1446
  (value) => PostPurchaseCommonReviewRating.parse({ value: import_zod16.z.string().parse(value) }).value
1444
1447
  ),
1445
- reviewCount: readReviewField(count, (value) => PostPurchaseReviewCount.parse(value))
1448
+ reviewCount: readReviewField(count, readCount)
1446
1449
  };
1447
1450
  };
1448
1451
 
@@ -1360,16 +1360,19 @@ var readOkendoReviews = (find) => {
1360
1360
 
1361
1361
  // src/server/postPurchaseScalarReviews.ts
1362
1362
  import { z as z16 } from "zod";
1363
+ var NO_RATING = "null";
1364
+ var readCount = (value) => PostPurchaseReviewCount.parse(value);
1363
1365
  var readScalarReviews = (find, namespace, ratingKey, countKey) => {
1364
1366
  const rating = find(namespace, ratingKey);
1365
1367
  const count = find(namespace, countKey);
1366
1368
  if (!rating || !count) return null;
1369
+ if (rating.value === NO_RATING && readReviewField(count, readCount) === 0) return null;
1367
1370
  return {
1368
1371
  rating: readReviewField(
1369
1372
  rating,
1370
1373
  (value) => PostPurchaseCommonReviewRating.parse({ value: z16.string().parse(value) }).value
1371
1374
  ),
1372
- reviewCount: readReviewField(count, (value) => PostPurchaseReviewCount.parse(value))
1375
+ reviewCount: readReviewField(count, readCount)
1373
1376
  };
1374
1377
  };
1375
1378
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.62.0",
3
+ "version": "3.62.1",
4
4
  "description": "Shared zod schemas, legacy-to-CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers (rebuy-api, admin-nextjs, rebuy-shopify-extensions)",
5
5
  "license": "MIT",
6
6
  "author": "Rebuy, Inc.",