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