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