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