@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
|
@@ -15,6 +15,61 @@ export declare const PostPurchaseShadowSelectionSchema: z.ZodDiscriminatedUnion<
|
|
|
15
15
|
verdict: z.ZodLiteral<"skip">;
|
|
16
16
|
}, z.core.$strip>], "verdict">;
|
|
17
17
|
export type PostPurchaseShadowSelection = z.infer<typeof PostPurchaseShadowSelectionSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* The shadow report's fields WITHOUT the status/differences cross-field refinements below — the derivable
|
|
20
|
+
* base. `PostPurchaseShadowReportSchema` was a plain `ZodObject` before those refinements were added, and
|
|
21
|
+
* zod 4 rejects `.omit()`/`.pick()`/`.partial()` on an object schema carrying checks (see
|
|
22
|
+
* `src/schema/widgets/checkout-and-beyond/image.ts:74-82` for the same tradeoff): a consumer already
|
|
23
|
+
* deriving from the published schema would start throwing at module-eval. Derive from this instead when
|
|
24
|
+
* you need the unavailable three; everything that parses a wire report uses
|
|
25
|
+
* {@link PostPurchaseShadowReportSchema}.
|
|
26
|
+
*/
|
|
27
|
+
export declare const PostPurchaseShadowReportFields: z.ZodObject<{
|
|
28
|
+
differences: z.ZodArray<z.ZodEnum<{
|
|
29
|
+
entry: "entry";
|
|
30
|
+
verdict: "verdict";
|
|
31
|
+
targeting: "targeting";
|
|
32
|
+
"incomplete-capture": "incomplete-capture";
|
|
33
|
+
"unsupported-configuration": "unsupported-configuration";
|
|
34
|
+
}>>;
|
|
35
|
+
legacySelection: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
|
+
entry: z.ZodObject<{
|
|
37
|
+
blockId: z.ZodNumber;
|
|
38
|
+
blockIndex: z.ZodString;
|
|
39
|
+
blockParentIndex: z.ZodString;
|
|
40
|
+
flowId: z.ZodNumber;
|
|
41
|
+
sectionId: z.ZodNumber;
|
|
42
|
+
widgetId: z.ZodNumber;
|
|
43
|
+
widgetTraffic: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
verdict: z.ZodLiteral<"render">;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
verdict: z.ZodLiteral<"skip">;
|
|
48
|
+
}, z.core.$strip>], "verdict">;
|
|
49
|
+
phase: z.ZodLiteral<"shouldRender">;
|
|
50
|
+
sampleId: z.ZodString;
|
|
51
|
+
serverSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
|
+
entry: z.ZodObject<{
|
|
53
|
+
blockId: z.ZodNumber;
|
|
54
|
+
blockIndex: z.ZodString;
|
|
55
|
+
blockParentIndex: z.ZodString;
|
|
56
|
+
flowId: z.ZodNumber;
|
|
57
|
+
sectionId: z.ZodNumber;
|
|
58
|
+
widgetId: z.ZodNumber;
|
|
59
|
+
widgetTraffic: z.ZodNumber;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
verdict: z.ZodLiteral<"render">;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
verdict: z.ZodLiteral<"skip">;
|
|
64
|
+
}, z.core.$strip>], "verdict">>;
|
|
65
|
+
status: z.ZodEnum<{
|
|
66
|
+
match: "match";
|
|
67
|
+
diverged: "diverged";
|
|
68
|
+
incomplete: "incomplete";
|
|
69
|
+
}>;
|
|
70
|
+
targetingFlowIds: z.ZodArray<z.ZodNumber>;
|
|
71
|
+
workflowPhase: z.ZodLiteral<"decide">;
|
|
72
|
+
}, z.core.$strip>;
|
|
18
73
|
/**
|
|
19
74
|
* A shadow comparison between the legacy client-side selection and the Decider's own — wire-only. The
|
|
20
75
|
* sampled request/capture shape (`ShadowSampleSchema` upstream, with its Flow-listing and product data)
|
|
@@ -22,8 +77,8 @@ export type PostPurchaseShadowSelection = z.infer<typeof PostPurchaseShadowSelec
|
|
|
22
77
|
*/
|
|
23
78
|
export declare const PostPurchaseShadowReportSchema: z.ZodObject<{
|
|
24
79
|
differences: z.ZodArray<z.ZodEnum<{
|
|
25
|
-
verdict: "verdict";
|
|
26
80
|
entry: "entry";
|
|
81
|
+
verdict: "verdict";
|
|
27
82
|
targeting: "targeting";
|
|
28
83
|
"incomplete-capture": "incomplete-capture";
|
|
29
84
|
"unsupported-configuration": "unsupported-configuration";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const POST_PURCHASE_SKIP_LIMIT = 32;
|
|
3
3
|
/** This request's verified reads, not a claim about the path of a competing committed winner. */
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const PostPurchaseSkipTraceSchema: z.ZodArray<z.ZodObject<{
|
|
5
5
|
entry: z.ZodObject<{
|
|
6
6
|
blockId: z.ZodNumber;
|
|
7
7
|
blockIndex: z.ZodString;
|
|
@@ -16,4 +16,4 @@ export declare const PostPurchaseSkipTrace: z.ZodArray<z.ZodObject<{
|
|
|
16
16
|
"no-eligible-subscription": "no-eligible-subscription";
|
|
17
17
|
}>;
|
|
18
18
|
}, z.core.$strip>>;
|
|
19
|
-
export type PostPurchaseSkipTrace = z.infer<typeof
|
|
19
|
+
export type PostPurchaseSkipTrace = z.infer<typeof PostPurchaseSkipTraceSchema>;
|
|
@@ -24,7 +24,7 @@ __export(widgetData_exports, {
|
|
|
24
24
|
extensionWidgetTypes: () => extensionWidgetTypes
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(widgetData_exports);
|
|
27
|
-
var
|
|
27
|
+
var import_zod31 = require("zod");
|
|
28
28
|
|
|
29
29
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
30
30
|
var import_zod = require("zod");
|
|
@@ -142,6 +142,8 @@ var languageKeys = [
|
|
|
142
142
|
"zh"
|
|
143
143
|
];
|
|
144
144
|
var LanguageKey = freezeEnum(languageKeys);
|
|
145
|
+
var layoutFrames = ["callout", "offer-content"];
|
|
146
|
+
var LayoutFrame = freezeEnum(layoutFrames);
|
|
145
147
|
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
146
148
|
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
147
149
|
var objectFits = ["cover", "contain"];
|
|
@@ -180,6 +182,7 @@ var sectionTypes = [
|
|
|
180
182
|
"progressBar",
|
|
181
183
|
"quantity",
|
|
182
184
|
"reviews",
|
|
185
|
+
"separator",
|
|
183
186
|
"text",
|
|
184
187
|
"variants"
|
|
185
188
|
];
|
|
@@ -289,17 +292,17 @@ var CheckoutExtension = import_zod2.z.looseObject({
|
|
|
289
292
|
});
|
|
290
293
|
|
|
291
294
|
// src/schema/widgets/contentBlock.ts
|
|
292
|
-
var
|
|
295
|
+
var import_zod25 = require("zod");
|
|
293
296
|
|
|
294
297
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
295
|
-
var
|
|
298
|
+
var import_zod24 = require("zod");
|
|
296
299
|
|
|
297
300
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
298
|
-
var
|
|
299
|
-
var
|
|
301
|
+
var import_uuid13 = require("uuid");
|
|
302
|
+
var import_zod23 = require("zod");
|
|
300
303
|
|
|
301
304
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
302
|
-
var
|
|
305
|
+
var import_zod22 = require("zod");
|
|
303
306
|
|
|
304
307
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
305
308
|
var import_zod3 = require("zod");
|
|
@@ -1395,35 +1398,46 @@ var CABReviewsSection = import_zod19.z.object({
|
|
|
1395
1398
|
name: import_zod19.z.string().optional(),
|
|
1396
1399
|
sectionId: import_zod19.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
1397
1400
|
sectionType: import_zod19.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
1398
|
-
size: import_zod19.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
1401
|
+
size: import_zod19.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
1402
|
+
strokeColor: import_zod19.z.string().default("#fadb14"),
|
|
1403
|
+
strokeWidth: import_zod19.z.number().nonnegative().default(0)
|
|
1399
1404
|
});
|
|
1400
1405
|
|
|
1401
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
1402
|
-
var import_compat3 = require("es-toolkit/compat");
|
|
1406
|
+
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
1403
1407
|
var import_uuid11 = require("uuid");
|
|
1404
1408
|
var import_zod20 = require("zod");
|
|
1405
|
-
var
|
|
1409
|
+
var CABSeparatorSection = import_zod20.z.object({
|
|
1406
1410
|
...CABVariableFields,
|
|
1407
|
-
hideOutOfStockVariants: import_zod20.z.boolean().default(false),
|
|
1408
|
-
name: import_zod20.z.string().optional(),
|
|
1409
1411
|
sectionId: import_zod20.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
1410
|
-
sectionType: import_zod20.z.literal(SectionType.
|
|
1411
|
-
|
|
1412
|
-
|
|
1412
|
+
sectionType: import_zod20.z.literal(SectionType.separator).default(SectionType.separator)
|
|
1413
|
+
});
|
|
1414
|
+
|
|
1415
|
+
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
1416
|
+
var import_compat3 = require("es-toolkit/compat");
|
|
1417
|
+
var import_uuid12 = require("uuid");
|
|
1418
|
+
var import_zod21 = require("zod");
|
|
1419
|
+
var CABVariantsSection = import_zod21.z.object({
|
|
1420
|
+
...CABVariableFields,
|
|
1421
|
+
hideOutOfStockVariants: import_zod21.z.boolean().default(false),
|
|
1422
|
+
name: import_zod21.z.string().optional(),
|
|
1423
|
+
sectionId: import_zod21.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
1424
|
+
sectionType: import_zod21.z.literal(SectionType.variants).default(SectionType.variants),
|
|
1425
|
+
selector: import_zod21.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
1426
|
+
variantMode: import_zod21.z.enum(variantModes).default(VariantMode.multiple)
|
|
1413
1427
|
});
|
|
1414
1428
|
|
|
1415
1429
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1416
|
-
var CABBorder =
|
|
1417
|
-
radius:
|
|
1418
|
-
style:
|
|
1419
|
-
width:
|
|
1430
|
+
var CABBorder = import_zod22.z.object({
|
|
1431
|
+
radius: import_zod22.z.enum(borderRadii).default(BorderRadius.base),
|
|
1432
|
+
style: import_zod22.z.enum(borderStyles).default(BorderStyle.none),
|
|
1433
|
+
width: import_zod22.z.enum(borderWidths).default(BorderWidth.base)
|
|
1420
1434
|
}).default({
|
|
1421
1435
|
radius: BorderRadius.base,
|
|
1422
1436
|
style: BorderStyle.none,
|
|
1423
1437
|
width: BorderWidth.base
|
|
1424
1438
|
});
|
|
1425
|
-
var CABSection =
|
|
1426
|
-
() =>
|
|
1439
|
+
var CABSection = import_zod22.z.lazy(
|
|
1440
|
+
() => import_zod22.z.discriminatedUnion("sectionType", [
|
|
1427
1441
|
CABBannerSection,
|
|
1428
1442
|
CABButtonSection,
|
|
1429
1443
|
CABCarouselSection,
|
|
@@ -1439,38 +1453,49 @@ var CABSection = import_zod21.z.lazy(
|
|
|
1439
1453
|
CABProgressBarSection,
|
|
1440
1454
|
CABQuantitySection,
|
|
1441
1455
|
CABReviewsSection,
|
|
1456
|
+
CABSeparatorSection,
|
|
1442
1457
|
CABTextSection,
|
|
1443
1458
|
CABVariantsSection
|
|
1444
1459
|
])
|
|
1445
1460
|
);
|
|
1446
1461
|
|
|
1447
1462
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1448
|
-
var GridItem =
|
|
1449
|
-
var
|
|
1463
|
+
var GridItem = import_zod23.z.union([import_zod23.z.literal("auto"), import_zod23.z.literal("fill"), import_zod23.z.string().regex(/^\d+%$/), import_zod23.z.number()]);
|
|
1464
|
+
var CABLayoutWrapping = import_zod23.z.object({
|
|
1465
|
+
breakAt: import_zod23.z.number().positive(),
|
|
1466
|
+
maxPerLine: import_zod23.z.number().int().positive()
|
|
1467
|
+
});
|
|
1468
|
+
var CABLayoutSection = import_zod23.z.object({
|
|
1450
1469
|
...CABVariableFields,
|
|
1451
|
-
alignment:
|
|
1452
|
-
horizontal:
|
|
1453
|
-
vertical:
|
|
1470
|
+
alignment: import_zod23.z.object({
|
|
1471
|
+
horizontal: import_zod23.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
1472
|
+
vertical: import_zod23.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
1454
1473
|
}).default({
|
|
1455
1474
|
horizontal: HorizontalAlignment.start,
|
|
1456
1475
|
vertical: VerticalAlignment.top
|
|
1457
1476
|
}),
|
|
1458
|
-
border:
|
|
1459
|
-
buttonField:
|
|
1460
|
-
direction:
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1477
|
+
border: import_zod23.z.lazy(() => CABBorder),
|
|
1478
|
+
buttonField: import_zod23.z.enum(buttonFields).optional(),
|
|
1479
|
+
direction: import_zod23.z.enum(directions).default(Direction.rows),
|
|
1480
|
+
/**
|
|
1481
|
+
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1482
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
1483
|
+
*/
|
|
1484
|
+
frame: import_zod23.z.enum(layoutFrames).optional(),
|
|
1485
|
+
grid: import_zod23.z.object({
|
|
1486
|
+
columns: import_zod23.z.union([import_zod23.z.array(GridItem), import_zod23.z.undefined()]).default(() => ["auto"]),
|
|
1487
|
+
rows: import_zod23.z.union([import_zod23.z.array(GridItem), import_zod23.z.undefined()]).default(() => ["auto"])
|
|
1464
1488
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
1465
|
-
name:
|
|
1466
|
-
padding:
|
|
1467
|
-
sectionId:
|
|
1468
|
-
sections:
|
|
1469
|
-
sectionType:
|
|
1470
|
-
spacing:
|
|
1489
|
+
name: import_zod23.z.string().optional(),
|
|
1490
|
+
padding: import_zod23.z.enum(spacings).default(Spacing.none),
|
|
1491
|
+
sectionId: import_zod23.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
1492
|
+
sections: import_zod23.z.union([import_zod23.z.array(import_zod23.z.lazy(() => CABSection)), import_zod23.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1493
|
+
sectionType: import_zod23.z.literal(SectionType.layout).default(SectionType.layout),
|
|
1494
|
+
spacing: import_zod23.z.enum(spacings).default(Spacing.base),
|
|
1471
1495
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
1472
|
-
viewUrl:
|
|
1473
|
-
width:
|
|
1496
|
+
viewUrl: import_zod23.z.string().optional(),
|
|
1497
|
+
width: import_zod23.z.number().default(100),
|
|
1498
|
+
wrapping: CABLayoutWrapping.optional()
|
|
1474
1499
|
});
|
|
1475
1500
|
|
|
1476
1501
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -1491,8 +1516,8 @@ var UI_LABELS = {
|
|
|
1491
1516
|
};
|
|
1492
1517
|
|
|
1493
1518
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1494
|
-
var localized = (fallback) =>
|
|
1495
|
-
var CABUILabels =
|
|
1519
|
+
var localized = (fallback) => import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
1520
|
+
var CABUILabels = import_zod24.z.object({
|
|
1496
1521
|
currentPage: localized(UI_LABELS.currentPage),
|
|
1497
1522
|
guest: localized(UI_LABELS.guest),
|
|
1498
1523
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -1517,154 +1542,154 @@ var CABUILabels = import_zod23.z.object({
|
|
|
1517
1542
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
1518
1543
|
updating: { ...UI_LABELS.updating }
|
|
1519
1544
|
}));
|
|
1520
|
-
var TargetArea =
|
|
1521
|
-
fill:
|
|
1522
|
-
flip:
|
|
1523
|
-
icon:
|
|
1524
|
-
label:
|
|
1525
|
-
width:
|
|
1545
|
+
var TargetArea = import_zod24.z.object({
|
|
1546
|
+
fill: import_zod24.z.boolean().optional(),
|
|
1547
|
+
flip: import_zod24.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
1548
|
+
icon: import_zod24.z.string(),
|
|
1549
|
+
label: import_zod24.z.string(),
|
|
1550
|
+
width: import_zod24.z.string()
|
|
1526
1551
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
1527
|
-
var CABTracking =
|
|
1528
|
-
enableAttribution:
|
|
1529
|
-
enableSource:
|
|
1530
|
-
enableWidget:
|
|
1552
|
+
var CABTracking = import_zod24.z.object({
|
|
1553
|
+
enableAttribution: import_zod24.z.boolean().nullish().transform((value) => value ?? true),
|
|
1554
|
+
enableSource: import_zod24.z.boolean().nullish().transform((value) => value ?? true),
|
|
1555
|
+
enableWidget: import_zod24.z.boolean().nullish().transform((value) => value ?? true)
|
|
1531
1556
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
1532
|
-
var CABExperiment =
|
|
1533
|
-
elementId:
|
|
1534
|
-
experimentId:
|
|
1535
|
-
experimentType:
|
|
1536
|
-
selectedId:
|
|
1557
|
+
var CABExperiment = import_zod24.z.object({
|
|
1558
|
+
elementId: import_zod24.z.number(),
|
|
1559
|
+
experimentId: import_zod24.z.number(),
|
|
1560
|
+
experimentType: import_zod24.z.string(),
|
|
1561
|
+
selectedId: import_zod24.z.number()
|
|
1537
1562
|
});
|
|
1538
1563
|
var CABRootSection = CABLayoutSection.extend({
|
|
1539
|
-
editorMode:
|
|
1564
|
+
editorMode: import_zod24.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
1540
1565
|
experiment: CABExperiment.optional(),
|
|
1541
1566
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
1542
1567
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
1543
|
-
previewMode:
|
|
1544
|
-
storeId:
|
|
1568
|
+
previewMode: import_zod24.z.boolean().nullish().transform((value) => value ?? false),
|
|
1569
|
+
storeId: import_zod24.z.number().nullable().default(null),
|
|
1545
1570
|
targetArea: TargetArea.nullable(),
|
|
1546
1571
|
tracking: CABTracking,
|
|
1547
|
-
type:
|
|
1572
|
+
type: import_zod24.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
1548
1573
|
uiLabels: CABUILabels,
|
|
1549
|
-
version:
|
|
1550
|
-
widgetId:
|
|
1574
|
+
version: import_zod24.z.literal(2).default(2),
|
|
1575
|
+
widgetId: import_zod24.z.number().nullable().default(null)
|
|
1551
1576
|
});
|
|
1552
1577
|
|
|
1553
1578
|
// src/schema/widgets/contentBlock.ts
|
|
1554
|
-
var ContentBlockV1 =
|
|
1555
|
-
blockSpacing:
|
|
1556
|
-
imageBlocks:
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
altText:
|
|
1560
|
-
description:
|
|
1561
|
-
id:
|
|
1562
|
-
imagePlacement:
|
|
1563
|
-
imageSize:
|
|
1564
|
-
imageUrl:
|
|
1565
|
-
textAlignment:
|
|
1579
|
+
var ContentBlockV1 = import_zod25.z.object({
|
|
1580
|
+
blockSpacing: import_zod25.z.enum(spacings).optional(),
|
|
1581
|
+
imageBlocks: import_zod25.z.union([
|
|
1582
|
+
import_zod25.z.array(
|
|
1583
|
+
import_zod25.z.object({
|
|
1584
|
+
altText: import_zod25.z.string().nullable(),
|
|
1585
|
+
description: import_zod25.z.string().nullable(),
|
|
1586
|
+
id: import_zod25.z.uuid(),
|
|
1587
|
+
imagePlacement: import_zod25.z.enum(["top", "right", "bottom", "left"]),
|
|
1588
|
+
imageSize: import_zod25.z.number(),
|
|
1589
|
+
imageUrl: import_zod25.z.url(),
|
|
1590
|
+
textAlignment: import_zod25.z.enum(["left", "center", "right"]),
|
|
1566
1591
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
1567
|
-
textSize:
|
|
1592
|
+
textSize: import_zod25.z.enum(inlineTextSizeNames)
|
|
1568
1593
|
})
|
|
1569
1594
|
),
|
|
1570
|
-
|
|
1595
|
+
import_zod25.z.strictObject({}).transform(() => [])
|
|
1571
1596
|
]).optional(),
|
|
1572
|
-
imageLayout:
|
|
1573
|
-
language:
|
|
1574
|
-
description:
|
|
1575
|
-
superTitle:
|
|
1576
|
-
title:
|
|
1597
|
+
imageLayout: import_zod25.z.enum(["row", "column"]).optional(),
|
|
1598
|
+
language: import_zod25.z.object({
|
|
1599
|
+
description: import_zod25.z.string(),
|
|
1600
|
+
superTitle: import_zod25.z.string(),
|
|
1601
|
+
title: import_zod25.z.string()
|
|
1577
1602
|
}),
|
|
1578
|
-
previewMode:
|
|
1579
|
-
type:
|
|
1580
|
-
version:
|
|
1603
|
+
previewMode: import_zod25.z.boolean(),
|
|
1604
|
+
type: import_zod25.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
1605
|
+
version: import_zod25.z.literal(1)
|
|
1581
1606
|
});
|
|
1582
|
-
var ContentBlock =
|
|
1607
|
+
var ContentBlock = import_zod25.z.discriminatedUnion("version", [
|
|
1583
1608
|
ContentBlockV1,
|
|
1584
1609
|
CABRootSection.extend({
|
|
1585
|
-
type:
|
|
1610
|
+
type: import_zod25.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
1586
1611
|
})
|
|
1587
1612
|
]);
|
|
1588
1613
|
|
|
1589
1614
|
// src/schema/widgets/giftWithPurchase.ts
|
|
1590
|
-
var
|
|
1591
|
-
var GiftWithPurchase =
|
|
1592
|
-
type:
|
|
1615
|
+
var import_zod26 = require("zod");
|
|
1616
|
+
var GiftWithPurchase = import_zod26.z.looseObject({
|
|
1617
|
+
type: import_zod26.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
1593
1618
|
});
|
|
1594
1619
|
|
|
1595
1620
|
// src/schema/widgets/lineItemEditor.ts
|
|
1596
|
-
var
|
|
1597
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
1598
|
-
downgradeToOneTimeLabel:
|
|
1621
|
+
var import_zod27 = require("zod");
|
|
1622
|
+
var LineItemEditorSwitchLanguageV1 = import_zod27.z.object({
|
|
1623
|
+
downgradeToOneTimeLabel: import_zod27.z.string().optional(),
|
|
1599
1624
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
1600
|
-
subscriptionOptionLabel:
|
|
1601
|
-
upgradeToSubscriptionLabel:
|
|
1602
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
1625
|
+
subscriptionOptionLabel: import_zod27.z.string().optional(),
|
|
1626
|
+
upgradeToSubscriptionLabel: import_zod27.z.string().optional(),
|
|
1627
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod27.z.string().optional()
|
|
1603
1628
|
});
|
|
1604
|
-
var LineItemEditorV1 =
|
|
1629
|
+
var LineItemEditorV1 = import_zod27.z.object({
|
|
1605
1630
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
1606
|
-
button:
|
|
1607
|
-
previewMode:
|
|
1608
|
-
switchToSubscription:
|
|
1609
|
-
disableDowngrade:
|
|
1631
|
+
button: import_zod27.z.object({ kind: import_zod27.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
1632
|
+
previewMode: import_zod27.z.boolean().optional(),
|
|
1633
|
+
switchToSubscription: import_zod27.z.object({
|
|
1634
|
+
disableDowngrade: import_zod27.z.boolean().optional(),
|
|
1610
1635
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
1611
1636
|
}).optional(),
|
|
1612
|
-
switchToSubscriptionEnabled:
|
|
1613
|
-
tracking:
|
|
1614
|
-
enableAttribution:
|
|
1615
|
-
enableSource:
|
|
1616
|
-
enableWidget:
|
|
1637
|
+
switchToSubscriptionEnabled: import_zod27.z.boolean().optional(),
|
|
1638
|
+
tracking: import_zod27.z.object({
|
|
1639
|
+
enableAttribution: import_zod27.z.boolean().optional(),
|
|
1640
|
+
enableSource: import_zod27.z.boolean().optional(),
|
|
1641
|
+
enableWidget: import_zod27.z.boolean().optional()
|
|
1617
1642
|
}).optional(),
|
|
1618
|
-
type:
|
|
1619
|
-
version:
|
|
1643
|
+
type: import_zod27.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
1644
|
+
version: import_zod27.z.literal(1)
|
|
1620
1645
|
});
|
|
1621
|
-
var LineItemEditor =
|
|
1646
|
+
var LineItemEditor = import_zod27.z.discriminatedUnion("version", [
|
|
1622
1647
|
LineItemEditorV1,
|
|
1623
1648
|
CABRootSection.extend({
|
|
1624
|
-
type:
|
|
1649
|
+
type: import_zod27.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
1625
1650
|
})
|
|
1626
1651
|
]);
|
|
1627
1652
|
|
|
1628
1653
|
// src/schema/widgets/progressBar.ts
|
|
1629
|
-
var
|
|
1630
|
-
var ProgressBar =
|
|
1631
|
-
type:
|
|
1654
|
+
var import_zod28 = require("zod");
|
|
1655
|
+
var ProgressBar = import_zod28.z.looseObject({
|
|
1656
|
+
type: import_zod28.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
1632
1657
|
});
|
|
1633
1658
|
|
|
1634
1659
|
// src/schema/widgets/rebuyButton.ts
|
|
1635
|
-
var
|
|
1636
|
-
var RebuyButtonV1 =
|
|
1637
|
-
type:
|
|
1638
|
-
version:
|
|
1660
|
+
var import_zod29 = require("zod");
|
|
1661
|
+
var RebuyButtonV1 = import_zod29.z.looseObject({
|
|
1662
|
+
type: import_zod29.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
1663
|
+
version: import_zod29.z.literal(1)
|
|
1639
1664
|
});
|
|
1640
|
-
var RebuyButton =
|
|
1665
|
+
var RebuyButton = import_zod29.z.discriminatedUnion("version", [
|
|
1641
1666
|
RebuyButtonV1,
|
|
1642
1667
|
CABRootSection.extend({
|
|
1643
|
-
type:
|
|
1668
|
+
type: import_zod29.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
1644
1669
|
})
|
|
1645
1670
|
]);
|
|
1646
1671
|
|
|
1647
1672
|
// src/schema/widgets/rebuyMonetize.ts
|
|
1648
|
-
var
|
|
1649
|
-
var RebuyMonetize =
|
|
1650
|
-
type:
|
|
1673
|
+
var import_zod30 = require("zod");
|
|
1674
|
+
var RebuyMonetize = import_zod30.z.looseObject({
|
|
1675
|
+
type: import_zod30.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
1651
1676
|
});
|
|
1652
|
-
var RebuyMonetizeV1 =
|
|
1653
|
-
name:
|
|
1654
|
-
previewMode:
|
|
1677
|
+
var RebuyMonetizeV1 = import_zod30.z.object({
|
|
1678
|
+
name: import_zod30.z.string().nullable().optional(),
|
|
1679
|
+
previewMode: import_zod30.z.boolean().optional(),
|
|
1655
1680
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
1656
|
-
privacyPolicyUrl:
|
|
1681
|
+
privacyPolicyUrl: import_zod30.z.string().nullable().optional(),
|
|
1657
1682
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
1658
|
-
subVertical:
|
|
1659
|
-
tracking:
|
|
1660
|
-
enableAttribution:
|
|
1661
|
-
enableSource:
|
|
1662
|
-
enableWidget:
|
|
1683
|
+
subVertical: import_zod30.z.string().nullable().optional(),
|
|
1684
|
+
tracking: import_zod30.z.object({
|
|
1685
|
+
enableAttribution: import_zod30.z.boolean().optional(),
|
|
1686
|
+
enableSource: import_zod30.z.boolean().optional(),
|
|
1687
|
+
enableWidget: import_zod30.z.boolean().optional()
|
|
1663
1688
|
}).optional(),
|
|
1664
|
-
type:
|
|
1665
|
-
version:
|
|
1689
|
+
type: import_zod30.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
1690
|
+
version: import_zod30.z.literal(1),
|
|
1666
1691
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
1667
|
-
vertical:
|
|
1692
|
+
vertical: import_zod30.z.string().nullable().optional()
|
|
1668
1693
|
});
|
|
1669
1694
|
|
|
1670
1695
|
// src/schema/widgetData.ts
|
|
@@ -1678,7 +1703,7 @@ var extensionWidgetTypes = [
|
|
|
1678
1703
|
WidgetType.ui_extension_line_item_editor,
|
|
1679
1704
|
WidgetType.ui_extension_progress_bar
|
|
1680
1705
|
];
|
|
1681
|
-
var WidgetData =
|
|
1706
|
+
var WidgetData = import_zod31.z.discriminatedUnion("type", [
|
|
1682
1707
|
ABTestingPlaceholder,
|
|
1683
1708
|
CheckoutExtension,
|
|
1684
1709
|
ContentBlock,
|