@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 +6 -0
- package/dist/index.mjs +6 -0
- 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 +7 -0
- package/dist/server/index.mjs +7 -0
- 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
|
@@ -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;
|
|
@@ -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
|
@@ -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,
|
package/dist/server/index.mjs
CHANGED
|
@@ -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,
|
|
@@ -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.",
|