@rebuy/rebuy 3.26.0 → 3.28.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 +902 -750
- package/dist/index.mjs +901 -749
- package/dist/schema/checkout-and-beyond/constants.cjs +5 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +5 -0
- package/dist/schema/checkout-and-beyond/index.cjs +97 -68
- package/dist/schema/checkout-and-beyond/index.mjs +97 -68
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/postPurchaseEligibility.d.ts +2 -2
- package/dist/schema/postPurchaseExitPolicy.d.ts +20 -0
- package/dist/schema/postPurchaseIdentity.d.ts +9 -0
- package/dist/schema/postPurchaseOrderDecision.d.ts +10 -0
- package/dist/schema/postPurchasePolicy.d.ts +62 -0
- package/dist/schema/postPurchaseSelection.d.ts +29 -0
- package/dist/schema/postPurchaseSession.d.ts +112 -0
- package/dist/schema/postPurchaseSessionClose.d.ts +25 -0
- package/dist/schema/postPurchaseShadow.d.ts +56 -1
- package/dist/schema/postPurchaseSkipTrace.d.ts +2 -2
- package/dist/schema/widget-data.cjs +160 -135
- package/dist/schema/widget-data.mjs +160 -135
- package/dist/schema/widgetData.d.ts +24 -0
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +13 -1
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +17 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +2 -0
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/separator.d.ts +192 -0
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +2 -1
- package/dist/schema/widgets/contentBlock.d.ts +8 -0
- package/dist/schema/widgets/lineItemEditor.d.ts +8 -0
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts +2 -2
- package/dist/schema/widgets/rebuyButton.d.ts +8 -0
- package/dist/server/index.cjs +601 -188
- package/dist/server/index.mjs +601 -188
- package/dist/server/requestSchemas.d.ts +1 -1
- package/dist/transforms/index.cjs +481 -59
- package/dist/transforms/index.d.ts +2 -0
- package/dist/transforms/index.mjs +481 -59
- package/dist/transforms/postPurchase/convertCalloutBlock.d.ts +8 -0
- package/dist/transforms/postPurchase/convertMessagePreview.d.ts +8 -0
- package/dist/transforms/postPurchase/convertPayButtonBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertSeparatorBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertTextBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertTimerBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/styledTextRun.d.ts +3 -0
- package/dist/transforms/postPurchase/types.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/schema/widgetData.ts
|
|
2
|
-
import { z as
|
|
2
|
+
import { z as z31 } from "zod";
|
|
3
3
|
|
|
4
4
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
5
5
|
import { z } from "zod";
|
|
@@ -117,6 +117,8 @@ var languageKeys = [
|
|
|
117
117
|
"zh"
|
|
118
118
|
];
|
|
119
119
|
var LanguageKey = freezeEnum(languageKeys);
|
|
120
|
+
var layoutFrames = ["callout", "offer-content"];
|
|
121
|
+
var LayoutFrame = freezeEnum(layoutFrames);
|
|
120
122
|
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
121
123
|
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
122
124
|
var objectFits = ["cover", "contain"];
|
|
@@ -155,6 +157,7 @@ var sectionTypes = [
|
|
|
155
157
|
"progressBar",
|
|
156
158
|
"quantity",
|
|
157
159
|
"reviews",
|
|
160
|
+
"separator",
|
|
158
161
|
"text",
|
|
159
162
|
"variants"
|
|
160
163
|
];
|
|
@@ -264,17 +267,17 @@ var CheckoutExtension = z2.looseObject({
|
|
|
264
267
|
});
|
|
265
268
|
|
|
266
269
|
// src/schema/widgets/contentBlock.ts
|
|
267
|
-
import { z as
|
|
270
|
+
import { z as z25 } from "zod";
|
|
268
271
|
|
|
269
272
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
270
|
-
import { z as
|
|
273
|
+
import { z as z24 } from "zod";
|
|
271
274
|
|
|
272
275
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
273
|
-
import { v7 as
|
|
274
|
-
import { z as
|
|
276
|
+
import { v7 as uuidv713 } from "uuid";
|
|
277
|
+
import { z as z23 } from "zod";
|
|
275
278
|
|
|
276
279
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
277
|
-
import { z as
|
|
280
|
+
import { z as z22 } from "zod";
|
|
278
281
|
|
|
279
282
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
280
283
|
import { z as z3 } from "zod";
|
|
@@ -1370,35 +1373,46 @@ var CABReviewsSection = z19.object({
|
|
|
1370
1373
|
name: z19.string().optional(),
|
|
1371
1374
|
sectionId: z19.uuid().default(() => uuidv710()),
|
|
1372
1375
|
sectionType: z19.literal(SectionType.reviews).default(SectionType.reviews),
|
|
1373
|
-
size: z19.enum(reviewsSizes).default(ReviewsSize.default)
|
|
1376
|
+
size: z19.enum(reviewsSizes).default(ReviewsSize.default),
|
|
1377
|
+
strokeColor: z19.string().default("#fadb14"),
|
|
1378
|
+
strokeWidth: z19.number().nonnegative().default(0)
|
|
1374
1379
|
});
|
|
1375
1380
|
|
|
1376
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
1377
|
-
import { slice } from "es-toolkit/compat";
|
|
1381
|
+
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
1378
1382
|
import { v7 as uuidv711 } from "uuid";
|
|
1379
1383
|
import { z as z20 } from "zod";
|
|
1380
|
-
var
|
|
1384
|
+
var CABSeparatorSection = z20.object({
|
|
1381
1385
|
...CABVariableFields,
|
|
1382
|
-
hideOutOfStockVariants: z20.boolean().default(false),
|
|
1383
|
-
name: z20.string().optional(),
|
|
1384
1386
|
sectionId: z20.uuid().default(() => uuidv711()),
|
|
1385
|
-
sectionType: z20.literal(SectionType.
|
|
1386
|
-
|
|
1387
|
-
|
|
1387
|
+
sectionType: z20.literal(SectionType.separator).default(SectionType.separator)
|
|
1388
|
+
});
|
|
1389
|
+
|
|
1390
|
+
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
1391
|
+
import { slice } from "es-toolkit/compat";
|
|
1392
|
+
import { v7 as uuidv712 } from "uuid";
|
|
1393
|
+
import { z as z21 } from "zod";
|
|
1394
|
+
var CABVariantsSection = z21.object({
|
|
1395
|
+
...CABVariableFields,
|
|
1396
|
+
hideOutOfStockVariants: z21.boolean().default(false),
|
|
1397
|
+
name: z21.string().optional(),
|
|
1398
|
+
sectionId: z21.uuid().default(() => uuidv712()),
|
|
1399
|
+
sectionType: z21.literal(SectionType.variants).default(SectionType.variants),
|
|
1400
|
+
selector: z21.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
1401
|
+
variantMode: z21.enum(variantModes).default(VariantMode.multiple)
|
|
1388
1402
|
});
|
|
1389
1403
|
|
|
1390
1404
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1391
|
-
var CABBorder =
|
|
1392
|
-
radius:
|
|
1393
|
-
style:
|
|
1394
|
-
width:
|
|
1405
|
+
var CABBorder = z22.object({
|
|
1406
|
+
radius: z22.enum(borderRadii).default(BorderRadius.base),
|
|
1407
|
+
style: z22.enum(borderStyles).default(BorderStyle.none),
|
|
1408
|
+
width: z22.enum(borderWidths).default(BorderWidth.base)
|
|
1395
1409
|
}).default({
|
|
1396
1410
|
radius: BorderRadius.base,
|
|
1397
1411
|
style: BorderStyle.none,
|
|
1398
1412
|
width: BorderWidth.base
|
|
1399
1413
|
});
|
|
1400
|
-
var CABSection =
|
|
1401
|
-
() =>
|
|
1414
|
+
var CABSection = z22.lazy(
|
|
1415
|
+
() => z22.discriminatedUnion("sectionType", [
|
|
1402
1416
|
CABBannerSection,
|
|
1403
1417
|
CABButtonSection,
|
|
1404
1418
|
CABCarouselSection,
|
|
@@ -1414,38 +1428,49 @@ var CABSection = z21.lazy(
|
|
|
1414
1428
|
CABProgressBarSection,
|
|
1415
1429
|
CABQuantitySection,
|
|
1416
1430
|
CABReviewsSection,
|
|
1431
|
+
CABSeparatorSection,
|
|
1417
1432
|
CABTextSection,
|
|
1418
1433
|
CABVariantsSection
|
|
1419
1434
|
])
|
|
1420
1435
|
);
|
|
1421
1436
|
|
|
1422
1437
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1423
|
-
var GridItem =
|
|
1424
|
-
var
|
|
1438
|
+
var GridItem = z23.union([z23.literal("auto"), z23.literal("fill"), z23.string().regex(/^\d+%$/), z23.number()]);
|
|
1439
|
+
var CABLayoutWrapping = z23.object({
|
|
1440
|
+
breakAt: z23.number().positive(),
|
|
1441
|
+
maxPerLine: z23.number().int().positive()
|
|
1442
|
+
});
|
|
1443
|
+
var CABLayoutSection = z23.object({
|
|
1425
1444
|
...CABVariableFields,
|
|
1426
|
-
alignment:
|
|
1427
|
-
horizontal:
|
|
1428
|
-
vertical:
|
|
1445
|
+
alignment: z23.object({
|
|
1446
|
+
horizontal: z23.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
1447
|
+
vertical: z23.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
1429
1448
|
}).default({
|
|
1430
1449
|
horizontal: HorizontalAlignment.start,
|
|
1431
1450
|
vertical: VerticalAlignment.top
|
|
1432
1451
|
}),
|
|
1433
|
-
border:
|
|
1434
|
-
buttonField:
|
|
1435
|
-
direction:
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1452
|
+
border: z23.lazy(() => CABBorder),
|
|
1453
|
+
buttonField: z23.enum(buttonFields).optional(),
|
|
1454
|
+
direction: z23.enum(directions).default(Direction.rows),
|
|
1455
|
+
/**
|
|
1456
|
+
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1457
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
1458
|
+
*/
|
|
1459
|
+
frame: z23.enum(layoutFrames).optional(),
|
|
1460
|
+
grid: z23.object({
|
|
1461
|
+
columns: z23.union([z23.array(GridItem), z23.undefined()]).default(() => ["auto"]),
|
|
1462
|
+
rows: z23.union([z23.array(GridItem), z23.undefined()]).default(() => ["auto"])
|
|
1439
1463
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
1440
|
-
name:
|
|
1441
|
-
padding:
|
|
1442
|
-
sectionId:
|
|
1443
|
-
sections:
|
|
1444
|
-
sectionType:
|
|
1445
|
-
spacing:
|
|
1464
|
+
name: z23.string().optional(),
|
|
1465
|
+
padding: z23.enum(spacings).default(Spacing.none),
|
|
1466
|
+
sectionId: z23.uuid().default(() => uuidv713()),
|
|
1467
|
+
sections: z23.union([z23.array(z23.lazy(() => CABSection)), z23.strictObject({}).transform(() => [])]).default(() => []),
|
|
1468
|
+
sectionType: z23.literal(SectionType.layout).default(SectionType.layout),
|
|
1469
|
+
spacing: z23.enum(spacings).default(Spacing.base),
|
|
1446
1470
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
1447
|
-
viewUrl:
|
|
1448
|
-
width:
|
|
1471
|
+
viewUrl: z23.string().optional(),
|
|
1472
|
+
width: z23.number().default(100),
|
|
1473
|
+
wrapping: CABLayoutWrapping.optional()
|
|
1449
1474
|
});
|
|
1450
1475
|
|
|
1451
1476
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -1466,8 +1491,8 @@ var UI_LABELS = {
|
|
|
1466
1491
|
};
|
|
1467
1492
|
|
|
1468
1493
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1469
|
-
var localized = (fallback) =>
|
|
1470
|
-
var CABUILabels =
|
|
1494
|
+
var localized = (fallback) => z24.record(z24.string(), z24.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
1495
|
+
var CABUILabels = z24.object({
|
|
1471
1496
|
currentPage: localized(UI_LABELS.currentPage),
|
|
1472
1497
|
guest: localized(UI_LABELS.guest),
|
|
1473
1498
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -1492,154 +1517,154 @@ var CABUILabels = z23.object({
|
|
|
1492
1517
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
1493
1518
|
updating: { ...UI_LABELS.updating }
|
|
1494
1519
|
}));
|
|
1495
|
-
var TargetArea =
|
|
1496
|
-
fill:
|
|
1497
|
-
flip:
|
|
1498
|
-
icon:
|
|
1499
|
-
label:
|
|
1500
|
-
width:
|
|
1520
|
+
var TargetArea = z24.object({
|
|
1521
|
+
fill: z24.boolean().optional(),
|
|
1522
|
+
flip: z24.enum(["both", "horizontal", "vertical"]).optional(),
|
|
1523
|
+
icon: z24.string(),
|
|
1524
|
+
label: z24.string(),
|
|
1525
|
+
width: z24.string()
|
|
1501
1526
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
1502
|
-
var CABTracking =
|
|
1503
|
-
enableAttribution:
|
|
1504
|
-
enableSource:
|
|
1505
|
-
enableWidget:
|
|
1527
|
+
var CABTracking = z24.object({
|
|
1528
|
+
enableAttribution: z24.boolean().nullish().transform((value) => value ?? true),
|
|
1529
|
+
enableSource: z24.boolean().nullish().transform((value) => value ?? true),
|
|
1530
|
+
enableWidget: z24.boolean().nullish().transform((value) => value ?? true)
|
|
1506
1531
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
1507
|
-
var CABExperiment =
|
|
1508
|
-
elementId:
|
|
1509
|
-
experimentId:
|
|
1510
|
-
experimentType:
|
|
1511
|
-
selectedId:
|
|
1532
|
+
var CABExperiment = z24.object({
|
|
1533
|
+
elementId: z24.number(),
|
|
1534
|
+
experimentId: z24.number(),
|
|
1535
|
+
experimentType: z24.string(),
|
|
1536
|
+
selectedId: z24.number()
|
|
1512
1537
|
});
|
|
1513
1538
|
var CABRootSection = CABLayoutSection.extend({
|
|
1514
|
-
editorMode:
|
|
1539
|
+
editorMode: z24.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
1515
1540
|
experiment: CABExperiment.optional(),
|
|
1516
1541
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
1517
1542
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
1518
|
-
previewMode:
|
|
1519
|
-
storeId:
|
|
1543
|
+
previewMode: z24.boolean().nullish().transform((value) => value ?? false),
|
|
1544
|
+
storeId: z24.number().nullable().default(null),
|
|
1520
1545
|
targetArea: TargetArea.nullable(),
|
|
1521
1546
|
tracking: CABTracking,
|
|
1522
|
-
type:
|
|
1547
|
+
type: z24.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
1523
1548
|
uiLabels: CABUILabels,
|
|
1524
|
-
version:
|
|
1525
|
-
widgetId:
|
|
1549
|
+
version: z24.literal(2).default(2),
|
|
1550
|
+
widgetId: z24.number().nullable().default(null)
|
|
1526
1551
|
});
|
|
1527
1552
|
|
|
1528
1553
|
// src/schema/widgets/contentBlock.ts
|
|
1529
|
-
var ContentBlockV1 =
|
|
1530
|
-
blockSpacing:
|
|
1531
|
-
imageBlocks:
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
altText:
|
|
1535
|
-
description:
|
|
1536
|
-
id:
|
|
1537
|
-
imagePlacement:
|
|
1538
|
-
imageSize:
|
|
1539
|
-
imageUrl:
|
|
1540
|
-
textAlignment:
|
|
1554
|
+
var ContentBlockV1 = z25.object({
|
|
1555
|
+
blockSpacing: z25.enum(spacings).optional(),
|
|
1556
|
+
imageBlocks: z25.union([
|
|
1557
|
+
z25.array(
|
|
1558
|
+
z25.object({
|
|
1559
|
+
altText: z25.string().nullable(),
|
|
1560
|
+
description: z25.string().nullable(),
|
|
1561
|
+
id: z25.uuid(),
|
|
1562
|
+
imagePlacement: z25.enum(["top", "right", "bottom", "left"]),
|
|
1563
|
+
imageSize: z25.number(),
|
|
1564
|
+
imageUrl: z25.url(),
|
|
1565
|
+
textAlignment: z25.enum(["left", "center", "right"]),
|
|
1541
1566
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
1542
|
-
textSize:
|
|
1567
|
+
textSize: z25.enum(inlineTextSizeNames)
|
|
1543
1568
|
})
|
|
1544
1569
|
),
|
|
1545
|
-
|
|
1570
|
+
z25.strictObject({}).transform(() => [])
|
|
1546
1571
|
]).optional(),
|
|
1547
|
-
imageLayout:
|
|
1548
|
-
language:
|
|
1549
|
-
description:
|
|
1550
|
-
superTitle:
|
|
1551
|
-
title:
|
|
1572
|
+
imageLayout: z25.enum(["row", "column"]).optional(),
|
|
1573
|
+
language: z25.object({
|
|
1574
|
+
description: z25.string(),
|
|
1575
|
+
superTitle: z25.string(),
|
|
1576
|
+
title: z25.string()
|
|
1552
1577
|
}),
|
|
1553
|
-
previewMode:
|
|
1554
|
-
type:
|
|
1555
|
-
version:
|
|
1578
|
+
previewMode: z25.boolean(),
|
|
1579
|
+
type: z25.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
1580
|
+
version: z25.literal(1)
|
|
1556
1581
|
});
|
|
1557
|
-
var ContentBlock =
|
|
1582
|
+
var ContentBlock = z25.discriminatedUnion("version", [
|
|
1558
1583
|
ContentBlockV1,
|
|
1559
1584
|
CABRootSection.extend({
|
|
1560
|
-
type:
|
|
1585
|
+
type: z25.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
1561
1586
|
})
|
|
1562
1587
|
]);
|
|
1563
1588
|
|
|
1564
1589
|
// src/schema/widgets/giftWithPurchase.ts
|
|
1565
|
-
import { z as
|
|
1566
|
-
var GiftWithPurchase =
|
|
1567
|
-
type:
|
|
1590
|
+
import { z as z26 } from "zod";
|
|
1591
|
+
var GiftWithPurchase = z26.looseObject({
|
|
1592
|
+
type: z26.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
1568
1593
|
});
|
|
1569
1594
|
|
|
1570
1595
|
// src/schema/widgets/lineItemEditor.ts
|
|
1571
|
-
import { z as
|
|
1572
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
1573
|
-
downgradeToOneTimeLabel:
|
|
1596
|
+
import { z as z27 } from "zod";
|
|
1597
|
+
var LineItemEditorSwitchLanguageV1 = z27.object({
|
|
1598
|
+
downgradeToOneTimeLabel: z27.string().optional(),
|
|
1574
1599
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
1575
|
-
subscriptionOptionLabel:
|
|
1576
|
-
upgradeToSubscriptionLabel:
|
|
1577
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
1600
|
+
subscriptionOptionLabel: z27.string().optional(),
|
|
1601
|
+
upgradeToSubscriptionLabel: z27.string().optional(),
|
|
1602
|
+
upgradeToSubscriptionWithoutDiscountLabel: z27.string().optional()
|
|
1578
1603
|
});
|
|
1579
|
-
var LineItemEditorV1 =
|
|
1604
|
+
var LineItemEditorV1 = z27.object({
|
|
1580
1605
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
1581
|
-
button:
|
|
1582
|
-
previewMode:
|
|
1583
|
-
switchToSubscription:
|
|
1584
|
-
disableDowngrade:
|
|
1606
|
+
button: z27.object({ kind: z27.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
1607
|
+
previewMode: z27.boolean().optional(),
|
|
1608
|
+
switchToSubscription: z27.object({
|
|
1609
|
+
disableDowngrade: z27.boolean().optional(),
|
|
1585
1610
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
1586
1611
|
}).optional(),
|
|
1587
|
-
switchToSubscriptionEnabled:
|
|
1588
|
-
tracking:
|
|
1589
|
-
enableAttribution:
|
|
1590
|
-
enableSource:
|
|
1591
|
-
enableWidget:
|
|
1612
|
+
switchToSubscriptionEnabled: z27.boolean().optional(),
|
|
1613
|
+
tracking: z27.object({
|
|
1614
|
+
enableAttribution: z27.boolean().optional(),
|
|
1615
|
+
enableSource: z27.boolean().optional(),
|
|
1616
|
+
enableWidget: z27.boolean().optional()
|
|
1592
1617
|
}).optional(),
|
|
1593
|
-
type:
|
|
1594
|
-
version:
|
|
1618
|
+
type: z27.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
1619
|
+
version: z27.literal(1)
|
|
1595
1620
|
});
|
|
1596
|
-
var LineItemEditor =
|
|
1621
|
+
var LineItemEditor = z27.discriminatedUnion("version", [
|
|
1597
1622
|
LineItemEditorV1,
|
|
1598
1623
|
CABRootSection.extend({
|
|
1599
|
-
type:
|
|
1624
|
+
type: z27.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
1600
1625
|
})
|
|
1601
1626
|
]);
|
|
1602
1627
|
|
|
1603
1628
|
// src/schema/widgets/progressBar.ts
|
|
1604
|
-
import { z as
|
|
1605
|
-
var ProgressBar =
|
|
1606
|
-
type:
|
|
1629
|
+
import { z as z28 } from "zod";
|
|
1630
|
+
var ProgressBar = z28.looseObject({
|
|
1631
|
+
type: z28.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
1607
1632
|
});
|
|
1608
1633
|
|
|
1609
1634
|
// src/schema/widgets/rebuyButton.ts
|
|
1610
|
-
import { z as
|
|
1611
|
-
var RebuyButtonV1 =
|
|
1612
|
-
type:
|
|
1613
|
-
version:
|
|
1635
|
+
import { z as z29 } from "zod";
|
|
1636
|
+
var RebuyButtonV1 = z29.looseObject({
|
|
1637
|
+
type: z29.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
1638
|
+
version: z29.literal(1)
|
|
1614
1639
|
});
|
|
1615
|
-
var RebuyButton =
|
|
1640
|
+
var RebuyButton = z29.discriminatedUnion("version", [
|
|
1616
1641
|
RebuyButtonV1,
|
|
1617
1642
|
CABRootSection.extend({
|
|
1618
|
-
type:
|
|
1643
|
+
type: z29.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
1619
1644
|
})
|
|
1620
1645
|
]);
|
|
1621
1646
|
|
|
1622
1647
|
// src/schema/widgets/rebuyMonetize.ts
|
|
1623
|
-
import { z as
|
|
1624
|
-
var RebuyMonetize =
|
|
1625
|
-
type:
|
|
1648
|
+
import { z as z30 } from "zod";
|
|
1649
|
+
var RebuyMonetize = z30.looseObject({
|
|
1650
|
+
type: z30.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
1626
1651
|
});
|
|
1627
|
-
var RebuyMonetizeV1 =
|
|
1628
|
-
name:
|
|
1629
|
-
previewMode:
|
|
1652
|
+
var RebuyMonetizeV1 = z30.object({
|
|
1653
|
+
name: z30.string().nullable().optional(),
|
|
1654
|
+
previewMode: z30.boolean().optional(),
|
|
1630
1655
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
1631
|
-
privacyPolicyUrl:
|
|
1656
|
+
privacyPolicyUrl: z30.string().nullable().optional(),
|
|
1632
1657
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
1633
|
-
subVertical:
|
|
1634
|
-
tracking:
|
|
1635
|
-
enableAttribution:
|
|
1636
|
-
enableSource:
|
|
1637
|
-
enableWidget:
|
|
1658
|
+
subVertical: z30.string().nullable().optional(),
|
|
1659
|
+
tracking: z30.object({
|
|
1660
|
+
enableAttribution: z30.boolean().optional(),
|
|
1661
|
+
enableSource: z30.boolean().optional(),
|
|
1662
|
+
enableWidget: z30.boolean().optional()
|
|
1638
1663
|
}).optional(),
|
|
1639
|
-
type:
|
|
1640
|
-
version:
|
|
1664
|
+
type: z30.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
1665
|
+
version: z30.literal(1),
|
|
1641
1666
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
1642
|
-
vertical:
|
|
1667
|
+
vertical: z30.string().nullable().optional()
|
|
1643
1668
|
});
|
|
1644
1669
|
|
|
1645
1670
|
// src/schema/widgetData.ts
|
|
@@ -1653,7 +1678,7 @@ var extensionWidgetTypes = [
|
|
|
1653
1678
|
WidgetType.ui_extension_line_item_editor,
|
|
1654
1679
|
WidgetType.ui_extension_progress_bar
|
|
1655
1680
|
];
|
|
1656
|
-
var WidgetData =
|
|
1681
|
+
var WidgetData = z31.discriminatedUnion("type", [
|
|
1657
1682
|
ABTestingPlaceholder,
|
|
1658
1683
|
CheckoutExtension,
|
|
1659
1684
|
ContentBlock,
|
|
@@ -114,6 +114,10 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
114
114
|
rows: "rows";
|
|
115
115
|
grid: "grid";
|
|
116
116
|
}>>;
|
|
117
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
callout: "callout";
|
|
119
|
+
"offer-content": "offer-content";
|
|
120
|
+
}>>;
|
|
117
121
|
grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
118
122
|
columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
|
|
119
123
|
rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
|
|
@@ -140,6 +144,10 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
140
144
|
}>>;
|
|
141
145
|
viewUrl: z.ZodOptional<z.ZodString>;
|
|
142
146
|
width: z.ZodDefault<z.ZodNumber>;
|
|
147
|
+
wrapping: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
breakAt: z.ZodNumber;
|
|
149
|
+
maxPerLine: z.ZodNumber;
|
|
150
|
+
}, z.core.$strip>>;
|
|
143
151
|
mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
144
152
|
effect: z.ZodDefault<z.ZodEnum<{
|
|
145
153
|
set_false: "set_false";
|
|
@@ -472,6 +480,10 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
472
480
|
rows: "rows";
|
|
473
481
|
grid: "grid";
|
|
474
482
|
}>>;
|
|
483
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
484
|
+
callout: "callout";
|
|
485
|
+
"offer-content": "offer-content";
|
|
486
|
+
}>>;
|
|
475
487
|
grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
476
488
|
columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
|
|
477
489
|
rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
|
|
@@ -498,6 +510,10 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
498
510
|
}>>;
|
|
499
511
|
viewUrl: z.ZodOptional<z.ZodString>;
|
|
500
512
|
width: z.ZodDefault<z.ZodNumber>;
|
|
513
|
+
wrapping: z.ZodOptional<z.ZodObject<{
|
|
514
|
+
breakAt: z.ZodNumber;
|
|
515
|
+
maxPerLine: z.ZodNumber;
|
|
516
|
+
}, z.core.$strip>>;
|
|
501
517
|
mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
502
518
|
effect: z.ZodDefault<z.ZodEnum<{
|
|
503
519
|
set_false: "set_false";
|
|
@@ -807,6 +823,10 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
807
823
|
rows: "rows";
|
|
808
824
|
grid: "grid";
|
|
809
825
|
}>>;
|
|
826
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
827
|
+
callout: "callout";
|
|
828
|
+
"offer-content": "offer-content";
|
|
829
|
+
}>>;
|
|
810
830
|
grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
811
831
|
columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
|
|
812
832
|
rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
|
|
@@ -833,6 +853,10 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
833
853
|
}>>;
|
|
834
854
|
viewUrl: z.ZodOptional<z.ZodString>;
|
|
835
855
|
width: z.ZodDefault<z.ZodNumber>;
|
|
856
|
+
wrapping: z.ZodOptional<z.ZodObject<{
|
|
857
|
+
breakAt: z.ZodNumber;
|
|
858
|
+
maxPerLine: z.ZodNumber;
|
|
859
|
+
}, z.core.$strip>>;
|
|
836
860
|
mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
837
861
|
effect: z.ZodDefault<z.ZodEnum<{
|
|
838
862
|
set_false: "set_false";
|
|
@@ -232,6 +232,10 @@ export declare const CABBannerSection: z.ZodLazy<z.ZodObject<{
|
|
|
232
232
|
rows: "rows";
|
|
233
233
|
grid: "grid";
|
|
234
234
|
}>>;
|
|
235
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
236
|
+
callout: "callout";
|
|
237
|
+
"offer-content": "offer-content";
|
|
238
|
+
}>>;
|
|
235
239
|
padding: z.ZodDefault<z.ZodEnum<{
|
|
236
240
|
none: "none";
|
|
237
241
|
base: "base";
|
|
@@ -250,6 +254,10 @@ export declare const CABBannerSection: z.ZodLazy<z.ZodObject<{
|
|
|
250
254
|
extraLoose: "extraLoose";
|
|
251
255
|
}>>;
|
|
252
256
|
viewUrl: z.ZodOptional<z.ZodString>;
|
|
257
|
+
wrapping: z.ZodOptional<z.ZodObject<{
|
|
258
|
+
breakAt: z.ZodNumber;
|
|
259
|
+
maxPerLine: z.ZodNumber;
|
|
260
|
+
}, z.core.$strip>>;
|
|
253
261
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
254
262
|
declineAllOffers: "declineAllOffers";
|
|
255
263
|
declineOffer: "declineOffer";
|
|
@@ -257,6 +257,10 @@ export declare const CABCarouselSection: z.ZodLazy<z.ZodObject<{
|
|
|
257
257
|
rows: "rows";
|
|
258
258
|
grid: "grid";
|
|
259
259
|
}>>;
|
|
260
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
261
|
+
callout: "callout";
|
|
262
|
+
"offer-content": "offer-content";
|
|
263
|
+
}>>;
|
|
260
264
|
padding: z.ZodDefault<z.ZodEnum<{
|
|
261
265
|
none: "none";
|
|
262
266
|
base: "base";
|
|
@@ -274,6 +278,10 @@ export declare const CABCarouselSection: z.ZodLazy<z.ZodObject<{
|
|
|
274
278
|
extraLoose: "extraLoose";
|
|
275
279
|
}>>;
|
|
276
280
|
viewUrl: z.ZodOptional<z.ZodString>;
|
|
281
|
+
wrapping: z.ZodOptional<z.ZodObject<{
|
|
282
|
+
breakAt: z.ZodNumber;
|
|
283
|
+
maxPerLine: z.ZodNumber;
|
|
284
|
+
}, z.core.$strip>>;
|
|
277
285
|
autoAdvanceInterval: z.ZodDefault<z.ZodNumber>;
|
|
278
286
|
itemsAtOnce: z.ZodDefault<z.ZodNumber>;
|
|
279
287
|
offersDirection: z.ZodDefault<z.ZodEnum<{
|
|
@@ -256,6 +256,10 @@ export declare const CABCartLineSection: z.ZodLazy<z.ZodObject<{
|
|
|
256
256
|
rows: "rows";
|
|
257
257
|
grid: "grid";
|
|
258
258
|
}>>;
|
|
259
|
+
frame: z.ZodOptional<z.ZodEnum<{
|
|
260
|
+
callout: "callout";
|
|
261
|
+
"offer-content": "offer-content";
|
|
262
|
+
}>>;
|
|
259
263
|
padding: z.ZodDefault<z.ZodEnum<{
|
|
260
264
|
none: "none";
|
|
261
265
|
base: "base";
|
|
@@ -273,6 +277,10 @@ export declare const CABCartLineSection: z.ZodLazy<z.ZodObject<{
|
|
|
273
277
|
extraLoose: "extraLoose";
|
|
274
278
|
}>>;
|
|
275
279
|
viewUrl: z.ZodOptional<z.ZodString>;
|
|
280
|
+
wrapping: z.ZodOptional<z.ZodObject<{
|
|
281
|
+
breakAt: z.ZodNumber;
|
|
282
|
+
maxPerLine: z.ZodNumber;
|
|
283
|
+
}, z.core.$strip>>;
|
|
276
284
|
sections: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodLazy<z.ZodType<CABSection, unknown, z.core.$ZodTypeInternals<CABSection, unknown>>>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
|
|
277
285
|
sectionType: z.ZodDefault<z.ZodLiteral<"cartLine">>;
|
|
278
286
|
}, z.core.$strip>>;
|
|
@@ -173,6 +173,17 @@ export declare const LanguageKey: {
|
|
|
173
173
|
};
|
|
174
174
|
export type LanguageKey = (typeof languageKeys)[number];
|
|
175
175
|
/** Runtime cart/order events a variable mutator can fire on (the events phase of REB-22472). */
|
|
176
|
+
/**
|
|
177
|
+
* Platform chrome a `layout` can wear. A frame changes how a renderer wraps the section, never its data, so a
|
|
178
|
+
* framed section stays a plain `layout` rather than becoming its own section type (a `callout` is passive
|
|
179
|
+
* offer framing with a subdued box and block borders; a `banner` is status feedback and stays separate).
|
|
180
|
+
*/
|
|
181
|
+
export declare const layoutFrames: readonly ["callout", "offer-content"];
|
|
182
|
+
export declare const LayoutFrame: {
|
|
183
|
+
readonly callout: "callout";
|
|
184
|
+
readonly "offer-content": "offer-content";
|
|
185
|
+
};
|
|
186
|
+
export type LayoutFrame = (typeof layoutFrames)[number];
|
|
176
187
|
export declare const mutatorEvents: readonly ["item_added", "quantity_changed", "variant_selected"];
|
|
177
188
|
export declare const MutatorEvent: {
|
|
178
189
|
readonly item_added: "item_added";
|
|
@@ -255,7 +266,7 @@ export declare const ReviewsSize: {
|
|
|
255
266
|
readonly large: "large";
|
|
256
267
|
};
|
|
257
268
|
export type ReviewsSize = (typeof reviewsSizes)[number];
|
|
258
|
-
export declare const sectionTypes: readonly ["banner", "button", "carousel", "cartLine", "dataSource", "discount", "image", "layout", "monetize", "offers", "product", "products", "progressBar", "quantity", "reviews", "text", "variants"];
|
|
269
|
+
export declare const sectionTypes: readonly ["banner", "button", "carousel", "cartLine", "dataSource", "discount", "image", "layout", "monetize", "offers", "product", "products", "progressBar", "quantity", "reviews", "separator", "text", "variants"];
|
|
259
270
|
export declare const SectionType: {
|
|
260
271
|
readonly product: "product";
|
|
261
272
|
readonly products: "products";
|
|
@@ -273,6 +284,7 @@ export declare const SectionType: {
|
|
|
273
284
|
readonly progressBar: "progressBar";
|
|
274
285
|
readonly quantity: "quantity";
|
|
275
286
|
readonly reviews: "reviews";
|
|
287
|
+
readonly separator: "separator";
|
|
276
288
|
readonly text: "text";
|
|
277
289
|
};
|
|
278
290
|
export type SectionType = (typeof sectionTypes)[number];
|