@rebuy/rebuy 3.5.1 → 3.7.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 +762 -648
- package/dist/index.mjs +762 -648
- package/dist/schema/checkout-and-beyond/constants.cjs +16 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +16 -0
- package/dist/schema/checkout-and-beyond/index.cjs +454 -362
- package/dist/schema/checkout-and-beyond/index.mjs +454 -362
- package/dist/schema/metadata.d.ts +3 -1
- package/dist/schema/widget-data.cjs +508 -435
- package/dist/schema/widget-data.mjs +508 -435
- package/dist/schema/widgetData.d.ts +438 -147
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +154 -49
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +29 -0
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +146 -0
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +294 -100
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +148 -52
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts +146 -0
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts +292 -0
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +140 -68
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/variables.d.ts +470 -0
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +146 -49
- package/dist/schema/widgets/contentBlock.d.ts +146 -49
- package/dist/schema/widgets/lineItemEditor.d.ts +146 -49
- package/dist/schema/widgets/rebuyButton.d.ts +146 -49
- package/dist/server/index.cjs +514 -417
- package/dist/server/index.mjs +514 -417
- package/dist/transforms/index.cjs +392 -317
- package/dist/transforms/index.mjs +392 -317
- package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ __export(src_exports, {
|
|
|
40
40
|
CABDataSourceSection: () => CABDataSourceSection,
|
|
41
41
|
CABDiscount: () => CABDiscount,
|
|
42
42
|
CABDiscountSection: () => CABDiscountSection,
|
|
43
|
+
CABEventTrigger: () => CABEventTrigger,
|
|
43
44
|
CABExperiment: () => CABExperiment,
|
|
44
45
|
CABImageSection: () => CABImageSection,
|
|
45
46
|
CABImageSectionFields: () => CABImageSectionFields,
|
|
@@ -52,16 +53,26 @@ __export(src_exports, {
|
|
|
52
53
|
CABProgressBarSection: () => CABProgressBarSection,
|
|
53
54
|
CABProgressTier: () => CABProgressTier,
|
|
54
55
|
CABQuantitySection: () => CABQuantitySection,
|
|
56
|
+
CABResultCountTrigger: () => CABResultCountTrigger,
|
|
57
|
+
CABResultTagTrigger: () => CABResultTagTrigger,
|
|
55
58
|
CABReviewsSection: () => CABReviewsSection,
|
|
56
59
|
CABRootSection: () => CABRootSection,
|
|
57
|
-
|
|
60
|
+
CABRuleset: () => CABRuleset,
|
|
61
|
+
CABRulesetEntry: () => CABRulesetEntry,
|
|
58
62
|
CABSection: () => CABSection,
|
|
59
63
|
CABTextSection: () => CABTextSection,
|
|
60
64
|
CABTextTier: () => CABTextTier,
|
|
61
65
|
CABTracking: () => CABTracking,
|
|
62
66
|
CABUILabels: () => CABUILabels,
|
|
67
|
+
CABVariable: () => CABVariable,
|
|
68
|
+
CABVariableEffect: () => CABVariableEffect,
|
|
69
|
+
CABVariableFields: () => CABVariableFields,
|
|
70
|
+
CABVariableMutator: () => CABVariableMutator,
|
|
71
|
+
CABVariableSeed: () => CABVariableSeed,
|
|
72
|
+
CABVariableTrigger: () => CABVariableTrigger,
|
|
63
73
|
CABVariantContent: () => CABVariantContent,
|
|
64
74
|
CABVariantsSection: () => CABVariantsSection,
|
|
75
|
+
CABVisibility: () => CABVisibility,
|
|
65
76
|
COMBINED_ENDPOINTS: () => COMBINED_ENDPOINTS,
|
|
66
77
|
CabActiveExperiment: () => CabActiveExperiment,
|
|
67
78
|
CabShopConfig: () => CabShopConfig,
|
|
@@ -96,6 +107,7 @@ __export(src_exports, {
|
|
|
96
107
|
LineItemEditorSwitchLanguageV1: () => LineItemEditorSwitchLanguageV1,
|
|
97
108
|
LineItemEditorV1: () => LineItemEditorV1,
|
|
98
109
|
Metadata: () => Metadata,
|
|
110
|
+
MutatorEvent: () => MutatorEvent,
|
|
99
111
|
NO_HTML: () => NO_HTML,
|
|
100
112
|
OFFER_LABELS: () => OFFER_LABELS,
|
|
101
113
|
ObjectFit: () => ObjectFit,
|
|
@@ -122,6 +134,8 @@ __export(src_exports, {
|
|
|
122
134
|
RebuyClient: () => RebuyClient,
|
|
123
135
|
RebuyMonetize: () => RebuyMonetize,
|
|
124
136
|
RebuyMonetizeV1: () => RebuyMonetizeV1,
|
|
137
|
+
ResultCountOperator: () => ResultCountOperator,
|
|
138
|
+
ResultTagOperator: () => ResultTagOperator,
|
|
125
139
|
ReviewsSize: () => ReviewsSize,
|
|
126
140
|
RuleCondition: () => RuleCondition,
|
|
127
141
|
RuleLogicBlock: () => RuleLogicBlock,
|
|
@@ -151,6 +165,7 @@ __export(src_exports, {
|
|
|
151
165
|
TiptapText: () => TiptapText,
|
|
152
166
|
UI_LABELS: () => UI_LABELS,
|
|
153
167
|
UserConfig: () => UserConfig,
|
|
168
|
+
VariableEffect: () => VariableEffect,
|
|
154
169
|
VariantMode: () => VariantMode,
|
|
155
170
|
VariantSelector: () => VariantSelector,
|
|
156
171
|
VerticalAlignment: () => VerticalAlignment,
|
|
@@ -222,6 +237,7 @@ __export(src_exports, {
|
|
|
222
237
|
isTimerBlock: () => isTimerBlock,
|
|
223
238
|
isVariantsType: () => isVariantsType,
|
|
224
239
|
languageKeys: () => languageKeys,
|
|
240
|
+
mutatorEvents: () => mutatorEvents,
|
|
225
241
|
objectFits: () => objectFits,
|
|
226
242
|
offersDirections: () => offersDirections,
|
|
227
243
|
popoverPositionMap: () => popoverPositionMap,
|
|
@@ -232,6 +248,8 @@ __export(src_exports, {
|
|
|
232
248
|
progressTierUnits: () => progressTierUnits,
|
|
233
249
|
quantityInputs: () => quantityInputs,
|
|
234
250
|
queryStringToObject: () => queryStringToObject,
|
|
251
|
+
resultCountOperators: () => resultCountOperators,
|
|
252
|
+
resultTagOperators: () => resultTagOperators,
|
|
235
253
|
reviewsSizes: () => reviewsSizes,
|
|
236
254
|
ruleOperators: () => ruleOperators,
|
|
237
255
|
ruleTypes: () => ruleTypes,
|
|
@@ -250,6 +268,7 @@ __export(src_exports, {
|
|
|
250
268
|
textSizeNames: () => textSizeNames,
|
|
251
269
|
utmObjectFromString: () => utmObjectFromString,
|
|
252
270
|
uuid: () => uuid,
|
|
271
|
+
variableEffects: () => variableEffects,
|
|
253
272
|
variantAvailable: () => variantAvailable,
|
|
254
273
|
variantMinMaxPriceObject: () => variantMinMaxPriceObject,
|
|
255
274
|
variantModes: () => variantModes,
|
|
@@ -1390,7 +1409,29 @@ var Metadata = import_zod4.z.object({
|
|
|
1390
1409
|
unmatchedRules: import_zod4.z.array(MatchedRule).optional(),
|
|
1391
1410
|
widget: import_zod4.z.object({
|
|
1392
1411
|
discount: import_zod4.z.object({ amount: import_zod4.z.string(), type: import_zod4.z.string() }).optional(),
|
|
1393
|
-
|
|
1412
|
+
/**
|
|
1413
|
+
* Data-source-authored text content, dual-purpose in the CAB renderer (rebuy-shopify-extensions'
|
|
1414
|
+
* `checkout-and-beyond`): every key becomes a `{{token}}` for the interpolation pass
|
|
1415
|
+
* (`extractDataVariables`), e.g. `{ superTitle: 'Limited drop' }` resolves `{{superTitle}}`
|
|
1416
|
+
* anywhere in the widget's copy, and the legacy add-to-order state keys (`extractLabelOverrides`)
|
|
1417
|
+
* plus `variantOption`/`variantOptions` (`extractVariantLabels`) additionally keep their
|
|
1418
|
+
* whole-label override behavior. The serve path passes metadata through verbatim
|
|
1419
|
+
* (`fetchDataSourceResults` only camelCases keys, which lands snake_case names in the canonical
|
|
1420
|
+
* token grammar); this schema is the contract of record. Parsing mirrors the renderer's
|
|
1421
|
+
* fail-safe: an entry whose value is not a string or finite number — a data-source author's
|
|
1422
|
+
* `null`, boolean, object, or a computed `NaN`/`Infinity` — is dropped at parse time rather
|
|
1423
|
+
* than failing the whole `Metadata` block or rendering `[object Object]` (or a literal `NaN`)
|
|
1424
|
+
* into buyer copy. Booleans stay excluded on purpose (unlike
|
|
1425
|
+
* `Output.value` above, this is buyer-facing copy); an empty string is kept — it deliberately
|
|
1426
|
+
* blanks a token.
|
|
1427
|
+
*/
|
|
1428
|
+
language: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.unknown()).transform(
|
|
1429
|
+
(raw) => Object.fromEntries(
|
|
1430
|
+
Object.entries(raw).filter(
|
|
1431
|
+
(entry) => typeof entry[1] === "string" || Number.isFinite(entry[1])
|
|
1432
|
+
)
|
|
1433
|
+
)
|
|
1434
|
+
).optional()
|
|
1394
1435
|
}).optional()
|
|
1395
1436
|
});
|
|
1396
1437
|
|
|
@@ -1534,7 +1575,7 @@ var UserConfig = import_zod7.z.object({
|
|
|
1534
1575
|
});
|
|
1535
1576
|
|
|
1536
1577
|
// src/schema/widgetData.ts
|
|
1537
|
-
var
|
|
1578
|
+
var import_zod37 = require("zod");
|
|
1538
1579
|
|
|
1539
1580
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1540
1581
|
var import_zod8 = require("zod");
|
|
@@ -1650,6 +1691,8 @@ var languageKeys = [
|
|
|
1650
1691
|
"zh"
|
|
1651
1692
|
];
|
|
1652
1693
|
var LanguageKey = freezeEnum(languageKeys);
|
|
1694
|
+
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
1695
|
+
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
1653
1696
|
var objectFits = ["cover", "contain"];
|
|
1654
1697
|
var ObjectFit = freezeEnum(objectFits);
|
|
1655
1698
|
var popoverPositions = ["inlineStart", "inlineEnd", "blockStart", "blockEnd"];
|
|
@@ -1668,6 +1711,10 @@ var progressTierUnits = ["currency", "item"];
|
|
|
1668
1711
|
var ProgressTierUnit = freezeEnum(progressTierUnits);
|
|
1669
1712
|
var quantityInputs = ["select", "number"];
|
|
1670
1713
|
var QuantityInput = freezeEnum(quantityInputs);
|
|
1714
|
+
var resultCountOperators = ["equals", "greater_than", "less_than"];
|
|
1715
|
+
var ResultCountOperator = freezeEnum(resultCountOperators);
|
|
1716
|
+
var resultTagOperators = ["contains", "does_not_contain"];
|
|
1717
|
+
var ResultTagOperator = freezeEnum(resultTagOperators);
|
|
1671
1718
|
var reviewsSizes = ["small", "default", "large"];
|
|
1672
1719
|
var ReviewsSize = freezeEnum(reviewsSizes);
|
|
1673
1720
|
var sectionTypes = [
|
|
@@ -1700,6 +1747,8 @@ var inlineTextSizeNames = ["extraSmall", "small", "base", "medium", "large", "ex
|
|
|
1700
1747
|
var InlineTextSizeName = freezeEnum(inlineTextSizeNames);
|
|
1701
1748
|
var textSizeNames = [...inlineTextSizeNames, "heading"];
|
|
1702
1749
|
var TextSizeName = freezeEnum(textSizeNames);
|
|
1750
|
+
var variableEffects = ["set_false", "set_true", "toggle"];
|
|
1751
|
+
var VariableEffect = freezeEnum(variableEffects);
|
|
1703
1752
|
var variantModes = ["multiple", "single"];
|
|
1704
1753
|
var VariantMode = freezeEnum(variantModes);
|
|
1705
1754
|
var variantSelectors = ["menu", "radio", "button"];
|
|
@@ -1789,87 +1838,20 @@ var CheckoutExtension = import_zod9.z.looseObject({
|
|
|
1789
1838
|
});
|
|
1790
1839
|
|
|
1791
1840
|
// src/schema/widgets/contentBlock.ts
|
|
1792
|
-
var
|
|
1841
|
+
var import_zod31 = require("zod");
|
|
1793
1842
|
|
|
1794
1843
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1795
|
-
var
|
|
1844
|
+
var import_zod30 = require("zod");
|
|
1796
1845
|
|
|
1797
1846
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1798
1847
|
var import_uuid13 = require("uuid");
|
|
1799
|
-
var
|
|
1800
|
-
|
|
1801
|
-
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1802
|
-
var import_zod10 = require("zod");
|
|
1803
|
-
var ruleTypes = [
|
|
1804
|
-
"cart",
|
|
1805
|
-
"cart_count",
|
|
1806
|
-
"cart_item_count",
|
|
1807
|
-
"cart_line_count",
|
|
1808
|
-
"cart_subtotal",
|
|
1809
|
-
"collection",
|
|
1810
|
-
"customer",
|
|
1811
|
-
"customer_order_count",
|
|
1812
|
-
"customer_tag",
|
|
1813
|
-
"customer_total_spent",
|
|
1814
|
-
"date",
|
|
1815
|
-
"product",
|
|
1816
|
-
"product_tag",
|
|
1817
|
-
"product_title",
|
|
1818
|
-
"product_type",
|
|
1819
|
-
"product_vendor"
|
|
1820
|
-
];
|
|
1821
|
-
var ruleType = import_zod10.z.enum(ruleTypes);
|
|
1822
|
-
var RuleType = ruleType.enum;
|
|
1823
|
-
var ruleOperators = [
|
|
1824
|
-
"after",
|
|
1825
|
-
"anything",
|
|
1826
|
-
"before",
|
|
1827
|
-
"contains",
|
|
1828
|
-
"contains_any",
|
|
1829
|
-
"does_not_contain",
|
|
1830
|
-
"does_not_contain_any",
|
|
1831
|
-
"equals",
|
|
1832
|
-
"does_not_equal",
|
|
1833
|
-
"greater_than",
|
|
1834
|
-
"less_than"
|
|
1835
|
-
];
|
|
1836
|
-
var ruleOperator = import_zod10.z.enum(ruleOperators);
|
|
1837
|
-
var RuleOperator = ruleOperator.enum;
|
|
1838
|
-
var RuleCondition = import_zod10.z.object({
|
|
1839
|
-
operator: import_zod10.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
1840
|
-
products: import_zod10.z.union([import_zod10.z.array(import_zod10.z.unknown()), import_zod10.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1841
|
-
type: import_zod10.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
1842
|
-
value: import_zod10.z.coerce.string().default("")
|
|
1843
|
-
});
|
|
1844
|
-
var RuleLogicBlock = import_zod10.z.object({
|
|
1845
|
-
rules: import_zod10.z.array(RuleCondition).default(() => [])
|
|
1846
|
-
});
|
|
1847
|
-
var CABRule = import_zod10.z.object({
|
|
1848
|
-
dataSourceId: import_zod10.z.number().nullable().default(null),
|
|
1849
|
-
enabled: import_zod10.z.boolean().default(false),
|
|
1850
|
-
ruleset: import_zod10.z.union([
|
|
1851
|
-
import_zod10.z.array(
|
|
1852
|
-
import_zod10.z.object({
|
|
1853
|
-
exitIfMatched: import_zod10.z.boolean().default(true),
|
|
1854
|
-
logic: import_zod10.z.array(RuleLogicBlock).default(() => []),
|
|
1855
|
-
output: import_zod10.z.array(
|
|
1856
|
-
import_zod10.z.object({
|
|
1857
|
-
key: import_zod10.z.string().default("should_show"),
|
|
1858
|
-
type: import_zod10.z.literal("data_json").default("data_json"),
|
|
1859
|
-
value: import_zod10.z.string().default("true")
|
|
1860
|
-
})
|
|
1861
|
-
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
1862
|
-
})
|
|
1863
|
-
),
|
|
1864
|
-
import_zod10.z.strictObject({}).transform(() => [])
|
|
1865
|
-
]).default(() => [])
|
|
1866
|
-
});
|
|
1848
|
+
var import_zod29 = require("zod");
|
|
1867
1849
|
|
|
1868
1850
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1869
|
-
var
|
|
1851
|
+
var import_zod28 = require("zod");
|
|
1870
1852
|
|
|
1871
1853
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1872
|
-
var
|
|
1854
|
+
var import_zod10 = require("zod");
|
|
1873
1855
|
|
|
1874
1856
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1875
1857
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -1946,11 +1928,11 @@ var isTextType = isSectionType(SectionType.text);
|
|
|
1946
1928
|
var isVariantsType = isSectionType(SectionType.variants);
|
|
1947
1929
|
|
|
1948
1930
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1949
|
-
var CABBannerSection =
|
|
1931
|
+
var CABBannerSection = import_zod10.z.lazy(
|
|
1950
1932
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
1951
|
-
buttonField:
|
|
1952
|
-
color:
|
|
1953
|
-
dismissible:
|
|
1933
|
+
buttonField: import_zod10.z.enum(buttonFields).optional(),
|
|
1934
|
+
color: import_zod10.z.enum(bannerColors).default("info"),
|
|
1935
|
+
dismissible: import_zod10.z.boolean().default(true),
|
|
1954
1936
|
/**
|
|
1955
1937
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
1956
1938
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -1966,18 +1948,18 @@ var CABBannerSection = import_zod11.z.lazy(
|
|
|
1966
1948
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
1967
1949
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
1968
1950
|
*/
|
|
1969
|
-
heading:
|
|
1970
|
-
sectionType:
|
|
1951
|
+
heading: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
1952
|
+
sectionType: import_zod10.z.literal(SectionType.banner).default(SectionType.banner)
|
|
1971
1953
|
})
|
|
1972
1954
|
);
|
|
1973
1955
|
|
|
1974
1956
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1975
1957
|
var import_uuid4 = require("uuid");
|
|
1976
|
-
var
|
|
1958
|
+
var import_zod15 = require("zod");
|
|
1977
1959
|
|
|
1978
1960
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1979
1961
|
var import_uuid2 = require("uuid");
|
|
1980
|
-
var
|
|
1962
|
+
var import_zod13 = require("zod");
|
|
1981
1963
|
|
|
1982
1964
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
1983
1965
|
var iconNames = [
|
|
@@ -2063,17 +2045,142 @@ var IconSize = freezeEnum(iconSizes);
|
|
|
2063
2045
|
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
2064
2046
|
var IconTone = freezeEnum(iconTones);
|
|
2065
2047
|
|
|
2048
|
+
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
2049
|
+
var import_zod12 = require("zod");
|
|
2050
|
+
|
|
2051
|
+
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
2052
|
+
var import_zod11 = require("zod");
|
|
2053
|
+
var ruleTypes = [
|
|
2054
|
+
"cart",
|
|
2055
|
+
"cart_count",
|
|
2056
|
+
"cart_item_count",
|
|
2057
|
+
"cart_line_count",
|
|
2058
|
+
"cart_subtotal",
|
|
2059
|
+
"collection",
|
|
2060
|
+
"customer",
|
|
2061
|
+
"customer_order_count",
|
|
2062
|
+
"customer_tag",
|
|
2063
|
+
"customer_total_spent",
|
|
2064
|
+
"date",
|
|
2065
|
+
"product",
|
|
2066
|
+
"product_tag",
|
|
2067
|
+
"product_title",
|
|
2068
|
+
"product_type",
|
|
2069
|
+
"product_vendor"
|
|
2070
|
+
];
|
|
2071
|
+
var ruleType = import_zod11.z.enum(ruleTypes);
|
|
2072
|
+
var RuleType = ruleType.enum;
|
|
2073
|
+
var ruleOperators = [
|
|
2074
|
+
"after",
|
|
2075
|
+
"anything",
|
|
2076
|
+
"before",
|
|
2077
|
+
"contains",
|
|
2078
|
+
"contains_any",
|
|
2079
|
+
"does_not_contain",
|
|
2080
|
+
"does_not_contain_any",
|
|
2081
|
+
"equals",
|
|
2082
|
+
"does_not_equal",
|
|
2083
|
+
"greater_than",
|
|
2084
|
+
"less_than"
|
|
2085
|
+
];
|
|
2086
|
+
var ruleOperator = import_zod11.z.enum(ruleOperators);
|
|
2087
|
+
var RuleOperator = ruleOperator.enum;
|
|
2088
|
+
var RuleCondition = import_zod11.z.object({
|
|
2089
|
+
operator: import_zod11.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
2090
|
+
products: import_zod11.z.union([import_zod11.z.array(import_zod11.z.unknown()), import_zod11.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2091
|
+
type: import_zod11.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
2092
|
+
value: import_zod11.z.coerce.string().default("")
|
|
2093
|
+
});
|
|
2094
|
+
var RuleLogicBlock = import_zod11.z.object({
|
|
2095
|
+
rules: import_zod11.z.array(RuleCondition).default(() => [])
|
|
2096
|
+
});
|
|
2097
|
+
var CABRulesetEntry = import_zod11.z.object({
|
|
2098
|
+
exitIfMatched: import_zod11.z.boolean().default(true),
|
|
2099
|
+
logic: import_zod11.z.array(RuleLogicBlock).default(() => []),
|
|
2100
|
+
output: import_zod11.z.array(
|
|
2101
|
+
import_zod11.z.object({
|
|
2102
|
+
key: import_zod11.z.string().default("should_show"),
|
|
2103
|
+
type: import_zod11.z.literal("data_json").default("data_json"),
|
|
2104
|
+
value: import_zod11.z.string().default("true")
|
|
2105
|
+
})
|
|
2106
|
+
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
2107
|
+
});
|
|
2108
|
+
var CABRuleset = import_zod11.z.union([import_zod11.z.array(CABRulesetEntry), import_zod11.z.strictObject({}).transform(() => [])]).default(() => []);
|
|
2109
|
+
|
|
2110
|
+
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
2111
|
+
var variableEffect = import_zod12.z.enum(variableEffects);
|
|
2112
|
+
var CABVariableSeed = import_zod12.z.object({
|
|
2113
|
+
dataSourceId: import_zod12.z.number().nullable().default(null),
|
|
2114
|
+
ruleset: CABRuleset
|
|
2115
|
+
});
|
|
2116
|
+
var CABVariable = import_zod12.z.object({
|
|
2117
|
+
/**
|
|
2118
|
+
* Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
|
|
2119
|
+
* from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
|
|
2120
|
+
* below; a cross-field default has no `.default()` spelling. An explicit value always wins.
|
|
2121
|
+
*/
|
|
2122
|
+
defaultValue: import_zod12.z.boolean().optional(),
|
|
2123
|
+
name: import_zod12.z.string().min(1),
|
|
2124
|
+
seed: CABVariableSeed.optional()
|
|
2125
|
+
}).transform(({ defaultValue, ...variable }) => ({
|
|
2126
|
+
defaultValue: defaultValue ?? variable.seed === void 0,
|
|
2127
|
+
...variable
|
|
2128
|
+
}));
|
|
2129
|
+
var CABVariableEffect = import_zod12.z.object({
|
|
2130
|
+
effect: variableEffect.default(VariableEffect.toggle),
|
|
2131
|
+
variable: import_zod12.z.string().min(1)
|
|
2132
|
+
});
|
|
2133
|
+
var CABVisibility = import_zod12.z.object({
|
|
2134
|
+
variable: import_zod12.z.string().min(1),
|
|
2135
|
+
visibleWhen: import_zod12.z.boolean().default(true)
|
|
2136
|
+
});
|
|
2137
|
+
var resultCountOperator = import_zod12.z.enum(resultCountOperators);
|
|
2138
|
+
var resultTagOperator = import_zod12.z.enum(resultTagOperators);
|
|
2139
|
+
var mutatorEvent = import_zod12.z.enum(mutatorEvents);
|
|
2140
|
+
var CABResultCountTrigger = import_zod12.z.object({
|
|
2141
|
+
operator: resultCountOperator.default(ResultCountOperator.equals),
|
|
2142
|
+
type: import_zod12.z.literal("result_count"),
|
|
2143
|
+
value: import_zod12.z.number().default(0)
|
|
2144
|
+
});
|
|
2145
|
+
var CABResultTagTrigger = import_zod12.z.object({
|
|
2146
|
+
operator: resultTagOperator.default(ResultTagOperator.contains),
|
|
2147
|
+
type: import_zod12.z.literal("result_tag"),
|
|
2148
|
+
value: import_zod12.z.string().min(1)
|
|
2149
|
+
});
|
|
2150
|
+
var CABEventTrigger = import_zod12.z.object({
|
|
2151
|
+
event: mutatorEvent,
|
|
2152
|
+
type: import_zod12.z.literal("event")
|
|
2153
|
+
});
|
|
2154
|
+
var CABVariableTrigger = import_zod12.z.discriminatedUnion("type", [
|
|
2155
|
+
CABEventTrigger,
|
|
2156
|
+
CABResultCountTrigger,
|
|
2157
|
+
CABResultTagTrigger
|
|
2158
|
+
]);
|
|
2159
|
+
var CABVariableMutator = import_zod12.z.object({
|
|
2160
|
+
effect: variableEffect.default(VariableEffect.set_false),
|
|
2161
|
+
variable: import_zod12.z.string().min(1),
|
|
2162
|
+
when: CABVariableTrigger
|
|
2163
|
+
});
|
|
2164
|
+
var CABVariableFields = {
|
|
2165
|
+
mutators: import_zod12.z.array(CABVariableMutator).optional(),
|
|
2166
|
+
variables: import_zod12.z.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
|
|
2167
|
+
message: "variable names must be unique within a section"
|
|
2168
|
+
}).optional(),
|
|
2169
|
+
visibility: CABVisibility.optional()
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2066
2172
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2067
|
-
var CABImageSectionFields =
|
|
2068
|
-
|
|
2173
|
+
var CABImageSectionFields = import_zod13.z.object({
|
|
2174
|
+
...CABVariableFields,
|
|
2175
|
+
altText: import_zod13.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
2069
2176
|
/**
|
|
2070
2177
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
2071
2178
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
2072
2179
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
2073
2180
|
*/
|
|
2074
|
-
aspectRatio:
|
|
2075
|
-
border:
|
|
2076
|
-
buttonField:
|
|
2181
|
+
aspectRatio: import_zod13.z.number().positive().nullable().default(null),
|
|
2182
|
+
border: import_zod13.z.lazy(() => CABBorder),
|
|
2183
|
+
buttonField: import_zod13.z.enum(buttonFields).optional(),
|
|
2077
2184
|
/**
|
|
2078
2185
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
2079
2186
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -2092,30 +2199,29 @@ var CABImageSectionFields = import_zod12.z.object({
|
|
|
2092
2199
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
2093
2200
|
* the risky half.
|
|
2094
2201
|
*/
|
|
2095
|
-
category:
|
|
2202
|
+
category: import_zod13.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
2096
2203
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
2097
|
-
iconSize:
|
|
2204
|
+
iconSize: import_zod13.z.enum(iconSizes).nullable().default(null),
|
|
2098
2205
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
2099
|
-
iconTone:
|
|
2100
|
-
name:
|
|
2101
|
-
naturalHeight:
|
|
2102
|
-
naturalWidth:
|
|
2206
|
+
iconTone: import_zod13.z.enum(iconTones).nullable().default(null),
|
|
2207
|
+
name: import_zod13.z.string().optional(),
|
|
2208
|
+
naturalHeight: import_zod13.z.number().default(0),
|
|
2209
|
+
naturalWidth: import_zod13.z.number().default(0),
|
|
2103
2210
|
/**
|
|
2104
2211
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
2105
2212
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
2106
2213
|
*/
|
|
2107
|
-
objectFit:
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
sectionType: import_zod12.z.literal(SectionType.image).default(SectionType.image),
|
|
2214
|
+
objectFit: import_zod13.z.enum(objectFits).default(ObjectFit.contain),
|
|
2215
|
+
sectionId: import_zod13.z.uuid().default(() => (0, import_uuid2.v7)()),
|
|
2216
|
+
sectionType: import_zod13.z.literal(SectionType.image).default(SectionType.image),
|
|
2111
2217
|
/**
|
|
2112
2218
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
2113
2219
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
2114
2220
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
2115
2221
|
* server-chosen tier icon actually needs it.
|
|
2116
2222
|
*/
|
|
2117
|
-
source:
|
|
2118
|
-
width:
|
|
2223
|
+
source: import_zod13.z.union([import_zod13.z.url(), import_zod13.z.literal(""), import_zod13.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod13.z.enum(iconNames)]).default(""),
|
|
2224
|
+
width: import_zod13.z.number().default(100)
|
|
2119
2225
|
});
|
|
2120
2226
|
var iconNameSet = new Set(iconNames);
|
|
2121
2227
|
var isIconName = (source) => iconNameSet.has(source);
|
|
@@ -2137,71 +2243,71 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, c
|
|
|
2137
2243
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
2138
2244
|
var import_compat2 = require("es-toolkit/compat");
|
|
2139
2245
|
var import_uuid3 = require("uuid");
|
|
2140
|
-
var
|
|
2141
|
-
var enumOrOmit = (...vals) =>
|
|
2142
|
-
var TiptapText =
|
|
2143
|
-
marks:
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
attrs:
|
|
2150
|
-
class:
|
|
2151
|
-
href:
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2246
|
+
var import_zod14 = require("zod");
|
|
2247
|
+
var enumOrOmit = (...vals) => import_zod14.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
2248
|
+
var TiptapText = import_zod14.z.object({
|
|
2249
|
+
marks: import_zod14.z.union([
|
|
2250
|
+
import_zod14.z.array(
|
|
2251
|
+
import_zod14.z.discriminatedUnion("type", [
|
|
2252
|
+
import_zod14.z.object({ type: import_zod14.z.literal("bold") }),
|
|
2253
|
+
import_zod14.z.object({ type: import_zod14.z.literal("italic") }),
|
|
2254
|
+
import_zod14.z.object({
|
|
2255
|
+
attrs: import_zod14.z.object({
|
|
2256
|
+
class: import_zod14.z.string().nullable(),
|
|
2257
|
+
href: import_zod14.z.union([
|
|
2258
|
+
import_zod14.z.url(),
|
|
2259
|
+
import_zod14.z.literal("#"),
|
|
2260
|
+
import_zod14.z.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
2261
|
+
import_zod14.z.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
2156
2262
|
]),
|
|
2157
|
-
rel:
|
|
2158
|
-
target:
|
|
2263
|
+
rel: import_zod14.z.string().default("noopener noreferrer nofollow"),
|
|
2264
|
+
target: import_zod14.z.string().default("_blank")
|
|
2159
2265
|
}),
|
|
2160
|
-
type:
|
|
2266
|
+
type: import_zod14.z.literal("link")
|
|
2161
2267
|
}),
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
attrs:
|
|
2268
|
+
import_zod14.z.object({ type: import_zod14.z.literal("strike") }),
|
|
2269
|
+
import_zod14.z.object({
|
|
2270
|
+
attrs: import_zod14.z.object({
|
|
2165
2271
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
2166
2272
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
2167
2273
|
}),
|
|
2168
|
-
type:
|
|
2274
|
+
type: import_zod14.z.literal("textStyle")
|
|
2169
2275
|
})
|
|
2170
2276
|
])
|
|
2171
2277
|
),
|
|
2172
|
-
|
|
2278
|
+
import_zod14.z.strictObject({}).transform(() => [])
|
|
2173
2279
|
]).optional(),
|
|
2174
|
-
text:
|
|
2175
|
-
type:
|
|
2280
|
+
text: import_zod14.z.string().default(""),
|
|
2281
|
+
type: import_zod14.z.literal("text").default("text")
|
|
2176
2282
|
});
|
|
2177
|
-
var TiptapParagraph =
|
|
2178
|
-
attrs:
|
|
2283
|
+
var TiptapParagraph = import_zod14.z.object({
|
|
2284
|
+
attrs: import_zod14.z.object({
|
|
2179
2285
|
textAlign: enumOrOmit(...textAlignments)
|
|
2180
2286
|
}).default({ textAlign: TextAlignment.start }),
|
|
2181
|
-
content:
|
|
2182
|
-
type:
|
|
2287
|
+
content: import_zod14.z.union([import_zod14.z.array(TiptapText), import_zod14.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2288
|
+
type: import_zod14.z.literal("paragraph").default("paragraph")
|
|
2183
2289
|
});
|
|
2184
|
-
var TiptapDocument =
|
|
2185
|
-
attrs:
|
|
2290
|
+
var TiptapDocument = import_zod14.z.object({
|
|
2291
|
+
attrs: import_zod14.z.object({
|
|
2186
2292
|
blockSpacing: enumOrOmit(...spacings)
|
|
2187
2293
|
}).default({ blockSpacing: Spacing.base }),
|
|
2188
|
-
content:
|
|
2189
|
-
type:
|
|
2294
|
+
content: import_zod14.z.union([import_zod14.z.array(TiptapParagraph), import_zod14.z.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
2295
|
+
type: import_zod14.z.literal("doc").default("doc")
|
|
2190
2296
|
});
|
|
2191
|
-
var CABTextTier =
|
|
2192
|
-
threshold:
|
|
2193
|
-
thresholds:
|
|
2194
|
-
tierId:
|
|
2195
|
-
tierType:
|
|
2297
|
+
var CABTextTier = import_zod14.z.object({
|
|
2298
|
+
threshold: import_zod14.z.number().int().nonnegative(),
|
|
2299
|
+
thresholds: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number().int().nonnegative()).default(() => ({})),
|
|
2300
|
+
tierId: import_zod14.z.string().optional(),
|
|
2301
|
+
tierType: import_zod14.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
2196
2302
|
});
|
|
2197
|
-
var CABTextSection =
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
sectionId:
|
|
2204
|
-
sectionType:
|
|
2303
|
+
var CABTextSection = import_zod14.z.object({
|
|
2304
|
+
...CABVariableFields,
|
|
2305
|
+
buttonField: import_zod14.z.enum(buttonFields).optional(),
|
|
2306
|
+
content: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.union([import_zod14.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
2307
|
+
name: import_zod14.z.string().optional(),
|
|
2308
|
+
optionId: import_zod14.z.number().optional(),
|
|
2309
|
+
sectionId: import_zod14.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
2310
|
+
sectionType: import_zod14.z.literal(SectionType.text).default(SectionType.text),
|
|
2205
2311
|
tier: CABTextTier.optional()
|
|
2206
2312
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
2207
2313
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
@@ -2223,35 +2329,35 @@ var CABTextSection = import_zod13.z.object({
|
|
|
2223
2329
|
});
|
|
2224
2330
|
|
|
2225
2331
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2226
|
-
var CABButtonContent =
|
|
2227
|
-
() =>
|
|
2332
|
+
var CABButtonContent = import_zod15.z.lazy(
|
|
2333
|
+
() => import_zod15.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
2228
2334
|
);
|
|
2229
|
-
var CABButtonSection =
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2335
|
+
var CABButtonSection = import_zod15.z.object({
|
|
2336
|
+
...CABVariableFields,
|
|
2337
|
+
action: import_zod15.z.union([import_zod15.z.literal(""), import_zod15.z.enum(buttonActions)]).default(""),
|
|
2338
|
+
buttonStyle: import_zod15.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
2339
|
+
custom: import_zod15.z.object({
|
|
2340
|
+
color: import_zod15.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
2341
|
+
height: import_zod15.z.number().default(52),
|
|
2342
|
+
width: import_zod15.z.number().default(300)
|
|
2236
2343
|
}).default({
|
|
2237
2344
|
color: "#005bd3",
|
|
2238
2345
|
height: 52,
|
|
2239
2346
|
width: 300
|
|
2240
2347
|
}),
|
|
2241
|
-
disableDowngrade:
|
|
2242
|
-
name:
|
|
2243
|
-
optionId:
|
|
2244
|
-
popover:
|
|
2245
|
-
alignment:
|
|
2246
|
-
position:
|
|
2348
|
+
disableDowngrade: import_zod15.z.boolean().default(false),
|
|
2349
|
+
name: import_zod15.z.string().optional(),
|
|
2350
|
+
optionId: import_zod15.z.number().optional(),
|
|
2351
|
+
popover: import_zod15.z.object({
|
|
2352
|
+
alignment: import_zod15.z.enum(textAlignments).default(TextAlignment.center),
|
|
2353
|
+
position: import_zod15.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
2247
2354
|
}).optional().default(() => ({
|
|
2248
2355
|
alignment: TextAlignment.center,
|
|
2249
2356
|
position: PopoverPosition.blockStart
|
|
2250
2357
|
})),
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
sectionType: import_zod14.z.literal(SectionType.button).default(SectionType.button),
|
|
2358
|
+
sectionId: import_zod15.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
2359
|
+
sections: import_zod15.z.union([import_zod15.z.array(CABButtonContent), import_zod15.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2360
|
+
sectionType: import_zod15.z.literal(SectionType.button).default(SectionType.button),
|
|
2255
2361
|
/**
|
|
2256
2362
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
2257
2363
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -2266,86 +2372,93 @@ var CABButtonSection = import_zod14.z.object({
|
|
|
2266
2372
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
2267
2373
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
2268
2374
|
*/
|
|
2269
|
-
tier:
|
|
2375
|
+
tier: import_zod15.z.object({ tierId: import_zod15.z.string().min(1) }).optional(),
|
|
2270
2376
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
2271
|
-
trackingUrl:
|
|
2377
|
+
trackingUrl: import_zod15.z.string().optional(),
|
|
2378
|
+
/**
|
|
2379
|
+
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
2380
|
+
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
2381
|
+
*/
|
|
2382
|
+
variableEffects: import_zod15.z.array(CABVariableEffect).optional()
|
|
2272
2383
|
});
|
|
2273
2384
|
|
|
2274
2385
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2275
|
-
var
|
|
2386
|
+
var import_zod20 = require("zod");
|
|
2276
2387
|
|
|
2277
2388
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2278
|
-
var
|
|
2389
|
+
var import_zod19 = require("zod");
|
|
2279
2390
|
|
|
2280
2391
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
2281
2392
|
var import_uuid5 = require("uuid");
|
|
2282
|
-
var
|
|
2283
|
-
var CABDiscount =
|
|
2284
|
-
amount:
|
|
2285
|
-
discountedBy:
|
|
2286
|
-
discountedFrom:
|
|
2287
|
-
type:
|
|
2393
|
+
var import_zod16 = require("zod");
|
|
2394
|
+
var CABDiscount = import_zod16.z.object({
|
|
2395
|
+
amount: import_zod16.z.union([import_zod16.z.number(), import_zod16.z.string()]).catch(0),
|
|
2396
|
+
discountedBy: import_zod16.z.string().optional(),
|
|
2397
|
+
discountedFrom: import_zod16.z.enum(discountSources).optional().catch(void 0),
|
|
2398
|
+
type: import_zod16.z.enum(discountTypes).catch("none")
|
|
2288
2399
|
});
|
|
2289
|
-
var CABIntegrations =
|
|
2290
|
-
judgeme:
|
|
2291
|
-
junip:
|
|
2292
|
-
klaviyo:
|
|
2293
|
-
loox:
|
|
2294
|
-
okendo:
|
|
2295
|
-
opinew:
|
|
2296
|
-
reviewsio:
|
|
2297
|
-
stamped:
|
|
2298
|
-
yotpo:
|
|
2400
|
+
var CABIntegrations = import_zod16.z.object({
|
|
2401
|
+
judgeme: import_zod16.z.boolean().default(false),
|
|
2402
|
+
junip: import_zod16.z.boolean().default(false),
|
|
2403
|
+
klaviyo: import_zod16.z.boolean().default(false),
|
|
2404
|
+
loox: import_zod16.z.boolean().default(false),
|
|
2405
|
+
okendo: import_zod16.z.boolean().default(false),
|
|
2406
|
+
opinew: import_zod16.z.boolean().default(false),
|
|
2407
|
+
reviewsio: import_zod16.z.boolean().default(false),
|
|
2408
|
+
stamped: import_zod16.z.boolean().default(false),
|
|
2409
|
+
yotpo: import_zod16.z.boolean().default(false)
|
|
2299
2410
|
});
|
|
2300
|
-
var CABDataSourceSection =
|
|
2301
|
-
dataSourceId:
|
|
2302
|
-
dataSourcePath:
|
|
2411
|
+
var CABDataSourceSection = import_zod16.z.object({
|
|
2412
|
+
dataSourceId: import_zod16.z.number().nullable().default(null),
|
|
2413
|
+
dataSourcePath: import_zod16.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
2303
2414
|
discount: CABDiscount.optional(),
|
|
2304
2415
|
integrations: CABIntegrations.optional(),
|
|
2305
|
-
limit:
|
|
2306
|
-
matchVariant:
|
|
2307
|
-
matchVariantOutOfStock:
|
|
2308
|
-
name:
|
|
2309
|
-
productType:
|
|
2310
|
-
sectionId:
|
|
2311
|
-
sectionType:
|
|
2416
|
+
limit: import_zod16.z.number().default(1),
|
|
2417
|
+
matchVariant: import_zod16.z.boolean().default(false),
|
|
2418
|
+
matchVariantOutOfStock: import_zod16.z.boolean().default(false),
|
|
2419
|
+
name: import_zod16.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
2420
|
+
productType: import_zod16.z.enum(productTypes).optional(),
|
|
2421
|
+
sectionId: import_zod16.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
2422
|
+
sectionType: import_zod16.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
2312
2423
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
2313
|
-
subscriptionIsDefault:
|
|
2314
|
-
treatAsGwp:
|
|
2424
|
+
subscriptionIsDefault: import_zod16.z.boolean().default(false),
|
|
2425
|
+
treatAsGwp: import_zod16.z.boolean().default(false)
|
|
2315
2426
|
});
|
|
2316
2427
|
|
|
2317
2428
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2318
2429
|
var import_uuid7 = require("uuid");
|
|
2319
|
-
var
|
|
2430
|
+
var import_zod18 = require("zod");
|
|
2320
2431
|
|
|
2321
2432
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
2322
2433
|
var import_uuid6 = require("uuid");
|
|
2323
|
-
var
|
|
2324
|
-
var CABVariantContent =
|
|
2325
|
-
() =>
|
|
2434
|
+
var import_zod17 = require("zod");
|
|
2435
|
+
var CABVariantContent = import_zod17.z.lazy(
|
|
2436
|
+
() => import_zod17.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
2326
2437
|
);
|
|
2327
|
-
var CABProductSection =
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2438
|
+
var CABProductSection = import_zod17.z.object({
|
|
2439
|
+
...CABVariableFields,
|
|
2440
|
+
name: import_zod17.z.string().optional(),
|
|
2441
|
+
productId: import_zod17.z.number().nullable().default(null),
|
|
2442
|
+
sectionId: import_zod17.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
2443
|
+
sections: import_zod17.z.union([import_zod17.z.array(CABVariantContent), import_zod17.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2444
|
+
sectionType: import_zod17.z.literal(SectionType.product).default(SectionType.product),
|
|
2445
|
+
selectors: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
2446
|
+
variantMode: import_zod17.z.enum(variantModes).default(VariantMode.multiple)
|
|
2335
2447
|
});
|
|
2336
2448
|
|
|
2337
2449
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2338
|
-
var CABProductsSection =
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2450
|
+
var CABProductsSection = import_zod18.z.object({
|
|
2451
|
+
...CABVariableFields,
|
|
2452
|
+
name: import_zod18.z.string().optional(),
|
|
2453
|
+
sectionId: import_zod18.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
2454
|
+
sections: import_zod18.z.union([import_zod18.z.array(import_zod18.z.lazy(() => CABProductSection)), import_zod18.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2455
|
+
sectionType: import_zod18.z.literal(SectionType.products).default(SectionType.products)
|
|
2343
2456
|
});
|
|
2344
2457
|
|
|
2345
2458
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2346
|
-
var CABOffersSection =
|
|
2459
|
+
var CABOffersSection = import_zod19.z.lazy(
|
|
2347
2460
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2348
|
-
sections:
|
|
2461
|
+
sections: import_zod19.z.union([import_zod19.z.array(import_zod19.z.lazy(() => CABSection)), import_zod19.z.strictObject({}).transform(() => [])]).default(() => [
|
|
2349
2462
|
CABBannerSection.parse({
|
|
2350
2463
|
buttonField: "undoAddToOrder",
|
|
2351
2464
|
color: "success",
|
|
@@ -2359,64 +2472,65 @@ var CABOffersSection = import_zod18.z.lazy(
|
|
|
2359
2472
|
CABDataSourceSection.parse({}),
|
|
2360
2473
|
CABProductsSection.parse({})
|
|
2361
2474
|
]),
|
|
2362
|
-
sectionType:
|
|
2475
|
+
sectionType: import_zod19.z.literal(SectionType.offers).default(SectionType.offers)
|
|
2363
2476
|
})
|
|
2364
2477
|
);
|
|
2365
2478
|
|
|
2366
2479
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2367
|
-
var CABCarouselSection =
|
|
2480
|
+
var CABCarouselSection = import_zod20.z.lazy(
|
|
2368
2481
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2369
|
-
autoAdvanceInterval:
|
|
2370
|
-
itemsAtOnce:
|
|
2482
|
+
autoAdvanceInterval: import_zod20.z.number().default(0),
|
|
2483
|
+
itemsAtOnce: import_zod20.z.number().min(1).default(1),
|
|
2371
2484
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
2372
|
-
offersDirection:
|
|
2373
|
-
sections:
|
|
2374
|
-
sectionType:
|
|
2485
|
+
offersDirection: import_zod20.z.enum(offersDirections).default("vertical"),
|
|
2486
|
+
sections: import_zod20.z.union([import_zod20.z.array(import_zod20.z.lazy(() => CABSection)), import_zod20.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
2487
|
+
sectionType: import_zod20.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
2375
2488
|
})
|
|
2376
2489
|
);
|
|
2377
2490
|
|
|
2378
2491
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
2379
|
-
var
|
|
2380
|
-
var CABCartLineSection =
|
|
2492
|
+
var import_zod21 = require("zod");
|
|
2493
|
+
var CABCartLineSection = import_zod21.z.lazy(
|
|
2381
2494
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2382
|
-
sections:
|
|
2383
|
-
sectionType:
|
|
2495
|
+
sections: import_zod21.z.union([import_zod21.z.array(import_zod21.z.lazy(() => CABSection)), import_zod21.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
2496
|
+
sectionType: import_zod21.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
2384
2497
|
})
|
|
2385
2498
|
);
|
|
2386
2499
|
|
|
2387
2500
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
2388
2501
|
var import_uuid8 = require("uuid");
|
|
2389
|
-
var
|
|
2390
|
-
var CABDiscountSection =
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2502
|
+
var import_zod22 = require("zod");
|
|
2503
|
+
var CABDiscountSection = import_zod22.z.object({
|
|
2504
|
+
...CABVariableFields,
|
|
2505
|
+
amount: import_zod22.z.union([import_zod22.z.number(), import_zod22.z.string()]).catch(0),
|
|
2506
|
+
discountedBy: import_zod22.z.string().optional(),
|
|
2507
|
+
discountedFrom: import_zod22.z.enum(discountSources).optional().catch(void 0),
|
|
2508
|
+
message: import_zod22.z.string().optional(),
|
|
2509
|
+
name: import_zod22.z.string().optional(),
|
|
2510
|
+
quantity: import_zod22.z.number().default(1),
|
|
2511
|
+
sectionId: import_zod22.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
2512
|
+
sectionType: import_zod22.z.literal(SectionType.discount).default(SectionType.discount),
|
|
2513
|
+
type: import_zod22.z.enum(discountTypes).catch("none")
|
|
2400
2514
|
});
|
|
2401
2515
|
|
|
2402
2516
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
2403
2517
|
var import_uuid9 = require("uuid");
|
|
2404
|
-
var
|
|
2405
|
-
var CABMonetizeSection =
|
|
2406
|
-
|
|
2518
|
+
var import_zod23 = require("zod");
|
|
2519
|
+
var CABMonetizeSection = import_zod23.z.object({
|
|
2520
|
+
...CABVariableFields,
|
|
2521
|
+
name: import_zod23.z.string().optional(),
|
|
2407
2522
|
/** Privacy Policy footer href (the widget's `privacy_policy_url` setting); the client relays it to `/cab/monetize`. */
|
|
2408
|
-
privacyPolicyUrl:
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
sectionType: import_zod22.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2523
|
+
privacyPolicyUrl: import_zod23.z.string().optional(),
|
|
2524
|
+
sectionId: import_zod23.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
2525
|
+
sectionType: import_zod23.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2412
2526
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
2413
|
-
subVertical:
|
|
2527
|
+
subVertical: import_zod23.z.string().optional(),
|
|
2414
2528
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
2415
|
-
vertical:
|
|
2529
|
+
vertical: import_zod23.z.string().optional()
|
|
2416
2530
|
});
|
|
2417
2531
|
|
|
2418
2532
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2419
|
-
var
|
|
2533
|
+
var import_zod24 = require("zod");
|
|
2420
2534
|
|
|
2421
2535
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
2422
2536
|
var GIFT_LABELS = {
|
|
@@ -2535,21 +2649,21 @@ var GIFT_LABELS = {
|
|
|
2535
2649
|
};
|
|
2536
2650
|
|
|
2537
2651
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2538
|
-
var CABProgressTier =
|
|
2652
|
+
var CABProgressTier = import_zod24.z.object({
|
|
2539
2653
|
/**
|
|
2540
2654
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
2541
2655
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
2542
2656
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
2543
2657
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
2544
2658
|
*/
|
|
2545
|
-
discount:
|
|
2659
|
+
discount: import_zod24.z.object({ amount: import_zod24.z.number().nonnegative(), type: import_zod24.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
2546
2660
|
/**
|
|
2547
2661
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
2548
2662
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
2549
2663
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
2550
2664
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
2551
2665
|
*/
|
|
2552
|
-
filterOosVariants:
|
|
2666
|
+
filterOosVariants: import_zod24.z.boolean().default(false),
|
|
2553
2667
|
/**
|
|
2554
2668
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
2555
2669
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -2557,10 +2671,10 @@ var CABProgressTier = import_zod23.z.object({
|
|
|
2557
2671
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
2558
2672
|
* tree is complete.
|
|
2559
2673
|
*/
|
|
2560
|
-
gift:
|
|
2561
|
-
productId:
|
|
2562
|
-
title:
|
|
2563
|
-
variantIds:
|
|
2674
|
+
gift: import_zod24.z.object({
|
|
2675
|
+
productId: import_zod24.z.number().int().positive(),
|
|
2676
|
+
title: import_zod24.z.string().optional(),
|
|
2677
|
+
variantIds: import_zod24.z.array(import_zod24.z.number().int().positive()).default(() => [])
|
|
2564
2678
|
}).optional(),
|
|
2565
2679
|
/**
|
|
2566
2680
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
@@ -2571,35 +2685,35 @@ var CABProgressTier = import_zod23.z.object({
|
|
|
2571
2685
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
2572
2686
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
2573
2687
|
*/
|
|
2574
|
-
label:
|
|
2688
|
+
label: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).optional(),
|
|
2575
2689
|
/**
|
|
2576
2690
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
2577
2691
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
2578
2692
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
2579
2693
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
2580
2694
|
*/
|
|
2581
|
-
productTierImage:
|
|
2695
|
+
productTierImage: import_zod24.z.boolean().default(false),
|
|
2582
2696
|
/**
|
|
2583
2697
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
2584
2698
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
2585
2699
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
2586
2700
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
2587
2701
|
*/
|
|
2588
|
-
threshold:
|
|
2702
|
+
threshold: import_zod24.z.number().int().nonnegative(),
|
|
2589
2703
|
/**
|
|
2590
2704
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
2591
2705
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
2592
2706
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
2593
2707
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
2594
2708
|
*/
|
|
2595
|
-
thresholds:
|
|
2709
|
+
thresholds: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.number().int().nonnegative()).default(() => ({})),
|
|
2596
2710
|
/**
|
|
2597
2711
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
2598
2712
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
2599
2713
|
* shipping bar (single unlabeled tier, no gift).
|
|
2600
2714
|
*/
|
|
2601
|
-
tierId:
|
|
2602
|
-
tierType:
|
|
2715
|
+
tierId: import_zod24.z.string().optional(),
|
|
2716
|
+
tierType: import_zod24.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
2603
2717
|
/**
|
|
2604
2718
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
2605
2719
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -2610,9 +2724,9 @@ var CABProgressTier = import_zod23.z.object({
|
|
|
2610
2724
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
2611
2725
|
* template text supplies grammatically-neutral wording around the token.
|
|
2612
2726
|
*/
|
|
2613
|
-
unit:
|
|
2727
|
+
unit: import_zod24.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
2614
2728
|
});
|
|
2615
|
-
var CABProgressBarSection =
|
|
2729
|
+
var CABProgressBarSection = import_zod24.z.lazy(
|
|
2616
2730
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2617
2731
|
/**
|
|
2618
2732
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -2621,35 +2735,35 @@ var CABProgressBarSection = import_zod23.z.lazy(
|
|
|
2621
2735
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
2622
2736
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
2623
2737
|
*/
|
|
2624
|
-
barId:
|
|
2738
|
+
barId: import_zod24.z.string().optional(),
|
|
2625
2739
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
2626
|
-
countryCodes:
|
|
2740
|
+
countryCodes: import_zod24.z.array(import_zod24.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2627
2741
|
/**
|
|
2628
2742
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
2629
2743
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
2630
2744
|
*/
|
|
2631
|
-
excludeCountryCodes:
|
|
2745
|
+
excludeCountryCodes: import_zod24.z.array(import_zod24.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2632
2746
|
/**
|
|
2633
2747
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
2634
2748
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
2635
2749
|
* adds the cart's discount allocations back to the live subtotal.
|
|
2636
2750
|
*/
|
|
2637
|
-
excludeDiscountInSubtotal:
|
|
2751
|
+
excludeDiscountInSubtotal: import_zod24.z.boolean().default(false),
|
|
2638
2752
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
2639
|
-
excludedVariantIds:
|
|
2753
|
+
excludedVariantIds: import_zod24.z.array(import_zod24.z.number().int().positive()).default(() => []),
|
|
2640
2754
|
/**
|
|
2641
2755
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
2642
2756
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
2643
2757
|
*/
|
|
2644
|
-
freeShippingOnSubscription:
|
|
2758
|
+
freeShippingOnSubscription: import_zod24.z.boolean().default(false),
|
|
2645
2759
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
2646
|
-
giftAreaTitle:
|
|
2760
|
+
giftAreaTitle: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
2647
2761
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
2648
|
-
giftLabels:
|
|
2649
|
-
addGift:
|
|
2650
|
-
remove:
|
|
2651
|
-
selectOptions:
|
|
2652
|
-
yourGift:
|
|
2762
|
+
giftLabels: import_zod24.z.object({
|
|
2763
|
+
addGift: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
2764
|
+
remove: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
2765
|
+
selectOptions: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
2766
|
+
yourGift: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
2653
2767
|
}).default(() => ({
|
|
2654
2768
|
addGift: { ...GIFT_LABELS.addGift },
|
|
2655
2769
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -2657,37 +2771,38 @@ var CABProgressBarSection = import_zod23.z.lazy(
|
|
|
2657
2771
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
2658
2772
|
})),
|
|
2659
2773
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
2660
|
-
name:
|
|
2774
|
+
name: import_zod24.z.string().default("Order progress"),
|
|
2661
2775
|
/**
|
|
2662
2776
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
2663
2777
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
2664
2778
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
2665
2779
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
2666
2780
|
*/
|
|
2667
|
-
progressColor:
|
|
2668
|
-
sectionType:
|
|
2781
|
+
progressColor: import_zod24.z.string().optional(),
|
|
2782
|
+
sectionType: import_zod24.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
2669
2783
|
/**
|
|
2670
2784
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
2671
2785
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
2672
2786
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
2673
2787
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
2674
2788
|
*/
|
|
2675
|
-
tiers:
|
|
2789
|
+
tiers: import_zod24.z.union([import_zod24.z.array(CABProgressTier), import_zod24.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
2676
2790
|
})
|
|
2677
2791
|
);
|
|
2678
2792
|
|
|
2679
2793
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
2680
2794
|
var import_uuid10 = require("uuid");
|
|
2681
|
-
var
|
|
2682
|
-
var CABQuantitySection =
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2795
|
+
var import_zod25 = require("zod");
|
|
2796
|
+
var CABQuantitySection = import_zod25.z.object({
|
|
2797
|
+
...CABVariableFields,
|
|
2798
|
+
errorMessages: import_zod25.z.record(
|
|
2799
|
+
import_zod25.z.string(),
|
|
2800
|
+
import_zod25.z.object({
|
|
2686
2801
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
2687
|
-
increment:
|
|
2688
|
-
max:
|
|
2689
|
-
min:
|
|
2690
|
-
neg:
|
|
2802
|
+
increment: import_zod25.z.string().optional(),
|
|
2803
|
+
max: import_zod25.z.string().optional(),
|
|
2804
|
+
min: import_zod25.z.string().optional(),
|
|
2805
|
+
neg: import_zod25.z.string().optional()
|
|
2691
2806
|
})
|
|
2692
2807
|
).default({
|
|
2693
2808
|
en: {
|
|
@@ -2697,19 +2812,18 @@ var CABQuantitySection = import_zod24.z.object({
|
|
|
2697
2812
|
neg: "Quantity cannot be negative"
|
|
2698
2813
|
}
|
|
2699
2814
|
}),
|
|
2700
|
-
inputType:
|
|
2701
|
-
max:
|
|
2702
|
-
min:
|
|
2815
|
+
inputType: import_zod25.z.enum(quantityInputs).default(QuantityInput.select),
|
|
2816
|
+
max: import_zod25.z.number().min(1).max(100).default(10),
|
|
2817
|
+
min: import_zod25.z.number().min(1).default(1),
|
|
2703
2818
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
2704
|
-
name:
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
sectionType: import_zod24.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2819
|
+
name: import_zod25.z.string().default("Quantity"),
|
|
2820
|
+
sectionId: import_zod25.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
2821
|
+
sectionType: import_zod25.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2708
2822
|
});
|
|
2709
2823
|
|
|
2710
2824
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2711
2825
|
var import_uuid11 = require("uuid");
|
|
2712
|
-
var
|
|
2826
|
+
var import_zod26 = require("zod");
|
|
2713
2827
|
|
|
2714
2828
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
2715
2829
|
var REVIEW_LABELS = {
|
|
@@ -2772,50 +2886,50 @@ var REVIEW_LABELS = {
|
|
|
2772
2886
|
};
|
|
2773
2887
|
|
|
2774
2888
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2775
|
-
var CABReviewsSection =
|
|
2776
|
-
|
|
2889
|
+
var CABReviewsSection = import_zod26.z.object({
|
|
2890
|
+
...CABVariableFields,
|
|
2891
|
+
color: import_zod26.z.string().default("#fadb14"),
|
|
2777
2892
|
/**
|
|
2778
2893
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
2779
2894
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
2780
2895
|
* or merchant work.
|
|
2781
2896
|
*/
|
|
2782
|
-
countLabels:
|
|
2783
|
-
one:
|
|
2784
|
-
other:
|
|
2897
|
+
countLabels: import_zod26.z.object({
|
|
2898
|
+
one: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
2899
|
+
other: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
2785
2900
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
2786
|
-
name:
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
size: import_zod25.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2901
|
+
name: import_zod26.z.string().optional(),
|
|
2902
|
+
sectionId: import_zod26.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
2903
|
+
sectionType: import_zod26.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2904
|
+
size: import_zod26.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2791
2905
|
});
|
|
2792
2906
|
|
|
2793
2907
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2794
2908
|
var import_compat3 = require("es-toolkit/compat");
|
|
2795
2909
|
var import_uuid12 = require("uuid");
|
|
2796
|
-
var
|
|
2797
|
-
var CABVariantsSection =
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
sectionId:
|
|
2802
|
-
sectionType:
|
|
2803
|
-
selector:
|
|
2804
|
-
variantMode:
|
|
2910
|
+
var import_zod27 = require("zod");
|
|
2911
|
+
var CABVariantsSection = import_zod27.z.object({
|
|
2912
|
+
...CABVariableFields,
|
|
2913
|
+
hideOutOfStockVariants: import_zod27.z.boolean().default(false),
|
|
2914
|
+
name: import_zod27.z.string().optional(),
|
|
2915
|
+
sectionId: import_zod27.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
2916
|
+
sectionType: import_zod27.z.literal(SectionType.variants).default(SectionType.variants),
|
|
2917
|
+
selector: import_zod27.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2918
|
+
variantMode: import_zod27.z.enum(variantModes).default(VariantMode.multiple)
|
|
2805
2919
|
});
|
|
2806
2920
|
|
|
2807
2921
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2808
|
-
var CABBorder =
|
|
2809
|
-
radius:
|
|
2810
|
-
style:
|
|
2811
|
-
width:
|
|
2922
|
+
var CABBorder = import_zod28.z.object({
|
|
2923
|
+
radius: import_zod28.z.enum(borderRadii).default(BorderRadius.base),
|
|
2924
|
+
style: import_zod28.z.enum(borderStyles).default(BorderStyle.none),
|
|
2925
|
+
width: import_zod28.z.enum(borderWidths).default(BorderWidth.base)
|
|
2812
2926
|
}).default({
|
|
2813
2927
|
radius: BorderRadius.base,
|
|
2814
2928
|
style: BorderStyle.none,
|
|
2815
2929
|
width: BorderWidth.base
|
|
2816
2930
|
});
|
|
2817
|
-
var CABSection =
|
|
2818
|
-
() =>
|
|
2931
|
+
var CABSection = import_zod28.z.lazy(
|
|
2932
|
+
() => import_zod28.z.discriminatedUnion("sectionType", [
|
|
2819
2933
|
CABBannerSection,
|
|
2820
2934
|
CABButtonSection,
|
|
2821
2935
|
CABCarouselSection,
|
|
@@ -2837,32 +2951,32 @@ var CABSection = import_zod27.z.lazy(
|
|
|
2837
2951
|
);
|
|
2838
2952
|
|
|
2839
2953
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2840
|
-
var GridItem =
|
|
2841
|
-
var CABLayoutSection =
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2954
|
+
var GridItem = import_zod29.z.union([import_zod29.z.literal("auto"), import_zod29.z.literal("fill"), import_zod29.z.string().regex(/^\d+%$/), import_zod29.z.number()]);
|
|
2955
|
+
var CABLayoutSection = import_zod29.z.object({
|
|
2956
|
+
...CABVariableFields,
|
|
2957
|
+
alignment: import_zod29.z.object({
|
|
2958
|
+
horizontal: import_zod29.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2959
|
+
vertical: import_zod29.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2845
2960
|
}).default({
|
|
2846
2961
|
horizontal: HorizontalAlignment.start,
|
|
2847
2962
|
vertical: VerticalAlignment.top
|
|
2848
2963
|
}),
|
|
2849
|
-
border:
|
|
2850
|
-
buttonField:
|
|
2851
|
-
direction:
|
|
2852
|
-
grid:
|
|
2853
|
-
columns:
|
|
2854
|
-
rows:
|
|
2964
|
+
border: import_zod29.z.lazy(() => CABBorder),
|
|
2965
|
+
buttonField: import_zod29.z.enum(buttonFields).optional(),
|
|
2966
|
+
direction: import_zod29.z.enum(directions).default(Direction.rows),
|
|
2967
|
+
grid: import_zod29.z.object({
|
|
2968
|
+
columns: import_zod29.z.union([import_zod29.z.array(GridItem), import_zod29.z.undefined()]).default(() => ["auto"]),
|
|
2969
|
+
rows: import_zod29.z.union([import_zod29.z.array(GridItem), import_zod29.z.undefined()]).default(() => ["auto"])
|
|
2855
2970
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2856
|
-
name:
|
|
2857
|
-
padding:
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
spacing: import_zod28.z.enum(spacings).default(Spacing.base),
|
|
2971
|
+
name: import_zod29.z.string().optional(),
|
|
2972
|
+
padding: import_zod29.z.enum(spacings).default(Spacing.none),
|
|
2973
|
+
sectionId: import_zod29.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
2974
|
+
sections: import_zod29.z.union([import_zod29.z.array(import_zod29.z.lazy(() => CABSection)), import_zod29.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2975
|
+
sectionType: import_zod29.z.literal(SectionType.layout).default(SectionType.layout),
|
|
2976
|
+
spacing: import_zod29.z.enum(spacings).default(Spacing.base),
|
|
2863
2977
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2864
|
-
viewUrl:
|
|
2865
|
-
width:
|
|
2978
|
+
viewUrl: import_zod29.z.string().optional(),
|
|
2979
|
+
width: import_zod29.z.number().default(100)
|
|
2866
2980
|
});
|
|
2867
2981
|
|
|
2868
2982
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -2879,8 +2993,8 @@ var UI_LABELS = {
|
|
|
2879
2993
|
};
|
|
2880
2994
|
|
|
2881
2995
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2882
|
-
var localized = (fallback) =>
|
|
2883
|
-
var CABUILabels =
|
|
2996
|
+
var localized = (fallback) => import_zod30.z.record(import_zod30.z.string(), import_zod30.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
2997
|
+
var CABUILabels = import_zod30.z.object({
|
|
2884
2998
|
currentPage: localized(UI_LABELS.currentPage),
|
|
2885
2999
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
2886
3000
|
nextPage: localized(UI_LABELS.nextPage),
|
|
@@ -2901,154 +3015,154 @@ var CABUILabels = import_zod29.z.object({
|
|
|
2901
3015
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
2902
3016
|
updating: { ...UI_LABELS.updating }
|
|
2903
3017
|
}));
|
|
2904
|
-
var TargetArea =
|
|
2905
|
-
fill:
|
|
2906
|
-
flip:
|
|
2907
|
-
icon:
|
|
2908
|
-
label:
|
|
2909
|
-
width:
|
|
3018
|
+
var TargetArea = import_zod30.z.object({
|
|
3019
|
+
fill: import_zod30.z.boolean().optional(),
|
|
3020
|
+
flip: import_zod30.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3021
|
+
icon: import_zod30.z.string(),
|
|
3022
|
+
label: import_zod30.z.string(),
|
|
3023
|
+
width: import_zod30.z.string()
|
|
2910
3024
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
2911
|
-
var CABTracking =
|
|
2912
|
-
enableAttribution:
|
|
2913
|
-
enableSource:
|
|
2914
|
-
enableWidget:
|
|
3025
|
+
var CABTracking = import_zod30.z.object({
|
|
3026
|
+
enableAttribution: import_zod30.z.boolean().nullish().transform((value) => value ?? true),
|
|
3027
|
+
enableSource: import_zod30.z.boolean().nullish().transform((value) => value ?? true),
|
|
3028
|
+
enableWidget: import_zod30.z.boolean().nullish().transform((value) => value ?? true)
|
|
2915
3029
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
2916
|
-
var CABExperiment =
|
|
2917
|
-
elementId:
|
|
2918
|
-
experimentId:
|
|
2919
|
-
experimentType:
|
|
2920
|
-
selectedId:
|
|
3030
|
+
var CABExperiment = import_zod30.z.object({
|
|
3031
|
+
elementId: import_zod30.z.number(),
|
|
3032
|
+
experimentId: import_zod30.z.number(),
|
|
3033
|
+
experimentType: import_zod30.z.string(),
|
|
3034
|
+
selectedId: import_zod30.z.number()
|
|
2921
3035
|
});
|
|
2922
3036
|
var CABRootSection = CABLayoutSection.extend({
|
|
2923
|
-
editorMode:
|
|
3037
|
+
editorMode: import_zod30.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
2924
3038
|
experiment: CABExperiment.optional(),
|
|
2925
3039
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
2926
3040
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
2927
|
-
previewMode:
|
|
2928
|
-
storeId:
|
|
3041
|
+
previewMode: import_zod30.z.boolean().nullish().transform((value) => value ?? false),
|
|
3042
|
+
storeId: import_zod30.z.number().nullable().default(null),
|
|
2929
3043
|
targetArea: TargetArea.nullable(),
|
|
2930
3044
|
tracking: CABTracking,
|
|
2931
|
-
type:
|
|
3045
|
+
type: import_zod30.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
2932
3046
|
uiLabels: CABUILabels,
|
|
2933
|
-
version:
|
|
2934
|
-
widgetId:
|
|
3047
|
+
version: import_zod30.z.literal(2).default(2),
|
|
3048
|
+
widgetId: import_zod30.z.number().nullable().default(null)
|
|
2935
3049
|
});
|
|
2936
3050
|
|
|
2937
3051
|
// src/schema/widgets/contentBlock.ts
|
|
2938
|
-
var ContentBlockV1 =
|
|
2939
|
-
blockSpacing:
|
|
2940
|
-
imageBlocks:
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
altText:
|
|
2944
|
-
description:
|
|
2945
|
-
id:
|
|
2946
|
-
imagePlacement:
|
|
2947
|
-
imageSize:
|
|
2948
|
-
imageUrl:
|
|
2949
|
-
textAlignment:
|
|
3052
|
+
var ContentBlockV1 = import_zod31.z.object({
|
|
3053
|
+
blockSpacing: import_zod31.z.enum(spacings).optional(),
|
|
3054
|
+
imageBlocks: import_zod31.z.union([
|
|
3055
|
+
import_zod31.z.array(
|
|
3056
|
+
import_zod31.z.object({
|
|
3057
|
+
altText: import_zod31.z.string().nullable(),
|
|
3058
|
+
description: import_zod31.z.string().nullable(),
|
|
3059
|
+
id: import_zod31.z.uuid(),
|
|
3060
|
+
imagePlacement: import_zod31.z.enum(["top", "right", "bottom", "left"]),
|
|
3061
|
+
imageSize: import_zod31.z.number(),
|
|
3062
|
+
imageUrl: import_zod31.z.url(),
|
|
3063
|
+
textAlignment: import_zod31.z.enum(["left", "center", "right"]),
|
|
2950
3064
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
2951
|
-
textSize:
|
|
3065
|
+
textSize: import_zod31.z.enum(inlineTextSizeNames)
|
|
2952
3066
|
})
|
|
2953
3067
|
),
|
|
2954
|
-
|
|
3068
|
+
import_zod31.z.strictObject({}).transform(() => [])
|
|
2955
3069
|
]).optional(),
|
|
2956
|
-
imageLayout:
|
|
2957
|
-
language:
|
|
2958
|
-
description:
|
|
2959
|
-
superTitle:
|
|
2960
|
-
title:
|
|
3070
|
+
imageLayout: import_zod31.z.enum(["row", "column"]).optional(),
|
|
3071
|
+
language: import_zod31.z.object({
|
|
3072
|
+
description: import_zod31.z.string(),
|
|
3073
|
+
superTitle: import_zod31.z.string(),
|
|
3074
|
+
title: import_zod31.z.string()
|
|
2961
3075
|
}),
|
|
2962
|
-
previewMode:
|
|
2963
|
-
type:
|
|
2964
|
-
version:
|
|
3076
|
+
previewMode: import_zod31.z.boolean(),
|
|
3077
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
3078
|
+
version: import_zod31.z.literal(1)
|
|
2965
3079
|
});
|
|
2966
|
-
var ContentBlock =
|
|
3080
|
+
var ContentBlock = import_zod31.z.discriminatedUnion("version", [
|
|
2967
3081
|
ContentBlockV1,
|
|
2968
3082
|
CABRootSection.extend({
|
|
2969
|
-
type:
|
|
3083
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
2970
3084
|
})
|
|
2971
3085
|
]);
|
|
2972
3086
|
|
|
2973
3087
|
// src/schema/widgets/giftWithPurchase.ts
|
|
2974
|
-
var
|
|
2975
|
-
var GiftWithPurchase =
|
|
2976
|
-
type:
|
|
3088
|
+
var import_zod32 = require("zod");
|
|
3089
|
+
var GiftWithPurchase = import_zod32.z.looseObject({
|
|
3090
|
+
type: import_zod32.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
2977
3091
|
});
|
|
2978
3092
|
|
|
2979
3093
|
// src/schema/widgets/lineItemEditor.ts
|
|
2980
|
-
var
|
|
2981
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
2982
|
-
downgradeToOneTimeLabel:
|
|
3094
|
+
var import_zod33 = require("zod");
|
|
3095
|
+
var LineItemEditorSwitchLanguageV1 = import_zod33.z.object({
|
|
3096
|
+
downgradeToOneTimeLabel: import_zod33.z.string().optional(),
|
|
2983
3097
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
2984
|
-
subscriptionOptionLabel:
|
|
2985
|
-
upgradeToSubscriptionLabel:
|
|
2986
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
3098
|
+
subscriptionOptionLabel: import_zod33.z.string().optional(),
|
|
3099
|
+
upgradeToSubscriptionLabel: import_zod33.z.string().optional(),
|
|
3100
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod33.z.string().optional()
|
|
2987
3101
|
});
|
|
2988
|
-
var LineItemEditorV1 =
|
|
3102
|
+
var LineItemEditorV1 = import_zod33.z.object({
|
|
2989
3103
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
2990
|
-
button:
|
|
2991
|
-
previewMode:
|
|
2992
|
-
switchToSubscription:
|
|
2993
|
-
disableDowngrade:
|
|
3104
|
+
button: import_zod33.z.object({ kind: import_zod33.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
3105
|
+
previewMode: import_zod33.z.boolean().optional(),
|
|
3106
|
+
switchToSubscription: import_zod33.z.object({
|
|
3107
|
+
disableDowngrade: import_zod33.z.boolean().optional(),
|
|
2994
3108
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
2995
3109
|
}).optional(),
|
|
2996
|
-
switchToSubscriptionEnabled:
|
|
2997
|
-
tracking:
|
|
2998
|
-
enableAttribution:
|
|
2999
|
-
enableSource:
|
|
3000
|
-
enableWidget:
|
|
3110
|
+
switchToSubscriptionEnabled: import_zod33.z.boolean().optional(),
|
|
3111
|
+
tracking: import_zod33.z.object({
|
|
3112
|
+
enableAttribution: import_zod33.z.boolean().optional(),
|
|
3113
|
+
enableSource: import_zod33.z.boolean().optional(),
|
|
3114
|
+
enableWidget: import_zod33.z.boolean().optional()
|
|
3001
3115
|
}).optional(),
|
|
3002
|
-
type:
|
|
3003
|
-
version:
|
|
3116
|
+
type: import_zod33.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
3117
|
+
version: import_zod33.z.literal(1)
|
|
3004
3118
|
});
|
|
3005
|
-
var LineItemEditor =
|
|
3119
|
+
var LineItemEditor = import_zod33.z.discriminatedUnion("version", [
|
|
3006
3120
|
LineItemEditorV1,
|
|
3007
3121
|
CABRootSection.extend({
|
|
3008
|
-
type:
|
|
3122
|
+
type: import_zod33.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
3009
3123
|
})
|
|
3010
3124
|
]);
|
|
3011
3125
|
|
|
3012
3126
|
// src/schema/widgets/progressBar.ts
|
|
3013
|
-
var
|
|
3014
|
-
var ProgressBar =
|
|
3015
|
-
type:
|
|
3127
|
+
var import_zod34 = require("zod");
|
|
3128
|
+
var ProgressBar = import_zod34.z.looseObject({
|
|
3129
|
+
type: import_zod34.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
3016
3130
|
});
|
|
3017
3131
|
|
|
3018
3132
|
// src/schema/widgets/rebuyButton.ts
|
|
3019
|
-
var
|
|
3020
|
-
var RebuyButtonV1 =
|
|
3021
|
-
type:
|
|
3022
|
-
version:
|
|
3133
|
+
var import_zod35 = require("zod");
|
|
3134
|
+
var RebuyButtonV1 = import_zod35.z.looseObject({
|
|
3135
|
+
type: import_zod35.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
3136
|
+
version: import_zod35.z.literal(1)
|
|
3023
3137
|
});
|
|
3024
|
-
var RebuyButton =
|
|
3138
|
+
var RebuyButton = import_zod35.z.discriminatedUnion("version", [
|
|
3025
3139
|
RebuyButtonV1,
|
|
3026
3140
|
CABRootSection.extend({
|
|
3027
|
-
type:
|
|
3141
|
+
type: import_zod35.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
3028
3142
|
})
|
|
3029
3143
|
]);
|
|
3030
3144
|
|
|
3031
3145
|
// src/schema/widgets/rebuyMonetize.ts
|
|
3032
|
-
var
|
|
3033
|
-
var RebuyMonetize =
|
|
3034
|
-
type:
|
|
3146
|
+
var import_zod36 = require("zod");
|
|
3147
|
+
var RebuyMonetize = import_zod36.z.looseObject({
|
|
3148
|
+
type: import_zod36.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
3035
3149
|
});
|
|
3036
|
-
var RebuyMonetizeV1 =
|
|
3037
|
-
name:
|
|
3038
|
-
previewMode:
|
|
3150
|
+
var RebuyMonetizeV1 = import_zod36.z.object({
|
|
3151
|
+
name: import_zod36.z.string().nullable().optional(),
|
|
3152
|
+
previewMode: import_zod36.z.boolean().optional(),
|
|
3039
3153
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
3040
|
-
privacyPolicyUrl:
|
|
3154
|
+
privacyPolicyUrl: import_zod36.z.string().nullable().optional(),
|
|
3041
3155
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
3042
|
-
subVertical:
|
|
3043
|
-
tracking:
|
|
3044
|
-
enableAttribution:
|
|
3045
|
-
enableSource:
|
|
3046
|
-
enableWidget:
|
|
3156
|
+
subVertical: import_zod36.z.string().nullable().optional(),
|
|
3157
|
+
tracking: import_zod36.z.object({
|
|
3158
|
+
enableAttribution: import_zod36.z.boolean().optional(),
|
|
3159
|
+
enableSource: import_zod36.z.boolean().optional(),
|
|
3160
|
+
enableWidget: import_zod36.z.boolean().optional()
|
|
3047
3161
|
}).optional(),
|
|
3048
|
-
type:
|
|
3049
|
-
version:
|
|
3162
|
+
type: import_zod36.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
3163
|
+
version: import_zod36.z.literal(1),
|
|
3050
3164
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
3051
|
-
vertical:
|
|
3165
|
+
vertical: import_zod36.z.string().nullable().optional()
|
|
3052
3166
|
});
|
|
3053
3167
|
|
|
3054
3168
|
// src/schema/widgetData.ts
|
|
@@ -3062,7 +3176,7 @@ var extensionWidgetTypes = [
|
|
|
3062
3176
|
WidgetType.ui_extension_line_item_editor,
|
|
3063
3177
|
WidgetType.ui_extension_progress_bar
|
|
3064
3178
|
];
|
|
3065
|
-
var WidgetData =
|
|
3179
|
+
var WidgetData = import_zod37.z.discriminatedUnion("type", [
|
|
3066
3180
|
ABTestingPlaceholder,
|
|
3067
3181
|
CheckoutExtension,
|
|
3068
3182
|
ContentBlock,
|
|
@@ -3391,15 +3505,15 @@ var SWITCH_LABELS = {
|
|
|
3391
3505
|
|
|
3392
3506
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
3393
3507
|
var import_compat4 = require("es-toolkit/compat");
|
|
3394
|
-
var
|
|
3395
|
-
var strictNumber =
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3508
|
+
var import_zod38 = require("zod");
|
|
3509
|
+
var strictNumber = import_zod38.z.union([
|
|
3510
|
+
import_zod38.z.number(),
|
|
3511
|
+
import_zod38.z.string().transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
3512
|
+
import_zod38.z.unknown().transform(() => 0)
|
|
3399
3513
|
]);
|
|
3400
3514
|
|
|
3401
3515
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
3402
|
-
var
|
|
3516
|
+
var import_zod39 = require("zod");
|
|
3403
3517
|
var blockTypes = [
|
|
3404
3518
|
"callout_banner",
|
|
3405
3519
|
"image",
|
|
@@ -3410,144 +3524,144 @@ var blockTypes = [
|
|
|
3410
3524
|
"text",
|
|
3411
3525
|
"timer"
|
|
3412
3526
|
];
|
|
3413
|
-
var blockType =
|
|
3527
|
+
var blockType = import_zod39.z.enum(blockTypes);
|
|
3414
3528
|
var BlockType = blockType.enum;
|
|
3415
3529
|
|
|
3416
3530
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
3417
3531
|
var import_compat5 = require("es-toolkit/compat");
|
|
3418
3532
|
var import_uuid14 = require("uuid");
|
|
3419
|
-
var
|
|
3420
|
-
var TextAlignment2 =
|
|
3421
|
-
var TextSize =
|
|
3422
|
-
|
|
3423
|
-
|
|
3533
|
+
var import_zod40 = require("zod");
|
|
3534
|
+
var TextAlignment2 = import_zod40.z.union([import_zod40.z.enum(["leading", "center", "trailing"]), import_zod40.z.unknown().transform(() => "leading")]);
|
|
3535
|
+
var TextSize = import_zod40.z.union([
|
|
3536
|
+
import_zod40.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
3537
|
+
import_zod40.z.unknown().transform(() => "medium")
|
|
3424
3538
|
]);
|
|
3425
|
-
var CalloutBannerBlock =
|
|
3426
|
-
id:
|
|
3427
|
-
name:
|
|
3428
|
-
settings:
|
|
3429
|
-
superTitle:
|
|
3430
|
-
title:
|
|
3539
|
+
var CalloutBannerBlock = import_zod40.z.object({
|
|
3540
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3541
|
+
name: import_zod40.z.string().optional(),
|
|
3542
|
+
settings: import_zod40.z.object({
|
|
3543
|
+
superTitle: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
3544
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
3431
3545
|
}),
|
|
3432
|
-
styles:
|
|
3433
|
-
superTitleEmphasized:
|
|
3546
|
+
styles: import_zod40.z.object({
|
|
3547
|
+
superTitleEmphasized: import_zod40.z.boolean().default(false),
|
|
3434
3548
|
superTitleSize: TextSize.default("large"),
|
|
3435
3549
|
textAlignment: TextAlignment2.default("center"),
|
|
3436
|
-
titleEmphasized:
|
|
3550
|
+
titleEmphasized: import_zod40.z.boolean().default(true),
|
|
3437
3551
|
titleSize: TextSize.default("large")
|
|
3438
3552
|
}),
|
|
3439
|
-
type:
|
|
3553
|
+
type: import_zod40.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
3440
3554
|
});
|
|
3441
|
-
var ImageBlock =
|
|
3442
|
-
id:
|
|
3443
|
-
name:
|
|
3444
|
-
settings:
|
|
3445
|
-
|
|
3555
|
+
var ImageBlock = import_zod40.z.object({
|
|
3556
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3557
|
+
name: import_zod40.z.string().optional(),
|
|
3558
|
+
settings: import_zod40.z.union([
|
|
3559
|
+
import_zod40.z.object({
|
|
3446
3560
|
/** This isn't used in the post-purchase offer widget */
|
|
3447
|
-
alt:
|
|
3448
|
-
image:
|
|
3449
|
-
imageSize:
|
|
3450
|
-
imageType:
|
|
3561
|
+
alt: import_zod40.z.string().optional().default(""),
|
|
3562
|
+
image: import_zod40.z.union([import_zod40.z.literal(""), import_zod40.z.url()]).default(""),
|
|
3563
|
+
imageSize: import_zod40.z.number().default(20),
|
|
3564
|
+
imageType: import_zod40.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
3451
3565
|
}),
|
|
3452
|
-
|
|
3566
|
+
import_zod40.z.array(import_zod40.z.never()).transform(() => ({}))
|
|
3453
3567
|
]),
|
|
3454
|
-
type:
|
|
3568
|
+
type: import_zod40.z.literal(BlockType.image).default(BlockType.image)
|
|
3455
3569
|
});
|
|
3456
|
-
var ImageContentBlock =
|
|
3457
|
-
id:
|
|
3458
|
-
name:
|
|
3459
|
-
settings:
|
|
3460
|
-
alt:
|
|
3461
|
-
description:
|
|
3570
|
+
var ImageContentBlock = import_zod40.z.object({
|
|
3571
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3572
|
+
name: import_zod40.z.string().optional(),
|
|
3573
|
+
settings: import_zod40.z.object({
|
|
3574
|
+
alt: import_zod40.z.string().optional().default(""),
|
|
3575
|
+
description: import_zod40.z.union([import_zod40.z.string(), TiptapDocument, import_zod40.z.null()]).default(
|
|
3462
3576
|
"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."
|
|
3463
3577
|
),
|
|
3464
3578
|
descriptionSize: TextSize.default("medium"),
|
|
3465
3579
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3466
|
-
image:
|
|
3467
|
-
imagePlacement:
|
|
3468
|
-
imageSize:
|
|
3469
|
-
superTitle:
|
|
3580
|
+
image: import_zod40.z.union([import_zod40.z.literal(""), import_zod40.z.url()]).default(""),
|
|
3581
|
+
imagePlacement: import_zod40.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
3582
|
+
imageSize: import_zod40.z.number().default(20),
|
|
3583
|
+
superTitle: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
3470
3584
|
superTitleSize: TextSize.default("medium"),
|
|
3471
3585
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3472
|
-
swapContent:
|
|
3473
|
-
title:
|
|
3586
|
+
swapContent: import_zod40.z.boolean().optional().default(false),
|
|
3587
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
3474
3588
|
titleSize: TextSize.default("medium")
|
|
3475
3589
|
}),
|
|
3476
|
-
type:
|
|
3590
|
+
type: import_zod40.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
3477
3591
|
});
|
|
3478
|
-
var PayButtonBlock =
|
|
3479
|
-
id:
|
|
3480
|
-
name:
|
|
3481
|
-
settings:
|
|
3482
|
-
|
|
3483
|
-
label:
|
|
3592
|
+
var PayButtonBlock = import_zod40.z.object({
|
|
3593
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3594
|
+
name: import_zod40.z.string().optional(),
|
|
3595
|
+
settings: import_zod40.z.union([
|
|
3596
|
+
import_zod40.z.object({
|
|
3597
|
+
label: import_zod40.z.string().default("Pay Now")
|
|
3484
3598
|
}),
|
|
3485
|
-
|
|
3599
|
+
import_zod40.z.array(import_zod40.z.never()).transform(() => ({
|
|
3486
3600
|
label: "Pay Now"
|
|
3487
3601
|
}))
|
|
3488
3602
|
]),
|
|
3489
|
-
styles:
|
|
3490
|
-
|
|
3491
|
-
buttonWidth:
|
|
3603
|
+
styles: import_zod40.z.union([
|
|
3604
|
+
import_zod40.z.object({
|
|
3605
|
+
buttonWidth: import_zod40.z.number().min(10).max(100).default(50)
|
|
3492
3606
|
}),
|
|
3493
|
-
|
|
3607
|
+
import_zod40.z.array(import_zod40.z.never()).transform(() => ({
|
|
3494
3608
|
buttonWidth: 50
|
|
3495
3609
|
}))
|
|
3496
3610
|
]),
|
|
3497
|
-
type:
|
|
3611
|
+
type: import_zod40.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
3498
3612
|
});
|
|
3499
|
-
var ProductInformationBlock =
|
|
3613
|
+
var ProductInformationBlock = import_zod40.z.object({
|
|
3500
3614
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3501
|
-
hideProductImage:
|
|
3502
|
-
id:
|
|
3503
|
-
name:
|
|
3504
|
-
type:
|
|
3615
|
+
hideProductImage: import_zod40.z.boolean().optional().default(false),
|
|
3616
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3617
|
+
name: import_zod40.z.string().optional(),
|
|
3618
|
+
type: import_zod40.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
3505
3619
|
});
|
|
3506
|
-
var SeparatorBlock =
|
|
3507
|
-
id:
|
|
3508
|
-
name:
|
|
3509
|
-
type:
|
|
3620
|
+
var SeparatorBlock = import_zod40.z.object({
|
|
3621
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3622
|
+
name: import_zod40.z.string().optional(),
|
|
3623
|
+
type: import_zod40.z.literal(BlockType.separator).default(BlockType.separator)
|
|
3510
3624
|
});
|
|
3511
|
-
var TextBlock =
|
|
3512
|
-
id:
|
|
3513
|
-
name:
|
|
3514
|
-
settings:
|
|
3515
|
-
description:
|
|
3625
|
+
var TextBlock = import_zod40.z.object({
|
|
3626
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3627
|
+
name: import_zod40.z.string().optional(),
|
|
3628
|
+
settings: import_zod40.z.object({
|
|
3629
|
+
description: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).optional().default(
|
|
3516
3630
|
"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."
|
|
3517
3631
|
),
|
|
3518
3632
|
/** This isn't used in the post-purchase offer widget */
|
|
3519
3633
|
descriptionSize: TextSize.default("medium"),
|
|
3520
3634
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3521
|
-
superTitle:
|
|
3635
|
+
superTitle: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default("Super Title"),
|
|
3522
3636
|
/** This isn't used in the post-purchase offer widget */
|
|
3523
3637
|
superTitleSize: TextSize.default("medium"),
|
|
3524
|
-
title:
|
|
3638
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
3525
3639
|
/** This isn't used in the post-purchase offer widget */
|
|
3526
3640
|
titleSize: TextSize.default("medium")
|
|
3527
3641
|
}),
|
|
3528
|
-
type:
|
|
3642
|
+
type: import_zod40.z.literal(BlockType.text).default(BlockType.text)
|
|
3529
3643
|
});
|
|
3530
|
-
var TimerBlock =
|
|
3531
|
-
id:
|
|
3532
|
-
name:
|
|
3533
|
-
settings:
|
|
3534
|
-
durationMinutes:
|
|
3535
|
-
durationSeconds:
|
|
3536
|
-
endOffer:
|
|
3537
|
-
title:
|
|
3644
|
+
var TimerBlock = import_zod40.z.object({
|
|
3645
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3646
|
+
name: import_zod40.z.string().optional(),
|
|
3647
|
+
settings: import_zod40.z.object({
|
|
3648
|
+
durationMinutes: import_zod40.z.number().min(0).default(10),
|
|
3649
|
+
durationSeconds: import_zod40.z.union([import_zod40.z.number().min(0), import_zod40.z.unknown().transform(() => 0)]).default(0),
|
|
3650
|
+
endOffer: import_zod40.z.boolean().default(true),
|
|
3651
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
3538
3652
|
}),
|
|
3539
|
-
styles:
|
|
3653
|
+
styles: import_zod40.z.object({
|
|
3540
3654
|
textAlignment: TextAlignment2.default("center"),
|
|
3541
|
-
timerBackgroundColor:
|
|
3542
|
-
timerEmphasized:
|
|
3655
|
+
timerBackgroundColor: import_zod40.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
3656
|
+
timerEmphasized: import_zod40.z.union([import_zod40.z.boolean(), import_zod40.z.unknown().transform(() => true)]).default(true),
|
|
3543
3657
|
timerSize: TextSize.default("medium"),
|
|
3544
|
-
timerWidth:
|
|
3545
|
-
titleEmphasized:
|
|
3658
|
+
timerWidth: import_zod40.z.number().min(10).max(100).optional().default(100),
|
|
3659
|
+
titleEmphasized: import_zod40.z.union([import_zod40.z.boolean(), import_zod40.z.unknown().transform(() => true)]).default(false),
|
|
3546
3660
|
titleSize: TextSize.default("medium")
|
|
3547
3661
|
}),
|
|
3548
|
-
type:
|
|
3662
|
+
type: import_zod40.z.literal(BlockType.timer).default(BlockType.timer)
|
|
3549
3663
|
});
|
|
3550
|
-
var PostPurchaseBlock =
|
|
3664
|
+
var PostPurchaseBlock = import_zod40.z.discriminatedUnion("type", [
|
|
3551
3665
|
CalloutBannerBlock,
|
|
3552
3666
|
ImageBlock,
|
|
3553
3667
|
ImageContentBlock,
|
|
@@ -3567,68 +3681,68 @@ var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)
|
|
|
3567
3681
|
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
3568
3682
|
|
|
3569
3683
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3570
|
-
var
|
|
3684
|
+
var import_zod43 = require("zod");
|
|
3571
3685
|
|
|
3572
3686
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3573
|
-
var
|
|
3687
|
+
var import_zod42 = require("zod");
|
|
3574
3688
|
|
|
3575
3689
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
3576
|
-
var
|
|
3577
|
-
var PostPurchaseSettings =
|
|
3578
|
-
advance:
|
|
3579
|
-
blocks:
|
|
3690
|
+
var import_zod41 = require("zod");
|
|
3691
|
+
var PostPurchaseSettings = import_zod41.z.object({
|
|
3692
|
+
advance: import_zod41.z.object({ removePartialOrder: import_zod41.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
3693
|
+
blocks: import_zod41.z.union([import_zod41.z.array(PostPurchaseBlock), import_zod41.z.unknown().transform(() => [])]).default(() => [
|
|
3580
3694
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3581
3695
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3582
3696
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3583
3697
|
]),
|
|
3584
|
-
columnLayout:
|
|
3585
|
-
discount:
|
|
3698
|
+
columnLayout: import_zod41.z.boolean().optional(),
|
|
3699
|
+
discount: import_zod41.z.object({
|
|
3586
3700
|
amount: strictNumber.default(30),
|
|
3587
|
-
shouldShowSavingText:
|
|
3588
|
-
type:
|
|
3701
|
+
shouldShowSavingText: import_zod41.z.boolean().optional().default(true),
|
|
3702
|
+
type: import_zod41.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3589
3703
|
}),
|
|
3590
|
-
discountedFrom:
|
|
3591
|
-
endpoint:
|
|
3592
|
-
integrations:
|
|
3593
|
-
judgeme:
|
|
3594
|
-
junip:
|
|
3595
|
-
klaviyo:
|
|
3596
|
-
loox:
|
|
3597
|
-
okendo:
|
|
3598
|
-
opinew:
|
|
3599
|
-
reviewsio:
|
|
3600
|
-
stamped:
|
|
3601
|
-
yotpo:
|
|
3704
|
+
discountedFrom: import_zod41.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
3705
|
+
endpoint: import_zod41.z.string().optional(),
|
|
3706
|
+
integrations: import_zod41.z.object({
|
|
3707
|
+
judgeme: import_zod41.z.boolean().default(false),
|
|
3708
|
+
junip: import_zod41.z.boolean().optional().default(false),
|
|
3709
|
+
klaviyo: import_zod41.z.boolean().default(false),
|
|
3710
|
+
loox: import_zod41.z.boolean().default(false),
|
|
3711
|
+
okendo: import_zod41.z.boolean().default(false),
|
|
3712
|
+
opinew: import_zod41.z.boolean().optional().default(false),
|
|
3713
|
+
reviewsio: import_zod41.z.boolean().optional().default(false),
|
|
3714
|
+
stamped: import_zod41.z.boolean().default(false),
|
|
3715
|
+
yotpo: import_zod41.z.boolean().default(false)
|
|
3602
3716
|
}),
|
|
3603
|
-
key:
|
|
3604
|
-
language:
|
|
3605
|
-
description:
|
|
3606
|
-
descriptionEnabled:
|
|
3607
|
-
descriptionRte:
|
|
3608
|
-
content:
|
|
3609
|
-
type:
|
|
3717
|
+
key: import_zod41.z.string().optional(),
|
|
3718
|
+
language: import_zod41.z.object({
|
|
3719
|
+
description: import_zod41.z.union([import_zod41.z.string(), import_zod41.z.unknown().transform(() => "")]).default(""),
|
|
3720
|
+
descriptionEnabled: import_zod41.z.boolean().optional().default(false),
|
|
3721
|
+
descriptionRte: import_zod41.z.object({
|
|
3722
|
+
content: import_zod41.z.array(import_zod41.z.unknown()),
|
|
3723
|
+
type: import_zod41.z.string()
|
|
3610
3724
|
}).optional(),
|
|
3611
|
-
descriptionSpacing:
|
|
3612
|
-
displayCtaPrice:
|
|
3613
|
-
global:
|
|
3614
|
-
declineAll:
|
|
3615
|
-
declineThisOffer:
|
|
3616
|
-
free:
|
|
3617
|
-
notAvailable:
|
|
3618
|
-
payNow:
|
|
3619
|
-
payNowUpgradeToSubscription:
|
|
3620
|
-
quantity:
|
|
3725
|
+
descriptionSpacing: import_zod41.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
3726
|
+
displayCtaPrice: import_zod41.z.boolean().default(true),
|
|
3727
|
+
global: import_zod41.z.object({
|
|
3728
|
+
declineAll: import_zod41.z.string().optional().default("Decline All"),
|
|
3729
|
+
declineThisOffer: import_zod41.z.string().default("Decline this offer"),
|
|
3730
|
+
free: import_zod41.z.string().optional().default("Free"),
|
|
3731
|
+
notAvailable: import_zod41.z.string().optional().default("Not available"),
|
|
3732
|
+
payNow: import_zod41.z.string().default("Pay Now"),
|
|
3733
|
+
payNowUpgradeToSubscription: import_zod41.z.string().optional().default("Upgrade to Subscription"),
|
|
3734
|
+
quantity: import_zod41.z.string().default("Quantity"),
|
|
3621
3735
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3622
|
-
recurringShipping:
|
|
3623
|
-
recurringSubtotal:
|
|
3624
|
-
reviewsPlural:
|
|
3625
|
-
reviewsSingular:
|
|
3626
|
-
save:
|
|
3627
|
-
shipping:
|
|
3628
|
-
subscriptionOption:
|
|
3629
|
-
subtotal:
|
|
3630
|
-
taxes:
|
|
3631
|
-
total:
|
|
3736
|
+
recurringShipping: import_zod41.z.string().optional().default("Recurring shipping"),
|
|
3737
|
+
recurringSubtotal: import_zod41.z.string().default("Recurring subtotal"),
|
|
3738
|
+
reviewsPlural: import_zod41.z.string().optional().default("Reviews"),
|
|
3739
|
+
reviewsSingular: import_zod41.z.string().optional().default("Review"),
|
|
3740
|
+
save: import_zod41.z.union([import_zod41.z.string(), import_zod41.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
3741
|
+
shipping: import_zod41.z.string().default("Shipping"),
|
|
3742
|
+
subscriptionOption: import_zod41.z.string().optional().default("Subscribe and Save"),
|
|
3743
|
+
subtotal: import_zod41.z.string().default("Subtotal"),
|
|
3744
|
+
taxes: import_zod41.z.string().default("Taxes"),
|
|
3745
|
+
total: import_zod41.z.string().default("Total")
|
|
3632
3746
|
}).optional().default(() => ({
|
|
3633
3747
|
declineAll: "Decline All",
|
|
3634
3748
|
declineThisOffer: "Decline this offer",
|
|
@@ -3649,70 +3763,70 @@ var PostPurchaseSettings = import_zod40.z.object({
|
|
|
3649
3763
|
taxes: "Taxes",
|
|
3650
3764
|
total: "Total"
|
|
3651
3765
|
})),
|
|
3652
|
-
globalTranslation:
|
|
3766
|
+
globalTranslation: import_zod41.z.string().optional().default("english")
|
|
3653
3767
|
}),
|
|
3654
|
-
metafields:
|
|
3768
|
+
metafields: import_zod41.z.boolean().default(false),
|
|
3655
3769
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3656
|
-
offer:
|
|
3657
|
-
count:
|
|
3770
|
+
offer: import_zod41.z.object({
|
|
3771
|
+
count: import_zod41.z.number().default(1)
|
|
3658
3772
|
}),
|
|
3659
|
-
offersLayout:
|
|
3660
|
-
itemsPerPage:
|
|
3661
|
-
type:
|
|
3773
|
+
offersLayout: import_zod41.z.object({
|
|
3774
|
+
itemsPerPage: import_zod41.z.number().optional(),
|
|
3775
|
+
type: import_zod41.z.enum(["list", "grid", "carousel"]).default("list")
|
|
3662
3776
|
}).optional().default({
|
|
3663
3777
|
type: "list"
|
|
3664
3778
|
}),
|
|
3665
3779
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3666
|
-
previewMode:
|
|
3667
|
-
productLimit:
|
|
3668
|
-
productOptions:
|
|
3780
|
+
previewMode: import_zod41.z.boolean().default(false),
|
|
3781
|
+
productLimit: import_zod41.z.number().optional().default(1),
|
|
3782
|
+
productOptions: import_zod41.z.object({
|
|
3669
3783
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3670
|
-
hideOutOfStockVariants:
|
|
3671
|
-
matchVariant:
|
|
3672
|
-
showDeclineAll:
|
|
3673
|
-
showShipping:
|
|
3674
|
-
showSubtotal:
|
|
3675
|
-
showTaxes:
|
|
3676
|
-
showTotal:
|
|
3677
|
-
showVariantSelectors:
|
|
3678
|
-
variantSelectorDisplayMode:
|
|
3784
|
+
hideOutOfStockVariants: import_zod41.z.boolean().optional().default(false),
|
|
3785
|
+
matchVariant: import_zod41.z.boolean().optional().default(true),
|
|
3786
|
+
showDeclineAll: import_zod41.z.enum(["above", "below", "both", "none"]).optional(),
|
|
3787
|
+
showShipping: import_zod41.z.boolean().optional().default(true),
|
|
3788
|
+
showSubtotal: import_zod41.z.boolean().optional().default(true),
|
|
3789
|
+
showTaxes: import_zod41.z.boolean().optional().default(true),
|
|
3790
|
+
showTotal: import_zod41.z.boolean().optional().default(true),
|
|
3791
|
+
showVariantSelectors: import_zod41.z.boolean().optional().default(true),
|
|
3792
|
+
variantSelectorDisplayMode: import_zod41.z.enum(["separate", "single"]).optional().default("separate")
|
|
3679
3793
|
}),
|
|
3680
|
-
productType:
|
|
3681
|
-
productTypeSelector:
|
|
3682
|
-
quantityInputs:
|
|
3683
|
-
defaultQuantity:
|
|
3684
|
-
enabled:
|
|
3685
|
-
maxValue:
|
|
3686
|
-
minValue:
|
|
3794
|
+
productType: import_zod41.z.union([import_zod41.z.enum(["one-time", "subscription", "both"]), import_zod41.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
3795
|
+
productTypeSelector: import_zod41.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
3796
|
+
quantityInputs: import_zod41.z.object({
|
|
3797
|
+
defaultQuantity: import_zod41.z.union([import_zod41.z.number(), import_zod41.z.null().transform(() => 1)]).default(1),
|
|
3798
|
+
enabled: import_zod41.z.boolean().default(true),
|
|
3799
|
+
maxValue: import_zod41.z.union([import_zod41.z.number(), import_zod41.z.null().transform(() => 15)]).default(15),
|
|
3800
|
+
minValue: import_zod41.z.union([import_zod41.z.number().min(0), import_zod41.z.unknown().transform(() => 0)]).default(1)
|
|
3687
3801
|
}),
|
|
3688
|
-
shipping:
|
|
3802
|
+
shipping: import_zod41.z.object({
|
|
3689
3803
|
amount: strictNumber.default(10),
|
|
3690
3804
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3691
|
-
enabled:
|
|
3692
|
-
title:
|
|
3693
|
-
type:
|
|
3805
|
+
enabled: import_zod41.z.boolean().default(true),
|
|
3806
|
+
title: import_zod41.z.string().optional().default("Shipping Fees"),
|
|
3807
|
+
type: import_zod41.z.enum(["free", "fixed_amount"]).default("free")
|
|
3694
3808
|
}),
|
|
3695
|
-
styles:
|
|
3696
|
-
starColor:
|
|
3697
|
-
starSize:
|
|
3698
|
-
starStrokeColor:
|
|
3699
|
-
strokeWidth:
|
|
3809
|
+
styles: import_zod41.z.object({
|
|
3810
|
+
starColor: import_zod41.z.string().optional().default("#fadb14"),
|
|
3811
|
+
starSize: import_zod41.z.union([import_zod41.z.enum(["small", "medium", "large"]), import_zod41.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
3812
|
+
starStrokeColor: import_zod41.z.string().optional().default("#fadb14"),
|
|
3813
|
+
strokeWidth: import_zod41.z.string().optional().default("1")
|
|
3700
3814
|
}).optional(),
|
|
3701
|
-
subImages:
|
|
3702
|
-
subscription:
|
|
3703
|
-
discount:
|
|
3815
|
+
subImages: import_zod41.z.number().nullish().default(8),
|
|
3816
|
+
subscription: import_zod41.z.object({
|
|
3817
|
+
discount: import_zod41.z.object({
|
|
3704
3818
|
amount: strictNumber.default(30),
|
|
3705
|
-
shouldShowSavingText:
|
|
3706
|
-
type:
|
|
3819
|
+
shouldShowSavingText: import_zod41.z.boolean().optional().default(true),
|
|
3820
|
+
type: import_zod41.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3707
3821
|
}),
|
|
3708
|
-
shipping:
|
|
3822
|
+
shipping: import_zod41.z.object({
|
|
3709
3823
|
amount: strictNumber.default(1),
|
|
3710
3824
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3711
|
-
enabled:
|
|
3825
|
+
enabled: import_zod41.z.boolean().default(true),
|
|
3712
3826
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3713
3827
|
recurringAmount: strictNumber.default(2),
|
|
3714
|
-
shippingTitle:
|
|
3715
|
-
type:
|
|
3828
|
+
shippingTitle: import_zod41.z.string().default("Shipping Fees"),
|
|
3829
|
+
type: import_zod41.z.enum(["free", "fixed_amount"]).default("free")
|
|
3716
3830
|
})
|
|
3717
3831
|
}).optional().default({
|
|
3718
3832
|
discount: {
|
|
@@ -3730,15 +3844,15 @@ var PostPurchaseSettings = import_zod40.z.object({
|
|
|
3730
3844
|
type: "free"
|
|
3731
3845
|
}
|
|
3732
3846
|
}),
|
|
3733
|
-
subscriptionIsDefault:
|
|
3847
|
+
subscriptionIsDefault: import_zod41.z.boolean().optional(),
|
|
3734
3848
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3735
|
-
template:
|
|
3736
|
-
type:
|
|
3737
|
-
upgradeToSubscription:
|
|
3738
|
-
acceptButtonText:
|
|
3739
|
-
allow:
|
|
3740
|
-
emailRefundNotice:
|
|
3741
|
-
errorBannerText:
|
|
3849
|
+
template: import_zod41.z.string().optional().default(""),
|
|
3850
|
+
type: import_zod41.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
3851
|
+
upgradeToSubscription: import_zod41.z.object({
|
|
3852
|
+
acceptButtonText: import_zod41.z.string().optional().default("Upgrade"),
|
|
3853
|
+
allow: import_zod41.z.boolean().optional().default(false),
|
|
3854
|
+
emailRefundNotice: import_zod41.z.boolean().optional().default(false),
|
|
3855
|
+
errorBannerText: import_zod41.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
3742
3856
|
}).optional().default(() => ({
|
|
3743
3857
|
acceptButtonText: "Upgrade",
|
|
3744
3858
|
allow: false,
|
|
@@ -3748,32 +3862,32 @@ var PostPurchaseSettings = import_zod40.z.object({
|
|
|
3748
3862
|
});
|
|
3749
3863
|
|
|
3750
3864
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3751
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
3752
|
-
id:
|
|
3753
|
-
name:
|
|
3865
|
+
var PostPurchaseWidgetLinkedFlow = import_zod42.z.object({
|
|
3866
|
+
id: import_zod42.z.number(),
|
|
3867
|
+
name: import_zod42.z.string()
|
|
3754
3868
|
});
|
|
3755
|
-
var PostPurchaseWidget =
|
|
3756
|
-
classification:
|
|
3757
|
-
createdAtTime:
|
|
3758
|
-
customEndpointName:
|
|
3759
|
-
id:
|
|
3760
|
-
lastViewed:
|
|
3761
|
-
linkedCustomEndpointId:
|
|
3762
|
-
linkedFlows:
|
|
3763
|
-
name:
|
|
3764
|
-
owner:
|
|
3869
|
+
var PostPurchaseWidget = import_zod42.z.object({
|
|
3870
|
+
classification: import_zod42.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
3871
|
+
createdAtTime: import_zod42.z.iso.datetime({ offset: true }).optional(),
|
|
3872
|
+
customEndpointName: import_zod42.z.string().nullish(),
|
|
3873
|
+
id: import_zod42.z.number().default(0),
|
|
3874
|
+
lastViewed: import_zod42.z.iso.datetime({ offset: true }).nullish(),
|
|
3875
|
+
linkedCustomEndpointId: import_zod42.z.number().nullish(),
|
|
3876
|
+
linkedFlows: import_zod42.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
3877
|
+
name: import_zod42.z.string().default(""),
|
|
3878
|
+
owner: import_zod42.z.number().nullish(),
|
|
3765
3879
|
settings: PostPurchaseSettings
|
|
3766
3880
|
});
|
|
3767
3881
|
|
|
3768
3882
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3769
|
-
var PostPurchaseOffer =
|
|
3770
|
-
|
|
3771
|
-
errors:
|
|
3772
|
-
message:
|
|
3773
|
-
successful:
|
|
3883
|
+
var PostPurchaseOffer = import_zod43.z.discriminatedUnion("successful", [
|
|
3884
|
+
import_zod43.z.strictObject({
|
|
3885
|
+
errors: import_zod43.z.array(import_zod43.z.object({ message: import_zod43.z.string() })),
|
|
3886
|
+
message: import_zod43.z.string(),
|
|
3887
|
+
successful: import_zod43.z.literal(false)
|
|
3774
3888
|
}),
|
|
3775
|
-
|
|
3776
|
-
successful:
|
|
3889
|
+
import_zod43.z.strictObject({
|
|
3890
|
+
successful: import_zod43.z.literal(true),
|
|
3777
3891
|
widget: PostPurchaseWidget
|
|
3778
3892
|
})
|
|
3779
3893
|
]);
|