@rebuy/rebuy 3.51.1 → 3.52.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/dist/index.cjs CHANGED
@@ -1783,6 +1783,12 @@ var import_zod18 = require("zod");
1783
1783
  // src/schema/postPurchaseProductGallery.ts
1784
1784
  var import_zod9 = require("zod");
1785
1785
  var PostPurchaseProductGallery = import_zod9.z.object({
1786
+ /**
1787
+ * The product had more than one image before `images` was capped at the sub-image limit, so a
1788
+ * renderer shows the thumbnail row even when the cap leaves one image (legacy checks the count
1789
+ * before slicing). Older replies omit it; fall back to `images.length > 1`.
1790
+ */
1791
+ hasMultiple: import_zod9.z.boolean().optional(),
1786
1792
  images: import_zod9.z.array(
1787
1793
  import_zod9.z.object({
1788
1794
  description: import_zod9.z.string(),
package/dist/index.mjs CHANGED
@@ -1311,6 +1311,12 @@ import { z as z18 } from "zod";
1311
1311
  // src/schema/postPurchaseProductGallery.ts
1312
1312
  import { z as z9 } from "zod";
1313
1313
  var PostPurchaseProductGallery = z9.object({
1314
+ /**
1315
+ * The product had more than one image before `images` was capped at the sub-image limit, so a
1316
+ * renderer shows the thumbnail row even when the cap leaves one image (legacy checks the count
1317
+ * before slicing). Older replies omit it; fall back to `images.length > 1`.
1318
+ */
1319
+ hasMultiple: z9.boolean().optional(),
1314
1320
  images: z9.array(
1315
1321
  z9.object({
1316
1322
  description: z9.string(),
@@ -51,6 +51,7 @@ export declare const PreparedPostPurchaseProduct: z.ZodObject<{
51
51
  compare_at_price: "compare_at_price";
52
52
  }>>>;
53
53
  gallery: z.ZodOptional<z.ZodObject<{
54
+ hasMultiple: z.ZodOptional<z.ZodBoolean>;
54
55
  images: z.ZodArray<z.ZodObject<{
55
56
  description: z.ZodString;
56
57
  id: z.ZodNumber;
@@ -215,6 +216,7 @@ export declare const PostPurchasePreparation: z.ZodDiscriminatedUnion<[z.ZodObje
215
216
  compare_at_price: "compare_at_price";
216
217
  }>>>;
217
218
  gallery: z.ZodOptional<z.ZodObject<{
219
+ hasMultiple: z.ZodOptional<z.ZodBoolean>;
218
220
  images: z.ZodArray<z.ZodObject<{
219
221
  description: z.ZodString;
220
222
  id: z.ZodNumber;
@@ -230,6 +230,7 @@ export declare const PostPurchaseProductCollectionView: z.ZodObject<{
230
230
  compare_at_price: "compare_at_price";
231
231
  }>>>;
232
232
  gallery: z.ZodOptional<z.ZodObject<{
233
+ hasMultiple: z.ZodOptional<z.ZodBoolean>;
233
234
  images: z.ZodArray<z.ZodObject<{
234
235
  description: z.ZodString;
235
236
  id: z.ZodNumber;
@@ -51,6 +51,7 @@ export declare const PostPurchaseProductDisplay: z.ZodObject<{
51
51
  compare_at_price: "compare_at_price";
52
52
  }>>>;
53
53
  gallery: z.ZodOptional<z.ZodObject<{
54
+ hasMultiple: z.ZodOptional<z.ZodBoolean>;
54
55
  images: z.ZodArray<z.ZodObject<{
55
56
  description: z.ZodString;
56
57
  id: z.ZodNumber;
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const PostPurchaseProductGallery: z.ZodObject<{
3
+ hasMultiple: z.ZodOptional<z.ZodBoolean>;
3
4
  images: z.ZodArray<z.ZodObject<{
4
5
  description: z.ZodString;
5
6
  id: z.ZodNumber;
@@ -233,6 +233,7 @@ export declare const PostPurchaseProductView: z.ZodUnion<readonly [z.ZodObject<{
233
233
  compare_at_price: "compare_at_price";
234
234
  }>>>;
235
235
  gallery: z.ZodOptional<z.ZodObject<{
236
+ hasMultiple: z.ZodOptional<z.ZodBoolean>;
236
237
  images: z.ZodArray<z.ZodObject<{
237
238
  description: z.ZodString;
238
239
  id: z.ZodNumber;
@@ -44,6 +44,7 @@ export declare const PreparedPostPurchaseSubscription: z.ZodObject<{
44
44
  compare_at_price: "compare_at_price";
45
45
  }>>>;
46
46
  gallery: z.ZodOptional<z.ZodObject<{
47
+ hasMultiple: z.ZodOptional<z.ZodBoolean>;
47
48
  images: z.ZodArray<z.ZodObject<{
48
49
  description: z.ZodString;
49
50
  id: z.ZodNumber;
@@ -240,6 +241,7 @@ export declare const readPostPurchaseSubscription: (prepared: z.infer<typeof Pre
240
241
  source: string;
241
242
  thumbnail: string;
242
243
  }[];
244
+ hasMultiple?: boolean | undefined;
243
245
  selectedImageId?: number | undefined;
244
246
  } | undefined;
245
247
  };
@@ -6368,6 +6368,12 @@ var import_zod54 = require("zod");
6368
6368
  // src/schema/postPurchaseProductGallery.ts
6369
6369
  var import_zod52 = require("zod");
6370
6370
  var PostPurchaseProductGallery = import_zod52.z.object({
6371
+ /**
6372
+ * The product had more than one image before `images` was capped at the sub-image limit, so a
6373
+ * renderer shows the thumbnail row even when the cap leaves one image (legacy checks the count
6374
+ * before slicing). Older replies omit it; fall back to `images.length > 1`.
6375
+ */
6376
+ hasMultiple: import_zod52.z.boolean().optional(),
6371
6377
  images: import_zod52.z.array(
6372
6378
  import_zod52.z.object({
6373
6379
  description: import_zod52.z.string(),
@@ -6561,6 +6567,7 @@ var postPurchasePrimaryImage = (product) => {
6561
6567
 
6562
6568
  // src/server/postPurchaseProductGallery.ts
6563
6569
  var postPurchaseProductGallery = (product, limit) => ({
6570
+ hasMultiple: (product.images?.length ?? 0) > 1,
6564
6571
  images: (product.images ?? []).slice(0, limit ?? 0).map((image) => ({
6565
6572
  description: image.alt ?? product.title,
6566
6573
  id: image.id,
@@ -6296,6 +6296,12 @@ import { z as z54 } from "zod";
6296
6296
  // src/schema/postPurchaseProductGallery.ts
6297
6297
  import { z as z52 } from "zod";
6298
6298
  var PostPurchaseProductGallery = z52.object({
6299
+ /**
6300
+ * The product had more than one image before `images` was capped at the sub-image limit, so a
6301
+ * renderer shows the thumbnail row even when the cap leaves one image (legacy checks the count
6302
+ * before slicing). Older replies omit it; fall back to `images.length > 1`.
6303
+ */
6304
+ hasMultiple: z52.boolean().optional(),
6299
6305
  images: z52.array(
6300
6306
  z52.object({
6301
6307
  description: z52.string(),
@@ -6489,6 +6495,7 @@ var postPurchasePrimaryImage = (product) => {
6489
6495
 
6490
6496
  // src/server/postPurchaseProductGallery.ts
6491
6497
  var postPurchaseProductGallery = (product, limit) => ({
6498
+ hasMultiple: (product.images?.length ?? 0) > 1,
6492
6499
  images: (product.images ?? []).slice(0, limit ?? 0).map((image) => ({
6493
6500
  description: image.alt ?? product.title,
6494
6501
  id: image.id,
@@ -78,6 +78,7 @@ export declare const projectPostPurchaseProductDisplay: (effective: PostPurchase
78
78
  source: string;
79
79
  thumbnail: string;
80
80
  }[];
81
+ hasMultiple?: boolean | undefined;
81
82
  selectedImageId?: number | undefined;
82
83
  } | undefined;
83
84
  };
@@ -1,5 +1,8 @@
1
1
  import type { PostPurchaseProductGallery } from '../schema/postPurchaseProductGallery';
2
2
  import type { PostPurchaseProductSettings } from '../schema/postPurchaseProductSettings';
3
3
  import type { PostPurchaseProductSource } from '../schema/postPurchaseProductSource';
4
- /** Display-only catalog facts (L67); a selected image may lie outside the configured thumbnail limit. */
4
+ /**
5
+ * Display-only catalog facts (L67); a selected image may lie outside the configured thumbnail limit, and
6
+ * `hasMultiple` counts the images before the limit applies (legacy ProductOffer).
7
+ */
5
8
  export declare const postPurchaseProductGallery: (product: PostPurchaseProductSource["data"][number], limit: PostPurchaseProductSettings["subImages"]) => PostPurchaseProductGallery;
@@ -141,6 +141,7 @@ export declare const preparePostPurchaseAdmissionView: (widgetId: number, settin
141
141
  source: string;
142
142
  thumbnail: string;
143
143
  }[];
144
+ hasMultiple?: boolean | undefined;
144
145
  selectedImageId?: number | undefined;
145
146
  } | undefined;
146
147
  };
@@ -181,6 +181,7 @@ export declare const preparePostPurchaseCollectionGroup: (widgetId: number, sett
181
181
  source: string;
182
182
  thumbnail: string;
183
183
  }[];
184
+ hasMultiple?: boolean | undefined;
184
185
  selectedImageId?: number | undefined;
185
186
  } | undefined;
186
187
  };
@@ -163,6 +163,7 @@ export declare const preparePostPurchaseCollectionView: (widgetId: number, setti
163
163
  source: string;
164
164
  thumbnail: string;
165
165
  }[];
166
+ hasMultiple?: boolean | undefined;
166
167
  selectedImageId?: number | undefined;
167
168
  } | undefined;
168
169
  };
@@ -182,6 +182,7 @@ export declare const preparePostPurchaseGroupAdmissionView: (widgetId: number, s
182
182
  source: string;
183
183
  thumbnail: string;
184
184
  }[];
185
+ hasMultiple?: boolean | undefined;
185
186
  selectedImageId?: number | undefined;
186
187
  } | undefined;
187
188
  };
@@ -145,6 +145,7 @@ export declare const preparePostPurchaseGroupDefault: (widgetId: number, setting
145
145
  source: string;
146
146
  thumbnail: string;
147
147
  }[];
148
+ hasMultiple?: boolean | undefined;
148
149
  selectedImageId?: number | undefined;
149
150
  } | undefined;
150
151
  };
@@ -181,6 +181,7 @@ export declare const preparePostPurchaseGroupView: (widgetId: number, settings:
181
181
  source: string;
182
182
  thumbnail: string;
183
183
  }[];
184
+ hasMultiple?: boolean | undefined;
184
185
  selectedImageId?: number | undefined;
185
186
  } | undefined;
186
187
  };
@@ -144,6 +144,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
144
144
  source: string;
145
145
  thumbnail: string;
146
146
  }[];
147
+ hasMultiple?: boolean | undefined;
147
148
  selectedImageId?: number | undefined;
148
149
  } | undefined;
149
150
  };
@@ -957,6 +958,7 @@ export declare const preparePostPurchaseMemberView: (widgetId: number, settings:
957
958
  source: string;
958
959
  thumbnail: string;
959
960
  }[];
961
+ hasMultiple?: boolean | undefined;
960
962
  selectedImageId?: number | undefined;
961
963
  } | undefined;
962
964
  };
@@ -1561,6 +1563,7 @@ export declare const preparePostPurchaseMemberAdmissionView: (widgetId: number,
1561
1563
  source: string;
1562
1564
  thumbnail: string;
1563
1565
  }[];
1566
+ hasMultiple?: boolean | undefined;
1564
1567
  selectedImageId?: number | undefined;
1565
1568
  } | undefined;
1566
1569
  };
@@ -162,6 +162,7 @@ export declare const preparePostPurchaseQuantityAdmissionView: (widgetId: number
162
162
  source: string;
163
163
  thumbnail: string;
164
164
  }[];
165
+ hasMultiple?: boolean | undefined;
165
166
  selectedImageId?: number | undefined;
166
167
  } | undefined;
167
168
  };
@@ -150,6 +150,7 @@ export declare const preparePostPurchaseQuantityView: (widgetId: number, setting
150
150
  source: string;
151
151
  thumbnail: string;
152
152
  }[];
153
+ hasMultiple?: boolean | undefined;
153
154
  selectedImageId?: number | undefined;
154
155
  } | undefined;
155
156
  };
@@ -75,6 +75,7 @@ export declare const preparePostPurchaseSubscription: (settings: unknown, respon
75
75
  source: string;
76
76
  thumbnail: string;
77
77
  }[];
78
+ hasMultiple?: boolean | undefined;
78
79
  selectedImageId?: number | undefined;
79
80
  } | undefined;
80
81
  };
@@ -81,6 +81,7 @@ export declare const projectPostPurchaseProduct: ({ data, effective, metadata, o
81
81
  source: string;
82
82
  thumbnail: string;
83
83
  }[];
84
+ hasMultiple?: boolean | undefined;
84
85
  selectedImageId?: number | undefined;
85
86
  } | undefined;
86
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.51.1",
3
+ "version": "3.52.0",
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.",