@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
package/dist/index.cjs
CHANGED
|
@@ -48,6 +48,7 @@ __export(src_exports, {
|
|
|
48
48
|
CABImageSectionFields: () => CABImageSectionFields,
|
|
49
49
|
CABIntegrations: () => CABIntegrations,
|
|
50
50
|
CABLayoutSection: () => CABLayoutSection,
|
|
51
|
+
CABLayoutWrapping: () => CABLayoutWrapping,
|
|
51
52
|
CABMonetizeAds: () => CABMonetizeAds,
|
|
52
53
|
CABMonetizeSection: () => CABMonetizeSection,
|
|
53
54
|
CABNumberVariable: () => CABNumberVariable,
|
|
@@ -65,6 +66,7 @@ __export(src_exports, {
|
|
|
65
66
|
CABRuleset: () => CABRuleset,
|
|
66
67
|
CABRulesetEntry: () => CABRulesetEntry,
|
|
67
68
|
CABSection: () => CABSection,
|
|
69
|
+
CABSeparatorSection: () => CABSeparatorSection,
|
|
68
70
|
CABTextSection: () => CABTextSection,
|
|
69
71
|
CABTextTier: () => CABTextTier,
|
|
70
72
|
CABTextVariable: () => CABTextVariable,
|
|
@@ -99,12 +101,14 @@ __export(src_exports, {
|
|
|
99
101
|
DiscountSource: () => DiscountSource,
|
|
100
102
|
DiscountType: () => DiscountType,
|
|
101
103
|
EditorMode: () => EditorMode,
|
|
104
|
+
ExitPolicySchema: () => ExitPolicySchema,
|
|
102
105
|
GIFT_LABELS: () => GIFT_LABELS,
|
|
103
106
|
Geolocation: () => Geolocation,
|
|
104
107
|
GiftWithPurchase: () => GiftWithPurchase,
|
|
105
108
|
GridItem: () => GridItem,
|
|
106
109
|
HEX_COLOR_REGEX: () => HEX_COLOR_REGEX,
|
|
107
110
|
HTML_TAGS_REGEX: () => HTML_TAGS_REGEX,
|
|
111
|
+
HoldSettingSchema: () => HoldSettingSchema,
|
|
108
112
|
HorizontalAlignment: () => HorizontalAlignment,
|
|
109
113
|
IconName: () => IconName,
|
|
110
114
|
IconSize: () => IconSize,
|
|
@@ -114,6 +118,7 @@ __export(src_exports, {
|
|
|
114
118
|
ImageContentBlock: () => ImageContentBlock,
|
|
115
119
|
InlineTextSizeName: () => InlineTextSizeName,
|
|
116
120
|
LanguageKey: () => LanguageKey,
|
|
121
|
+
LayoutFrame: () => LayoutFrame,
|
|
117
122
|
LineItemEditor: () => LineItemEditor,
|
|
118
123
|
LineItemEditorSwitchLanguageV1: () => LineItemEditorSwitchLanguageV1,
|
|
119
124
|
LineItemEditorV1: () => LineItemEditorV1,
|
|
@@ -124,17 +129,20 @@ __export(src_exports, {
|
|
|
124
129
|
ObjectFit: () => ObjectFit,
|
|
125
130
|
OfferProduct: () => OfferProduct,
|
|
126
131
|
OffersDirection: () => OffersDirection,
|
|
132
|
+
OrderDecisionSchema: () => OrderDecisionSchema,
|
|
127
133
|
POST_PURCHASE_SKIP_LIMIT: () => POST_PURCHASE_SKIP_LIMIT,
|
|
128
134
|
PayButtonBlock: () => PayButtonBlock,
|
|
129
135
|
PopoverPosition: () => PopoverPosition,
|
|
136
|
+
PostPurchaseAppIdSchema: () => PostPurchaseAppIdSchema,
|
|
130
137
|
PostPurchaseBlock: () => PostPurchaseBlock,
|
|
131
138
|
PostPurchaseOffer: () => PostPurchaseOffer,
|
|
132
139
|
PostPurchaseOrderIdSchema: () => PostPurchaseOrderIdSchema,
|
|
133
140
|
PostPurchaseSettings: () => PostPurchaseSettings,
|
|
141
|
+
PostPurchaseShadowReportFields: () => PostPurchaseShadowReportFields,
|
|
134
142
|
PostPurchaseShadowReportSchema: () => PostPurchaseShadowReportSchema,
|
|
135
143
|
PostPurchaseShadowSelectionSchema: () => PostPurchaseShadowSelectionSchema,
|
|
136
|
-
|
|
137
|
-
|
|
144
|
+
PostPurchaseSkipReasonSchema: () => PostPurchaseSkipReasonSchema,
|
|
145
|
+
PostPurchaseSkipTraceSchema: () => PostPurchaseSkipTraceSchema,
|
|
138
146
|
PostPurchaseTimestampSchema: () => PostPurchaseTimestampSchema,
|
|
139
147
|
PostPurchaseWidget: () => PostPurchaseWidget,
|
|
140
148
|
PostPurchaseWidgetLinkedFlow: () => PostPurchaseWidgetLinkedFlow,
|
|
@@ -148,6 +156,7 @@ __export(src_exports, {
|
|
|
148
156
|
QuantityInput: () => QuantityInput,
|
|
149
157
|
REVIEW_LABELS: () => REVIEW_LABELS,
|
|
150
158
|
ROOT_RELATIVE_PATH_REGEX: () => ROOT_RELATIVE_PATH_REGEX,
|
|
159
|
+
ReadySessionTimingSchema: () => ReadySessionTimingSchema,
|
|
151
160
|
RebuyButton: () => RebuyButton,
|
|
152
161
|
RebuyButtonV1: () => RebuyButtonV1,
|
|
153
162
|
RebuyClient: () => RebuyClient,
|
|
@@ -164,9 +173,18 @@ __export(src_exports, {
|
|
|
164
173
|
STATIC_ENDPOINTS: () => STATIC_ENDPOINTS,
|
|
165
174
|
SWITCH_LABELS: () => SWITCH_LABELS,
|
|
166
175
|
SectionType: () => SectionType,
|
|
176
|
+
SelectionClaimsSchema: () => SelectionClaimsSchema,
|
|
167
177
|
SellingPlanGroup: () => SellingPlanGroup,
|
|
168
178
|
SeparatorBlock: () => SeparatorBlock,
|
|
169
179
|
Session: () => Session,
|
|
180
|
+
SessionCloseRequestSchema: () => SessionCloseRequestSchema,
|
|
181
|
+
SessionCloseResponseSchema: () => SessionCloseResponseSchema,
|
|
182
|
+
SessionClosureSchema: () => SessionClosureSchema,
|
|
183
|
+
SessionIdentitySchema: () => SessionIdentitySchema,
|
|
184
|
+
SessionOrderTimingSchema: () => SessionOrderTimingSchema,
|
|
185
|
+
SessionPolicySchema: () => SessionPolicySchema,
|
|
186
|
+
SessionStartRequestSchema: () => SessionStartRequestSchema,
|
|
187
|
+
SessionStartResponseSchema: () => SessionStartResponseSchema,
|
|
170
188
|
ShopConfig: () => ShopConfig,
|
|
171
189
|
ShopifyDomainSchema: () => ShopifyDomainSchema,
|
|
172
190
|
SmartCartBar: () => SmartCartBar,
|
|
@@ -181,6 +199,7 @@ __export(src_exports, {
|
|
|
181
199
|
TextColorName: () => TextColorName,
|
|
182
200
|
TextSizeName: () => TextSizeName,
|
|
183
201
|
TimerBlock: () => TimerBlock,
|
|
202
|
+
TimingSettingsSchema: () => TimingSettingsSchema,
|
|
184
203
|
TiptapDocument: () => TiptapDocument,
|
|
185
204
|
TiptapParagraph: () => TiptapParagraph,
|
|
186
205
|
TiptapText: () => TiptapText,
|
|
@@ -260,6 +279,7 @@ __export(src_exports, {
|
|
|
260
279
|
isTimerBlock: () => isTimerBlock,
|
|
261
280
|
isVariantsType: () => isVariantsType,
|
|
262
281
|
languageKeys: () => languageKeys,
|
|
282
|
+
layoutFrames: () => layoutFrames,
|
|
263
283
|
mutatorEvents: () => mutatorEvents,
|
|
264
284
|
objectFits: () => objectFits,
|
|
265
285
|
offersDirections: () => offersDirections,
|
|
@@ -1560,105 +1580,212 @@ var OfferProduct = import_zod5.z.object({
|
|
|
1560
1580
|
|
|
1561
1581
|
// src/schema/postPurchaseEligibility.ts
|
|
1562
1582
|
var import_zod6 = require("zod");
|
|
1563
|
-
var
|
|
1583
|
+
var PostPurchaseSkipReasonSchema = import_zod6.z.enum(["empty", "no-eligible-subscription"]);
|
|
1564
1584
|
|
|
1565
|
-
// src/schema/
|
|
1585
|
+
// src/schema/postPurchaseExitPolicy.ts
|
|
1566
1586
|
var import_zod7 = require("zod");
|
|
1567
|
-
var
|
|
1568
|
-
var
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1587
|
+
var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
|
|
1588
|
+
var ExitPolicySchema = import_zod7.z.discriminatedUnion("status", [
|
|
1589
|
+
import_zod7.z.strictObject({ status: import_zod7.z.literal("unavailable") }),
|
|
1590
|
+
import_zod7.z.strictObject({
|
|
1591
|
+
delayMs: import_zod7.z.number().int().nonnegative().max(EXIT_DELAY_MAX_MS),
|
|
1592
|
+
source: import_zod7.z.enum(["admitted", "selected-flow"]),
|
|
1593
|
+
status: import_zod7.z.literal("available")
|
|
1594
|
+
})
|
|
1595
|
+
]);
|
|
1596
|
+
|
|
1597
|
+
// src/schema/postPurchaseIdentity.ts
|
|
1598
|
+
var import_zod8 = require("zod");
|
|
1599
|
+
var POST_PURCHASE_ID_MAX = 128;
|
|
1600
|
+
var PostPurchaseTimestampSchema = import_zod8.z.number().int().nonnegative();
|
|
1601
|
+
var PostPurchaseOrderIdSchema = import_zod8.z.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
|
|
1602
|
+
var ShopifyDomainSchema = import_zod8.z.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
|
|
1603
|
+
var DecideRequestSchema = import_zod8.z.object({
|
|
1604
|
+
checkoutToken: import_zod8.z.string().min(1).max(POST_PURCHASE_ID_MAX),
|
|
1572
1605
|
shop: ShopifyDomainSchema
|
|
1573
1606
|
});
|
|
1574
|
-
var
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1607
|
+
var PostPurchaseAppIdSchema = import_zod8.z.string().min(1).max(POST_PURCHASE_ID_MAX);
|
|
1608
|
+
var DecisionEntrySchema = import_zod8.z.object({
|
|
1609
|
+
blockId: import_zod8.z.number().int().positive(),
|
|
1610
|
+
blockIndex: import_zod8.z.string(),
|
|
1611
|
+
blockParentIndex: import_zod8.z.string(),
|
|
1612
|
+
flowId: import_zod8.z.number().int().positive(),
|
|
1613
|
+
sectionId: import_zod8.z.number().int().positive(),
|
|
1614
|
+
widgetId: import_zod8.z.number().int().positive(),
|
|
1615
|
+
widgetTraffic: import_zod8.z.number().min(0).max(100)
|
|
1616
|
+
});
|
|
1617
|
+
|
|
1618
|
+
// src/schema/postPurchaseOrderDecision.ts
|
|
1619
|
+
var import_zod9 = require("zod");
|
|
1620
|
+
var OrderDecisionSchema = import_zod9.z.discriminatedUnion("owner", [
|
|
1621
|
+
import_zod9.z.object({ owner: import_zod9.z.literal("session"), sessionId: import_zod9.z.string().regex(/^[a-f0-9]{64}$/) }),
|
|
1622
|
+
import_zod9.z.object({ owner: import_zod9.z.literal("release"), sessionId: import_zod9.z.null() })
|
|
1623
|
+
]);
|
|
1624
|
+
|
|
1625
|
+
// src/schema/postPurchasePolicy.ts
|
|
1626
|
+
var import_zod10 = require("zod");
|
|
1627
|
+
var HoldSettingSchema = import_zod10.z.discriminatedUnion("enabled", [
|
|
1628
|
+
import_zod10.z.object({ durationMinutes: import_zod10.z.number().int().min(1).max(60), enabled: import_zod10.z.literal(true) }),
|
|
1629
|
+
import_zod10.z.object({ durationMinutes: import_zod10.z.null(), enabled: import_zod10.z.literal(false) })
|
|
1630
|
+
]);
|
|
1631
|
+
var TimingSettingsSchema = import_zod10.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
1632
|
+
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
1633
|
+
durationMinutes: import_zod10.z.number().int().min(1).max(60).nullable(),
|
|
1634
|
+
source: import_zod10.z.enum(["shop", "flow", "native"])
|
|
1635
|
+
}).refine(
|
|
1636
|
+
(policy) => {
|
|
1637
|
+
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
1638
|
+
const expectedDuration = expectedSource === "shop" ? policy.shopHold.durationMinutes : expectedSource === "flow" ? policy.flowHold.durationMinutes : null;
|
|
1639
|
+
return policy.source === expectedSource && policy.durationMinutes === expectedDuration;
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
message: "source and durationMinutes must reflect the shop-over-flow-over-native precedence",
|
|
1643
|
+
path: ["source"]
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1646
|
+
|
|
1647
|
+
// src/schema/postPurchaseSelection.ts
|
|
1648
|
+
var import_zod11 = require("zod");
|
|
1649
|
+
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
1650
|
+
appId: PostPurchaseAppIdSchema,
|
|
1651
|
+
entry: DecisionEntrySchema,
|
|
1652
|
+
iss: import_zod11.z.literal("rebuy-api"),
|
|
1653
|
+
purpose: import_zod11.z.literal("post-purchase-selection")
|
|
1654
|
+
});
|
|
1655
|
+
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
1656
|
+
selectionToken: import_zod11.z.string().min(1).max(8192).optional()
|
|
1657
|
+
}).strict();
|
|
1658
|
+
|
|
1659
|
+
// src/schema/postPurchaseSession.ts
|
|
1660
|
+
var import_zod12 = require("zod");
|
|
1661
|
+
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
1662
|
+
var SessionOrderTimingSchema = import_zod12.z.object({
|
|
1663
|
+
nativeDeadline: PostPurchaseTimestampSchema,
|
|
1664
|
+
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
1665
|
+
orderId: PostPurchaseOrderIdSchema,
|
|
1666
|
+
timingSource: import_zod12.z.literal("shopify-order-created-at")
|
|
1667
|
+
});
|
|
1668
|
+
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
1669
|
+
deadline: PostPurchaseTimestampSchema,
|
|
1670
|
+
entry: DecisionEntrySchema,
|
|
1671
|
+
policySnapshot: SessionPolicySchema,
|
|
1672
|
+
startedAt: PostPurchaseTimestampSchema
|
|
1673
|
+
}).refine((session) => session.orderCreatedAt <= session.startedAt, {
|
|
1674
|
+
message: "startedAt must not precede orderCreatedAt",
|
|
1675
|
+
path: ["startedAt"]
|
|
1676
|
+
}).refine((session) => session.startedAt <= session.deadline, {
|
|
1677
|
+
message: "deadline must not precede startedAt",
|
|
1678
|
+
path: ["deadline"]
|
|
1679
|
+
}).refine((session) => session.deadline <= session.nativeDeadline, {
|
|
1680
|
+
message: "deadline must not exceed nativeDeadline",
|
|
1681
|
+
path: ["deadline"]
|
|
1682
|
+
});
|
|
1683
|
+
var SessionStartResponseSchema = import_zod12.z.object({
|
|
1684
|
+
data: import_zod12.z.object({
|
|
1685
|
+
phase: import_zod12.z.literal("render"),
|
|
1686
|
+
serverNow: PostPurchaseTimestampSchema,
|
|
1687
|
+
session: ReadySessionTimingSchema,
|
|
1688
|
+
workflowPhase: import_zod12.z.literal("start")
|
|
1689
|
+
}),
|
|
1690
|
+
successful: import_zod12.z.literal(true)
|
|
1582
1691
|
});
|
|
1583
1692
|
|
|
1693
|
+
// src/schema/postPurchaseSessionClose.ts
|
|
1694
|
+
var import_zod13 = require("zod");
|
|
1695
|
+
var SessionClosureSchema = import_zod13.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod13.z.literal("closed") });
|
|
1696
|
+
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
1697
|
+
var SessionCloseResponseSchema = import_zod13.z.object({ data: SessionClosureSchema, successful: import_zod13.z.literal(true) });
|
|
1698
|
+
|
|
1584
1699
|
// src/schema/postPurchaseShadow.ts
|
|
1585
|
-
var
|
|
1586
|
-
var PostPurchaseShadowSelectionSchema =
|
|
1587
|
-
|
|
1588
|
-
|
|
1700
|
+
var import_zod14 = require("zod");
|
|
1701
|
+
var PostPurchaseShadowSelectionSchema = import_zod14.z.discriminatedUnion("verdict", [
|
|
1702
|
+
import_zod14.z.object({ entry: DecisionEntrySchema, verdict: import_zod14.z.literal("render") }),
|
|
1703
|
+
import_zod14.z.object({ verdict: import_zod14.z.literal("skip") })
|
|
1589
1704
|
]);
|
|
1590
|
-
var
|
|
1591
|
-
differences:
|
|
1705
|
+
var PostPurchaseShadowReportFields = import_zod14.z.object({
|
|
1706
|
+
differences: import_zod14.z.array(import_zod14.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
1707
|
+
message: "differences must not contain duplicate entries"
|
|
1708
|
+
}),
|
|
1592
1709
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
1593
|
-
phase:
|
|
1594
|
-
sampleId:
|
|
1710
|
+
phase: import_zod14.z.literal("shouldRender"),
|
|
1711
|
+
sampleId: import_zod14.z.string(),
|
|
1595
1712
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
1596
|
-
status:
|
|
1597
|
-
targetingFlowIds:
|
|
1598
|
-
workflowPhase:
|
|
1713
|
+
status: import_zod14.z.enum(["match", "diverged", "incomplete"]),
|
|
1714
|
+
targetingFlowIds: import_zod14.z.array(import_zod14.z.number().int().positive()),
|
|
1715
|
+
workflowPhase: import_zod14.z.literal("decide")
|
|
1716
|
+
});
|
|
1717
|
+
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
1718
|
+
(report) => report.status !== "match" || report.differences.length === 0,
|
|
1719
|
+
{ message: "status 'match' requires an empty differences array", path: ["status"] }
|
|
1720
|
+
).refine((report) => report.status !== "diverged" || report.differences.length > 0, {
|
|
1721
|
+
message: "status 'diverged' requires a non-empty differences array",
|
|
1722
|
+
path: ["status"]
|
|
1723
|
+
}).refine((report) => report.status !== "diverged" || report.serverSelection !== void 0, {
|
|
1724
|
+
message: "status 'diverged' requires a serverSelection to diverge from",
|
|
1725
|
+
path: ["status"]
|
|
1599
1726
|
});
|
|
1600
1727
|
|
|
1601
1728
|
// src/schema/postPurchaseSkipTrace.ts
|
|
1602
|
-
var
|
|
1729
|
+
var import_zod15 = require("zod");
|
|
1603
1730
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
1604
|
-
var
|
|
1605
|
-
|
|
1731
|
+
var PostPurchaseSkipTraceSchema = import_zod15.z.array(
|
|
1732
|
+
import_zod15.z.object({
|
|
1606
1733
|
entry: DecisionEntrySchema,
|
|
1607
|
-
reason:
|
|
1734
|
+
reason: PostPurchaseSkipReasonSchema
|
|
1608
1735
|
})
|
|
1609
1736
|
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
1610
1737
|
|
|
1611
1738
|
// src/schema/shopConfig.ts
|
|
1612
|
-
var
|
|
1613
|
-
var ShopConfig =
|
|
1614
|
-
activeExperiments:
|
|
1615
|
-
|
|
1616
|
-
data:
|
|
1617
|
-
|
|
1618
|
-
aliasName:
|
|
1619
|
-
cssInput:
|
|
1620
|
-
elementId:
|
|
1621
|
-
id:
|
|
1622
|
-
javascriptInput:
|
|
1623
|
-
traffic:
|
|
1739
|
+
var import_zod16 = require("zod");
|
|
1740
|
+
var ShopConfig = import_zod16.z.object({
|
|
1741
|
+
activeExperiments: import_zod16.z.array(
|
|
1742
|
+
import_zod16.z.object({
|
|
1743
|
+
data: import_zod16.z.array(
|
|
1744
|
+
import_zod16.z.object({
|
|
1745
|
+
aliasName: import_zod16.z.string(),
|
|
1746
|
+
cssInput: import_zod16.z.string().nullish(),
|
|
1747
|
+
elementId: import_zod16.z.coerce.number(),
|
|
1748
|
+
id: import_zod16.z.coerce.number(),
|
|
1749
|
+
javascriptInput: import_zod16.z.string().nullish(),
|
|
1750
|
+
traffic: import_zod16.z.coerce.number()
|
|
1624
1751
|
})
|
|
1625
1752
|
),
|
|
1626
|
-
id:
|
|
1627
|
-
name:
|
|
1628
|
-
pageTarget:
|
|
1629
|
-
pageTargetUrl:
|
|
1630
|
-
placeholderId:
|
|
1631
|
-
type:
|
|
1753
|
+
id: import_zod16.z.coerce.number(),
|
|
1754
|
+
name: import_zod16.z.string(),
|
|
1755
|
+
pageTarget: import_zod16.z.string().nullable(),
|
|
1756
|
+
pageTargetUrl: import_zod16.z.string().nullable(),
|
|
1757
|
+
placeholderId: import_zod16.z.coerce.number().nullable(),
|
|
1758
|
+
type: import_zod16.z.string()
|
|
1632
1759
|
})
|
|
1633
1760
|
),
|
|
1634
|
-
activePackages:
|
|
1635
|
-
|
|
1636
|
-
cancelledAt:
|
|
1637
|
-
id:
|
|
1638
|
-
installedAt:
|
|
1639
|
-
isActive:
|
|
1640
|
-
isBillable:
|
|
1641
|
-
packageId:
|
|
1642
|
-
packageName:
|
|
1643
|
-
shortName:
|
|
1644
|
-
trialDays:
|
|
1645
|
-
uninstalledAt:
|
|
1761
|
+
activePackages: import_zod16.z.array(
|
|
1762
|
+
import_zod16.z.object({
|
|
1763
|
+
cancelledAt: import_zod16.z.string().nullable(),
|
|
1764
|
+
id: import_zod16.z.number(),
|
|
1765
|
+
installedAt: import_zod16.z.string().nullable(),
|
|
1766
|
+
isActive: import_zod16.z.boolean(),
|
|
1767
|
+
isBillable: import_zod16.z.boolean(),
|
|
1768
|
+
packageId: import_zod16.z.number(),
|
|
1769
|
+
packageName: import_zod16.z.string(),
|
|
1770
|
+
shortName: import_zod16.z.string(),
|
|
1771
|
+
trialDays: import_zod16.z.number(),
|
|
1772
|
+
uninstalledAt: import_zod16.z.string().nullable()
|
|
1646
1773
|
})
|
|
1647
1774
|
),
|
|
1648
|
-
apiKey:
|
|
1649
|
-
billingVersion:
|
|
1650
|
-
cacheKey:
|
|
1651
|
-
carousel:
|
|
1652
|
-
currency:
|
|
1653
|
-
currencySymbol:
|
|
1654
|
-
domain:
|
|
1655
|
-
enabledJquery:
|
|
1656
|
-
enabledPresentmentCurrencies:
|
|
1657
|
-
hasSmartCollectionsEnabled:
|
|
1658
|
-
hasSmartSearchEnabled:
|
|
1659
|
-
id:
|
|
1660
|
-
integrations:
|
|
1661
|
-
|
|
1775
|
+
apiKey: import_zod16.z.string(),
|
|
1776
|
+
billingVersion: import_zod16.z.string().nullable(),
|
|
1777
|
+
cacheKey: import_zod16.z.coerce.number(),
|
|
1778
|
+
carousel: import_zod16.z.enum(["flickity", "splide"]),
|
|
1779
|
+
currency: import_zod16.z.string(),
|
|
1780
|
+
currencySymbol: import_zod16.z.string(),
|
|
1781
|
+
domain: import_zod16.z.string(),
|
|
1782
|
+
enabledJquery: import_zod16.z.boolean(),
|
|
1783
|
+
enabledPresentmentCurrencies: import_zod16.z.array(import_zod16.z.string()),
|
|
1784
|
+
hasSmartCollectionsEnabled: import_zod16.z.boolean(),
|
|
1785
|
+
hasSmartSearchEnabled: import_zod16.z.boolean(),
|
|
1786
|
+
id: import_zod16.z.coerce.number(),
|
|
1787
|
+
integrations: import_zod16.z.record(
|
|
1788
|
+
import_zod16.z.enum([
|
|
1662
1789
|
"attentive",
|
|
1663
1790
|
"judgeme",
|
|
1664
1791
|
"junip",
|
|
@@ -1671,46 +1798,46 @@ var ShopConfig = import_zod10.z.object({
|
|
|
1671
1798
|
"stamped",
|
|
1672
1799
|
"yotpo"
|
|
1673
1800
|
]),
|
|
1674
|
-
|
|
1801
|
+
import_zod16.z.union([import_zod16.z.boolean(), import_zod16.z.unknown()])
|
|
1675
1802
|
),
|
|
1676
|
-
markets:
|
|
1677
|
-
enabled:
|
|
1803
|
+
markets: import_zod16.z.object({
|
|
1804
|
+
enabled: import_zod16.z.boolean()
|
|
1678
1805
|
}),
|
|
1679
|
-
monetize:
|
|
1680
|
-
publisherKey:
|
|
1806
|
+
monetize: import_zod16.z.object({
|
|
1807
|
+
publisherKey: import_zod16.z.string().nullable()
|
|
1681
1808
|
}).nullish(),
|
|
1682
|
-
moneyFormat:
|
|
1683
|
-
myshopifyDomain:
|
|
1684
|
-
primaryLocale:
|
|
1685
|
-
productGroupsEnabled:
|
|
1686
|
-
rechargeCustomDomain:
|
|
1687
|
-
sellingPlansEnabled:
|
|
1688
|
-
shopId:
|
|
1689
|
-
shopifySellingPlansEnabled:
|
|
1690
|
-
shopName:
|
|
1691
|
-
storefrontAccessToken:
|
|
1692
|
-
useRebuyIcons:
|
|
1809
|
+
moneyFormat: import_zod16.z.string(),
|
|
1810
|
+
myshopifyDomain: import_zod16.z.string(),
|
|
1811
|
+
primaryLocale: import_zod16.z.string(),
|
|
1812
|
+
productGroupsEnabled: import_zod16.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
1813
|
+
rechargeCustomDomain: import_zod16.z.string().nullable(),
|
|
1814
|
+
sellingPlansEnabled: import_zod16.z.boolean(),
|
|
1815
|
+
shopId: import_zod16.z.number(),
|
|
1816
|
+
shopifySellingPlansEnabled: import_zod16.z.boolean(),
|
|
1817
|
+
shopName: import_zod16.z.string(),
|
|
1818
|
+
storefrontAccessToken: import_zod16.z.string().nullable(),
|
|
1819
|
+
useRebuyIcons: import_zod16.z.boolean()
|
|
1693
1820
|
});
|
|
1694
1821
|
|
|
1695
1822
|
// src/schema/userConfig.ts
|
|
1696
|
-
var
|
|
1697
|
-
var UserConfig =
|
|
1823
|
+
var import_zod17 = require("zod");
|
|
1824
|
+
var UserConfig = import_zod17.z.object({
|
|
1698
1825
|
shop: ShopConfig,
|
|
1699
1826
|
/**
|
|
1700
1827
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
1701
1828
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
1702
1829
|
*/
|
|
1703
1830
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
1704
|
-
smartFlows:
|
|
1831
|
+
smartFlows: import_zod17.z.array(import_zod17.z.unknown())
|
|
1705
1832
|
});
|
|
1706
1833
|
|
|
1707
1834
|
// src/schema/widgetData.ts
|
|
1708
|
-
var
|
|
1835
|
+
var import_zod48 = require("zod");
|
|
1709
1836
|
|
|
1710
1837
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1711
|
-
var
|
|
1712
|
-
var ABTestingPlaceholder =
|
|
1713
|
-
type:
|
|
1838
|
+
var import_zod18 = require("zod");
|
|
1839
|
+
var ABTestingPlaceholder = import_zod18.z.looseObject({
|
|
1840
|
+
type: import_zod18.z.literal("placeholder")
|
|
1714
1841
|
});
|
|
1715
1842
|
|
|
1716
1843
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
@@ -1823,6 +1950,8 @@ var languageKeys = [
|
|
|
1823
1950
|
"zh"
|
|
1824
1951
|
];
|
|
1825
1952
|
var LanguageKey = freezeEnum(languageKeys);
|
|
1953
|
+
var layoutFrames = ["callout", "offer-content"];
|
|
1954
|
+
var LayoutFrame = freezeEnum(layoutFrames);
|
|
1826
1955
|
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
1827
1956
|
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
1828
1957
|
var objectFits = ["cover", "contain"];
|
|
@@ -1867,6 +1996,7 @@ var sectionTypes = [
|
|
|
1867
1996
|
"progressBar",
|
|
1868
1997
|
"quantity",
|
|
1869
1998
|
"reviews",
|
|
1999
|
+
"separator",
|
|
1870
2000
|
"text",
|
|
1871
2001
|
"variants"
|
|
1872
2002
|
];
|
|
@@ -1970,26 +2100,26 @@ var targetAreas = {
|
|
|
1970
2100
|
};
|
|
1971
2101
|
|
|
1972
2102
|
// src/schema/widgets/checkoutExtension.ts
|
|
1973
|
-
var
|
|
1974
|
-
var CheckoutExtension =
|
|
1975
|
-
type:
|
|
2103
|
+
var import_zod19 = require("zod");
|
|
2104
|
+
var CheckoutExtension = import_zod19.z.looseObject({
|
|
2105
|
+
type: import_zod19.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
1976
2106
|
});
|
|
1977
2107
|
|
|
1978
2108
|
// src/schema/widgets/contentBlock.ts
|
|
1979
|
-
var
|
|
2109
|
+
var import_zod42 = require("zod");
|
|
1980
2110
|
|
|
1981
2111
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1982
|
-
var
|
|
2112
|
+
var import_zod41 = require("zod");
|
|
1983
2113
|
|
|
1984
2114
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1985
|
-
var
|
|
1986
|
-
var
|
|
2115
|
+
var import_uuid14 = require("uuid");
|
|
2116
|
+
var import_zod40 = require("zod");
|
|
1987
2117
|
|
|
1988
2118
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1989
|
-
var
|
|
2119
|
+
var import_zod39 = require("zod");
|
|
1990
2120
|
|
|
1991
2121
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1992
|
-
var
|
|
2122
|
+
var import_zod20 = require("zod");
|
|
1993
2123
|
|
|
1994
2124
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1995
2125
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -2067,11 +2197,11 @@ var isTextType = isSectionType(SectionType.text);
|
|
|
2067
2197
|
var isVariantsType = isSectionType(SectionType.variants);
|
|
2068
2198
|
|
|
2069
2199
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
2070
|
-
var CABBannerSection =
|
|
2200
|
+
var CABBannerSection = import_zod20.z.lazy(
|
|
2071
2201
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2072
|
-
buttonField:
|
|
2073
|
-
color:
|
|
2074
|
-
dismissible:
|
|
2202
|
+
buttonField: import_zod20.z.enum(buttonFields).optional(),
|
|
2203
|
+
color: import_zod20.z.enum(bannerColors).default("info"),
|
|
2204
|
+
dismissible: import_zod20.z.boolean().default(true),
|
|
2075
2205
|
/**
|
|
2076
2206
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
2077
2207
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -2087,18 +2217,18 @@ var CABBannerSection = import_zod14.z.lazy(
|
|
|
2087
2217
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
2088
2218
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
2089
2219
|
*/
|
|
2090
|
-
heading:
|
|
2091
|
-
sectionType:
|
|
2220
|
+
heading: import_zod20.z.record(import_zod20.z.string(), import_zod20.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
2221
|
+
sectionType: import_zod20.z.literal(SectionType.banner).default(SectionType.banner)
|
|
2092
2222
|
})
|
|
2093
2223
|
);
|
|
2094
2224
|
|
|
2095
2225
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2096
2226
|
var import_uuid4 = require("uuid");
|
|
2097
|
-
var
|
|
2227
|
+
var import_zod25 = require("zod");
|
|
2098
2228
|
|
|
2099
2229
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2100
2230
|
var import_uuid2 = require("uuid");
|
|
2101
|
-
var
|
|
2231
|
+
var import_zod23 = require("zod");
|
|
2102
2232
|
|
|
2103
2233
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
2104
2234
|
var iconNames = [
|
|
@@ -2185,10 +2315,10 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
2185
2315
|
var IconTone = freezeEnum(iconTones);
|
|
2186
2316
|
|
|
2187
2317
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
2188
|
-
var
|
|
2318
|
+
var import_zod22 = require("zod");
|
|
2189
2319
|
|
|
2190
2320
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
2191
|
-
var
|
|
2321
|
+
var import_zod21 = require("zod");
|
|
2192
2322
|
var ruleTypes = [
|
|
2193
2323
|
"cart",
|
|
2194
2324
|
"cart_count",
|
|
@@ -2207,7 +2337,7 @@ var ruleTypes = [
|
|
|
2207
2337
|
"product_type",
|
|
2208
2338
|
"product_vendor"
|
|
2209
2339
|
];
|
|
2210
|
-
var ruleType =
|
|
2340
|
+
var ruleType = import_zod21.z.enum(ruleTypes);
|
|
2211
2341
|
var RuleType = ruleType.enum;
|
|
2212
2342
|
var ruleOperators = [
|
|
2213
2343
|
"after",
|
|
@@ -2222,124 +2352,124 @@ var ruleOperators = [
|
|
|
2222
2352
|
"greater_than",
|
|
2223
2353
|
"less_than"
|
|
2224
2354
|
];
|
|
2225
|
-
var ruleOperator =
|
|
2355
|
+
var ruleOperator = import_zod21.z.enum(ruleOperators);
|
|
2226
2356
|
var RuleOperator = ruleOperator.enum;
|
|
2227
|
-
var RuleCondition =
|
|
2228
|
-
operator:
|
|
2229
|
-
products:
|
|
2230
|
-
type:
|
|
2231
|
-
value:
|
|
2357
|
+
var RuleCondition = import_zod21.z.object({
|
|
2358
|
+
operator: import_zod21.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
2359
|
+
products: import_zod21.z.union([import_zod21.z.array(import_zod21.z.unknown()), import_zod21.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2360
|
+
type: import_zod21.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
2361
|
+
value: import_zod21.z.coerce.string().default("")
|
|
2232
2362
|
});
|
|
2233
|
-
var RuleLogicBlock =
|
|
2234
|
-
rules:
|
|
2363
|
+
var RuleLogicBlock = import_zod21.z.object({
|
|
2364
|
+
rules: import_zod21.z.array(RuleCondition).default(() => [])
|
|
2235
2365
|
});
|
|
2236
|
-
var CABRulesetEntry =
|
|
2237
|
-
exitIfMatched:
|
|
2238
|
-
logic:
|
|
2239
|
-
output:
|
|
2240
|
-
|
|
2241
|
-
key:
|
|
2242
|
-
type:
|
|
2243
|
-
value:
|
|
2366
|
+
var CABRulesetEntry = import_zod21.z.object({
|
|
2367
|
+
exitIfMatched: import_zod21.z.boolean().default(true),
|
|
2368
|
+
logic: import_zod21.z.array(RuleLogicBlock).default(() => []),
|
|
2369
|
+
output: import_zod21.z.array(
|
|
2370
|
+
import_zod21.z.object({
|
|
2371
|
+
key: import_zod21.z.string().default("should_show"),
|
|
2372
|
+
type: import_zod21.z.literal("data_json").default("data_json"),
|
|
2373
|
+
value: import_zod21.z.string().default("true")
|
|
2244
2374
|
})
|
|
2245
2375
|
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
2246
2376
|
});
|
|
2247
|
-
var CABRuleset =
|
|
2377
|
+
var CABRuleset = import_zod21.z.union([import_zod21.z.array(CABRulesetEntry), import_zod21.z.strictObject({}).transform(() => [])]).default(() => []);
|
|
2248
2378
|
|
|
2249
2379
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
2250
|
-
var variableEffect =
|
|
2251
|
-
var CABVariableSeed =
|
|
2252
|
-
dataSourceId:
|
|
2380
|
+
var variableEffect = import_zod22.z.enum(variableEffects);
|
|
2381
|
+
var CABVariableSeed = import_zod22.z.object({
|
|
2382
|
+
dataSourceId: import_zod22.z.number().nullable().default(null),
|
|
2253
2383
|
ruleset: CABRuleset
|
|
2254
2384
|
});
|
|
2255
|
-
var CABBooleanVariable =
|
|
2385
|
+
var CABBooleanVariable = import_zod22.z.object({
|
|
2256
2386
|
/**
|
|
2257
2387
|
* Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
|
|
2258
2388
|
* from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
|
|
2259
2389
|
* below; a cross-field default has no `.default()` spelling. An explicit value always wins.
|
|
2260
2390
|
*/
|
|
2261
|
-
defaultValue:
|
|
2262
|
-
name:
|
|
2391
|
+
defaultValue: import_zod22.z.boolean().optional(),
|
|
2392
|
+
name: import_zod22.z.string().min(1),
|
|
2263
2393
|
seed: CABVariableSeed.optional(),
|
|
2264
2394
|
/** Defaulted so every stored declaration (all boolean before `text` existed) parses unchanged. */
|
|
2265
|
-
type:
|
|
2395
|
+
type: import_zod22.z.literal(VariableType.boolean).default(VariableType.boolean)
|
|
2266
2396
|
});
|
|
2267
|
-
var CABTextVariable =
|
|
2268
|
-
defaultValue:
|
|
2269
|
-
name:
|
|
2270
|
-
seed:
|
|
2271
|
-
type:
|
|
2397
|
+
var CABTextVariable = import_zod22.z.object({
|
|
2398
|
+
defaultValue: import_zod22.z.string(),
|
|
2399
|
+
name: import_zod22.z.string().min(1),
|
|
2400
|
+
seed: import_zod22.z.never().optional(),
|
|
2401
|
+
type: import_zod22.z.literal(VariableType.text)
|
|
2272
2402
|
});
|
|
2273
|
-
var CABNumberVariable =
|
|
2274
|
-
defaultValue:
|
|
2275
|
-
name:
|
|
2276
|
-
seed:
|
|
2277
|
-
type:
|
|
2403
|
+
var CABNumberVariable = import_zod22.z.object({
|
|
2404
|
+
defaultValue: import_zod22.z.number(),
|
|
2405
|
+
name: import_zod22.z.string().min(1),
|
|
2406
|
+
seed: import_zod22.z.never().optional(),
|
|
2407
|
+
type: import_zod22.z.literal(VariableType.number)
|
|
2278
2408
|
});
|
|
2279
|
-
var CABVariable =
|
|
2409
|
+
var CABVariable = import_zod22.z.union([CABTextVariable, CABNumberVariable, CABBooleanVariable]).transform(
|
|
2280
2410
|
(variable) => variable.type === VariableType.boolean ? { ...variable, defaultValue: variable.defaultValue ?? variable.seed === void 0 } : variable
|
|
2281
2411
|
);
|
|
2282
|
-
var CABVariableEffect =
|
|
2412
|
+
var CABVariableEffect = import_zod22.z.object({
|
|
2283
2413
|
effect: variableEffect.default(VariableEffect.toggle),
|
|
2284
|
-
variable:
|
|
2414
|
+
variable: import_zod22.z.string().min(1)
|
|
2285
2415
|
});
|
|
2286
|
-
var CABVisibility =
|
|
2287
|
-
variable:
|
|
2288
|
-
visibleWhen:
|
|
2416
|
+
var CABVisibility = import_zod22.z.object({
|
|
2417
|
+
variable: import_zod22.z.string().min(1),
|
|
2418
|
+
visibleWhen: import_zod22.z.boolean().default(true)
|
|
2289
2419
|
});
|
|
2290
|
-
var contentOperator =
|
|
2291
|
-
var resultCountOperator =
|
|
2292
|
-
var resultTagOperator =
|
|
2293
|
-
var mutatorEvent =
|
|
2294
|
-
var CABContentTrigger =
|
|
2420
|
+
var contentOperator = import_zod22.z.enum(contentOperators);
|
|
2421
|
+
var resultCountOperator = import_zod22.z.enum(resultCountOperators);
|
|
2422
|
+
var resultTagOperator = import_zod22.z.enum(resultTagOperators);
|
|
2423
|
+
var mutatorEvent = import_zod22.z.enum(mutatorEvents);
|
|
2424
|
+
var CABContentTrigger = import_zod22.z.object({
|
|
2295
2425
|
operator: contentOperator.default(ContentOperator.is_empty),
|
|
2296
|
-
type:
|
|
2426
|
+
type: import_zod22.z.literal("content")
|
|
2297
2427
|
});
|
|
2298
|
-
var CABResultCountTrigger =
|
|
2428
|
+
var CABResultCountTrigger = import_zod22.z.object({
|
|
2299
2429
|
operator: resultCountOperator.default(ResultCountOperator.equals),
|
|
2300
|
-
type:
|
|
2301
|
-
value:
|
|
2430
|
+
type: import_zod22.z.literal("result_count"),
|
|
2431
|
+
value: import_zod22.z.number().default(0)
|
|
2302
2432
|
});
|
|
2303
|
-
var CABResultTagTrigger =
|
|
2433
|
+
var CABResultTagTrigger = import_zod22.z.object({
|
|
2304
2434
|
operator: resultTagOperator.default(ResultTagOperator.contains),
|
|
2305
|
-
type:
|
|
2306
|
-
value:
|
|
2435
|
+
type: import_zod22.z.literal("result_tag"),
|
|
2436
|
+
value: import_zod22.z.string().min(1)
|
|
2307
2437
|
});
|
|
2308
|
-
var CABEventTrigger =
|
|
2438
|
+
var CABEventTrigger = import_zod22.z.object({
|
|
2309
2439
|
event: mutatorEvent,
|
|
2310
|
-
type:
|
|
2440
|
+
type: import_zod22.z.literal("event")
|
|
2311
2441
|
});
|
|
2312
|
-
var CABVariableTrigger =
|
|
2442
|
+
var CABVariableTrigger = import_zod22.z.discriminatedUnion("type", [
|
|
2313
2443
|
CABContentTrigger,
|
|
2314
2444
|
CABEventTrigger,
|
|
2315
2445
|
CABResultCountTrigger,
|
|
2316
2446
|
CABResultTagTrigger
|
|
2317
2447
|
]);
|
|
2318
|
-
var CABVariableMutator =
|
|
2448
|
+
var CABVariableMutator = import_zod22.z.object({
|
|
2319
2449
|
effect: variableEffect.default(VariableEffect.set_false),
|
|
2320
|
-
variable:
|
|
2450
|
+
variable: import_zod22.z.string().min(1),
|
|
2321
2451
|
when: CABVariableTrigger
|
|
2322
2452
|
});
|
|
2323
2453
|
var CABVariableFields = {
|
|
2324
|
-
mutators:
|
|
2325
|
-
variables:
|
|
2454
|
+
mutators: import_zod22.z.array(CABVariableMutator).optional(),
|
|
2455
|
+
variables: import_zod22.z.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
|
|
2326
2456
|
message: "variable names must be unique within a section"
|
|
2327
2457
|
}).optional(),
|
|
2328
2458
|
visibility: CABVisibility.optional()
|
|
2329
2459
|
};
|
|
2330
2460
|
|
|
2331
2461
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2332
|
-
var CABImageSectionFields =
|
|
2462
|
+
var CABImageSectionFields = import_zod23.z.object({
|
|
2333
2463
|
...CABVariableFields,
|
|
2334
|
-
altText:
|
|
2464
|
+
altText: import_zod23.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
2335
2465
|
/**
|
|
2336
2466
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
2337
2467
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
2338
2468
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
2339
2469
|
*/
|
|
2340
|
-
aspectRatio:
|
|
2341
|
-
border:
|
|
2342
|
-
buttonField:
|
|
2470
|
+
aspectRatio: import_zod23.z.number().positive().nullable().default(null),
|
|
2471
|
+
border: import_zod23.z.lazy(() => CABBorder),
|
|
2472
|
+
buttonField: import_zod23.z.enum(buttonFields).optional(),
|
|
2343
2473
|
/**
|
|
2344
2474
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
2345
2475
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -2358,29 +2488,29 @@ var CABImageSectionFields = import_zod17.z.object({
|
|
|
2358
2488
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
2359
2489
|
* the risky half.
|
|
2360
2490
|
*/
|
|
2361
|
-
category:
|
|
2491
|
+
category: import_zod23.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
2362
2492
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
2363
|
-
iconSize:
|
|
2493
|
+
iconSize: import_zod23.z.enum(iconSizes).nullable().default(null),
|
|
2364
2494
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
2365
|
-
iconTone:
|
|
2366
|
-
name:
|
|
2367
|
-
naturalHeight:
|
|
2368
|
-
naturalWidth:
|
|
2495
|
+
iconTone: import_zod23.z.enum(iconTones).nullable().default(null),
|
|
2496
|
+
name: import_zod23.z.string().optional(),
|
|
2497
|
+
naturalHeight: import_zod23.z.number().default(0),
|
|
2498
|
+
naturalWidth: import_zod23.z.number().default(0),
|
|
2369
2499
|
/**
|
|
2370
2500
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
2371
2501
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
2372
2502
|
*/
|
|
2373
|
-
objectFit:
|
|
2374
|
-
sectionId:
|
|
2375
|
-
sectionType:
|
|
2503
|
+
objectFit: import_zod23.z.enum(objectFits).default(ObjectFit.contain),
|
|
2504
|
+
sectionId: import_zod23.z.uuid().default(() => (0, import_uuid2.v7)()),
|
|
2505
|
+
sectionType: import_zod23.z.literal(SectionType.image).default(SectionType.image),
|
|
2376
2506
|
/**
|
|
2377
2507
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
2378
2508
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
2379
2509
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
2380
2510
|
* server-chosen tier icon actually needs it.
|
|
2381
2511
|
*/
|
|
2382
|
-
source:
|
|
2383
|
-
width:
|
|
2512
|
+
source: import_zod23.z.union([import_zod23.z.url(), import_zod23.z.literal(""), import_zod23.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod23.z.enum(iconNames)]).default(""),
|
|
2513
|
+
width: import_zod23.z.number().default(100)
|
|
2384
2514
|
});
|
|
2385
2515
|
var iconNameSet = new Set(iconNames);
|
|
2386
2516
|
var isIconName = (source) => iconNameSet.has(source);
|
|
@@ -2402,71 +2532,71 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, c
|
|
|
2402
2532
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
2403
2533
|
var import_compat2 = require("es-toolkit/compat");
|
|
2404
2534
|
var import_uuid3 = require("uuid");
|
|
2405
|
-
var
|
|
2406
|
-
var enumOrOmit = (...vals) =>
|
|
2407
|
-
var TiptapText =
|
|
2408
|
-
marks:
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
attrs:
|
|
2415
|
-
class:
|
|
2416
|
-
href:
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2535
|
+
var import_zod24 = require("zod");
|
|
2536
|
+
var enumOrOmit = (...vals) => import_zod24.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
2537
|
+
var TiptapText = import_zod24.z.object({
|
|
2538
|
+
marks: import_zod24.z.union([
|
|
2539
|
+
import_zod24.z.array(
|
|
2540
|
+
import_zod24.z.discriminatedUnion("type", [
|
|
2541
|
+
import_zod24.z.object({ type: import_zod24.z.literal("bold") }),
|
|
2542
|
+
import_zod24.z.object({ type: import_zod24.z.literal("italic") }),
|
|
2543
|
+
import_zod24.z.object({
|
|
2544
|
+
attrs: import_zod24.z.object({
|
|
2545
|
+
class: import_zod24.z.string().nullable(),
|
|
2546
|
+
href: import_zod24.z.union([
|
|
2547
|
+
import_zod24.z.url(),
|
|
2548
|
+
import_zod24.z.literal("#"),
|
|
2549
|
+
import_zod24.z.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
2550
|
+
import_zod24.z.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
2421
2551
|
]),
|
|
2422
|
-
rel:
|
|
2423
|
-
target:
|
|
2552
|
+
rel: import_zod24.z.string().default("noopener noreferrer nofollow"),
|
|
2553
|
+
target: import_zod24.z.string().default("_blank")
|
|
2424
2554
|
}),
|
|
2425
|
-
type:
|
|
2555
|
+
type: import_zod24.z.literal("link")
|
|
2426
2556
|
}),
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
attrs:
|
|
2557
|
+
import_zod24.z.object({ type: import_zod24.z.literal("strike") }),
|
|
2558
|
+
import_zod24.z.object({
|
|
2559
|
+
attrs: import_zod24.z.object({
|
|
2430
2560
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
2431
2561
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
2432
2562
|
}),
|
|
2433
|
-
type:
|
|
2563
|
+
type: import_zod24.z.literal("textStyle")
|
|
2434
2564
|
})
|
|
2435
2565
|
])
|
|
2436
2566
|
),
|
|
2437
|
-
|
|
2567
|
+
import_zod24.z.strictObject({}).transform(() => [])
|
|
2438
2568
|
]).optional(),
|
|
2439
|
-
text:
|
|
2440
|
-
type:
|
|
2569
|
+
text: import_zod24.z.string().default(""),
|
|
2570
|
+
type: import_zod24.z.literal("text").default("text")
|
|
2441
2571
|
});
|
|
2442
|
-
var TiptapParagraph =
|
|
2443
|
-
attrs:
|
|
2572
|
+
var TiptapParagraph = import_zod24.z.object({
|
|
2573
|
+
attrs: import_zod24.z.object({
|
|
2444
2574
|
textAlign: enumOrOmit(...textAlignments)
|
|
2445
2575
|
}).default({ textAlign: TextAlignment.start }),
|
|
2446
|
-
content:
|
|
2447
|
-
type:
|
|
2576
|
+
content: import_zod24.z.union([import_zod24.z.array(TiptapText), import_zod24.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2577
|
+
type: import_zod24.z.literal("paragraph").default("paragraph")
|
|
2448
2578
|
});
|
|
2449
|
-
var TiptapDocument =
|
|
2450
|
-
attrs:
|
|
2579
|
+
var TiptapDocument = import_zod24.z.object({
|
|
2580
|
+
attrs: import_zod24.z.object({
|
|
2451
2581
|
blockSpacing: enumOrOmit(...spacings)
|
|
2452
2582
|
}).default({ blockSpacing: Spacing.base }),
|
|
2453
|
-
content:
|
|
2454
|
-
type:
|
|
2583
|
+
content: import_zod24.z.union([import_zod24.z.array(TiptapParagraph), import_zod24.z.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
2584
|
+
type: import_zod24.z.literal("doc").default("doc")
|
|
2455
2585
|
});
|
|
2456
|
-
var CABTextTier =
|
|
2457
|
-
threshold:
|
|
2458
|
-
thresholds:
|
|
2459
|
-
tierId:
|
|
2460
|
-
tierType:
|
|
2586
|
+
var CABTextTier = import_zod24.z.object({
|
|
2587
|
+
threshold: import_zod24.z.number().int().nonnegative(),
|
|
2588
|
+
thresholds: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.number().int().nonnegative()).default(() => ({})),
|
|
2589
|
+
tierId: import_zod24.z.string().optional(),
|
|
2590
|
+
tierType: import_zod24.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
2461
2591
|
});
|
|
2462
|
-
var CABTextSection =
|
|
2592
|
+
var CABTextSection = import_zod24.z.object({
|
|
2463
2593
|
...CABVariableFields,
|
|
2464
|
-
buttonField:
|
|
2465
|
-
content:
|
|
2466
|
-
name:
|
|
2467
|
-
optionId:
|
|
2468
|
-
sectionId:
|
|
2469
|
-
sectionType:
|
|
2594
|
+
buttonField: import_zod24.z.enum(buttonFields).optional(),
|
|
2595
|
+
content: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.union([import_zod24.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
2596
|
+
name: import_zod24.z.string().optional(),
|
|
2597
|
+
optionId: import_zod24.z.number().optional(),
|
|
2598
|
+
sectionId: import_zod24.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
2599
|
+
sectionType: import_zod24.z.literal(SectionType.text).default(SectionType.text),
|
|
2470
2600
|
tier: CABTextTier.optional()
|
|
2471
2601
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
2472
2602
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
@@ -2488,35 +2618,35 @@ var CABTextSection = import_zod18.z.object({
|
|
|
2488
2618
|
});
|
|
2489
2619
|
|
|
2490
2620
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2491
|
-
var CABButtonContent =
|
|
2492
|
-
() =>
|
|
2621
|
+
var CABButtonContent = import_zod25.z.lazy(
|
|
2622
|
+
() => import_zod25.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
2493
2623
|
);
|
|
2494
|
-
var CABButtonSection =
|
|
2624
|
+
var CABButtonSection = import_zod25.z.object({
|
|
2495
2625
|
...CABVariableFields,
|
|
2496
|
-
action:
|
|
2497
|
-
buttonStyle:
|
|
2498
|
-
custom:
|
|
2499
|
-
color:
|
|
2500
|
-
height:
|
|
2501
|
-
width:
|
|
2626
|
+
action: import_zod25.z.union([import_zod25.z.literal(""), import_zod25.z.enum(buttonActions)]).default(""),
|
|
2627
|
+
buttonStyle: import_zod25.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
2628
|
+
custom: import_zod25.z.object({
|
|
2629
|
+
color: import_zod25.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
2630
|
+
height: import_zod25.z.number().default(52),
|
|
2631
|
+
width: import_zod25.z.number().default(300)
|
|
2502
2632
|
}).default({
|
|
2503
2633
|
color: "#005bd3",
|
|
2504
2634
|
height: 52,
|
|
2505
2635
|
width: 300
|
|
2506
2636
|
}),
|
|
2507
|
-
disableDowngrade:
|
|
2508
|
-
name:
|
|
2509
|
-
optionId:
|
|
2510
|
-
popover:
|
|
2511
|
-
alignment:
|
|
2512
|
-
position:
|
|
2637
|
+
disableDowngrade: import_zod25.z.boolean().default(false),
|
|
2638
|
+
name: import_zod25.z.string().optional(),
|
|
2639
|
+
optionId: import_zod25.z.number().optional(),
|
|
2640
|
+
popover: import_zod25.z.object({
|
|
2641
|
+
alignment: import_zod25.z.enum(textAlignments).default(TextAlignment.center),
|
|
2642
|
+
position: import_zod25.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
2513
2643
|
}).optional().default(() => ({
|
|
2514
2644
|
alignment: TextAlignment.center,
|
|
2515
2645
|
position: PopoverPosition.blockStart
|
|
2516
2646
|
})),
|
|
2517
|
-
sectionId:
|
|
2518
|
-
sections:
|
|
2519
|
-
sectionType:
|
|
2647
|
+
sectionId: import_zod25.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
2648
|
+
sections: import_zod25.z.union([import_zod25.z.array(CABButtonContent), import_zod25.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2649
|
+
sectionType: import_zod25.z.literal(SectionType.button).default(SectionType.button),
|
|
2520
2650
|
/**
|
|
2521
2651
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
2522
2652
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -2531,91 +2661,91 @@ var CABButtonSection = import_zod19.z.object({
|
|
|
2531
2661
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
2532
2662
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
2533
2663
|
*/
|
|
2534
|
-
tier:
|
|
2664
|
+
tier: import_zod25.z.object({ tierId: import_zod25.z.string().min(1) }).optional(),
|
|
2535
2665
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
2536
|
-
trackingUrl:
|
|
2666
|
+
trackingUrl: import_zod25.z.string().optional(),
|
|
2537
2667
|
/**
|
|
2538
2668
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
2539
2669
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
2540
2670
|
*/
|
|
2541
|
-
variableEffects:
|
|
2671
|
+
variableEffects: import_zod25.z.array(CABVariableEffect).optional()
|
|
2542
2672
|
});
|
|
2543
2673
|
|
|
2544
2674
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2545
|
-
var
|
|
2675
|
+
var import_zod30 = require("zod");
|
|
2546
2676
|
|
|
2547
2677
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2548
|
-
var
|
|
2678
|
+
var import_zod29 = require("zod");
|
|
2549
2679
|
|
|
2550
2680
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
2551
2681
|
var import_uuid5 = require("uuid");
|
|
2552
|
-
var
|
|
2553
|
-
var CABDiscount =
|
|
2554
|
-
amount:
|
|
2555
|
-
discountedBy:
|
|
2556
|
-
discountedFrom:
|
|
2557
|
-
type:
|
|
2682
|
+
var import_zod26 = require("zod");
|
|
2683
|
+
var CABDiscount = import_zod26.z.object({
|
|
2684
|
+
amount: import_zod26.z.union([import_zod26.z.number(), import_zod26.z.string()]).catch(0),
|
|
2685
|
+
discountedBy: import_zod26.z.string().optional(),
|
|
2686
|
+
discountedFrom: import_zod26.z.enum(discountSources).optional().catch(void 0),
|
|
2687
|
+
type: import_zod26.z.enum(discountTypes).catch("none")
|
|
2558
2688
|
});
|
|
2559
|
-
var CABIntegrations =
|
|
2560
|
-
judgeme:
|
|
2561
|
-
junip:
|
|
2562
|
-
klaviyo:
|
|
2563
|
-
loox:
|
|
2564
|
-
okendo:
|
|
2565
|
-
opinew:
|
|
2566
|
-
reviewsio:
|
|
2567
|
-
stamped:
|
|
2568
|
-
yotpo:
|
|
2689
|
+
var CABIntegrations = import_zod26.z.object({
|
|
2690
|
+
judgeme: import_zod26.z.boolean().default(false),
|
|
2691
|
+
junip: import_zod26.z.boolean().default(false),
|
|
2692
|
+
klaviyo: import_zod26.z.boolean().default(false),
|
|
2693
|
+
loox: import_zod26.z.boolean().default(false),
|
|
2694
|
+
okendo: import_zod26.z.boolean().default(false),
|
|
2695
|
+
opinew: import_zod26.z.boolean().default(false),
|
|
2696
|
+
reviewsio: import_zod26.z.boolean().default(false),
|
|
2697
|
+
stamped: import_zod26.z.boolean().default(false),
|
|
2698
|
+
yotpo: import_zod26.z.boolean().default(false)
|
|
2569
2699
|
});
|
|
2570
|
-
var CABDataSourceSection =
|
|
2571
|
-
dataSourceId:
|
|
2572
|
-
dataSourcePath:
|
|
2700
|
+
var CABDataSourceSection = import_zod26.z.object({
|
|
2701
|
+
dataSourceId: import_zod26.z.number().nullable().default(null),
|
|
2702
|
+
dataSourcePath: import_zod26.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
2573
2703
|
discount: CABDiscount.optional(),
|
|
2574
2704
|
integrations: CABIntegrations.optional(),
|
|
2575
|
-
limit:
|
|
2576
|
-
matchVariant:
|
|
2577
|
-
matchVariantOutOfStock:
|
|
2578
|
-
name:
|
|
2579
|
-
productType:
|
|
2580
|
-
sectionId:
|
|
2581
|
-
sectionType:
|
|
2705
|
+
limit: import_zod26.z.number().default(1),
|
|
2706
|
+
matchVariant: import_zod26.z.boolean().default(false),
|
|
2707
|
+
matchVariantOutOfStock: import_zod26.z.boolean().default(false),
|
|
2708
|
+
name: import_zod26.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
2709
|
+
productType: import_zod26.z.enum(productTypes).optional(),
|
|
2710
|
+
sectionId: import_zod26.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
2711
|
+
sectionType: import_zod26.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
2582
2712
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
2583
|
-
subscriptionIsDefault:
|
|
2584
|
-
treatAsGwp:
|
|
2713
|
+
subscriptionIsDefault: import_zod26.z.boolean().default(false),
|
|
2714
|
+
treatAsGwp: import_zod26.z.boolean().default(false)
|
|
2585
2715
|
});
|
|
2586
2716
|
|
|
2587
2717
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2588
2718
|
var import_uuid7 = require("uuid");
|
|
2589
|
-
var
|
|
2719
|
+
var import_zod28 = require("zod");
|
|
2590
2720
|
|
|
2591
2721
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
2592
2722
|
var import_uuid6 = require("uuid");
|
|
2593
|
-
var
|
|
2594
|
-
var CABVariantContent =
|
|
2595
|
-
() =>
|
|
2723
|
+
var import_zod27 = require("zod");
|
|
2724
|
+
var CABVariantContent = import_zod27.z.lazy(
|
|
2725
|
+
() => import_zod27.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
2596
2726
|
);
|
|
2597
|
-
var CABProductSection =
|
|
2727
|
+
var CABProductSection = import_zod27.z.object({
|
|
2598
2728
|
...CABVariableFields,
|
|
2599
|
-
name:
|
|
2600
|
-
productId:
|
|
2601
|
-
sectionId:
|
|
2602
|
-
sections:
|
|
2603
|
-
sectionType:
|
|
2604
|
-
selectors:
|
|
2605
|
-
variantMode:
|
|
2729
|
+
name: import_zod27.z.string().optional(),
|
|
2730
|
+
productId: import_zod27.z.number().nullable().default(null),
|
|
2731
|
+
sectionId: import_zod27.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
2732
|
+
sections: import_zod27.z.union([import_zod27.z.array(CABVariantContent), import_zod27.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2733
|
+
sectionType: import_zod27.z.literal(SectionType.product).default(SectionType.product),
|
|
2734
|
+
selectors: import_zod27.z.record(import_zod27.z.string(), import_zod27.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
2735
|
+
variantMode: import_zod27.z.enum(variantModes).default(VariantMode.multiple)
|
|
2606
2736
|
});
|
|
2607
2737
|
|
|
2608
2738
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2609
|
-
var CABProductsSection =
|
|
2739
|
+
var CABProductsSection = import_zod28.z.object({
|
|
2610
2740
|
...CABVariableFields,
|
|
2611
|
-
name:
|
|
2612
|
-
sectionId:
|
|
2613
|
-
sections:
|
|
2614
|
-
sectionType:
|
|
2741
|
+
name: import_zod28.z.string().optional(),
|
|
2742
|
+
sectionId: import_zod28.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
2743
|
+
sections: import_zod28.z.union([import_zod28.z.array(import_zod28.z.lazy(() => CABProductSection)), import_zod28.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2744
|
+
sectionType: import_zod28.z.literal(SectionType.products).default(SectionType.products)
|
|
2615
2745
|
});
|
|
2616
2746
|
|
|
2617
2747
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2618
|
-
var CABOffersSection =
|
|
2748
|
+
var CABOffersSection = import_zod29.z.lazy(
|
|
2619
2749
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2620
2750
|
/**
|
|
2621
2751
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -2623,8 +2753,8 @@ var CABOffersSection = import_zod23.z.lazy(
|
|
|
2623
2753
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
2624
2754
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
2625
2755
|
*/
|
|
2626
|
-
divider:
|
|
2627
|
-
sections:
|
|
2756
|
+
divider: import_zod29.z.boolean().optional(),
|
|
2757
|
+
sections: import_zod29.z.union([import_zod29.z.array(import_zod29.z.lazy(() => CABSection)), import_zod29.z.strictObject({}).transform(() => [])]).default(() => [
|
|
2628
2758
|
CABBannerSection.parse({
|
|
2629
2759
|
buttonField: "undoAddToOrder",
|
|
2630
2760
|
color: "success",
|
|
@@ -2638,77 +2768,77 @@ var CABOffersSection = import_zod23.z.lazy(
|
|
|
2638
2768
|
CABDataSourceSection.parse({}),
|
|
2639
2769
|
CABProductsSection.parse({})
|
|
2640
2770
|
]),
|
|
2641
|
-
sectionType:
|
|
2771
|
+
sectionType: import_zod29.z.literal(SectionType.offers).default(SectionType.offers)
|
|
2642
2772
|
})
|
|
2643
2773
|
);
|
|
2644
2774
|
|
|
2645
2775
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2646
|
-
var CABCarouselSection =
|
|
2776
|
+
var CABCarouselSection = import_zod30.z.lazy(
|
|
2647
2777
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2648
|
-
autoAdvanceInterval:
|
|
2649
|
-
itemsAtOnce:
|
|
2778
|
+
autoAdvanceInterval: import_zod30.z.number().default(0),
|
|
2779
|
+
itemsAtOnce: import_zod30.z.number().min(1).default(1),
|
|
2650
2780
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
2651
|
-
offersDirection:
|
|
2652
|
-
sections:
|
|
2653
|
-
sectionType:
|
|
2781
|
+
offersDirection: import_zod30.z.enum(offersDirections).default("vertical"),
|
|
2782
|
+
sections: import_zod30.z.union([import_zod30.z.array(import_zod30.z.lazy(() => CABSection)), import_zod30.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
2783
|
+
sectionType: import_zod30.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
2654
2784
|
})
|
|
2655
2785
|
);
|
|
2656
2786
|
|
|
2657
2787
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
2658
|
-
var
|
|
2659
|
-
var CABCartLineSection =
|
|
2788
|
+
var import_zod31 = require("zod");
|
|
2789
|
+
var CABCartLineSection = import_zod31.z.lazy(
|
|
2660
2790
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2661
|
-
sections:
|
|
2662
|
-
sectionType:
|
|
2791
|
+
sections: import_zod31.z.union([import_zod31.z.array(import_zod31.z.lazy(() => CABSection)), import_zod31.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
2792
|
+
sectionType: import_zod31.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
2663
2793
|
})
|
|
2664
2794
|
);
|
|
2665
2795
|
|
|
2666
2796
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
2667
2797
|
var import_uuid8 = require("uuid");
|
|
2668
|
-
var
|
|
2669
|
-
var CABDiscountSection =
|
|
2798
|
+
var import_zod32 = require("zod");
|
|
2799
|
+
var CABDiscountSection = import_zod32.z.object({
|
|
2670
2800
|
...CABVariableFields,
|
|
2671
|
-
amount:
|
|
2672
|
-
discountedBy:
|
|
2673
|
-
discountedFrom:
|
|
2674
|
-
message:
|
|
2675
|
-
name:
|
|
2676
|
-
quantity:
|
|
2677
|
-
sectionId:
|
|
2678
|
-
sectionType:
|
|
2679
|
-
type:
|
|
2801
|
+
amount: import_zod32.z.union([import_zod32.z.number(), import_zod32.z.string()]).catch(0),
|
|
2802
|
+
discountedBy: import_zod32.z.string().optional(),
|
|
2803
|
+
discountedFrom: import_zod32.z.enum(discountSources).optional().catch(void 0),
|
|
2804
|
+
message: import_zod32.z.string().optional(),
|
|
2805
|
+
name: import_zod32.z.string().optional(),
|
|
2806
|
+
quantity: import_zod32.z.number().default(1),
|
|
2807
|
+
sectionId: import_zod32.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
2808
|
+
sectionType: import_zod32.z.literal(SectionType.discount).default(SectionType.discount),
|
|
2809
|
+
type: import_zod32.z.enum(discountTypes).catch("none")
|
|
2680
2810
|
});
|
|
2681
2811
|
|
|
2682
2812
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
2683
2813
|
var import_uuid9 = require("uuid");
|
|
2684
|
-
var
|
|
2685
|
-
var CABMonetizeAds =
|
|
2686
|
-
requestId:
|
|
2814
|
+
var import_zod33 = require("zod");
|
|
2815
|
+
var CABMonetizeAds = import_zod33.z.object({
|
|
2816
|
+
requestId: import_zod33.z.string().optional(),
|
|
2687
2817
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
2688
|
-
testing:
|
|
2818
|
+
testing: import_zod33.z.boolean().default(false)
|
|
2689
2819
|
});
|
|
2690
|
-
var CABMonetizeSection =
|
|
2820
|
+
var CABMonetizeSection = import_zod33.z.object({
|
|
2691
2821
|
...CABVariableFields,
|
|
2692
2822
|
ads: CABMonetizeAds.optional(),
|
|
2693
|
-
name:
|
|
2823
|
+
name: import_zod33.z.string().optional(),
|
|
2694
2824
|
/**
|
|
2695
2825
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
2696
2826
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
2697
2827
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
2698
2828
|
*/
|
|
2699
|
-
offers:
|
|
2829
|
+
offers: import_zod33.z.array(import_zod33.z.lazy(() => CABSection)).optional(),
|
|
2700
2830
|
/** Privacy Policy footer href (the widget's `privacy_policy_url` setting); read server-side for hydration, relayed by the client only on the legacy `/cab/monetize` fallback. */
|
|
2701
|
-
privacyPolicyUrl:
|
|
2702
|
-
sectionId:
|
|
2703
|
-
sectionType:
|
|
2831
|
+
privacyPolicyUrl: import_zod33.z.string().optional(),
|
|
2832
|
+
sectionId: import_zod33.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
2833
|
+
sectionType: import_zod33.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2704
2834
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
2705
|
-
subVertical:
|
|
2835
|
+
subVertical: import_zod33.z.string().optional(),
|
|
2706
2836
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
2707
|
-
vertical:
|
|
2837
|
+
vertical: import_zod33.z.string().optional()
|
|
2708
2838
|
});
|
|
2709
2839
|
|
|
2710
2840
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2711
|
-
var
|
|
2841
|
+
var import_zod34 = require("zod");
|
|
2712
2842
|
|
|
2713
2843
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
2714
2844
|
var GIFT_LABELS = {
|
|
@@ -2827,34 +2957,34 @@ var GIFT_LABELS = {
|
|
|
2827
2957
|
};
|
|
2828
2958
|
|
|
2829
2959
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2830
|
-
var CABProgressTierExclusion =
|
|
2831
|
-
collectionIds:
|
|
2832
|
-
productIds:
|
|
2833
|
-
tags:
|
|
2834
|
-
type:
|
|
2960
|
+
var CABProgressTierExclusion = import_zod34.z.object({
|
|
2961
|
+
collectionIds: import_zod34.z.array(import_zod34.z.number().int().positive()).default(() => []),
|
|
2962
|
+
productIds: import_zod34.z.array(import_zod34.z.number().int().positive()).default(() => []),
|
|
2963
|
+
tags: import_zod34.z.array(import_zod34.z.string().min(1)).default(() => []),
|
|
2964
|
+
type: import_zod34.z.enum(progressTierExclusionTypes)
|
|
2835
2965
|
});
|
|
2836
|
-
var CABProgressTier =
|
|
2966
|
+
var CABProgressTier = import_zod34.z.object({
|
|
2837
2967
|
/**
|
|
2838
2968
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
2839
2969
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
2840
2970
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
2841
2971
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
2842
2972
|
*/
|
|
2843
|
-
discount:
|
|
2973
|
+
discount: import_zod34.z.object({ amount: import_zod34.z.number().nonnegative(), type: import_zod34.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
2844
2974
|
/**
|
|
2845
2975
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
2846
2976
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
2847
2977
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
2848
2978
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
2849
2979
|
*/
|
|
2850
|
-
exclusions:
|
|
2980
|
+
exclusions: import_zod34.z.array(CABProgressTierExclusion).default(() => []),
|
|
2851
2981
|
/**
|
|
2852
2982
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
2853
2983
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
2854
2984
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
2855
2985
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
2856
2986
|
*/
|
|
2857
|
-
filterOosVariants:
|
|
2987
|
+
filterOosVariants: import_zod34.z.boolean().default(false),
|
|
2858
2988
|
/**
|
|
2859
2989
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
2860
2990
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -2862,10 +2992,10 @@ var CABProgressTier = import_zod28.z.object({
|
|
|
2862
2992
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
2863
2993
|
* tree is complete.
|
|
2864
2994
|
*/
|
|
2865
|
-
gift:
|
|
2866
|
-
productId:
|
|
2867
|
-
title:
|
|
2868
|
-
variantIds:
|
|
2995
|
+
gift: import_zod34.z.object({
|
|
2996
|
+
productId: import_zod34.z.number().int().positive(),
|
|
2997
|
+
title: import_zod34.z.string().optional(),
|
|
2998
|
+
variantIds: import_zod34.z.array(import_zod34.z.number().int().positive()).default(() => [])
|
|
2869
2999
|
}).optional(),
|
|
2870
3000
|
/**
|
|
2871
3001
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -2885,7 +3015,7 @@ var CABProgressTier = import_zod28.z.object({
|
|
|
2885
3015
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
2886
3016
|
* React's size rather than the old hardcoded 20.
|
|
2887
3017
|
*/
|
|
2888
|
-
iconSizePx:
|
|
3018
|
+
iconSizePx: import_zod34.z.number().int().min(1).max(64).default(18),
|
|
2889
3019
|
/**
|
|
2890
3020
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
2891
3021
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -2895,35 +3025,35 @@ var CABProgressTier = import_zod28.z.object({
|
|
|
2895
3025
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
2896
3026
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
2897
3027
|
*/
|
|
2898
|
-
label:
|
|
3028
|
+
label: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.string()).optional(),
|
|
2899
3029
|
/**
|
|
2900
3030
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
2901
3031
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
2902
3032
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
2903
3033
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
2904
3034
|
*/
|
|
2905
|
-
productTierImage:
|
|
3035
|
+
productTierImage: import_zod34.z.boolean().default(false),
|
|
2906
3036
|
/**
|
|
2907
3037
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
2908
3038
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
2909
3039
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
2910
3040
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
2911
3041
|
*/
|
|
2912
|
-
threshold:
|
|
3042
|
+
threshold: import_zod34.z.number().int().nonnegative(),
|
|
2913
3043
|
/**
|
|
2914
3044
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
2915
3045
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
2916
3046
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
2917
3047
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
2918
3048
|
*/
|
|
2919
|
-
thresholds:
|
|
3049
|
+
thresholds: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.number().int().nonnegative()).default(() => ({})),
|
|
2920
3050
|
/**
|
|
2921
3051
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
2922
3052
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
2923
3053
|
* shipping bar (single unlabeled tier, no gift).
|
|
2924
3054
|
*/
|
|
2925
|
-
tierId:
|
|
2926
|
-
tierType:
|
|
3055
|
+
tierId: import_zod34.z.string().optional(),
|
|
3056
|
+
tierType: import_zod34.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
2927
3057
|
/**
|
|
2928
3058
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
2929
3059
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -2934,9 +3064,9 @@ var CABProgressTier = import_zod28.z.object({
|
|
|
2934
3064
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
2935
3065
|
* template text supplies grammatically-neutral wording around the token.
|
|
2936
3066
|
*/
|
|
2937
|
-
unit:
|
|
3067
|
+
unit: import_zod34.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
2938
3068
|
});
|
|
2939
|
-
var CABProgressBarSection =
|
|
3069
|
+
var CABProgressBarSection = import_zod34.z.lazy(
|
|
2940
3070
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2941
3071
|
/**
|
|
2942
3072
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -2945,35 +3075,35 @@ var CABProgressBarSection = import_zod28.z.lazy(
|
|
|
2945
3075
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
2946
3076
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
2947
3077
|
*/
|
|
2948
|
-
barId:
|
|
3078
|
+
barId: import_zod34.z.string().optional(),
|
|
2949
3079
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
2950
|
-
countryCodes:
|
|
3080
|
+
countryCodes: import_zod34.z.array(import_zod34.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2951
3081
|
/**
|
|
2952
3082
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
2953
3083
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
2954
3084
|
*/
|
|
2955
|
-
excludeCountryCodes:
|
|
3085
|
+
excludeCountryCodes: import_zod34.z.array(import_zod34.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2956
3086
|
/**
|
|
2957
3087
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
2958
3088
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
2959
3089
|
* adds the cart's discount allocations back to the live subtotal.
|
|
2960
3090
|
*/
|
|
2961
|
-
excludeDiscountInSubtotal:
|
|
3091
|
+
excludeDiscountInSubtotal: import_zod34.z.boolean().default(false),
|
|
2962
3092
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
2963
|
-
excludedVariantIds:
|
|
3093
|
+
excludedVariantIds: import_zod34.z.array(import_zod34.z.number().int().positive()).default(() => []),
|
|
2964
3094
|
/**
|
|
2965
3095
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
2966
3096
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
2967
3097
|
*/
|
|
2968
|
-
freeShippingOnSubscription:
|
|
3098
|
+
freeShippingOnSubscription: import_zod34.z.boolean().default(false),
|
|
2969
3099
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
2970
|
-
giftAreaTitle:
|
|
3100
|
+
giftAreaTitle: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
2971
3101
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
2972
|
-
giftLabels:
|
|
2973
|
-
addGift:
|
|
2974
|
-
remove:
|
|
2975
|
-
selectOptions:
|
|
2976
|
-
yourGift:
|
|
3102
|
+
giftLabels: import_zod34.z.object({
|
|
3103
|
+
addGift: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
3104
|
+
remove: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
3105
|
+
selectOptions: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
3106
|
+
yourGift: import_zod34.z.record(import_zod34.z.string(), import_zod34.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
2977
3107
|
}).default(() => ({
|
|
2978
3108
|
addGift: { ...GIFT_LABELS.addGift },
|
|
2979
3109
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -2981,38 +3111,38 @@ var CABProgressBarSection = import_zod28.z.lazy(
|
|
|
2981
3111
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
2982
3112
|
})),
|
|
2983
3113
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
2984
|
-
name:
|
|
3114
|
+
name: import_zod34.z.string().default("Order progress"),
|
|
2985
3115
|
/**
|
|
2986
3116
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
2987
3117
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
2988
3118
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
2989
3119
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
2990
3120
|
*/
|
|
2991
|
-
progressColor:
|
|
2992
|
-
sectionType:
|
|
3121
|
+
progressColor: import_zod34.z.string().optional(),
|
|
3122
|
+
sectionType: import_zod34.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
2993
3123
|
/**
|
|
2994
3124
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
2995
3125
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
2996
3126
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
2997
3127
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
2998
3128
|
*/
|
|
2999
|
-
tiers:
|
|
3129
|
+
tiers: import_zod34.z.union([import_zod34.z.array(CABProgressTier), import_zod34.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
3000
3130
|
})
|
|
3001
3131
|
);
|
|
3002
3132
|
|
|
3003
3133
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
3004
3134
|
var import_uuid10 = require("uuid");
|
|
3005
|
-
var
|
|
3006
|
-
var CABQuantitySection =
|
|
3135
|
+
var import_zod35 = require("zod");
|
|
3136
|
+
var CABQuantitySection = import_zod35.z.object({
|
|
3007
3137
|
...CABVariableFields,
|
|
3008
|
-
errorMessages:
|
|
3009
|
-
|
|
3010
|
-
|
|
3138
|
+
errorMessages: import_zod35.z.record(
|
|
3139
|
+
import_zod35.z.string(),
|
|
3140
|
+
import_zod35.z.object({
|
|
3011
3141
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
3012
|
-
increment:
|
|
3013
|
-
max:
|
|
3014
|
-
min:
|
|
3015
|
-
neg:
|
|
3142
|
+
increment: import_zod35.z.string().optional(),
|
|
3143
|
+
max: import_zod35.z.string().optional(),
|
|
3144
|
+
min: import_zod35.z.string().optional(),
|
|
3145
|
+
neg: import_zod35.z.string().optional()
|
|
3016
3146
|
})
|
|
3017
3147
|
).default({
|
|
3018
3148
|
en: {
|
|
@@ -3022,18 +3152,18 @@ var CABQuantitySection = import_zod29.z.object({
|
|
|
3022
3152
|
neg: "Quantity cannot be negative"
|
|
3023
3153
|
}
|
|
3024
3154
|
}),
|
|
3025
|
-
inputType:
|
|
3026
|
-
max:
|
|
3027
|
-
min:
|
|
3155
|
+
inputType: import_zod35.z.enum(quantityInputs).default(QuantityInput.select),
|
|
3156
|
+
max: import_zod35.z.number().min(1).max(100).default(10),
|
|
3157
|
+
min: import_zod35.z.number().min(1).default(1),
|
|
3028
3158
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
3029
|
-
name:
|
|
3030
|
-
sectionId:
|
|
3031
|
-
sectionType:
|
|
3159
|
+
name: import_zod35.z.string().default("Quantity"),
|
|
3160
|
+
sectionId: import_zod35.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
3161
|
+
sectionType: import_zod35.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
3032
3162
|
});
|
|
3033
3163
|
|
|
3034
3164
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3035
3165
|
var import_uuid11 = require("uuid");
|
|
3036
|
-
var
|
|
3166
|
+
var import_zod36 = require("zod");
|
|
3037
3167
|
|
|
3038
3168
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
3039
3169
|
var REVIEW_LABELS = {
|
|
@@ -3096,50 +3226,61 @@ var REVIEW_LABELS = {
|
|
|
3096
3226
|
};
|
|
3097
3227
|
|
|
3098
3228
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3099
|
-
var CABReviewsSection =
|
|
3229
|
+
var CABReviewsSection = import_zod36.z.object({
|
|
3100
3230
|
...CABVariableFields,
|
|
3101
|
-
color:
|
|
3231
|
+
color: import_zod36.z.string().default("#fadb14"),
|
|
3102
3232
|
/**
|
|
3103
3233
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
3104
3234
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
3105
3235
|
* or merchant work.
|
|
3106
3236
|
*/
|
|
3107
|
-
countLabels:
|
|
3108
|
-
one:
|
|
3109
|
-
other:
|
|
3237
|
+
countLabels: import_zod36.z.object({
|
|
3238
|
+
one: import_zod36.z.record(import_zod36.z.string(), import_zod36.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
3239
|
+
other: import_zod36.z.record(import_zod36.z.string(), import_zod36.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
3110
3240
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
3111
|
-
name:
|
|
3112
|
-
sectionId:
|
|
3113
|
-
sectionType:
|
|
3114
|
-
size:
|
|
3241
|
+
name: import_zod36.z.string().optional(),
|
|
3242
|
+
sectionId: import_zod36.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
3243
|
+
sectionType: import_zod36.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
3244
|
+
size: import_zod36.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
3245
|
+
strokeColor: import_zod36.z.string().default("#fadb14"),
|
|
3246
|
+
strokeWidth: import_zod36.z.number().nonnegative().default(0)
|
|
3247
|
+
});
|
|
3248
|
+
|
|
3249
|
+
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
3250
|
+
var import_uuid12 = require("uuid");
|
|
3251
|
+
var import_zod37 = require("zod");
|
|
3252
|
+
var CABSeparatorSection = import_zod37.z.object({
|
|
3253
|
+
...CABVariableFields,
|
|
3254
|
+
sectionId: import_zod37.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
3255
|
+
sectionType: import_zod37.z.literal(SectionType.separator).default(SectionType.separator)
|
|
3115
3256
|
});
|
|
3116
3257
|
|
|
3117
3258
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
3118
3259
|
var import_compat3 = require("es-toolkit/compat");
|
|
3119
|
-
var
|
|
3120
|
-
var
|
|
3121
|
-
var CABVariantsSection =
|
|
3260
|
+
var import_uuid13 = require("uuid");
|
|
3261
|
+
var import_zod38 = require("zod");
|
|
3262
|
+
var CABVariantsSection = import_zod38.z.object({
|
|
3122
3263
|
...CABVariableFields,
|
|
3123
|
-
hideOutOfStockVariants:
|
|
3124
|
-
name:
|
|
3125
|
-
sectionId:
|
|
3126
|
-
sectionType:
|
|
3127
|
-
selector:
|
|
3128
|
-
variantMode:
|
|
3264
|
+
hideOutOfStockVariants: import_zod38.z.boolean().default(false),
|
|
3265
|
+
name: import_zod38.z.string().optional(),
|
|
3266
|
+
sectionId: import_zod38.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
3267
|
+
sectionType: import_zod38.z.literal(SectionType.variants).default(SectionType.variants),
|
|
3268
|
+
selector: import_zod38.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
3269
|
+
variantMode: import_zod38.z.enum(variantModes).default(VariantMode.multiple)
|
|
3129
3270
|
});
|
|
3130
3271
|
|
|
3131
3272
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3132
|
-
var CABBorder =
|
|
3133
|
-
radius:
|
|
3134
|
-
style:
|
|
3135
|
-
width:
|
|
3273
|
+
var CABBorder = import_zod39.z.object({
|
|
3274
|
+
radius: import_zod39.z.enum(borderRadii).default(BorderRadius.base),
|
|
3275
|
+
style: import_zod39.z.enum(borderStyles).default(BorderStyle.none),
|
|
3276
|
+
width: import_zod39.z.enum(borderWidths).default(BorderWidth.base)
|
|
3136
3277
|
}).default({
|
|
3137
3278
|
radius: BorderRadius.base,
|
|
3138
3279
|
style: BorderStyle.none,
|
|
3139
3280
|
width: BorderWidth.base
|
|
3140
3281
|
});
|
|
3141
|
-
var CABSection =
|
|
3142
|
-
() =>
|
|
3282
|
+
var CABSection = import_zod39.z.lazy(
|
|
3283
|
+
() => import_zod39.z.discriminatedUnion("sectionType", [
|
|
3143
3284
|
CABBannerSection,
|
|
3144
3285
|
CABButtonSection,
|
|
3145
3286
|
CABCarouselSection,
|
|
@@ -3155,38 +3296,49 @@ var CABSection = import_zod32.z.lazy(
|
|
|
3155
3296
|
CABProgressBarSection,
|
|
3156
3297
|
CABQuantitySection,
|
|
3157
3298
|
CABReviewsSection,
|
|
3299
|
+
CABSeparatorSection,
|
|
3158
3300
|
CABTextSection,
|
|
3159
3301
|
CABVariantsSection
|
|
3160
3302
|
])
|
|
3161
3303
|
);
|
|
3162
3304
|
|
|
3163
3305
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3164
|
-
var GridItem =
|
|
3165
|
-
var
|
|
3306
|
+
var GridItem = import_zod40.z.union([import_zod40.z.literal("auto"), import_zod40.z.literal("fill"), import_zod40.z.string().regex(/^\d+%$/), import_zod40.z.number()]);
|
|
3307
|
+
var CABLayoutWrapping = import_zod40.z.object({
|
|
3308
|
+
breakAt: import_zod40.z.number().positive(),
|
|
3309
|
+
maxPerLine: import_zod40.z.number().int().positive()
|
|
3310
|
+
});
|
|
3311
|
+
var CABLayoutSection = import_zod40.z.object({
|
|
3166
3312
|
...CABVariableFields,
|
|
3167
|
-
alignment:
|
|
3168
|
-
horizontal:
|
|
3169
|
-
vertical:
|
|
3313
|
+
alignment: import_zod40.z.object({
|
|
3314
|
+
horizontal: import_zod40.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
3315
|
+
vertical: import_zod40.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
3170
3316
|
}).default({
|
|
3171
3317
|
horizontal: HorizontalAlignment.start,
|
|
3172
3318
|
vertical: VerticalAlignment.top
|
|
3173
3319
|
}),
|
|
3174
|
-
border:
|
|
3175
|
-
buttonField:
|
|
3176
|
-
direction:
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3320
|
+
border: import_zod40.z.lazy(() => CABBorder),
|
|
3321
|
+
buttonField: import_zod40.z.enum(buttonFields).optional(),
|
|
3322
|
+
direction: import_zod40.z.enum(directions).default(Direction.rows),
|
|
3323
|
+
/**
|
|
3324
|
+
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
3325
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3326
|
+
*/
|
|
3327
|
+
frame: import_zod40.z.enum(layoutFrames).optional(),
|
|
3328
|
+
grid: import_zod40.z.object({
|
|
3329
|
+
columns: import_zod40.z.union([import_zod40.z.array(GridItem), import_zod40.z.undefined()]).default(() => ["auto"]),
|
|
3330
|
+
rows: import_zod40.z.union([import_zod40.z.array(GridItem), import_zod40.z.undefined()]).default(() => ["auto"])
|
|
3180
3331
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
3181
|
-
name:
|
|
3182
|
-
padding:
|
|
3183
|
-
sectionId:
|
|
3184
|
-
sections:
|
|
3185
|
-
sectionType:
|
|
3186
|
-
spacing:
|
|
3332
|
+
name: import_zod40.z.string().optional(),
|
|
3333
|
+
padding: import_zod40.z.enum(spacings).default(Spacing.none),
|
|
3334
|
+
sectionId: import_zod40.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
3335
|
+
sections: import_zod40.z.union([import_zod40.z.array(import_zod40.z.lazy(() => CABSection)), import_zod40.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3336
|
+
sectionType: import_zod40.z.literal(SectionType.layout).default(SectionType.layout),
|
|
3337
|
+
spacing: import_zod40.z.enum(spacings).default(Spacing.base),
|
|
3187
3338
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
3188
|
-
viewUrl:
|
|
3189
|
-
width:
|
|
3339
|
+
viewUrl: import_zod40.z.string().optional(),
|
|
3340
|
+
width: import_zod40.z.number().default(100),
|
|
3341
|
+
wrapping: CABLayoutWrapping.optional()
|
|
3190
3342
|
});
|
|
3191
3343
|
|
|
3192
3344
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -3207,8 +3359,8 @@ var UI_LABELS = {
|
|
|
3207
3359
|
};
|
|
3208
3360
|
|
|
3209
3361
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3210
|
-
var localized = (fallback) =>
|
|
3211
|
-
var CABUILabels =
|
|
3362
|
+
var localized = (fallback) => import_zod41.z.record(import_zod41.z.string(), import_zod41.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
3363
|
+
var CABUILabels = import_zod41.z.object({
|
|
3212
3364
|
currentPage: localized(UI_LABELS.currentPage),
|
|
3213
3365
|
guest: localized(UI_LABELS.guest),
|
|
3214
3366
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -3233,154 +3385,154 @@ var CABUILabels = import_zod34.z.object({
|
|
|
3233
3385
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
3234
3386
|
updating: { ...UI_LABELS.updating }
|
|
3235
3387
|
}));
|
|
3236
|
-
var TargetArea =
|
|
3237
|
-
fill:
|
|
3238
|
-
flip:
|
|
3239
|
-
icon:
|
|
3240
|
-
label:
|
|
3241
|
-
width:
|
|
3388
|
+
var TargetArea = import_zod41.z.object({
|
|
3389
|
+
fill: import_zod41.z.boolean().optional(),
|
|
3390
|
+
flip: import_zod41.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3391
|
+
icon: import_zod41.z.string(),
|
|
3392
|
+
label: import_zod41.z.string(),
|
|
3393
|
+
width: import_zod41.z.string()
|
|
3242
3394
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
3243
|
-
var CABTracking =
|
|
3244
|
-
enableAttribution:
|
|
3245
|
-
enableSource:
|
|
3246
|
-
enableWidget:
|
|
3395
|
+
var CABTracking = import_zod41.z.object({
|
|
3396
|
+
enableAttribution: import_zod41.z.boolean().nullish().transform((value) => value ?? true),
|
|
3397
|
+
enableSource: import_zod41.z.boolean().nullish().transform((value) => value ?? true),
|
|
3398
|
+
enableWidget: import_zod41.z.boolean().nullish().transform((value) => value ?? true)
|
|
3247
3399
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
3248
|
-
var CABExperiment =
|
|
3249
|
-
elementId:
|
|
3250
|
-
experimentId:
|
|
3251
|
-
experimentType:
|
|
3252
|
-
selectedId:
|
|
3400
|
+
var CABExperiment = import_zod41.z.object({
|
|
3401
|
+
elementId: import_zod41.z.number(),
|
|
3402
|
+
experimentId: import_zod41.z.number(),
|
|
3403
|
+
experimentType: import_zod41.z.string(),
|
|
3404
|
+
selectedId: import_zod41.z.number()
|
|
3253
3405
|
});
|
|
3254
3406
|
var CABRootSection = CABLayoutSection.extend({
|
|
3255
|
-
editorMode:
|
|
3407
|
+
editorMode: import_zod41.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
3256
3408
|
experiment: CABExperiment.optional(),
|
|
3257
3409
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
3258
3410
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
3259
|
-
previewMode:
|
|
3260
|
-
storeId:
|
|
3411
|
+
previewMode: import_zod41.z.boolean().nullish().transform((value) => value ?? false),
|
|
3412
|
+
storeId: import_zod41.z.number().nullable().default(null),
|
|
3261
3413
|
targetArea: TargetArea.nullable(),
|
|
3262
3414
|
tracking: CABTracking,
|
|
3263
|
-
type:
|
|
3415
|
+
type: import_zod41.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
3264
3416
|
uiLabels: CABUILabels,
|
|
3265
|
-
version:
|
|
3266
|
-
widgetId:
|
|
3417
|
+
version: import_zod41.z.literal(2).default(2),
|
|
3418
|
+
widgetId: import_zod41.z.number().nullable().default(null)
|
|
3267
3419
|
});
|
|
3268
3420
|
|
|
3269
3421
|
// src/schema/widgets/contentBlock.ts
|
|
3270
|
-
var ContentBlockV1 =
|
|
3271
|
-
blockSpacing:
|
|
3272
|
-
imageBlocks:
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
altText:
|
|
3276
|
-
description:
|
|
3277
|
-
id:
|
|
3278
|
-
imagePlacement:
|
|
3279
|
-
imageSize:
|
|
3280
|
-
imageUrl:
|
|
3281
|
-
textAlignment:
|
|
3422
|
+
var ContentBlockV1 = import_zod42.z.object({
|
|
3423
|
+
blockSpacing: import_zod42.z.enum(spacings).optional(),
|
|
3424
|
+
imageBlocks: import_zod42.z.union([
|
|
3425
|
+
import_zod42.z.array(
|
|
3426
|
+
import_zod42.z.object({
|
|
3427
|
+
altText: import_zod42.z.string().nullable(),
|
|
3428
|
+
description: import_zod42.z.string().nullable(),
|
|
3429
|
+
id: import_zod42.z.uuid(),
|
|
3430
|
+
imagePlacement: import_zod42.z.enum(["top", "right", "bottom", "left"]),
|
|
3431
|
+
imageSize: import_zod42.z.number(),
|
|
3432
|
+
imageUrl: import_zod42.z.url(),
|
|
3433
|
+
textAlignment: import_zod42.z.enum(["left", "center", "right"]),
|
|
3282
3434
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
3283
|
-
textSize:
|
|
3435
|
+
textSize: import_zod42.z.enum(inlineTextSizeNames)
|
|
3284
3436
|
})
|
|
3285
3437
|
),
|
|
3286
|
-
|
|
3438
|
+
import_zod42.z.strictObject({}).transform(() => [])
|
|
3287
3439
|
]).optional(),
|
|
3288
|
-
imageLayout:
|
|
3289
|
-
language:
|
|
3290
|
-
description:
|
|
3291
|
-
superTitle:
|
|
3292
|
-
title:
|
|
3440
|
+
imageLayout: import_zod42.z.enum(["row", "column"]).optional(),
|
|
3441
|
+
language: import_zod42.z.object({
|
|
3442
|
+
description: import_zod42.z.string(),
|
|
3443
|
+
superTitle: import_zod42.z.string(),
|
|
3444
|
+
title: import_zod42.z.string()
|
|
3293
3445
|
}),
|
|
3294
|
-
previewMode:
|
|
3295
|
-
type:
|
|
3296
|
-
version:
|
|
3446
|
+
previewMode: import_zod42.z.boolean(),
|
|
3447
|
+
type: import_zod42.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
3448
|
+
version: import_zod42.z.literal(1)
|
|
3297
3449
|
});
|
|
3298
|
-
var ContentBlock =
|
|
3450
|
+
var ContentBlock = import_zod42.z.discriminatedUnion("version", [
|
|
3299
3451
|
ContentBlockV1,
|
|
3300
3452
|
CABRootSection.extend({
|
|
3301
|
-
type:
|
|
3453
|
+
type: import_zod42.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
3302
3454
|
})
|
|
3303
3455
|
]);
|
|
3304
3456
|
|
|
3305
3457
|
// src/schema/widgets/giftWithPurchase.ts
|
|
3306
|
-
var
|
|
3307
|
-
var GiftWithPurchase =
|
|
3308
|
-
type:
|
|
3458
|
+
var import_zod43 = require("zod");
|
|
3459
|
+
var GiftWithPurchase = import_zod43.z.looseObject({
|
|
3460
|
+
type: import_zod43.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
3309
3461
|
});
|
|
3310
3462
|
|
|
3311
3463
|
// src/schema/widgets/lineItemEditor.ts
|
|
3312
|
-
var
|
|
3313
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
3314
|
-
downgradeToOneTimeLabel:
|
|
3464
|
+
var import_zod44 = require("zod");
|
|
3465
|
+
var LineItemEditorSwitchLanguageV1 = import_zod44.z.object({
|
|
3466
|
+
downgradeToOneTimeLabel: import_zod44.z.string().optional(),
|
|
3315
3467
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
3316
|
-
subscriptionOptionLabel:
|
|
3317
|
-
upgradeToSubscriptionLabel:
|
|
3318
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
3468
|
+
subscriptionOptionLabel: import_zod44.z.string().optional(),
|
|
3469
|
+
upgradeToSubscriptionLabel: import_zod44.z.string().optional(),
|
|
3470
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod44.z.string().optional()
|
|
3319
3471
|
});
|
|
3320
|
-
var LineItemEditorV1 =
|
|
3472
|
+
var LineItemEditorV1 = import_zod44.z.object({
|
|
3321
3473
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
3322
|
-
button:
|
|
3323
|
-
previewMode:
|
|
3324
|
-
switchToSubscription:
|
|
3325
|
-
disableDowngrade:
|
|
3474
|
+
button: import_zod44.z.object({ kind: import_zod44.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
3475
|
+
previewMode: import_zod44.z.boolean().optional(),
|
|
3476
|
+
switchToSubscription: import_zod44.z.object({
|
|
3477
|
+
disableDowngrade: import_zod44.z.boolean().optional(),
|
|
3326
3478
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
3327
3479
|
}).optional(),
|
|
3328
|
-
switchToSubscriptionEnabled:
|
|
3329
|
-
tracking:
|
|
3330
|
-
enableAttribution:
|
|
3331
|
-
enableSource:
|
|
3332
|
-
enableWidget:
|
|
3480
|
+
switchToSubscriptionEnabled: import_zod44.z.boolean().optional(),
|
|
3481
|
+
tracking: import_zod44.z.object({
|
|
3482
|
+
enableAttribution: import_zod44.z.boolean().optional(),
|
|
3483
|
+
enableSource: import_zod44.z.boolean().optional(),
|
|
3484
|
+
enableWidget: import_zod44.z.boolean().optional()
|
|
3333
3485
|
}).optional(),
|
|
3334
|
-
type:
|
|
3335
|
-
version:
|
|
3486
|
+
type: import_zod44.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
3487
|
+
version: import_zod44.z.literal(1)
|
|
3336
3488
|
});
|
|
3337
|
-
var LineItemEditor =
|
|
3489
|
+
var LineItemEditor = import_zod44.z.discriminatedUnion("version", [
|
|
3338
3490
|
LineItemEditorV1,
|
|
3339
3491
|
CABRootSection.extend({
|
|
3340
|
-
type:
|
|
3492
|
+
type: import_zod44.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
3341
3493
|
})
|
|
3342
3494
|
]);
|
|
3343
3495
|
|
|
3344
3496
|
// src/schema/widgets/progressBar.ts
|
|
3345
|
-
var
|
|
3346
|
-
var ProgressBar =
|
|
3347
|
-
type:
|
|
3497
|
+
var import_zod45 = require("zod");
|
|
3498
|
+
var ProgressBar = import_zod45.z.looseObject({
|
|
3499
|
+
type: import_zod45.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
3348
3500
|
});
|
|
3349
3501
|
|
|
3350
3502
|
// src/schema/widgets/rebuyButton.ts
|
|
3351
|
-
var
|
|
3352
|
-
var RebuyButtonV1 =
|
|
3353
|
-
type:
|
|
3354
|
-
version:
|
|
3503
|
+
var import_zod46 = require("zod");
|
|
3504
|
+
var RebuyButtonV1 = import_zod46.z.looseObject({
|
|
3505
|
+
type: import_zod46.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
3506
|
+
version: import_zod46.z.literal(1)
|
|
3355
3507
|
});
|
|
3356
|
-
var RebuyButton =
|
|
3508
|
+
var RebuyButton = import_zod46.z.discriminatedUnion("version", [
|
|
3357
3509
|
RebuyButtonV1,
|
|
3358
3510
|
CABRootSection.extend({
|
|
3359
|
-
type:
|
|
3511
|
+
type: import_zod46.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
3360
3512
|
})
|
|
3361
3513
|
]);
|
|
3362
3514
|
|
|
3363
3515
|
// src/schema/widgets/rebuyMonetize.ts
|
|
3364
|
-
var
|
|
3365
|
-
var RebuyMonetize =
|
|
3366
|
-
type:
|
|
3516
|
+
var import_zod47 = require("zod");
|
|
3517
|
+
var RebuyMonetize = import_zod47.z.looseObject({
|
|
3518
|
+
type: import_zod47.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
3367
3519
|
});
|
|
3368
|
-
var RebuyMonetizeV1 =
|
|
3369
|
-
name:
|
|
3370
|
-
previewMode:
|
|
3520
|
+
var RebuyMonetizeV1 = import_zod47.z.object({
|
|
3521
|
+
name: import_zod47.z.string().nullable().optional(),
|
|
3522
|
+
previewMode: import_zod47.z.boolean().optional(),
|
|
3371
3523
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
3372
|
-
privacyPolicyUrl:
|
|
3524
|
+
privacyPolicyUrl: import_zod47.z.string().nullable().optional(),
|
|
3373
3525
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
3374
|
-
subVertical:
|
|
3375
|
-
tracking:
|
|
3376
|
-
enableAttribution:
|
|
3377
|
-
enableSource:
|
|
3378
|
-
enableWidget:
|
|
3526
|
+
subVertical: import_zod47.z.string().nullable().optional(),
|
|
3527
|
+
tracking: import_zod47.z.object({
|
|
3528
|
+
enableAttribution: import_zod47.z.boolean().optional(),
|
|
3529
|
+
enableSource: import_zod47.z.boolean().optional(),
|
|
3530
|
+
enableWidget: import_zod47.z.boolean().optional()
|
|
3379
3531
|
}).optional(),
|
|
3380
|
-
type:
|
|
3381
|
-
version:
|
|
3532
|
+
type: import_zod47.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
3533
|
+
version: import_zod47.z.literal(1),
|
|
3382
3534
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
3383
|
-
vertical:
|
|
3535
|
+
vertical: import_zod47.z.string().nullable().optional()
|
|
3384
3536
|
});
|
|
3385
3537
|
|
|
3386
3538
|
// src/schema/widgetData.ts
|
|
@@ -3394,7 +3546,7 @@ var extensionWidgetTypes = [
|
|
|
3394
3546
|
WidgetType.ui_extension_line_item_editor,
|
|
3395
3547
|
WidgetType.ui_extension_progress_bar
|
|
3396
3548
|
];
|
|
3397
|
-
var WidgetData =
|
|
3549
|
+
var WidgetData = import_zod48.z.discriminatedUnion("type", [
|
|
3398
3550
|
ABTestingPlaceholder,
|
|
3399
3551
|
CheckoutExtension,
|
|
3400
3552
|
ContentBlock,
|
|
@@ -3755,15 +3907,15 @@ var SWITCH_LABELS = {
|
|
|
3755
3907
|
|
|
3756
3908
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
3757
3909
|
var import_compat4 = require("es-toolkit/compat");
|
|
3758
|
-
var
|
|
3759
|
-
var strictNumber =
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3910
|
+
var import_zod49 = require("zod");
|
|
3911
|
+
var strictNumber = import_zod49.z.union([
|
|
3912
|
+
import_zod49.z.number(),
|
|
3913
|
+
import_zod49.z.string().transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
3914
|
+
import_zod49.z.unknown().transform(() => 0)
|
|
3763
3915
|
]);
|
|
3764
3916
|
|
|
3765
3917
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
3766
|
-
var
|
|
3918
|
+
var import_zod50 = require("zod");
|
|
3767
3919
|
var blockTypes = [
|
|
3768
3920
|
"callout_banner",
|
|
3769
3921
|
"image",
|
|
@@ -3774,144 +3926,144 @@ var blockTypes = [
|
|
|
3774
3926
|
"text",
|
|
3775
3927
|
"timer"
|
|
3776
3928
|
];
|
|
3777
|
-
var blockType =
|
|
3929
|
+
var blockType = import_zod50.z.enum(blockTypes);
|
|
3778
3930
|
var BlockType = blockType.enum;
|
|
3779
3931
|
|
|
3780
3932
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
3781
3933
|
var import_compat5 = require("es-toolkit/compat");
|
|
3782
|
-
var
|
|
3783
|
-
var
|
|
3784
|
-
var TextAlignment2 =
|
|
3785
|
-
var TextSize =
|
|
3786
|
-
|
|
3787
|
-
|
|
3934
|
+
var import_uuid15 = require("uuid");
|
|
3935
|
+
var import_zod51 = require("zod");
|
|
3936
|
+
var TextAlignment2 = import_zod51.z.union([import_zod51.z.enum(["leading", "center", "trailing"]), import_zod51.z.unknown().transform(() => "leading")]);
|
|
3937
|
+
var TextSize = import_zod51.z.union([
|
|
3938
|
+
import_zod51.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
3939
|
+
import_zod51.z.unknown().transform(() => "medium")
|
|
3788
3940
|
]);
|
|
3789
|
-
var CalloutBannerBlock =
|
|
3790
|
-
id:
|
|
3791
|
-
name:
|
|
3792
|
-
settings:
|
|
3793
|
-
superTitle:
|
|
3794
|
-
title:
|
|
3941
|
+
var CalloutBannerBlock = import_zod51.z.object({
|
|
3942
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
3943
|
+
name: import_zod51.z.string().optional(),
|
|
3944
|
+
settings: import_zod51.z.object({
|
|
3945
|
+
superTitle: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
3946
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
3795
3947
|
}),
|
|
3796
|
-
styles:
|
|
3797
|
-
superTitleEmphasized:
|
|
3948
|
+
styles: import_zod51.z.object({
|
|
3949
|
+
superTitleEmphasized: import_zod51.z.boolean().default(false),
|
|
3798
3950
|
superTitleSize: TextSize.default("large"),
|
|
3799
3951
|
textAlignment: TextAlignment2.default("center"),
|
|
3800
|
-
titleEmphasized:
|
|
3952
|
+
titleEmphasized: import_zod51.z.boolean().default(true),
|
|
3801
3953
|
titleSize: TextSize.default("large")
|
|
3802
3954
|
}),
|
|
3803
|
-
type:
|
|
3955
|
+
type: import_zod51.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
3804
3956
|
});
|
|
3805
|
-
var ImageBlock =
|
|
3806
|
-
id:
|
|
3807
|
-
name:
|
|
3808
|
-
settings:
|
|
3809
|
-
|
|
3957
|
+
var ImageBlock = import_zod51.z.object({
|
|
3958
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
3959
|
+
name: import_zod51.z.string().optional(),
|
|
3960
|
+
settings: import_zod51.z.union([
|
|
3961
|
+
import_zod51.z.object({
|
|
3810
3962
|
/** This isn't used in the post-purchase offer widget */
|
|
3811
|
-
alt:
|
|
3812
|
-
image:
|
|
3813
|
-
imageSize:
|
|
3814
|
-
imageType:
|
|
3963
|
+
alt: import_zod51.z.string().optional().default(""),
|
|
3964
|
+
image: import_zod51.z.union([import_zod51.z.literal(""), import_zod51.z.url()]).default(""),
|
|
3965
|
+
imageSize: import_zod51.z.number().default(20),
|
|
3966
|
+
imageType: import_zod51.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
3815
3967
|
}),
|
|
3816
|
-
|
|
3968
|
+
import_zod51.z.array(import_zod51.z.never()).transform(() => ({}))
|
|
3817
3969
|
]),
|
|
3818
|
-
type:
|
|
3970
|
+
type: import_zod51.z.literal(BlockType.image).default(BlockType.image)
|
|
3819
3971
|
});
|
|
3820
|
-
var ImageContentBlock =
|
|
3821
|
-
id:
|
|
3822
|
-
name:
|
|
3823
|
-
settings:
|
|
3824
|
-
alt:
|
|
3825
|
-
description:
|
|
3972
|
+
var ImageContentBlock = import_zod51.z.object({
|
|
3973
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
3974
|
+
name: import_zod51.z.string().optional(),
|
|
3975
|
+
settings: import_zod51.z.object({
|
|
3976
|
+
alt: import_zod51.z.string().optional().default(""),
|
|
3977
|
+
description: import_zod51.z.union([import_zod51.z.string(), TiptapDocument, import_zod51.z.null()]).default(
|
|
3826
3978
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
3827
3979
|
),
|
|
3828
3980
|
descriptionSize: TextSize.default("medium"),
|
|
3829
3981
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3830
|
-
image:
|
|
3831
|
-
imagePlacement:
|
|
3832
|
-
imageSize:
|
|
3833
|
-
superTitle:
|
|
3982
|
+
image: import_zod51.z.union([import_zod51.z.literal(""), import_zod51.z.url()]).default(""),
|
|
3983
|
+
imagePlacement: import_zod51.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
3984
|
+
imageSize: import_zod51.z.number().default(20),
|
|
3985
|
+
superTitle: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
3834
3986
|
superTitleSize: TextSize.default("medium"),
|
|
3835
3987
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3836
|
-
swapContent:
|
|
3837
|
-
title:
|
|
3988
|
+
swapContent: import_zod51.z.boolean().optional().default(false),
|
|
3989
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
3838
3990
|
titleSize: TextSize.default("medium")
|
|
3839
3991
|
}),
|
|
3840
|
-
type:
|
|
3992
|
+
type: import_zod51.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
3841
3993
|
});
|
|
3842
|
-
var PayButtonBlock =
|
|
3843
|
-
id:
|
|
3844
|
-
name:
|
|
3845
|
-
settings:
|
|
3846
|
-
|
|
3847
|
-
label:
|
|
3994
|
+
var PayButtonBlock = import_zod51.z.object({
|
|
3995
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
3996
|
+
name: import_zod51.z.string().optional(),
|
|
3997
|
+
settings: import_zod51.z.union([
|
|
3998
|
+
import_zod51.z.object({
|
|
3999
|
+
label: import_zod51.z.string().default("Pay Now")
|
|
3848
4000
|
}),
|
|
3849
|
-
|
|
4001
|
+
import_zod51.z.array(import_zod51.z.never()).transform(() => ({
|
|
3850
4002
|
label: "Pay Now"
|
|
3851
4003
|
}))
|
|
3852
4004
|
]),
|
|
3853
|
-
styles:
|
|
3854
|
-
|
|
3855
|
-
buttonWidth:
|
|
4005
|
+
styles: import_zod51.z.union([
|
|
4006
|
+
import_zod51.z.object({
|
|
4007
|
+
buttonWidth: import_zod51.z.number().min(10).max(100).default(50)
|
|
3856
4008
|
}),
|
|
3857
|
-
|
|
4009
|
+
import_zod51.z.array(import_zod51.z.never()).transform(() => ({
|
|
3858
4010
|
buttonWidth: 50
|
|
3859
4011
|
}))
|
|
3860
4012
|
]),
|
|
3861
|
-
type:
|
|
4013
|
+
type: import_zod51.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
3862
4014
|
});
|
|
3863
|
-
var ProductInformationBlock =
|
|
4015
|
+
var ProductInformationBlock = import_zod51.z.object({
|
|
3864
4016
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3865
|
-
hideProductImage:
|
|
3866
|
-
id:
|
|
3867
|
-
name:
|
|
3868
|
-
type:
|
|
4017
|
+
hideProductImage: import_zod51.z.boolean().optional().default(false),
|
|
4018
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4019
|
+
name: import_zod51.z.string().optional(),
|
|
4020
|
+
type: import_zod51.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
3869
4021
|
});
|
|
3870
|
-
var SeparatorBlock =
|
|
3871
|
-
id:
|
|
3872
|
-
name:
|
|
3873
|
-
type:
|
|
4022
|
+
var SeparatorBlock = import_zod51.z.object({
|
|
4023
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4024
|
+
name: import_zod51.z.string().optional(),
|
|
4025
|
+
type: import_zod51.z.literal(BlockType.separator).default(BlockType.separator)
|
|
3874
4026
|
});
|
|
3875
|
-
var TextBlock =
|
|
3876
|
-
id:
|
|
3877
|
-
name:
|
|
3878
|
-
settings:
|
|
3879
|
-
description:
|
|
4027
|
+
var TextBlock = import_zod51.z.object({
|
|
4028
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4029
|
+
name: import_zod51.z.string().optional(),
|
|
4030
|
+
settings: import_zod51.z.object({
|
|
4031
|
+
description: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).optional().default(
|
|
3880
4032
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
3881
4033
|
),
|
|
3882
4034
|
/** This isn't used in the post-purchase offer widget */
|
|
3883
4035
|
descriptionSize: TextSize.default("medium"),
|
|
3884
4036
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3885
|
-
superTitle:
|
|
4037
|
+
superTitle: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default("Super Title"),
|
|
3886
4038
|
/** This isn't used in the post-purchase offer widget */
|
|
3887
4039
|
superTitleSize: TextSize.default("medium"),
|
|
3888
|
-
title:
|
|
4040
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
3889
4041
|
/** This isn't used in the post-purchase offer widget */
|
|
3890
4042
|
titleSize: TextSize.default("medium")
|
|
3891
4043
|
}),
|
|
3892
|
-
type:
|
|
4044
|
+
type: import_zod51.z.literal(BlockType.text).default(BlockType.text)
|
|
3893
4045
|
});
|
|
3894
|
-
var TimerBlock =
|
|
3895
|
-
id:
|
|
3896
|
-
name:
|
|
3897
|
-
settings:
|
|
3898
|
-
durationMinutes:
|
|
3899
|
-
durationSeconds:
|
|
3900
|
-
endOffer:
|
|
3901
|
-
title:
|
|
4046
|
+
var TimerBlock = import_zod51.z.object({
|
|
4047
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4048
|
+
name: import_zod51.z.string().optional(),
|
|
4049
|
+
settings: import_zod51.z.object({
|
|
4050
|
+
durationMinutes: import_zod51.z.number().min(0).default(10),
|
|
4051
|
+
durationSeconds: import_zod51.z.union([import_zod51.z.number().min(0), import_zod51.z.unknown().transform(() => 0)]).default(0),
|
|
4052
|
+
endOffer: import_zod51.z.boolean().default(true),
|
|
4053
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
3902
4054
|
}),
|
|
3903
|
-
styles:
|
|
4055
|
+
styles: import_zod51.z.object({
|
|
3904
4056
|
textAlignment: TextAlignment2.default("center"),
|
|
3905
|
-
timerBackgroundColor:
|
|
3906
|
-
timerEmphasized:
|
|
4057
|
+
timerBackgroundColor: import_zod51.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
4058
|
+
timerEmphasized: import_zod51.z.union([import_zod51.z.boolean(), import_zod51.z.unknown().transform(() => true)]).default(true),
|
|
3907
4059
|
timerSize: TextSize.default("medium"),
|
|
3908
|
-
timerWidth:
|
|
3909
|
-
titleEmphasized:
|
|
4060
|
+
timerWidth: import_zod51.z.number().min(10).max(100).optional().default(100),
|
|
4061
|
+
titleEmphasized: import_zod51.z.union([import_zod51.z.boolean(), import_zod51.z.unknown().transform(() => true)]).default(false),
|
|
3910
4062
|
titleSize: TextSize.default("medium")
|
|
3911
4063
|
}),
|
|
3912
|
-
type:
|
|
4064
|
+
type: import_zod51.z.literal(BlockType.timer).default(BlockType.timer)
|
|
3913
4065
|
});
|
|
3914
|
-
var PostPurchaseBlock =
|
|
4066
|
+
var PostPurchaseBlock = import_zod51.z.discriminatedUnion("type", [
|
|
3915
4067
|
CalloutBannerBlock,
|
|
3916
4068
|
ImageBlock,
|
|
3917
4069
|
ImageContentBlock,
|
|
@@ -3931,68 +4083,68 @@ var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)
|
|
|
3931
4083
|
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
3932
4084
|
|
|
3933
4085
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3934
|
-
var
|
|
4086
|
+
var import_zod54 = require("zod");
|
|
3935
4087
|
|
|
3936
4088
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3937
|
-
var
|
|
4089
|
+
var import_zod53 = require("zod");
|
|
3938
4090
|
|
|
3939
4091
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
3940
|
-
var
|
|
3941
|
-
var PostPurchaseSettings =
|
|
3942
|
-
advance:
|
|
3943
|
-
blocks:
|
|
4092
|
+
var import_zod52 = require("zod");
|
|
4093
|
+
var PostPurchaseSettings = import_zod52.z.object({
|
|
4094
|
+
advance: import_zod52.z.object({ removePartialOrder: import_zod52.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
4095
|
+
blocks: import_zod52.z.union([import_zod52.z.array(PostPurchaseBlock), import_zod52.z.unknown().transform(() => [])]).default(() => [
|
|
3944
4096
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3945
4097
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3946
4098
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3947
4099
|
]),
|
|
3948
|
-
columnLayout:
|
|
3949
|
-
discount:
|
|
4100
|
+
columnLayout: import_zod52.z.boolean().optional(),
|
|
4101
|
+
discount: import_zod52.z.object({
|
|
3950
4102
|
amount: strictNumber.default(30),
|
|
3951
|
-
shouldShowSavingText:
|
|
3952
|
-
type:
|
|
4103
|
+
shouldShowSavingText: import_zod52.z.boolean().optional().default(true),
|
|
4104
|
+
type: import_zod52.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3953
4105
|
}),
|
|
3954
|
-
discountedFrom:
|
|
3955
|
-
endpoint:
|
|
3956
|
-
integrations:
|
|
3957
|
-
judgeme:
|
|
3958
|
-
junip:
|
|
3959
|
-
klaviyo:
|
|
3960
|
-
loox:
|
|
3961
|
-
okendo:
|
|
3962
|
-
opinew:
|
|
3963
|
-
reviewsio:
|
|
3964
|
-
stamped:
|
|
3965
|
-
yotpo:
|
|
4106
|
+
discountedFrom: import_zod52.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
4107
|
+
endpoint: import_zod52.z.string().optional(),
|
|
4108
|
+
integrations: import_zod52.z.object({
|
|
4109
|
+
judgeme: import_zod52.z.boolean().default(false),
|
|
4110
|
+
junip: import_zod52.z.boolean().optional().default(false),
|
|
4111
|
+
klaviyo: import_zod52.z.boolean().default(false),
|
|
4112
|
+
loox: import_zod52.z.boolean().default(false),
|
|
4113
|
+
okendo: import_zod52.z.boolean().default(false),
|
|
4114
|
+
opinew: import_zod52.z.boolean().optional().default(false),
|
|
4115
|
+
reviewsio: import_zod52.z.boolean().optional().default(false),
|
|
4116
|
+
stamped: import_zod52.z.boolean().default(false),
|
|
4117
|
+
yotpo: import_zod52.z.boolean().default(false)
|
|
3966
4118
|
}),
|
|
3967
|
-
key:
|
|
3968
|
-
language:
|
|
3969
|
-
description:
|
|
3970
|
-
descriptionEnabled:
|
|
3971
|
-
descriptionRte:
|
|
3972
|
-
content:
|
|
3973
|
-
type:
|
|
4119
|
+
key: import_zod52.z.string().optional(),
|
|
4120
|
+
language: import_zod52.z.object({
|
|
4121
|
+
description: import_zod52.z.union([import_zod52.z.string(), import_zod52.z.unknown().transform(() => "")]).default(""),
|
|
4122
|
+
descriptionEnabled: import_zod52.z.boolean().optional().default(false),
|
|
4123
|
+
descriptionRte: import_zod52.z.object({
|
|
4124
|
+
content: import_zod52.z.array(import_zod52.z.unknown()),
|
|
4125
|
+
type: import_zod52.z.string()
|
|
3974
4126
|
}).optional(),
|
|
3975
|
-
descriptionSpacing:
|
|
3976
|
-
displayCtaPrice:
|
|
3977
|
-
global:
|
|
3978
|
-
declineAll:
|
|
3979
|
-
declineThisOffer:
|
|
3980
|
-
free:
|
|
3981
|
-
notAvailable:
|
|
3982
|
-
payNow:
|
|
3983
|
-
payNowUpgradeToSubscription:
|
|
3984
|
-
quantity:
|
|
4127
|
+
descriptionSpacing: import_zod52.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
4128
|
+
displayCtaPrice: import_zod52.z.boolean().default(true),
|
|
4129
|
+
global: import_zod52.z.object({
|
|
4130
|
+
declineAll: import_zod52.z.string().optional().default("Decline All"),
|
|
4131
|
+
declineThisOffer: import_zod52.z.string().default("Decline this offer"),
|
|
4132
|
+
free: import_zod52.z.string().optional().default("Free"),
|
|
4133
|
+
notAvailable: import_zod52.z.string().optional().default("Not available"),
|
|
4134
|
+
payNow: import_zod52.z.string().default("Pay Now"),
|
|
4135
|
+
payNowUpgradeToSubscription: import_zod52.z.string().optional().default("Upgrade to Subscription"),
|
|
4136
|
+
quantity: import_zod52.z.string().default("Quantity"),
|
|
3985
4137
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3986
|
-
recurringShipping:
|
|
3987
|
-
recurringSubtotal:
|
|
3988
|
-
reviewsPlural:
|
|
3989
|
-
reviewsSingular:
|
|
3990
|
-
save:
|
|
3991
|
-
shipping:
|
|
3992
|
-
subscriptionOption:
|
|
3993
|
-
subtotal:
|
|
3994
|
-
taxes:
|
|
3995
|
-
total:
|
|
4138
|
+
recurringShipping: import_zod52.z.string().optional().default("Recurring shipping"),
|
|
4139
|
+
recurringSubtotal: import_zod52.z.string().default("Recurring subtotal"),
|
|
4140
|
+
reviewsPlural: import_zod52.z.string().optional().default("Reviews"),
|
|
4141
|
+
reviewsSingular: import_zod52.z.string().optional().default("Review"),
|
|
4142
|
+
save: import_zod52.z.union([import_zod52.z.string(), import_zod52.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
4143
|
+
shipping: import_zod52.z.string().default("Shipping"),
|
|
4144
|
+
subscriptionOption: import_zod52.z.string().optional().default("Subscribe and Save"),
|
|
4145
|
+
subtotal: import_zod52.z.string().default("Subtotal"),
|
|
4146
|
+
taxes: import_zod52.z.string().default("Taxes"),
|
|
4147
|
+
total: import_zod52.z.string().default("Total")
|
|
3996
4148
|
}).optional().default(() => ({
|
|
3997
4149
|
declineAll: "Decline All",
|
|
3998
4150
|
declineThisOffer: "Decline this offer",
|
|
@@ -4013,70 +4165,70 @@ var PostPurchaseSettings = import_zod45.z.object({
|
|
|
4013
4165
|
taxes: "Taxes",
|
|
4014
4166
|
total: "Total"
|
|
4015
4167
|
})),
|
|
4016
|
-
globalTranslation:
|
|
4168
|
+
globalTranslation: import_zod52.z.string().optional().default("english")
|
|
4017
4169
|
}),
|
|
4018
|
-
metafields:
|
|
4170
|
+
metafields: import_zod52.z.boolean().default(false),
|
|
4019
4171
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4020
|
-
offer:
|
|
4021
|
-
count:
|
|
4172
|
+
offer: import_zod52.z.object({
|
|
4173
|
+
count: import_zod52.z.number().default(1)
|
|
4022
4174
|
}),
|
|
4023
|
-
offersLayout:
|
|
4024
|
-
itemsPerPage:
|
|
4025
|
-
type:
|
|
4175
|
+
offersLayout: import_zod52.z.object({
|
|
4176
|
+
itemsPerPage: import_zod52.z.number().optional(),
|
|
4177
|
+
type: import_zod52.z.enum(["list", "grid", "carousel"]).default("list")
|
|
4026
4178
|
}).optional().default({
|
|
4027
4179
|
type: "list"
|
|
4028
4180
|
}),
|
|
4029
4181
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4030
|
-
previewMode:
|
|
4031
|
-
productLimit:
|
|
4032
|
-
productOptions:
|
|
4182
|
+
previewMode: import_zod52.z.boolean().default(false),
|
|
4183
|
+
productLimit: import_zod52.z.number().optional().default(1),
|
|
4184
|
+
productOptions: import_zod52.z.object({
|
|
4033
4185
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4034
|
-
hideOutOfStockVariants:
|
|
4035
|
-
matchVariant:
|
|
4036
|
-
showDeclineAll:
|
|
4037
|
-
showShipping:
|
|
4038
|
-
showSubtotal:
|
|
4039
|
-
showTaxes:
|
|
4040
|
-
showTotal:
|
|
4041
|
-
showVariantSelectors:
|
|
4042
|
-
variantSelectorDisplayMode:
|
|
4186
|
+
hideOutOfStockVariants: import_zod52.z.boolean().optional().default(false),
|
|
4187
|
+
matchVariant: import_zod52.z.boolean().optional().default(true),
|
|
4188
|
+
showDeclineAll: import_zod52.z.enum(["above", "below", "both", "none"]).optional(),
|
|
4189
|
+
showShipping: import_zod52.z.boolean().optional().default(true),
|
|
4190
|
+
showSubtotal: import_zod52.z.boolean().optional().default(true),
|
|
4191
|
+
showTaxes: import_zod52.z.boolean().optional().default(true),
|
|
4192
|
+
showTotal: import_zod52.z.boolean().optional().default(true),
|
|
4193
|
+
showVariantSelectors: import_zod52.z.boolean().optional().default(true),
|
|
4194
|
+
variantSelectorDisplayMode: import_zod52.z.enum(["separate", "single"]).optional().default("separate")
|
|
4043
4195
|
}),
|
|
4044
|
-
productType:
|
|
4045
|
-
productTypeSelector:
|
|
4046
|
-
quantityInputs:
|
|
4047
|
-
defaultQuantity:
|
|
4048
|
-
enabled:
|
|
4049
|
-
maxValue:
|
|
4050
|
-
minValue:
|
|
4196
|
+
productType: import_zod52.z.union([import_zod52.z.enum(["one-time", "subscription", "both"]), import_zod52.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
4197
|
+
productTypeSelector: import_zod52.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
4198
|
+
quantityInputs: import_zod52.z.object({
|
|
4199
|
+
defaultQuantity: import_zod52.z.union([import_zod52.z.number(), import_zod52.z.null().transform(() => 1)]).default(1),
|
|
4200
|
+
enabled: import_zod52.z.boolean().default(true),
|
|
4201
|
+
maxValue: import_zod52.z.union([import_zod52.z.number(), import_zod52.z.null().transform(() => 15)]).default(15),
|
|
4202
|
+
minValue: import_zod52.z.union([import_zod52.z.number().min(0), import_zod52.z.unknown().transform(() => 0)]).default(1)
|
|
4051
4203
|
}),
|
|
4052
|
-
shipping:
|
|
4204
|
+
shipping: import_zod52.z.object({
|
|
4053
4205
|
amount: strictNumber.default(10),
|
|
4054
4206
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4055
|
-
enabled:
|
|
4056
|
-
title:
|
|
4057
|
-
type:
|
|
4207
|
+
enabled: import_zod52.z.boolean().default(true),
|
|
4208
|
+
title: import_zod52.z.string().optional().default("Shipping Fees"),
|
|
4209
|
+
type: import_zod52.z.enum(["free", "fixed_amount"]).default("free")
|
|
4058
4210
|
}),
|
|
4059
|
-
styles:
|
|
4060
|
-
starColor:
|
|
4061
|
-
starSize:
|
|
4062
|
-
starStrokeColor:
|
|
4063
|
-
strokeWidth:
|
|
4211
|
+
styles: import_zod52.z.object({
|
|
4212
|
+
starColor: import_zod52.z.string().optional().default("#fadb14"),
|
|
4213
|
+
starSize: import_zod52.z.union([import_zod52.z.enum(["small", "medium", "large"]), import_zod52.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
4214
|
+
starStrokeColor: import_zod52.z.string().optional().default("#fadb14"),
|
|
4215
|
+
strokeWidth: import_zod52.z.string().optional().default("1")
|
|
4064
4216
|
}).optional(),
|
|
4065
|
-
subImages:
|
|
4066
|
-
subscription:
|
|
4067
|
-
discount:
|
|
4217
|
+
subImages: import_zod52.z.number().nullish().default(8),
|
|
4218
|
+
subscription: import_zod52.z.object({
|
|
4219
|
+
discount: import_zod52.z.object({
|
|
4068
4220
|
amount: strictNumber.default(30),
|
|
4069
|
-
shouldShowSavingText:
|
|
4070
|
-
type:
|
|
4221
|
+
shouldShowSavingText: import_zod52.z.boolean().optional().default(true),
|
|
4222
|
+
type: import_zod52.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
4071
4223
|
}),
|
|
4072
|
-
shipping:
|
|
4224
|
+
shipping: import_zod52.z.object({
|
|
4073
4225
|
amount: strictNumber.default(1),
|
|
4074
4226
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4075
|
-
enabled:
|
|
4227
|
+
enabled: import_zod52.z.boolean().default(true),
|
|
4076
4228
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4077
4229
|
recurringAmount: strictNumber.default(2),
|
|
4078
|
-
shippingTitle:
|
|
4079
|
-
type:
|
|
4230
|
+
shippingTitle: import_zod52.z.string().default("Shipping Fees"),
|
|
4231
|
+
type: import_zod52.z.enum(["free", "fixed_amount"]).default("free")
|
|
4080
4232
|
})
|
|
4081
4233
|
}).optional().default({
|
|
4082
4234
|
discount: {
|
|
@@ -4094,15 +4246,15 @@ var PostPurchaseSettings = import_zod45.z.object({
|
|
|
4094
4246
|
type: "free"
|
|
4095
4247
|
}
|
|
4096
4248
|
}),
|
|
4097
|
-
subscriptionIsDefault:
|
|
4249
|
+
subscriptionIsDefault: import_zod52.z.boolean().optional(),
|
|
4098
4250
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4099
|
-
template:
|
|
4100
|
-
type:
|
|
4101
|
-
upgradeToSubscription:
|
|
4102
|
-
acceptButtonText:
|
|
4103
|
-
allow:
|
|
4104
|
-
emailRefundNotice:
|
|
4105
|
-
errorBannerText:
|
|
4251
|
+
template: import_zod52.z.string().optional().default(""),
|
|
4252
|
+
type: import_zod52.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
4253
|
+
upgradeToSubscription: import_zod52.z.object({
|
|
4254
|
+
acceptButtonText: import_zod52.z.string().optional().default("Upgrade"),
|
|
4255
|
+
allow: import_zod52.z.boolean().optional().default(false),
|
|
4256
|
+
emailRefundNotice: import_zod52.z.boolean().optional().default(false),
|
|
4257
|
+
errorBannerText: import_zod52.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
4106
4258
|
}).optional().default(() => ({
|
|
4107
4259
|
acceptButtonText: "Upgrade",
|
|
4108
4260
|
allow: false,
|
|
@@ -4112,32 +4264,32 @@ var PostPurchaseSettings = import_zod45.z.object({
|
|
|
4112
4264
|
});
|
|
4113
4265
|
|
|
4114
4266
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
4115
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
4116
|
-
id:
|
|
4117
|
-
name:
|
|
4267
|
+
var PostPurchaseWidgetLinkedFlow = import_zod53.z.object({
|
|
4268
|
+
id: import_zod53.z.number(),
|
|
4269
|
+
name: import_zod53.z.string()
|
|
4118
4270
|
});
|
|
4119
|
-
var PostPurchaseWidget =
|
|
4120
|
-
classification:
|
|
4121
|
-
createdAtTime:
|
|
4122
|
-
customEndpointName:
|
|
4123
|
-
id:
|
|
4124
|
-
lastViewed:
|
|
4125
|
-
linkedCustomEndpointId:
|
|
4126
|
-
linkedFlows:
|
|
4127
|
-
name:
|
|
4128
|
-
owner:
|
|
4271
|
+
var PostPurchaseWidget = import_zod53.z.object({
|
|
4272
|
+
classification: import_zod53.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
4273
|
+
createdAtTime: import_zod53.z.iso.datetime({ offset: true }).optional(),
|
|
4274
|
+
customEndpointName: import_zod53.z.string().nullish(),
|
|
4275
|
+
id: import_zod53.z.number().default(0),
|
|
4276
|
+
lastViewed: import_zod53.z.iso.datetime({ offset: true }).nullish(),
|
|
4277
|
+
linkedCustomEndpointId: import_zod53.z.number().nullish(),
|
|
4278
|
+
linkedFlows: import_zod53.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
4279
|
+
name: import_zod53.z.string().default(""),
|
|
4280
|
+
owner: import_zod53.z.number().nullish(),
|
|
4129
4281
|
settings: PostPurchaseSettings
|
|
4130
4282
|
});
|
|
4131
4283
|
|
|
4132
4284
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4133
|
-
var PostPurchaseOffer =
|
|
4134
|
-
|
|
4135
|
-
errors:
|
|
4136
|
-
message:
|
|
4137
|
-
successful:
|
|
4285
|
+
var PostPurchaseOffer = import_zod54.z.discriminatedUnion("successful", [
|
|
4286
|
+
import_zod54.z.strictObject({
|
|
4287
|
+
errors: import_zod54.z.array(import_zod54.z.object({ message: import_zod54.z.string() })),
|
|
4288
|
+
message: import_zod54.z.string(),
|
|
4289
|
+
successful: import_zod54.z.literal(false)
|
|
4138
4290
|
}),
|
|
4139
|
-
|
|
4140
|
-
successful:
|
|
4291
|
+
import_zod54.z.strictObject({
|
|
4292
|
+
successful: import_zod54.z.literal(true),
|
|
4141
4293
|
widget: PostPurchaseWidget
|
|
4142
4294
|
})
|
|
4143
4295
|
]);
|