@rebuy/rebuy 3.51.0 → 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 +13 -1
- package/dist/index.mjs +13 -1
- package/dist/schema/offerProduct.d.ts +1 -1
- package/dist/schema/postPurchaseProduct.d.ts +2 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +1 -0
- package/dist/schema/postPurchaseProductDisplay.d.ts +1 -0
- package/dist/schema/postPurchaseProductGallery.d.ts +1 -0
- package/dist/schema/postPurchaseProductView.d.ts +1 -0
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +2 -0
- package/dist/server/index.cjs +14 -1
- package/dist/server/index.mjs +14 -1
- package/dist/server/postPurchaseProductDisplay.d.ts +1 -0
- package/dist/server/postPurchaseProductGallery.d.ts +4 -1
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +1 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +1 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +1 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +1 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +1 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +1 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +3 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +1 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +1 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +1 -0
- package/dist/server/projectPostPurchaseProduct.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1714,7 +1714,13 @@ var OfferProduct = import_zod5.z.object({
|
|
|
1714
1714
|
discount: OfferProductDiscount.optional(),
|
|
1715
1715
|
id: import_zod5.z.number(),
|
|
1716
1716
|
image: import_zod5.z.object({ src: import_zod5.z.string() }).nullish(),
|
|
1717
|
-
|
|
1717
|
+
/**
|
|
1718
|
+
* `variantIds` is optional: the engine omits `variant_ids` (rather than sending `[]`) on an image tied to no
|
|
1719
|
+
* variant — seen live on the `recommended` data source while `top_sellers` sends `[]` for the same image
|
|
1720
|
+
* (REB-24958). A missing list means "not variant-specific", exactly like `[]`, so the image keeps its `src`
|
|
1721
|
+
* and the product is never dropped over it.
|
|
1722
|
+
*/
|
|
1723
|
+
images: import_zod5.z.array(import_zod5.z.object({ src: import_zod5.z.string(), variantIds: import_zod5.z.array(import_zod5.z.number()).optional() })).nullish(),
|
|
1718
1724
|
link: import_zod5.z.string().optional(),
|
|
1719
1725
|
metafields: import_zod5.z.array(import_zod5.z.object({ key: import_zod5.z.string(), namespace: import_zod5.z.string(), value: import_zod5.z.string() })).optional(),
|
|
1720
1726
|
options: import_zod5.z.array(OfferProductOption),
|
|
@@ -1777,6 +1783,12 @@ var import_zod18 = require("zod");
|
|
|
1777
1783
|
// src/schema/postPurchaseProductGallery.ts
|
|
1778
1784
|
var import_zod9 = require("zod");
|
|
1779
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(),
|
|
1780
1792
|
images: import_zod9.z.array(
|
|
1781
1793
|
import_zod9.z.object({
|
|
1782
1794
|
description: import_zod9.z.string(),
|
package/dist/index.mjs
CHANGED
|
@@ -1242,7 +1242,13 @@ var OfferProduct = z5.object({
|
|
|
1242
1242
|
discount: OfferProductDiscount.optional(),
|
|
1243
1243
|
id: z5.number(),
|
|
1244
1244
|
image: z5.object({ src: z5.string() }).nullish(),
|
|
1245
|
-
|
|
1245
|
+
/**
|
|
1246
|
+
* `variantIds` is optional: the engine omits `variant_ids` (rather than sending `[]`) on an image tied to no
|
|
1247
|
+
* variant — seen live on the `recommended` data source while `top_sellers` sends `[]` for the same image
|
|
1248
|
+
* (REB-24958). A missing list means "not variant-specific", exactly like `[]`, so the image keeps its `src`
|
|
1249
|
+
* and the product is never dropped over it.
|
|
1250
|
+
*/
|
|
1251
|
+
images: z5.array(z5.object({ src: z5.string(), variantIds: z5.array(z5.number()).optional() })).nullish(),
|
|
1246
1252
|
link: z5.string().optional(),
|
|
1247
1253
|
metafields: z5.array(z5.object({ key: z5.string(), namespace: z5.string(), value: z5.string() })).optional(),
|
|
1248
1254
|
options: z5.array(OfferProductOption),
|
|
@@ -1305,6 +1311,12 @@ import { z as z18 } from "zod";
|
|
|
1305
1311
|
// src/schema/postPurchaseProductGallery.ts
|
|
1306
1312
|
import { z as z9 } from "zod";
|
|
1307
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(),
|
|
1308
1320
|
images: z9.array(
|
|
1309
1321
|
z9.object({
|
|
1310
1322
|
description: z9.string(),
|
|
@@ -21,7 +21,7 @@ export declare const OfferProduct: z.ZodObject<{
|
|
|
21
21
|
}, z.core.$strip>>>;
|
|
22
22
|
images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
23
23
|
src: z.ZodString;
|
|
24
|
-
variantIds: z.ZodArray<z.ZodNumber
|
|
24
|
+
variantIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
25
25
|
}, z.core.$strip>>>>;
|
|
26
26
|
link: z.ZodOptional<z.ZodString>;
|
|
27
27
|
metafields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -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;
|
|
@@ -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
|
};
|
package/dist/server/index.cjs
CHANGED
|
@@ -387,7 +387,13 @@ var OfferProduct = import_zod3.z.object({
|
|
|
387
387
|
discount: OfferProductDiscount.optional(),
|
|
388
388
|
id: import_zod3.z.number(),
|
|
389
389
|
image: import_zod3.z.object({ src: import_zod3.z.string() }).nullish(),
|
|
390
|
-
|
|
390
|
+
/**
|
|
391
|
+
* `variantIds` is optional: the engine omits `variant_ids` (rather than sending `[]`) on an image tied to no
|
|
392
|
+
* variant — seen live on the `recommended` data source while `top_sellers` sends `[]` for the same image
|
|
393
|
+
* (REB-24958). A missing list means "not variant-specific", exactly like `[]`, so the image keeps its `src`
|
|
394
|
+
* and the product is never dropped over it.
|
|
395
|
+
*/
|
|
396
|
+
images: import_zod3.z.array(import_zod3.z.object({ src: import_zod3.z.string(), variantIds: import_zod3.z.array(import_zod3.z.number()).optional() })).nullish(),
|
|
391
397
|
link: import_zod3.z.string().optional(),
|
|
392
398
|
metafields: import_zod3.z.array(import_zod3.z.object({ key: import_zod3.z.string(), namespace: import_zod3.z.string(), value: import_zod3.z.string() })).optional(),
|
|
393
399
|
options: import_zod3.z.array(OfferProductOption),
|
|
@@ -6362,6 +6368,12 @@ var import_zod54 = require("zod");
|
|
|
6362
6368
|
// src/schema/postPurchaseProductGallery.ts
|
|
6363
6369
|
var import_zod52 = require("zod");
|
|
6364
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(),
|
|
6365
6377
|
images: import_zod52.z.array(
|
|
6366
6378
|
import_zod52.z.object({
|
|
6367
6379
|
description: import_zod52.z.string(),
|
|
@@ -6555,6 +6567,7 @@ var postPurchasePrimaryImage = (product) => {
|
|
|
6555
6567
|
|
|
6556
6568
|
// src/server/postPurchaseProductGallery.ts
|
|
6557
6569
|
var postPurchaseProductGallery = (product, limit) => ({
|
|
6570
|
+
hasMultiple: (product.images?.length ?? 0) > 1,
|
|
6558
6571
|
images: (product.images ?? []).slice(0, limit ?? 0).map((image) => ({
|
|
6559
6572
|
description: image.alt ?? product.title,
|
|
6560
6573
|
id: image.id,
|
package/dist/server/index.mjs
CHANGED
|
@@ -315,7 +315,13 @@ var OfferProduct = z3.object({
|
|
|
315
315
|
discount: OfferProductDiscount.optional(),
|
|
316
316
|
id: z3.number(),
|
|
317
317
|
image: z3.object({ src: z3.string() }).nullish(),
|
|
318
|
-
|
|
318
|
+
/**
|
|
319
|
+
* `variantIds` is optional: the engine omits `variant_ids` (rather than sending `[]`) on an image tied to no
|
|
320
|
+
* variant — seen live on the `recommended` data source while `top_sellers` sends `[]` for the same image
|
|
321
|
+
* (REB-24958). A missing list means "not variant-specific", exactly like `[]`, so the image keeps its `src`
|
|
322
|
+
* and the product is never dropped over it.
|
|
323
|
+
*/
|
|
324
|
+
images: z3.array(z3.object({ src: z3.string(), variantIds: z3.array(z3.number()).optional() })).nullish(),
|
|
319
325
|
link: z3.string().optional(),
|
|
320
326
|
metafields: z3.array(z3.object({ key: z3.string(), namespace: z3.string(), value: z3.string() })).optional(),
|
|
321
327
|
options: z3.array(OfferProductOption),
|
|
@@ -6290,6 +6296,12 @@ import { z as z54 } from "zod";
|
|
|
6290
6296
|
// src/schema/postPurchaseProductGallery.ts
|
|
6291
6297
|
import { z as z52 } from "zod";
|
|
6292
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(),
|
|
6293
6305
|
images: z52.array(
|
|
6294
6306
|
z52.object({
|
|
6295
6307
|
description: z52.string(),
|
|
@@ -6483,6 +6495,7 @@ var postPurchasePrimaryImage = (product) => {
|
|
|
6483
6495
|
|
|
6484
6496
|
// src/server/postPurchaseProductGallery.ts
|
|
6485
6497
|
var postPurchaseProductGallery = (product, limit) => ({
|
|
6498
|
+
hasMultiple: (product.images?.length ?? 0) > 1,
|
|
6486
6499
|
images: (product.images ?? []).slice(0, limit ?? 0).map((image) => ({
|
|
6487
6500
|
description: image.alt ?? product.title,
|
|
6488
6501
|
id: image.id,
|
|
@@ -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
|
-
/**
|
|
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;
|
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebuy/rebuy",
|
|
3
|
-
"version": "3.
|
|
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.",
|