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