@rebuy/rebuy 3.27.0 → 3.28.1
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 +383 -347
- package/dist/index.mjs +382 -346
- package/dist/schema/checkout-and-beyond/constants.cjs +5 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +5 -0
- package/dist/schema/checkout-and-beyond/index.cjs +104 -68
- package/dist/schema/checkout-and-beyond/index.mjs +104 -68
- package/dist/schema/widget-data.cjs +167 -135
- package/dist/schema/widget-data.mjs +167 -135
- package/dist/schema/widgetData.d.ts +24 -0
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +13 -1
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +17 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +2 -0
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/separator.d.ts +192 -0
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +2 -1
- package/dist/schema/widgets/contentBlock.d.ts +8 -0
- package/dist/schema/widgets/lineItemEditor.d.ts +8 -0
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts +2 -2
- package/dist/schema/widgets/rebuyButton.d.ts +8 -0
- package/dist/server/index.cjs +606 -188
- package/dist/server/index.mjs +606 -188
- package/dist/transforms/index.cjs +486 -59
- package/dist/transforms/index.d.ts +2 -0
- package/dist/transforms/index.mjs +486 -59
- package/dist/transforms/postPurchase/convertCalloutBlock.d.ts +8 -0
- package/dist/transforms/postPurchase/convertMessagePreview.d.ts +8 -0
- package/dist/transforms/postPurchase/convertPayButtonBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertSeparatorBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertTextBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertTimerBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/styledTextRun.d.ts +3 -0
- package/dist/transforms/postPurchase/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -48,6 +48,7 @@ __export(src_exports, {
|
|
|
48
48
|
CABImageSectionFields: () => CABImageSectionFields,
|
|
49
49
|
CABIntegrations: () => CABIntegrations,
|
|
50
50
|
CABLayoutSection: () => CABLayoutSection,
|
|
51
|
+
CABLayoutWrapping: () => CABLayoutWrapping,
|
|
51
52
|
CABMonetizeAds: () => CABMonetizeAds,
|
|
52
53
|
CABMonetizeSection: () => CABMonetizeSection,
|
|
53
54
|
CABNumberVariable: () => CABNumberVariable,
|
|
@@ -65,6 +66,7 @@ __export(src_exports, {
|
|
|
65
66
|
CABRuleset: () => CABRuleset,
|
|
66
67
|
CABRulesetEntry: () => CABRulesetEntry,
|
|
67
68
|
CABSection: () => CABSection,
|
|
69
|
+
CABSeparatorSection: () => CABSeparatorSection,
|
|
68
70
|
CABTextSection: () => CABTextSection,
|
|
69
71
|
CABTextTier: () => CABTextTier,
|
|
70
72
|
CABTextVariable: () => CABTextVariable,
|
|
@@ -116,6 +118,7 @@ __export(src_exports, {
|
|
|
116
118
|
ImageContentBlock: () => ImageContentBlock,
|
|
117
119
|
InlineTextSizeName: () => InlineTextSizeName,
|
|
118
120
|
LanguageKey: () => LanguageKey,
|
|
121
|
+
LayoutFrame: () => LayoutFrame,
|
|
119
122
|
LineItemEditor: () => LineItemEditor,
|
|
120
123
|
LineItemEditorSwitchLanguageV1: () => LineItemEditorSwitchLanguageV1,
|
|
121
124
|
LineItemEditorV1: () => LineItemEditorV1,
|
|
@@ -276,6 +279,7 @@ __export(src_exports, {
|
|
|
276
279
|
isTimerBlock: () => isTimerBlock,
|
|
277
280
|
isVariantsType: () => isVariantsType,
|
|
278
281
|
languageKeys: () => languageKeys,
|
|
282
|
+
layoutFrames: () => layoutFrames,
|
|
279
283
|
mutatorEvents: () => mutatorEvents,
|
|
280
284
|
objectFits: () => objectFits,
|
|
281
285
|
offersDirections: () => offersDirections,
|
|
@@ -1828,7 +1832,7 @@ var UserConfig = import_zod17.z.object({
|
|
|
1828
1832
|
});
|
|
1829
1833
|
|
|
1830
1834
|
// src/schema/widgetData.ts
|
|
1831
|
-
var
|
|
1835
|
+
var import_zod48 = require("zod");
|
|
1832
1836
|
|
|
1833
1837
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1834
1838
|
var import_zod18 = require("zod");
|
|
@@ -1946,6 +1950,8 @@ var languageKeys = [
|
|
|
1946
1950
|
"zh"
|
|
1947
1951
|
];
|
|
1948
1952
|
var LanguageKey = freezeEnum(languageKeys);
|
|
1953
|
+
var layoutFrames = ["callout", "offer-content"];
|
|
1954
|
+
var LayoutFrame = freezeEnum(layoutFrames);
|
|
1949
1955
|
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
1950
1956
|
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
1951
1957
|
var objectFits = ["cover", "contain"];
|
|
@@ -1990,6 +1996,7 @@ var sectionTypes = [
|
|
|
1990
1996
|
"progressBar",
|
|
1991
1997
|
"quantity",
|
|
1992
1998
|
"reviews",
|
|
1999
|
+
"separator",
|
|
1993
2000
|
"text",
|
|
1994
2001
|
"variants"
|
|
1995
2002
|
];
|
|
@@ -2099,17 +2106,17 @@ var CheckoutExtension = import_zod19.z.looseObject({
|
|
|
2099
2106
|
});
|
|
2100
2107
|
|
|
2101
2108
|
// src/schema/widgets/contentBlock.ts
|
|
2102
|
-
var
|
|
2109
|
+
var import_zod42 = require("zod");
|
|
2103
2110
|
|
|
2104
2111
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2105
|
-
var
|
|
2112
|
+
var import_zod41 = require("zod");
|
|
2106
2113
|
|
|
2107
2114
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2108
|
-
var
|
|
2109
|
-
var
|
|
2115
|
+
var import_uuid14 = require("uuid");
|
|
2116
|
+
var import_zod40 = require("zod");
|
|
2110
2117
|
|
|
2111
2118
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2112
|
-
var
|
|
2119
|
+
var import_zod39 = require("zod");
|
|
2113
2120
|
|
|
2114
2121
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
2115
2122
|
var import_zod20 = require("zod");
|
|
@@ -3234,35 +3241,53 @@ var CABReviewsSection = import_zod36.z.object({
|
|
|
3234
3241
|
name: import_zod36.z.string().optional(),
|
|
3235
3242
|
sectionId: import_zod36.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
3236
3243
|
sectionType: import_zod36.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
3237
|
-
size: import_zod36.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
3244
|
+
size: import_zod36.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
3245
|
+
/**
|
|
3246
|
+
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
3247
|
+
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
3248
|
+
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
3249
|
+
* the whole reviews section.
|
|
3250
|
+
*/
|
|
3251
|
+
strokeColor: import_zod36.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
3252
|
+
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
3253
|
+
strokeWidth: import_zod36.z.number().nonnegative().default(0)
|
|
3238
3254
|
});
|
|
3239
3255
|
|
|
3240
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
3241
|
-
var import_compat3 = require("es-toolkit/compat");
|
|
3256
|
+
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
3242
3257
|
var import_uuid12 = require("uuid");
|
|
3243
3258
|
var import_zod37 = require("zod");
|
|
3244
|
-
var
|
|
3259
|
+
var CABSeparatorSection = import_zod37.z.object({
|
|
3245
3260
|
...CABVariableFields,
|
|
3246
|
-
hideOutOfStockVariants: import_zod37.z.boolean().default(false),
|
|
3247
|
-
name: import_zod37.z.string().optional(),
|
|
3248
3261
|
sectionId: import_zod37.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
3249
|
-
sectionType: import_zod37.z.literal(SectionType.
|
|
3250
|
-
|
|
3251
|
-
|
|
3262
|
+
sectionType: import_zod37.z.literal(SectionType.separator).default(SectionType.separator)
|
|
3263
|
+
});
|
|
3264
|
+
|
|
3265
|
+
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
3266
|
+
var import_compat3 = require("es-toolkit/compat");
|
|
3267
|
+
var import_uuid13 = require("uuid");
|
|
3268
|
+
var import_zod38 = require("zod");
|
|
3269
|
+
var CABVariantsSection = import_zod38.z.object({
|
|
3270
|
+
...CABVariableFields,
|
|
3271
|
+
hideOutOfStockVariants: import_zod38.z.boolean().default(false),
|
|
3272
|
+
name: import_zod38.z.string().optional(),
|
|
3273
|
+
sectionId: import_zod38.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
3274
|
+
sectionType: import_zod38.z.literal(SectionType.variants).default(SectionType.variants),
|
|
3275
|
+
selector: import_zod38.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
3276
|
+
variantMode: import_zod38.z.enum(variantModes).default(VariantMode.multiple)
|
|
3252
3277
|
});
|
|
3253
3278
|
|
|
3254
3279
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3255
|
-
var CABBorder =
|
|
3256
|
-
radius:
|
|
3257
|
-
style:
|
|
3258
|
-
width:
|
|
3280
|
+
var CABBorder = import_zod39.z.object({
|
|
3281
|
+
radius: import_zod39.z.enum(borderRadii).default(BorderRadius.base),
|
|
3282
|
+
style: import_zod39.z.enum(borderStyles).default(BorderStyle.none),
|
|
3283
|
+
width: import_zod39.z.enum(borderWidths).default(BorderWidth.base)
|
|
3259
3284
|
}).default({
|
|
3260
3285
|
radius: BorderRadius.base,
|
|
3261
3286
|
style: BorderStyle.none,
|
|
3262
3287
|
width: BorderWidth.base
|
|
3263
3288
|
});
|
|
3264
|
-
var CABSection =
|
|
3265
|
-
() =>
|
|
3289
|
+
var CABSection = import_zod39.z.lazy(
|
|
3290
|
+
() => import_zod39.z.discriminatedUnion("sectionType", [
|
|
3266
3291
|
CABBannerSection,
|
|
3267
3292
|
CABButtonSection,
|
|
3268
3293
|
CABCarouselSection,
|
|
@@ -3278,38 +3303,49 @@ var CABSection = import_zod38.z.lazy(
|
|
|
3278
3303
|
CABProgressBarSection,
|
|
3279
3304
|
CABQuantitySection,
|
|
3280
3305
|
CABReviewsSection,
|
|
3306
|
+
CABSeparatorSection,
|
|
3281
3307
|
CABTextSection,
|
|
3282
3308
|
CABVariantsSection
|
|
3283
3309
|
])
|
|
3284
3310
|
);
|
|
3285
3311
|
|
|
3286
3312
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3287
|
-
var GridItem =
|
|
3288
|
-
var
|
|
3313
|
+
var GridItem = import_zod40.z.union([import_zod40.z.literal("auto"), import_zod40.z.literal("fill"), import_zod40.z.string().regex(/^\d+%$/), import_zod40.z.number()]);
|
|
3314
|
+
var CABLayoutWrapping = import_zod40.z.object({
|
|
3315
|
+
breakAt: import_zod40.z.number().positive(),
|
|
3316
|
+
maxPerLine: import_zod40.z.number().int().positive()
|
|
3317
|
+
});
|
|
3318
|
+
var CABLayoutSection = import_zod40.z.object({
|
|
3289
3319
|
...CABVariableFields,
|
|
3290
|
-
alignment:
|
|
3291
|
-
horizontal:
|
|
3292
|
-
vertical:
|
|
3320
|
+
alignment: import_zod40.z.object({
|
|
3321
|
+
horizontal: import_zod40.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
3322
|
+
vertical: import_zod40.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
3293
3323
|
}).default({
|
|
3294
3324
|
horizontal: HorizontalAlignment.start,
|
|
3295
3325
|
vertical: VerticalAlignment.top
|
|
3296
3326
|
}),
|
|
3297
|
-
border:
|
|
3298
|
-
buttonField:
|
|
3299
|
-
direction:
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3327
|
+
border: import_zod40.z.lazy(() => CABBorder),
|
|
3328
|
+
buttonField: import_zod40.z.enum(buttonFields).optional(),
|
|
3329
|
+
direction: import_zod40.z.enum(directions).default(Direction.rows),
|
|
3330
|
+
/**
|
|
3331
|
+
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
3332
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3333
|
+
*/
|
|
3334
|
+
frame: import_zod40.z.enum(layoutFrames).optional(),
|
|
3335
|
+
grid: import_zod40.z.object({
|
|
3336
|
+
columns: import_zod40.z.union([import_zod40.z.array(GridItem), import_zod40.z.undefined()]).default(() => ["auto"]),
|
|
3337
|
+
rows: import_zod40.z.union([import_zod40.z.array(GridItem), import_zod40.z.undefined()]).default(() => ["auto"])
|
|
3303
3338
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
3304
|
-
name:
|
|
3305
|
-
padding:
|
|
3306
|
-
sectionId:
|
|
3307
|
-
sections:
|
|
3308
|
-
sectionType:
|
|
3309
|
-
spacing:
|
|
3339
|
+
name: import_zod40.z.string().optional(),
|
|
3340
|
+
padding: import_zod40.z.enum(spacings).default(Spacing.none),
|
|
3341
|
+
sectionId: import_zod40.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
3342
|
+
sections: import_zod40.z.union([import_zod40.z.array(import_zod40.z.lazy(() => CABSection)), import_zod40.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3343
|
+
sectionType: import_zod40.z.literal(SectionType.layout).default(SectionType.layout),
|
|
3344
|
+
spacing: import_zod40.z.enum(spacings).default(Spacing.base),
|
|
3310
3345
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
3311
|
-
viewUrl:
|
|
3312
|
-
width:
|
|
3346
|
+
viewUrl: import_zod40.z.string().optional(),
|
|
3347
|
+
width: import_zod40.z.number().default(100),
|
|
3348
|
+
wrapping: CABLayoutWrapping.optional()
|
|
3313
3349
|
});
|
|
3314
3350
|
|
|
3315
3351
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -3330,8 +3366,8 @@ var UI_LABELS = {
|
|
|
3330
3366
|
};
|
|
3331
3367
|
|
|
3332
3368
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3333
|
-
var localized = (fallback) =>
|
|
3334
|
-
var CABUILabels =
|
|
3369
|
+
var localized = (fallback) => import_zod41.z.record(import_zod41.z.string(), import_zod41.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
3370
|
+
var CABUILabels = import_zod41.z.object({
|
|
3335
3371
|
currentPage: localized(UI_LABELS.currentPage),
|
|
3336
3372
|
guest: localized(UI_LABELS.guest),
|
|
3337
3373
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -3356,154 +3392,154 @@ var CABUILabels = import_zod40.z.object({
|
|
|
3356
3392
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
3357
3393
|
updating: { ...UI_LABELS.updating }
|
|
3358
3394
|
}));
|
|
3359
|
-
var TargetArea =
|
|
3360
|
-
fill:
|
|
3361
|
-
flip:
|
|
3362
|
-
icon:
|
|
3363
|
-
label:
|
|
3364
|
-
width:
|
|
3395
|
+
var TargetArea = import_zod41.z.object({
|
|
3396
|
+
fill: import_zod41.z.boolean().optional(),
|
|
3397
|
+
flip: import_zod41.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3398
|
+
icon: import_zod41.z.string(),
|
|
3399
|
+
label: import_zod41.z.string(),
|
|
3400
|
+
width: import_zod41.z.string()
|
|
3365
3401
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
3366
|
-
var CABTracking =
|
|
3367
|
-
enableAttribution:
|
|
3368
|
-
enableSource:
|
|
3369
|
-
enableWidget:
|
|
3402
|
+
var CABTracking = import_zod41.z.object({
|
|
3403
|
+
enableAttribution: import_zod41.z.boolean().nullish().transform((value) => value ?? true),
|
|
3404
|
+
enableSource: import_zod41.z.boolean().nullish().transform((value) => value ?? true),
|
|
3405
|
+
enableWidget: import_zod41.z.boolean().nullish().transform((value) => value ?? true)
|
|
3370
3406
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
3371
|
-
var CABExperiment =
|
|
3372
|
-
elementId:
|
|
3373
|
-
experimentId:
|
|
3374
|
-
experimentType:
|
|
3375
|
-
selectedId:
|
|
3407
|
+
var CABExperiment = import_zod41.z.object({
|
|
3408
|
+
elementId: import_zod41.z.number(),
|
|
3409
|
+
experimentId: import_zod41.z.number(),
|
|
3410
|
+
experimentType: import_zod41.z.string(),
|
|
3411
|
+
selectedId: import_zod41.z.number()
|
|
3376
3412
|
});
|
|
3377
3413
|
var CABRootSection = CABLayoutSection.extend({
|
|
3378
|
-
editorMode:
|
|
3414
|
+
editorMode: import_zod41.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
3379
3415
|
experiment: CABExperiment.optional(),
|
|
3380
3416
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
3381
3417
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
3382
|
-
previewMode:
|
|
3383
|
-
storeId:
|
|
3418
|
+
previewMode: import_zod41.z.boolean().nullish().transform((value) => value ?? false),
|
|
3419
|
+
storeId: import_zod41.z.number().nullable().default(null),
|
|
3384
3420
|
targetArea: TargetArea.nullable(),
|
|
3385
3421
|
tracking: CABTracking,
|
|
3386
|
-
type:
|
|
3422
|
+
type: import_zod41.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
3387
3423
|
uiLabels: CABUILabels,
|
|
3388
|
-
version:
|
|
3389
|
-
widgetId:
|
|
3424
|
+
version: import_zod41.z.literal(2).default(2),
|
|
3425
|
+
widgetId: import_zod41.z.number().nullable().default(null)
|
|
3390
3426
|
});
|
|
3391
3427
|
|
|
3392
3428
|
// src/schema/widgets/contentBlock.ts
|
|
3393
|
-
var ContentBlockV1 =
|
|
3394
|
-
blockSpacing:
|
|
3395
|
-
imageBlocks:
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
altText:
|
|
3399
|
-
description:
|
|
3400
|
-
id:
|
|
3401
|
-
imagePlacement:
|
|
3402
|
-
imageSize:
|
|
3403
|
-
imageUrl:
|
|
3404
|
-
textAlignment:
|
|
3429
|
+
var ContentBlockV1 = import_zod42.z.object({
|
|
3430
|
+
blockSpacing: import_zod42.z.enum(spacings).optional(),
|
|
3431
|
+
imageBlocks: import_zod42.z.union([
|
|
3432
|
+
import_zod42.z.array(
|
|
3433
|
+
import_zod42.z.object({
|
|
3434
|
+
altText: import_zod42.z.string().nullable(),
|
|
3435
|
+
description: import_zod42.z.string().nullable(),
|
|
3436
|
+
id: import_zod42.z.uuid(),
|
|
3437
|
+
imagePlacement: import_zod42.z.enum(["top", "right", "bottom", "left"]),
|
|
3438
|
+
imageSize: import_zod42.z.number(),
|
|
3439
|
+
imageUrl: import_zod42.z.url(),
|
|
3440
|
+
textAlignment: import_zod42.z.enum(["left", "center", "right"]),
|
|
3405
3441
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
3406
|
-
textSize:
|
|
3442
|
+
textSize: import_zod42.z.enum(inlineTextSizeNames)
|
|
3407
3443
|
})
|
|
3408
3444
|
),
|
|
3409
|
-
|
|
3445
|
+
import_zod42.z.strictObject({}).transform(() => [])
|
|
3410
3446
|
]).optional(),
|
|
3411
|
-
imageLayout:
|
|
3412
|
-
language:
|
|
3413
|
-
description:
|
|
3414
|
-
superTitle:
|
|
3415
|
-
title:
|
|
3447
|
+
imageLayout: import_zod42.z.enum(["row", "column"]).optional(),
|
|
3448
|
+
language: import_zod42.z.object({
|
|
3449
|
+
description: import_zod42.z.string(),
|
|
3450
|
+
superTitle: import_zod42.z.string(),
|
|
3451
|
+
title: import_zod42.z.string()
|
|
3416
3452
|
}),
|
|
3417
|
-
previewMode:
|
|
3418
|
-
type:
|
|
3419
|
-
version:
|
|
3453
|
+
previewMode: import_zod42.z.boolean(),
|
|
3454
|
+
type: import_zod42.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
3455
|
+
version: import_zod42.z.literal(1)
|
|
3420
3456
|
});
|
|
3421
|
-
var ContentBlock =
|
|
3457
|
+
var ContentBlock = import_zod42.z.discriminatedUnion("version", [
|
|
3422
3458
|
ContentBlockV1,
|
|
3423
3459
|
CABRootSection.extend({
|
|
3424
|
-
type:
|
|
3460
|
+
type: import_zod42.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
3425
3461
|
})
|
|
3426
3462
|
]);
|
|
3427
3463
|
|
|
3428
3464
|
// src/schema/widgets/giftWithPurchase.ts
|
|
3429
|
-
var
|
|
3430
|
-
var GiftWithPurchase =
|
|
3431
|
-
type:
|
|
3465
|
+
var import_zod43 = require("zod");
|
|
3466
|
+
var GiftWithPurchase = import_zod43.z.looseObject({
|
|
3467
|
+
type: import_zod43.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
3432
3468
|
});
|
|
3433
3469
|
|
|
3434
3470
|
// src/schema/widgets/lineItemEditor.ts
|
|
3435
|
-
var
|
|
3436
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
3437
|
-
downgradeToOneTimeLabel:
|
|
3471
|
+
var import_zod44 = require("zod");
|
|
3472
|
+
var LineItemEditorSwitchLanguageV1 = import_zod44.z.object({
|
|
3473
|
+
downgradeToOneTimeLabel: import_zod44.z.string().optional(),
|
|
3438
3474
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
3439
|
-
subscriptionOptionLabel:
|
|
3440
|
-
upgradeToSubscriptionLabel:
|
|
3441
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
3475
|
+
subscriptionOptionLabel: import_zod44.z.string().optional(),
|
|
3476
|
+
upgradeToSubscriptionLabel: import_zod44.z.string().optional(),
|
|
3477
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod44.z.string().optional()
|
|
3442
3478
|
});
|
|
3443
|
-
var LineItemEditorV1 =
|
|
3479
|
+
var LineItemEditorV1 = import_zod44.z.object({
|
|
3444
3480
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
3445
|
-
button:
|
|
3446
|
-
previewMode:
|
|
3447
|
-
switchToSubscription:
|
|
3448
|
-
disableDowngrade:
|
|
3481
|
+
button: import_zod44.z.object({ kind: import_zod44.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
3482
|
+
previewMode: import_zod44.z.boolean().optional(),
|
|
3483
|
+
switchToSubscription: import_zod44.z.object({
|
|
3484
|
+
disableDowngrade: import_zod44.z.boolean().optional(),
|
|
3449
3485
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
3450
3486
|
}).optional(),
|
|
3451
|
-
switchToSubscriptionEnabled:
|
|
3452
|
-
tracking:
|
|
3453
|
-
enableAttribution:
|
|
3454
|
-
enableSource:
|
|
3455
|
-
enableWidget:
|
|
3487
|
+
switchToSubscriptionEnabled: import_zod44.z.boolean().optional(),
|
|
3488
|
+
tracking: import_zod44.z.object({
|
|
3489
|
+
enableAttribution: import_zod44.z.boolean().optional(),
|
|
3490
|
+
enableSource: import_zod44.z.boolean().optional(),
|
|
3491
|
+
enableWidget: import_zod44.z.boolean().optional()
|
|
3456
3492
|
}).optional(),
|
|
3457
|
-
type:
|
|
3458
|
-
version:
|
|
3493
|
+
type: import_zod44.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
3494
|
+
version: import_zod44.z.literal(1)
|
|
3459
3495
|
});
|
|
3460
|
-
var LineItemEditor =
|
|
3496
|
+
var LineItemEditor = import_zod44.z.discriminatedUnion("version", [
|
|
3461
3497
|
LineItemEditorV1,
|
|
3462
3498
|
CABRootSection.extend({
|
|
3463
|
-
type:
|
|
3499
|
+
type: import_zod44.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
3464
3500
|
})
|
|
3465
3501
|
]);
|
|
3466
3502
|
|
|
3467
3503
|
// src/schema/widgets/progressBar.ts
|
|
3468
|
-
var
|
|
3469
|
-
var ProgressBar =
|
|
3470
|
-
type:
|
|
3504
|
+
var import_zod45 = require("zod");
|
|
3505
|
+
var ProgressBar = import_zod45.z.looseObject({
|
|
3506
|
+
type: import_zod45.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
3471
3507
|
});
|
|
3472
3508
|
|
|
3473
3509
|
// src/schema/widgets/rebuyButton.ts
|
|
3474
|
-
var
|
|
3475
|
-
var RebuyButtonV1 =
|
|
3476
|
-
type:
|
|
3477
|
-
version:
|
|
3510
|
+
var import_zod46 = require("zod");
|
|
3511
|
+
var RebuyButtonV1 = import_zod46.z.looseObject({
|
|
3512
|
+
type: import_zod46.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
3513
|
+
version: import_zod46.z.literal(1)
|
|
3478
3514
|
});
|
|
3479
|
-
var RebuyButton =
|
|
3515
|
+
var RebuyButton = import_zod46.z.discriminatedUnion("version", [
|
|
3480
3516
|
RebuyButtonV1,
|
|
3481
3517
|
CABRootSection.extend({
|
|
3482
|
-
type:
|
|
3518
|
+
type: import_zod46.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
3483
3519
|
})
|
|
3484
3520
|
]);
|
|
3485
3521
|
|
|
3486
3522
|
// src/schema/widgets/rebuyMonetize.ts
|
|
3487
|
-
var
|
|
3488
|
-
var RebuyMonetize =
|
|
3489
|
-
type:
|
|
3523
|
+
var import_zod47 = require("zod");
|
|
3524
|
+
var RebuyMonetize = import_zod47.z.looseObject({
|
|
3525
|
+
type: import_zod47.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
3490
3526
|
});
|
|
3491
|
-
var RebuyMonetizeV1 =
|
|
3492
|
-
name:
|
|
3493
|
-
previewMode:
|
|
3527
|
+
var RebuyMonetizeV1 = import_zod47.z.object({
|
|
3528
|
+
name: import_zod47.z.string().nullable().optional(),
|
|
3529
|
+
previewMode: import_zod47.z.boolean().optional(),
|
|
3494
3530
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
3495
|
-
privacyPolicyUrl:
|
|
3531
|
+
privacyPolicyUrl: import_zod47.z.string().nullable().optional(),
|
|
3496
3532
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
3497
|
-
subVertical:
|
|
3498
|
-
tracking:
|
|
3499
|
-
enableAttribution:
|
|
3500
|
-
enableSource:
|
|
3501
|
-
enableWidget:
|
|
3533
|
+
subVertical: import_zod47.z.string().nullable().optional(),
|
|
3534
|
+
tracking: import_zod47.z.object({
|
|
3535
|
+
enableAttribution: import_zod47.z.boolean().optional(),
|
|
3536
|
+
enableSource: import_zod47.z.boolean().optional(),
|
|
3537
|
+
enableWidget: import_zod47.z.boolean().optional()
|
|
3502
3538
|
}).optional(),
|
|
3503
|
-
type:
|
|
3504
|
-
version:
|
|
3539
|
+
type: import_zod47.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
3540
|
+
version: import_zod47.z.literal(1),
|
|
3505
3541
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
3506
|
-
vertical:
|
|
3542
|
+
vertical: import_zod47.z.string().nullable().optional()
|
|
3507
3543
|
});
|
|
3508
3544
|
|
|
3509
3545
|
// src/schema/widgetData.ts
|
|
@@ -3517,7 +3553,7 @@ var extensionWidgetTypes = [
|
|
|
3517
3553
|
WidgetType.ui_extension_line_item_editor,
|
|
3518
3554
|
WidgetType.ui_extension_progress_bar
|
|
3519
3555
|
];
|
|
3520
|
-
var WidgetData =
|
|
3556
|
+
var WidgetData = import_zod48.z.discriminatedUnion("type", [
|
|
3521
3557
|
ABTestingPlaceholder,
|
|
3522
3558
|
CheckoutExtension,
|
|
3523
3559
|
ContentBlock,
|
|
@@ -3878,15 +3914,15 @@ var SWITCH_LABELS = {
|
|
|
3878
3914
|
|
|
3879
3915
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
3880
3916
|
var import_compat4 = require("es-toolkit/compat");
|
|
3881
|
-
var
|
|
3882
|
-
var strictNumber =
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3917
|
+
var import_zod49 = require("zod");
|
|
3918
|
+
var strictNumber = import_zod49.z.union([
|
|
3919
|
+
import_zod49.z.number(),
|
|
3920
|
+
import_zod49.z.string().transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
3921
|
+
import_zod49.z.unknown().transform(() => 0)
|
|
3886
3922
|
]);
|
|
3887
3923
|
|
|
3888
3924
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
3889
|
-
var
|
|
3925
|
+
var import_zod50 = require("zod");
|
|
3890
3926
|
var blockTypes = [
|
|
3891
3927
|
"callout_banner",
|
|
3892
3928
|
"image",
|
|
@@ -3897,144 +3933,144 @@ var blockTypes = [
|
|
|
3897
3933
|
"text",
|
|
3898
3934
|
"timer"
|
|
3899
3935
|
];
|
|
3900
|
-
var blockType =
|
|
3936
|
+
var blockType = import_zod50.z.enum(blockTypes);
|
|
3901
3937
|
var BlockType = blockType.enum;
|
|
3902
3938
|
|
|
3903
3939
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
3904
3940
|
var import_compat5 = require("es-toolkit/compat");
|
|
3905
|
-
var
|
|
3906
|
-
var
|
|
3907
|
-
var TextAlignment2 =
|
|
3908
|
-
var TextSize =
|
|
3909
|
-
|
|
3910
|
-
|
|
3941
|
+
var import_uuid15 = require("uuid");
|
|
3942
|
+
var import_zod51 = require("zod");
|
|
3943
|
+
var TextAlignment2 = import_zod51.z.union([import_zod51.z.enum(["leading", "center", "trailing"]), import_zod51.z.unknown().transform(() => "leading")]);
|
|
3944
|
+
var TextSize = import_zod51.z.union([
|
|
3945
|
+
import_zod51.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
3946
|
+
import_zod51.z.unknown().transform(() => "medium")
|
|
3911
3947
|
]);
|
|
3912
|
-
var CalloutBannerBlock =
|
|
3913
|
-
id:
|
|
3914
|
-
name:
|
|
3915
|
-
settings:
|
|
3916
|
-
superTitle:
|
|
3917
|
-
title:
|
|
3948
|
+
var CalloutBannerBlock = import_zod51.z.object({
|
|
3949
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
3950
|
+
name: import_zod51.z.string().optional(),
|
|
3951
|
+
settings: import_zod51.z.object({
|
|
3952
|
+
superTitle: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
3953
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
3918
3954
|
}),
|
|
3919
|
-
styles:
|
|
3920
|
-
superTitleEmphasized:
|
|
3955
|
+
styles: import_zod51.z.object({
|
|
3956
|
+
superTitleEmphasized: import_zod51.z.boolean().default(false),
|
|
3921
3957
|
superTitleSize: TextSize.default("large"),
|
|
3922
3958
|
textAlignment: TextAlignment2.default("center"),
|
|
3923
|
-
titleEmphasized:
|
|
3959
|
+
titleEmphasized: import_zod51.z.boolean().default(true),
|
|
3924
3960
|
titleSize: TextSize.default("large")
|
|
3925
3961
|
}),
|
|
3926
|
-
type:
|
|
3962
|
+
type: import_zod51.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
3927
3963
|
});
|
|
3928
|
-
var ImageBlock =
|
|
3929
|
-
id:
|
|
3930
|
-
name:
|
|
3931
|
-
settings:
|
|
3932
|
-
|
|
3964
|
+
var ImageBlock = import_zod51.z.object({
|
|
3965
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
3966
|
+
name: import_zod51.z.string().optional(),
|
|
3967
|
+
settings: import_zod51.z.union([
|
|
3968
|
+
import_zod51.z.object({
|
|
3933
3969
|
/** This isn't used in the post-purchase offer widget */
|
|
3934
|
-
alt:
|
|
3935
|
-
image:
|
|
3936
|
-
imageSize:
|
|
3937
|
-
imageType:
|
|
3970
|
+
alt: import_zod51.z.string().optional().default(""),
|
|
3971
|
+
image: import_zod51.z.union([import_zod51.z.literal(""), import_zod51.z.url()]).default(""),
|
|
3972
|
+
imageSize: import_zod51.z.number().default(20),
|
|
3973
|
+
imageType: import_zod51.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
3938
3974
|
}),
|
|
3939
|
-
|
|
3975
|
+
import_zod51.z.array(import_zod51.z.never()).transform(() => ({}))
|
|
3940
3976
|
]),
|
|
3941
|
-
type:
|
|
3977
|
+
type: import_zod51.z.literal(BlockType.image).default(BlockType.image)
|
|
3942
3978
|
});
|
|
3943
|
-
var ImageContentBlock =
|
|
3944
|
-
id:
|
|
3945
|
-
name:
|
|
3946
|
-
settings:
|
|
3947
|
-
alt:
|
|
3948
|
-
description:
|
|
3979
|
+
var ImageContentBlock = import_zod51.z.object({
|
|
3980
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
3981
|
+
name: import_zod51.z.string().optional(),
|
|
3982
|
+
settings: import_zod51.z.object({
|
|
3983
|
+
alt: import_zod51.z.string().optional().default(""),
|
|
3984
|
+
description: import_zod51.z.union([import_zod51.z.string(), TiptapDocument, import_zod51.z.null()]).default(
|
|
3949
3985
|
"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."
|
|
3950
3986
|
),
|
|
3951
3987
|
descriptionSize: TextSize.default("medium"),
|
|
3952
3988
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3953
|
-
image:
|
|
3954
|
-
imagePlacement:
|
|
3955
|
-
imageSize:
|
|
3956
|
-
superTitle:
|
|
3989
|
+
image: import_zod51.z.union([import_zod51.z.literal(""), import_zod51.z.url()]).default(""),
|
|
3990
|
+
imagePlacement: import_zod51.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
3991
|
+
imageSize: import_zod51.z.number().default(20),
|
|
3992
|
+
superTitle: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
3957
3993
|
superTitleSize: TextSize.default("medium"),
|
|
3958
3994
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3959
|
-
swapContent:
|
|
3960
|
-
title:
|
|
3995
|
+
swapContent: import_zod51.z.boolean().optional().default(false),
|
|
3996
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
3961
3997
|
titleSize: TextSize.default("medium")
|
|
3962
3998
|
}),
|
|
3963
|
-
type:
|
|
3999
|
+
type: import_zod51.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
3964
4000
|
});
|
|
3965
|
-
var PayButtonBlock =
|
|
3966
|
-
id:
|
|
3967
|
-
name:
|
|
3968
|
-
settings:
|
|
3969
|
-
|
|
3970
|
-
label:
|
|
4001
|
+
var PayButtonBlock = import_zod51.z.object({
|
|
4002
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4003
|
+
name: import_zod51.z.string().optional(),
|
|
4004
|
+
settings: import_zod51.z.union([
|
|
4005
|
+
import_zod51.z.object({
|
|
4006
|
+
label: import_zod51.z.string().default("Pay Now")
|
|
3971
4007
|
}),
|
|
3972
|
-
|
|
4008
|
+
import_zod51.z.array(import_zod51.z.never()).transform(() => ({
|
|
3973
4009
|
label: "Pay Now"
|
|
3974
4010
|
}))
|
|
3975
4011
|
]),
|
|
3976
|
-
styles:
|
|
3977
|
-
|
|
3978
|
-
buttonWidth:
|
|
4012
|
+
styles: import_zod51.z.union([
|
|
4013
|
+
import_zod51.z.object({
|
|
4014
|
+
buttonWidth: import_zod51.z.number().min(10).max(100).default(50)
|
|
3979
4015
|
}),
|
|
3980
|
-
|
|
4016
|
+
import_zod51.z.array(import_zod51.z.never()).transform(() => ({
|
|
3981
4017
|
buttonWidth: 50
|
|
3982
4018
|
}))
|
|
3983
4019
|
]),
|
|
3984
|
-
type:
|
|
4020
|
+
type: import_zod51.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
3985
4021
|
});
|
|
3986
|
-
var ProductInformationBlock =
|
|
4022
|
+
var ProductInformationBlock = import_zod51.z.object({
|
|
3987
4023
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3988
|
-
hideProductImage:
|
|
3989
|
-
id:
|
|
3990
|
-
name:
|
|
3991
|
-
type:
|
|
4024
|
+
hideProductImage: import_zod51.z.boolean().optional().default(false),
|
|
4025
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4026
|
+
name: import_zod51.z.string().optional(),
|
|
4027
|
+
type: import_zod51.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
3992
4028
|
});
|
|
3993
|
-
var SeparatorBlock =
|
|
3994
|
-
id:
|
|
3995
|
-
name:
|
|
3996
|
-
type:
|
|
4029
|
+
var SeparatorBlock = import_zod51.z.object({
|
|
4030
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4031
|
+
name: import_zod51.z.string().optional(),
|
|
4032
|
+
type: import_zod51.z.literal(BlockType.separator).default(BlockType.separator)
|
|
3997
4033
|
});
|
|
3998
|
-
var TextBlock =
|
|
3999
|
-
id:
|
|
4000
|
-
name:
|
|
4001
|
-
settings:
|
|
4002
|
-
description:
|
|
4034
|
+
var TextBlock = import_zod51.z.object({
|
|
4035
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4036
|
+
name: import_zod51.z.string().optional(),
|
|
4037
|
+
settings: import_zod51.z.object({
|
|
4038
|
+
description: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).optional().default(
|
|
4003
4039
|
"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."
|
|
4004
4040
|
),
|
|
4005
4041
|
/** This isn't used in the post-purchase offer widget */
|
|
4006
4042
|
descriptionSize: TextSize.default("medium"),
|
|
4007
4043
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
4008
|
-
superTitle:
|
|
4044
|
+
superTitle: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default("Super Title"),
|
|
4009
4045
|
/** This isn't used in the post-purchase offer widget */
|
|
4010
4046
|
superTitleSize: TextSize.default("medium"),
|
|
4011
|
-
title:
|
|
4047
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
4012
4048
|
/** This isn't used in the post-purchase offer widget */
|
|
4013
4049
|
titleSize: TextSize.default("medium")
|
|
4014
4050
|
}),
|
|
4015
|
-
type:
|
|
4051
|
+
type: import_zod51.z.literal(BlockType.text).default(BlockType.text)
|
|
4016
4052
|
});
|
|
4017
|
-
var TimerBlock =
|
|
4018
|
-
id:
|
|
4019
|
-
name:
|
|
4020
|
-
settings:
|
|
4021
|
-
durationMinutes:
|
|
4022
|
-
durationSeconds:
|
|
4023
|
-
endOffer:
|
|
4024
|
-
title:
|
|
4053
|
+
var TimerBlock = import_zod51.z.object({
|
|
4054
|
+
id: import_zod51.z.string().optional().default(() => (0, import_uuid15.v4)()),
|
|
4055
|
+
name: import_zod51.z.string().optional(),
|
|
4056
|
+
settings: import_zod51.z.object({
|
|
4057
|
+
durationMinutes: import_zod51.z.number().min(0).default(10),
|
|
4058
|
+
durationSeconds: import_zod51.z.union([import_zod51.z.number().min(0), import_zod51.z.unknown().transform(() => 0)]).default(0),
|
|
4059
|
+
endOffer: import_zod51.z.boolean().default(true),
|
|
4060
|
+
title: import_zod51.z.union([import_zod51.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
4025
4061
|
}),
|
|
4026
|
-
styles:
|
|
4062
|
+
styles: import_zod51.z.object({
|
|
4027
4063
|
textAlignment: TextAlignment2.default("center"),
|
|
4028
|
-
timerBackgroundColor:
|
|
4029
|
-
timerEmphasized:
|
|
4064
|
+
timerBackgroundColor: import_zod51.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
4065
|
+
timerEmphasized: import_zod51.z.union([import_zod51.z.boolean(), import_zod51.z.unknown().transform(() => true)]).default(true),
|
|
4030
4066
|
timerSize: TextSize.default("medium"),
|
|
4031
|
-
timerWidth:
|
|
4032
|
-
titleEmphasized:
|
|
4067
|
+
timerWidth: import_zod51.z.number().min(10).max(100).optional().default(100),
|
|
4068
|
+
titleEmphasized: import_zod51.z.union([import_zod51.z.boolean(), import_zod51.z.unknown().transform(() => true)]).default(false),
|
|
4033
4069
|
titleSize: TextSize.default("medium")
|
|
4034
4070
|
}),
|
|
4035
|
-
type:
|
|
4071
|
+
type: import_zod51.z.literal(BlockType.timer).default(BlockType.timer)
|
|
4036
4072
|
});
|
|
4037
|
-
var PostPurchaseBlock =
|
|
4073
|
+
var PostPurchaseBlock = import_zod51.z.discriminatedUnion("type", [
|
|
4038
4074
|
CalloutBannerBlock,
|
|
4039
4075
|
ImageBlock,
|
|
4040
4076
|
ImageContentBlock,
|
|
@@ -4054,68 +4090,68 @@ var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)
|
|
|
4054
4090
|
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
4055
4091
|
|
|
4056
4092
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4057
|
-
var
|
|
4093
|
+
var import_zod54 = require("zod");
|
|
4058
4094
|
|
|
4059
4095
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
4060
|
-
var
|
|
4096
|
+
var import_zod53 = require("zod");
|
|
4061
4097
|
|
|
4062
4098
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
4063
|
-
var
|
|
4064
|
-
var PostPurchaseSettings =
|
|
4065
|
-
advance:
|
|
4066
|
-
blocks:
|
|
4099
|
+
var import_zod52 = require("zod");
|
|
4100
|
+
var PostPurchaseSettings = import_zod52.z.object({
|
|
4101
|
+
advance: import_zod52.z.object({ removePartialOrder: import_zod52.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
4102
|
+
blocks: import_zod52.z.union([import_zod52.z.array(PostPurchaseBlock), import_zod52.z.unknown().transform(() => [])]).default(() => [
|
|
4067
4103
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
4068
4104
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
4069
4105
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
4070
4106
|
]),
|
|
4071
|
-
columnLayout:
|
|
4072
|
-
discount:
|
|
4107
|
+
columnLayout: import_zod52.z.boolean().optional(),
|
|
4108
|
+
discount: import_zod52.z.object({
|
|
4073
4109
|
amount: strictNumber.default(30),
|
|
4074
|
-
shouldShowSavingText:
|
|
4075
|
-
type:
|
|
4110
|
+
shouldShowSavingText: import_zod52.z.boolean().optional().default(true),
|
|
4111
|
+
type: import_zod52.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
4076
4112
|
}),
|
|
4077
|
-
discountedFrom:
|
|
4078
|
-
endpoint:
|
|
4079
|
-
integrations:
|
|
4080
|
-
judgeme:
|
|
4081
|
-
junip:
|
|
4082
|
-
klaviyo:
|
|
4083
|
-
loox:
|
|
4084
|
-
okendo:
|
|
4085
|
-
opinew:
|
|
4086
|
-
reviewsio:
|
|
4087
|
-
stamped:
|
|
4088
|
-
yotpo:
|
|
4113
|
+
discountedFrom: import_zod52.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
4114
|
+
endpoint: import_zod52.z.string().optional(),
|
|
4115
|
+
integrations: import_zod52.z.object({
|
|
4116
|
+
judgeme: import_zod52.z.boolean().default(false),
|
|
4117
|
+
junip: import_zod52.z.boolean().optional().default(false),
|
|
4118
|
+
klaviyo: import_zod52.z.boolean().default(false),
|
|
4119
|
+
loox: import_zod52.z.boolean().default(false),
|
|
4120
|
+
okendo: import_zod52.z.boolean().default(false),
|
|
4121
|
+
opinew: import_zod52.z.boolean().optional().default(false),
|
|
4122
|
+
reviewsio: import_zod52.z.boolean().optional().default(false),
|
|
4123
|
+
stamped: import_zod52.z.boolean().default(false),
|
|
4124
|
+
yotpo: import_zod52.z.boolean().default(false)
|
|
4089
4125
|
}),
|
|
4090
|
-
key:
|
|
4091
|
-
language:
|
|
4092
|
-
description:
|
|
4093
|
-
descriptionEnabled:
|
|
4094
|
-
descriptionRte:
|
|
4095
|
-
content:
|
|
4096
|
-
type:
|
|
4126
|
+
key: import_zod52.z.string().optional(),
|
|
4127
|
+
language: import_zod52.z.object({
|
|
4128
|
+
description: import_zod52.z.union([import_zod52.z.string(), import_zod52.z.unknown().transform(() => "")]).default(""),
|
|
4129
|
+
descriptionEnabled: import_zod52.z.boolean().optional().default(false),
|
|
4130
|
+
descriptionRte: import_zod52.z.object({
|
|
4131
|
+
content: import_zod52.z.array(import_zod52.z.unknown()),
|
|
4132
|
+
type: import_zod52.z.string()
|
|
4097
4133
|
}).optional(),
|
|
4098
|
-
descriptionSpacing:
|
|
4099
|
-
displayCtaPrice:
|
|
4100
|
-
global:
|
|
4101
|
-
declineAll:
|
|
4102
|
-
declineThisOffer:
|
|
4103
|
-
free:
|
|
4104
|
-
notAvailable:
|
|
4105
|
-
payNow:
|
|
4106
|
-
payNowUpgradeToSubscription:
|
|
4107
|
-
quantity:
|
|
4134
|
+
descriptionSpacing: import_zod52.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
4135
|
+
displayCtaPrice: import_zod52.z.boolean().default(true),
|
|
4136
|
+
global: import_zod52.z.object({
|
|
4137
|
+
declineAll: import_zod52.z.string().optional().default("Decline All"),
|
|
4138
|
+
declineThisOffer: import_zod52.z.string().default("Decline this offer"),
|
|
4139
|
+
free: import_zod52.z.string().optional().default("Free"),
|
|
4140
|
+
notAvailable: import_zod52.z.string().optional().default("Not available"),
|
|
4141
|
+
payNow: import_zod52.z.string().default("Pay Now"),
|
|
4142
|
+
payNowUpgradeToSubscription: import_zod52.z.string().optional().default("Upgrade to Subscription"),
|
|
4143
|
+
quantity: import_zod52.z.string().default("Quantity"),
|
|
4108
4144
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4109
|
-
recurringShipping:
|
|
4110
|
-
recurringSubtotal:
|
|
4111
|
-
reviewsPlural:
|
|
4112
|
-
reviewsSingular:
|
|
4113
|
-
save:
|
|
4114
|
-
shipping:
|
|
4115
|
-
subscriptionOption:
|
|
4116
|
-
subtotal:
|
|
4117
|
-
taxes:
|
|
4118
|
-
total:
|
|
4145
|
+
recurringShipping: import_zod52.z.string().optional().default("Recurring shipping"),
|
|
4146
|
+
recurringSubtotal: import_zod52.z.string().default("Recurring subtotal"),
|
|
4147
|
+
reviewsPlural: import_zod52.z.string().optional().default("Reviews"),
|
|
4148
|
+
reviewsSingular: import_zod52.z.string().optional().default("Review"),
|
|
4149
|
+
save: import_zod52.z.union([import_zod52.z.string(), import_zod52.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
4150
|
+
shipping: import_zod52.z.string().default("Shipping"),
|
|
4151
|
+
subscriptionOption: import_zod52.z.string().optional().default("Subscribe and Save"),
|
|
4152
|
+
subtotal: import_zod52.z.string().default("Subtotal"),
|
|
4153
|
+
taxes: import_zod52.z.string().default("Taxes"),
|
|
4154
|
+
total: import_zod52.z.string().default("Total")
|
|
4119
4155
|
}).optional().default(() => ({
|
|
4120
4156
|
declineAll: "Decline All",
|
|
4121
4157
|
declineThisOffer: "Decline this offer",
|
|
@@ -4136,70 +4172,70 @@ var PostPurchaseSettings = import_zod51.z.object({
|
|
|
4136
4172
|
taxes: "Taxes",
|
|
4137
4173
|
total: "Total"
|
|
4138
4174
|
})),
|
|
4139
|
-
globalTranslation:
|
|
4175
|
+
globalTranslation: import_zod52.z.string().optional().default("english")
|
|
4140
4176
|
}),
|
|
4141
|
-
metafields:
|
|
4177
|
+
metafields: import_zod52.z.boolean().default(false),
|
|
4142
4178
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4143
|
-
offer:
|
|
4144
|
-
count:
|
|
4179
|
+
offer: import_zod52.z.object({
|
|
4180
|
+
count: import_zod52.z.number().default(1)
|
|
4145
4181
|
}),
|
|
4146
|
-
offersLayout:
|
|
4147
|
-
itemsPerPage:
|
|
4148
|
-
type:
|
|
4182
|
+
offersLayout: import_zod52.z.object({
|
|
4183
|
+
itemsPerPage: import_zod52.z.number().optional(),
|
|
4184
|
+
type: import_zod52.z.enum(["list", "grid", "carousel"]).default("list")
|
|
4149
4185
|
}).optional().default({
|
|
4150
4186
|
type: "list"
|
|
4151
4187
|
}),
|
|
4152
4188
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4153
|
-
previewMode:
|
|
4154
|
-
productLimit:
|
|
4155
|
-
productOptions:
|
|
4189
|
+
previewMode: import_zod52.z.boolean().default(false),
|
|
4190
|
+
productLimit: import_zod52.z.number().optional().default(1),
|
|
4191
|
+
productOptions: import_zod52.z.object({
|
|
4156
4192
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4157
|
-
hideOutOfStockVariants:
|
|
4158
|
-
matchVariant:
|
|
4159
|
-
showDeclineAll:
|
|
4160
|
-
showShipping:
|
|
4161
|
-
showSubtotal:
|
|
4162
|
-
showTaxes:
|
|
4163
|
-
showTotal:
|
|
4164
|
-
showVariantSelectors:
|
|
4165
|
-
variantSelectorDisplayMode:
|
|
4193
|
+
hideOutOfStockVariants: import_zod52.z.boolean().optional().default(false),
|
|
4194
|
+
matchVariant: import_zod52.z.boolean().optional().default(true),
|
|
4195
|
+
showDeclineAll: import_zod52.z.enum(["above", "below", "both", "none"]).optional(),
|
|
4196
|
+
showShipping: import_zod52.z.boolean().optional().default(true),
|
|
4197
|
+
showSubtotal: import_zod52.z.boolean().optional().default(true),
|
|
4198
|
+
showTaxes: import_zod52.z.boolean().optional().default(true),
|
|
4199
|
+
showTotal: import_zod52.z.boolean().optional().default(true),
|
|
4200
|
+
showVariantSelectors: import_zod52.z.boolean().optional().default(true),
|
|
4201
|
+
variantSelectorDisplayMode: import_zod52.z.enum(["separate", "single"]).optional().default("separate")
|
|
4166
4202
|
}),
|
|
4167
|
-
productType:
|
|
4168
|
-
productTypeSelector:
|
|
4169
|
-
quantityInputs:
|
|
4170
|
-
defaultQuantity:
|
|
4171
|
-
enabled:
|
|
4172
|
-
maxValue:
|
|
4173
|
-
minValue:
|
|
4203
|
+
productType: import_zod52.z.union([import_zod52.z.enum(["one-time", "subscription", "both"]), import_zod52.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
4204
|
+
productTypeSelector: import_zod52.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
4205
|
+
quantityInputs: import_zod52.z.object({
|
|
4206
|
+
defaultQuantity: import_zod52.z.union([import_zod52.z.number(), import_zod52.z.null().transform(() => 1)]).default(1),
|
|
4207
|
+
enabled: import_zod52.z.boolean().default(true),
|
|
4208
|
+
maxValue: import_zod52.z.union([import_zod52.z.number(), import_zod52.z.null().transform(() => 15)]).default(15),
|
|
4209
|
+
minValue: import_zod52.z.union([import_zod52.z.number().min(0), import_zod52.z.unknown().transform(() => 0)]).default(1)
|
|
4174
4210
|
}),
|
|
4175
|
-
shipping:
|
|
4211
|
+
shipping: import_zod52.z.object({
|
|
4176
4212
|
amount: strictNumber.default(10),
|
|
4177
4213
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4178
|
-
enabled:
|
|
4179
|
-
title:
|
|
4180
|
-
type:
|
|
4214
|
+
enabled: import_zod52.z.boolean().default(true),
|
|
4215
|
+
title: import_zod52.z.string().optional().default("Shipping Fees"),
|
|
4216
|
+
type: import_zod52.z.enum(["free", "fixed_amount"]).default("free")
|
|
4181
4217
|
}),
|
|
4182
|
-
styles:
|
|
4183
|
-
starColor:
|
|
4184
|
-
starSize:
|
|
4185
|
-
starStrokeColor:
|
|
4186
|
-
strokeWidth:
|
|
4218
|
+
styles: import_zod52.z.object({
|
|
4219
|
+
starColor: import_zod52.z.string().optional().default("#fadb14"),
|
|
4220
|
+
starSize: import_zod52.z.union([import_zod52.z.enum(["small", "medium", "large"]), import_zod52.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
4221
|
+
starStrokeColor: import_zod52.z.string().optional().default("#fadb14"),
|
|
4222
|
+
strokeWidth: import_zod52.z.string().optional().default("1")
|
|
4187
4223
|
}).optional(),
|
|
4188
|
-
subImages:
|
|
4189
|
-
subscription:
|
|
4190
|
-
discount:
|
|
4224
|
+
subImages: import_zod52.z.number().nullish().default(8),
|
|
4225
|
+
subscription: import_zod52.z.object({
|
|
4226
|
+
discount: import_zod52.z.object({
|
|
4191
4227
|
amount: strictNumber.default(30),
|
|
4192
|
-
shouldShowSavingText:
|
|
4193
|
-
type:
|
|
4228
|
+
shouldShowSavingText: import_zod52.z.boolean().optional().default(true),
|
|
4229
|
+
type: import_zod52.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
4194
4230
|
}),
|
|
4195
|
-
shipping:
|
|
4231
|
+
shipping: import_zod52.z.object({
|
|
4196
4232
|
amount: strictNumber.default(1),
|
|
4197
4233
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4198
|
-
enabled:
|
|
4234
|
+
enabled: import_zod52.z.boolean().default(true),
|
|
4199
4235
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4200
4236
|
recurringAmount: strictNumber.default(2),
|
|
4201
|
-
shippingTitle:
|
|
4202
|
-
type:
|
|
4237
|
+
shippingTitle: import_zod52.z.string().default("Shipping Fees"),
|
|
4238
|
+
type: import_zod52.z.enum(["free", "fixed_amount"]).default("free")
|
|
4203
4239
|
})
|
|
4204
4240
|
}).optional().default({
|
|
4205
4241
|
discount: {
|
|
@@ -4217,15 +4253,15 @@ var PostPurchaseSettings = import_zod51.z.object({
|
|
|
4217
4253
|
type: "free"
|
|
4218
4254
|
}
|
|
4219
4255
|
}),
|
|
4220
|
-
subscriptionIsDefault:
|
|
4256
|
+
subscriptionIsDefault: import_zod52.z.boolean().optional(),
|
|
4221
4257
|
/** This isn't configurable in the admin-nextjs editor */
|
|
4222
|
-
template:
|
|
4223
|
-
type:
|
|
4224
|
-
upgradeToSubscription:
|
|
4225
|
-
acceptButtonText:
|
|
4226
|
-
allow:
|
|
4227
|
-
emailRefundNotice:
|
|
4228
|
-
errorBannerText:
|
|
4258
|
+
template: import_zod52.z.string().optional().default(""),
|
|
4259
|
+
type: import_zod52.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
4260
|
+
upgradeToSubscription: import_zod52.z.object({
|
|
4261
|
+
acceptButtonText: import_zod52.z.string().optional().default("Upgrade"),
|
|
4262
|
+
allow: import_zod52.z.boolean().optional().default(false),
|
|
4263
|
+
emailRefundNotice: import_zod52.z.boolean().optional().default(false),
|
|
4264
|
+
errorBannerText: import_zod52.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
4229
4265
|
}).optional().default(() => ({
|
|
4230
4266
|
acceptButtonText: "Upgrade",
|
|
4231
4267
|
allow: false,
|
|
@@ -4235,32 +4271,32 @@ var PostPurchaseSettings = import_zod51.z.object({
|
|
|
4235
4271
|
});
|
|
4236
4272
|
|
|
4237
4273
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
4238
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
4239
|
-
id:
|
|
4240
|
-
name:
|
|
4274
|
+
var PostPurchaseWidgetLinkedFlow = import_zod53.z.object({
|
|
4275
|
+
id: import_zod53.z.number(),
|
|
4276
|
+
name: import_zod53.z.string()
|
|
4241
4277
|
});
|
|
4242
|
-
var PostPurchaseWidget =
|
|
4243
|
-
classification:
|
|
4244
|
-
createdAtTime:
|
|
4245
|
-
customEndpointName:
|
|
4246
|
-
id:
|
|
4247
|
-
lastViewed:
|
|
4248
|
-
linkedCustomEndpointId:
|
|
4249
|
-
linkedFlows:
|
|
4250
|
-
name:
|
|
4251
|
-
owner:
|
|
4278
|
+
var PostPurchaseWidget = import_zod53.z.object({
|
|
4279
|
+
classification: import_zod53.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
4280
|
+
createdAtTime: import_zod53.z.iso.datetime({ offset: true }).optional(),
|
|
4281
|
+
customEndpointName: import_zod53.z.string().nullish(),
|
|
4282
|
+
id: import_zod53.z.number().default(0),
|
|
4283
|
+
lastViewed: import_zod53.z.iso.datetime({ offset: true }).nullish(),
|
|
4284
|
+
linkedCustomEndpointId: import_zod53.z.number().nullish(),
|
|
4285
|
+
linkedFlows: import_zod53.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
4286
|
+
name: import_zod53.z.string().default(""),
|
|
4287
|
+
owner: import_zod53.z.number().nullish(),
|
|
4252
4288
|
settings: PostPurchaseSettings
|
|
4253
4289
|
});
|
|
4254
4290
|
|
|
4255
4291
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4256
|
-
var PostPurchaseOffer =
|
|
4257
|
-
|
|
4258
|
-
errors:
|
|
4259
|
-
message:
|
|
4260
|
-
successful:
|
|
4292
|
+
var PostPurchaseOffer = import_zod54.z.discriminatedUnion("successful", [
|
|
4293
|
+
import_zod54.z.strictObject({
|
|
4294
|
+
errors: import_zod54.z.array(import_zod54.z.object({ message: import_zod54.z.string() })),
|
|
4295
|
+
message: import_zod54.z.string(),
|
|
4296
|
+
successful: import_zod54.z.literal(false)
|
|
4261
4297
|
}),
|
|
4262
|
-
|
|
4263
|
-
successful:
|
|
4298
|
+
import_zod54.z.strictObject({
|
|
4299
|
+
successful: import_zod54.z.literal(true),
|
|
4264
4300
|
widget: PostPurchaseWidget
|
|
4265
4301
|
})
|
|
4266
4302
|
]);
|