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